comparison configure.in @ 4:fe6bca95afa7

Makefile.in contains updated files required
author Matt Johnston <matt@ucc.asn.au>
date Tue, 01 Jun 2004 02:46:09 +0000
parents
children 45ee5ffd6ea0
comparison
equal deleted inserted replaced
-1:000000000000 4:fe6bca95afa7
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # This Autoconf file was cobbled from various locations.
5
6 AC_PREREQ(2.50)
7 AC_INIT(buffer.c)
8
9 OLDCFLAGS=$CFLAGS
10 # Checks for programs.
11 AC_PROG_CC
12 AC_PROG_MAKE_SET
13
14 if test -z "$LD" ; then
15 LD=$CC
16 fi
17 AC_SUBST(LD)
18
19 if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then
20 AC_MSG_RESULT(No \$CFLAGS set... using "-Os -W -Wall for GCC")
21 CFLAGS="-Os -W -Wall"
22 fi
23
24 # Host specific options
25 # this isn't a definitive list of hosts, they are just added as required
26 AC_CANONICAL_HOST
27
28 case "$host" in
29
30 *-*-linux*)
31 no_ptmx_check=1
32 ;;
33
34 *-*-solaris*)
35 CFLAGS="$CFLAGS -I/usr/local/include"
36 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
37 conf_lastlog_location="/var/adm/lastlog"
38 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
39 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
40 if test "$sol2ver" -ge 8; then
41 AC_MSG_RESULT(yes)
42 AC_DEFINE(DISABLE_UTMP,,Disable utmp)
43 AC_DEFINE(DISABLE_WTMP,,Disable wtmp)
44 else
45 AC_MSG_RESULT(no)
46 fi
47 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
48 AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl")
49 ;;
50
51 *-*-aix*)
52 AC_DEFINE(AIX,,Using AIX)
53 ;;
54
55 *-*-hpux*)
56 LIBS="$LIBS -lsec"
57 ;;
58 esac
59
60 AC_CHECK_TOOL(AR, ar, :)
61 AC_CHECK_TOOL(RANLIB, ranlib, :)
62 AC_CHECK_TOOL(STRIP, strip, :)
63 AC_CHECK_TOOL(INSTALL, install, :)
64
65 dnl Can't use login() or logout() with uclibc
66 AC_CHECK_DECL(__UCLIBC__,
67 [
68 no_loginfunc_check=1
69 AC_MSG_RESULT(Using uClibc - login() and logout() probably don't work, so we won't use them.)
70 ],,,)
71
72 # Checks for libraries.
73 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
74
75 # Check if zlib is needed
76 AC_ARG_WITH(zlib,
77 [ --with-zlib=PATH Use zlib in PATH],
78 [
79 # option is given
80 if test -d "$withval/lib"; then
81 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
82 else
83 LDFLAGS="-L${withval} ${LDFLAGS}"
84 fi
85 if test -d "$withval/include"; then
86 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
87 else
88 CPPFLAGS="-I${withval} ${CPPFLAGS}"
89 fi
90 ]
91 )
92
93 AC_ARG_ENABLE(zlib,
94 [ --disable-zlib Don't include zlib support],
95 [
96 if test "x$enableval" = "xno"; then
97 AC_DEFINE(DISABLE_ZLIB,, Use zlib)
98 AC_MSG_RESULT(Disabling zlib)
99 else
100 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
101 AC_MSG_RESULT(Enabling zlib)
102 fi
103 ],
104 [
105 # if not disabled, check for zlib
106 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
107 AC_MSG_RESULT(Enabling zlib)
108 ]
109 )
110
111 AC_ARG_ENABLE(openpty,
112 [ --disable-openpty Don't use openpty, use alternative method],
113 [
114 if test "x$enableval" = "xno"; then
115 AC_MSG_RESULT(Not using openpty)
116 else
117 AC_MSG_RESULT(Using openpty if available)
118 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
119 fi
120 ],
121 [
122 AC_MSG_RESULT(Using openpty if available)
123 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
124 ]
125 )
126
127
128 AC_ARG_ENABLE(syslog,
129 [ --disable-syslog Don't include syslog support],
130 [
131 if test "x$enableval" = "xno"; then
132 AC_DEFINE(DISABLE_SYSLOG,, Using syslog)
133 AC_MSG_RESULT(Disabling syslog)
134 else
135 AC_MSG_RESULT(Enabling syslog)
136 fi
137 ],
138 [
139 AC_MSG_RESULT(Enabling syslog)
140 ]
141 )
142
143 AC_ARG_ENABLE(shadow,
144 [ --disable-shadow Don't use shadow passwords (if available)],
145 [
146 if test "x$enableval" = "xno"; then
147 AC_MSG_RESULT(Not using shadow passwords)
148 else
149 AC_CHECK_HEADERS([shadow.h])
150 AC_MSG_RESULT(Using shadow passwords if available)
151 fi
152 ],
153 [
154 AC_CHECK_HEADERS([shadow.h])
155 AC_MSG_RESULT(Using shadow passwords if available)
156 ]
157 )
158
159
160 # Checks for header files.
161 AC_HEADER_STDC
162 AC_HEADER_SYS_WAIT
163 AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h netinet/tcp.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h crypt.h pty.h ioctl.h libutil.h libgen.h inttypes.h stropts.h utmp.h utmpx.h lastlog.h paths.h util.h netdb.h sys/dirent.h])
164
165 # Checks for typedefs, structures, and compiler characteristics.
166 AC_C_CONST
167 AC_TYPE_UID_T
168 AC_TYPE_MODE_T
169 AC_TYPE_PID_T
170 AC_TYPE_SIZE_T
171 AC_HEADER_TIME
172
173 AC_CHECK_TYPES([uint16_t, u_int16_t, struct sockaddr_storage])
174 AC_CHECK_TYPE([socklen_t], ,[
175 AC_MSG_CHECKING([for socklen_t equivalent])
176 AC_CACHE_VAL([curl_cv_socklen_t_equiv],
177 [
178 # Systems have either "struct sockaddr *" or
179 # "void *" as the second argument to getpeername
180 curl_cv_socklen_t_equiv=
181 for arg2 in "struct sockaddr" void; do
182 for t in int size_t unsigned long "unsigned long"; do
183 AC_TRY_COMPILE([
184 #include <sys/types.h>
185 #include <sys/socket.h>
186
187 int getpeername (int, $arg2 *, $t *);
188 ],[
189 $t len;
190 getpeername(0,0,&len);
191 ],[
192 curl_cv_socklen_t_equiv="$t"
193 break
194 ])
195 done
196 done
197
198 if test "x$curl_cv_socklen_t_equiv" = x; then
199 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
200 fi
201 ])
202 AC_MSG_RESULT($curl_cv_socklen_t_equiv)
203 AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
204 [type to use in place of socklen_t if not defined])],
205 [#include <sys/types.h>
206 #include <sys/socket.h>])
207
208
209 # for loginrec.c
210
211 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_tv, struct utmp.ut_id, struct utmp.ut_addr, struct utmp.ut_addr_v6, struct utmp.ut_exit, struct utmp.ut_time],,,[
212 #include <sys/types.h>
213 #if HAVE_UTMP_H
214 #include <utmp.h>
215 #endif
216 ])
217
218 AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_type, struct utmpx.ut_id, struct utmpx.ut_addr, struct utmpx.ut_addr_v6, struct utmpx.ut_time, struct utmpx.ut_tv],,,[
219 #include <sys/types.h>
220 #if HAVE_UTMPX_H
221 #include <utmpx.h>
222 #endif
223 ])
224
225 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
226 AC_CHECK_FUNCS(utmpname)
227 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
228 AC_CHECK_FUNCS(setutxent utmpxname)
229 AC_CHECK_FUNCS(logout updwtmp logwtmp)
230
231 dnl Added from OpenSSH 3.6.1p2's configure.ac
232
233 dnl allow user to disable some login recording features
234 AC_ARG_ENABLE(lastlog,
235 [ --disable-lastlog Disable use of lastlog even if detected [no]],
236 [ AC_DEFINE(DISABLE_LASTLOG,,Disable use of lastlog()) ]
237 )
238 AC_ARG_ENABLE(utmp,
239 [ --disable-utmp Disable use of utmp even if detected [no]],
240 [ AC_DEFINE(DISABLE_UTMP,,Disable use of utmp) ]
241 )
242 AC_ARG_ENABLE(utmpx,
243 [ --disable-utmpx Disable use of utmpx even if detected [no]],
244 [ AC_DEFINE(DISABLE_UTMPX,,Disable use of utmpx) ]
245 )
246 AC_ARG_ENABLE(wtmp,
247 [ --disable-wtmp Disable use of wtmp even if detected [no]],
248 [ AC_DEFINE(DISABLE_WTMP,,Disable use of wtmp) ]
249 )
250 AC_ARG_ENABLE(wtmpx,
251 [ --disable-wtmpx Disable use of wtmpx even if detected [no]],
252 [ AC_DEFINE(DISABLE_WTMPX,,Disable use of wtmpx) ]
253 )
254 AC_ARG_ENABLE(loginfunc,
255 [ --disable-loginfunc Disable use of login() etc. [no]],
256 [ no_loginfunc_check=1
257 AC_MSG_RESULT(Not using login() etc) ]
258 )
259 AC_ARG_ENABLE(pututline,
260 [ --disable-pututline Disable use of pututline() etc. ([uw]tmp) [no]],
261 [ AC_DEFINE(DISABLE_PUTUTLINE,,Disable use of pututline()) ]
262 )
263 AC_ARG_ENABLE(pututxline,
264 [ --disable-pututxline Disable use of pututxline() etc. ([uw]tmpx) [no]],
265 [ AC_DEFINE(DISABLE_PUTUTXLINE,,Disable use of pututxline()) ]
266 )
267 AC_ARG_WITH(lastlog,
268 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
269 [
270 if test "x$withval" = "xno" ; then
271 AC_DEFINE(DISABLE_LASTLOG)
272 else
273 conf_lastlog_location=$withval
274 fi
275 ]
276 )
277
278 if test -z "$no_loginfunc_check"; then
279 dnl Checks for libutil functions (login(), logout() etc, not openpty() )
280 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,,Have login() function)])
281 AC_CHECK_FUNCS(logout updwtmp logwtmp)
282 fi
283
284 dnl lastlog, [uw]tmpx? detection
285 dnl NOTE: set the paths in the platform section to avoid the
286 dnl need for command-line parameters
287 dnl lastlog and [uw]tmp are subject to a file search if all else fails
288
289 dnl lastlog detection
290 dnl NOTE: the code itself will detect if lastlog is a directory
291 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
292 AC_TRY_COMPILE([
293 #include <sys/types.h>
294 #include <utmp.h>
295 #ifdef HAVE_LASTLOG_H
296 # include <lastlog.h>
297 #endif
298 #ifdef HAVE_PATHS_H
299 # include <paths.h>
300 #endif
301 #ifdef HAVE_LOGIN_H
302 # include <login.h>
303 #endif
304 ],
305 [ char *lastlog = LASTLOG_FILE; ],
306 [ AC_MSG_RESULT(yes) ],
307 [
308 AC_MSG_RESULT(no)
309 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
310 AC_TRY_COMPILE([
311 #include <sys/types.h>
312 #include <utmp.h>
313 #ifdef HAVE_LASTLOG_H
314 # include <lastlog.h>
315 #endif
316 #ifdef HAVE_PATHS_H
317 # include <paths.h>
318 #endif
319 ],
320 [ char *lastlog = _PATH_LASTLOG; ],
321 [ AC_MSG_RESULT(yes) ],
322 [
323 AC_MSG_RESULT(no)
324 system_lastlog_path=no
325 ])
326 ]
327 )
328
329 if test -z "$conf_lastlog_location"; then
330 if test x"$system_lastlog_path" = x"no" ; then
331 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
332 if (test -d "$f" || test -f "$f") ; then
333 conf_lastlog_location=$f
334 fi
335 done
336 if test -z "$conf_lastlog_location"; then
337 AC_MSG_WARN([** Cannot find lastlog **])
338 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
339 fi
340 fi
341 fi
342
343 if test -n "$conf_lastlog_location"; then
344 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", lastlog file location)
345 fi
346
347 dnl utmp detection
348 AC_MSG_CHECKING([if your system defines UTMP_FILE])
349 AC_TRY_COMPILE([
350 #include <sys/types.h>
351 #include <utmp.h>
352 #ifdef HAVE_PATHS_H
353 # include <paths.h>
354 #endif
355 ],
356 [ char *utmp = UTMP_FILE; ],
357 [ AC_MSG_RESULT(yes) ],
358 [ AC_MSG_RESULT(no)
359 system_utmp_path=no ]
360 )
361 if test -z "$conf_utmp_location"; then
362 if test x"$system_utmp_path" = x"no" ; then
363 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
364 if test -f $f ; then
365 conf_utmp_location=$f
366 fi
367 done
368 if test -z "$conf_utmp_location"; then
369 AC_DEFINE(DISABLE_UTMP)
370 fi
371 fi
372 fi
373 if test -n "$conf_utmp_location"; then
374 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", utmp file location)
375 fi
376
377 dnl wtmp detection
378 AC_MSG_CHECKING([if your system defines WTMP_FILE])
379 AC_TRY_COMPILE([
380 #include <sys/types.h>
381 #include <utmp.h>
382 #ifdef HAVE_PATHS_H
383 # include <paths.h>
384 #endif
385 ],
386 [ char *wtmp = WTMP_FILE; ],
387 [ AC_MSG_RESULT(yes) ],
388 [ AC_MSG_RESULT(no)
389 system_wtmp_path=no ]
390 )
391 if test -z "$conf_wtmp_location"; then
392 if test x"$system_wtmp_path" = x"no" ; then
393 for f in /usr/adm/wtmp /var/log/wtmp; do
394 if test -f $f ; then
395 conf_wtmp_location=$f
396 fi
397 done
398 if test -z "$conf_wtmp_location"; then
399 AC_DEFINE(DISABLE_WTMP)
400 fi
401 fi
402 fi
403 if test -n "$conf_wtmp_location"; then
404 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", wtmp file location)
405 fi
406
407
408 dnl utmpx detection - I don't know any system so perverse as to require
409 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
410 dnl there, though.
411 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
412 AC_TRY_COMPILE([
413 #include <sys/types.h>
414 #include <utmp.h>
415 #ifdef HAVE_UTMPX_H
416 #include <utmpx.h>
417 #endif
418 #ifdef HAVE_PATHS_H
419 # include <paths.h>
420 #endif
421 ],
422 [ char *utmpx = UTMPX_FILE; ],
423 [ AC_MSG_RESULT(yes) ],
424 [ AC_MSG_RESULT(no)
425 system_utmpx_path=no ]
426 )
427 if test -z "$conf_utmpx_location"; then
428 if test x"$system_utmpx_path" = x"no" ; then
429 AC_DEFINE(DISABLE_UTMPX)
430 fi
431 else
432 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location", utmpx file location)
433 fi
434
435 dnl wtmpx detection
436 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
437 AC_TRY_COMPILE([
438 #include <sys/types.h>
439 #include <utmp.h>
440 #ifdef HAVE_UTMPX_H
441 #include <utmpx.h>
442 #endif
443 #ifdef HAVE_PATHS_H
444 # include <paths.h>
445 #endif
446 ],
447 [ char *wtmpx = WTMPX_FILE; ],
448 [ AC_MSG_RESULT(yes) ],
449 [ AC_MSG_RESULT(no)
450 system_wtmpx_path=no ]
451 )
452 if test -z "$conf_wtmpx_location"; then
453 if test x"$system_wtmpx_path" = x"no" ; then
454 AC_DEFINE(DISABLE_WTMPX)
455 fi
456 else
457 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", wtmpx file location)
458 fi
459
460 # Checks for library functions.
461 AC_PROG_GCC_TRADITIONAL
462 AC_FUNC_MEMCMP
463 AC_FUNC_SELECT_ARGTYPES
464 AC_TYPE_SIGNAL
465 AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty ])
466
467 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
468
469 # Solaris needs ptmx
470 if test -z "$no_ptmx_check" ; then
471 if test x"$cross_compiling" = x"no" ; then
472 AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx))
473 else
474 AC_MSG_RESULT(Not checking for /dev/ptmx, we're cross-compiling)
475 fi
476 fi
477
478 if test -z "$no_ptc_check" ; then
479 if test x"$cross_compiling" = x"no" ; then
480 AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts))
481 else
482 AC_MSG_RESULT(Not checking for /dev/ptc & /dev/pts\, we're cross-compiling)
483 fi
484 fi
485
486 AC_CONFIG_HEADER(config.h)
487 AC_OUTPUT(Makefile)
488 AC_MSG_RESULT()
489 AC_MSG_RESULT(Now edit options.h to choose features.)