📄 configure.ac
字号:
dnl Check if they want support for Wrap. Certain daemons likednl ftpd have support for it.if test "$with_wrap" = yes; thendnl See if we have libwrap.adnl we can not use AC_CHECK_LIB reliably since for the wrap libdnl you have to define some global variables#AC_CHECK_LIB(wrap, hosts_ctl, LIBWRAP=-lwrap) AC_MSG_CHECKING(hosts_ctl in -lwrap); 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, 1, [Define to one if you have -lwrap.]) LIBWRAP=-lwrap fi AC_MSG_RESULT($ac_cv_lib_wrap_hosts_ctl);fiAC_SUBST(LIBWRAP)### Checks for header files.AC_HEADER_STDCAC_HEADER_TIMEAC_HEADER_DIRENTAC_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 \ readline/readline.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], [], [], [#include <sys/types.h>#ifdef HAVE_NETINET_IN_SYSTM_H# include <netinet/in_systm.h>#endif#include <netinet/in.h>#ifdef HAVE_NETINET_IP_H# include <netinet/ip.h>#endif#ifdef HAVE_SYS_PARAM_H# include <sys/param.h>#endif])### Checks for types.dnl Checks return type of signal handlersAC_TYPE_SIGNALAC_CHECK_TYPE(socklen_t, , AC_DEFINE(socklen_t, int, [Define to int if <sys/types.h> does not define], [#include <sys/types.h>]))dnl We may need our own definition for struct osockaddr (equivalent to thednl old 4.3BSD struct sockaddr, and used in grotty bsd talk protocol)AC_CHECK_TYPE(struct osockaddr, , [AC_DEFINE(HAVE_OSOCKADDR_H, 1, [Define to one if you have <osockaddr.h>.])], [#include <sys/types.h> #include <sys/socket.h> ])AC_CHECK_TYPES(struct if_nameindex, , , [#include <sys/types.h> #include <sys/socket.h> #include <net/if.h>])dnl sig_t is the type of a signal handler (4.4BSD)AC_CHECK_TYPES(sig_t, , , [#include <sys/types.h> #include <signal.h> ])dnl sigset_t is a set of signals (4.4BSD)AC_CHECK_TYPE(sigset_t, , AC_DEFINE(sigset_t, unsigned long, [FIXME]), [#include <sys/types.h> #include <signal.h> ])dnl I'm not sure what this is, but netbsd has it; just use int if necessary.AC_CHECK_TYPE(sig_atomic_t, , AC_DEFINE(sig_atomic_t, int, [FIXME]), [#include <sys/types.h> #include <signal.h> ])AC_CHECK_TYPE(sa_family_t, , AC_DEFINE(sa_family_t, unsigned int, [FIXME]), [#include <sys/types.h> #ifdef HAVE_SOCKET_H #include <socket.h> #endif #include <sys/socket.h> ])dnl Check for termio-related types and definesAC_CHECK_TYPES(cc_t, , , [#if defined(HAVE_TERMIOS_H) # include <termios.h> #elif defined(HAVE_TERMIO_H) # include <termio.h> #else # include <sgtty.h> #endif ])dnl Check for compile support for ceratin typeAC_CHECK_TYPE(long long, , AC_DEFINE(LONG_LONG, long, [Define to long if compiler does not support]))AC_CHECK_TYPE(long double, , AC_DEFINE(LONG_DOUBLE, double, [Define to double if compiler does not support]))### Checks for structures.IU_CHECK_MEMBERS([struct sockaddr_in.sin_len], , , [ #include <sys/types.h> #include <netinet/in.h> ])if test "$ac_cv_header_utmp_h" = yes; then AC_CHECK_TYPES(struct lastlog, , , [#include <utmp.h>]) IU_CHECK_MEMBERS([struct utmp.ut_type, struct utmp.ut_pid, struct utmp.ut_id, struct utmp.ut_user, struct utmp.ut_host, struct utmp.ut_tv, struct utmp.ut_exit], , , [#include <sys/types.h> #include <utmp.h>])fiif test "$ac_cv_header_utmpx_h" = yes; then IU_CHECK_MEMBERS([struct utmpx.ut_tv], , , [#include <utmpx.h>])fiIU_CHECK_MEMBERS([stuct ifreq.ifr_index, struct ifreq.ifr_netmask, struct ifreq.ifr_broadaddr], , , [#include <sys/types.h> #include <sys/socket.h> #include <net/if.h>])IU_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/types.h> #include <sys/socket.h>])IU_CHECK_MEMBERS([struct hostent.h_addr_list], , , [#include <netdb.h>])IU_CHECK_MEMBERS([struct stat.st_blksize])### Checks for compiler characteristics.AM_C_PROTOTYPES dnl FIXME: Does inetutils even compile on pre-ANSI compilers?AC_C_CONSTdnl See if `weak refs' are possible; these make it possible (with shareddnl libraries) to check for the existance of a standard function at run-timednl instead of compile time, which is very handy for distributing binarydnl version programs that automatically adapt -- in inetutils case, to whetherdnl or not crypt is available.IU_CHECK_WEAK_REFS### Checks for library functions.AC_FUNC_CLOSEDIR_VOIDAC_FUNC_ALLOCAAC_FUNC_SETVBUF_REVERSEDAC_FUNC_FORKAC_FUNC_STRCOLLAC_FUNC_MMAPAC_FUNC_MALLOCAC_FUNC_REALLOCAC_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)dnl Functions that we will define if necessary.AC_REPLACE_FUNCS(getpass getusershell memcmp memcpy memmove memset \ setenv strdup poll)dnl Look for the crypt function itself (in libcrypt if possible)_SAVE_LIBS="$LIBS"LIBS="$LIBCRYPT $LIBS"AC_CHECK_FUNCS(crypt)LIBS="$_SAVE_LIBS"jm_INCLUDED_REGEX(libinetutils/regex.c)AC_CHECK_FUNC(_obstack_free)dnl Use (posix) `setpgid' if it's around, otherwise assume a BSD setpgrpAC_CHECK_FUNC(setpgid, , AC_DEFINE(setpgid, setpgrp, [Define to `setpgrp' if you don't have `setpgid'.]))dnl We use our own version of getopt (including our own header file) if thednl system one doesn't have getopt_long.AC_CHECK_FUNC(getopt_long)AC_CHECK_HEADER(poll.h)dnl Supply a version of poll() if the libray is missing.dnl syslogd uses poll() unconditionnaly.AC_CHECK_FUNC(poll, , [AC_DEFINE(HAVE_POLL_H, 1, [Define to one if you have <poll.h>])])dnl See if snprintf exists, otherwise just use a bogus versionAC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF, 1, [Define to one if you have snprintf])])dnl See if vsnprintf exists, otherwise use our own.AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF, 1, [Define to one if you have vsnprintf])])dnl See if the system has strerror, and replace it if notAC_CHECK_FUNC(strerror)if test "$ac_cv_func_strerror" = no; then # No strerror, so see if the SYS_ERRLIST variable can be used by ours AC_CHECK_FUNC(sys_errlist, AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define to one if you have sys_errlist.])) if test "$ac_cv_func_sys_errlist" = yes; then AC_CHECK_DECL(sys_errlist, , , [#include <stdio.h> #ifdef HAVE_ERRNO_H #include <errno.h> #endif]) fifidnl See if the system has hstrerror, and replace it if notAC_CHECK_FUNC(hstrerror)if test "$ac_cv_func_hstrerror" = yes; then AC_CHECK_DECL(hstrerror, , , [#include <netdb.h>])else # No hstrerror, so see if the H_ERRLIST variable can be used by ours AC_CHECK_FUNC(h_errlist) if test "$ac_cv_func_h_errlist" = yes; then AC_CHECK_DECL(h_errlist, , , [#include <netdb.h>]) fifiif test "$ac_cv_func_hstrerror" = yes -o "$ac_cv_func_h_errlist" = yes; then # If there's a system hstrerror, or we can reasonably replace it, say so. # We still provide some definition, regardless, but this allows people to use # a reasonable alternative if the situation allows, rather than using a # degenerate version that only says `Host lookup error N'. AC_DEFINE(HAVE_HSTRERROR, 1, [Define to one if you have hstrerror.])fi## Checks for function declarations.AC_DECL_SYS_SIGLISTAC_CHECK_DECLS(crypt, , , [#include <unistd.h>])dnl EWOULDBLOCK is more or less the BSD version of posix EAGAIN.IU_CHECK_MACRO(EWOULDBLOCK, [#include <errno.h>], , , AC_DEFINE(EWOULDBLOCK, EAGAIN, 1, [FIXME]))AC_CHECK_DECLS(errno, , , [#include <errno.h>])dnl See whether <syslog.h> will declare special internal stuff if we definednl SYSLOG_NAMES before including it. We check for various syslog internaldnl macros, the typedef `CODE', and the variable `prioritynames'.define([iu_syslog_includes], [[#include <stdlib.h> #define SYSLOG_NAMES #include <syslog.h> ]])IU_CHECK_MACRO(syslog internal macros, iu_syslog_includes, [LOG_MAKEPRI LOG_PRI LOG_FAC], AC_CHECK_TYPE(CODE, AC_CHECK_DECL(prioritynames, AC_DEFINE(HAVE_SYSLOG_INTERNAL, 1, [FIXME]),, iu_syslog_includes), , iu_syslog_includes),)undefine([iu_syslog_includes])dnl Some systems don't declare common functions (especially if they returndnl int), at least in the expected header file. Check.AC_CHECK_DECLS([fclose, pclose], , , [#include <stdio.h>])AC_CHECK_DECLS([getcwd, getlogin, getpass, getusershell, ttyname], , , [#include <unistd.h>])AC_CHECK_DECLS([getgrnam, initgroups], , , [#include <grp.h>])AC_CHECK_DECLS(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> ])dnl Our home-grown version of setenv needs to use ENVIRONAC_CHECK_DECLS(environ, , , [ #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif ])dnl See if we have h_errno (the test is here so we can use -lresolvdnl if necessary).AC_CACHE_CHECK([for h_errno], inetutils_cv_var_h_errno, 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 dnl FIXME: Isn't this wrong? Shouldn't the declaration check define dnl this if we find h_errno? AC_DEFINE(HAVE_H_ERRNO, 1, [Define to one if you have h_errno.]) AC_CHECK_DECL(h_errno, , , [#include <netdb.h>])fi## Checks for CPP macros.dnl Look for the posix SEEK_ macros (for lseek), and if not found, try thednl similar berkeley L_ macros; if neither can be found, use the classic unixdnl 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, [FIXME]) AC_DEFINE(SEEK_CUR, L_INCR, [FIXME]) AC_DEFINE(SEEK_END, L_XTND, [FIXME]), AC_DEFINE(SEEK_SET, 0, [FIXME]) AC_DEFINE(SEEK_CUR, 1, [FIXME]) AC_DEFINE(SEEK_END, 2, [FIXME])))dnl 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, [FIXME]) AC_DEFINE(STDOUT_FILENO, 1, [FIXME]) AC_DEFINE(STDERR_FILENO, 2, [FIXME]))dnl 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)fidnl Configure paths used by inetutils programs. See the file `paths' fordnl details.PATHDEFS_MAKE=pathdefs.makePATHS_DEFS=paths.defsIU_CONFIG_PATHS($srcdir/paths, PATHDEFS_MAKE, PATHS_DEFS)AH_BOTTOM([/* Defaults for PATH_ variables. */#include <confpaths.h>])dnl Define ARG_UNUSED macrodnlAH_BOTTOM([#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)# define __attribute__(x)#endif#ifndef ARG_UNUSED# define ARG_UNUSED __attribute__ ((__unused__))#endif])dnl Ok this is the end of the rope, even autoconf can't help.dnl For example on certain system login(1) will not work if wednl don't have an entry in utmpx.dnl Also for some OS they are better handle with STREAMScase "$host" in*olaris*) AC_DEFINE(SOLARIS, 1, [FIXME]) AC_DEFINE(UTMPX, 1, [FIXME]) AC_DEFINE(HAVE_STREAMSPTY, 1, [FIXME]) ;;*irix* | *hpux*) AC_DEFINE(UTMPX, 1, [FIXME]) AC_DEFINE(UTMPX, 1, [FIXME]) ;;esacAC_CONFIG_FILES([Makefile lib/Makefilelibinetutils/Makefile libtelnet/Makefile glob/Makefilelibicmp/Makefile ping/Makefile ftp/Makefile ftpd/Makefile inetd/Makefilercp/Makefilerexecd/Makefile rlogin/Makefile rlogind/Makefile rsh/Makefilershd/Makefile logger/Makefile syslogd/Makefile talk/Makefiletalkd/Makefile telnet/Makefile telnetd/Makefile tftp/Makefiletftpd/Makefile uucpd/Makefile gwhois/Makefile libls/Makefileifconfig/Makefileifconfig/system/Makefileconfpaths.h:confpaths.h.inheaders/Makefiledoc/Makefile doc/rfc/Makefile])AC_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -