1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
dnl Process this file with autoconf to produce a configure script.
dnl init
AC_INIT(fn_bind.c)
AM_INIT_AUTOMAKE(cftp, 0.10)
AM_CONFIG_HEADER(config.h)
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS='-g' auto_cflags=1
AC_PROG_CC
dnl # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
dnl test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_SUBST(DOMAINNAME)dnl
dnl programs
dnl libraries
TERMCAP=none
AC_CHECK_FUNC(tgetent, [TERMCAP=""])
if test "$TERMCAP" = none
then
AC_CHECK_LIB(termcap, tgetent, [TERMCAP=-ltermcap])
fi
if test "$TERMCAP" = none
then
AC_CHECK_LIB(curses, tgetent, [TERMCAP=-lcurses])
fi
if test "$TERMCAP" = none
then
AC_CHECK_LIB(ncurses, tgetent, [TERMCAP=-lncurses])
fi
if test "$TERMCAP" = none
then
AC_MSG_ERROR([can't find termcap (emulation) library])
fi
LIBS="$LIBS $TERMCAP"
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(resolv, main)
dnl header files
AC_CHECK_HEADERS(sys/select.h)
AC_CACHE_CHECK([whether h_errno is declared in netdb.h],
dlo_cv_decl_h_errno,
AC_TRY_COMPILE([#include "netdb.h"], [h_errno = 0;],
[dlo_cv_decl_h_errno=yes],
[dlo_cv_decl_h_errno=no]))
if test "$dlo_cv_decl_h_errno" = yes; then
AC_DEFINE(H_ERRNO_DECLARED, 1, [Define if netdb.h declares h_errno])
fi
dnl typedefs
dnl structures
NIH_CHECK_STRUCT([#include <sys/types.h>
#include <sys/socket.h>], sockaddr_storage)
NIH_CHECK_STRUCT_MEMBER([#include <sys/types.h>
#include <sys/socket.h>], sockaddr, sa_len)
dnl compiler characteristics
dnl library functions
AC_REPLACE_FUNCS(strdup getcwd getdomainname strerror basename fputchar fnmatch inet_aton getaddrinfo)
AC_CHECK_FUNCS(tparam, [tparam=1], [tparam=0])
if test "$tparam" -ne 1
then
AC_CHECK_FUNCS(tparm, , [LIBOBJS="$LIBOBJS tparam.o"])
fi
AC_CHECK_FUNCS(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
if test `expr "$LIBOBJS" : getdomainname` -ne 0
then
AC_CHECK_PROG(DOMAINNAME_PRG, domainname, YES, NO)
if test "$DOMAINNAME_PRG" = "YES"
then
DOMAINNAME=`domainname`
else
DOMAINNAME=""
fi
else
DOMAINNAME=""
fi
dnl system services
dnl output
AC_OUTPUT(Makefile)
|