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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/wwwoffle.c)
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)
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/statvfs.h sys/vfs.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TIMEZONE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_BLKSIZE
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 setgroups)
dnl Checks for libraries
ETR_SOCKET_NSL
dnl Checks for installation location
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 libz, 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 IPv6.
AC_ARG_WITH(ipv6,
[ --with-ipv6 Enable the use of IPv6 sockets],
WITH_IPV6=$withval,WITH_IPV6=no)
if test "$WITH_IPV6" = "no"; then
USE_IPV6=0
else
USE_IPV6=1
if test "$ac_cv_func_getnameinfo" = "no"; then
USE_IPV6=0
AC_MSG_ERROR([The IPv6 option was chosen, but the getnameinfo() function is not available])
fi
if test "$ac_cv_func_getaddrinfo" = "no"; then
USE_IPV6=0
AC_MSG_ERROR([The IPv6 option was chosen, but the getaddrinfo() function is not available])
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
fi
AC_DEFINE_UNQUOTED(DEF_CONFDIR,"$CONFDIR")
AC_SUBST(CONFDIR)
AC_ARG_WITH(server,
[ --with-server=host:port:port Set the default host and HTTP port and WWWOFFLE port],
SERVER=$withval,)
if test "x$SERVER" = "x"; then
SERVER=localhost:8080:8081
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
AC_SUBST(LOCALHOST)
AC_SUBST(HTTP_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 Create the output files.
AC_OUTPUT(
Makefile
cache/Makefile
conf/Makefile
doc/Makefile
src/Makefile
src/testprogs/Makefile
src/autoconfig.h.in
)
|