]> git.ipfire.org Git - thirdparty/squid.git/blob - acinclude/init.m4
Shuffled acinclude.m4 into acinclude/init.m4
[thirdparty/squid.git] / acinclude / init.m4
1 dnl This encapsulates the nasty mess of headers we need to check when
2 dnl checking types.
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
6 * find them..
7 * IMPORTANT: Keep compat/types.h syncronised with this list
8 */
9 #if HAVE_SYS_TYPES_H
10 #include <sys/types.h>
11 #endif
12 #if HAVE_LINUX_TYPES_H
13 #include <linux/types.h>
14 #endif
15 #if HAVE_STDLIB_H
16 #include <stdlib.h>
17 #endif
18 #if HAVE_STDDEF_H
19 #include <stddef.h>
20 #endif
21 #if HAVE_INTTYPES_H
22 #include <inttypes.h>
23 #endif
24 #if HAVE_SYS_BITYPES_H
25 #include <sys/bitypes.h>
26 #endif
27 #if HAVE_SYS_SELECT_H
28 #include <sys/select.h>
29 #endif
30 #if HAVE_NETINET_IN_SYSTM_H
31 #include <netinet/in_systm.h>
32 #endif
33 ]])
34
35 dnl *BSD net headers
36 AC_DEFUN([SQUID_BSDNET_INCLUDES],[
37 SQUID_DEFAULT_INCLUDES
38 #if HAVE_SYS_TIME_H
39 #include <sys/time.h>
40 #endif
41 #if HAVE_SYS_SOCKET_H
42 #include <sys/socket.h>
43 #endif
44 #if HAVE_NETINET_IN_H
45 #include <netinet/in.h>
46 #endif
47 #if HAVE_NETINET_IP_H
48 #include <netinet/ip.h>
49 #endif
50 #if HAVE_NETINET_IP_COMPAT_H
51 #include <netinet/ip_compat.h>
52 #endif
53 #if HAVE_NET_IF_H
54 #include <net/if.h>
55 #endif
56 #if HAVE_NETINET_IP_FIL_H
57 #include <netinet/ip_fil.h>
58 #endif
59 #if HAVE_SYS_PARAM_H
60 #include <sys/param.h>
61 #endif
62 ])
63
64 dnl ===========================================================================
65 dnl http://autoconf-archive.cryp.to/ax_with_prog.html
66 dnl ===========================================================================
67 dnl
68 dnl SYNOPSIS
69 dnl
70 dnl AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
71 dnl
72 dnl DESCRIPTION
73 dnl
74 dnl Locates an installed program binary, placing the result in the precious
75 dnl variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
76 dnl failing that searches for program in the given path (which defaults to
77 dnl the system path). If program is found, VARIABLE is set to the full path
78 dnl of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
79 dnl if provided, unchanged otherwise.
80 dnl
81 dnl A typical example could be the following one:
82 dnl
83 dnl AX_WITH_PROG(PERL,perl)
84 dnl
85 dnl NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
86 dnl Dustin J. Mitchell <dustin@cs.uchicago.edu>.
87 dnl
88 dnl LAST MODIFICATION
89 dnl
90 dnl 2008-05-05
91 dnl
92 dnl COPYLEFT
93 dnl
94 dnl Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
95 dnl Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
96 dnl
97 dnl Copying and distribution of this file, with or without modification, are
98 dnl permitted in any medium without royalty provided the copyright notice
99 dnl and this notice are preserved.
100 dnl
101 AC_DEFUN([AX_WITH_PROG],[
102 AC_PREREQ([2.61])
103
104 pushdef([VARIABLE],$1)
105 pushdef([EXECUTABLE],$2)
106 pushdef([VALUE_IF_NOT_FOUND],$3)
107 pushdef([PATH_PROG],$4)
108
109 AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
110
111 AS_IF(test -z "$VARIABLE",[
112 AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
113 AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[[PATH]]]]],absolute path to EXECUTABLE executable), [
114 AS_IF([test "$withval" != "yes"],[
115 VARIABLE="$withval"
116 AC_MSG_RESULT($VARIABLE)
117 ],[
118 VARIABLE=""
119 AC_MSG_RESULT([no])
120 ])
121 ],[
122 AC_MSG_RESULT([no])
123 ])
124
125 AS_IF(test -z "$VARIABLE",[
126 AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
127 ])
128 ])
129
130 popdef([PATH_PROG])
131 popdef([VALUE_IF_NOT_FOUND])
132 popdef([EXECUTABLE])
133 popdef([VARIABLE])
134 ])