File: configure.in

package info (click to toggle)
wput 0.6.2%2Bgit20130413-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,652 kB
  • sloc: ansic: 6,854; sh: 3,460; makefile: 72; sed: 16
file content (197 lines) | stat: -rw-r--r-- 5,618 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
AC_INIT(wput, 0.6.2)
AC_REVISION($Revision$)
AC_PREREQ(2.53)
CFLAGS="${CFLAGS} -Wall"
PACKAGE="wput"
VERSION="0.6.2"
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
GETOPT=""
MEMDBG=""
AC_ARG_ENABLE(memdbg,
 [  --enable-memdbg  enables memory debugging support [default=no]])
if test "$enable_memdbg" = "yes"; then
 CFLAGS="$CFLAGS -DMEMDBG"
 MEMDBG="memdbg.o"
 echo "------------------------"
 echo "Memory debugging enabled. Do not forget to 'make clean',"
 echo "before you recompile Wput."
 echo "------------------------"
fi

if test -x /usr/bin/getconf ; then
  echo -n "checking Large File System support: "
  LFS_CFLAGS=`/usr/bin/getconf LFS_CFLAGS`
  if test -n "$LFS_CFLAGS" ;then
    CFLAGS="$CFLAGS $LFS_CFLAGS"
    echo "yes"
  else
    echo "no"
  fi
fi

AC_ARG_WITH(ssl,
[[  --with-ssl              link with SSL support [default=auto]
  --without-ssl           disable SSL autodetection]])

AC_ARG_ENABLE(g_switch,
 [  --disable-g-switch  uses the -g switch for compiling [default=yes]])
if test "$enable_g_switch" != "no"; then
 echo "Debug Information enabled"
 CFLAGS="$CFLAGS  -g"
fi
AC_PROG_CC
AC_CHECK_HEADERS([sys/ioctl.h], AC_DEFINE([HAVE_IOCTL], [], [Define if sys/ioctl.h is available]))
AC_CHECK_HEADERS([sys/termio.h], AC_DEFINE([HAVE_SYSTERMIO], [], [Define is sys/termio.h is available]))
AC_CHECK_HEADERS([termio.h], AC_DEFINE([HAVE_TERMIO], [], [Define if termio.h is available]))
AC_CHECK_HEADERS([sys/winsize.h], AC_DEFINE([HAVE_WINSIZE], [], [Define if sys/winsize.h is available]))
AC_CHECK_HEADERS([locale.h], AC_DEFINE([HAVE_LOCALE_H], [], [Define if locale.h is available]))
AC_CHECK_HEADERS([libintl.h], AC_DEFINE([HAVE_LIBINTL_H], [], [Define if libintl.h is available]))
AC_CHECK_HEADERS(getopt.h, [
 AC_SEARCH_LIBS(getopt_long, gnugetopt, [],
     [AC_MSG_ERROR("You need to get libgnugetopt or a newer GNU libc.")]
     )
 ],
    [AC_CHECK_HEADERS(gnugetopt/getopt.h, [
     AC_SEARCH_LIBS(getopt_long, gnugetopt, [],
     [AC_MSG_ERROR("You need to get libgnugetopt or a newer GNU libc.")]
     )
 ],
    [GETOPT="getopt/getopt.o getopt/getopt1.o"]
    )]
)

AM_GNU_GETTEXT_VERSION([0.12.1])
AM_GNU_GETTEXT([external])

dnl $with_ssl can be one of:
dnl  - empty string or "auto", meaning autodetect SSL and use it if found.
dnl  - "yes", meaning link with SSL or bail out.
dnl  - "no", meaning don't link with SSL.
dnl  - anything else, meaning use that as the SSL root, and bail out
dnl    if it fails.

if test x"$with_ssl" = x; then
  dnl Canonicalize unspecified with-ssl setting to "auto".  This
  dnl implements the "auto-detect by default" feature.  If you want to
  dnl change this to "ignore SSL by default", change "auto" to "no".
  with_ssl=auto
fi
dnl #
dnl # Check for GNUTLS if it's specified.
dnl #
if test "x$with_ssl" != "xno"; then
	with_ssl="no"
	prefix=`eval echo $prefix`

	AC_ARG_WITH(gnutls-includes,
		[  --with-gnutls-includes=PREFIX   Location of GNUTLS includes.],
		[ with_gnutls_includes="$withval" ],
		[ with_gnutls_includes="$prefix/include" ])

	have_gnutls_includes="no"

	if test "x$with_gnutls_includes" != "xno"; then
		CPPFLAGS_save="$CPPFLAGS"

		AC_MSG_CHECKING(for GNUTLS includes)
		AC_MSG_RESULT("")

		CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes"
		AC_CHECK_HEADERS([gnutls/gnutls.h, gnutls/openssl.h], [ gnutls_includes="yes" ])
		CPPFLAGS="$CPPFLAGS_save"

		if test "x$gnutls_includes" != "xno" -a \
		        "x$gnutls_includes" != "x"; then
			have_gnutls_includes="yes"

			GNUTLS_CFLAGS="-I$with_gnutls_includes"
		else
			GNUTLS_CFLAGS=""
		fi
	else
		AC_MSG_CHECKING(for GNUTLS includes)
		AC_MSG_RESULT(no)
	fi

	AC_ARG_WITH(gnutls-libs,
		[  --with-gnutls-libs=PREFIX       Location of GNUTLS libraries.],
		[ with_gnutls_libs="$withval" ])

	if test "x$with_gnutls_libs"     != "xno" -a \
	        "x$have_gnutls_includes" != "xno"; then

		LDFLAGS_save="$LDFLAGS"

		case $with_gnutls_libs in
			""|-L*) ;;
			*) with_gnutls_libs="-L$with_gnutls_libs" ;;
		esac

		AC_CACHE_CHECK([for GNUTLS libraries], ac_cv_gnutls_libs,
		[
			LIBS_save="$LIBS"
			LIBS="$LIBS $with_gnutls_libs -lgnutls -lgnutls-openssl"
			AC_TRY_LINK_FUNC(gnutls_init, gnutls_libs="yes", gnutls_libs="no")
			LIBS="$LIBS_save"
			LDFLAGS="$LDFLAGS_save"
		])

		if test "x$gnutls_libs" != "xno"; then
			AC_DEFINE([HAVE_GNUTLS], [1], [Define if you have GNUTLS])
			AC_DEFINE([HAVE_SSL], [], [Define if SSL is available])
			msg_gnutls="GNUTLS"
			GNUTLS_LIBS="$with_gnutls_libs -lgnutls-openssl"

			with_ssl="yes"
		else
			GNUTLS_CFLAGS=""
			GNUTLS_LIBS=""
		fi
	else
		AC_MSG_CHECKING(for GNUTLS libraries)
		AC_MSG_RESULT(no)
	fi
else
	GNUTLS_CFLAGS=""
	GNUTLS_LIBS=""
fi

AC_CHECK_TYPES([long long, unsigned long long], AC_DEFINE([HAVE_LONG_LONG]))
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(short)
host_os=`uname`
case "$host_os" in
mpeix*)    LIBS="-lsocket $LIBS";;
sco3.2v5*) if test "$GCC" != "yes"; then
             CFLAGS="$CFLAGS"
           LD='$(CC) $(CFLAGS)'
      LIBS="-lsocket $LIBS"
    else
      CC="gcc"
      LIBS="-lsocket -lnsl $LIBS"
      CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS"
    fi
  ;;
sysv5uw7*) LIBS="-lsocket $LIBS"
    if test "$GCC" != "yes"; then
      # We are using built-in inline function
      CC="cc -belf"
      CXX="CC -belf"
    fi
    LIBS="-lsocket $LIBS"
  ;;
sco*)    CC=${CC-"cc -belf"}
    LIBS="-lsocket $LIBS";;
SCO*)      CC=${CC-"cc -belf"}
           LIBS="-lsocket $LIBS";;
Haiku*)    LIBS="-lnetwork $LIBS";;
esac
AC_CONFIG_HEADER(src/config.h)
AC_SUBST(GETOPT)
AC_SUBST(MEMDBG)
AC_SUBST(GNUTLS_CFLAGS)
AC_SUBST(GNUTLS_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in])

AC_OUTPUT