dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (c) 1997, by Carlo Wood dnl Make sure we are in the correct directory (someone could have run dnl 'configure' with a wrong '--srcdir'); Note that a bug in autoconf dnl forces us to have srcdir == dir where configure resides (config): AC_INIT(config-sh.in) dnl 'configure' must be run from within 'config/'. AC_CONFIG_AUX_DIR(.) dnl Define the input and output configuration header file, dnl (Generate config/setup.h from config/setup.h.in): AC_CONFIG_HEADER(setup.h) dnl Demand at least version 2.13 of autoconf AC_PREREQ(2.13) dnl This should be done early. AC_PROG_CC dnl UNIX Variants dnl Allow the use of BSD functions on AIX. AC_AIX dnl Allow the use of POSIX functions on several OS. AC_ISC_POSIX AC_MINIX dnl ANSIfy the C compiler whenever possible. AM_PROG_CC_STDC dnl Use -O3 instead of -O2. if test "$CFLAGS" != "" ; then CFLAGS=`echo "$CFLAGS" | sed -e 's/-O2/-O3/'` fi dnl Remove -pipe during configure if test "$CFLAGS" != "" ; then CFLAGS=`echo "$CFLAGS" | sed -e 's/-pipe//g'` fi dnl Checks for libraries. AC_CHECK_LIB(c, crypt, [true], AC_CHECK_LIB(descrypt, crypt, LIBS="-ldescrypt $LIBS", AC_CHECK_LIB(crypt, crypt))) AC_CHECK_LIB(c, gethostbyname, [true], AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="-lnsl $LIBS")) dnl IRIX has -lsocket, but doesn't need it. AC_CHECK_LIB(c, socket, [true], AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS")) unet_CHECK_LIB_RESOLV dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(malloc.h sys/malloc.h fcntl.h string.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h memory.h errno.h net/errno.h sys/cdefs.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T unet_CHECK_TYPE_SIZES dnl Define SIZE_T_FMT and TIME_T_FMT to be the printf format for dnl respectively size_t and time_t. unet_DEFINE_SIZE_T_FMT unet_DEFINE_TIME_T_FMT dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(strchr memcpy memmove) AC_CHECK_FUNCS(gethostname gettimeofday mkdir strerror strtoken) AC_CHECK_FUNCS(select socket uname) AC_CHECK_FUNCS(setrlimit inet_netof getrusage times res_init) dnl Do we have a system call poll? unet_FUNC_POLL_SYSCALL dnl Do we have restarting syscalls ? AC_SYS_RESTARTABLE_SYSCALLS dnl Test for programs AC_PROG_AWK AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROGS(RMPROG, rm, /bin/rm) AC_PATH_PROGS(SHPROG, sh, /bin/sh) dnl Test if /bin/sh supports 'set -h' AC_CACHE_CHECK([for set -h], unet_cv_sys_set_h, [echo "set -h; exit $?" > conftest ; $SHPROG ./conftest 2> conftest.out ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then unet_cv_sys_set_h=yes else unet_cv_sys_set_h=no fi $RMPROG -fr conftest*]) dnl Used in Configure. AC_SUBST(unet_cv_sys_set_h) unet_NONBLOCKING unet_SIGNALS dnl Add -pipe when possible unet_PIPE_CFLAGS dnl Used in config-sh. AC_SUBST(ac_cv_header_poll_h) AC_SUBST(ac_cv_header_syslog_h) AC_SUBST(unet_cv_func_poll_syscall) dnl Finally really generate all output files: AC_OUTPUT(config-sh Configure ../Makefile ../ircd/Makefile ../doc/Makefile Makefile, [echo timestamp > stamp-h;],)