dnl Process this file with autoconf to produce a configure script. AC_INIT(wwwoffle,2.9) dnl Specify the autoconf file. AC_CONFIG_HEADER(src/autoconfig.h) dnl Checks for programs. AC_PROG_CC AC_PROG_LEX AC_PROG_INSTALL AC_PROG_AWK AC_PROG_MAKE_SET AC_CHECK_PROGS(TAR,gnutar gtar tar,tar) AC_CHECK_PROG(PERL,perl,perl) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME AC_CHECK_HEADERS(sys/time.h sys/param.h sys/statvfs.h sys/vfs.h) AC_CHECK_HEADERS(sys/mount.h,,, [ #if SYS_PARAM_H #include #endif ]) dnl Checks for typedefs, structures, and compiler characteristics. AC_STRUCT_TIMEZONE AC_STRUCT_ST_BLOCKS AC_STRUCT_ST_BLKSIZE dnl Checks for libraries. ETR_SOCKET_NSL LIBS="$LIBS $ETR_SOCKET_LIBS" dnl Checks for library functions. AC_CHECK_FUNCS(getaddrinfo getnameinfo) AC_CHECK_FUNCS(statfs statvfs) if test "$ac_cv_func_statfs" = "no"; then if test "$ac_cv_func_statvfs" = "no"; then AC_MSG_ERROR([Neither of the two functions statfs or statvfs are available]) fi fi AC_CHECK_FUNCS(setresuid setresgid getresuid getresgid setreuid setregid setgroups) dnl Checks for zlib libraries. AC_ARG_WITH(zlib, [ --with-zlib=dir Set the location of the zlib header and library], WITH_ZLIB=$withval,WITH_ZLIB=yes) if test "$WITH_ZLIB" = "no"; then ZLIB_INC= ZLIB_LIB= USE_ZLIB=0 else if test "$WITH_ZLIB" = "yes"; then ZLIB_LIB=-lz ZLIB_INC= USE_ZLIB=1 else zlib_dir=$WITH_ZLIB ZLIB_LIB="-L${zlib_dir}/lib -lz" ZLIB_INC="-I${zlib_dir}/include" USE_ZLIB=1 fi AC_CHECK_LIB(z, zlibVersion, WITH_ZLIB=yes,WITH_ZLIB=no,$ZLIB_LIB) if test "$WITH_ZLIB" = "no"; then AC_MSG_WARN([Cannot find working libz library, configuring without compression support]) ZLIB_LIB= ZLIB_INC= USE_ZLIB=0 fi fi AC_DEFINE_UNQUOTED(USE_ZLIB,$USE_ZLIB) AC_SUBST(ZLIB_LIB) AC_SUBST(ZLIB_INC) dnl Checks for using gnutls. AC_ARG_WITH(gnutls, [ --with-gnutls=dir Set the location of the gnutls header and library], WITH_GNUTLS=$withval,WITH_GNUTLS=no) if test "$WITH_GNUTLS" = "no"; then GNUTLS_INC= GNUTLS_LIB= USE_GNUTLS=0 else if test "$WITH_GNUTLS" = "yes"; then AC_CHECK_PROG(LIBGNUTLS_CONFIG,libgnutls-config,libgnutls-config) if test "$LIBGNUTLS_CONFIG" = ""; then AC_MSG_WARN([Cannot find libgnutls-config program, configuring without SSL/https support]) WITH_LIBGNUTLS_CONFIG=0 else WITH_LIBGNUTLS_CONFIG=1 fi else LIBGNUTLS_CONFIG="$WITH_GNUTLS/bin/libgnutls-config" if test -x "$LIBGNUTLS_CONFIG" ; then WITH_LIBGNUTLS_CONFIG=1 else AC_MSG_WARN([Cannot find $WITH_GNUTLS/bin/libgnutls-config program, configuring without SSL/https support]) WITH_LIBGNUTLS_CONFIG=0 fi fi if test "$WITH_LIBGNUTLS_CONFIG" = "1"; then GNUTLS_LIB=`$LIBGNUTLS_CONFIG --libs` GNUTLS_INC=`$LIBGNUTLS_CONFIG --cflags` USE_GNUTLS=1 AC_CHECK_LIB(gnutls, gnutls_check_version, WITH_GNUTLS=yes,WITH_GNUTLS=no,$GNUTLS_LIB) if test "$WITH_GNUTLS" = "no"; then AC_MSG_WARN([Cannot find working libgnutls library, configuring without SSL/https support]) GNUTLS_LIB= GNUTLS_INC= USE_GNUTLS=0 fi else GNUTLS_LIB= GNUTLS_INC= USE_GNUTLS=0 fi fi AC_DEFINE_UNQUOTED(USE_GNUTLS,$USE_GNUTLS) AC_SUBST(GNUTLS_LIB) AC_SUBST(GNUTLS_INC) dnl Checks for using IPv6. AC_ARG_WITH(ipv6, [ --with-ipv6 Enable the use of IPv6 sockets], WITH_IPV6=$withval,WITH_IPV6=yes) if test "$WITH_IPV6" = "no"; then USE_IPV6=0 else USE_IPV6=1 AC_MSG_CHECKING(for IPv6 support) if test "$ac_cv_func_getnameinfo" = "no"; then AC_MSG_RESULT([no, cannot find getnameinfo() function]) USE_IPV6=0 elif test "$ac_cv_func_getaddrinfo" = "no"; then AC_MSG_RESULT([no, cannot find getaddrinfo() function]) USE_IPV6=0 else AC_MSG_RESULT(yes) fi fi AC_DEFINE_UNQUOTED(USE_IPV6,$USE_IPV6) dnl Check for Cygwin. AC_CYGWIN if test "$CYGWIN" = "yes"; then install_win32=install-win32 else install_win32= fi AC_SUBST(install_win32) dnl The WWWOFFLE specific settings that we need. AC_ARG_WITH(spooldir, [ --with-spooldir=directory Set the default spool directory], SPOOLDIR=$withval,) if test "x$SPOOLDIR" = "x"; then SPOOLDIR=/var/spool/wwwoffle fi AC_DEFINE_UNQUOTED(DEF_SPOOLDIR,"$SPOOLDIR") AC_SUBST(SPOOLDIR) AC_ARG_WITH(confdir, [ --with-confdir=directory Set the default config file directory], CONFDIR=$withval,) if test "x$CONFDIR" = "x"; then CONFDIR=/etc/wwwoffle fi AC_DEFINE_UNQUOTED(DEF_CONFDIR,"$CONFDIR") AC_SUBST(CONFDIR) AC_ARG_WITH(server, [ --with-server=host:port:port:port Set the default host, HTTP port, WWWOFFLE port and HTTPS port], SERVER=$withval,) if test "x$SERVER" = "x"; then SERVER=localhost:8080:8081:8443 fi LOCALHOST=`echo $SERVER | awk -F: '{print $1}'` if test "x$LOCALHOST" = "x"; then LOCALHOST=localhost fi HTTP_PORT=`echo $SERVER | awk -F: '{print $2}'` if test "x$HTTP_PORT" = "x"; then HTTP_PORT=8080 fi WWWOFFLE_PORT=`echo $SERVER | awk -F: '{print $3}'` if test "x$WWWOFFLE_PORT" = "x"; then WWWOFFLE_PORT=8081 fi HTTPS_PORT=`echo $SERVER | awk -F: '{print $4}'` if test "x$HTTPS_PORT" = "x"; then HTTPS_PORT=8443 fi AC_SUBST(LOCALHOST) AC_SUBST(HTTP_PORT) AC_SUBST(HTTPS_PORT) AC_SUBST(WWWOFFLE_PORT) dnl Language settings. AC_MSG_CHECKING(the default language) LANGUAGES="de en es fr it nl pl ru" AC_SUBST(LANGUAGES) AC_ARG_WITH(default-language, [ --with-default-language=lang Set the default language to install], WITH_LANG=$withval,WITH_LANG=en) DEFLANG= for lang in $LANGUAGES; do if test "$WITH_LANG" = $lang; then DEFLANG=$lang fi done if test "x$DEFLANG" = "x"; then AC_MSG_ERROR([Invalid value $WITH_LANG for default language, choose from: $LANGUAGES.]) else AC_MSG_RESULT($DEFLANG) fi AC_SUBST(DEFLANG) dnl Checks for installation location. dnl Create the output files. AC_OUTPUT( Makefile cache/Makefile conf/Makefile doc/Makefile src/Makefile src/testprogs/Makefile src/autoconfig.h.in )