]> git.ipfire.org Git - thirdparty/squid.git/blame - acinclude.m4
Author: Francesco Chemolli <kinkie@squid-cache.org>
[thirdparty/squid.git] / acinclude.m4
CommitLineData
6a9f6389 1dnl This encapsulates the nasty mess of headers we need to check when
2dnl checking types.
36975a27 3AC_DEFUN([SQUID_DEFAULT_INCLUDES],[[
0a4e8536 4/* What a mess.. many systems have added the (now standard) bit types
5 * in their own ways, so we need to scan a wide variety of headers to
6 * find them..
6a9f6389 7 * IMPORTANT: Keep include/squid_types.h syncronised with this list
0a4e8536 8 */
6a9f6389 9#if HAVE_SYS_TYPES_H
0a4e8536 10#include <sys/types.h>
6a9f6389 11#endif
62b34480 12#if STDC_HEADERS
13#include <stdlib.h>
14#include <stddef.h>
15#endif
16#if HAVE_INTTYPES_H
17#include <inttypes.h>
18#endif
0a4e8536 19#if HAVE_SYS_BITYPES_H
20#include <sys/bitypes.h>
21#endif
eea70fbb 22#if HAVE_SYS_SELECT_H
23#include <sys/select.h>
24#endif
dc8596bb
AJ
25#if HAVE_NETINET_IN_SYSTM_H
26#include <netinet/in_systm.h>
27#endif
6a9f6389 28]])
62b34480 29
6a9f6389 30dnl and this is for AC_CHECK_SIZEOF
36975a27 31AC_DEFUN([SQUID_DEFAULT_SIZEOF_INCLUDES],[
6a9f6389 32#include <stdio.h>
33SQUID_DEFAULT_INCLUDES
34])
5a3237b0 35
36dnl *BSD net headers
36975a27 37AC_DEFUN([SQUID_BSDNET_INCLUDES],[
5a3237b0 38SQUID_DEFAULT_INCLUDES
2874ca69 39#if HAVE_SYS_TIME_H
40#include <sys/time.h>
41#endif
5a3237b0 42#if HAVE_SYS_SOCKET_H
43#include <sys/socket.h>
44#endif
45#if HAVE_NETINET_IN_H
46#include <netinet/in.h>
47#endif
dc8596bb
AJ
48#if HAVE_NETINET_IP_H
49#include <netinet/ip.h>
50#endif
5a3237b0 51#if HAVE_NETINET_IP_COMPAT_H
52#include <netinet/ip_compat.h>
53#endif
5a3237b0 54#if HAVE_NET_IF_H
55#include <net/if.h>
56#endif
2874ca69 57#if HAVE_NETINET_IP_FIL_H
58#include <netinet/ip_fil.h>
59#endif
77e4c0c9 60#if HAVE_SYS_PARAM_H
61#include <sys/param.h>
62#endif
5a3237b0 63])
d7c59e37 64
65dnl
66dnl thanks to autogen, for the template..
67dnl
68dnl @synopsis AC_TEST_CHECKFORHUGEOBJECTS
69dnl
70dnl Test whether -fhuge-objects is available with this c++ compiler. gcc-29.5 series compilers need this on some platform with large objects.
71dnl
72AC_DEFUN([AC_TEST_CHECKFORHUGEOBJECTS],[
73 AC_MSG_CHECKING([whether compiler accepts -fhuge-objects])
74 AC_CACHE_VAL([ac_cv_test_checkforhugeobjects],[
75 ac_cv_test_checkforhugeobjects=`echo "int foo;" > conftest.cc
76${CXX} -Werror -fhuge-objects -c conftest.cc 2>/dev/null
77res=$?
78rm -f conftest.*
79echo yes
32a843d5 80exit $res`
d7c59e37 81 if [[ $? -ne 0 ]]
82 then ac_cv_test_checkforhugeobjects=no
83 else if [[ -z "$ac_cv_test_checkforhugeobjects" ]]
84 then ac_cv_test_checkforhugeobjects=yes
85 fi ; fi
86 ]) # end of CACHE_VAL
87 AC_MSG_RESULT([${ac_cv_test_checkforhugeobjects}])
88
89 if test "X${ac_cv_test_checkforhugeobjects}" != Xno
90 then
91 HUGE_OBJECT_FLAG="-fhuge-objects"
92 else
93 HUGE_OBJECT_FLAG=""
94 fi
95]) # end of AC_DEFUN of AC_TEST_CHECKFORHUGEOBJECTS
a1c31e3c
AJ
96
97
98dnl ===========================================================================
99dnl http://autoconf-archive.cryp.to/ax_with_prog.html
100dnl ===========================================================================
101dnl
102dnl SYNOPSIS
103dnl
104dnl AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
105dnl
106dnl DESCRIPTION
107dnl
108dnl Locates an installed program binary, placing the result in the precious
109dnl variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
110dnl failing that searches for program in the given path (which defaults to
111dnl the system path). If program is found, VARIABLE is set to the full path
112dnl of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
113dnl if provided, unchanged otherwise.
114dnl
115dnl A typical example could be the following one:
116dnl
117dnl AX_WITH_PROG(PERL,perl)
118dnl
119dnl NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
120dnl Dustin J. Mitchell <dustin@cs.uchicago.edu>.
121dnl
122dnl LAST MODIFICATION
123dnl
124dnl 2008-05-05
125dnl
126dnl COPYLEFT
127dnl
128dnl Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
129dnl Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
130dnl
131dnl Copying and distribution of this file, with or without modification, are
132dnl permitted in any medium without royalty provided the copyright notice
133dnl and this notice are preserved.
134dnl
135AC_DEFUN([AX_WITH_PROG],[
136 AC_PREREQ([2.61])
137
138 pushdef([VARIABLE],$1)
139 pushdef([EXECUTABLE],$2)
140 pushdef([VALUE_IF_NOT_FOUND],$3)
141 pushdef([PATH_PROG],$4)
142
143 AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
144
145 AS_IF(test -z "$VARIABLE",[
146 AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
147 AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[[PATH]]]]],absolute path to EXECUTABLE executable), [
148 AS_IF([test "$withval" != "yes"],[
149 VARIABLE="$withval"
150 AC_MSG_RESULT($VARIABLE)
151 ],[
152 VARIABLE=""
153 AC_MSG_RESULT([no])
154 ])
155 ],[
156 AC_MSG_RESULT([no])
157 ])
158
159 AS_IF(test -z "$VARIABLE",[
160 AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
161 ])
162 ])
163
164 popdef([PATH_PROG])
165 popdef([VALUE_IF_NOT_FOUND])
166 popdef([EXECUTABLE])
167 popdef([VARIABLE])
168])