/[inetutils]/inetutils/configure.ac
ViewVC logotype

Diff of /inetutils/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by gray, Mon Apr 8 14:00:26 2002 UTC revision 1.5 by ams, Sun Apr 28 16:45:12 2002 UTC
# Line 1  Line 1 
1  # Configuration for inetutils  # Configuration for inetutils
2  #  #
3  # Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.  # Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
4  #  #
5  # Written by Miles Bader <miles@gnu.ai.mit.edu>  # Written by Miles Bader <miles@gnu.ai.mit.edu>
6  #  #
# Line 19  Line 19 
19  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  #  #
21    
 AC_INIT  
 AC_CONFIG_SRCDIR([inetd/inetd.c])  
   
 # Versions of autoconf before 2.12 had bugs in autoheader that screwed up  
 # the production of headers/config.h.in.  
22  AC_PREREQ(2.52)  AC_PREREQ(2.52)
23    
24  AC_CANONICAL_SYSTEM  AC_INIT([GNU inetutils], [1.3.2e], [bug-inetutils@gnu.org])
25  AM_INIT_AUTOMAKE([inetutils], [1.3.2e], nodef)  VERSION=1.3.2e
26    AC_SUBST(VERSION) # FIXME: Why is this used over PACKAGE_VERSION?
27    
28  # Generate <config.h>; note that we use a `header' subdirectory, which  AC_CONFIG_SRCDIR([inetd/inetd.c])
29  # contains all include files distributed with inetutils, and an `include'  AM_CONFIG_HEADER([config.h:config.hin])
30  # directory, which holds those actually needed for compilation.  AC_CANONICAL_SYSTEM # FIXME: Why not just _HOST?
 #  
 # If config.h.in needs to be regenerated (because of changes in configure.in  
 # or headers/acconfig.h, use the command `autoheader -l headers'.  
 #  
 AM_CONFIG_HEADER(config.h)  
31    
32  # config.h turns this on, so make sure it's on for our tests too  # config.h turns this on, so make sure it's on for our tests too
33  #CPPFLAGS=-D_BSD_SOURCE  #CPPFLAGS=-D_BSD_SOURCE
# Line 51  INCLUDES="crypt.h arpa/telnet.h arpa/ftp Line 42  INCLUDES="crypt.h arpa/telnet.h arpa/ftp
42  LINK_SRCS=''  LINK_SRCS=''
43  LINK_DSTS=''  LINK_DSTS=''
44    
45  # By default we compile both servers and clients, but see what the user wants  dnl For now, we always use libexecdir; later we may want to vary where the
46    dnl daemons go.
47    inetdaemondir='$(libexecdir)'
48    AC_SUBST(inetdaemondir)
49    
50  AC_ARG_ENABLE(servers, [  --disable-servers       don't compile servers],  AC_ARG_ENABLE(servers, [  --disable-servers       don't compile servers],
51                , enable_servers=yes)                , enable_servers=yes)
52  AC_ARG_ENABLE(clients, [  --disable-clients       don't compile clients],  AC_ARG_ENABLE(clients, [  --disable-clients       don't compile clients],
53                , enable_clients=yes)                , enable_clients=yes)
 # Check if they want support for internal ls.  
54  AC_ARG_ENABLE(libls,   [  --disable-libls         disable support for libls ],  AC_ARG_ENABLE(libls,   [  --disable-libls         disable support for libls ],
55                , enable_libls=yes)                , enable_libls=yes)
56    AC_ARG_ENABLE(encryption, [  --enable-encryption     enable encryption],
57                  , enable_encryption=no)
58    AC_ARG_ENABLE(authentication,
59                  [  --enable-authentication enable connection authentication],
60                  , enable_authentication=no)
61    
62    AC_ARG_WITH(krb4, [  --with-krb4[[=PATH]]      Compile with Kerberos IV],
63                [KERBEROS_VERSION=4
64                 KERBEROS_DIR=$withval])
65    AC_ARG_WITH(krb5, [  --with-krb5[[=PATH]]      Compile with Kerberos V],
66                [KERBEROS_VERSION=5
67                 KERBEROS_DIR=$withval])
68    AC_ARG_WITH(wrap, [  --with-wrap    add tcp wrapper support])
69    AC_ARG_WITH(pam,  [  --with-pam    add support for PAM])
70    
71  IU_ENABLE_SERVER(ftpd)  IU_ENABLE_SERVER(ftpd)
72  IU_ENABLE_SERVER(inetd)  IU_ENABLE_SERVER(inetd)
# Line 84  IU_ENABLE_CLIENT(tftp) Line 91  IU_ENABLE_CLIENT(tftp)
91  IU_ENABLE_CLIENT(whois)  IU_ENABLE_CLIENT(whois)
92  IU_ENABLE_CLIENT(ifconfig)  IU_ENABLE_CLIENT(ifconfig)
93    
94  # Automake will generate lines in each Makefile.in for each variable that is  AM_INIT_AUTOMAKE
 # specified with AC_SUBST here.  Originally, I tried putting AC_SUBST in  
 # IU_ENABLE_FOO, but then I discovered that doing so causes automake to not  
 # recognize the variables.  I later realized that with the way I wrote the  
 # each Makefile.am, automake doesn't need to recognize the variables, but it's  
 # not worth the trouble to change it back.  --devnull  
 AC_SUBST(BUILD_FTPD)  
 AC_SUBST(BUILD_INETD)  
 AC_SUBST(BUILD_REXECD)  
 AC_SUBST(BUILD_RLOGIND)  
 AC_SUBST(BUILD_RSHD)  
 AC_SUBST(BUILD_SYSLOGD)  
 AC_SUBST(BUILD_TALKD)  
 AC_SUBST(BUILD_TELNETD)  
 AC_SUBST(BUILD_TFTPD)  
 AC_SUBST(BUILD_UUCPD)  
   
 AC_SUBST(BUILD_FTP)  
 AC_SUBST(BUILD_PING)  
 AC_SUBST(BUILD_RCP)  
 AC_SUBST(BUILD_RLOGIN)  
 AC_SUBST(BUILD_RSH)  
 AC_SUBST(BUILD_LOGGER)  
 AC_SUBST(BUILD_TALK)  
 AC_SUBST(BUILD_TELNET)  
 AC_SUBST(BUILD_TFTP)  
 AC_SUBST(BUILD_WHOIS)  
 AC_SUBST(BUILD_IFCONFIG)  
   
   
 # Encryption and authentication is turned off by default  
 AC_ARG_ENABLE(encryption, [  --enable-encryption     enable encryption],  
               , enable_encryption=no)  
 AC_ARG_ENABLE(authentication,  
               [  --enable-authentication enable connection authentication],  
               , enable_authentication=no)  
   
 AC_ARG_WITH(krb4,  
 [  --with-krb4[[=PATH]]      Compile with Kerberos IV],  
             [KERBEROS_VERSION=4  
              KERBEROS_DIR=$withval])  
 AC_ARG_WITH(krb5,  
 [  --with-krb5[[=PATH]]      Compile with Kerberos V],  
             [KERBEROS_VERSION=5  
              KERBEROS_DIR=$withval])  
   
 AC_PROG_MAKE_SET  
95    
96  AC_PROG_CC  ### Checks for programs.
 AC_PROG_CPP  
97  AC_AIX  AC_AIX
98  AC_MINIX  AC_CHECK_TOOL(AR, ar)
99  AC_ISC_POSIX  AC_ISC_POSIX
100    AC_MINIX
101    AC_PATH_PROG(RM, rm, rm)
102    AC_PROG_CC
103    AC_PROG_CPP
104  AC_PROG_INSTALL  AC_PROG_INSTALL
105    AC_PROG_MAKE_SET
106    AC_PROG_RANLIB
107  AC_PROG_YACC  AC_PROG_YACC
 AC_CHECK_TOOL(AR, ar)  
 AC_CHECK_TOOL(RANLIB, ranlib, :)  
 AC_PATH_PROG(RM, rm, rm)  
   
 # the code is ANSI C  
 AM_C_PROTOTYPES  
 AC_HEADER_STDC  
 AC_C_CONST([])  
 AC_C_CONST  
   
   
 AC_CHECK_HEADERS(arpa/nameser.h des.h errno.h fcntl.h features.h glob.h \  
                  krb.h memory.h malloc.h netinet/in_systm.h netinet/ip.h \  
                  netinet/ip_icmp.h netinet/ip_var.h \  
                  security/pam_appl.h \  
                  shadow.h stdarg.h stdlib.h string.h stropts.h sys/tty.h \  
                  sys/utsname.h sys/ptyvar.h sys/msgbuf.h sys/filio.h \  
                  sys/ioctl_compat.h sys/cdefs.h sys/stream.h sys/mkdev.h \  
                  sys/sockio.h sys/sysmacros.h sys/param.h sys/file.h \  
                  sys/proc.h sys/select.h sys/time.h sys/wait.h sys/resource.h \  
                  stropts.h tcpd.h termio.h termios.h utmp.h utmpx.h unistd.h \  
                  vis.h)  
 AC_CHECK_HEADER(poll.h,  
                 [],  
                 [INCLUDES="$INCLUDES poll.h"])  
 AC_HEADER_TIME  
   
 AC_CHECK_LIB(nsl, inet_ntoa)  
 AC_CHECK_LIB(socket, getpeername)  
 AC_CHECK_LIB(resolv, gethostname)  
 AC_CHECK_LIB(bsd, revoke)  
   
 AC_CHECK_FUNCS(bcopy bcmp bzero cfsetspeed cgetent dirfd fchdir flock \  
                fpathconf ftruncate \  
                getcwd getmsg getspnam initgroups initsetproctitle killpg \  
                mkstemp ptsname \  
                setegid seteuid setpgid \  
                setsid setregid setreuid setresgid setresuid setutent_r \  
                sigaction sigvec strchr setproctitle tcgetattr tzset utimes \  
                utime uname \  
                updwtmp updwtmpx vhangup wait3 wait4)  
   
 # Functions that we will define (in libinetutils) if necessary.  
 AC_REPLACE_FUNCS(getpass getusershell herror memcmp memcpy memmove memset \  
                  setenv strdup strcasecmp strsignal waitpid poll)  
 IU_INCLUDED_REGEX(libinetutils/regex.c)  
 AC_CHECK_FUNC(_obstack_free, ,  
   INCLUDES="$INCLUDES obstack.h"  
   LIBOBJS="$LIBOBJS obstack.o")  
   
   
 # Use (posix) `setpgid' if it's around, otherwise assume a BSD setpgrp  
 AC_CHECK_FUNC(setpgid, , AC_DEFINE(setpgid, setpgrp))  
   
 # Some systems don't declare common functions (especially if they return int),  
 # at least in the expected header file.  Check.  
 IU_CHECK_DECL(fclose, [#include <stdio.h>])  
 IU_CHECK_DECL(pclose, [#include <stdio.h>])  
 IU_CHECK_DECL(getcwd, [#include <unistd.h>])  
 IU_CHECK_DECL(getlogin, [#include <unistd.h>])  
 IU_CHECK_DECL(getpass, [#include <unistd.h>])  
 IU_CHECK_DECL(getusershell, [#include <unistd.h>])  
 IU_CHECK_DECL(ttyname, [#include <unistd.h>])  
 IU_CHECK_DECL(strerror, [#include <string.h>])  
 IU_CHECK_DECL(strchr, [#include <string.h>])  
 IU_CHECK_DECL(getgrnam, [#include <grp.h>])  
 IU_CHECK_DECL(initgroups, [#include <grp.h>])  
   
 IU_CHECK_DECL(htons,  
   [ #ifdef HAVE_SYS_TYPES_H  
     # include <sys/types.h>  
     #endif  
     #ifdef HAVE_SYS_PARAM_H  
     # include <sys/param.h>  
     #endif  
     #include <netinet/in.h> ])  
   
 if test "$ac_cv_func_setenv" = no; then  
   # Our home-grown version of setenv needs to use ENVIRON  
   IU_CHECK_DECL(environ,  
     [ #ifdef HAVE_UNISTD_H  
       # include <unistd.h>  
       #endif  
       #ifdef HAVE_STDLIB_H  
       # include <stdlib.h>  
       #endif ])  
 fi  
   
 # EWOULDBLOCK is more or less the BSD version of posix EAGAIN.  
 IU_CHECK_MACRO(EWOULDBLOCK, [#include <errno.h>], ,  
   :, AC_DEFINE(EWOULDBLOCK, EAGAIN))  
 IU_CHECK_DECL(errno, [#include <errno.h>])  
108    
109  # __P is the standard name for the ansi-or-not-ansi arg-decl macro.  dnl __P is the standard name for the ansi-or-not-ansi arg-decl macro.
110  # We define our own version in <config.h> if the system doesn't supply one.  dnl We define our own version in <config.h> if the system doesn't supply one.
111    dnl NOTE: This check has to be done pretty early because we use __P in <config.h>
112  IU_CHECK_MACRO(__P,  IU_CHECK_MACRO(__P,
113    [ #ifdef HAVE_SYS_CDEFS_H    [ #ifdef HAVE_SYS_CDEFS_H
114      #include <sys/cdefs.h>      #include <sys/cdefs.h>
115      #endif ])      #endif ])
116    
117  # If revoke hasn't been defined yet, just define a dummy version  AH_BOTTOM(
118  AC_REPLACE_FUNCS(revoke)  [#ifdef HAVE___P
119    /* The system defines __P; we tested for it in <sys/cdefs.h>, so include that
120       if we can.  */
121  AC_HEADER_DIRENT  # ifdef HAVE_SYS_CDEFS_H
122  AC_FUNC_CLOSEDIR_VOID  #  include <sys/cdefs.h>
123  AC_FUNC_ALLOCA  # endif
124  AC_FUNC_SETVBUF_REVERSED  #else /* !HAVE___P */
125  AC_FUNC_FORK([])  /* If the system includes don't seem to define __P, do it here instead.  */
126  AC_FUNC_STRCOLL  # if defined (__GNUC__) || (defined (__STDC__) && __STDC__) || defined (__cplusplus)
127    #  define       __P(args)       args    /* Use prototypes.  */
128  # See whether <syslog.h> will declare special internal stuff if we define  #else
129  # SYSLOG_NAMES before including it.  We check for various syslog internal macros,  #  define       __P(args)       ()      /* No prototypes.  */
130  # the typedef `CODE', and the variable `prioritynames'.  #endif
131  define([iu_syslog_includes],  #endif /* HAVE___P */])
   [[ #ifdef HAVE_STDLIB_H  
      #include <stdlib.h>  
      #endif  
      #define SYSLOG_NAMES  
      #include <syslog.h> ]])  
 IU_CHECK_MACRO(syslog internal macros,  
   iu_syslog_includes,  
   [LOG_MAKEPRI LOG_PRI LOG_FAC],  
   IU_CHECK_TYPE(CODE,  
     iu_syslog_includes,  
     IU_CHECK_DECL(prioritynames,  
       iu_syslog_includes,  
       AC_DEFINE(HAVE_SYSLOG_INTERNAL),  
       INCLUDES="$INCLUDES syslog-int.h"),  
     INCLUDES="$INCLUDES syslog-int.h"),  
   INCLUDES="$INCLUDES syslog-int.h")  
 undefine([iu_syslog_includes])  
132    
133  # libutil is a 4.4BSD library that defines several functions handy for  
134  # inetutil daemons, doing such things as utmp frobbing, and pty setup.  ### Checks for libraries.
135  AC_CHECK_LIB(util, logout, LIBUTIL=-lutil)  AC_CHECK_LIB(bsd, revoke)
136  AC_SUBST(LIBUTIL)  AC_CHECK_LIB(nsl, inet_ntoa)
137  # Look for the functions typically defined by libutil (which of course may  AC_CHECK_LIB(resolv, gethostname)
138  # not actually be in libutil), and and use our own versions if necesary.  AC_CHECK_LIB(socket, getpeername)
139  _SAVE_LIBS="$LIBS"  AC_CHECK_LIB(opie, opiegenerator)
140  LIBS="$LIBUTIL $LIBS"  AC_CHECK_LIB(z, gzdopen)
 AC_REPLACE_FUNCS(login logout logwtmp openpty forkpty ruserok iruserok login_tty)  
 LIBS="$_SAVE_LIBS"  
141    
142  # See if `weak refs' are possible; these make it possible (with shared  # We want to use libreadline if it is available.  However, it seems that the
143  # libraries) to check for the existance of a standard function at run-time  # guile hackers have had problems because there is a Solaris libreadline
144  # instead of compile time, which is very handy for distributing binary  # that is different from the GNU libreadline; therefore we test for an obscure
145  # version programs that automatically adapt -- in inetutils case, to whether  # function in the GNU libreadline.
146  # or not crypt is available.  #AC_CHECK_LIB(termcap, tputs)
147  IU_CHECK_WEAK_REFS  #AC_CHECK_LIB(readline, rl_bind_key,,, -ltermcap)
148    AC_CHECK_LIB(readline, rl_bind_key,
149                 [LIBREADLINE=-lreadline
150                  AC_DEFINE(HAVE_LIBREADLINE, 1,
151                       [Define to one if you have -lreadline])],
152                 [LIBREADLINE=], "$LIBTERMCAP")
153    AC_SUBST(LIBREADLINE)
154    AC_SUBST(LIBTERMCAP)
155    
156  # See if there's a separate libcrypt (many systems put crypt there)  dnl See if there's a separate libcrypt (many systems put crypt there)
157  AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt)  AC_CHECK_LIB(crypt, crypt, LIBCRYPT=-lcrypt)
158  AC_SUBST(LIBCRYPT)  AC_SUBST(LIBCRYPT)
159    
160  # Check if they want support for Wrap.  Certain daemons like  # See if a termcap library is available (under one of several names)
161  # ftpd have support for it.  IU_LIB_TERMCAP
162  AC_ARG_WITH(wrap, [  --with-wrap    add tcp wrapper support])  # If not, add a bogus version of tgetent to libinetutils, as that's the only
163  if test "$with_wrap" = yes; then  # function actually used (to check terminal type validity), modulo any
164  # See if we have libwrap.a  # dependencies from curses.
165  # we can not use AC_CHECK_LIB reliably since for the wrap lib  if test -z "$LIBTERMCAP"; then
166  # you have to define some global variables    # Some packages include termcap just ;
167  #AC_CHECK_LIB(wrap, hosts_ctl, LIBWRAP=-lwrap)    # for those cases, we really don't need termcap.
168    AC_MSG_CHECKING(hosts_ctl in -lwrap);    AC_LIBOBJ(stub_tgetent)
   save_LIBS=$LIBS  
   LIBS="$save_LIBS -lwrap"  
   AC_TRY_LINK([int allow_severity = 1; int deny_severity = 1;],  
               hosts_ctl(), eval "ac_cv_lib_wrap_hosts_ctl=yes",  
               eval "ac_cv_lib_wrap_hosts_ctl=no")  
   LIBS=$save_LIBS  
   if test "$ac_cv_lib_wrap_hosts_ctl" = yes ; then  
     AC_DEFINE(WITH_WRAP)  
     LIBWRAP=-lwrap  
   fi  
   AC_MSG_RESULT($ac_cv_lib_wrap_hosts_ctl);  
169  fi  fi
170  AC_SUBST(LIBWRAP)  
171    dnl libutil is a 4.4BSD library that defines several functions handy for
172    dnl inetutil daemons, doing such things as utmp frobbing, and pty setup.
173    AC_CHECK_LIB(util, logout, LIBUTIL=-lutil)
174    AC_SUBST(LIBUTIL)
175    
176  # Check if they want support for PAM.  Certain daemons like  # Check if they want support for PAM.  Certain daemons like
177  # ftpd have support for it.  # ftpd have support for it.
178  AC_ARG_WITH(pam, [  --with-pam    add support for PAM])  
179  # See if we have libpam.a this is for ftpd.  # See if we have libpam.a this is for ftpd.
180  if test "$with_pam" = yes ; then  if test "$with_pam" = yes ; then
181    AC_CHECK_LIB(dl, dlopen)    AC_CHECK_LIB(dl, dlopen)
182    AC_CHECK_LIB(pam, pam_authenticate, LIBPAM=-lpam)    AC_CHECK_LIB(pam, pam_authenticate, LIBPAM=-lpam)
183    if test "$ac_cv_lib_pam_pam_authenticate" = yes ; then    if test "$ac_cv_lib_pam_pam_authenticate" = yes ; then
184       AC_DEFINE(WITH_PAM)       AC_DEFINE(WITH_PAM, 1, [Define to one if you have -lpam.])
185    fi    fi
186  fi  fi
187  AC_SUBST(LIBPAM)  AC_SUBST(LIBPAM)
188    
 # Look for the crypt function itself (in libcrypt if possible)  
 _SAVE_LIBS="$LIBS"  
 LIBS="$LIBCRYPT $LIBS"  
 AC_CHECK_FUNCS(crypt)  
 LIBS="$_SAVE_LIBS"  
 # ... and see if it's declared anywhere  
 IU_CHECK_DECL(crypt, [#include <unistd.h>])  
   
 # Look for the posix SEEK_ macros (for lseek), and if not found, try the  
 # similar berkeley L_ macros; if neither can be found, use the classic unix  
 # values.  
 IU_CHECK_MACRO(SEEK_ macros,  
   [#include <unistd.h>], SEEK_SET SEEK_CUR SEEK_END,  
   :,  
   IU_CHECK_MACRO(L_ seek macros,  
     [#include <unistd.h>], L_SET L_INCR L_XTND,  
     AC_DEFINE(SEEK_SET, L_SET)  
     AC_DEFINE(SEEK_CUR, L_INCR)  
     AC_DEFINE(SEEK_END, L_XTND),  
     AC_DEFINE(SEEK_SET, 0)  
     AC_DEFINE(SEEK_CUR, 1)  
     AC_DEFINE(SEEK_END, 2)))  
   
 # Look for the posix _FILENO macros; if not found, use the classic unix values.  
 IU_CHECK_MACRO(_FILENO macros,  
   [#include <unistd.h>], STDIN_FILENO STDOUT_FILENO STDERR_FILENO,  
   :,  
   AC_DEFINE(STDIN_FILENO, 0)  
   AC_DEFINE(STDOUT_FILENO, 1)  
   AC_DEFINE(STDERR_FILENO, 2))  
   
 # See where to find fd_set (bit-vectors for select) manipulation macros.  
 IU_CHECK_MACRO(fd_set macros, [#include <sys/types.h>],  
   FD_ZERO FD_CLR FD_SET FD_ISSET)  
 if test "$inetutils_cv_macro_fd_set_macros" = no; then  
   IU_CHECK_MACRO(fd_set macros in <sys/time.h>, [#include <sys/time.h>],  
     FD_ZERO FD_CLR FD_SET FD_ISSET)  
 fi  
   
 # See if structure stat has a st_blksize member.  
 AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_BLKSIZE:  
         your code should no longer depend upon `HAVE_ST_BLKSIZE', but  
         `HAVE_STRUCT_STAT_ST_BLKSIZE'.  Remove this warning and  
         the `AC_DEFINE' when you adjust the code.])  
 AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1,  
                             [Define if your `struct stat' has  
                              `st_blksize'.  Deprecated, use  
                              `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])  
   
   
 # See if stat includes sub-second time information (the st_?timespec form is  
 # from bsd, and the st_?time_usec form is used by the hurd; the latter will  
 # eventually be replaced by the former).  
 IU_CHECK_STRUCT_FIELD(stat, st_mtimespec,  
   [ #include <sys/types.h>  
     #include <sys/stat.h> ],  
   :,  
   IU_CHECK_STRUCT_FIELD(stat, st_mtime_usec,  
     [ #include <sys/types.h>  
       #include <sys/stat.h>]))  
   
 # See if a termcap library is available (under one of several names)  
 IU_LIB_TERMCAP  
 # If not, add a bogus version of tgetent to libinetutils, as that's the only  
 # function actually used (to check terminal type validity), modulo any  
 # dependencies from curses.  
 if test -z "$LIBTERMCAP"; then  
   # Some packages include termcap just ;  
   # for those cases, we really don't need termcap.  
   LIBOBJS="$LIBOBJS stub_tgetent.o"  
 fi  
   
189  # Can we use libls? but we must have fchdir()  # Can we use libls? but we must have fchdir()
190  if test "$enable_libls" = yes  -a "$ac_cv_func_fchdir" = yes ; then  if test "$enable_libls" = yes  -a "$ac_cv_func_fchdir" = yes ; then
191    LIBLS="../libls/libls.a"    LIBLS="../libls/libls.a"
192    BUILD_LIBLS="libls.a"    libls_BUILD="libls.a"
193    AC_DEFINE(WITH_LIBLS)    AC_DEFINE(WITH_LIBLS, 1, [Define to one if you have -lls])
194  else  else
195    LIBLS=''    LIBLS=''
196    BUILD_LIBLS=''    libls_BUILD=''
197  fi  fi
198  AC_SUBST(LIBLS)  AC_SUBST(LIBLS)
199  AC_SUBST(BUILD_LIBLS)  AC_SUBST(libls_BUILD)
200    
201  # Only talk uses curses, so only check for it if we want that  # Only talk uses curses, so only check for it if we want that
202  if test "$enable_talk" != no; then  if test "$enable_talk" != no; then
# Line 426  else Line 209  else
209      AC_MSG_WARN([curses is not available, so not building talk])      AC_MSG_WARN([curses is not available, so not building talk])
210    fi    fi
211    enable_talk=no    enable_talk=no
212    BUILD_TALK=''    talk_BUILD=''
213  fi  fi
214    
 # We may need our own definition for struct osockaddr (equivalent to the  
 # old 4.3BSD struct sockaddr, and used in grotty bsd talk protocol)  
 IU_CHECK_TYPE(struct osockaddr,  
     [ #include <sys/types.h>  
       #include <sys/socket.h> ],  
     :, AC_DEFINE(HAVE_OSOCKADDR_H) INCLUDES="$INCLUDES osockaddr.h")  
 IU_CHECK_STRUCT_FIELD(sockaddr_in, sin_len,  
     [ #include <sys/types.h>  
       #include <netinet/in.h> ])  
   
215  # Look for a system `glob' function, and use our own if we can't find one (or  # Look for a system `glob' function, and use our own if we can't find one (or
216  # if the system one is missing features we need).  # if the system one is missing features we need).
217  sys_glob=no  sys_glob=no
# Line 453  if test "$ac_cv_header_glob_h" = yes; th Line 226  if test "$ac_cv_header_glob_h" = yes; th
226    LIBS="$_SAVE_LIBS"    LIBS="$_SAVE_LIBS"
227  fi  fi
228  if test "$sys_glob" != yes; then  if test "$sys_glob" != yes; then
229    BUILD_LIBGLOB=libglob.a    libglob_BUILD=libglob.a
230    LINK_SRCS="$LINK_SRCS glob/glob.h"    LINK_SRCS="$LINK_SRCS glob/glob.h"
231    LINK_DSTS="$LINK_DSTS include/glob.h"    LINK_DSTS="$LINK_DSTS include/glob.h"
232    LINK_SRCS="$LINK_SRCS glob/fnmatch.h"    LINK_SRCS="$LINK_SRCS glob/fnmatch.h"
233    LINK_DSTS="$LINK_DSTS include/fnmatch.h"    LINK_DSTS="$LINK_DSTS include/fnmatch.h"
234    LIBGLOB="-L../glob -lglob"    LIBGLOB="-L../glob -lglob"
235  else  else
236    BUILD_LIBGLOB=''    libglob_BUILD=''
237  fi  fi
238  AC_SUBST(LIBGLOB)  AC_SUBST(LIBGLOB)
239  AC_SUBST(BUILD_LIBGLOB)  AC_SUBST(libglob_BUILD)
240    
241    
242    dnl FIXME: Make this test case a bit more robust.  Is there a reason why
243    dnl        KRB4 exists?
244  LIBAUTH=  LIBAUTH=
245  INCAUTH=  INCAUTH=
246  if test "$enable_encryption" = yes -o "$enable_authentication" = yes; then  if test "$enable_encryption" = yes -o "$enable_authentication" = yes; then
247      AH_TEMPLATE(KERBEROS_IV, [Define to one if you have Kerberos IV])
248      AH_TEMPLATE(KRB4, [Define to one if you have Kerberos IV])
249      AH_TEMPLATE(KERBEROS, [Define to one if you have Kerberos])
250      AH_TEMPLATE(DES_ENCRYPTION, [FIXME])
251      AH_TEMPLATE(KERBEROS_V, [FIXME])
252      
253    if test $KERBEROS_VERSION -eq 4; then    if test $KERBEROS_VERSION -eq 4; then
254      AC_CHECK_LIB(krb, krb_mk_req,      AC_CHECK_LIB(krb, krb_mk_req,
255                   [LIBAUTH=-lkrb                   [LIBAUTH=-lkrb
# Line 478  if test "$enable_encryption" = yes -o "$ Line 260  if test "$enable_encryption" = yes -o "$
260        AC_CHECK_LIB(des, des_key_sched,        AC_CHECK_LIB(des, des_key_sched,
261                     [LIBAUTH="$LIBAUTH -ldes"],                     [LIBAUTH="$LIBAUTH -ldes"],
262                     -L$KERBEROS_DIR)                     -L$KERBEROS_DIR)
263        #FIXME:        dnl FIXME: Fix this to one test case.
264        test "$enable_authentication" = yes -a "$ac_cv_lib_krb_krb_mk_req" = yes\        test "$enable_authentication" = yes -a "$ac_cv_lib_krb_krb_mk_req" = yes\
265    && AC_DEFINE(KRB4)    && AC_DEFINE(KRB4)
266        test "$enable_authentication" = yes -a "$ac_cv_lib_krb_krb_mk_req" = yes \        test "$enable_authentication" = yes -a "$ac_cv_lib_krb_krb_mk_req" = yes \
# Line 504  fi Line 286  fi
286  AC_SUBST(LIBAUTH)  AC_SUBST(LIBAUTH)
287  AC_SUBST(INCAUTH)  AC_SUBST(INCAUTH)
288    
289  # define CPP macros that enable auth/encrypt code  dnl Define CPP macros that enable auth/encrypt code
290  if test ".$LIBAUTH" != .; then  if test ".$LIBAUTH" != .; then
291    test "$enable_authentication" = yes && AC_DEFINE(AUTHENTICATION)    test "$enable_authentication" = yes && AC_DEFINE(AUTHENTICATION, 1,
292    test "$enable_encryption" = yes     && AC_DEFINE(ENCRYPTION)                     [Define to one if you want authentication.])
293      test "$enable_encryption" = yes     && AC_DEFINE(ENCRYPTION, 1,
294                       [Define to one if you want encryption.])
295  fi  fi
296    
297  # We use our own version of getopt (including our own header file) if the  dnl Check if they want support for Wrap.  Certain daemons like
298  # system one doesn't have getopt_long.  dnl ftpd have support for it.
 AC_CHECK_FUNC(getopt_long, ,  
   INCLUDES="$INCLUDES getopt.h"  
   LIBOBJS="$LIBOBJS getopt.o getopt1.o")  
299    
300  # Supply a version of poll() if the libray is missing.  if test "$with_wrap" = yes; then
301  # syslogd uses poll() unconditionnaly.  dnl See if we have libwrap.a
302  AC_CHECK_FUNC(poll, ,  dnl we can not use AC_CHECK_LIB reliably since for the wrap lib
303    AC_DEFINE(HAVE_POLL_H)  dnl you have to define some global variables
304    INCLUDES="$INCLUDES poll.h"  #AC_CHECK_LIB(wrap, hosts_ctl, LIBWRAP=-lwrap)
305    LIBOBJS="$LIBOBJS poll.o")    AC_MSG_CHECKING(hosts_ctl in -lwrap);
306      save_LIBS=$LIBS
307      LIBS="$save_LIBS -lwrap"
308      AC_TRY_LINK([int allow_severity = 1; int deny_severity = 1;],
309                  hosts_ctl(), eval "ac_cv_lib_wrap_hosts_ctl=yes",
310                  eval "ac_cv_lib_wrap_hosts_ctl=no")
311      LIBS=$save_LIBS
312      if test "$ac_cv_lib_wrap_hosts_ctl" = yes ; then
313        AC_DEFINE(WITH_WRAP, 1, [Define to one if you have -lwrap.])
314        LIBWRAP=-lwrap
315      fi
316      AC_MSG_RESULT($ac_cv_lib_wrap_hosts_ctl);
317    fi
318    AC_SUBST(LIBWRAP)
319    
320  # Supply versions of the BSD error reporting functions if the system doesn't  
321  AC_CHECK_FUNC(verrx, ,  ### Checks for header files.
322    INCLUDES="$INCLUDES err.h"  AC_HEADER_STDC
323    LIBOBJS="$LIBOBJS err.o")  AC_HEADER_TIME
324    AC_HEADER_DIRENT
325    
326    AC_CHECK_HEADERS(arpa/nameser.h des.h errno.h fcntl.h features.h glob.h \
327                     krb.h memory.h malloc.h netinet/in_systm.h netinet/ip.h \
328                     netinet/ip_icmp.h netinet/ip_var.h \
329                     security/pam_appl.h \
330                     shadow.h stdarg.h stdlib.h string.h stropts.h sys/tty.h \
331                     sys/utsname.h sys/ptyvar.h sys/msgbuf.h sys/filio.h \
332                     sys/ioctl_compat.h sys/cdefs.h sys/stream.h sys/mkdev.h \
333                     sys/sockio.h sys/sysmacros.h sys/param.h sys/file.h \
334                     sys/proc.h sys/select.h sys/time.h sys/wait.h sys/resource.h \
335                     stropts.h tcpd.h termio.h termios.h utmp.h utmpx.h unistd.h \
336                     vis.h)
337    
338    AC_CHECK_HEADER(poll.h, , [INCLUDES="$INCLUDES poll.h"])
339    
340    
341    ### Checks for types.
342    dnl Checks return type of signal handlers
343    AC_TYPE_SIGNAL
344    
345    dnl We may need our own definition for struct osockaddr (equivalent to the
346    dnl old 4.3BSD struct sockaddr, and used in grotty bsd talk protocol)
347    AC_CHECK_TYPE(struct osockaddr, ,
348                  AC_DEFINE(HAVE_OSOCKADDR_H, 1,
349                            [Define to one if you have <osockaddr.h>.])
350                            INCLUDES="$INCLUDES osockaddr.h",
351                  [#include <sys/types.h>
352                   #include <sys/socket.h> ])
353    
354    AC_CHECK_TYPES(struct if_nameindex, , ,
355      [#include <sys/socket.h>
356       #include <net/if.h>])
357    
358    dnl sig_t is the type of a signal handler (4.4BSD)
359    AC_CHECK_TYPES(sig_t, , ,
360      [#include <sys/types.h>
361       #include <signal.h> ])
362    AH_BOTTOM(
363    [#ifndef HAVE_SIG_T
364    typedef RETSIGTYPE (*sig_t) ();
365    #endif])
366    
367    dnl sigset_t is a set of signals (4.4BSD)
368    AC_CHECK_TYPE(sigset_t, , AC_DEFINE(sigset_t, unsigned long, [FIXME]),
369      [#include <sys/types.h>
370       #include <signal.h> ])
371    
372    dnl I'm not sure what this is, but netbsd has it; just use int if necessary.
373    AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE(sig_atomic_t, int, [FIXME]),
374      [#include <sys/types.h>
375       #include <signal.h> ])
376    
377    AC_CHECK_TYPE(sa_family_t, , AC_DEFINE(sa_family_t, unsigned int, [FIXME]),
378        [#include <sys/types.h>
379         #ifdef HAVE_SOCKET_H
380         #include <socket.h>
381         #endif
382         #include <sys/socket.h> ])
383    
384    dnl Check for termio-related types and defines
385    AC_CHECK_TYPES(cc_t, , ,
386     [#if defined(HAVE_TERMIOS_H)
387      # include <termios.h>
388      #elif defined(HAVE_TERMIO_H)
389      # include <termio.h>
390      #else
391      # include <sgtty.h>
392      #endif ])
393    
394    
395    ### Checks for structures.
396    AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], , ,
397        [ #include <sys/types.h>
398          #include <netinet/in.h> ])
399    
400  if test "$ac_cv_header_utmp_h" = yes; then  if test "$ac_cv_header_utmp_h" = yes; then
401    IU_CHECK_TYPE(struct lastlog, [#include <utmp.h>])    AC_CHECK_TYPES(struct lastlog, , , [#include <utmp.h>])
402    IU_CHECK_STRUCT_FIELD(utmp, ut_type, [#ifdef HAVE_SYS_TYPES_H    AC_CHECK_MEMBERS([utmp.ut_type, utmp.ut_pid, utmp.ut_id, utmp.ut_user,
403                                          # include <sys/types.h>                      utmp.ut_host, utmp.ut_tv, utmp.ut_exit], , ,
404                                          #endif                     [#ifdef HAVE_SYS_TYPES_H
405                                          #include <utmp.h>])                      # include <sys/types.h>
406    IU_CHECK_STRUCT_FIELD(utmp, ut_pid, [#ifdef HAVE_SYS_TYPES_H                      #endif
407                                         # include <sys/types.h>                      #include <utmp.h>])
                                        #endif  
                                        #include <utmp.h>])  
   IU_CHECK_STRUCT_FIELD(utmp, ut_id, [#ifdef HAVE_SYS_TYPES_H  
                                       # include <sys/types.h>  
                                       #endif  
                                       #include <utmp.h>])  
   IU_CHECK_STRUCT_FIELD(utmp, ut_user, [#ifdef HAVE_SYS_TYPES_H  
                                         # include <sys/types.h>  
                                         #endif  
                                         #include <utmp.h>])  
   IU_CHECK_STRUCT_FIELD(utmp, ut_host, [#ifdef HAVE_SYS_TYPES_H  
                                         # include <sys/types.h>  
                                         #endif  
                                         #include <utmp.h>])  
   IU_CHECK_STRUCT_FIELD(utmp, ut_tv, [#ifdef HAVE_SYS_TYPES_H  
                                       # include <sys/types.h>  
                                       #endif  
                                       #include <utmp.h>])  
   IU_CHECK_STRUCT_FIELD(utmp, ut_exit, [#ifdef HAVE_SYS_TYPES_H  
                                         # include <sys/types.h>  
                                         #endif  
                                         #include <utmp.h>])  
408  fi  fi
409  if test "$ac_cv_header_utmpx_h" = yes; then  if test "$ac_cv_header_utmpx_h" = yes; then
410    IU_CHECK_STRUCT_FIELD(utmpx, ut_tv, [#include <utmpx.h>])    AC_CHECK_MEMBERS([struct utmpx.ut_tv], , , [#include <utmpx.h>])
411  fi  fi
412    
413  IU_CHECK_TYPE(struct if_nameindex,  AC_CHECK_MEMBERS([stuct ifreq.ifr_index, struct ifreq.ifr_netmask,
414    [ #include <sys/socket.h>                    struct ifreq.ifr_broadaddr], , ,
415      #include <net/if.h>])                   [#include <sys/socket.h>
416                      #include <net/if.h>])
417  IU_CHECK_STRUCT_FIELD(ifreq,  
418                        ifr_index,  AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
419                [#include <sys/socket.h>                   [#include <sys/types.h>
420                 #include <net/if.h>])                    #include <sys/socket.h>])
421    AC_CHECK_MEMBERS([struct hostent.h_addr_list], , , [#include <netdb.h>])
422  IU_CHECK_STRUCT_FIELD(ifreq,  
423                        ifr_netmask,  AC_CHECK_MEMBERS([struct stat.st_blksize])
424                [#include <sys/socket.h>  
425                 #include <net/if.h>])  AH_BOTTOM(
426    [#ifdef HAVE_SYS_PARAM_H
427  IU_CHECK_STRUCT_FIELD(ifreq,  #include <sys/types.h>
428                        ifr_broadaddr,  #include <sys/param.h>
429                [#include <sys/socket.h>  #endif
430                 #include <net/if.h>])  /* Get or fake the disk device blocksize.
431       Usually defined by sys/param.h (if at all).  */
432  IU_CHECK_STRUCT_FIELD(sockaddr,  #if !defined(DEV_BSIZE) && defined(BSIZE)
433                        sa_len,  #define DEV_BSIZE BSIZE
434                [#include <sys/types.h>  #endif
435                 #include <sys/socket.h>])  #if !defined(DEV_BSIZE) && defined(BBSIZE) /* SGI */
436    #define DEV_BSIZE BBSIZE
437    #endif
438    #ifndef DEV_BSIZE
439    #define DEV_BSIZE 4096
440    #endif
441    
442    /* Extract or fake data from a `struct stat'.
443       ST_BLKSIZE: Optimal I/O blocksize for the file, in bytes. */
444    #ifndef HAVE_STRUCT_STAT_ST_BLKSIZE
445    # define ST_BLKSIZE(statbuf) DEV_BSIZE
446    #else /* HAVE_STRUCT_STAT_ST_BLKSIZE */
447    /* Some systems, like Sequents, return st_blksize of 0 on pipes. */
448    # define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
449                                  ? (statbuf).st_blksize : DEV_BSIZE)
450    #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */])
451    
452    ### Checks for compiler characteristics.
453    AM_C_PROTOTYPES dnl FIXME: Does inetutils even compile on pre-ANSI compilers?
454    AC_C_CONST
455    
456    dnl See if `weak refs' are possible; these make it possible (with shared
457    dnl libraries) to check for the existance of a standard function at run-time
458    dnl instead of compile time, which is very handy for distributing binary
459    dnl version programs that automatically adapt -- in inetutils case, to whether
460    dnl or not crypt is available.
461    IU_CHECK_WEAK_REFS
462    
463    
464    ### Checks for library functions.
465    AC_FUNC_CLOSEDIR_VOID
466    AC_FUNC_ALLOCA
467    AC_FUNC_SETVBUF_REVERSED
468    AC_FUNC_FORK
469    AC_FUNC_STRCOLL
470    AC_FUNC_MMAP
471    
472    AC_CHECK_FUNCS(bcopy bcmp bzero cfsetspeed cgetent dirfd fchdir flock \
473                   fpathconf ftruncate \
474                   getcwd getmsg getspnam initgroups initsetproctitle killpg \
475                   mkstemp ptsname \
476                   setegid seteuid setpgid \
477                   setsid setregid setreuid setresgid setresuid setutent_r \
478                   sigaction sigvec strchr setproctitle tcgetattr tzset utimes \
479                   utime uname \
480                   updwtmp updwtmpx vhangup wait3 wait4)
481    AH_BOTTOM(
482    [#ifndef HAVE_BCOPY
483    #define bcopy(f,t,z) memmove(t,f,z)
484    #endif])
485    
486    AH_BOTTOM(
487    [#ifndef HAVE_BZERO
488    #define bzero(x,z) memset(x,0,z)
489    #endif])
490    
491    dnl Functions that we will define (in libinetutils) if necessary.
492    AC_REPLACE_FUNCS(getpass getusershell herror memcmp memcpy memmove memset \
493                     setenv strdup strcasecmp strsignal waitpid poll)
494    
495    dnl Look for the functions typically defined by libutil (which of course may
496    dnl not actually be in libutil), and and use our own versions if necesary.
497    _SAVE_LIBS="$LIBS"
498    LIBS="$LIBUTIL $LIBS"
499    AC_REPLACE_FUNCS(login logout logwtmp openpty forkpty ruserok iruserok login_tty)
500    LIBS="$_SAVE_LIBS"
501    
502    dnl Look for the crypt function itself (in libcrypt if possible)
503    _SAVE_LIBS="$LIBS"
504    LIBS="$LIBCRYPT $LIBS"
505    AC_CHECK_FUNCS(crypt)
506    LIBS="$_SAVE_LIBS"
507    
508    AH_BOTTOM(
509    [#ifndef HAVE_MEMCPY
510    #define memcpy memmove
511    #endif])
512    AH_BOTTOM(
513    [#if !defined(HAVE_MEMMOVE) || !defined(HAVE_MEMSET)
514    /* Make sure size_t is defined */
515    #include <sys/types.h>
516    #endif])
517    AH_BOTTOM(
518    [#ifndef HAVE_MEMMOVE
519    /* Declare our own silly version.  */
520    extern void *memmove __P ((void *to, const void *from, size_t sz));
521    #endif])
522    AH_BOTTOM(
523    [#ifndef HAVE_MEMSET
524    /* Declare our own silly version.  */
525    extern void memset __P ((void *mem, int val, size_t sz));
526    #endif])
527    
528    dnl FIXME: I don't understand this.
529    dnl If revoke hasn't been defined yet, just define a dummy version
530    AC_REPLACE_FUNCS(revoke)
531    
532    jm_INCLUDED_REGEX(libinetutils/regex.c)
533    
534  # See if the system has strerror, and replace it if not  AC_CHECK_FUNC(_obstack_free, ,
535  AC_CHECK_FUNC(strerror, , LIBOBJS="$LIBOBJS strerror.o")    AC_LIBOBJ(obstack) INCLUDES="$INCLUDES obstack.h")
536    
537    dnl Use (posix) `setpgid' if it's around, otherwise assume a BSD setpgrp
538    AC_CHECK_FUNC(setpgid, , AC_DEFINE(setpgid, setpgrp,
539                              [Define to `setpgrp' if you don't have `setpgid'.]))
540    
541    dnl We use our own version of getopt (including our own header file) if the
542    dnl system one doesn't have getopt_long.
543    AC_CHECK_FUNC(getopt_long, ,
544      AC_LIBOBJ(getopt)
545      AC_LIBOBJ(getopt1)
546      INCLUDES="$INCLUDES getopt.h")
547    
548    dnl Supply a version of poll() if the libray is missing.
549    dnl syslogd uses poll() unconditionnaly.
550    AC_CHECK_FUNC(poll, ,
551      AC_DEFINE(HAVE_POLL_H, 1, [Define to one if you have <poll.h>])
552      AC_LIBOBJ(poll)
553      INCLUDES="$INCLUDES poll.h")
554    
555    dnl Supply versions of the BSD error reporting functions if the system doesn't
556    AC_CHECK_FUNC(verrx, ,
557      AC_LIBOBJ(err)
558      INCLUDES="$INCLUDES err.h")
559    
560    dnl See if the __PROGNAME variable is defined, otherwise use our own.
561    AC_CHECK_FUNC(__progname,
562      AC_DEFINE(HAVE___PROGNAME, 1, [Define to one if you have __progname]),
563      AC_LIBOBJ(__progname))
564    
565    dnl See if snprintf exists, otherwise just use a bogus version
566    AC_CHECK_FUNC(snprintf,
567      AC_DEFINE(HAVE_SNPRINTF, 1, [Define to one if you have snprintf]),
568      AC_LIBOBJ(snprintf))
569    
570    dnl See if vsnprintf exists, otherwise use our own.
571    AC_CHECK_FUNC(vsnprintf,
572      AC_DEFINE(HAVE_VSNPRINTF, 1, [FIXME]),
573      AC_LIBOBJ(snprintf))
574    AH_BOTTOM(
575    [#ifndef HAVE_VSNPRINTF
576    #include <sys/types.h>
577    #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
578    #include <stdarg.h>
579    #else
580    #include <varargs.h>
581    #endif
582    extern int vsnprintf __P ((char *, size_t, const char *, va_list));
583    #endif])
584    
585    dnl See if the system has strerror, and replace it if not
586    AC_CHECK_FUNC(strerror, , AC_LIBOBJ(strerror))
587  if test "$ac_cv_func_strerror" = no; then  if test "$ac_cv_func_strerror" = no; then
588    # No strerror, so see if the SYS_ERRLIST variable can be used by ours    # No strerror, so see if the SYS_ERRLIST variable can be used by ours
589    AC_CHECK_FUNC(sys_errlist, AC_DEFINE(HAVE_SYS_ERRLIST))    AC_CHECK_FUNC(sys_errlist, AC_DEFINE(HAVE_SYS_ERRLIST, 1,
590                                  [Define to one if you have sys_errlist.]))
591    if test "$ac_cv_func_sys_errlist" = yes; then    if test "$ac_cv_func_sys_errlist" = yes; then
592      IU_CHECK_DECL(sys_errlist, [      AC_CHECK_DECL(sys_errlist, , ,
593        #include <stdio.h>       [#include <stdio.h>
594        #ifdef HAVE_ERRNO_H        #ifdef HAVE_ERRNO_H
595        #include <errno.h>        #include <errno.h>
596        #endif])        #endif])
597    fi    fi
598  fi  fi
599    
600  # See if we have h_errno (the test is here so we can use -lresolv if necessary).  dnl See if the system has hstrerror, and replace it if not
601  AC_CACHE_CHECK([for h_errno], inetutils_cv_var_h_errno,  AC_CHECK_FUNC(hstrerror, , AC_LIBOBJ(hstrerror))
   AC_TRY_COMPILE([#include <netdb.h>],  
     [ extern int h_errno; int iu_x = h_errno; ],  
     inetutils_cv_var_h_errno=yes, inetutils_cv_var_h_errno=no))  
 if test "$inetutils_cv_var_h_errno" = yes; then  
   AC_DEFINE(HAVE_H_ERRNO)  
   IU_CHECK_DECL(h_errno, [#include <netdb.h>])  
 fi  
   
 # See if the system has hstrerror, and replace it if not  
 AC_CHECK_FUNC(hstrerror, , LIBOBJS="$LIBOBJS hstrerror.o")  
602  if test "$ac_cv_func_hstrerror" = yes; then  if test "$ac_cv_func_hstrerror" = yes; then
603    IU_CHECK_DECL(hstrerror, [#include <netdb.h>])    AC_CHECK_DECL(hstrerror, , , [#include <netdb.h>])
604  else  else
605    # No hstrerror, so see if the H_ERRLIST variable can be used by ours    # No hstrerror, so see if the H_ERRLIST variable can be used by ours
606    AC_CHECK_FUNC(h_errlist)    AC_CHECK_FUNC(h_errlist)
607    if test "$ac_cv_func_h_errlist" = yes; then    if test "$ac_cv_func_h_errlist" = yes; then
608      IU_CHECK_DECL(h_errlist, [#include <netdb.h>])      AC_CHECK_DECL(h_errlist, , , [#include <netdb.h>])
609    fi    fi
610  fi  fi
611  if test "$ac_cv_func_hstrerror" = yes -o "$ac_cv_func_h_errlist" = yes; then  if test "$ac_cv_func_hstrerror" = yes -o "$ac_cv_func_h_errlist" = yes; then
# Line 627  if test "$ac_cv_func_hstrerror" = yes -o Line 613  if test "$ac_cv_func_hstrerror" = yes -o
613    # We still provide some definition, regardless, but this allows people to use    # We still provide some definition, regardless, but this allows people to use
614    # a reasonable alternative if the situation allows, rather than using a    # a reasonable alternative if the situation allows, rather than using a
615    # degenerate version that only says `Host lookup error N'.    # degenerate version that only says `Host lookup error N'.
616    AC_DEFINE(HAVE_HSTRERROR)    AC_DEFINE(HAVE_HSTRERROR, 1, [Define to one if you have hstrerror.])
617  fi  fi
618    
619  IU_CHECK_STRUCT_FIELD(hostent, h_addr_list, [#include <netdb.h>])  AH_BOTTOM(
620    [#ifndef HAVE_DECL_HSTRERROR
621    extern const char *hstrerror __P ((int));
622    #endif])
623    
624    ## Checks for function declarations.
625    
 # Checks return type of signal handlers  
 AC_TYPE_SIGNAL  
626  AC_DECL_SYS_SIGLIST  AC_DECL_SYS_SIGLIST
 # sig_t is the type of a signal handler (4.4BSD)  
 IU_CHECK_TYPE(sig_t,  
   [ #include <sys/types.h>  
     #include <signal.h> ])  
 # sigset_t is a set of signals (4.4BSD)  
 IU_CHECK_TYPE(sigset_t,  
   [ #include <sys/types.h>  
     #include <signal.h> ],  
   :, AC_DEFINE(sigset_t, unsigned long))  
 # I'm not sure what this is, but netbsd has it; just use int if necessary.  
 IU_CHECK_TYPE(sig_atomic_t,  
   [ #include <sys/types.h>  
     #include <signal.h> ],  
   :, AC_DEFINE(sig_atomic_t, int))  
   
   
 IU_CHECK_TYPE(sa_family_t,  
   [  
     #include <sys/types.h>  
     #ifdef HAVE_SOCKET_H  
     #include <socket.h>  
     #endif  
     #include <sys/socket.h> ],  
   :, AC_DEFINE(sa_family_t, unsigned int))  
627    
628  # See if the __PROGNAME variable is defined, otherwise use our own.  AC_CHECK_DECL(crypt, , , [#include <unistd.h>])
 AC_CHECK_FUNC(__progname,  
   AC_DEFINE(HAVE___PROGNAME),  
   LIBOBJS="$LIBOBJS __progname.o")  
629    
630  # See if snprintf exists, otherwise just use a bogus version  dnl EWOULDBLOCK is more or less the BSD version of posix EAGAIN.
631  AC_CHECK_FUNC(snprintf,  IU_CHECK_MACRO(EWOULDBLOCK, [#include <errno.h>], , ,
632    AC_DEFINE(HAVE_SNPRINTF),    AC_DEFINE(EWOULDBLOCK, EAGAIN, 1, [FIXME]))
633    LIBOBJS="$LIBOBJS snprintf.o")  AC_CHECK_DECL(errno, , , [#include <errno.h>])
634    
635    dnl See whether <syslog.h> will declare special internal stuff if we define
636    dnl SYSLOG_NAMES before including it.  We check for various syslog internal
637    dnl macros, the typedef `CODE', and the variable `prioritynames'.
638    define([iu_syslog_includes],
639      [[ #ifdef HAVE_STDLIB_H
640         #include <stdlib.h>
641         #endif
642         #define SYSLOG_NAMES
643         #include <syslog.h> ]])
644    IU_CHECK_MACRO(syslog internal macros,
645      iu_syslog_includes,
646      [LOG_MAKEPRI LOG_PRI LOG_FAC],
647      AC_CHECK_TYPE(CODE,
648        AC_CHECK_DECL(prioritynames,
649          AC_DEFINE(HAVE_SYSLOG_INTERNAL, 1, [FIXME]),
650          INCLUDES="$INCLUDES syslog-int.h",
651          iu_syslog_includes),
652        INCLUDES="$INCLUDES syslog-int.h", iu_syslog_includes),
653      INCLUDES="$INCLUDES syslog-int.h")
654    undefine([iu_syslog_includes])
655    
656  # See if vsnprintf exists, otherwise use our own.  dnl Some systems don't declare common functions (especially if they return
657  AC_CHECK_FUNC(vsnprintf,  dnl int), at least in the expected header file.  Check.
658    AC_DEFINE(HAVE_VSNPRINTF),  AC_CHECK_DECLS([fclose, pclose], , , [#include <stdio.h>])
659    LIBOBJS="$LIBOBJS snprintf.o")  AC_CHECK_DECLS([getcwd, getlogin, getpass, getusershell, ttyname], , ,
660                   [#include <unistd.h>])
661    AH_BOTTOM(
662    [#ifndef HAVE_DECL_GETLOGIN
663    extern char *getlogin __P((void));
664    #endif])
665    AH_BOTTOM(
666    [#ifndef HAVE_DECL_GETCWD
667    extern char *getcwd __P((char *, size_t));
668    #endif])
669    AH_BOTTOM(
670    [#ifndef HAVE_DECL_GETPASS
671    extern char *getpass __P((const char *));
672    #endif])
673    AH_BOTTOM(
674    [#ifndef HAVE_DECL_TTYNAME
675    extern char *ttyname __P ((int));
676    #endif])
677    
678    AC_CHECK_DECLS([strerror, strchr], , , [#include <string.h>])
679    AH_BOTTOM(
680    [#ifndef HAVE_DECL_STRERROR
681    extern const char *strerror __P ((int));
682    #endif])
683    AH_BOTTOM(
684    [#ifndef HAVE_DECL_STRCHR
685    extern char *strchr __P ((char *str, int ch));
686    extern char *strrchr __P ((char *str, int ch));
687    #endif
688    #ifndef HAVE_STRCHR
689    #define strchr index
690    #define strrchr rindex
691    #endif])
692    
693    AC_CHECK_DECLS([getgrnam, initgroups], , , [#include <grp.h>])
694    AH_BOTTOM(
695    [#ifndef HAVE_DECl_GETGRNAM
696    extern struct group *getgrnam __P ((const char *));
697    #endif])
698    
699  # We want to use libreadline if it is available.  However, it seems that the  AC_CHECK_DECLS(htons, , ,
700  # guile hackers have had problems because there is a Solaris libreadline    [ #ifdef HAVE_SYS_TYPES_H
701  # that is different from the GNU libreadline; therefore we test for an obscure      # include <sys/types.h>
702  # function in the GNU libreadline.      #endif
703  #AC_CHECK_LIB(termcap, tputs)      #ifdef HAVE_SYS_PARAM_H
704  #AC_CHECK_LIB(readline, rl_bind_key,,, -ltermcap)      # include <sys/param.h>
705  AC_CHECK_LIB(readline, rl_bind_key,      #endif
706               [LIBREADLINE=-lreadline      #include <netinet/in.h> ])
               AC_DEFINE(HAVE_LIBREADLINE)],  
              [LIBREADLINE=], "$LIBTERMCAP")  
 AC_SUBST(LIBREADLINE)  
 AC_SUBST(LIBTERMCAP)  
707    
708  AC_CHECK_LIB(opie, opiegenerator)  if test "$ac_cv_func_setenv" = no; then
709      dnl Our home-grown version of setenv needs to use ENVIRON
710      AC_CHECK_DECLS(environ, , ,
711        [ #ifdef HAVE_UNISTD_H
712          # include <unistd.h>
713          #endif
714          #ifdef HAVE_STDLIB_H
715          # include <stdlib.h>
716          #endif ])
717    fi
718    
719  AC_CHECK_LIB(z, gzdopen)  dnl See if we have h_errno (the test is here so we can use -lresolv
720    dnl if necessary).
721    AC_CACHE_CHECK([for h_errno], inetutils_cv_var_h_errno,
722      AC_TRY_COMPILE([#include <netdb.h>],
723        [ extern int h_errno; int iu_x = h_errno; ],
724        inetutils_cv_var_h_errno=yes, inetutils_cv_var_h_errno=no))
725    if test "$inetutils_cv_var_h_errno" = yes; then
726      dnl FIXME: Isn't this wrong? Shouldn't the declaration check define
727      dnl        this if we find h_errno?
728      AC_DEFINE(HAVE_H_ERRNO, 1, [Define to one if you have h_errno.])
729      AC_CHECK_DECL(h_errno, , , [#include <netdb.h>])
730    fi
731    
732  # Check for termio-related types and defines  ## Checks for CPP macros.
733  IU_CHECK_TYPE(cc_t,  dnl Look for the posix SEEK_ macros (for lseek), and if not found, try the
734   [ #if defined(HAVE_TERMIOS_H)  dnl similar berkeley L_ macros; if neither can be found, use the classic unix
735     # include <termios.h>  dnl values.
736     #elif defined(HAVE_TERMIO_H)  IU_CHECK_MACRO(SEEK_ macros,
737     # include <termio.h>    [#include <unistd.h>], SEEK_SET SEEK_CUR SEEK_END,
738     #else    :,
739     # include <sgtty.h>    IU_CHECK_MACRO(L_ seek macros,
740     #endif ])      [#include <unistd.h>], L_SET L_INCR L_XTND,
741        AC_DEFINE(SEEK_SET, L_SET, [FIXME])
742        AC_DEFINE(SEEK_CUR, L_INCR, [FIXME])
743        AC_DEFINE(SEEK_END, L_XTND, [FIXME]),
744        AC_DEFINE(SEEK_SET, 0, [FIXME])
745        AC_DEFINE(SEEK_CUR, 1, [FIXME])
746        AC_DEFINE(SEEK_END, 2, [FIXME])))
747    
748  # For now, we always use libexecdir; later we may want to vary where the  dnl Look for the posix _FILENO macros; if not found, use the classic unix values.
749  # daemons go.  IU_CHECK_MACRO(_FILENO macros,
750  inetdaemondir='$(libexecdir)'    [#include <unistd.h>], STDIN_FILENO STDOUT_FILENO STDERR_FILENO,
751  AC_SUBST(inetdaemondir)    :,
752      AC_DEFINE(STDIN_FILENO, 0, [FIXME])
753      AC_DEFINE(STDOUT_FILENO, 1, [FIXME])
754      AC_DEFINE(STDERR_FILENO, 2, [FIXME]))
755    
756  # Configure paths used by inetutils programs.  See the file `paths' for  dnl See where to find fd_set (bit-vectors for select) manipulation macros.
757  # details.  IU_CHECK_MACRO(fd_set macros, [#include <sys/types.h>],
758      FD_ZERO FD_CLR FD_SET FD_ISSET)
759    if test "$inetutils_cv_macro_fd_set_macros" = no; then
760      IU_CHECK_MACRO(fd_set macros in <sys/time.h>, [#include <sys/time.h>],
761        FD_ZERO FD_CLR FD_SET FD_ISSET)
762    fi
763    
764    dnl Configure paths used by inetutils programs.  See the file `paths' for
765    dnl details.
766  PATHDEFS_MAKE=pathdefs.make  PATHDEFS_MAKE=pathdefs.make
767  PATHS_DEFS=paths.defs  PATHS_DEFS=paths.defs
768  IU_CONFIG_PATHS($srcdir/paths, PATHDEFS_MAKE, PATHS_DEFS)  IU_CONFIG_PATHS($srcdir/paths, PATHDEFS_MAKE, PATHS_DEFS)
769    AH_BOTTOM(
770    [/* Defaults for PATH_ variables.  */
771    #include <include/confpaths.h>])
772    
773  # Supply optional header files by linking a copy into the object include dir  dnl Supply optional header files by linking a copy into the object include dir
774  LINK_SRCS="$LINK_SRCS `for I in $INCLUDES; do echo $ac_n ' 'headers/$I$ac_c; done`"  LINK_SRCS="$LINK_SRCS `for I in $INCLUDES; do echo $ac_n ' 'headers/$I$ac_c; done`"
775  LINK_DSTS="$LINK_DSTS `for I in $INCLUDES; do echo $ac_n ' 'include/$I$ac_c; done`"  LINK_DSTS="$LINK_DSTS `for I in $INCLUDES; do echo $ac_n ' 'include/$I$ac_c; done`"
776  ac_sources="$LINK_SRCS"  ac_sources="$LINK_SRCS"
777  ac_dests="$LINK_DSTS"  ac_dests="$LINK_DSTS"
778  while test -n "$ac_sources"; do  while test -n "$ac_sources"; do
779    set $ac_dests; ac_dest=$1; shift; ac_dests=$*    set $ac_dests
780    set $ac_sources; ac_source=$1; shift; ac_sources=$*    ac_dest=$1
781      shift
782      ac_dests=$*
783      set $ac_sources
784      ac_source=$1
785      shift
786      ac_sources=$*
787    ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"    ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
788  done  done
789  AC_CONFIG_LINKS([$ac_config_links_1])  AC_CONFIG_LINKS([$ac_config_links_1])
790    
791  AC_FUNC_MMAP  dnl Ok this is the end of the rope, even autoconf can't help.
792    dnl For example on certain system login(1) will not work if we
793  AC_SUBST(VERSION)  dnl don't have an entry in utmpx.
794    dnl Also for some OS they are better handle with STREAMS
 # Ok this is the end of the rope, even autoconf can't help.  
 # For example on certain system login(1) will not work if we  
 # don't have an entry in utmpx.  
 # Also for some OS they are better handle with STREAMS  
795  case "$host" in  case "$host" in
796  *olaris*)  *olaris*)
797    AC_DEFINE(SOLARIS)    AC_DEFINE(SOLARIS, 1, [FIXME])
798    AC_DEFINE(UTMPX)    AC_DEFINE(UTMPX, 1, [FIXME])
799    AC_DEFINE(SOLARIS)    AC_DEFINE(HAVE_STREAMSPTY, 1, [FIXME])
   AC_DEFINE(HAVE_STREAMSPTY)  
800    ;;    ;;
801  *irix*)  *irix* | *hpux*)
802    AC_DEFINE(UTMPX)    AC_DEFINE(UTMPX, 1, [FIXME])
803    ;;    AC_DEFINE(UTMPX, 1, [FIXME])
 *hpux*)  
   AC_DEFINE(UTMPX)  
804    ;;    ;;
805  esac  esac
806    
# Line 760  include/confpaths.h:headers/confpaths.h. Line 816  include/confpaths.h:headers/confpaths.h.
816  headers/Makefile include/version.h:headers/version.h.in  headers/Makefile include/version.h:headers/version.h.in
817  doc/Makefile doc/rfc/Makefile])  doc/Makefile doc/rfc/Makefile])
818  AC_OUTPUT  AC_OUTPUT
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26