dnl Process this file with autoconf or autoreconf to produce a configure script.
AC_INIT([sarg],[2.4.0-pre2])
AC_CONFIG_SRCDIR([log.c])
-AC_CONFIG_AUX_DIR(cfgaux)
+AC_CONFIG_AUX_DIR([cfgaux])
+AC_CONFIG_MACRO_DIR([m4])
+
+dnl We don't use automake but the following macro is required to
+dnl install "install-sh" that is required by configure.
+dnl I may be a bug in autoconf 2.69...
+dnl But if it is enabled, the AM_GNU_GETTEXT produce a warning!
+dnl The solution for now is to manually run automake -a before
+dnl running the configure script
+dnl AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
# Build with gd
AC_ARG_WITH([gd],
-AS_HELP_STRING([--with-gd],[Compile with support for the graphical gd library]),
-[],[with_gd=check])
+ AS_HELP_STRING([--with-gd],[Compile with support for the graphical gd library]),
+ [],[with_gd=check])
AS_IF([test "x$with_gd" != "xno"],
[
AC_CHECK_HEADERS(gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h)
# Build with LDAP
AC_ARG_WITH([ldap],
-AS_HELP_STRING([--with-ldap],[Compile with LDAP support]),
-[],[with_ldap=check])
+ AS_HELP_STRING([--with-ldap],[Compile with LDAP support]),
+ [],[with_ldap=check])
AS_IF([test "x$with_ldap" != "xno"],
[
AC_CHECK_HEADERS([ldap_cdefs.h] [ldap_features.h] [ldap.h],,break)
# Build with iconv
AC_ARG_WITH([iconv],
-AS_HELP_STRING([--with-iconv],[Compile with support for iconv]),
-[],[with_iconv=check])
+ AS_HELP_STRING([--with-iconv],[Compile with support for iconv]),
+ [],[with_iconv=check])
AS_IF([test "x$with_iconv" != "xno"],
[
dnl Check for iconv
# Build with pcre
AC_ARG_WITH([pcre],
-AS_HELP_STRING([--with-pcre],[Compile with support for the Perl Compatible Regular Expressions library]),
-[],[with_pcre=check])
+ AS_HELP_STRING([--with-pcre],[Compile with support for the Perl Compatible Regular Expressions library]),
+ [],[with_pcre=check])
AS_IF([test "x$with_pcre" != "xno"],
[
AC_CHECK_HEADERS(pcre.h)
# Build with file globbing
AC_ARG_WITH([glob],
-AS_HELP_STRING([--without-glob],[Ignore wildcards in file names]),
-[with_glob=no],[with_glob=yes])
+ AS_HELP_STRING([--without-glob],[Ignore wildcards in file names]),
+ [],[with_glob=yes])
AS_IF([test "x$with_glob" != "xno"],
[
- AC_CHECK_HEADERS(glob.h)
+ AC_CHECK_HEADERS([glob.h],[],
+ [
+ AS_IF([test "x$with_glob" != "xcheck"],
+ [
+ AC_MSG_FAILURE([glob.h not found (use --without-glob to compile without file globbing)])
+ ])
+ ])
],[
glob_status="disabled"
])
# Build with zlib
AC_ARG_WITH([zlib],
-AS_HELP_STRING([--with-zlib],[Compile with support to decompress gz files]),
-[],[with_zlib=check])
+ AS_HELP_STRING([--with-zlib],[Compile with support to decompress gz files]),
+ [],[with_zlib=check])
AS_IF([test "x$with_zlib" != "xno" ],
[
AC_CHECK_HEADERS(zlib.h)
AS_IF([test "x$ac_cv_header_zlib_h" = "xyes"],
[
- AC_CHECK_LIB(z, gzopen,LIBS="-lz ${LIBS}"; HAVE_ZLIB_LIB="yes", HAVE_ZLIB_LIB="")
+ AC_CHECK_LIB([z],[gzopen],
+ [
+ LIBS="-lz ${LIBS}"
+ HAVE_ZLIB_LIB="yes"
+ ],[
+ HAVE_ZLIB_LIB=""
+ ])
AS_IF([test "x$HAVE_ZLIB_LIB" != "xyes"],[AC_MSG_ERROR([zlib was not found])])
],[
zlib_status="not found"
zlib_status="disabled"
])
+# Build with bzlib
+AC_ARG_WITH([bzlib],
+ AS_HELP_STRING([--with-bzlib],[Compile with support to decompress bz2 files]),
+ [],[with_bzlib=check])
+AS_IF([test "x$with_bzlib" != "xno" ],
+[
+ AC_CHECK_HEADERS(bzlib.h)
+ AS_IF([test "x$ac_cv_header_bzlib_h" = "xyes"],
+ [
+ AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],
+ [
+ LIBS="-lbz2 ${LIBS}"
+ HAVE_BZLIB_LIB="yes"
+ ],[
+ HAVE_BZLIB_LIB=""
+ ])
+ AS_IF([test "x$HAVE_BZLIB_LIB" != "xyes"],[AC_MSG_ERROR([bzlib was not found])])
+ ],[
+ bzlib_status="not found"
+ ])
+],[
+ bzlib_status="disabled"
+])
+
+# Build with liblzma
+AC_ARG_WITH([liblzma],
+ AS_HELP_STRING([--with-liblzma],[Compile with support to decompress xz files]),
+ [],[with_liblzma=check])
+AS_IF([test "x$with_liblzma" != "xno" ],
+[
+ AC_CHECK_HEADERS(lzma.h)
+ AS_IF([test "x$ac_cv_header_lzma_h" = "xyes"],
+ [
+ AC_CHECK_LIB([lzma],[lzma_stream_decoder],
+ [
+ LIBS="-llzma ${LIBS}"
+ HAVE_LIBLZMA_LIB="yes"
+ ],[
+ HAVE_LIBLZMA_LIB=""
+ ])
+ AS_IF([test "x$HAVE_LIBLZMA_LIB" != "xyes"],[AC_MSG_ERROR([liblzma was not found])])
+ ],[
+ liblzma_status="not found"
+ ])
+],[
+ liblzma_status="disabled"
+])
+
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM
dnl Select sarg-php directory
AC_ARG_ENABLE(sargphp,
-AS_HELP_STRING([--enable-sargphp=sargphpdir],
-[Select sargphpdir as the directory to install sarg-php into]),
-[
- AS_IF([test "$enableval" -a "x$enableval" != "xno"],[SARGPHPDIR=$enableval])
-],[SARGPHPDIR="/var/www/html"])
+ AS_HELP_STRING([--enable-sargphp=sargphpdir],
+ [Select sargphpdir as the directory to install sarg-php into]),
+ [
+ AS_IF([test "$enableval" -a "x$enableval" != "xno"],[SARGPHPDIR=$enableval])
+ ],[SARGPHPDIR="/var/www/html"])
AS_IF([test "$SARGPHPDIR"],
[
AC_MSG_NOTICE([using $SARGPHPDIR as the directory to install sarg-php])
dnl Select fonts dir
AC_ARG_ENABLE(fontdir,
-AS_HELP_STRING([--enable-fontdir=fontdir],
-[Select fontdir as the directory with the fonts to use in the reports]),
-[
- AS_IF([test "$enableval" -a "x$enableval" != "xno"],[FONTDIR=$enableval])
-],[FONTDIR="${datarootdir}/sarg/fonts"])
+ AS_HELP_STRING([--enable-fontdir=fontdir],
+ [Select fontdir as the directory with the fonts to use in the reports]),
+ [
+ AS_IF([test "$enableval" -a "x$enableval" != "xno"],[FONTDIR=$enableval])
+ ],[FONTDIR="${datarootdir}/sarg/fonts"])
AS_IF([test "$FONTDIR"],
[
AS_IF([test "x$prefix" = "xNONE"],
dnl Select images dir
AC_ARG_ENABLE(imagedir,
-AS_HELP_STRING([--enable-imagedir=imagedir],
-[Select imagedir as the directory with the images to use in the reports]),
-[
- AS_IF([test "$enableval"],[IMAGEDIR=$enableval])
-],[IMAGEDIR="${datarootdir}/sarg/images"])
+ AS_HELP_STRING([--enable-imagedir=imagedir],
+ [Select imagedir as the directory with the images to use in the reports]),
+ [
+ AS_IF([test "$enableval"],[IMAGEDIR=$enableval])
+ ],[IMAGEDIR="${datarootdir}/sarg/images"])
AS_IF([test "x$prefix" = "xNONE"],
[
tempfullpath=`prefix=$ac_default_prefix ; eval "echo $IMAGEDIR"`
dnl Enable extra compile and run time protection
AC_ARG_ENABLE(extraprotection,
-AS_HELP_STRING([--enable-extraprotection],
-[Enable compile and runtime extra protections]),
+ AS_HELP_STRING([--enable-extraprotection],
+ [Enable compile and runtime extra protections]),
[
AS_IF([test "$enableval"],
[
dnl Enable double check of the data written in the reports
AC_ARG_ENABLE(doublecheck,
-AS_HELP_STRING([--enable-doublecheck],
-[Make sarg double check the data it manipulates and output a warning if an error is found]),
+ AS_HELP_STRING([--enable-doublecheck],
+ [Make sarg double check the data it manipulates and output a warning if an error is found]),
[
AS_IF([test "$enableval"],
[
dnl Get the xsl stylesheet to produce the manpage
AC_ARG_ENABLE(xsl-man,
-AS_HELP_STRING([--enable-xsl-man=man-xsl-style-sheet],
-[Select the directory containing the the XSL stylesheets to convert DocBook into man page]),
+ AS_HELP_STRING([--enable-xsl-man=man-xsl-style-sheet],
+ [Select the directory containing the the XSL stylesheets to convert DocBook into man page]),
[
AS_IF([test "$enableval"],
[
# debian
XSL_MAN_STYLESHEET="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl"
AC_SUBST(XSL_MAN_STYLESHEET)
-],
-[
-AC_CHECK_FILES([/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl],
-[
- # gentoo
- XSL_MAN_STYLESHEET="/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl"
- AC_SUBST(XSL_MAN_STYLESHEET)
-],)
+],[
+ AC_CHECK_FILES([/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl],
+ [
+ # gentoo
+ XSL_MAN_STYLESHEET="/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl"
+ AC_SUBST(XSL_MAN_STYLESHEET)
+ ])
]))
dnl Get the xsl stylesheet to produce the html page
AC_ARG_ENABLE(xsl-html,
-AS_HELP_STRING([--enable-xsl-html=html-xsl-style-sheet],
-[Select the directory containing the the XSL stylesheets to convert DocBook into html page]),
+ AS_HELP_STRING([--enable-xsl-html=html-xsl-style-sheet],
+ [Select the directory containing the the XSL stylesheets to convert DocBook into html page]),
[
AS_IF([test "$enableval"],
[
# gentoo
XSL_HTML_STYLESHEET="/usr/share/sgml/docbook/xsl-stylesheets/html/onechunk.xsl"
AC_SUBST(XSL_HTML_STYLESHEET)
-],)
+])
]))
AC_SUBST(PACKAGE,"$PACKAGE_NAME")
],[test "x$zlib_status" = "xnot found"],[
AC_MSG_NOTICE([zlib.h was not found so it won't be possible to process gzipped files])
])
+
+AS_IF([test "x$bzlib_status" = "xdisabled"],[
+ AC_MSG_NOTICE([Not building with bzlib as requested on the configuration command line])
+],[test "x$bzlib_status" = "xnot found"],[
+ AC_MSG_NOTICE([bzlib.h was not found so it won't be possible to process bzipped files])
+])
+
+AS_IF([test "x$liblzma_status" = "xdisabled"],[
+ AC_MSG_NOTICE([Not building with liblzma as requested on the configuration command line])
+],[test "x$liblzma_status" = "xnot found"],[
+ AC_MSG_NOTICE([lzma.h was not found so it won't be possible to process xz files])
+])