forked from ytoolshed/range
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
152 lines (134 loc) · 3.62 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([librange], [1.1], [[email protected]])
AC_CONFIG_SRCDIR([src/librange.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_CONFIG_HEADER([src/config.h])
AM_INIT_AUTOMAKE
AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Package name])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Package version])
# Checks for programs.
AC_PROG_YACC
AM_PROG_LEX
AC_PROG_CC
AC_LANG_C
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
# begin perl checking
perl_default="/usr/local/bin/perl"
AC_ARG_ENABLE(
perl,
AC_HELP_STRING([--enable-perl@<:@=PERL@:>@],
[Use this perl binary to build perl functionality. Requires libperl and working PCRE. (default = /usr/local/bin/perl)]),
if test "$enableval" = "yes"; then
PERL=$perl_default
else
PERL=$enableval
fi
)
AM_CONDITIONAL([WANT_PERL], [test ! -z "$PERL"])
AC_ARG_ENABLE(
[mod-range],
AC_HELP_STRING([--enable-mod-range],
[Build apache module (Default = enabled)]),
MOD_RANGE=$enableval,[])
AM_CONDITIONAL([WANT_MODRANGE], [test "$MOD_RANGE" = "yes"])
AC_DEFUN([AC_CHECK_PERL],[
AC_MSG_CHECKING(perl in $PERL)
if test [ -f "$PERL" ]
then
AC_SUBST(PERL)
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(perl includes)
PERL_CFLAGS=`${PERL} -MExtUtils::Embed -e ccopts`
AC_SUBST(PERL_CFLAGS)
AC_MSG_RESULT($PERL_CFLAGS)
AC_MSG_CHECKING(perl libraries)
PERL_LIBS=`${PERL} -MExtUtils::Embed -e ldopts`
AC_SUBST(PERL_LIBS)
AC_MSG_RESULT($PERL_LIBS)
else
AC_MSG_ERROR([${PERL} not found])
fi
])
AC_DEFUN([AC_CHECK_PCRE],[
AC_PATH_PROG(pcreconfig,pcre-config)
if test [ -z "$pcreconfig" ]
then
AC_MSG_ERROR([pcre-config executable not found])
else
AC_MSG_CHECKING(pcre includes)
PCRE_CFLAGS=`${pcreconfig} --cflags`
AC_MSG_RESULT($PCRE_CFLAGS)
AC_SUBST(PCRE_CFLAGS)
AC_MSG_CHECKING(pcre libraries)
PCRE_LIBS=`${pcreconfig} --libs`
AC_MSG_RESULT($PCRE_LIBS)
AC_SUBST(PCRE_LIBS)
fi
])
AC_DEFUN([AC_CHECK_APR],[
AC_PATH_PROG(aprconfig,apr-config)
if test [ -z "$aprconfig" ]
then
AC_PATH_PROG(aprconfig, apr-1-config)
fi
if test [ -z "$aprconfig" ]
then
AC_MSG_ERROR([apr-config/apr-1-config executable not found])
else
AC_MSG_CHECKING(apr includes)
APR_CFLAGS=`${aprconfig} --cflags --cppflags --includes`
AC_MSG_RESULT($APR_CFLAGS)
AC_SUBST(APR_CFLAGS)
AC_MSG_CHECKING(apr libraries)
APR_LIBS=`${aprconfig} --link-libtool --libs`
APR_LIBS_LD=`${aprconfig} --link-ld --libs`
AC_MSG_RESULT($APR_LIBS)
AC_SUBST(APR_LIBS)
AC_SUBST(APR_LIBS_LD)
fi
])
AC_DEFUN([AC_CHECK_APXS],[
AC_CHECK_PROGS(APXS,[apxs apxs2],[],[path=$PATH$PATH_SEPARATOR/usr/local/apache$PATH_SEPARATOR/usr/apache])
if [ test -z "$APXS" ]; then
AC_MSG_ERROR("apxs not found")
else
APACHE_INCDIR=`$APXS -q INCLUDEDIR`
AC_SUBST(APACHE_INCDIR)
fi
])
# always need APR
AC_CHECK_APR
# optionally check for perl
if test ! -z "$PERL"; then
AC_CHECK_PERL
AC_CHECK_PCRE
fi
# optionally check for apxs
if test "$MOD_RANGE" = "yes"; then
AC_CHECK_APXS
fi
AC_CHECK_LIB([m], [sin], [], [exit 1])
AC_CHECK_LIB([pthread], [pthread_create], [], [exit 1])
AC_CHECK_LIB([z], [zlibVersion], [], [exit 1])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([strerror])
AC_CONFIG_FILES([Makefile
doc/Makefile
m4/Makefile
src/Makefile
mod_range/Makefile
plugins/Makefile])
AC_OUTPUT