1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([sarg],[2.2.5])
3 AC_CONFIG_SRCDIR([log.c])
4 AC_CONFIG_AUX_DIR(cfgaux)
11 [ --without-gcc use CC to compile])
13 test -n "$CC" && cc_specified=yes
19 dnl * ) AC_PROG_CXX ;;
22 if test "${CC}" = "cc" ; then
23 CFLAGS="${CFLAGS} -Wall -g -O2 -Aa -Werror=implicit-function-declaration"
25 CFLAGS="${CFLAGS} -Wall -Werror=implicit-function-declaration"
30 LDFLAGS="${LDFLAGS} -lsocket -lnsl"
31 CFLAGS="-DSOLARIS ${CFLAGS}"
35 #dnl Checks for programs.
44 if test -n "$LIBICONV" ; then
45 LIBS="$LIBS $LIBICONV"
48 AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \
49 dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \
50 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h \
51 errno.h sys/resource.h sys/wait.h stdarg.h inttypes.h)
53 AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="")
55 dnl Checks for typedefs, structures, and compiler characteristics.
61 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
62 # needs to be defined for it
63 AC_MSG_CHECKING([for fopen64])
64 AC_CACHE_VAL(bu_cv_have_fopen64,
65 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[FILE *f = fopen64 ("/tmp/foo","r");]])],[bu_cv_have_fopen64=yes],[saved_CFLAGS=$CFLAGS
66 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
67 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
68 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
69 bu_cv_have_fopen64=no)
70 CFLAGS=$saved_CFLAGS])])
71 AC_MSG_RESULT($bu_cv_have_fopen64)
72 if test "$bu_cv_have_fopen64" != no; then
73 AC_DEFINE([HAVE_FOPEN64], 1,
74 [Is fopen64 available?])
75 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then
76 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
82 dnl check for the off_t size
83 AC_CHECK_SIZEOF(off_t)
84 if test $ac_cv_sizeof_off_t = "4"; then
85 AC_DEFINE(OFFSET_STRING, "%d", [Offset string])
86 elif test $ac_cv_sizeof_off_t = "8"; then
87 AC_DEFINE(OFFSET_STRING, "%"PRId64, [Offset string])
89 AC_MSG_ERROR([can not detect the size of your system\'s off_t type])
92 dnl check for the rlim_t size
93 AC_CHECK_SIZEOF(rlim_t,1,[#if HAVE_SYS_RESOURCE_H
94 #include <sys/resource.h>
97 if test $ac_cv_sizeof_rlim_t = "4"; then
98 AC_DEFINE(RLIM_STRING, "%d", [Rlim string])
99 elif test $ac_cv_sizeof_rlim_t = "8"; then
100 AC_DEFINE(RLIM_STRING, "%lli", [Rlim string])
102 AC_MSG_ERROR([can not detect the size of your system\'s rlim_t type])
106 AC_ARG_ENABLE(htmldir,
107 [ --enable-htmldir=htmldir
108 Select htmldir as the root of your WWW documents ],
110 if test "$enableval"; then
113 ],[HTMLDIR="/var/www/html"])
114 echo "using $HTMLDIR as the WWW Document Root dir"
117 AC_CONFIG_FILES([Makefile])