1 dnl This encapsulates the nasty mess of headers we need to check when
3 AC_DEFUN([SQUID_DEFAULT_INCLUDES],[[
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
7 * IMPORTANT: Keep include/squid_types.h syncronised with this list
10 #include <sys/types.h>
19 #if HAVE_SYS_BITYPES_H
20 #include <sys/bitypes.h>
23 #include <sys/select.h>
25 #if HAVE_NETINET_IN_SYSTM_H
26 #include <netinet/in_systm.h>
30 dnl and this is for AC_CHECK_SIZEOF
31 AC_DEFUN([SQUID_DEFAULT_SIZEOF_INCLUDES],[
33 SQUID_DEFAULT_INCLUDES
37 AC_DEFUN([SQUID_BSDNET_INCLUDES],[
38 SQUID_DEFAULT_INCLUDES
43 #include <sys/socket.h>
46 #include <netinet/in.h>
49 #include <netinet/ip.h>
51 #if HAVE_NETINET_IP_COMPAT_H
52 #include <netinet/ip_compat.h>
57 #if HAVE_NETINET_IP_FIL_H
58 #include <netinet/ip_fil.h>
61 #include <sys/param.h>
66 dnl thanks to autogen, for the template..
68 dnl @synopsis AC_TEST_CHECKFORHUGEOBJECTS
70 dnl Test whether -fhuge-objects is available with this c++ compiler. gcc-29.5 series compilers need this on some platform with large objects.
73 AC_DEFUN([AC_TEST_CHECKFORHUGEOBJECTS],[
74 if test "$GCC" = "yes"; then
75 AC_MSG_CHECKING([whether compiler accepts -fhuge-objects])
76 AC_CACHE_VAL([ac_cv_test_checkforhugeobjects],[
77 ac_cv_test_checkforhugeobjects=`echo "int main(int argc, char **argv) { int foo; }" > conftest.cc
78 ${CXX} -Werror -fhuge-objects -o conftest.bin conftest.cc 2>/dev/null
84 then ac_cv_test_checkforhugeobjects=no
85 else if [[ -z "$ac_cv_test_checkforhugeobjects" ]]
86 then ac_cv_test_checkforhugeobjects=yes
89 AC_MSG_RESULT([${ac_cv_test_checkforhugeobjects}])
91 if test "X${ac_cv_test_checkforhugeobjects}" != Xno
93 HUGE_OBJECT_FLAG="-fhuge-objects"
96 ]) # end of AC_DEFUN of AC_TEST_CHECKFORHUGEOBJECTS
99 dnl ===========================================================================
100 dnl http://autoconf-archive.cryp.to/ax_with_prog.html
101 dnl ===========================================================================
105 dnl AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
109 dnl Locates an installed program binary, placing the result in the precious
110 dnl variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
111 dnl failing that searches for program in the given path (which defaults to
112 dnl the system path). If program is found, VARIABLE is set to the full path
113 dnl of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
114 dnl if provided, unchanged otherwise.
116 dnl A typical example could be the following one:
118 dnl AX_WITH_PROG(PERL,perl)
120 dnl NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
121 dnl Dustin J. Mitchell <dustin@cs.uchicago.edu>.
123 dnl LAST MODIFICATION
129 dnl Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
130 dnl Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
132 dnl Copying and distribution of this file, with or without modification, are
133 dnl permitted in any medium without royalty provided the copyright notice
134 dnl and this notice are preserved.
136 AC_DEFUN([AX_WITH_PROG],[
139 pushdef([VARIABLE],$1)
140 pushdef([EXECUTABLE],$2)
141 pushdef([VALUE_IF_NOT_FOUND],$3)
142 pushdef([PATH_PROG],$4)
144 AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
146 AS_IF(test -z "$VARIABLE",[
147 AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
148 AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[[PATH]]]]],absolute path to EXECUTABLE executable), [
149 AS_IF([test "$withval" != "yes"],[
151 AC_MSG_RESULT($VARIABLE)
160 AS_IF(test -z "$VARIABLE",[
161 AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
166 popdef([VALUE_IF_NOT_FOUND])