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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
dnl Process this file with autoconf to produce a configure script.
dnl Autoconfigure input file for suck
AC_INIT(suck.c)
AC_CONFIG_HEADER(config.h)
AC_ARG_WITH(inn-lib, [ --with-inn-lib=path location of libinn.a])
AC_ARG_WITH(inn-include, [ --with-inn-include=path location of inn include files])
AC_ARG_WITH(perl-exe, [ --with-perl-exe=full path to perl executable eg: /usr/bin])
# we want these before the checks, so the checks can modify their values
test -z "$CFLAGS" && CFLAGS=-O2 AC_SUBST(CFLAGS)
test -z "$LDFLAGS" && LDFLAGS=-s AC_SUBST(LDFLAGS)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_SUBST(GCC)
dnl Checks for libraries.
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(socks, Rconnect)
AC_CHECK_LIB(socks5, SOCKSconnect)
AC_CHECK_LIB(cV, fprintf)
dnl Do I need -lcrypto????? for SSL
AC_CHECK_LIB(ssl, SSL_get_error, [SSL_LIB="-lssl"; SSL_DEFS="-DHAVE_LIBSSL"])
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h limits.h regex.h sys/select.h net/socket.h arpa/inet.h socks.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday select strerror memmove setvbuf sigaction)
if test "$with_inn_lib" ; then
LDFLAGS="$DB_LIB -L${with_inn_lib}"
fi
if test "$with_inn_include" ; then
testpath=$with_inn_include
else
testpath="/usr/include/inn /usr/local/include /usr/local/include/inn"
fi
HISTORY="chkhistory_db.o"
AC_CHECK_LIB(inn, main, [
DB_LIB="-linn"
DB_TYPE="-DUSE_INN23"
savedLIBS=$LIBS
LIBS="$LIBS -linn"
AC_CHECK_FUNC(QIOopen, , [
LIBS="$savedLIBS -lstorage"
AC_CHECK_FUNC(QIOopen, [DB_LIB="$DB_LIB -lstorage"])
])
LIBS=$savedLIBS
AC_MSG_CHECKING([for libinn.h])
for path in $testpath ; do
if test -f $path/libinn.h; then
AC_MSG_RESULT($path)
found="yes"
CPPFLAGS="$CPPFLAGS -I$path"
if test ! -f $path/configdata.h ; then
CPPFLAGS="$CPPFLAGS -DNO_CONFIGDATA"
fi
break
fi
done
test "$found" != "yes" && AC_MSG_RESULT(not found)
], [
AC_CHECK_LIB(dbz, main, [DB_LIB="-ldbz"; DB_TYPE="-DUSE_DBZ"], [
AC_CHECK_LIB(ndbm, main, [DB_LIB="-lndbm"; DB_TYPE="-DUSE_NDBM"], [
AC_CHECK_LIB(gdbm, main, [DB_LIB="-lgdbm"; DB_TYPE="-DUSE_GDBM"], [
AC_CHECK_LIB(dbm, main, [DB_LIB="-ldbm"; DB_TYPE="-DUSE_DBM"], [
HISTORY="chkhistory.o"])])])])
])
if test "$with_perl_exe" ; then
AC_CHECK_PROG(PERL, perl, true, false, [$with_perl_exe])
whichperl=${with_perl_exe}/perl
else
AC_CHECK_PROG(PERL, perl, true, false)
whichperl=perl
fi
if test "$PERL" = "true"; then
found="no"
AC_MSG_CHECKING([for libperl.a])
for path in `$whichperl -e 'foreach $i (@INC) { printf("%s ", $i) }'`; do
if test -f $path/libperl.a; then
AC_MSG_RESULT($path)
found="yes"
break
fi
path="${path}/CORE"
if test -f $path/libperl.a; then
AC_MSG_RESULT($path)
found="yes"
break
fi
done
if test "$found" = "yes"; then
PERL_DEFS="-DPERL_EMBED -Dbool=char -DHAS_BOOL"
PERL_LIB="-lperl"
PERL_LIB_LOC="-L$path"
PERL_INC_LOC="-I$path"
AC_CHECK_LIB(m, cos, [PERL_LIB="$PERL_LIB -lm"])
AC_CHECK_LIB(crypt, crypt, [PERL_LIB="$PERL_LIB -lcrypt"])
else
AC_MSG_RESULT(not found)
fi
fi
#AC_OUTPUT(Spanish.docs/Makefile Makefile, echo timestamp > stamp-h)
AC_SUBST(DB_TYPE)
AC_SUBST(DB_LIB)
AC_SUBST(HISTORY)
AC_SUBST(SSL_LIB)
AC_SUBST(SSL_DEFS)
AC_SUBST(PERL_DEFS)
AC_SUBST(PERL_LIB)
AC_SUBST(PERL_LIB_LOC)
AC_SUBST(PERL_INC_LOC)
AC_OUTPUT(Makefile, echo timestamp > stamp-h)
|