dnl Process this file with autoconf to produce a configure script. dnl $Id$ AC_INIT(lib/libs.h) AM_CONFIG_HEADER(config.h) SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbtask mbsetup unix lang examples html script" AC_SUBST(SUBDIRS) dnl General settings for MBSE BBS dnl After changeing the version number, run autoconf! PACKAGE="mbsebbs" MAJOR="0" MINOR="39" REVISION="1" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2003 Michiel Broek, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2003 M. Broek" GROUP="bbs" OWNER="mbse" AC_SUBST(PACKAGE) AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(REVISION) AC_SUBST(COPYRIGHT) AC_SUBST(GROUP) AC_SUBST(OWNER) AC_PREFIX_DEFAULT(/opt/mbse) AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_DEFINE_UNQUOTED(VERSION_MAJOR, $MAJOR) AC_DEFINE_UNQUOTED(VERSION_MINOR, $MINOR) AC_DEFINE_UNQUOTED(VERSION_REVISION, $REVISION) AC_DEFINE_UNQUOTED(COPYRIGHT, "$COPYRIGHT") AC_DEFINE_UNQUOTED(SHORTRIGHT, "$SHORTRIGHT") AC_SUBST(VERSION) TARGET="$target" dnl Checks for programs. dnl Try to find GNU make AC_CHECK_PROG(MAKE, gmake, gmake) AC_CHECK_PROG(MAKE, make, make) dnl Alternate awk check, I skip mawk because it doesn't work for MBSE. AC_CHECK_PROG(AWK, gawk, gawk) AC_CHECK_PROG(AWK, nawk, nawk) AC_CHECK_PROG(AWK, awk, awk) dnl Try to find GNU install AC_CHECK_PROG(INSTALL, ginstall, ginstall) AC_CHECK_PROG(INSTALL, install, install) AC_PROG_MAKE_SET AC_PROG_RANLIB AC_CHECK_PROG(TAR, tar, tar) AC_CHECK_PROG(ZIP, zip, zip) AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:) CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes" dnl Defines for MBSE BBS (must use tests or --enable-stuff later) AC_DEFINE_UNQUOTED(RESTAMP_OLD_POSTINGS, 21) AC_DEFINE(RESTAMP_FUTURE_POSTINGS) dnl Checks for libraries. AC_CHECK_LIB(compat,re_comp,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lcompat" fi AC_CACHE_CHECK(for pw_age in struct passwd, ac_cv_struct_passwd_pw_age, AC_TRY_COMPILE([#include ], [ struct passwd pw; pw.pw_age = ""; ], ac_cv_struct_passwd_pw_age=yes, ac_cv_struct_passwd_pw_age=no)) if test "$ac_cv_struct_passwd_pw_age" = "yes"; then AC_DEFINE(ATT_AGE) fi AC_CACHE_CHECK(for pw_comment in struct passwd, ac_cv_struct_passwd_pw_comment, AC_TRY_COMPILE([#include ], [ struct passwd pw; pw.pw_comment = ""; ], ac_cv_struct_passwd_pw_comment=yes, ac_cv_struct_passwd_pw_comment=no)) if test "$ac_cv_struct_passwd_pw_comment" = "yes"; then AC_DEFINE(ATT_COMMENT) fi AC_CHECK_LIB(shadow,setspent,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lshadow" SHADOW_PASSWORD=1 LIBSHADOW=1 else AC_CHECK_LIB(shadow,getspnam,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lshadow" SHADOW_PASSWORD=1 LIBSHADOW=1 else dnl some libc's (glibc 2.x) keep shadow functions in -lc AC_CHECK_LIB(c,setspent,result=yes,result=no) if test "$result" = "yes"; then if test -f /etc/shadow; then SHADOW_PASSWORD=1 fi fi fi fi if test "$SHADOW_PASSWORD" = "1"; then if test "$ac_cv_func_fgetspent" != "yes"; then AC_CHECK_LIB(shadow,fgetspent,result=yes,result=no) if test "$result" = "yes"; then if test "$LIBSHADOW" != "1"; then LIBS="$LIBS -lshadow" fi fi fi AC_DEFINE(SHADOW_PASSWORD) fi AC_CHECK_LIB(crypt,crypt,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lcrypt" AC_CHECK_HEADERS(crypt.h) fi AC_CHECK_LIB(util,login,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lutil" AC_CHECK_HEADERS(util.h) AC_CHECK_HEADERS(libutil.h) AC_CHECK_HEADERS(sys/types.h) fi AC_CHECK_LIB(z,compress2,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lz" AC_CHECK_HEADERS(zlib.h) fi dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(malloc.h sys/file.h sys/ioctl.h sys/time.h termios.h syslog.h sys/vfs.h unistd.h netinet/in.h regex.h) AC_CHECK_HEADERS(sys/resource.h usersec.h utime.h ulimit.h gshadow.h shadow.h) AC_CHECK_HEADERS(limits.h utmp.h utmpx.h lastlog.h rpc/key_prot.h) AC_CHECK_HEADERS(iconv.h) AC_STRUCT_TIMEZONE dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE AC_HEADER_STAT AC_STRUCT_TM dnl Checks for library functions. AC_CHECK_FUNCS(c64i a64l fchmod fchown fdatasync fsync lckpwdf strcasestr putpwent) AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_FUNC_SETPGRP AC_TYPE_SIGNAL AC_FUNC_UTIME_NULL AC_FUNC_VFORK AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday re_comp select socket uname) AC_CHECK_FUNCS(getspnam initgroups updwtmp updwtmpx) dnl Check for external programs AC_PATH_PROG(COMPRESS,compress,no-compress-found-during-configure) AC_PATH_PROG(GZIP,gzip,no-gzip-found-during-configure) AC_PATH_PROG(ARC,arc) AC_PATH_PROG(NOMARCH,nomarch) AC_PATH_PROG(ARJ,arj) AC_PATH_PROG(UNARJ,unarj) AC_PATH_PROG(LHA,lha) AC_PATH_PROG(RAR,rar) AC_PATH_PROG(UNRAR,unrar) AC_PATH_PROG(TAR,tar) AC_PATH_PROG(ZIP,zip) AC_PATH_PROG(UNZIP,unzip) AC_PATH_PROG(ZOO,zoo) AC_PATH_PROG(HA,ha) AC_PATH_PROG(ANTIVIR,antivir) AC_PATH_PROG(FPROT,f-prot) AC_PATH_PROG(UVSCAN,uvscan) AC_PATH_PROG(RB,rb) AC_PATH_PROG(RB,lrb) AC_PATH_PROG(SB,sb) AC_PATH_PROG(SB,lsb) AC_PATH_PROG(RZ,rz) AC_PATH_PROG(RZ,lrz) AC_PATH_PROG(SZ,sz) AC_PATH_PROG(SZ,lsz) AC_PATH_PROG(GOLDEDBIN,golded) AC_PATH_PROG(GOLDEDBIN,gedlnx) AC_PATH_PROG(GOLDNODE,goldnode) AC_PATH_PROG(GOLDNODE,gnlnx) AC_PATH_PROG(CONVERT,convert) dnl AC_ARG_WITH(log-compress,[ --with-log-compress=METHOD Log compression method (default gzip)], LOG_COMPRESS=$with_log_compress, LOG_COMPRESS=gzip) case "$LOG_COMPRESS" in gzip) LOG_COMPRESS=$GZIP LOG_COMPRESSEXT=".gz" ;; compress) LOG_COMPRESS=$COMPRESS LOG_COMPRESSEXT=".Z" ;; *) LOG_COMPRESS=$LOG_COMPRESS LOG_COMPRESSEXT=".unknown" ;; esac AC_SUBST(LOG_COMPRESS) AC_SUBST(LOG_COMPRESSEXT) dnl AC_MSG_CHECKING(location of joe editor) for joebin in /usr/bin /usr/local/bin /usr/pkg/bin NONE; do if test "$joebin" = "NONE"; then AC_MSG_RESULT(not found) elif test -x $joebin/joe; then AC_SUBST(joebin) AC_MSG_RESULT($joebin) break fi done AC_MSG_CHECKING(location of joe rc files) for joelib in /etc/joe /usr/lib/joe /usr/local/etc /usr/local/etc/joe /usr/local/lib/joe /usr/pkg/lib /usr/pkg/etc NONE; do if test "$joelib" = "NONE"; then AC_MSG_RESULT(not found) elif test -f $joelib/joerc; then AC_SUBST(joelib) AC_MSG_RESULT($joelib) break fi done AC_MSG_CHECKING(location of utmp) for utmpdir in /var/run /var/adm /usr/adm /etc NONE; do if test "$utmpdir" = "NONE"; then AC_MSG_WARN(utmp file not found) elif test -f $utmpdir/utmp; then AC_DEFINE_UNQUOTED(_UTMP_FILE, "$utmpdir/utmp") AC_MSG_RESULT($utmpdir) break fi done AC_MSG_CHECKING(location of lastlog/wtmp) for logdir in /var/log /var/adm /usr/adm /etc; do if test -d $logdir; then AC_DEFINE_UNQUOTED(_WTMP_FILE, "$logdir/wtmp") AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$logdir/lastlog") AC_MSG_RESULT($logdir) break fi done AC_MSG_CHECKING(location of vpopmail) for vpop in /var/qmail/vpopmail/bin NONE; do if test "$vpop" = "NONE"; then AC_MSG_RESULT(not found) elif test -x $vpop/vadduser; then AC_DEFINE_UNQUOTED(_VPOPMAIL_PATH, "$vpop") AC_MSG_RESULT($vpop) break fi done AC_OUTPUT( Makefile.global paths.h unix/login.defs INSTALL FILE_ID.DIZ script/editor html/index.htm html/basic.html ) #================================================================================= AC_MSG_RESULT([ -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- Configuration summary : Version : ..................... ${VERSION} ]) if test x$ac_cv_c_compiler_gnu = xyes ; then echo -e " Tools :\n" echo " Compiler is GCC : ............. ${ac_cv_c_compiler_gnu}" fi AC_MSG_RESULT([ Installation directories : Main directory : ........... ${prefix} Owner and group : ........... ${OWNER}.${GROUP} Now type 'make' and as root 'make install' ])