]>
Commit | Line | Data |
---|---|---|
25697a35 GS |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_INIT(log.c) | |
3 | AC_CONFIG_AUX_DIR(cfgaux) | |
4 | ||
5 | LDFLAGS="-g" | |
6 | ||
7 | AC_CANONICAL_HOST | |
8 | ||
9 | AC_ARG_WITH(gcc, | |
10 | [ --without-gcc use CC to compile]) | |
11 | ||
12 | test -n "$CC" && cc_specified=yes | |
13 | case ${with_gcc} in | |
14 | yes ) CC=gcc ;; | |
15 | dnl yes ) CC=g++ ;; | |
16 | no ) CC=cc ;; | |
17 | * ) AC_PROG_CC;; | |
18 | dnl * ) AC_PROG_CXX ;; | |
19 | esac | |
20 | ||
21 | if test "${CC}" = "cc" ; then | |
22 | CFLAGS="${CFLAGS} -w -g -O2 -Aa" | |
23 | else | |
24 | CFLAGS="${CFLAGS} -w" | |
25 | fi | |
26 | ||
27 | case "$host" in | |
28 | *-solaris*) | |
29 | LDFLAGS="${LDFLAGS} -lsocket -lnsl" | |
30 | CFLAGS="-DSOLARIS ${CFLAGS}" | |
31 | ;; | |
32 | esac | |
33 | ||
34 | #dnl Checks for programs. | |
35 | #AC_PROG_CC | |
36 | ||
37 | dnl Check for headers | |
38 | AC_HEADER_DIRENT | |
39 | AC_HEADER_STDC | |
40 | ||
d6e703cc FM |
41 | dnl Check for iconv |
42 | AM_ICONV | |
43 | if test -n "$LIBICONV" ; then | |
44 | LIBS="$LIBS $LIBICONV" | |
45 | fi | |
46 | ||
25697a35 GS |
47 | AC_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 | |
52 | AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="") | |
53 | ||
54 | dnl Checks for typedefs, structures, and compiler characteristics. | |
55 | AC_C_CONST | |
56 | AC_STRUCT_TM | |
57 | ||
d6e703cc FM |
58 | dnl check for the off_t size |
59 | AC_CHECK_SIZEOF(off_t) | |
60 | if test $ac_cv_sizeof_off_t = "4"; then | |
61 | AC_DEFINE(OFFSET_STRING, "%d", [Offset string]) | |
62 | elif test $ac_cv_sizeof_off_t = "8"; then | |
63 | AC_DEFINE(OFFSET_STRING, "%lli", [Offset string]) | |
64 | else | |
65 | AC_ERROR(can not detect the size of your system\'s off_t type) | |
66 | fi | |
67 | ||
25697a35 GS |
68 | # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE |
69 | # needs to be defined for it | |
70 | AC_MSG_CHECKING([for fopen64]) | |
71 | AC_CACHE_VAL(bu_cv_have_fopen64, | |
72 | [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");], | |
73 | bu_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");], | |
77 | bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE", | |
78 | bu_cv_have_fopen64=no) | |
79 | CPPFLAGS=$saved_CPPFLAGS])]) | |
80 | AC_MSG_RESULT($bu_cv_have_fopen64) | |
81 | if 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 | |
88 | fi | |
89 | ||
90 | ||
91 | dnl Select bindir | |
92 | AC_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"]) | |
100 | echo "using $BINDIR as the SARG binary" | |
101 | AC_SUBST(BINDIR) | |
102 | ||
103 | dnl Select mandir | |
104 | AC_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"]) | |
112 | echo "using $MANDIR as the SARG man page" | |
113 | AC_SUBST(MANDIR) | |
114 | ||
115 | dnl Select sysconfdir | |
116 | AC_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"]) | |
124 | echo "using $SYSCONFDIR as the SARG configuration dir" | |
125 | AC_SUBST(SYSCONFDIR) | |
126 | ||
127 | dnl Select htmldir | |
128 | AC_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"]) | |
136 | echo "using $HTMLDIR as the WWW Document Root dir" | |
137 | AC_SUBST(HTMLDIR) | |
138 | ||
139 | ||
140 | AC_OUTPUT(Makefile) |