diff options
Diffstat (limited to 'm4/apache.m4')
-rw-r--r-- | m4/apache.m4 | 186 |
1 files changed, 0 insertions, 186 deletions
diff --git a/m4/apache.m4 b/m4/apache.m4 deleted file mode 100644 index ef9ce90..0000000 --- a/m4/apache.m4 +++ /dev/null | |||
@@ -1,186 +0,0 @@ | |||
1 | dnl TEST_APACHE_VERSION(RELEASE, [MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | ||
2 | dnl Test for Apache | ||
3 | dnl | ||
4 | AC_DEFUN(TEST_APACHE_VERSION, | ||
5 | [dnl | ||
6 | AC_REQUIRE([AC_CANONICAL_TARGET]) | ||
7 | releasetest=$1 | ||
8 | min_apache_version="$2" | ||
9 | no_apache="" | ||
10 | ac_save_CFLAGS="$CFLAGS" | ||
11 | CFLAGS="$CFLAGS $APACHE_CFLAGS" | ||
12 | if test $releasetest -eq 20; then | ||
13 | CFLAGS="$CFLAGS -I$APU_INCDIR -I$APR_INCDIR" | ||
14 | fi | ||
15 | |||
16 | AC_TRY_RUN([ | ||
17 | #include <stdio.h> | ||
18 | #include <stdlib.h> | ||
19 | #include <string.h> | ||
20 | #include "httpd.h" | ||
21 | |||
22 | #ifndef AP_SERVER_BASEREVISION | ||
23 | #define AP_SERVER_BASEREVISION SERVER_BASEREVISION | ||
24 | #endif | ||
25 | |||
26 | char* my_strdup (char *str) | ||
27 | { | ||
28 | char *new_str; | ||
29 | |||
30 | if (str) { | ||
31 | new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); | ||
32 | strcpy (new_str, str); | ||
33 | } else | ||
34 | new_str = NULL; | ||
35 | |||
36 | return new_str; | ||
37 | } | ||
38 | |||
39 | int main (int argc, char *argv[]) | ||
40 | { | ||
41 | int major1, minor1, micro1; | ||
42 | int major2, minor2, micro2; | ||
43 | char *tmp_version; | ||
44 | |||
45 | { FILE *fp = fopen("conf.apachetest", "a"); if ( fp ) fclose(fp); } | ||
46 | |||
47 | tmp_version = my_strdup("$min_apache_version"); | ||
48 | if (sscanf(tmp_version, "%d.%d.%d", &major1, &minor1, µ1) != 3) { | ||
49 | printf("%s, bad version string\n", "$min_apache_version"); | ||
50 | exit(1); | ||
51 | } | ||
52 | tmp_version = my_strdup(AP_SERVER_BASEREVISION); | ||
53 | if (sscanf(tmp_version, "%d.%d.%d", &major2, &minor2, µ2) != 3) { | ||
54 | printf("%s, bad version string\n", AP_SERVER_BASEREVISION); | ||
55 | exit(1); | ||
56 | } | ||
57 | if ((major2 > major1) || | ||
58 | ((major2 == major1) && (minor2 > minor1)) || | ||
59 | ((major2 == major1) && (minor2 == minor1) && (micro2 >= micro1))) | ||
60 | { | ||
61 | exit(0); | ||
62 | } else { | ||
63 | /*printf("\n*** This module requires apache version %d.%d.%d or greater\n", | ||
64 | major1, minor1, micro1); | ||
65 | printf("*** I found version %d.%d.%d. Please verify the installation directory\n", | ||
66 | major2, minor2, micro2); | ||
67 | printf("*** of apache with the --with-apxs configure option.\n");*/ | ||
68 | exit(1); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | ],, no_apache=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
73 | CFLAGS="$ac_save_CFLAGS" | ||
74 | |||
75 | if test "x$no_apache" = x ; then | ||
76 | ifelse([$3], , :, [$3]) | ||
77 | else | ||
78 | if test -f conf.apachetest ; then | ||
79 | : | ||
80 | else | ||
81 | echo "*** Could not run Apache test program, checking why..." | ||
82 | CFLAGS="$CFLAGS APACHE_CFLAGS" | ||
83 | AC_TRY_LINK([ | ||
84 | #include <stdio.h> | ||
85 | #include "httpd.h" | ||
86 | |||
87 | int main(int argc, char *argv[]) | ||
88 | { return 0; } | ||
89 | #undef main | ||
90 | #define main K_and_R_C_main | ||
91 | ], [ return 0; ], | ||
92 | [ echo "*** The test program compiled, but failed to run. Check config.log" ], | ||
93 | [ echo "*** The test program failed to compile or link. Check config.log" ]) | ||
94 | CFLAGS="$ac_save_CFLAGS" | ||
95 | fi | ||
96 | ifelse([$4], , :, [$4]) | ||
97 | fi | ||
98 | rm -f conf.apachetest | ||
99 | ]) | ||
100 | |||
101 | dnl CHECK_PATH_APACHE([MINIMUM13-VERSION [, MINIMUM20-VERSION [, | ||
102 | dnl ACTION-IF-FOUND13 [, ACTION-IF-FOUND20 [, ACTION-IF-NOT-FOUND]]]) | ||
103 | dnl Test for Apache apxs | ||
104 | dnl | ||
105 | AC_DEFUN(CHECK_PATH_APACHE, | ||
106 | [dnl | ||
107 | AC_ARG_WITH( | ||
108 | apxs, | ||
109 | [AC_HELP_STRING([--with-apxs=PATH],[Location to APXS binary (default: /usr)])], | ||
110 | apxs_prefix="$withval", | ||
111 | apxs_prefix="/usr" | ||
112 | ) | ||
113 | AC_ARG_ENABLE( | ||
114 | apachetest, | ||
115 | [AC_HELP_STRING([--disable-apachetest],[Do not try to compile and run apache version test program])], | ||
116 | , | ||
117 | enable_apachetest=yes | ||
118 | ) | ||
119 | |||
120 | PATH="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin:$PATH" | ||
121 | if test -x $apxs_prefix -a ! -d $apxs_prefix; then | ||
122 | APXS_BIN=$apxs_prefix | ||
123 | else | ||
124 | AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH]) | ||
125 | fi | ||
126 | min_apache13_version=ifelse([$1], ,no,$1) | ||
127 | min_apache20_version=ifelse([$2], ,no,$2) | ||
128 | no_apxs="" | ||
129 | if test "$APXS_BIN" = "no"; then | ||
130 | AC_MSG_ERROR([*** The apxs binary installed by apache could not be found!]) | ||
131 | AC_MSG_ERROR([*** If apache is installed in PREFIX, make sure PREFIX/bin is in]) | ||
132 | AC_MSG_ERROR([*** your path, or use the --with-apxs configure option]) | ||
133 | else | ||
134 | APACHE_INCDIR=`$APXS_BIN -q INCLUDEDIR` | ||
135 | APR_INCDIR=`$APXS_BIN -q APR_INCLUDEDIR` | ||
136 | APU_INCDIR=`$APXS_BIN -q APU_INCLUDEDIR` | ||
137 | APACHE_CPPFLAGS=`$APXS_BIN -q CPPFLAGS` | ||
138 | APACHE_CPPFLAGS="$APACHE_CPPFLAGS -I$APACHE_INCDIR" | ||
139 | APACHE_CFLAGS=`$APXS_BIN -q CFLAGS` | ||
140 | APACHE_CFLAGS="$APACHE_CFLAGS -I$APACHE_INCDIR" | ||
141 | APACHE_MODDIR=`$APXS_BIN -q LIBEXECDIR` | ||
142 | |||
143 | if test "x$enable_apachetest" = "xyes" ; then | ||
144 | if test "$min_apache20_version" != "no"; then | ||
145 | AC_MSG_CHECKING(for Apache 2.0 version >= $min_apache20_version) | ||
146 | TEST_APACHE_VERSION(20,$min_apache20_version, | ||
147 | AC_MSG_RESULT(yes) | ||
148 | AC_DEFINE(WITH_APACHE20,1,[Define to 1 if we are compiling with Apache 2.0.x]) | ||
149 | APACHE_VERSION="2.0" | ||
150 | APXS_EXTENSION=.la | ||
151 | APACHE_CFLAGS="$APACHE_CFLAGS -I$APU_INCDIR -I$APR_INCDIR" | ||
152 | APACHE_CPPFLAGS="$APACHE_CPPFLAGS -I$APU_INCDIR -I$APR_INCDIR" | ||
153 | APACHE_DEFS="-DWITH_APACHE20" | ||
154 | ifelse([$4], , , $4), | ||
155 | AC_MSG_RESULT(no) | ||
156 | if test "x$min_apache13_version" = "xno"; then | ||
157 | ifelse([$5], , , $5) | ||
158 | fi | ||
159 | ) | ||
160 | fi | ||
161 | if test "$min_apache13_version" != "no" -a "x$APACHE_VERSION" = "x"; then | ||
162 | AC_MSG_CHECKING(for Apache 1.3 version >= $min_apache13_version) | ||
163 | TEST_APACHE_VERSION(13,$min_apache13_version, | ||
164 | AC_MSG_RESULT(yes) | ||
165 | AC_DEFINE(WITH_APACHE13,1,[Define to 1 if we are compiling with Apache 1.3.x]) | ||
166 | APACHE_VERSION="1.3" | ||
167 | APXS_EXTENSION=.so | ||
168 | APACHE_CFLAGS="-g $APACHE_CFLAGS" | ||
169 | APACHE_DEFS="-DWITH_APACHE13" | ||
170 | ifelse([$3], , , $3), | ||
171 | AC_MSG_RESULT(no) | ||
172 | ifelse([$5], , , $5) | ||
173 | ) | ||
174 | fi | ||
175 | fi | ||
176 | AC_SUBST(APACHE_DEFS) | ||
177 | AC_SUBST(APACHE_CFLAGS) | ||
178 | AC_SUBST(APACHE_CPPFLAGS) | ||
179 | AC_SUBST(APACHE_INCDIR) | ||
180 | AC_SUBST(APR_INCDIR) | ||
181 | AC_SUBST(APU_INCDIR) | ||
182 | AC_SUBST(APACHE_MODDIR) | ||
183 | AC_SUBST(APACHE_VERSION) | ||
184 | AC_SUBST(APXS_EXTENSION) | ||
185 | fi | ||
186 | ]) | ||