dropbear: update to 2015.67
[tomato.git] / release / src / router / dropbear / configure.ac
blobb0e85e540531870b46b51fc2ab3badb6bf3940d8
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf and autoheader to produce a configure script.
4 # This Autoconf file was cobbled from various locations. In particular, a bunch
5 # of the platform checks have been taken straight from OpenSSH's configure.ac
6 # Huge thanks to them for dealing with the horrible platform-specifics :)
8 AC_PREREQ(2.59)
9 AC_INIT
10 AC_CONFIG_SRCDIR(buffer.c)
12 OLDCFLAGS=$CFLAGS
13 # Checks for programs.
14 AC_PROG_CC
15 AC_PROG_MAKE_SET
17 if test -z "$LD" ; then
18         LD=$CC
20 AC_SUBST(LD)    
22 if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then
23         AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC)
24         CFLAGS="-Os -W -Wall -Wno-pointer-sign"
27 # large file support is useful for scp
28 AC_SYS_LARGEFILE
30 # Host specific options
31 # this isn't a definitive list of hosts, they are just added as required
32 AC_CANONICAL_HOST
34 case "$host" in
36 *-*-linux*)
37         no_ptmx_check=1
38         ;;
40 *-*-solaris*)
41         CFLAGS="$CFLAGS -I/usr/local/include"
42         LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
43         conf_lastlog_location="/var/adm/lastlog"
44         AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
45         sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
46         if test "$sol2ver" -ge 8; then
47                 AC_MSG_RESULT(yes)
48                 AC_DEFINE(DISABLE_UTMP,,Disable utmp)
49                 AC_DEFINE(DISABLE_WTMP,,Disable wtmp)
50         else
51                 AC_MSG_RESULT(no)
52         fi
53         AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
54         AC_CHECK_LIB(nsl, yp_match, LIBS="$LIBS -lnsl")
55         ;;
57 *-*-aix*)
58         AC_DEFINE(AIX,,Using AIX)
59         # OpenSSH thinks it's broken. If it isn't, let me know.
60         AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
61         ;;
62         
63 *-*-hpux*)
64         LIBS="$LIBS -lsec"
65         # It's probably broken.
66         AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
67         ;;
68 *-dec-osf*)
69         AC_DEFINE(BROKEN_GETADDRINFO,,Broken getaddrinfo)
70         ;;
71 esac
73 AC_CHECK_TOOL(AR, ar, :)
74 AC_CHECK_TOOL(RANLIB, ranlib, :)
75 AC_CHECK_TOOL(STRIP, strip, :)
76 AC_CHECK_TOOL(INSTALL, install, :)
78 dnl Can't use login() or logout() with uclibc
79 AC_CHECK_DECL(__UCLIBC__, 
80         [
81         no_loginfunc_check=1
82         AC_MSG_NOTICE([Using uClibc - login() and logout() probably don't work, so we won't use them.])
83         ],,,)
85 # Checks for libraries.
86 AC_CHECK_LIB(crypt, crypt, CRYPTLIB="-lcrypt")
87 AC_SUBST(CRYPTLIB)      
89 # Check if zlib is needed
90 AC_ARG_WITH(zlib,
91         [  --with-zlib=PATH        Use zlib in PATH],
92         [
93                 # option is given
94                 if test -d "$withval/lib"; then
95                         LDFLAGS="-L${withval}/lib ${LDFLAGS}"
96                 else
97                         LDFLAGS="-L${withval} ${LDFLAGS}"
98                 fi
99                 if test -d "$withval/include"; then
100                         CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
101                 else
102                         CPPFLAGS="-I${withval} ${CPPFLAGS}"
103                 fi
104         ]
107 AC_ARG_ENABLE(zlib,
108         [  --disable-zlib          Don't include zlib support],
109         [
110                 if test "x$enableval" = "xno"; then
111                         AC_DEFINE(DISABLE_ZLIB,, Use zlib)
112                         AC_MSG_NOTICE(Disabling zlib)
113                 else
114                         AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
115                         AC_MSG_NOTICE(Enabling zlib)
116                 fi
117         ],
118         [
119                 # if not disabled, check for zlib
120                 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
121                 AC_MSG_NOTICE(Enabling zlib)
122         ]
125 # Check if pam is needed
126 AC_ARG_WITH(pam,
127         [  --with-pam=PATH        Use pam in PATH],
128         [
129                 # option is given
130                 if test -d "$withval/lib"; then
131                         LDFLAGS="-L${withval}/lib ${LDFLAGS}"
132                 else
133                         LDFLAGS="-L${withval} ${LDFLAGS}"
134                 fi
135                 if test -d "$withval/include"; then
136                         CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
137                 else
138                         CPPFLAGS="-I${withval} ${CPPFLAGS}"
139                 fi
140         ]
144 AC_ARG_ENABLE(pam,
145         [  --enable-pam          Try to include PAM support],
146         [
147                 if test "x$enableval" = "xyes"; then
148                         AC_CHECK_LIB(pam, pam_authenticate, , AC_MSG_ERROR([*** PAM missing - install first or check config.log ***]))
149                         AC_MSG_NOTICE(Enabling PAM)
150                         AC_CHECK_FUNCS(pam_fail_delay)
151                 else
152                         AC_DEFINE(DISABLE_PAM,, Use PAM)
153                         AC_MSG_NOTICE(Disabling PAM)
154                 fi
155         ],
156         [
157                 # disable it by default
158                 AC_DEFINE(DISABLE_PAM,, Use PAM)
159                 AC_MSG_NOTICE(Disabling PAM)
160         ]
163 AC_ARG_ENABLE(openpty,
164         [  --disable-openpty       Don't use openpty, use alternative method],
165         [
166                 if test "x$enableval" = "xno"; then
167                         AC_MSG_NOTICE(Not using openpty)
168                 else
169                         AC_MSG_NOTICE(Using openpty if available)
170                         AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
171                 fi
172         ],
173         [
174                 AC_MSG_NOTICE(Using openpty if available)
175                 AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
176         ]
178                 
180 AC_ARG_ENABLE(syslog,
181         [  --disable-syslog        Don't include syslog support],
182         [
183                 if test "x$enableval" = "xno"; then
184                         AC_DEFINE(DISABLE_SYSLOG,, Using syslog)
185                         AC_MSG_NOTICE(Disabling syslog)
186                 else
187                         AC_MSG_NOTICE(Enabling syslog)
188                 fi
189         ],
190         [
191                 AC_MSG_NOTICE(Enabling syslog)
192         ]
195 AC_ARG_ENABLE(shadow,
196         [  --disable-shadow        Don't use shadow passwords (if available)],
197         [
198                 if test "x$enableval" = "xno"; then
199                         AC_MSG_NOTICE(Not using shadow passwords)
200                 else
201                         AC_CHECK_HEADERS([shadow.h])
202                         AC_MSG_NOTICE(Using shadow passwords if available)
203                 fi
204         ],
205         [
206                 AC_CHECK_HEADERS([shadow.h])
207                 AC_MSG_NOTICE(Using shadow passwords if available)
208         ]
210                         
212 # Checks for header files.
213 AC_HEADER_STDC
214 AC_HEADER_SYS_WAIT
215 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 security/pam_appl.h pam/pam_appl.h netinet/in_systm.h sys/uio.h])
217 # Checks for typedefs, structures, and compiler characteristics.
218 AC_C_CONST
219 AC_TYPE_UID_T
220 AC_TYPE_MODE_T
221 AC_TYPE_PID_T
222 AC_TYPE_SIZE_T
223 AC_HEADER_TIME
225 AC_CHECK_TYPES([uint8_t, u_int8_t, uint16_t, u_int16_t, uint32_t, u_int32_t])
226 AC_CHECK_TYPES([struct sockaddr_storage])
227 AC_CHECK_TYPE([socklen_t], ,[
228         AC_MSG_CHECKING([for socklen_t equivalent])
229         AC_CACHE_VAL([curl_cv_socklen_t_equiv],
230         [
231         # Systems have either "struct sockaddr *" or
232         # "void *" as the second argument to getpeername
233         curl_cv_socklen_t_equiv=
234         for arg2 in "struct sockaddr" void; do
235                 for t in int size_t unsigned long "unsigned long"; do
236                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
237 #include <sys/types.h>
238 #include <sys/socket.h>
240                         int getpeername (int, $arg2 *, $t *);
241                 ]],[[
242                         $t len;
243                         getpeername(0,0,&len);
244                 ]])],[
245                         curl_cv_socklen_t_equiv="$t"
246                         break
247                 ])
248                 done
249         done
251         if test "x$curl_cv_socklen_t_equiv" = x; then
252                 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
253         fi
254         ])
255         AC_MSG_RESULT($curl_cv_socklen_t_equiv)
256         AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
257                         [type to use in place of socklen_t if not defined])],
258         [#include <sys/types.h>
259         #include <sys/socket.h>])
261 # for the fake-rfc2553 stuff - straight from OpenSSH
263 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
264         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
265 #include <sys/types.h>
266 #include <sys/socket.h>
267                 ]],
268                 [[ struct sockaddr_storage s; ]])],
269                 [ ac_cv_have_struct_sockaddr_storage="yes" ],
270                 [ ac_cv_have_struct_sockaddr_storage="no" ]
271         )
273 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
274         AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
277 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
278         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
279 #include <sys/types.h>
280 #include <netinet/in.h>
281                 ]],
282                 [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],
283                 [ ac_cv_have_struct_sockaddr_in6="yes" ],
284                 [ ac_cv_have_struct_sockaddr_in6="no" ]
285         )
287 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
288         AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,,Have struct sockaddr_in6)
291 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
292         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
293 #include <sys/types.h>
294 #include <netinet/in.h>
295                 ]],
296                 [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],
297                 [ ac_cv_have_struct_in6_addr="yes" ],
298                 [ ac_cv_have_struct_in6_addr="no" ]
299         )
301 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
302         AC_DEFINE(HAVE_STRUCT_IN6_ADDR,,Have struct in6_addr)
305 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
306         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
307 #include <sys/types.h>
308 #include <sys/socket.h>
309 #include <netdb.h>
310                 ]],
311                 [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],
312                 [ ac_cv_have_struct_addrinfo="yes" ],
313                 [ ac_cv_have_struct_addrinfo="no" ]
314         )
316 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
317         AC_DEFINE(HAVE_STRUCT_ADDRINFO,,Have struct addrinfo)
321 # IRIX has a const char return value for gai_strerror()
322 AC_CHECK_FUNCS(gai_strerror,[
323         AC_DEFINE(HAVE_GAI_STRERROR)
324         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
325 #include <sys/types.h>
326 #include <sys/socket.h>
327 #include <netdb.h>
329 const char *gai_strerror(int);]],[[
330 char *str;
332 str = gai_strerror(0);]])],[
333                 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
334                 [Define if gai_strerror() returns const char *])])])
336 # for loginrec.c
338 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],,,[
339 #include <sys/types.h>
340 #if HAVE_UTMP_H
341 #include <utmp.h>
342 #endif
345 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],,,[
346 #include <sys/types.h>
347 #include <sys/socket.h>
348 #if HAVE_UTMPX_H
349 #include <utmpx.h>
350 #endif
353 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],,,[
354 #include <sys/types.h>
355 #include <sys/socket.h>
358 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
359 AC_CHECK_FUNCS(utmpname)
360 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
361 AC_CHECK_FUNCS(setutxent utmpxname)
362 AC_CHECK_FUNCS(logout updwtmp logwtmp)
364 # OS X monotonic time
365 AC_CHECK_HEADERS([mach/mach_time.h])
366 AC_CHECK_FUNCS(mach_absolute_time)
368 AC_ARG_ENABLE(bundled-libtom,
369 [  --enable-bundled-libtom       Force using bundled libtomcrypt/libtommath even if a system version exists.
370   --disable-bundled-libtom      Force using system libtomcrypt/libtommath, fail if it does not exist.
371                                 Default is to use system if available, otherwise bundled.],
372         [
373                 if test "x$enableval" = "xyes"; then
374                         BUNDLED_LIBTOM=1
375                         AC_MSG_NOTICE(Forcing bundled libtom*)
376                 else
377                         BUNDLED_LIBTOM=0
378                         AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", 
379                                 [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] )
380                         AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", 
381                                 [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
382                 fi
383         ],
384         [
385                 BUNDLED_LIBTOM=0
386                 AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", BUNDLED_LIBTOM=1)
387                 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1)
388         ]
391 if test $BUNDLED_LIBTOM = 1 ; then
392         AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom) 
395 AC_SUBST(LIBTOM_LIBS)
396 AC_SUBST(BUNDLED_LIBTOM)
398 dnl Added from OpenSSH 3.6.1p2's configure.ac
400 dnl allow user to disable some login recording features
401 AC_ARG_ENABLE(lastlog,
402         [  --disable-lastlog       Disable use of lastlog even if detected [no]],
403         [ AC_DEFINE(DISABLE_LASTLOG,,Disable use of lastlog()) ]
405 AC_ARG_ENABLE(utmp,
406         [  --disable-utmp          Disable use of utmp even if detected [no]],
407         [ AC_DEFINE(DISABLE_UTMP,,Disable use of utmp) ]
409 AC_ARG_ENABLE(utmpx,
410         [  --disable-utmpx         Disable use of utmpx even if detected [no]],
411         [ AC_DEFINE(DISABLE_UTMPX,,Disable use of utmpx) ]
413 AC_ARG_ENABLE(wtmp,
414         [  --disable-wtmp          Disable use of wtmp even if detected [no]],
415         [ AC_DEFINE(DISABLE_WTMP,,Disable use of wtmp) ]
417 AC_ARG_ENABLE(wtmpx,
418         [  --disable-wtmpx         Disable use of wtmpx even if detected [no]],
419         [ AC_DEFINE(DISABLE_WTMPX,,Disable use of wtmpx) ]
421 AC_ARG_ENABLE(loginfunc,
422         [  --disable-loginfunc     Disable use of login() etc. [no]],
423         [ no_loginfunc_check=1
424         AC_MSG_NOTICE(Not using login() etc) ]
426 AC_ARG_ENABLE(pututline,
427         [  --disable-pututline     Disable use of pututline() etc. ([uw]tmp) [no]],
428         [ AC_DEFINE(DISABLE_PUTUTLINE,,Disable use of pututline()) ]
430 AC_ARG_ENABLE(pututxline,
431         [  --disable-pututxline    Disable use of pututxline() etc. ([uw]tmpx) [no]],
432         [ AC_DEFINE(DISABLE_PUTUTXLINE,,Disable use of pututxline()) ]
434 AC_ARG_WITH(lastlog,
435   [  --with-lastlog=FILE|DIR specify lastlog location [common locations]],
436         [
437                 if test "x$withval" = "xno" ; then      
438                         AC_DEFINE(DISABLE_LASTLOG)
439                 else
440                         conf_lastlog_location=$withval
441                 fi
442         ]
445 if test -z "$no_loginfunc_check"; then
446         dnl    Checks for libutil functions (login(), logout() etc, not openpty() )
447         AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN,,Have login() function)])
448         AC_CHECK_FUNCS(logout updwtmp logwtmp)
451 dnl lastlog, [uw]tmpx? detection
452 dnl  NOTE: set the paths in the platform section to avoid the
453 dnl   need for command-line parameters
454 dnl lastlog and [uw]tmp are subject to a file search if all else fails
456 dnl lastlog detection
457 dnl  NOTE: the code itself will detect if lastlog is a directory
458 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
459 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
460 #include <sys/types.h>
461 #include <utmp.h>
462 #ifdef HAVE_LASTLOG_H
463 #  include <lastlog.h>
464 #endif
465 #ifdef HAVE_PATHS_H
466 #  include <paths.h>
467 #endif
468 #ifdef HAVE_LOGIN_H
469 # include <login.h>
470 #endif
471         ]],
472         [[ char *lastlog = LASTLOG_FILE; ]])],
473         [ AC_MSG_RESULT(yes) ],
474         [
475                 AC_MSG_RESULT(no)
476                 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
477                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
478 #include <sys/types.h>
479 #include <utmp.h>
480 #ifdef HAVE_LASTLOG_H
481 #  include <lastlog.h>
482 #endif
483 #ifdef HAVE_PATHS_H
484 #  include <paths.h>
485 #endif
486                 ]],
487                 [[ char *lastlog = _PATH_LASTLOG; ]])],
488                 [ AC_MSG_RESULT(yes) ],
489                 [
490                         AC_MSG_RESULT(no)
491                         system_lastlog_path=no
492                 ])
493         ]
496 if test -z "$conf_lastlog_location"; then
497         if test x"$system_lastlog_path" = x"no" ; then
498                 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
499                                 if (test -d "$f" || test -f "$f") ; then
500                                         conf_lastlog_location=$f
501                                 fi
502                 done
503                 if test -z "$conf_lastlog_location"; then
504                         AC_MSG_WARN([** Cannot find lastlog **])
505                         dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
506                 fi
507         fi
510 if test -n "$conf_lastlog_location"; then
511         AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location", lastlog file location)
512 fi      
514 dnl utmp detection
515 AC_MSG_CHECKING([if your system defines UTMP_FILE])
516 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
517 #include <sys/types.h>
518 #include <utmp.h>
519 #ifdef HAVE_PATHS_H
520 #  include <paths.h>
521 #endif
522         ]],
523         [[ char *utmp = UTMP_FILE; ]])],
524         [ AC_MSG_RESULT(yes) ],
525         [ AC_MSG_RESULT(no)
526           system_utmp_path=no ]
528 if test -z "$conf_utmp_location"; then
529         if test x"$system_utmp_path" = x"no" ; then
530                 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
531                         if test -f $f ; then
532                                 conf_utmp_location=$f
533                         fi
534                 done
535                 if test -z "$conf_utmp_location"; then
536                         AC_DEFINE(DISABLE_UTMP)
537                 fi
538         fi
540 if test -n "$conf_utmp_location"; then
541         AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location", utmp file location)
542 fi      
544 dnl wtmp detection
545 AC_MSG_CHECKING([if your system defines WTMP_FILE])
546 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
547 #include <sys/types.h>
548 #ifdef HAVE_UTMP_H
549 #  include <utmp.h>
550 #endif
551 #ifdef HAVE_PATHS_H
552 #  include <paths.h>
553 #endif
554         ]],
555         [[ char *wtmp = WTMP_FILE; ]])],
556         [ AC_MSG_RESULT(yes) ],
557         [ AC_MSG_RESULT(no)
558           system_wtmp_path=no ]
560 if test -z "$conf_wtmp_location"; then
561         if test x"$system_wtmp_path" = x"no" ; then
562                 for f in /usr/adm/wtmp /var/log/wtmp; do
563                         if test -f $f ; then
564                                 conf_wtmp_location=$f
565                         fi
566                 done
567                 if test -z "$conf_wtmp_location"; then
568                         AC_DEFINE(DISABLE_WTMP)
569                 fi
570         fi
572 if test -n "$conf_wtmp_location"; then
573         AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location", wtmp file location)
574 fi      
577 dnl utmpx detection - I don't know any system so perverse as to require
578 dnl  utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
579 dnl  there, though.
580 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
581 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
582 #include <sys/types.h>
583 #include <utmp.h>
584 #ifdef HAVE_UTMPX_H
585 #include <utmpx.h>
586 #endif
587 #ifdef HAVE_PATHS_H
588 #  include <paths.h>
589 #endif
590         ]],
591         [[ char *utmpx = UTMPX_FILE; ]])],
592         [ AC_MSG_RESULT(yes) ],
593         [ AC_MSG_RESULT(no)
594           system_utmpx_path=no ]
596 if test -z "$conf_utmpx_location"; then
597         if test x"$system_utmpx_path" = x"no" ; then
598                 AC_DEFINE(DISABLE_UTMPX)
599         fi
600 else
601         AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location", utmpx file location)
602 fi      
604 dnl wtmpx detection
605 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
607 #include <sys/types.h>
608 #ifdef HAVE_UTMP_H
609 #  include <utmp.h>
610 #endif
611 #ifdef HAVE_UTMPX_H
612 #  include <utmpx.h>
613 #endif
614 #ifdef HAVE_PATHS_H
615 #  include <paths.h>
616 #endif
617         ]],
618         [[ char *wtmpx = WTMPX_FILE; ]])],
619         [ AC_MSG_RESULT(yes) ],
620         [ AC_MSG_RESULT(no)
621           system_wtmpx_path=no ]
623 if test -z "$conf_wtmpx_location"; then
624         if test x"$system_wtmpx_path" = x"no" ; then
625                 AC_DEFINE(DISABLE_WTMPX)
626         fi
627 else
628         AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location", wtmpx file location)
629 fi      
631 # Checks for library functions.
632 AC_PROG_GCC_TRADITIONAL
633 AC_FUNC_MEMCMP
634 AC_FUNC_SELECT_ARGTYPES
635 AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty getaddrinfo freeaddrinfo getnameinfo fork writev])
637 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
639 # Solaris needs ptmx
640 if test -z "$no_ptmx_check" ; then
641         if test x"$cross_compiling" = x"no" ; then
642                 if test -e /dev/ptmx ; then
643                         AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx)
644                 fi
645         else
646                 AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling])
647         fi
650 if test -z "$no_ptc_check" ; then
651         if test x"$cross_compiling" = x"no" ; then
652                 if test -e /dev/ptc ; then
653                         AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts)
654                 fi
655         else
656                 AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling])
657         fi
660 AC_EXEEXT
662 # XXX there must be a nicer way to do this
663 if test $BUNDLED_LIBTOM = 1 ; then
664 AS_MKDIR_P(libtomcrypt/src/ciphers/aes)
665 AS_MKDIR_P(libtomcrypt/src/ciphers/safer)
666 AS_MKDIR_P(libtomcrypt/src/ciphers/twofish)
667 AS_MKDIR_P(libtomcrypt/src/encauth/ccm)
668 AS_MKDIR_P(libtomcrypt/src/encauth/eax)
669 AS_MKDIR_P(libtomcrypt/src/encauth/gcm)
670 AS_MKDIR_P(libtomcrypt/src/encauth/ocb)
671 AS_MKDIR_P(libtomcrypt/src/hashes)
672 AS_MKDIR_P(libtomcrypt/src/hashes/chc)
673 AS_MKDIR_P(libtomcrypt/src/hashes/helper)
674 AS_MKDIR_P(libtomcrypt/src/hashes/sha2)
675 AS_MKDIR_P(libtomcrypt/src/hashes/whirl)
676 AS_MKDIR_P(libtomcrypt/src/mac/hmac)
677 AS_MKDIR_P(libtomcrypt/src/mac/omac)
678 AS_MKDIR_P(libtomcrypt/src/mac/pelican)
679 AS_MKDIR_P(libtomcrypt/src/mac/pmac)
680 AS_MKDIR_P(libtomcrypt/src/mac/f9)
681 AS_MKDIR_P(libtomcrypt/src/mac/xcbc)
682 AS_MKDIR_P(libtomcrypt/src/math/fp)
683 AS_MKDIR_P(libtomcrypt/src/misc/base64)
684 AS_MKDIR_P(libtomcrypt/src/misc/crypt)
685 AS_MKDIR_P(libtomcrypt/src/misc/mpi)
686 AS_MKDIR_P(libtomcrypt/src/misc/pkcs5)
687 AS_MKDIR_P(libtomcrypt/src/modes/cbc)
688 AS_MKDIR_P(libtomcrypt/src/modes/cfb)
689 AS_MKDIR_P(libtomcrypt/src/modes/ctr)
690 AS_MKDIR_P(libtomcrypt/src/modes/ecb)
691 AS_MKDIR_P(libtomcrypt/src/modes/ofb)
692 AS_MKDIR_P(libtomcrypt/src/modes/f8)
693 AS_MKDIR_P(libtomcrypt/src/modes/lrw)
694 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit)
695 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/boolean)
696 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice)
697 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5)
698 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer)
699 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier)
700 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet)
701 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string)
702 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence)
703 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/set)
704 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer)
705 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime)
706 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utf8)
707 AS_MKDIR_P(libtomcrypt/src/pk/dh)
708 AS_MKDIR_P(libtomcrypt/src/pk/dsa)
709 AS_MKDIR_P(libtomcrypt/src/pk/ecc)
710 AS_MKDIR_P(libtomcrypt/src/pk/katja)
711 AS_MKDIR_P(libtomcrypt/src/pk/pkcs1)
712 AS_MKDIR_P(libtomcrypt/src/pk/rsa)
713 AS_MKDIR_P(libtomcrypt/src/prngs)
714 LIBTOM_FILES="libtomcrypt/Makefile libtommath/Makefile"
716 AC_CONFIG_HEADER(config.h)
717 AC_CONFIG_FILES(Makefile $LIBTOM_FILES)
718 AC_OUTPUT
720 AC_MSG_NOTICE()
721 if test $BUNDLED_LIBTOM = 1 ; then
722 AC_MSG_NOTICE(Using bundled libtomcrypt and libtommath)
723 else
724 AC_MSG_NOTICE(Using system libtomcrypt and libtommath)
727 AC_MSG_NOTICE()
728 AC_MSG_NOTICE(Now edit options.h to choose features.)