dnl Process this file with autoconf to produce a configure script. AC_INIT(qmailadmin.c) AM_INIT_AUTOMAKE($QA_PACKAGE,$QA_VERSION, [no-define]) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST QA_PACKAGE="qmailadmin" QA_VERSION="1.2.10" AC_DEFINE_UNQUOTED(QA_PACKAGE,"$QA_PACKAGE","") AC_DEFINE_UNQUOTED(QA_VERSION,"$QA_VERSION","") AC_SUBST(QA_PACKAGE) AC_SUBST(QA_VERSION) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_ISC_POSIX dnl Checks for libraries. AC_CHECK_LIB(crypt,crypt) AC_CHECK_LIB(shadow,crypt) #AC_CHECK_LIB(m,floor) #AC_CHECK_LIB(nsl, gethostbyaddr) #AC_CHECK_LIB(socket, getsockname) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST #AC_HEADER_STDBOOL AC_TYPE_UID_T # Checks for library functions. AC_FUNC_CLOSEDIR_VOID #AC_FUNC_FORK #AC_FUNC_LSTAT #AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK #AC_FUNC_MALLOC #AC_FUNC_REALLOC #AC_FUNC_STAT AC_CHECK_FUNCS([dup2 memset mkdir strcasecmp strchr strdup strncasecmp strrchr strstr]) if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi CGIBINTARGETS=qmailadmin AC_SUBST(CGIBINTARGETS) vpopmaildir="" for f in ~vpopmail do if test -d $f then vpopmaildir=$f fi done AC_ARG_ENABLE(vpopmaildir, [ --enable-vpopmaildir=DIR Home directory of vpopmail.], vpopmaildir="$enableval", [ if test "$vpopmaildir" = "" then AC_MSG_ERROR([Unable to find your vpopmaildir, specify --enable-vpopmaildir.]) fi ] ) AC_SUBST(vpopmaildir) auth_incs=`cat $vpopmaildir/etc/inc_deps` AC_SUBST(auth_incs) auth_libs=`cat $vpopmaildir/etc/lib_deps` AC_SUBST(auth_libs) htmldir="" for f in /home/httpd/html /usr/local/apache/htdocs /usr/local/www/data /var/www/html do if test -d $f then htmldir=$f fi done AC_ARG_ENABLE(htmldir, [ --enable-htmldir=DIR HTTP server's base html dir.], htmldir="$enableval", [ if test "$htmldir" = "" then AC_MSG_ERROR([Unable to find your html base directory, specify --enable-htmldir.]) fi ] ) AC_SUBST(htmldir) cgibindir="" for f in /home/httpd /usr/local/apache /usr/local/www /var/lib/httpd /var/www /usr/local/www $htmldir do if test -d $f/cgi-bin then cgibindir=$f/cgi-bin fi done AC_ARG_ENABLE(cgibindir, [ --enable-cgibindir=DIR HTTP server's cgi-bin directory.], cgibindir="$enableval", [ if test "$cgibindir" = "" then AC_MSG_ERROR([Unable to find your cgi-bin directory, specify --enable-cgibindir.]) fi ] ) AC_SUBST(cgibindir) imageurl="/images/qmailadmin" AC_ARG_ENABLE(imageurl, [ --enable-imageurl=URL URL to image files [/images/qmailadmin].], imageurl="$enableval", [ if test "$imageurl" = "" then AC_MSG_ERROR([Unable to find your html url, specify --enable-imageurl.]) fi ] ) AC_SUBST(imageurl) AC_DEFINE_UNQUOTED(IMAGEURL, "$imageurl","") imagedir="" for f in /home/httpd/html /usr/local/apache/htdocs /usr/local/www/data /var/www/html $htmldir do if test -d $f then imagedir=$f$imageurl fi done AC_ARG_ENABLE(imagedir, [ --enable-imagedir=DIR Where to put the image files [DocumentRoot/images/qmailadmin].], imagedir="$enableval", [ if test "$imagedir" = "" then AC_MSG_ERROR([Unable to find your html image directory, specify --enable-imagedir.]) fi ] ) AC_SUBST(imagedir) htmllibdir="/usr/local/share/qmailadmin" AC_ARG_ENABLE(htmllibdir, [ --enable-htmllibdir=DIR qmailadmin HTML library directory.], htmllibdir="$enableval", [ if test "$htmllibdir" = "" then AC_MSG_ERROR([Unable to find your htmllibdir directory, specify --enable-htmllibdir.]) fi ] ) AC_SUBST(htmllibdir,$htmllibdir) AC_DEFINE_UNQUOTED(HTMLLIBDIR, "$htmllibdir","") qmaildir="" for f in /var/qmail do if test -d $f then qmaildir=$f fi done AC_ARG_ENABLE(qmaildir, [ --enable-qmaildir=DIR directory where qmail is installed.], qmaildir="$enableval", [ if test "$qmaildir" = "" then AC_MSG_ERROR([Unable to find your qmaildir directory, specify --enable-qmaildir.]) fi ] ) AC_DEFINE_UNQUOTED(QMAILDIR,"$qmaildir","") ezmlmdir="" for f in /usr/local/bin/ezmlm /usr/bin /usr/sbin /usr/local/bin do if test -f $f/ezmlm-make then ezmlmdir=$f fi done AC_ARG_ENABLE(ezmlmdir, [ --enable-ezmlmdir=PATH Path to ezmlm binaries or =n to disable.], ezmlmdir="$enableval", [ if test "$ezmlmdir" = "" then AC_MSG_ERROR([Unable to find your ezmlmdir user, specify --enable-ezmlmdir.]) fi ] ) AC_DEFINE_UNQUOTED(EZMLMDIR,"$ezmlmdir","") cgipath="/cgi-bin/qmailadmin" AC_ARG_ENABLE(cgipath, [ --enable-cgipath=PATH URL path for cgi [/cgi-bin/qmailadmin].], cgipath="$enableval", [ if test "$cgipath" = "" then AC_MSG_ERROR([Unable to find your cgipath directory, specify --enable-cgipath.]) fi ] ) AC_DEFINE_UNQUOTED(CGIPATH,"$cgipath","") autorespond_path="" for f in /usr/local/bin /usr/bin /usr/sbin /usr/local/bin /var/qmail/bin do if test -f $f/autorespond then autorespond_path=$f fi done AC_ARG_ENABLE(autoresponder-path, [ --enable-autoresponder-path=PATH Path to autoresponder directory.], AC_ARG_ENABLE(autoresponder-bin, [], autorespond_path="$enableval", []) autorespond_path="$enableval", [ if test "$autorespond_path" = "" then AC_MSG_ERROR([Unable to find your autorespond program directory, specify --enable-autoresponder-path.]) fi ] ) AC_DEFINE_UNQUOTED(AUTORESPOND_PATH,"$autorespond_path","") vpopuser="vpopmail" AC_ARG_ENABLE(vpopuser, [ --enable-vpopuser=USER User vpopmail was installed as [vpopmail].], vpopuser="$enableval", [ if test "$vpopuser" = "" then AC_MSG_ERROR([Unable to find your vpopuser user, specify --enable-vpopuser.]) fi ] ) AC_DEFINE_UNQUOTED(VPOPUSER,"$vpopuser","") AC_SUBST(vpopuser) vpopgroup="vchkpw" AC_ARG_ENABLE(vpopgroup, [ --enable-vpopgroup=GROUP Group vpopmail was installed as [vchkpw].], vpopgroup="$enableval", [ if test "$vpopgroup" = "" then AC_MSG_ERROR([Unable to find your vpopgroup group, specify --enable-vpopgroup.]) fi ] ) AC_DEFINE_UNQUOTED(VPOPGROUP,"$vpopgroup","") AC_SUBST(vpopgroup) mysql=yes AC_ARG_ENABLE(ezmlm-mysql, [ --disable-ezmlm-mysql Disable MySQL options for mailing lists.], mysql="$enableval",) case $mysql in 1*|y*|Y*) mysql=yes AC_DEFINE_UNQUOTED(ENABLE_MYSQL,1,"") ;; *) mysql=no ;; esac maxusersperpage=15 AC_ARG_ENABLE(maxusersperpage, [ --enable-maxusersperpage=# Number of users to display on a page [15].], maxusersperpage="$enableval",) AC_DEFINE_UNQUOTED(MAXUSERSPERPAGE,$maxusersperpage,"") maxaliasesperpage=25 AC_ARG_ENABLE(maxaliasesperpage, [ --enable-maxaliasesperpage=# Number of aliases to display on a page [25].], maxaliasesperpage="$enableval",) AC_DEFINE_UNQUOTED(MAXALIASESPERPAGE,$maxaliasesperpage,"") NO_CACHE=no AC_ARG_ENABLE(no-cache, [ --enable-no-cache Prohibit caching via http headers.], NO_CACHE="$enableval",) case $NO_CACHE in 1*|y*|Y*) NO_CACHE=1 AC_DEFINE_UNQUOTED(NO_CACHE,$NO_CACHE,"") echo "checking whether we should prohibit caching... yes" ;; *) echo "checking whether we should prohibit caching... no" ;; esac IPAUTH=yes AC_ARG_ENABLE(ipauth, [ --disable-ipauth Disable IP address checks (NAT/proxy systems may not use the same IP for the whole session).], IPAUTH="$enableval",) case $IPAUTH in 1*|y*|Y*) IPAUTH=1 AC_DEFINE_UNQUOTED(IPAUTH,$IPAUTH,"") echo "checking whether to require ip authentication... yes" ;; *) echo "checking whether to require ip authentication... no" ;; esac USER_INDEX=yes AC_ARG_ENABLE(user-index, [ --disable-user-index Don't display user index on show users page.], USER_INDEX="$enableval",) case $USER_INDEX in 1*|y*|Y*) USER_INDEX=1 AC_DEFINE_UNQUOTED(USER_INDEX,$USER_INDEX,"") echo "checking whether to display user index... yes" ;; *) echo "checking whether to display user index... no" ;; esac AC_ARG_ENABLE(modify-quota, [ --enable-modify-quota Allow domain admin (postmaster) to modify user quotas.], MODIFY_QUOTA="$enableval",) case $MODIFY_QUOTA in 1*|y*|Y*) MODIFY_QUOTA=yes AC_DEFINE_UNQUOTED(MODIFY_QUOTA,1,"") echo "checking whether to allow admins to modify user quotas... yes" ;; *) MODIFY_QUOTA=no echo "checking whether to allow admins to modify user quotas... no" ;; esac AC_ARG_ENABLE(domain-autofill, [ --enable-domain-autofill Autofill the domain on login page based on the hostname that accesses qmailadmin.], DOMAIN_AUTOFILL="$enableval",) case $DOMAIN_AUTOFILL in 1*|y*|Y*) DOMAIN_AUTOFILL=yes AC_DEFINE_UNQUOTED(DOMAIN_AUTOFILL,1,"") echo "checking whether to autofill domain name on login page... yes" ;; *) DOMAIN_AUTOFILL=no echo "checking whether to autofill domain name on login page... no" ;; esac AC_ARG_ENABLE(modify-spam, [ --enable-modify-spam Allow users to enable/disable spam checking.], MODIFY_SPAM="$enableval",) case $MODIFY_SPAM in 1*|y*|Y*) MODIFY_SPAM=yes AC_DEFINE_UNQUOTED(MODIFY_SPAM,1,"") echo "checking whether to allow spam check enable/disable... yes" ;; *) MODIFY_SPAM=no echo "checking whether to allow spam check enable/disable... no" ;; esac spam_command="|preline /usr/local/bin/maildrop /etc/mailfilter" AC_ARG_ENABLE(spam_command, [ --enable-spam-command=CMD Remember to use '|preline' at the beginning, [|preline /usr/local/bin/maildrop /etc/mailfilter].], spam_command="$enableval", ) AC_DEFINE_UNQUOTED(SPAM_COMMAND, "$spam_command","") AC_SUBST(SPAM_COMMAND) HELP=no AC_ARG_ENABLE(help, [ --enable-help Display help links on login page.], HELP="$enableval",) case $HELP in 1*|y*|Y*) enable_help="yes" AC_SUBST(enable_help) AC_DEFINE_UNQUOTED(HELP,1,"") echo "checking whether to show help pages... yes" ;; *) enable_help="no" echo "checking whether to show help pages... no" ;; esac EZMLMIDX=no if test -f $ezmlmdir/ezmlm-moderate then EZMLMIDX=yes fi case $EZMLMIDX in 1*|y*|Y*) EZMLMIDX=1 AC_DEFINE_UNQUOTED(EZMLMIDX,$EZMLMIDX,"") echo "checking for ezmlm-idx... yes" ezmlmidx="yes" ;; *) echo "checking for ezmlm-idx... no" ezmlmidx="no" ;; esac AC_OUTPUT(Makefile) echo "" echo " $QA_PACKAGE $QA_VERSION" echo " Current settings" echo "---------------------------------------" echo " cgi-bin dir = "$cgibindir"" echo " html dir = "$htmldir"" echo " image dir = "$imagedir"" echo " image URL = "$imageurl"" echo " template dir = "$htmllibdir"" echo " qmail dir = "$qmaildir"" echo " vpopmail dir = "$vpopmaildir"" echo " autorespond dir = "$autorespond_path"" echo " ezmlm dir = "$ezmlmdir"" echo " ezmlm idx = "$ezmlmidx"" echo " mysql for ezmlm = "$mysql"" echo " help = "$enable_help"" echo " modify quota = "$MODIFY_QUOTA"" echo " domain autofill = "$DOMAIN_AUTOFILL"" echo " modify spam check = "$MODIFY_SPAM"" if test "$MODIFY_SPAM" = "yes" then echo " spam command = "$spam_command"" fi