]> git.ipfire.org Git - thirdparty/squid.git/blame - configure.in
update
[thirdparty/squid.git] / configure.in
CommitLineData
090089c4 1dnl
2877b8a9 2dnl Configuration input file for Squid
090089c4 3dnl
2877b8a9 4dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.7)
090089c4 5dnl
a26bdc75 6dnl $Id: configure.in,v 1.14 1996/04/08 23:25:18 wessels Exp $
090089c4 7dnl
8dnl
090089c4 9dnl
a26bdc75 10AC_INIT(src/main.c)
090089c4 11AC_CONFIG_HEADER(include/autoconf.h)
a26bdc75 12AC_REVISION($Revision: 1.14 $)dnl
2877b8a9 13AC_PREFIX_DEFAULT(/usr/local/squid)
da22ac20 14AC_CONFIG_AUX_DIR(aux)
090089c4 15
88d50a22 16AC_CANONICAL_HOST
17
090089c4 18dnl Build a copy of prefix
19
20if test -n "$prefix"; then
21 myprefix="$prefix";
22else
a26bdc75 23 myprefix="$ac_default_prefix"
090089c4 24fi
25
26INSTALL_TOPDIR="$myprefix";
27INSTALL_LIBDIR="$myprefix/lib";
28INSTALL_BINDIR="$myprefix/bin";
29INSTALL_MANDIR="$myprefix/man";
30
a26bdc75 31eval "sysconfdirval=$sysconfdir"
32eval "bindirval=$bindir"
33
090089c4 34THIS_HOST="`hostname`"
35XTRA_CFLAGS=''
090089c4 36CRYPT_LIB=''
37
a26bdc75 38if test -z "$CACHE_HTTP_PORT"; then
39 CACHE_HTTP_PORT="3128"
40fi
41if test -z "$CACHE_ICP_PORT"; then
42 CACHE_ICP_PORT="3130"
43fi
44if test -z "$CACHE_FTP_PORT"; then
45 CACHE_FTP_PORT="3132"
46fi
47
090089c4 48dnl Subsitutions
49AC_SUBST(INSTALL_TOPDIR)
50AC_SUBST(INSTALL_LIBDIR)
51AC_SUBST(INSTALL_BINDIR)
52AC_SUBST(INSTALL_MANDIR)
53AC_SUBST(DEFS)
54AC_SUBST(XTRA_CFLAGS)
55AC_SUBST(THIS_HOST)
a26bdc75 56AC_SUBST(CACHE_HTTP_PORT)
57AC_SUBST(CACHE_ICP_PORT)
58AC_SUBST(CACHE_FTP_PORT)
59AC_SUBST(sysconfdirval)
60AC_SUBST(bindirval)
090089c4 61
62dnl Check for GNU cc
63AC_PROG_CC
64
65dnl Warn if not using GNU cc
66XXXCC=`echo $CC | awk '{print $1}'`
a0846d9c 67if 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
77fi
78
79dnl Check for programs
80AC_PROG_CPP
81AC_PROG_INSTALL
82AC_PROG_RANLIB
83AC_PROG_LN_S
84AC_PATH_PROG(RM, rm, /bin/false)
85AC_PATH_PROG(MV, mv, /bin/false)
86AC_PATH_PROG(MKDIR, mkdir, /bin/false)
87AC_PATH_PROG(LN, ln, cp)
2877b8a9 88AC_PATH_PROG(CMD_PERL, perl, /usr/local/bin/perl)
090089c4 89
90dnl Set PERL too
91PERL="$CMD_PERL"
92AC_SUBST(PERL)
93
94dnl Check for headers
95AC_HEADER_DIRENT
96AC_HEADER_STDC
db40ae20 97
98AC_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 119AC_EGREP_HEADER(mxfast, malloc.h, [XTRA_CFLAGS="$XTRA_CFLAGS -DLNG_MALLINFO"], [XTRA_CFLAGS="$XTRA_CFLAGS"])
120
121dnl Check for typedefs
122AC_CHECK_SIZEOF(int)
123AC_CHECK_SIZEOF(long)
124
256cf05b 125dnl Check for special functions
126AC_FUNC_ALLOCA
090089c4 127
090089c4 128dnl Check for needed libraries
6716b242 129AC_CHECK_LIB(socket, main)
130AC_CHECK_LIB(malloc, main, [HAVE_LIBMALLOC="yes"; LIBS="$LIBS -lmalloc"])
131AC_CHECK_LIB(nsl, main)
132AC_CHECK_LIB(resolv, main)
133AC_CHECK_LIB(bsd, main)
090089c4 134
135dnl We found a version of libresolv on SunOS 4.x which requires -l44bsd
136dnl We have to first check to see if -l44bsd is present and has the
137dnl function inet_aton
77f675ad 138AC_CHECK_LIB(44bsd, inet_aton, [HAVE_LIB44BSD="yes"])
6716b242 139AC_CHECK_LIB(resolv, inet_aton, [if test "$HAVE_LIB44BSD" = "yes"; then LIBS="$LIBS -l44bsd"; fi])
090089c4 140
141dnl Check for libcrypt
142dnl cached uses crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
143AC_CHECK_LIB(crypt, crypt, [CRYPT_LIB="-lcrypt"])
77f675ad 144AC_SUBST(CRYPT_LIB)
145
146dnl System-specific library modifications
147dnl
148case "$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 ;;
160esac
090089c4 161
6716b242 162dnl Check for library functions
163AC_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 178dnl Need the debugging version of malloc if available
179XTRA_OBJS=''
77f675ad 180if 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
187fi
188AC_SUBST(XTRA_OBJS)
189
6716b242 190XTRA_LIBS="$LIBS"
191LIBS=''
090089c4 192AC_SUBST(XTRA_LIBS)
193
13b46529 194dnl Set STD_CFLAGS
195if 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
201fi
13b46529 202AC_SUBST(STD_CFLAGS)
a0846d9c 203
13b46529 204dnl Set STD_LDFLAGS
205if test -z "$STD_LDFLAGS"; then
d7ce09df 206 STD_LDFLAGS="-g"
090089c4 207fi
13b46529 208AC_SUBST(STD_LDFLAGS)
090089c4 209
77f675ad 210dnl Last minute system specific modifications
090089c4 211dnl
77f675ad 212case "$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 ;;
226esac
090089c4 227
228
229dnl Clean up after OSF/1 core dump bug
230rm -f core
231
232AC_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)