1 dnl Template file for GNU Autoconf
2 dnl Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 dnl Process this file with autoconf to produce a configure script.
22 AC_INIT(src/version.c)
24 AC_CONFIG_HEADER(src/config.h)
27 dnl What version of Wget are we building?
29 VERSION=`sed -e 's/^.*"\(.*\)";$/\1/' ${srcdir}/src/version.c`
30 echo "configuring for GNU Wget $VERSION"
36 dnl Get cannonical host
39 AC_DEFINE_UNQUOTED(OS_TYPE, "$host_os")
45 [ --with-socks use the socks library],
46 [AC_DEFINE(HAVE_SOCKS)])
49 [ --disable-opie disable support for opie or s/key FTP login],
50 USE_OPIE=$enableval, USE_OPIE=yes)
51 test x"${USE_OPIE}" = xyes && AC_DEFINE(USE_OPIE)
54 [ --disable-digest disable support for HTTP digest authorization],
55 USE_DIGEST=$enableval, USE_DIGEST=yes)
56 test x"${USE_DIGEST}" = xyes && AC_DEFINE(USE_DIGEST)
59 [ --disable-debug disable support for debugging output],
60 DEBUG=$enableval, DEBUG=yes)
61 test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
63 case "${USE_OPIE}${USE_DIGEST}" in
67 if test x"$USE_OPIE" = xyes; then
74 dnl Whether make sets $(MAKE)...
79 dnl Find a good install
87 dnl We want these before the checks, so the checks can modify their values.
88 test -z "$CFLAGS" && CFLAGS= auto_cflags=1
89 test -z "$CC" && cc_specified=yes
94 dnl if the user hasn't specified CFLAGS, then
95 dnl if compiler is gcc, then use -O2 and some warning flags
96 dnl else use os-specific flags or -O
98 if test -n "$auto_cflags"; then
99 if test -n "$GCC"; then
100 CFLAGS="$CFLAGS -O2 -Wall -Wno-implicit"
103 *hpux*) CFLAGS="$CFLAGS +O3" ;;
104 *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000" ;;
105 *) CFLAGS="$CFLAGS -O" ;;
116 dnl In case of {cyg,gnu}win32. Should be a _target_ test.
117 dnl Might also be erelevant for DJGPP.
120 *win32) exeext='.exe';;
126 dnl Check if we can handle prototypes.
131 dnl Checks for typedefs, structures, and compiler characteristics.
136 dnl #### This generates a warning. What do I do to shut it up?
139 # Check size of long.
140 AC_CHECK_SIZEOF(long)
141 AC_CHECK_SIZEOF(long long)
144 dnl Checks for headers
146 AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h)
147 AC_CHECK_HEADERS(sys/select.h sys/utsname.h pwd.h signal.h)
151 dnl Return type of signal-handlers
156 dnl Check for struct utimbuf
160 dnl Checks for library functions.
163 AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp)
164 AC_CHECK_FUNCS(gettimeofday mktime strptime)
165 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
166 AC_CHECK_FUNCS(uname gethostname)
168 AC_CHECK_FUNCS(gethostbyname, [], [
169 AC_CHECK_LIB(nsl, gethostbyname)
173 dnl Checks for libraries.
176 AC_CHECK_LIB(socket, socket)
178 dnl #### This appears to be deficient with later versions of SOCKS.
179 if test "x${with_socks}" = xyes
181 AC_CHECK_LIB(resolv, main)
182 AC_CHECK_LIB(socks, Rconnect)
185 dnl Set of available languages.
187 dnl #### This kind of sucks. Shouldn't the configure process
188 dnl determine this automagically by scanning `.po' files in `po/'
190 ALL_LINGUAS="cs de hr it no pl pt_BR ru"
192 dnl internationalization macros
196 dnl Find makeinfo. If makeinfo is not found, look for Emacs. If
197 dnl Emacs cannot be found, look for XEmacs.
200 AC_CHECK_PROGS(MAKEINFO, makeinfo emacs xemacs)
202 case "${MAKEINFO}" in
203 *makeinfo) MAKEINFO="${MAKEINFO} \$(srcdir)/wget.texi" ;;
204 *emacs | *xemacs) MAKEINFO="${MAKEINFO} -batch -q -no-site-file -eval '(find-file \"\$(srcdir)/wget.texi\")' -l texinfmt -f texinfo-format-buffer -f save-buffer" ;;
205 *) MAKEINFO="makeinfo \$(srcdir)/wget.texi" ;;
211 AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in],
213 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])