📄 config~2.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(src/main.c)AM_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE(modlogan,0.6.3)AM_MAINTAINER_MODEdnl Checks for programs.AC_PROG_CCAC_PROG_INSTALLAC_PROG_AWKAC_PROG_CPPAC_PROG_LN_SAC_PROG_MAKE_SETAM_WITH_DMALLOCif test -z "`echo "$CFLAGS" 2> /dev/null`" ; then CFLAGS="-O2 -g -Wall"fiAC_ARG_ENABLE(plugins,[ --enable-plugins Enable the use of dlopened plugins [default=no]],[case "${enableval}" in yes) plugins=true ;; no) plugins=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugins) ;;esac], [plugins=false])AC_ARG_ENABLE(check-dynamic,[ --enable-check-dynamic Enables a check for the correct behaviour of your dynamic libraries [default=yes]],[case "${enableval}" in yes) do_check=true ;; no) do_check=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-check-dynamic) ;;esac], [do_check=true])AM_CONDITIONAL(NO_PLUGINS, test x$plugins = xfalse)if test x$plugins = xfalse ; then AM_DISABLE_SHARED NO_PLUGINS=true AC_DEFINE(NO_PLUGINS)else AM_DISABLE_STATIC AC_LIBTOOL_DLOPEN AC_SEARCH_LIBS(dlopen, dl, [test "$ac_cv_search_dlopen" = "none required" || DL_LIB="$ac_cv_search_dlopen"], DL_LIB="") AC_SUBST(DL_LIB)fiAM_PROG_LIBTOOLALL_LINGUAS="de cs es it"AM_GNU_GETTEXTif test x$USE_INCLUDED_LIBINTL = xyes; then INTLINC='-I$(top_srcdir)/intl'else INTLINC=""fiAC_SUBST(INTLINC)LIBGD_PATH=falseAC_ARG_WITH(gd,[ --with-gd=DIR path the GD includes], LIBGD_PATH="${withval}")# --with-gd is only usefull with a pathif test x$LIBGD_PATH = xyes ; then LIBGD_PATH=falsefidnl Checks for header files.AC_HEADER_STDCAC_HEADER_DIRENTAC_HEADER_SYS_WAITAC_CHECK_HEADERS(fcntl.h unistd.h sys/time.h)dnl Checks for typedefs, structures, and compiler characteristics.AC_HEADER_TIMEAC_C_CONSTdnl Checks for library functions.AC_PROG_GCC_TRADITIONALAC_CHECK_FUNCS(strerror strtod strtol)if test x$plugins = xfalse ; then _INPUT_PLUGIN="clf" _OUTPUT_PLUGIN="modlogan" _PROCESSOR_PLUGIN="web" AC_ARG_WITH(output,[ --with-output=MODULE staticly linked output module], _OUTPUT_PLUGIN="${withval}") AC_ARG_WITH(input,[ --with-input=MODULE staticly linked input module], _INPUT_PLUGIN="${withval}") AC_ARG_WITH(processor,[ --with-processor=MODULE staticly linked processor module], _PROCESSOR_PLUGIN="${withval}") TEST_PATH="$srcdir/src/output/${_OUTPUT_PLUGIN}/generate.c" echo $ac_n "checking for outputplugin (${_OUTPUT_PLUGIN})""... $ac_c" if test -r ${TEST_PATH}; then OUTPUT_PLUGIN=${_OUTPUT_PLUGIN} echo "found" else echo "not found" echo "Please check if you have specified one of the following values" echo "- webalizer" echo "- text" echo "- csv" echo "- modlogan" echo "and many others. please, take a look at the INSTALL file." exit fi TEST_PATH="$srcdir/src/input/${_INPUT_PLUGIN}/parse.c" echo $ac_n "checking for inputplugin (${_INPUT_PLUGIN})""... $ac_c" if test -r ${TEST_PATH}; then INPUT_PLUGIN=${_INPUT_PLUGIN} echo "found" else echo "not found" echo "Please check if you have specified one of the following values" echo "- clf" echo "- wuftpd" echo "- null" echo "- msiis" echo "and many others. please, take a look at the INSTALL file." exit fi TEST_PATH="$srcdir/src/processor/${_PROCESSOR_PLUGIN}/process.c" echo $ac_n "checking for processorplugin (${_PROCESSOR_PLUGIN})""... $ac_c" if test -r ${TEST_PATH}; then PROCESSOR_PLUGIN=${_PROCESSOR_PLUGIN} echo "found" else echo "not found" echo "Please check if you have specified one of the following values" echo "- telecom" echo "- web" exit fi AC_SUBST(INPUT_PLUGIN) AC_SUBST(OUTPUT_PLUGIN) AC_SUBST(PROCESSOR_PLUGIN) AC_DEFINE_UNQUOTED(INPUT_PLUGIN, "$INPUT_PLUGIN", [name of the inputplugin]) AC_DEFINE_UNQUOTED(OUTPUT_PLUGIN, "$OUTPUT_PLUGIN", [name of the outputplugin]) AC_DEFINE_UNQUOTED(PROCESSOR_PLUGIN, "$PROCESSOR_PLUGIN", [name of the processorplugin])fiAC_CHECK_LIB(pcre, pcre_exec, HAVE_LIBPCRE=true, HAVE_LIBPCRE=false)if [ test x$HAVE_LIBPCRE = xfalse]; then echo "libpcre was not found. please install libpcre and run configure again"; exit else PCRE_LIB="-lpcre" AC_SUBST(PCRE_LIB)fiAC_SEARCH_LIBS(pow, "m", [test "$ac_cv_search_pow" = "none required" || M_LIB="$ac_cv_search_pow"], M_LIB="")AC_SUBST(M_LIB)AC_CHECK_LIB(adns, adns_wait, HAVE_LIBADNS=true, HAVE_LIBADNS=false)if [ test x$HAVE_LIBADNS = xfalse]; then echo "-- Could not detect libadns" echo "-> Resolver support disabled"else ADNS_LIB="-ladns" AC_SUBST(ADNS_LIB) AC_DEFINE(HAVE_LIBADNS)fiAC_CHECK_HEADER(zlib.h, HAVE_LIBZ=true, HAVE_LIBZ=false)if [ test x$HAVE_LIBZ = xtrue]; then AC_CHECK_LIB(z, gzopen, HAVE_LIBZ=true, HAVE_LIBZ=false) if [ test x$HAVE_LIBZ = xtrue]; then AC_DEFINE(HAVE_LIBZ) Z_LIB="-lz" AC_SUBST(Z_LIB) else echo "the libraries of libz couldn't be found. please install libz and run configure again"; exit fielse echo "the headers of libz couldn't be found. please install libz and run configure again"; exitfiAC_CHECK_HEADER(getopt.h, HAVE_GETOPT=true, HAVE_GETOPT=false)if [ test x$HAVE_GETOPT = xtrue]; then AC_CHECK_LIB(c, getopt_long, HAVE_GETOPT=true, HAVE_GETOPT=false) if [ test x$HAVE_GETOPT = xtrue]; then AC_DEFINE(HAVE_GETOPT_LONG) fi AC_DEFINE(HAVE_GETOPT_H)fiAC_CHECK_LIB(png, main, HAVE_LIBPNG=true, HAVE_LIBPNG=false, -lm -lz)if [ test x$HAVE_LIBPNG = xtrue ]; then AC_PATH_X OLDLIBS=${LIBS} if test "$have_x" = yes; then LIBS="${LIBS} -L$x_libraries" fi AC_CHECK_LIB(Xpm, main,HAVE_LIBXPM=true, HAVE_LIBXPM=false, -lX11) LIBS=${OLDLIBS} OLDINC=${CPPFLAGS} if [ test x$LIBGD_PATH != xfalse ]; then CPPFLAGS="-I${LIBGD_PATH} ${INCLUDES}" fi AC_CHECK_HEADER(gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if [ test x$HAVE_INCGD = xfalse]; then OLDINC=${CPPFLAGS} if [ test x$LIBGD_PATH != xfalse ]; then CPPFLAGS="-I${LIBGD_PATH} ${INCLUDES}" fi AC_CHECK_HEADER(gd/gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if [ test x$HAVE_INCGD = xfalse]; then OLDINC=${CPPFLAGS} if [ test x$LIBGD_PATH != xfalse ]; then CPPFLAGS="-I${LIBGD_PATH}/include ${INCLUDES}" fi AC_CHECK_HEADER(gd.h, HAVE_INCGD=true, HAVE_INCGD=false) CPPFLAGS=${OLDINC} if [ test x$HAVE_INCGD = xtrue]; then GD_INCDIR="-I${LIBGD_PATH}/include" fi else AC_DEFINE(HAVE_GD_GD_H) if [ test x$LIBGD_PATH != xfalse ]; then GD_INCDIR="-I${LIBGD_PATH}" fi fi else if [ test x$LIBGD_PATH != xfalse ]; then GD_INCDIR="-I${LIBGD_PATH}" fi fi OLDLIBS=${LIBS} if [ test x$LIBGD_PATH != xfalse ]; then LIBS="-L${LIBGD_PATH} ${LIBS}" fi AC_CHECK_LIB(gd, gdImagePng, HAVE_LIBGD=true, HAVE_LIBGD=false, -lpng -lz) LIBS=${OLDLIBS} if [ test x$HAVE_LIBGD = xfalse]; then OLDLIBS=${LIBS} if [ test x$LIBGD_PATH != xfalse ]; then LIBS="-L${LIBGD_PATH}/lib ${LIBS}" fi AC_CHECK_LIB(gd, gdImagePng, HAVE_LIBGD=true, HAVE_LIBGD=false, -lpng -lz) LIBS=${OLDLIBS} if [ test x$HAVE_LIBGD = xtrue]; then GD_LIBDIR="-L${LIBGD_PATH}/lib" fi else if [ test x$LIBGD_PATH != xfalse ]; then GD_LIBDIR="-L${LIBGD_PATH}" fi fi if [ test x$HAVE_INCGD = xfalse]; then echo "-- couldn't detect libgd headers(did you use --with-gd=<...> ??)"; echo "-- please install libgd > 1.7.x to get graphics in the reports"; echo "-> graphic support disabled"; else if [ test x$HAVE_LIBGD = xfalse]; then echo "-- couldn't detect libgd libraries with PNG-support"; echo "-- please install libgd > 1.7.x to get graphics in the reports"; echo "-> graphic support disabled"; else AC_DEFINE(HAVE_LIBGD) AC_SUBST(GD_LIBDIR) AC_SUBST(GD_INCDIR) fi fi AM_CONDITIONAL(NO_GRAPHICS, test x$HAVE_LIBGD = xfalse)else echo "-- couldn't detect libpng"; echo "-- please install libpng to get graphics in the reports"; echo "-> graphic support disabled"; AM_CONDITIONAL(NO_GRAPHICS, test x$HAVE_LIBPNG = xfalse)fidnl check for shared libs (dynamic mode only)if [ test x$plugins = xtrue && test x$do_check = xtrue ]; thenecho $ac_n "checking for dynamic versions of libgd, libpcre and libadns""... $ac_c"OLDLIBS=$LIBSLIBS="-lgd -lpcre -lz -lpng ${ADNS_LIB} ${M_LIB}" AC_TRY_LINK_MOD( , [int main(){ gdImagePng(); pcre_exec(); adns_wait();}],[ ldd conftest$ac_exeext > conftest.ldd_out;is_shared=`grep "libpcre" conftest.ldd_out | sed "s/.*=>//" | grep libpcre`is_shared_found=1if test "x$is_shared" = "x"; then is_shared_found=0fiis_shared=`grep "libgd" conftest.ldd_out | sed "s/.*=>//" | grep libgd`if test "x$is_shared" = "x"; then is_shared_found=0fiif [ test x$HAVE_LIBADNS = xtrue]; then is_shared=`grep "libadns" conftest.ldd_out | sed "s/.*=>//" | grep libadns` if test "x$is_shared" = "x"; then is_shared_found=0 fifiif test $is_shared_found = 0; then echo "failed" if [ test x$HAVE_LIBADNS = xtrue]; then echo "--> either libgd, libpcre or libadns aren't available in a shared version. here is the output of ldd:" else echo "--> either libgd or libpcre aren't available in a shared version. here is the output of ldd:" fi cat conftest.ldd_out echo "--> either you install all libraries as a shared version or you remove the '--enable-plugins' switch from the commandline" echo "--> if this diagnosic is wrong, send a mail to jan@kneschke.de including the current screen output and your 'uname -a'" echo "--> can suppress this check if you add '--disable-check-dynamic' to the configure options" exitelse echo "done"fi ],[echo "broken"echo "--> a small programm which checks for a shared version of libgd and libpcre couldn't be build. please send a full report and your config.log to jan@kneschke.de"echo "--> can suppress this check if you add '--disable-check-dynamic' to the configure options"exit])LIBS=$OLDLIBSfidnl Checks for database.MYSQL_LDADD=""MYSQL_INCLUDE=""AC_MSG_CHECKING(for MySQL support)AC_ARG_WITH(mysql,[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base install directory, defaults to /usr/local.],[ if test "$withval" != "no"; then if test "$withval" = "yes"; then MYSQL_INCDIR=/usr/local/include/mysql MYSQL_LIBDIR=/usr/local/lib/mysql else if test -f $withval/include/mysql/mysql.h; then MYSQL_INCDIR=$withval/include/mysql MYSQL_LIBDIR=$withval/lib/mysql elif test -f $withval/include/mysql.h; then MYSQL_INCDIR=$withval/include MYSQL_LIBDIR=$withval/lib else AC_MSG_RESULT(no) AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval) fi fi MYSQL_INCLUDE=-I$MYSQL_INCDIR MYSQL_LFLAGS="${ld_runpath_switch}$MYSQL_LIBDIR -L$MYSQL_LIBDIR" MYSQL_LIBS=-lmysqlclient AC_MSG_RESULT(yes) dnl check for errmsg.h, which isn't installed by some versions of 3.21 old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE" AC_CHECK_HEADERS(errmsg.h mysql.h) CPPFLAGS="$old_CPPFLAGS" MYSQL_LDADD="-L$MYSQL_LIBDIR $MYSQL_LIBS" else AC_MSG_RESULT(no) fi],[ AC_MSG_RESULT(no)])AC_SUBST(MYSQL_LDADD)AC_SUBST(MYSQL_INCLUDE)dnl Only use -Wall if we have gccif test "x$GCC" = "xyes"; then if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CXXFLAGS="$CXXFLAGS -Wall" CFLAGS="$CFLAGS -Wall" fifilocaledir='${datadir}/locale'AC_SUBST(localedir)AC_OUTPUT( Makefile \ doc/Makefile \ src/Makefile \ po/Makefile.in \ intl/Makefile \ src/input/Makefile \ src/input/clf/Makefile \ src/input/elmeg/Makefile \ src/input/hicom116/Makefile \ src/input/isdnlog/Makefile \ src/input/msiis/Makefile \ src/input/null/Makefile \ src/input/netscape/Makefile \ src/input/realserver/Makefile \ src/input/shoutcast/Makefile \ src/input/skeleton/Makefile \ src/input/squid/Makefile \ src/input/wuftpd/Makefile \ src/output/Makefile \ src/output/csv/Makefile \ src/output/modlogan/Makefile \ src/output/text/Makefile \ src/output/tkcontrol/Makefile \ src/output/webalizer/Makefile \ src/processor/Makefile \ src/processor/telecom/Makefile \ src/processor/web/Makefile \ modlogan.spec)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -