summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2008-02-20 19:53:44 (GMT)
committer Nokis Mavrogiannopoulos <nmav@gnutls.org>2008-02-20 19:53:44 (GMT)
commitabce2980c929dbb6ccb9d45c7cd88df3106c6ee4 (patch)
treeb71cda083d1ed8ceb2db2fb815eadf042295c348
parent572096be0da2690e3e32ad8fd19ae5758c870874 (diff)
added new m4 directory
-rw-r--r--m4/apache.m4151
-rw-r--r--m4/apache_test.m496
-rw-r--r--m4/apr_memcache.m456
-rw-r--r--m4/apreq.m443
-rwxr-xr-xm4/buildconf.py83
-rw-r--r--m4/find_apr.m4166
-rw-r--r--m4/libgnutls.m4 (renamed from libgnutls.m4)4
-rw-r--r--m4/libmemcache.m446
-rw-r--r--m4/librsvg.m429
-rw-r--r--m4/lua.m471
-rw-r--r--m4/mod_ftpd_providers.m496
-rw-r--r--m4/outoforder.m436
12 files changed, 875 insertions, 2 deletions
diff --git a/m4/apache.m4 b/m4/apache.m4
new file mode 100644
index 0000000..6051821
--- /dev/null
+++ b/m4/apache.m4
@@ -0,0 +1,151 @@
1
2dnl CHECK_APACHE([MINIMUM13-VERSION [, MINIMUM20-VERSION [,
3dnl ACTION-IF-FOUND13 [, ACTION-IF-FOUND20 [, ACTION-IF-NOT-FOUND]]])
4dnl Test for Apache apxs, APR, and APU
5
6AC_DEFUN([CHECK_APACHE],
7[dnl
8AC_ARG_WITH(
9 apxs,
10 [AC_HELP_STRING([--with-apxs=PATH],[Path to apxs])],
11 apxs_prefix="$withval",
12 apxs_prefix="/usr"
13 )
14
15AC_ARG_ENABLE(
16 apachetest,
17 [AC_HELP_STRING([--disable-apxstest],[Do not try to compile and run apache version test program])],
18 ,
19 enable_apachetest=yes
20 )
21
22 if test -x $apxs_prefix -a ! -d $apxs_prefix; then
23 APXS_BIN=$apxs_prefix
24 else
25 test_paths="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin"
26 test_paths="${test_paths}:/usr/bin:/usr/sbin"
27 test_paths="${test_paths}:/usr/local/bin:/usr/local/sbin:/usr/local/apache2/bin"
28 AC_PATH_PROG(APXS_BIN, apxs, no, [$test_paths])
29 fi
30 min_apache13_version=ifelse([$1], ,no,$1)
31 min_apache20_version=ifelse([$2], ,no,$2)
32 no_apxs=""
33 if test "$APXS_BIN" = "no"; then
34 AC_MSG_ERROR([*** The apxs binary installed by apache could not be found!])
35 AC_MSG_ERROR([*** Use the --with-apxs option with the full path to apxs])
36 else
37 AP_INCLUDES="-I`$APXS_BIN -q INCLUDEDIR 2>/dev/null`"
38 AP_INCLUDEDIR="`$APXS_BIN -q INCLUDEDIR 2>/dev/null`"
39
40 AP_PREFIX="`$APXS_BIN -q prefix 2>/dev/null`"
41
42 AP_BINDIR="`$APXS_BIN -q bindir 2>/dev/null`"
43 AP_SBINDIR="`$APXS_BIN -q sbindir 2>/dev/null`"
44 AP_SYSCONFDIR="`$APXS_BIN -q sysconfdir 2>/dev/null`"
45
46 APXS_CFLAGS=""
47 for flag in CFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS NOTEST_CFLAGS; do
48 APXS_CFLAGS="$APXS_CFLAGS `$APXS_BIN -q $flag 2>/dev/null`"
49 done
50
51 AP_CPPFLAGS="$APXS_CPPFLAGS $AP_INCLUDES"
52 AP_CFLAGS="$APXS_CFLAGS $AP_INCLUDES"
53
54 AP_LIBEXECDIR=`$APXS_BIN -q LIBEXECDIR 2>/dev/null`
55
56 if test "x$enable_apachetest" = "xyes" ; then
57 if test "$min_apache20_version" != "no"; then
58 APR_CONFIG="`$APXS_BIN -q APR_BINDIR 2>/dev/null`/apr-1-config"
59 if test ! -x $APR_CONFIG; then
60 APR_CONFIG="`$APXS_BIN -q APR_BINDIR 2>/dev/null`/apr-config"
61 fi
62 APR_INCLUDES=`$APR_CONFIG --includes 2>/dev/null`
63 APR_LDFLAGS=`$APR_CONFIG --link-ld 2>/dev/null`
64 APR_LIBS=`$APR_CONFIG --libs 2>/dev/null`
65 APR_LIBTOOL=`$APR_CONFIG --link-libtool 2>/dev/null`
66 APR_CPPFLAGS=`$APR_CONFIG --cppflags 2>/dev/null`
67 APR_CFLAGS=`$APR_CONFIG --cflags 2>/dev/null`
68 APR_VERSION=`$APR_CONFIG --version 2>/dev/null`
69 APU_CONFIG="`$APXS_BIN -q APU_BINDIR 2>/dev/null`/apu-1-config"
70 if test ! -x $APU_CONFIG; then
71 APU_CONFIG="`$APXS_BIN -q APU_BINDIR 2>/dev/null`/apu-config"
72 fi
73 APU_INCLUDES=`$APU_CONFIG --includes 2>/dev/null`
74 APU_LDFLAGS=`$APU_CONFIG --link-ld 2>/dev/null`
75 APU_LIBS=`$APU_CONFIG --libs 2>/dev/null`
76 APU_LIBTOOL=`$APU_CONFIG --link-libtool 2>/dev/null`
77 APU_VERSION=`$APU_CONFIG --version 2>/dev/null`
78
79 AC_MSG_CHECKING(for Apache 2.0 version >= $min_apache20_version)
80 TEST_APACHE_VERSION(20,$min_apache20_version,
81 AC_MSG_RESULT(yes)
82 AC_DEFINE(WITH_APACHE20,1,[Define to 1 if we are compiling with Apache 2.0.x])
83 AP_VERSION="2.0"
84 APXS_EXTENSION=.la
85 if test -f `$APXS_BIN -q INCLUDEDIR`/mod_status.h; then
86 AC_DEFINE(HAVE_MOD_STATUS_H,1,[Define to 1 if mod_status.h and the mod_Status hook are available])
87 fi
88 AP_CFLAGS="$AP_CFLAGS $APU_INCLUDES $APR_INCLUDES"
89 AP_CPPFLAGS="$AP_CPPFLAGS $APU_INCLUDES $APR_INCLUDES"
90 AP_DEFS="-DWITH_APACHE20"
91 ifelse([$4], , , $4),
92 AC_MSG_RESULT(no)
93 if test "x$min_apache13_version" = "xno"; then
94 ifelse([$5], , , $5)
95 fi
96 )
97 fi
98 if test "$min_apache13_version" != "no" -a "x$AP_VERSION" = "x"; then
99 APR_INCLUDES=""
100 APR_VERSION=""
101 APR_LDFLAGS=""
102 APR_LIBS=""
103 APR_LIBTOOL=""
104 APR_CFLAGS=""
105 APR_CPPFLAGS=""
106 APU_INCLUDES=""
107 APU_VERSION=""
108 APU_LDFLAGS=""
109 APU_LIBS=""
110 APU_LIBTOOL=""
111 AC_MSG_CHECKING(for Apache 1.3 version >= $min_apache13_version)
112 TEST_APACHE_VERSION(13,$min_apache13_version,
113 AC_MSG_RESULT(yes)
114 AC_DEFINE(WITH_APACHE13,1,[Define to 1 if we are compiling with Apache 1.3.x])
115 AP_VERSION="1.3"
116 APXS_EXTENSION=.so
117 AP_CFLAGS="-g $AP_CFLAGS"
118 AP_DEFS="-DWITH_APACHE13"
119 ifelse([$3], , , $3),
120 AC_MSG_RESULT(no)
121 ifelse([$5], , , $5)
122 )
123 fi
124 fi
125 AC_CHECK_DECL([DEFAULT_EXP_LIBEXECDIR],,[AC_DEFINE_UNQUOTED([DEFAULT_EXP_LIBEXECDIR],["$AP_LIBEXECDIR"],[Default Module LibExec directory])])
126 AC_SUBST(AP_DEFS)
127 AC_SUBST(AP_PREFIX)
128 AC_SUBST(AP_CFLAGS)
129 AC_SUBST(AP_CPPFLAGS)
130 AC_SUBST(AP_INCLUDES)
131 AC_SUBST(AP_INCLUDEDIR)
132 AC_SUBST(AP_LIBEXECDIR)
133 AC_SUBST(AP_VERSION)
134 AC_SUBST(AP_SYSCONFDIR)
135 AC_SUBST(AP_BINDIR)
136 AC_SUBST(AP_SBINDIR)
137 AC_SUBST(APR_INCLUDES)
138 AC_SUBST(APR_LDFLAGS)
139 AC_SUBST(APR_LIBS)
140 AC_SUBST(APR_LIBTOOL)
141 AC_SUBST(APR_CPPFLAGS)
142 AC_SUBST(APR_CFLAGS)
143 AC_SUBST(APU_INCLUDES)
144 AC_SUBST(APU_LDFLAGS)
145 AC_SUBST(APU_LIBS)
146 AC_SUBST(APU_LIBTOOL)
147 AC_SUBST(APXS_EXTENSION)
148 AC_SUBST(APXS_BIN)
149 AC_SUBST(APXS_CFLAGS)
150 fi
151])
diff --git a/m4/apache_test.m4 b/m4/apache_test.m4
new file mode 100644
index 0000000..8c91adf
--- /dev/null
+++ b/m4/apache_test.m4
@@ -0,0 +1,96 @@
1dnl TEST_APACHE_VERSION(RELEASE, [MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2dnl Test for Apache
3dnl
4AC_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 $AP_CFLAGS"
12 if test $releasetest -eq 20; then
13 CFLAGS="$CFLAGS $APU_INCLUDES $APR_INCLUDES"
14 fi
15 AC_TRY_RUN([
16#include <stdio.h>
17#include <stdlib.h>
18#include <string.h>
19#include "httpd.h"
20
21#ifndef AP_SERVER_BASEREVISION
22 #define AP_SERVER_BASEREVISION SERVER_BASEREVISION
23#endif
24
25char* my_strdup (char *str)
26{
27 char *new_str;
28
29 if (str) {
30 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
31 strcpy (new_str, str);
32 } else
33 new_str = NULL;
34
35 return new_str;
36}
37
38int main (int argc, char *argv[])
39{
40 int major1, minor1, micro1;
41 int major2, minor2, micro2;
42 char *tmp_version;
43
44 { FILE *fp = fopen("conf.apachetest", "a"); if ( fp ) fclose(fp); }
45
46 tmp_version = my_strdup("$min_apache_version");
47 if (sscanf(tmp_version, "%d.%d.%d", &major1, &minor1, &micro1) != 3) {
48 printf("%s, bad version string\n", "$min_apache_version");
49 exit(1);
50 }
51 tmp_version = my_strdup(AP_SERVER_BASEREVISION);
52 if (sscanf(tmp_version, "%d.%d.%d", &major2, &minor2, &micro2) != 3) {
53 printf("%s, bad version string\n", AP_SERVER_BASEREVISION);
54 exit(1);
55 }
56
57 if ( (major2 == major1) &&
58 ( (minor2 > minor1) ||
59 ((minor2 == minor1) && (micro2 >= micro1)) ) ) {
60 exit(0);
61 } else {
62 exit(1);
63 }
64}
65
66],, no_apache=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
67 CFLAGS="$ac_save_CFLAGS"
68
69 if test "x$no_apache" = x ; then
70 ifelse([$3], , :, [$3])
71 else
72 if test -f conf.apachetest ; then
73 :
74 else
75 echo "*** Could not run Apache test program, checking why..."
76 CFLAGS="$CFLAGS $AP_CFLAGS"
77 if test $releasetest -eq 20; then
78 CFLAGS="$CFLAGS $APU_INCLUDES $APR_INCLUDES"
79 fi
80 AC_TRY_LINK([
81#include <stdio.h>
82#include "httpd.h"
83
84int main(int argc, char *argv[])
85{ return 0; }
86#undef main
87#define main K_and_R_C_main
88], [ return 0; ],
89 [ echo "*** The test program compiled, but failed to run. Check config.log" ],
90 [ echo "*** The test program failed to compile or link. Check config.log" ])
91 CFLAGS="$ac_save_CFLAGS"
92 fi
93 ifelse([$4], , :, [$4])
94 fi
95 rm -f conf.apachetest
96])
diff --git a/m4/apr_memcache.m4 b/m4/apr_memcache.m4
new file mode 100644
index 0000000..71ab2b6
--- /dev/null
+++ b/m4/apr_memcache.m4
@@ -0,0 +1,56 @@
1dnl Check for memcache client libraries
2dnl CHECK_APR_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3dnl Sets:
4dnl APR_MEMCACHE_LIBS
5AC_DEFUN([CHECK_APR_MEMCACHE],
6[dnl
7
8AC_ARG_WITH(
9 apr-memcache-prefix,
10 [AC_HELP_STRING([--with-apr-memcache-prefix=PATH],[Install prefix for apr_memcache])],
11 apr_memcache_prefix="$withval",
12 apr_memcache_prefix="/usr",
13 :)
14AC_ARG_WITH(
15 apr-memcache-libs,
16 [AC_HELP_STRING([--with-apr-memcache-libs=PATH],[Path to apr_memcache libs])],
17 apr_memcache_libs="$withval",
18 apr_memcache_libs="$apr_memcache_prefix/lib"
19 :)
20AC_ARG_WITH(
21 apr-memcache-includes,
22 [AC_HELP_STRING([--with-apr-memcache-includes=PATH],[Path to apr_memcache includes])],
23 apr_memcache_includes="$withval",
24 apr_memcache_includes="$apr_memcache_prefix/include/apr_memcache-0"
25 :)
26
27
28AC_LIBTOOL_SYS_DYNAMIC_LINKER
29
30dnl # Determine memcache lib directory
31save_CFLAGS=$CFLAGS
32save_LDFLAGS=$LDFLAGS
33CFLAGS="-I$apr_memcache_includes $APR_INCLUDES $CFLAGS"
34LDFLAGS="-L$apr_memcache_libs $LDFLAGS"
35AC_CHECK_LIB(
36 apr_memcache,
37 apr_memcache_create,
38 [
39 APR_MEMCACHE_LIBS="-R$apr_memcache_libs -L$apr_memcache_libs -lapr_memcache"
40 APR_MEMCACHE_CFLAGS="-I$apr_memcache_includes"
41 ]
42)
43CFLAGS=$save_CFLAGS
44LDFLAGS=$save_LDFLAGS
45
46AC_SUBST(APR_MEMCACHE_LIBS)
47AC_SUBST(APR_MEMCACHE_CFLAGS)
48
49if test -z "${APR_MEMCACHE_LIBS}"; then
50 AC_MSG_NOTICE([*** memcache library not found.])
51 ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2)
52else
53 AC_MSG_NOTICE([using '${APR_MEMCACHE_LIBS}' for memcache])
54 ifelse([$1], , , $1)
55fi
56])
diff --git a/m4/apreq.m4 b/m4/apreq.m4
new file mode 100644
index 0000000..b457e02
--- /dev/null
+++ b/m4/apreq.m4
@@ -0,0 +1,43 @@
1dnl Check for apreq2 libraries
2dnl CHECK_APREQ2(MINIMUM-VERSION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3AC_DEFUN([CHECK_APREQ2],
4[dnl
5
6AC_ARG_WITH(
7 apreq2,
8 [AC_HELP_STRING([--with-apreq2=PATH],[Path to your apreq2-config])],
9 ap_path="$withval",
10 ap_path="/usr"
11 )
12
13 if test -x $ap_path -a ! -d $ap_path; then
14 AP_BIN=$ap_path
15 else
16 test_paths="$ap_path:$ap_path/bin:$ap_path/sbin"
17
18 dnl Search the Apache Binary Directories too. Since we should set these in apache.m4
19 if test -d $AP_BINDIR; then
20 test_paths="${test_paths}:${AP_BINDIR}"
21 fi
22 if test -d $AP_SBINDIR; then
23 test_paths="${test_paths}:${AP_SBINDIR}"
24 fi
25
26 test_paths="${test_paths}:/usr/bin:/usr/sbin"
27 test_paths="${test_paths}:/usr/local/bin:/usr/local/sbin"
28 AC_PATH_PROG(AP_BIN, apreq2-config, no, [$test_paths])
29 fi
30
31 if test "$AP_BIN" = "no"; then
32 AC_MSG_ERROR([*** The apreq2-config binary installed by apreq2 could not be found!])
33 AC_MSG_ERROR([*** Use the --with-apreq2 option with the full path to apreq2-config])
34 ifelse([$3], , AC_MSG_ERROR([apreq2 >=$1 is not installed.]), $3)
35 else
36 dnl TODO: Do a apreq2-config Version check here...
37 APREQ_LIBS="`$AP_BIN --link-ld --ldflags --libs 2>/dev/null`"
38 APREQ_CFLAGS="`$AP_BIN --includes 2>/dev/null`"
39 AC_SUBST(APREQ_LIBS)
40 AC_SUBST(APREQ_CFLAGS)
41 ifelse([$2], , AC_MSG_RESULT([yes]), $2)
42 fi
43])
diff --git a/m4/buildconf.py b/m4/buildconf.py
new file mode 100755
index 0000000..9ba621f
--- /dev/null
+++ b/m4/buildconf.py
@@ -0,0 +1,83 @@
1#!/usr/bin/env python
2#
3# buildconf.py: Runs Autotools on a project.
4#
5# Copyright 2004 Edward Rudd and Paul Querna
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#
19
20import os
21import sys
22import popen2
23from optparse import OptionParser
24
25cmd = {}
26
27def run_cmd(command, args=""):
28 global cmd
29 rp = popen2.Popen4("%s %s" % (cmd[command], args))
30 sout = rp.fromchild.readlines()
31 for line in sout:
32 sys.stdout.write(line)
33 rv = rp.wait()
34 if rv != 0:
35 print "Error: '%s %s' returned %d" % (cmd[command], args, rv)
36 sys.exit(-1)
37
38def select_cmd(command, list, args = "--version"):
39 global cmd
40 cmd[command] = None
41 for x in list:
42 # rv = os.spawnlp(os.P_WAIT, x, args)
43 rp = popen2.Popen4("%s %s" % (x, args))
44 rv = rp.wait()
45 if rv == 0:
46 cmd[command] = x
47 break
48 if cmd[command] == None:
49 print "Errpr: Could not find suitable version for '%s', tried running: %s" % (command, list)
50 sys.exit(-1)
51
52parser = OptionParser()
53
54parser.add_option("--libtoolize", action="store_true", dest="libtoolize", default=False)
55parser.add_option("--aclocal", action="store_true", dest="aclocal", default=False)
56parser.add_option("--automake", action="store_true", dest="automake", default=False)
57parser.add_option("--autoconf", action="store_true", dest="autoconf", default=False)
58parser.add_option("--autoheader", action="store_true", dest="autoheader", default=False)
59
60(options, args) = parser.parse_args()
61
62if options.libtoolize:
63 select_cmd("libtoolize", ['libtoolize14','glibtoolize','libtoolize'])
64if options.aclocal:
65 select_cmd("aclocal", ['aclocal-1.9','aclocal-1.8','aclocal-1.7','aclocal-1.6','aclocal'])
66if options.autoheader:
67 select_cmd("autoheader", ['autoheader259','autoheader257','autoheader'])
68if options.automake:
69 select_cmd("automake", ['automake-1.9','automake-1.8','automake-1.7','automake-1.6','automake'])
70if options.autoconf:
71 select_cmd("autoconf", ['autoconf259','autoconf257','autoconf'])
72
73if options.libtoolize:
74 run_cmd("libtoolize", "--force --copy")
75if options.aclocal:
76 run_cmd("aclocal", "-I m4")
77if options.autoheader:
78 run_cmd("autoheader")
79if options.automake:
80 run_cmd("automake", "--add-missing --copy --foreign")
81if options.autoconf:
82 run_cmd("autoconf")
83
diff --git a/m4/find_apr.m4 b/m4/find_apr.m4
new file mode 100644
index 0000000..9228c76
--- /dev/null
+++ b/m4/find_apr.m4
@@ -0,0 +1,166 @@
1dnl -------------------------------------------------------- -*- autoconf -*-
2dnl Copyright 2000-2005 The Apache Software Foundation
3dnl
4dnl Licensed under the Apache License, Version 2.0 (the "License");
5dnl you may not use this file except in compliance with the License.
6dnl You may obtain a copy of the License at
7dnl
8dnl http://www.apache.org/licenses/LICENSE-2.0
9dnl
10dnl Unless required by applicable law or agreed to in writing, software
11dnl distributed under the License is distributed on an "AS IS" BASIS,
12dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13dnl See the License for the specific language governing permissions and
14dnl limitations under the License.
15
16dnl
17dnl find_apr.m4 : locate the APR include files and libraries
18dnl
19dnl This macro file can be used by applications to find and use the APR
20dnl library. It provides a standardized mechanism for using APR. It supports
21dnl embedding APR into the application source, or locating an installed
22dnl copy of APR.
23dnl
24dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors)
25dnl
26dnl where srcdir is the location of the bundled APR source directory, or
27dnl empty if source is not bundled.
28dnl
29dnl where builddir is the location where the bundled APR will will be built,
30dnl or empty if the build will occur in the srcdir.
31dnl
32dnl where implicit-install-check set to 1 indicates if there is no
33dnl --with-apr option specified, we will look for installed copies.
34dnl
35dnl where acceptable-majors is a space separated list of acceptable major
36dnl version numbers. Often only a single major version will be acceptable.
37dnl If multiple versions are specified, and --with-apr=PREFIX or the
38dnl implicit installed search are used, then the first (leftmost) version
39dnl in the list that is found will be used. Currently defaults to [0 1].
40dnl
41dnl Sets the following variables on exit:
42dnl
43dnl apr_found : "yes", "no", "reconfig"
44dnl
45dnl apr_config : If the apr-config tool exists, this refers to it. If
46dnl apr_found is "reconfig", then the bundled directory
47dnl should be reconfigured *before* using apr_config.
48dnl
49dnl Note: this macro file assumes that apr-config has been installed; it
50dnl is normally considered a required part of an APR installation.
51dnl
52dnl If a bundled source directory is available and needs to be (re)configured,
53dnl then apr_found is set to "reconfig". The caller should reconfigure the
54dnl (passed-in) source directory, placing the result in the build directory,
55dnl as appropriate.
56dnl
57dnl If apr_found is "yes" or "reconfig", then the caller should use the
58dnl value of apr_config to fetch any necessary build/link information.
59dnl
60
61AC_DEFUN([APR_FIND_APR], [
62 apr_found="no"
63
64 if test "$ac_cv_emxos2" = "yes"; then
65 # Scripts don't pass test -x on OS/2
66 TEST_X="test -f"
67 else
68 TEST_X="test -x"
69 fi
70
71 ifelse([$4], [], [
72 ifdef(AC_WARNING,AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x]))
73 acceptable_majors="0 1"],
74 [acceptable_majors="$4"])
75
76 apr_temp_acceptable_apr_config=""
77 for apr_temp_major in $acceptable_majors
78 do
79 case $apr_temp_major in
80 0)
81 apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config"
82 ;;
83 *)
84 apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config"
85 ;;
86 esac
87 done
88
89 AC_MSG_CHECKING(for APR)
90 AC_ARG_WITH(apr,
91 [ --with-apr=PATH prefix for installed APR, path to APR build tree,
92 or the full path to apr-config],
93 [
94 if test "$withval" = "no" || test "$withval" = "yes"; then
95 AC_MSG_ERROR([--with-apr requires a directory or file to be provided])
96 fi
97
98 for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
99 do
100 for lookdir in "$withval/bin" "$withval"
101 do
102 if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
103 apr_found="yes"
104 apr_config="$lookdir/$apr_temp_apr_config_file"
105 break 2
106 fi
107 done
108 done
109
110 if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
111 apr_found="yes"
112 apr_config="$withval"
113 fi
114
115 dnl if --with-apr is used, it is a fatal error for its argument
116 dnl to be invalid
117 if test "$apr_found" != "yes"; then
118 AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.])
119 fi
120 ],[
121 dnl If we allow installed copies, check those before using bundled copy.
122 if test -n "$3" && test "$3" = "1"; then
123 for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
124 do
125 if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
126 apr_found="yes"
127 apr_config="$apr_temp_apr_config_file"
128 break
129 else
130 dnl look in some standard places
131 for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2; do
132 if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
133 apr_found="yes"
134 apr_config="$lookdir/bin/$apr_temp_apr_config_file"
135 break 2
136 fi
137 done
138 fi
139 done
140 fi
141 dnl if we have not found anything yet and have bundled source, use that
142 if test "$apr_found" = "no" && test -d "$1"; then
143 apr_temp_abs_srcdir="`cd $1 && pwd`"
144 apr_found="reconfig"
145 apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`"
146 case $apr_bundled_major in
147 "")
148 AC_MSG_ERROR([failed to find major version of bundled APR])
149 ;;
150 0)
151 apr_temp_apr_config_file="apr-config"
152 ;;
153 *)
154 apr_temp_apr_config_file="apr-$apr_bundled_major-config"
155 ;;
156 esac
157 if test -n "$2"; then
158 apr_config="$2/$apr_temp_apr_config_file"
159 else
160 apr_config="$1/$apr_temp_apr_config_file"
161 fi
162 fi
163 ])
164
165 AC_MSG_RESULT($apr_found)
166])
diff --git a/libgnutls.m4 b/m4/libgnutls.m4
index dd86431..960bb2a 100644
--- a/libgnutls.m4
+++ b/m4/libgnutls.m4
@@ -156,13 +156,13 @@ main ()
156 rm -f conf.libgnutlstest 156 rm -f conf.libgnutlstest
157 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) 157 AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS)
158 AC_SUBST(LIBGNUTLS_EXTRA_LIBS) 158 AC_SUBST(LIBGNUTLS_EXTRA_LIBS)
159 159
160 LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS 160 LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS
161 LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS 161 LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS
162 LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` 162 LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version`
163 LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`" 163 LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`"
164 GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool" 164 GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool"
165 165
166 AC_SUBST(LIBGNUTLS_CFLAGS) 166 AC_SUBST(LIBGNUTLS_CFLAGS)
167 AC_SUBST(LIBGNUTLS_LIBS) 167 AC_SUBST(LIBGNUTLS_LIBS)
168 AC_SUBST(LIBGNUTLS_VERSION) 168 AC_SUBST(LIBGNUTLS_VERSION)
diff --git a/m4/libmemcache.m4 b/m4/libmemcache.m4
new file mode 100644
index 0000000..95e630b
--- /dev/null
+++ b/m4/libmemcache.m4
@@ -0,0 +1,46 @@
1dnl Check for memcache client libraries
2dnl CHECK_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3AC_DEFUN([CHECK_MEMCACHE],
4[dnl
5
6AC_ARG_WITH(
7 memcache,
8 [AC_HELP_STRING([--with-memcache=PATH],[Path memcache libraries])],
9 mc_path="$withval",
10 :)
11
12dnl # Determine memcache lib directory
13if test -z $mc_path; then
14 test_paths="/usr/lib /usr/local/lib"
15else
16 test_paths="${mc_path}/lib"
17fi
18
19for x in $test_paths ; do
20 AC_MSG_CHECKING([for memcache library in ${x}])
21 if test -f ${x}/libmemcache.so.1.0; then
22 AC_MSG_RESULT([yes])
23 save_CFLAGS=$CFLAGS
24 save_LDFLAGS=$LDFLAGS
25 CFLAGS="$CFLAGS"
26 LDFLAGS="-L$x $LDFLAGS"
27 AC_CHECK_LIB(memcache, mc_server_add,
28 LIBMEMCACHE_LIBS="-L$x -lmemcache")
29 CFLAGS=$save_CFLAGS
30 LDFLAGS=$save_LDFLAGS
31 break
32 else
33 AC_MSG_RESULT([no])
34 fi
35done
36
37AC_SUBST(LIBMEMCACHE_LIBS)
38
39if test -z "${LIBMEMCACHE_LIBS}"; then
40 AC_MSG_NOTICE([*** memcache library not found.])
41 ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2)
42else
43 AC_MSG_NOTICE([using '${LIBMEMCACHE_LIBS}' for memcache])
44 ifelse([$1], , , $1)
45fi
46])
diff --git a/m4/librsvg.m4 b/m4/librsvg.m4
new file mode 100644
index 0000000..c8d2bf0
--- /dev/null
+++ b/m4/librsvg.m4
@@ -0,0 +1,29 @@
1dnl Check for librsvg libraries
2dnl CHECK_RSVG(MINIMUM-VERSION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3AC_DEFUN([CHECK_RSVG],
4[dnl
5
6pname=librsvg-2.0
7
8AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
9
10if test x$PKG_CONFIG = xno ; then
11 ifelse([$3], , AC_MSG_ERROR([pkg-config not found. pkg-config is required for librsvg]), $3)
12fi
13
14AC_MSG_CHECKING(for librsvg - version >= $1)
15
16if $PKG_CONFIG --atleast-version=$1 $pname; then
17 RSVG_LDFLAGS=`$PKG_CONFIG $pname --libs-only-L`
18 RSVG_LIBS=`$PKG_CONFIG $pname --libs-only-l --libs-only-other`
19 RSVG_CFLAGS=`$PKG_CONFIG $pname --cflags`
20 RSVG_VERSION=`$PKG_CONFIG $pname --modversion`
21 AC_SUBST(RSVG_LDFLAGS)
22 AC_SUBST(RSVG_LIBS)
23 AC_SUBST(RSVG_CFLAGS)
24 AC_SUBST(RSVG_VERSION)
25 ifelse([$2], , AC_MSG_RESULT([yes]), $2)
26else
27 ifelse([$3], , AC_MSG_ERROR([librsvg >=$1 is not installed.]), $3)
28fi
29])
diff --git a/m4/lua.m4 b/m4/lua.m4
new file mode 100644
index 0000000..beae980
--- /dev/null
+++ b/m4/lua.m4
@@ -0,0 +1,71 @@
1dnl Check for Lua 5.0 Libraries
2dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
3dnl Sets:
4dnl LUA_CFLAGS
5dnl LUA_LIBS
6AC_DEFUN([CHECK_LUA],
7[dnl
8
9AC_ARG_WITH(
10 lua,
11 [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.0 prefix])],
12 lua_path="$withval",
13 :)
14
15dnl # Determine memcache lib directory
16if test -z $mc_path; then
17 test_paths="/usr/local /usr"
18else
19 test_paths="${lua_path}"
20fi
21
22for x in $test_paths ; do
23 AC_MSG_CHECKING([for lua.h in ${x}/include/lua50])
24 if test -f ${x}/include/lua50/lua.h; then
25 AC_MSG_RESULT([yes])
26 save_CFLAGS=$CFLAGS
27 save_LDFLAGS=$LDFLAGS
28 CFLAGS="$CFLAGS"
29 LDFLAGS="-L$x/lib $LDFLAGS"
30 AC_CHECK_LIB(lua50, lua_open,
31 [
32 LUA_LIBS="-L$x/lib -llua50 -llualib50"
33 LUA_CFLAGS="-I$x/include/lua50"
34 ])
35 CFLAGS=$save_CFLAGS
36 LDFLAGS=$save_LDFLAGS
37 break
38 else
39 AC_MSG_RESULT([no])
40 fi
41 AC_MSG_CHECKING([for lua.h in ${x}/include])
42 if test -f ${x}/include/lua.h; then
43 AC_MSG_RESULT([yes])
44 save_CFLAGS=$CFLAGS
45 save_LDFLAGS=$LDFLAGS
46 CFLAGS="$CFLAGS"
47 LDFLAGS="-L$x/lib $LDFLAGS"
48 AC_CHECK_LIB(lua, lua_open,
49 [
50 LUA_LIBS="-L$x/lib -llua -llualib"
51 LUA_CFLAGS="-I$x/include/lua50"
52 ])
53 CFLAGS=$save_CFLAGS
54 LDFLAGS=$save_LDFLAGS
55 break
56 else
57 AC_MSG_RESULT([no])
58 fi
59done
60
61AC_SUBST(LUA_LIBS)
62AC_SUBST(LUA_CFLAGS)
63
64if test -z "${LUA_LIBS}"; then
65 AC_MSG_NOTICE([*** Lua 5.0 library not found.])
66 ifelse([$2], , AC_MSG_ERROR([Lua 5.0 library is required]), $2)
67else
68 AC_MSG_NOTICE([using '${LUA_LIBS}' for Lua Library])
69 ifelse([$1], , , $1)
70fi
71])
diff --git a/m4/mod_ftpd_providers.m4 b/m4/mod_ftpd_providers.m4
new file mode 100644
index 0000000..e018666
--- /dev/null
+++ b/m4/mod_ftpd_providers.m4
@@ -0,0 +1,96 @@
1dnl This file is Copyright 2003,2004 Edward Rudd
2dnl Usage, modification, and distribution of this file in other projects is
3dnl allowed and encouraged so long as this copyright notice is retained.
4dnl You are encouraged to send any patches to the me at
5dnl urkle <at> outoforder <dot> cc, but this is not a requirement
6
7dnl
8dnl MOD_FTPD_OUTPUT(file)
9dnl adds "file" to the list of files generated by AC_OUPUT
10AC_DEFUN([MOD_FTP_OUTPUT], [
11 MOD_FTPD_OUTPUT_FILES="$MOD_FTPD_OUTPUT_FILES $1"
12])dnl
13
14dnl
15dnl MOD_FTPD_PROVIDER(name, helptext[, default[, config]]]])
16dnl default is one of:
17dnl yes -- enabled by default. user must explicitly disable.
18dnl no -- disabled under default, most, all. user must explicitly enable.
19dnl most -- disabled by default. enabled explicitly or with most or all.
20dnl "" -- disabled under default, most. enabled explicitly or with all.
21dnl
22dnl basically: yes/no is a hard setting. "most" means follow the "most"
23dnl setting. otherwise, fall under the "all" setting.
24dnl explicit yes/no always overrides.
25dnl
26AC_DEFUN([MOD_FTPD_PROVIDER],[
27 AC_MSG_CHECKING(whether to enable mod_ftpd_$1)
28 define([optname],[--]ifelse($3,yes,disable,enable)[-]translit($1,_,-))dnl
29 AC_ARG_ENABLE(translit($1,_,-),AC_HELP_STRING(optname(),$2),,enable_$1=ifelse($3,,maybe-all,$3))
30 undefine([optname])dnl
31 _apmod_extra_msg=""
32
33 if test "$provider_selection" = "most" -a "$enable_$1" = "most"; then
34 _apmod_error_fatal=no
35 else
36 _apmod_error_fatal=yes
37 fi
38
39 if test "$enable_$1" = "yes"; then
40 _apmod_extra_msg=" ($provider_selection)"
41 elif test "$enable_$1" = "most"; then
42 if test "$provider_selection" = "most" -o "$provider_selection" = "all"; then
43 enable_$1=yes
44 _apmod_extra_msg=" ($provider_selection)"
45 elif test "$enable_$1" != "yes"; then
46 enable_$1=no
47 fi
48 elif test "$enable_$1" = "maybe-all"; then
49 if test "$provider_selection" = "all"; then
50 enable_$1=yes
51 _apmod_extra_msg=" (all)"
52 else
53 enable_$1=no
54 fi
55 fi
56 if test "$enable_$1" != "no"; then
57 ifelse([$4],,:,[AC_MSG_RESULT([checking dependencies])
58 $4
59 AC_MSG_CHECKING(whether to enable mod_$1)
60 if test "$enable_$1" = "no"; then
61 if test "$_apmod_error_fatal" = "no"; then
62 _apmod_extra_msg=" (disabled)"
63 else
64 AC_MSG_ERROR([mod_ftpd_$1 has been requested by can not be build due to prerequisite failure])
65 fi
66 fi])
67 fi
68 AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
69 if test "$enable_$1" != "no"; then
70 PROVIDER_LIST="$PROVIDER_LIST $provider_dir/$1"
71 fi
72])dnl
73
74dnl
75dnl MOD_FTPD_INCLUDE_PROVIDERS(directory)
76dnl searches directory for mod_ftpd provider config.m4 files
77dnl
78AC_DEFUN([MOD_FTPD_INCLUDE_PROVIDERS],[
79 AC_ARG_ENABLE(providers,
80 AC_HELP_STRING([--enable-providers=PROVIDER-LIST],[Providers to enable]),[
81 for i in $enableval; do
82 if test "$i" = "all" -o "$i" = "most"; then
83 provider_selection=$i
84 else
85 eval "enable_$i=yes"
86 fi
87 done
88 ],
89 provider_selection=most
90 )
91
92 provider_dir=$1
93 esyscmd(./config-stubs $provider_dir)
94
95 AC_CONFIG_SUBDIRS($PROVIDER_LIST)
96])dnl
diff --git a/m4/outoforder.m4 b/m4/outoforder.m4
new file mode 100644
index 0000000..7add221
--- /dev/null
+++ b/m4/outoforder.m4
@@ -0,0 +1,36 @@
1dnl m4 for utility macros used by all out of order projects
2
3dnl this writes a "config.nice" file which reinvokes ./configure with all
4dnl of the arguments. this is different from config.status which simply
5dnl regenerates the output files. config.nice is useful after you rebuild
6dnl ./configure (via autoconf or autogen.sh)
7AC_DEFUN([OOO_CONFIG_NICE],[
8 echo configure: creating $1
9 rm -f $1
10 cat >$1<<EOF
11#! /bin/sh
12#
13# Created by configure
14
15EOF
16
17 for arg in [$]0 "[$]@"; do
18 if test "[$]arg" != "--no-create" -a "[$]arg" != "--no-recursion"; then
19 echo "\"[$]arg\" \\" >> $1
20 fi
21 done
22 echo '"[$]@"' >> $1
23 chmod +x $1
24])
25
26dnl this macro adds a maintainer mode option to enable programmer specific
27dnl code in makefiles
28AC_DEFUN([OOO_MAINTAIN_MODE],[
29 AC_ARG_ENABLE(
30 maintainer,
31 [AC_HELP_STRING([--enable-maintainer],[Enable maintainer mode for this project])],
32 AC_MSG_RESULT([Enabling Maintainer Mode!!])
33 OOO_MAINTAIN=1,
34 OOO_MAINTAIN=0)
35 AC_SUBST(OOO_MAINTAIN)
36])