]> sjero.net Git - wget/blob - configure.in
[svn] Initial revision
[wget] / configure.in
1 dnl Template file for GNU Autoconf
2 dnl Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
3
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.
8
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.
13
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.
17
18 dnl
19 dnl Process this file with autoconf to produce a configure script.
20 dnl
21
22 AC_INIT(src/version.c)
23 AC_PREREQ(2.12)
24 AC_CONFIG_HEADER(src/config.h)
25
26 dnl
27 dnl What version of Wget are we building?
28 dnl
29 VERSION=`sed -e 's/^.*"\(.*\)";$/\1/' ${srcdir}/src/version.c`
30 echo "configuring for GNU Wget $VERSION"
31 AC_SUBST(VERSION)
32 PACKAGE=wget
33 AC_SUBST(PACKAGE)
34
35 dnl
36 dnl Get cannonical host
37 dnl
38 AC_CANONICAL_HOST
39 AC_DEFINE_UNQUOTED(OS_TYPE, "$host_os")
40
41 dnl
42 dnl Process features.
43 dnl
44 AC_ARG_WITH(socks,
45 [  --with-socks            use the socks library],
46 [AC_DEFINE(HAVE_SOCKS)])
47
48 AC_ARG_ENABLE(opie,
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)
52
53 AC_ARG_ENABLE(digest,
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)
57
58 AC_ARG_ENABLE(debug,
59 [  --disable-debug         disable support for debugging output],
60 DEBUG=$enableval, DEBUG=yes)
61 test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
62
63 case "${USE_OPIE}${USE_DIGEST}" in
64 *yes*)
65         MD5_OBJ='md5$o'
66 esac
67 if test x"$USE_OPIE" = xyes; then
68   OPIE_OBJ='ftp-opie$o'
69 fi
70 AC_SUBST(MD5_OBJ)
71 AC_SUBST(OPIE_OBJ)
72
73 dnl
74 dnl Whether make sets $(MAKE)...
75 dnl
76 AC_PROG_MAKE_SET
77
78 dnl
79 dnl Find a good install
80 dnl
81 AC_PROG_INSTALL
82
83 dnl
84 dnl Find the compiler
85 dnl
86
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
90
91 AC_PROG_CC
92
93 dnl
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
97 dnl
98 if test -n "$auto_cflags"; then
99   if test -n "$GCC"; then
100     CFLAGS="$CFLAGS -O2 -Wall -Wno-implicit"
101   else
102     case "$host_os" in
103       *hpux*)  CFLAGS="$CFLAGS +O3"                      ;;
104       *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000" ;;
105       *)       CFLAGS="$CFLAGS -O" ;;
106     esac
107   fi
108 fi
109
110 dnl
111 dnl Handle AIX
112 dnl
113 AC_AIX
114
115 dnl
116 dnl In case of {cyg,gnu}win32.  Should be a _target_ test.
117 dnl Might also be erelevant for DJGPP.
118 dnl
119 case "$host_os" in
120   *win32) exeext='.exe';;
121   *) exeext='';;
122 esac
123 AC_SUBST(exeext)
124
125 dnl
126 dnl Check if we can handle prototypes.
127 dnl
128 AM_C_PROTOTYPES
129
130 dnl
131 dnl Checks for typedefs, structures, and compiler characteristics.
132 dnl
133 AC_C_CONST
134 AC_TYPE_SIZE_T
135 AC_TYPE_PID_T
136 dnl #### This generates a warning.  What do I do to shut it up?
137 AC_C_BIGENDIAN
138
139 dnl
140 dnl Checks for headers
141 dnl
142 AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h)
143 AC_CHECK_HEADERS(sys/select.h sys/utsname.h pwd.h signal.h)
144 AC_HEADER_TIME
145
146 dnl
147 dnl Return type of signal-handlers
148 dnl
149 AC_TYPE_SIGNAL
150
151 dnl
152 dnl Check for struct utimbuf
153 WGET_STRUCT_UTIMBUF
154
155 dnl
156 dnl Checks for library functions.
157 dnl
158 AC_FUNC_ALLOCA
159 AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp)
160 AC_CHECK_FUNCS(gettimeofday mktime strptime)
161 AC_CHECK_FUNCS(strerror vsnprintf select signal symlink access isatty)
162 AC_CHECK_FUNCS(uname gethostname)
163
164 AC_CHECK_FUNCS(gethostbyname, [], [
165   AC_CHECK_LIB(nsl, gethostbyname)
166 ])
167
168 dnl
169 dnl Checks for libraries.
170 dnl
171
172 AC_CHECK_LIB(socket, socket)
173
174 dnl #### This appears to be deficient with later versions of SOCKS.
175 if test "x${with_socks}" = xyes
176 then
177   AC_CHECK_LIB(resolv, main)
178   AC_CHECK_LIB(socks, Rconnect)
179 fi
180
181 dnl Set of available languages.
182 dnl
183 dnl #### This kind of sucks.  Shouldn't the configure process
184 dnl determine this automagically by scanning `.po' files in `po/'
185 dnl subdirectory?
186 ALL_LINGUAS="cs de hr no it pt_BR"
187
188 dnl internationalization macros
189 WGET_WITH_NLS
190
191 dnl
192 dnl Find makeinfo.  If makeinfo is not found, look for Emacs.  If
193 dnl Emacs cannot be found, look for XEmacs.
194 dnl
195
196 AC_CHECK_PROGS(MAKEINFO, makeinfo emacs xemacs)
197
198 case "${MAKEINFO}" in
199    *makeinfo) MAKEINFO="${MAKEINFO} \$(srcdir)/wget.texi"  ;;
200    *emacs | *xemacs) MAKEINFO="${MAKEINFO} -batch -q -no-site-file -eval '(find-file \"\$(srcdir)/wget.texi\")' -l texinfmt -f texinfo-format-buffer -f save-buffer"  ;;
201    *) MAKEINFO="makeinfo \$(srcdir)/wget.texi"            ;;
202 esac
203
204 dnl
205 dnl Create output
206 dnl
207 AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in],
208 [WGET_PROCESS_PO
209 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])