]> git.ipfire.org Git - thirdparty/sarg.git/blame - configure.in
Mass commit of all the changes made between version 2.1 and 2.2.5. See ChangeLog...
[thirdparty/sarg.git] / configure.in
CommitLineData
25697a35
GS
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(log.c)
3AC_CONFIG_AUX_DIR(cfgaux)
4
5LDFLAGS="-g"
6
7AC_CANONICAL_HOST
8
9AC_ARG_WITH(gcc,
10[ --without-gcc use CC to compile])
11
12test -n "$CC" && cc_specified=yes
13case ${with_gcc} in
14 yes ) CC=gcc ;;
15dnl yes ) CC=g++ ;;
16 no ) CC=cc ;;
17 * ) AC_PROG_CC;;
18dnl * ) AC_PROG_CXX ;;
19esac
20
21if test "${CC}" = "cc" ; then
22 CFLAGS="${CFLAGS} -w -g -O2 -Aa"
23else
24 CFLAGS="${CFLAGS} -w"
25fi
26
27case "$host" in
28 *-solaris*)
29 LDFLAGS="${LDFLAGS} -lsocket -lnsl"
30 CFLAGS="-DSOLARIS ${CFLAGS}"
31 ;;
32esac
33
34#dnl Checks for programs.
35#AC_PROG_CC
36
37dnl Check for headers
38AC_HEADER_DIRENT
39AC_HEADER_STDC
40
d6e703cc
FM
41dnl Check for iconv
42AM_ICONV
43if test -n "$LIBICONV" ; then
44 LIBS="$LIBS $LIBICONV"
45fi
46
25697a35
GS
47AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \
48 dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \
d6e703cc
FM
49 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h \
50 errno.h sys/resource.h)
25697a35
GS
51
52AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="")
53
54dnl Checks for typedefs, structures, and compiler characteristics.
55AC_C_CONST
56AC_STRUCT_TM
57
d6e703cc
FM
58dnl check for the off_t size
59AC_CHECK_SIZEOF(off_t)
60if test $ac_cv_sizeof_off_t = "4"; then
61 AC_DEFINE(OFFSET_STRING, "%d", [Offset string])
62elif test $ac_cv_sizeof_off_t = "8"; then
63 AC_DEFINE(OFFSET_STRING, "%lli", [Offset string])
64else
65 AC_ERROR(can not detect the size of your system\'s off_t type)
66fi
67
25697a35
GS
68# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
69# needs to be defined for it
70AC_MSG_CHECKING([for fopen64])
71AC_CACHE_VAL(bu_cv_have_fopen64,
72[AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
73bu_cv_have_fopen64=yes,
74[saved_CPPFLAGS=$CPPFLAGS
75 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
76 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
77bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
78bu_cv_have_fopen64=no)
79 CPPFLAGS=$saved_CPPFLAGS])])
80AC_MSG_RESULT($bu_cv_have_fopen64)
81if test "$bu_cv_have_fopen64" != no; then
82 AC_DEFINE([HAVE_FOPEN64], 1,
83 [Is fopen64 available?])
84 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then
85 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
86 [Enable LFS])
87 fi
88fi
89
90
91dnl Select bindir
92AC_ARG_ENABLE(bindir,
93[ --enable-bindir=bindir
94 Select bindir ],
95[
96 if test "$enableval"; then
97 BINDIR=$enableval
98 fi
99],[BINDIR="/usr/bin"])
100echo "using $BINDIR as the SARG binary"
101AC_SUBST(BINDIR)
102
103dnl Select mandir
104AC_ARG_ENABLE(mandir,
105[ --enable-mandir=mandir
106 Select mandir ],
107[
108 if test "$enableval"; then
109 MANDIR=$enableval
110 fi
111],[MANDIR="/usr/local/man/man1"])
112echo "using $MANDIR as the SARG man page"
113AC_SUBST(MANDIR)
114
115dnl Select sysconfdir
116AC_ARG_ENABLE(sysconfdir,
117[ --enable-sysconfdir=sysconfdir
118 Select sysconfdir ],
119[
120 if test "$enableval"; then
121 SYSCONFDIR=$enableval
122 fi
123],[SYSCONFDIR="/usr/local/sarg"])
124echo "using $SYSCONFDIR as the SARG configuration dir"
125AC_SUBST(SYSCONFDIR)
126
127dnl Select htmldir
128AC_ARG_ENABLE(htmldir,
129[ --enable-htmldir=htmldir
130 Select htmldir ],
131[
132 if test "$enableval"; then
133 HTMLDIR=$enableval
134 fi
135],[HTMLDIR="/var/www/html"])
136echo "using $HTMLDIR as the WWW Document Root dir"
137AC_SUBST(HTMLDIR)
138
139
140AC_OUTPUT(Makefile)