]> sjero.net Git - wget/blob - configure.in
71c0029fa39a732b5837fac9828fd41bd34facf8
[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_WITH(ssl,
49 [  --with-ssl              use the openssl library])
50
51 AC_ARG_ENABLE(opie,
52 [  --disable-opie          disable support for opie or s/key FTP login],
53 USE_OPIE=$enableval, USE_OPIE=yes)
54 test x"${USE_OPIE}" = xyes && AC_DEFINE(USE_OPIE)
55
56 AC_ARG_ENABLE(digest,
57 [  --disable-digest        disable support for HTTP digest authorization],
58 USE_DIGEST=$enableval, USE_DIGEST=yes)
59 test x"${USE_DIGEST}" = xyes && AC_DEFINE(USE_DIGEST)
60
61 AC_ARG_ENABLE(debug,
62 [  --disable-debug         disable support for debugging output],
63 DEBUG=$enableval, DEBUG=yes)
64 test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
65
66 case "${USE_OPIE}${USE_DIGEST}" in
67 *yes*)
68         MD5_OBJ='md5$o'
69 esac
70 if test x"$USE_OPIE" = xyes; then
71   OPIE_OBJ='ftp-opie$o'
72 fi
73 AC_SUBST(MD5_OBJ)
74 AC_SUBST(OPIE_OBJ)
75
76 dnl
77 dnl Whether make sets $(MAKE)...
78 dnl
79 AC_PROG_MAKE_SET
80
81 dnl
82 dnl Find a good install
83 dnl
84 AC_PROG_INSTALL
85
86 dnl
87 dnl Find the compiler
88 dnl
89
90 dnl We want these before the checks, so the checks can modify their values.
91 test -z "$CFLAGS"  && CFLAGS= auto_cflags=1
92 test -z "$CC" && cc_specified=yes
93
94 AC_PROG_CC
95
96 dnl
97 dnl if the user hasn't specified CFLAGS, then
98 dnl   if compiler is gcc, then use -O2 and some warning flags
99 dnl   else use os-specific flags or -O
100 dnl
101 if test -n "$auto_cflags"; then
102   if test -n "$GCC"; then
103     CFLAGS="$CFLAGS -O2 -Wall -Wno-implicit"
104   else
105     case "$host_os" in
106       *hpux*)  CFLAGS="$CFLAGS +O3"                      ;;
107       *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000" ;;
108       *)       CFLAGS="$CFLAGS -O" ;;
109     esac
110   fi
111 fi
112
113 dnl
114 dnl Handle AIX
115 dnl
116 AC_AIX
117
118 dnl
119 dnl In case of {cyg,gnu}win32.  Should be a _target_ test.
120 dnl Might also be erelevant for DJGPP.
121 dnl
122 case "$host_os" in
123   *win32) exeext='.exe';;
124   *) exeext='';;
125 esac
126 AC_SUBST(exeext)
127
128 dnl
129 dnl Check if we can handle prototypes.
130 dnl
131 AM_C_PROTOTYPES
132
133 dnl
134 dnl Checks for typedefs, structures, and compiler characteristics.
135 dnl
136 AC_C_CONST
137 AC_TYPE_SIZE_T
138 AC_TYPE_PID_T
139 dnl #### This generates a warning.  What do I do to shut it up?
140 AC_C_BIGENDIAN
141
142 # Check size of long.
143 AC_CHECK_SIZEOF(long)
144 AC_CHECK_SIZEOF(long long)
145
146 dnl
147 dnl Checks for headers
148 dnl
149 AC_CHECK_HEADERS(string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h)
150 AC_CHECK_HEADERS(sys/select.h sys/utsname.h pwd.h signal.h)
151 AC_HEADER_TIME
152
153 dnl
154 dnl Return type of signal-handlers
155 dnl
156 AC_TYPE_SIGNAL
157
158 dnl
159 dnl Check for struct utimbuf
160 WGET_STRUCT_UTIMBUF
161
162 dnl
163 dnl Checks for library functions.
164 dnl
165 AC_FUNC_ALLOCA
166 AC_FUNC_MMAP
167 AC_CHECK_FUNCS(strdup strstr strcasecmp strncasecmp)
168 AC_CHECK_FUNCS(gettimeofday mktime strptime)
169 AC_CHECK_FUNCS(strerror snprintf vsnprintf select signal symlink access isatty)
170 AC_CHECK_FUNCS(uname gethostname)
171
172 AC_CHECK_FUNCS(gethostbyname, [], [
173   AC_CHECK_LIB(nsl, gethostbyname)
174 ])
175
176 dnl
177 dnl Checks for libraries.
178 dnl
179
180 AC_CHECK_LIB(socket, socket)
181
182 dnl #### This appears to be deficient with later versions of SOCKS.
183 if test "x${with_socks}" = xyes
184 then
185   AC_CHECK_LIB(resolv, main)
186   AC_CHECK_LIB(socks, Rconnect)
187 fi
188
189 dnl check for ssl libraries
190 if test "x${with_ssl}" = xyes
191 then
192   ssl_lose=no
193   AC_CHECK_LIB(ssl,SSL_new,,ssl_lose=yes,-lcrypto)
194   AC_CHECK_LIB(crypto,main,,ssl_lose=yes)
195   if test "$ssl_lose" = no
196   then
197     AC_DEFINE(HAVE_SSL)
198     SSL_OBJ='gen_sslfunc$o'
199     AC_SUBST(SSL_OBJ)
200   fi
201 fi
202
203 dnl
204 dnl Set of available languages.
205 dnl
206 ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//')`
207
208 dnl Original from autoconf, I think.
209 dnl ALL_LINGUAS="cs de hr it no pl pt_BR ru"
210
211 dnl internationalization macros
212 WGET_WITH_NLS
213
214 dnl
215 dnl Find makeinfo.  If makeinfo is not found, look for Emacs.  If
216 dnl Emacs cannot be found, look for XEmacs.
217 dnl
218
219 AC_CHECK_PROGS(MAKEINFO, makeinfo emacs xemacs)
220
221 case "${MAKEINFO}" in
222    *makeinfo) MAKEINFO="${MAKEINFO} \$(srcdir)/wget.texi"  ;;
223    *emacs | *xemacs) MAKEINFO="${MAKEINFO} -batch -q -no-site-file -eval '(find-file \"\$(srcdir)/wget.texi\")' -l texinfmt -f texinfo-format-buffer -f save-buffer"  ;;
224    *) MAKEINFO="makeinfo \$(srcdir)/wget.texi"            ;;
225 esac
226
227 dnl
228 dnl Find perl and pod2man
229 dnl
230
231 AC_PATH_PROGS(PERL, perl5 perl, no)
232 AC_PATH_PROG(POD2MAN, pod2man, no)
233
234 if test "x${POD2MAN}" = xno; then
235   COMMENT_IF_NO_POD2MAN="# "
236 else
237   COMMENT_IF_NO_POD2MAN=
238 fi
239 AC_SUBST(COMMENT_IF_NO_POD2MAN)
240
241 dnl
242 dnl Create output
243 dnl
244 AC_OUTPUT([Makefile src/Makefile doc/Makefile util/Makefile po/Makefile.in
245            windows/Makefile],
246 [WGET_PROCESS_PO
247 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])