]>
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 | ||
41 | AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \ | |
42 | dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \ | |
43 | ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h errno.h) | |
44 | ||
45 | AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="") | |
46 | ||
47 | dnl Checks for typedefs, structures, and compiler characteristics. | |
48 | AC_C_CONST | |
49 | AC_STRUCT_TM | |
50 | ||
51 | # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE | |
52 | # needs to be defined for it | |
53 | AC_MSG_CHECKING([for fopen64]) | |
54 | AC_CACHE_VAL(bu_cv_have_fopen64, | |
55 | [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");], | |
56 | bu_cv_have_fopen64=yes, | |
57 | [saved_CPPFLAGS=$CPPFLAGS | |
58 | CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" | |
59 | AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");], | |
60 | bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE", | |
61 | bu_cv_have_fopen64=no) | |
62 | CPPFLAGS=$saved_CPPFLAGS])]) | |
63 | AC_MSG_RESULT($bu_cv_have_fopen64) | |
64 | if test "$bu_cv_have_fopen64" != no; then | |
65 | AC_DEFINE([HAVE_FOPEN64], 1, | |
66 | [Is fopen64 available?]) | |
67 | if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then | |
68 | AC_DEFINE([_LARGEFILE64_SOURCE], 1, | |
69 | [Enable LFS]) | |
70 | fi | |
71 | fi | |
72 | ||
73 | ||
74 | dnl Select bindir | |
75 | AC_ARG_ENABLE(bindir, | |
76 | [ --enable-bindir=bindir | |
77 | Select bindir ], | |
78 | [ | |
79 | if test "$enableval"; then | |
80 | BINDIR=$enableval | |
81 | fi | |
82 | ],[BINDIR="/usr/bin"]) | |
83 | echo "using $BINDIR as the SARG binary" | |
84 | AC_SUBST(BINDIR) | |
85 | ||
86 | dnl Select mandir | |
87 | AC_ARG_ENABLE(mandir, | |
88 | [ --enable-mandir=mandir | |
89 | Select mandir ], | |
90 | [ | |
91 | if test "$enableval"; then | |
92 | MANDIR=$enableval | |
93 | fi | |
94 | ],[MANDIR="/usr/local/man/man1"]) | |
95 | echo "using $MANDIR as the SARG man page" | |
96 | AC_SUBST(MANDIR) | |
97 | ||
98 | dnl Select sysconfdir | |
99 | AC_ARG_ENABLE(sysconfdir, | |
100 | [ --enable-sysconfdir=sysconfdir | |
101 | Select sysconfdir ], | |
102 | [ | |
103 | if test "$enableval"; then | |
104 | SYSCONFDIR=$enableval | |
105 | fi | |
106 | ],[SYSCONFDIR="/usr/local/sarg"]) | |
107 | echo "using $SYSCONFDIR as the SARG configuration dir" | |
108 | AC_SUBST(SYSCONFDIR) | |
109 | ||
110 | dnl Select htmldir | |
111 | AC_ARG_ENABLE(htmldir, | |
112 | [ --enable-htmldir=htmldir | |
113 | Select htmldir ], | |
114 | [ | |
115 | if test "$enableval"; then | |
116 | HTMLDIR=$enableval | |
117 | fi | |
118 | ],[HTMLDIR="/var/www/html"]) | |
119 | echo "using $HTMLDIR as the WWW Document Root dir" | |
120 | AC_SUBST(HTMLDIR) | |
121 | ||
122 | ||
123 | AC_OUTPUT(Makefile) |