dnl Process this file with autoconf to produce a configure script. AC_INIT(src/config.h.in) AC_PROG_MAKE_SET dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB AC_CANONICAL_SYSTEM AC_CANONICAL_HOST test "$GCC" = yes && CFLAGS="$CFLAGS -Wall" AC_PREFIX_DEFAULT(/usr/local/etc/Counter) dnl Checks for libraries. dnl Checks for header files. dnl AC_HEADER_STDC AC_STDC_HEADERS AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS(string.h fcntl.h memory.h malloc.h unistd.h ctype.h errno.h) AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sys/stat.h sys/param.h sys/file.h stdlib.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_STRUCT_TM AC_CHECK_FUNCS(flock strcasecmp mktime strftime gmtime) AC_MSG_CHECKING([for system type]) case "$host_os" in *linux*) AC_MSG_RESULT("Cool It is Linux") ;; *solaris*) AC_DEFINE(SOLARIS) AC_MSG_RESULT("Solaris") if test "$GCC" != yes; then AC_DEFINE(__STDC__) fi ;; *ultrix*) AC_DEFINE(NOPROTO) AC_DEFINE(NOCONST) AC_MSG_RESULT("ultrix") ;; *) AC_MSG_RESULT("$host_os") ;; esac cgi_bin_dir="/usr/local/apache/cgi-bin" dnl sepcify cgi-bin directory, muquit, aug-26-1999 AC_MSG_CHECKING(for cgi-bin directory) AC_ARG_WITH(cgi-bin-dir, [ --with-cgi-bin-dir[=DIR] Designated directory for CGI programs], [ if test "$withval" = "yes"; then cgi_bin_dir="/usr/local/apache/cgi-bin" AC_MSG_RESULT($cgi_bin_dir) else cgi_bin_dir="$withval" AC_MSG_RESULT($cgi_bin_dir) fi ],[ AC_SUBST(cgi_bin_dir) AC_MSG_RESULT($cgi_bin_dir) ]) AC_SUBST(cgi_bin_dir) dbfound=0 db_support='no' ttf_support="no" probe_ttf='yes' probe_db='yes' probe_gdbm='yes' probe_ndbm='yes' probe_sdbm='yes' AC_DEFUN(AC_PREFERRED_DB_LIB,[ AC_MSG_CHECKING(for Berkeley DB 2.x or 3.x) for i in /usr/local /usr /usr/local/BerkeleyDB /usr/local/BerkeleyDB.3.0 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.2 $withval; do if test -f "$i/include/db.h" ; then dnl FIXME - sometimes yes will be printed more than one. mm AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BERKELEY_DB) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_DBHASH) DBM_TYPE=LDBM_USE_DBHASH DBT="Berkeley DBHASH" LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -ldb" dbfound=1 fi done if test $dbfound -eq 0; then AC_MSG_CHECKING(for Berkeley DB 1.85) for i in /usr/local /usr /usr/BerkeleyDB /usr/local/BerkeleyDB; do if test -f "$i/include/db_185.h"; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_DB_185_H) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_DBHASH) DBM_TYPE=LDBM_USE_DBHASH DBT="Berkeley DBHASH" LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -ldb" dbfound=1 fi done fi if test $dbfound -eq 0; then AC_MSG_RESULT(no) AC_MSG_CHECKING(for GNU gdbm) for i in /usr/local /usr; do if test -f "$i/include/gdbm.h"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_GDBM) DBM_TYPE=LDBM_USE_GDBM DBT=GDBM LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -lgdbm" dbfound=1 fi done fi if test $dbfound -eq 0; then AC_MSG_RESULT(no) AC_MSG_CHECKING(for sdbm) if test -f "./libs/sdbm/sdbm.h"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_SDBM) DBM_TYPE=LDBM_USE_SDBM DBT=SDBM THIS_LIBS="-L`pwd`/libs/sdbm -lsdbm" LDBM_INCLUDE="-I`pwd`/libs/ldbm -I`pwd`/libs/sdbm" DBM_LIB="-L`pwd`/libs/ldbm -lldbm $THIS_LIBS" dbfound=1 fi fi AC_SUBST(LDBM_INCLUDE) AC_SUBST(DBM_LIB) AC_SUBST(DBM_TYPE) ]) AC_ARG_WITH(db, [ --with-db[=DIR] Include Berkeley DB2 or DB3 support],[ if test "$probe_db" = "yes"; then AC_MSG_CHECKING(for Berkeyley DB3) for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.2 $withval; do if test -f "$i/include/db.h" ; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BERKELEY_DB) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_DBHASH) DBM_TYPE=LDBM_USE_DBHASH DBT="Berkeley DBHASH" LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -ldb" dbfound=1 db_support="yes" fi done if test $dbfound -eq 0; then AC_MSG_RESULT(no) fi fi ]) AC_ARG_WITH(db1, [ --with-db1[=DIR] Include Berkeyley db 1.x support],[ if test "$probe_db" = "yes"; then AC_MSG_CHECKING(for Berkeyley db 1.x) for i in /usr/local /usr /usr/BerkeleyDB /usr/local/BerkeleyDB $withval; do if test -f "$i/include/db_185.h"; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_DB_185_H) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_DBHASH) DBM_TYPE=LDBM_USE_DBHASH DBT="Berkeley DBHASH" LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -ldb" dbfound=1 db_support="yes" fi done if test $dbfound -eq 0; then AC_MSG_RESULT(no) fi fi ]) AC_ARG_WITH(gdbm, [ --with-gdbm[=DIR] Include GNU gdbm support],[ if test "$probe_gdbm" = "yes"; then AC_MSG_CHECKING(for GNU gdbm) for i in /usr/local /usr $withval; do if test -f "$i/include/gdbm.h"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_GDBM) DBM_TYPE=LDBM_USE_GDBM DBT=GDBM LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" DBM_LIB="-L`pwd`/libs/ldbm -lldbm -L$i/lib -lgdbm" dbfound=1 db_support="yes" fi done if test $dbfound -eq 0; then AC_MSG_RESULT(no) fi fi ]) AC_ARG_WITH(ndbm, [ --with-ndbm[=DIR] Include ndbm support],[ if test "$probe_ndbm" = "yes"; then AC_MSG_CHECKING(for ndbm) for i in /usr/local /usr $withval; do if test -f "$i/include/ndbm.h"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_NDBM) DBM_TYPE=LDBM_USE_NDBM DBT=NDBM LDBM_INCLUDE="-I`pwd`/libs/ldbm -I$i/include" THIS_LIBS="" for l in ndbm; do AC_CHECK_LIB($l,dbm_open,[THIS_LIBS="-L$i/lib -lndbm"]) done case "$host_os" in *osf*) THIS_LIBS="" ;; esac DBM_LIB="-L`pwd`/libs/ldbm -lldbm $THIS_LIBS" dbfound=1 db_support="yes" fi done if test $dbfound -eq 0; then AC_MSG_RESULT(no) fi fi ]) AC_ARG_WITH(sdbm, [ --with-sdbm Include sdbm (supplied) support],[ if test "$probe_sdbm" = "yes"; then AC_MSG_CHECKING(for sdbm) if test -f "`pwd`/libs/sdbm/sdbm.h"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_DATABASE) AC_DEFINE(LDBM_USE_SDBM) DBM_TYPE=LDBM_USE_SDBM DBT=SDBM LDBM_INCLUDE="-I`pwd`/libs/ldbm -I`pwd`/libs/sdbm" THIS_LIBS="-L`pwd`/libs/sdbm -lsdbm" DBM_LIB="-L`pwd`/libs/ldbm -lldbm $THIS_LIBS" dbfound=1 db_support="yes" fi if test $dbfound -eq 0; then AC_MSG_RESULT(no) fi fi ]) AC_SUBST(LDBM_INCLUDE) AC_SUBST(DBM_LIB) AC_SUBST(DBM_TYPE) AC_ARG_WITH(database, [ --without-database Don't include database supprt], [ if test "$withval" = "no"; then AC_MSG_CHECKING(database support) if test "$withval" = "no"; then AC_MSG_RESULT(no); db_support='no' probe_db='no' probe_gdbm='no' probe_ndbm='no' else if test $dbfound -eq 0; then db_support='yes' AC_MSG_RESULT(yes); fi fi fi ],[ if test $db_support = 'no'; then db_support='yes' AC_PREFERRED_DB_LIB fi ]) AC_DEFUN(AC_PROBE_TTF,[ AC_MSG_CHECKING(whether to include TrueType font support) for i in /usr /usr/local ; do if test -f "$i/include/freetype/freetype.h" ; then AC_MSG_RESULT(yes) TTF_DIR="$i" fi done if test -n "$TTF_DIR" ; then AC_DEFINE(HAS_TRUE_TYPE) TTF_LIB="-L$TTF_DIR/lib -lttf" TTF_INCLUDE="-I$TTF_DIR/include" AC_SUBST(TTF_LIB) AC_SUBST(TTF_INCLUDE) ttf_support='yes' else ttf_support='no' AC_MSG_RESULT(no) fi ]) AC_ARG_WITH(ttf, [ --without-ttf Don't include TrueType font supprt], [ if test "$withval" = "no"; then AC_MSG_CHECKING(TrueType font support) AC_MSG_RESULT(no); ttf_support="no" probe_ttf='no' fi ],[ if test "$ttf_support" = "no"; then AC_PROBE_TTF fi ]) AC_ARG_WITH(ttf, [ --with-ttf[=DIR] Include TrueType font support],[ if test "$probe_ttf" = "yes"; then AC_MSG_CHECKING(for FreeType lib) for i in /usr /usr/local $withval; do if test -f "$i/include/freetype/freetype.h" ; then AC_MSG_RESULT(yes) TTF_DIR="$i" AC_DEFINE(HAS_TRUE_TYPE) TTF_LIB="-L$TTF_DIR/lib -lttf" TTF_INCLUDE="-I$TTF_DIR/include" AC_SUBST(TTF_LIB) AC_SUBST(TTF_INCLUDE) ttf_support="yes" fi done if test "$ttf_support" = "no"; then AC_MSG_RESULT(no) fi fi ]) dnl Checks for library functions. AC_OUTPUT(src/config.h Config.tmpl libs/mcfg/Makefile libs/bigplus/Makefile libs/combine/Makefile \ libs/sdbm/Makefile \ libs/ldbm/Makefile \ libs/sll/Makefile \ libs/mutils/Makefile \ src/Makefile \ utils/mwhich/Makefile \ utils/mkstrip/Makefile \ utils/extdgts/Makefile \ utils/dumpdb/Makefile \ utils/editdb/Makefile \ utils/rgbtxt2db/Makefile ) /bin/rm -rf ././dbtype echo "" echo "======================================================================" echo "WWW Homepage counter is configured as follows. Please verify this" echo "configuration matches your expectations." echo "" echo "Host system type: $host" echo "Database support: $db_support" if test "$db_support" = 'yes' then echo " Database type = $DBT" echo " Include = $LDBM_INCLUDE" echo " Lib = $DBM_LIB" echo "" /bin/rm -f ./dbtype echo "$DBM_TYPE" > ./.dbtype fi echo "TrueType font (TTF) support: $ttf_support" if test "$ttf_support" = 'yes' then echo " TTF Lib = $TTF_LIB" echo " TTF Include = $TTF_INCLUDE" fi echo "" echo "Final Compilation Flags:" echo " CC = $CC" echo " CFLAGS = $CFLAGS" echo " CPPFLAGS = $CPPFLAGS" echo " LDFLAGS = $LDFLAGS" echo " LIBS = $LIBS" echo ""