]>
Commit | Line | Data |
---|---|---|
090089c4 | 1 | dnl |
2877b8a9 | 2 | dnl Configuration input file for Squid |
090089c4 | 3 | dnl |
2877b8a9 | 4 | dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.7) |
090089c4 | 5 | dnl |
a26bdc75 | 6 | dnl $Id: configure.in,v 1.14 1996/04/08 23:25:18 wessels Exp $ |
090089c4 | 7 | dnl |
8 | dnl | |
090089c4 | 9 | dnl |
a26bdc75 | 10 | AC_INIT(src/main.c) |
090089c4 | 11 | AC_CONFIG_HEADER(include/autoconf.h) |
a26bdc75 | 12 | AC_REVISION($Revision: 1.14 $)dnl |
2877b8a9 | 13 | AC_PREFIX_DEFAULT(/usr/local/squid) |
da22ac20 | 14 | AC_CONFIG_AUX_DIR(aux) |
090089c4 | 15 | |
88d50a22 | 16 | AC_CANONICAL_HOST |
17 | ||
090089c4 | 18 | dnl Build a copy of prefix |
19 | ||
20 | if test -n "$prefix"; then | |
21 | myprefix="$prefix"; | |
22 | else | |
a26bdc75 | 23 | myprefix="$ac_default_prefix" |
090089c4 | 24 | fi |
25 | ||
26 | INSTALL_TOPDIR="$myprefix"; | |
27 | INSTALL_LIBDIR="$myprefix/lib"; | |
28 | INSTALL_BINDIR="$myprefix/bin"; | |
29 | INSTALL_MANDIR="$myprefix/man"; | |
30 | ||
a26bdc75 | 31 | eval "sysconfdirval=$sysconfdir" |
32 | eval "bindirval=$bindir" | |
33 | ||
090089c4 | 34 | THIS_HOST="`hostname`" |
35 | XTRA_CFLAGS='' | |
090089c4 | 36 | CRYPT_LIB='' |
37 | ||
a26bdc75 | 38 | if test -z "$CACHE_HTTP_PORT"; then |
39 | CACHE_HTTP_PORT="3128" | |
40 | fi | |
41 | if test -z "$CACHE_ICP_PORT"; then | |
42 | CACHE_ICP_PORT="3130" | |
43 | fi | |
44 | if test -z "$CACHE_FTP_PORT"; then | |
45 | CACHE_FTP_PORT="3132" | |
46 | fi | |
47 | ||
090089c4 | 48 | dnl Subsitutions |
49 | AC_SUBST(INSTALL_TOPDIR) | |
50 | AC_SUBST(INSTALL_LIBDIR) | |
51 | AC_SUBST(INSTALL_BINDIR) | |
52 | AC_SUBST(INSTALL_MANDIR) | |
53 | AC_SUBST(DEFS) | |
54 | AC_SUBST(XTRA_CFLAGS) | |
55 | AC_SUBST(THIS_HOST) | |
a26bdc75 | 56 | AC_SUBST(CACHE_HTTP_PORT) |
57 | AC_SUBST(CACHE_ICP_PORT) | |
58 | AC_SUBST(CACHE_FTP_PORT) | |
59 | AC_SUBST(sysconfdirval) | |
60 | AC_SUBST(bindirval) | |
090089c4 | 61 | |
62 | dnl Check for GNU cc | |
63 | AC_PROG_CC | |
64 | ||
65 | dnl Warn if not using GNU cc | |
66 | XXXCC=`echo $CC | awk '{print $1}'` | |
a0846d9c | 67 | if test "`basename $XXXCC`" != "gcc"; then |
090089c4 | 68 | echo '**************************************************************'; |
69 | echo '**************************************************************'; | |
70 | echo '**'; | |
2877b8a9 | 71 | echo '** WARNING: Squid is only guaranteed to compile with GNU cc.'; |
090089c4 | 72 | echo "** Currently, you're using $CC"; |
73 | echo '** '; | |
090089c4 | 74 | echo '**************************************************************'; |
75 | echo '**************************************************************'; | |
76 | sleep 5 | |
77 | fi | |
78 | ||
79 | dnl Check for programs | |
80 | AC_PROG_CPP | |
81 | AC_PROG_INSTALL | |
82 | AC_PROG_RANLIB | |
83 | AC_PROG_LN_S | |
84 | AC_PATH_PROG(RM, rm, /bin/false) | |
85 | AC_PATH_PROG(MV, mv, /bin/false) | |
86 | AC_PATH_PROG(MKDIR, mkdir, /bin/false) | |
87 | AC_PATH_PROG(LN, ln, cp) | |
2877b8a9 | 88 | AC_PATH_PROG(CMD_PERL, perl, /usr/local/bin/perl) |
090089c4 | 89 | |
90 | dnl Set PERL too | |
91 | PERL="$CMD_PERL" | |
92 | AC_SUBST(PERL) | |
93 | ||
94 | dnl Check for headers | |
95 | AC_HEADER_DIRENT | |
96 | AC_HEADER_STDC | |
db40ae20 | 97 | |
98 | AC_CHECK_HEADERS( \ | |
99 | alloca.h \ | |
100 | arpa/inet.h \ | |
101 | bstring.h \ | |
102 | config.h \ | |
103 | crypt.h \ | |
104 | fcntl.h \ | |
105 | memory.h \ | |
106 | netinet/in.h \ | |
107 | stdlib.h \ | |
108 | string.h \ | |
109 | strings.h \ | |
110 | sys/file.h \ | |
111 | sys/select.h\ | |
112 | sys/time.h \ | |
113 | sys/types.h \ | |
114 | unistd.h \ | |
115 | regex.h \ | |
116 | syslog.h \ | |
117 | ) | |
118 | ||
090089c4 | 119 | AC_EGREP_HEADER(mxfast, malloc.h, [XTRA_CFLAGS="$XTRA_CFLAGS -DLNG_MALLINFO"], [XTRA_CFLAGS="$XTRA_CFLAGS"]) |
120 | ||
121 | dnl Check for typedefs | |
122 | AC_CHECK_SIZEOF(int) | |
123 | AC_CHECK_SIZEOF(long) | |
124 | ||
256cf05b | 125 | dnl Check for special functions |
126 | AC_FUNC_ALLOCA | |
090089c4 | 127 | |
090089c4 | 128 | dnl Check for needed libraries |
6716b242 | 129 | AC_CHECK_LIB(socket, main) |
130 | AC_CHECK_LIB(malloc, main, [HAVE_LIBMALLOC="yes"; LIBS="$LIBS -lmalloc"]) | |
131 | AC_CHECK_LIB(nsl, main) | |
132 | AC_CHECK_LIB(resolv, main) | |
133 | AC_CHECK_LIB(bsd, main) | |
090089c4 | 134 | |
135 | dnl We found a version of libresolv on SunOS 4.x which requires -l44bsd | |
136 | dnl We have to first check to see if -l44bsd is present and has the | |
137 | dnl function inet_aton | |
77f675ad | 138 | AC_CHECK_LIB(44bsd, inet_aton, [HAVE_LIB44BSD="yes"]) |
6716b242 | 139 | AC_CHECK_LIB(resolv, inet_aton, [if test "$HAVE_LIB44BSD" = "yes"; then LIBS="$LIBS -l44bsd"; fi]) |
090089c4 | 140 | |
141 | dnl Check for libcrypt | |
142 | dnl cached uses crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) | |
143 | AC_CHECK_LIB(crypt, crypt, [CRYPT_LIB="-lcrypt"]) | |
77f675ad | 144 | AC_SUBST(CRYPT_LIB) |
145 | ||
146 | dnl System-specific library modifications | |
147 | dnl | |
148 | case "$host" in | |
149 | *-sun-solaris*) | |
150 | echo "Removing -lmalloc for Solaris..." | |
6716b242 | 151 | LIBS=`echo $LIBS | sed -e s/-lmalloc//` |
77f675ad | 152 | HAVE_LIBMALLOC="no" |
153 | ;; | |
154 | *-sgi-irix*) | |
155 | echo "Removing -lsocket for IRIX..." | |
6716b242 | 156 | LIBS=`echo $LIBS | sed -e s/-lsocket//` |
77f675ad | 157 | echo "Removing -lnsl for IRIX..." |
6716b242 | 158 | LIBS=`echo $LIBS | sed -e s/-lnsl//` |
77f675ad | 159 | ;; |
160 | esac | |
090089c4 | 161 | |
6716b242 | 162 | dnl Check for library functions |
163 | AC_CHECK_FUNCS(\ | |
164 | getdtablesize \ | |
165 | mallinfo \ | |
166 | mallopt \ | |
167 | regcomp \ | |
168 | regexec \ | |
169 | regfree \ | |
170 | setrlimit \ | |
171 | strdup \ | |
172 | strerror \ | |
173 | sysconf \ | |
174 | syslog \ | |
175 | timegm\ | |
176 | ) | |
177 | ||
090089c4 | 178 | dnl Need the debugging version of malloc if available |
179 | XTRA_OBJS='' | |
77f675ad | 180 | if test "$HAVE_LIBMALLOC" = "yes" ; then |
090089c4 | 181 | if test -r /usr/lib/debug/malloc.o ; then |
182 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/malloc.o" | |
183 | fi | |
184 | if test -r /usr/lib/debug/mallocmap.o ; then | |
185 | XTRA_OBJS="$XTRA_OBJS /usr/lib/debug/mallocmap.o" | |
186 | fi | |
187 | fi | |
188 | AC_SUBST(XTRA_OBJS) | |
189 | ||
6716b242 | 190 | XTRA_LIBS="$LIBS" |
191 | LIBS='' | |
090089c4 | 192 | AC_SUBST(XTRA_LIBS) |
193 | ||
13b46529 | 194 | dnl Set STD_CFLAGS |
195 | if test -z "$STD_CFLAGS"; then | |
d7ce09df | 196 | STD_CFLAGS="-g" |
a0846d9c | 197 | XXXCC=`echo $CC | awk '{print $1}'` |
198 | if test "`basename $XXXCC`" = "gcc"; then | |
13b46529 | 199 | STD_CFLAGS="$STD_CFLAGS -Wall" |
a0846d9c | 200 | fi |
201 | fi | |
13b46529 | 202 | AC_SUBST(STD_CFLAGS) |
a0846d9c | 203 | |
13b46529 | 204 | dnl Set STD_LDFLAGS |
205 | if test -z "$STD_LDFLAGS"; then | |
d7ce09df | 206 | STD_LDFLAGS="-g" |
090089c4 | 207 | fi |
13b46529 | 208 | AC_SUBST(STD_LDFLAGS) |
090089c4 | 209 | |
77f675ad | 210 | dnl Last minute system specific modifications |
090089c4 | 211 | dnl |
77f675ad | 212 | case "$host" in |
213 | *-sgi-irix*) | |
214 | echo "Adding ANSI compile flags for IRIX..." | |
215 | XXXCC=`echo $CC | awk '{print $1}'` | |
216 | if test "`basename $XXXCC`" = "gcc"; then | |
217 | [XTRA_CFLAGS="$XTRA_CFLAGS -ansi"] | |
218 | else | |
219 | [XTRA_CFLAGS="$XTRA_CFLAGS -D__STRICT_ANSI__"] | |
220 | fi | |
221 | ;; | |
222 | *-hp-hpux*) | |
223 | echo "Disabling 'ranlib' for HP-UX..." | |
224 | RANLIB=":" | |
225 | ;; | |
226 | esac | |
090089c4 | 227 | |
228 | ||
229 | dnl Clean up after OSF/1 core dump bug | |
230 | rm -f core | |
231 | ||
232 | AC_OUTPUT(\ | |
0992a350 | 233 | ./makefile \ |
090089c4 | 234 | ./lib/Makefile \ |
a26bdc75 | 235 | ./include/config.h \ |
090089c4 | 236 | ./scripts/Makefile \ |
237 | ./scripts/RunCache \ | |
238 | ./scripts/RunAccel \ | |
a26bdc75 | 239 | ./src/Makefile \ |
240 | ./src/cached.conf \ | |
090089c4 | 241 | ) |