📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(webalizer.c)dnl default language (don't change!)DEFAULT_LANG="english"AC_SUBST(DEFAULT_LANG)OPTS=${DEFS}AC_SUBST(OPTS)dnl Checks for programs.IN_CFLAGS=${CFLAGS}AC_PROG_CCAC_PROG_LN_SAC_PROG_INSTALLAC_C_CHAR_UNSIGNEDdnl force our own CFLAGS defaultsif test "$GCC" = "yes"; then AC_ARG_ENABLE(static,--enable-static Build as static executable, LDFLAGS="--static ${LDFLAGS}") if test "$IN_CFLAGS" = ""; then CFLAGS="-Wall -O2" fi if test "$ac_cv_c_char_unsigned" = "yes"; then CFLAGS="-fsigned-char ${CFLAGS}" fi AC_ARG_ENABLE(debug,--enable-debug Compile with debugging code, CFLAGS="-g ${CFLAGS}")else if test "$IN_CFLAGS" = ""; then CFLAGS="-g" fifidnl Check for command line argumentsAC_ARG_WITH(etcdir,--with-etcdir=DIR Where to look for default config file [[/etc]],ETCDIR="${withval}",CACHE_ETC="yes")AC_ARG_WITH(gdlib,--with-gdlib=DIR Where to additionally look for libgd.a,EXTRA_GDLIB="${withval}", EXTRA_GDLIB="")AC_ARG_WITH(gd,--with-gd=DIR Where to additionally look for gd headers,EXTRA_GD="${withval}"; CFLAGS="-I${withval} ${CFLAGS}", EXTRA_GD="")AC_ARG_WITH(z-inc,--with-z-inc=DIR Alternate location for libz headers,CFLAGS="-I${withval} ${CFLAGS}")AC_ARG_WITH(zlib,--with-zlib=DIR Alternate location for libz library,LDFLAGS="-L${withval} ${LDFLAGS}")AC_ARG_WITH(png-inc,--with-png-inc=DIR Alternate location of png header files, CFLAGS="-I${withval} ${CFLAGS}")AC_ARG_WITH(png,--with-png=DIR Alternate location for libpng library,LDFLAGS="-L${withval} ${LDFLAGS}")AC_ARG_WITH(db,--with-db=DIR Alternate location for db headers,CFLAGS="-I${withval} ${CFLAGS}")AC_ARG_WITH(dblib,--with-dblib=DIR Alternate location for db library,LDFLAGS="-L${withval} ${LDFLAGS}"; HAVE_DB="yes", HAVE_DB="")dnl enable-dns forces use of DNS codeAC_ARG_ENABLE(dns,--enable-dns Enable DNS lookup code,USE_DNS="yes")dnl DNS library checkif test "$USE_DNS" = "yes"; then if test "$HAVE_DB" = ""; then AC_CHECK_FUNCS(dbopen) if test $ac_cv_func_dbopen = no; then AC_SEARCH_LIBS(dbopen, db db1, OPTS="-DUSE_DNS ${OPTS}"; HAVE_DB="yes") if test "$HAVE_DB" = ""; then AC_MSG_WARN(You must have a V1.85 compatable DB library!) AC_MSG_WARN(DNS lookup code will be disabled...) fi else OPTS="-DUSE_DNS ${OPTS}"; HAVE_DB="yes" fi else OPTS="-DUSE_DNS ${OPTS}"; LIBS="-ldb ${LIBS}"; HAVE_DB="yes" fi if test "$HAVE_DB" = "yes"; then dnl on my RH6 system, db.h is db_185.h ?!? AC_CHECK_HEADERS(db_185.h) AC_CHECK_HEADERS(errno.h) fi dnl Some systems need these at link time (not Linux) AC_CHECK_FUNCS(socket) if test $ac_cv_func_socket = no; then AC_CHECK_LIB(socket, main, LIBS="-lsocket ${LIBS}";) fi AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_LIB(nsl, main, LIBS="-lnsl ${LIBS}")fidnl Check for bsd 4.4 library -l44bsd:AC_CHECK_LIB(44bsd, main, LIBS="-l44bsd ${LIBS}")dnl Check for math library -lmAC_CHECK_LIB(m, main, HAVE_LIBM="1"; LIBS="-lm ${LIBS}")dnl Check for z library -lzAC_CHECK_LIB(z, main,LIBZ="yes",LIBZ="no")if test "$LIBZ" = "no"; then AC_MSG_ERROR(z library not found... please install zlib.)else AC_CHECK_LIB(z, gzrewind,LIBS="-lz ${LIBS}",LIBZ="no") if test "$LIBZ" = "no"; then AC_MSG_ERROR(Old version of zlib found, please upgrade!) fifidnl Check for png library -lpngAC_CHECK_LIB(png, main, LIBS="-lpng ${LIBS}", LIBPNG="no") if test "$LIBPNG" = "no"; then AC_MSG_ERROR(png library not found... please install png.) fidnl check for gd graphics library -lgdif test "$EXTRA_GD" = ""; then if test "$EXTRA_GDLIB" = ""; then AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_LIBGD="yes", HAVE_LIBGD="") fifiif test "$HAVE_LIBGD" = ""; then AC_FIND_PATH(GDLOC,libgd.a,"", ${PREFIX}/lib ${PREFIX}/lib/gd /usr/local/lib /usr/local/lib/gd /usr/local/gd /usr/local/include /usr/local/include/gd /usr/lib/gd /usr/lib /lib ./ ./gd ../gd ${EXTRA_GDLIB} ${EXTRA_GD}) if test "$GDLOC" = ""; then AC_FIND_PATH(GDLOC,libgd.so,"", ${PREFIX}/lib ${PREFIX}/lib/gd /usr/local/lib /usr/local/lib/gd /usr/local/gd /usr/local/include /usr/local/include/gd /usr/lib/gd /usr/lib /lib ./ ./gd ../gd ${EXTRA_GDLIB} ${EXTRA_GD}) fi if test "$GDLOC" = ""; then AC_MSG_ERROR(gd library not found... please install gd.) else LIBS="-lgd ${LIBS}" LDFLAGS="-L${GDLOC} ${LDFLAGS}" fifidnl find path to GD library headersAC_FIND_PATH(GDLIB,gd.h,"", ${PREFIX}/include ${PREFIX}/include/gd /usr/local/include/gd /usr/local/include /usr/include/gd /usr/include /include/gd /include ./ ./gd ../gd ${EXTRA_GD} ${EXTRA_GDLIB})dnl Abort if GD headers not foundif test "$GDLIB" = ""; then AC_MSG_ERROR(gd headers not found... please install gd.)fidnl additonal platform specific checksAC_CHECK_HEADERS(getopt.h)if test "$HAVE_LIBM" = "1"; then AC_CHECK_HEADERS(math.h)fiAC_MSG_CHECKING(default config dir)if test "$CACHE_ETC" = "yes"; then AC_CACHE_VAL(ac_cv_etcdir, ac_cv_etcdir=/etc) ETCDIR=$ac_cv_etcdirfiac_cv_etcdir=$ETCDIRAC_MSG_RESULT($ETCDIR)AC_SUBST(ETCDIR)LANG_CACHE=yesAC_ARG_WITH(language,--with-language=language Use 'language' (default is english), WEBALIZER_LANG="${withval}"; LANG_CACHE=no, LANG_CACHE=yes)if test "$WEBALIZER_LANG" = "no"; then WEBALIZER_LANG=english; fidnldnl check for valid language filednlAC_MSG_CHECKING(for language file)if test "$LANG_CACHE" = "yes"; thenAC_CACHE_VAL(ac_cv_language, ac_cv_language=$DEFAULT_LANG)WEBALIZER_LANG=$ac_cv_languagefiif test -f lang/webalizer_lang.${WEBALIZER_LANG}; thenAC_MSG_RESULT(yes - ${WEBALIZER_LANG})else if test -f lang/webalizer_lang.${DEFAULT_LANG}; then AC_MSG_RESULT('${WEBALIZER_LANG}' not found - using ${DEFAULT_LANG}) WEBALIZER_LANG=${DEFAULT_LANG} else AC_MSG_RESULT(no) AC_MSG_ERROR(language files not found... fix before continuing) fifiac_cv_language=${WEBALIZER_LANG}dnl create link to language fileAC_LINK_FILES(lang/webalizer_lang.${WEBALIZER_LANG}, webalizer_lang.h)dnl the stuff below was automatically generated by autoscan...dnl since we don't (yet) have conditionals in our code to handle thesednl situations, we just ignore them for now...dnl Checks for header files.dnl AC_HEADER_STDCdnl AC_CHECK_HEADERS(unistd.h)dnl Checks for typedefs, structures, and compiler characteristics.dnl AC_STRUCT_TMdnl Checks for library functions.dnl AC_FUNC_STRFTIMEdnl AC_CHECK_FUNCS(strstr strtoul uname)AC_OUTPUT(Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -