diff options
author | Nikos Mavrogiannopoulos | 2008-02-20 19:53:44 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2008-02-20 19:53:44 +0000 |
commit | abce2980c929dbb6ccb9d45c7cd88df3106c6ee4 (patch) | |
tree | b71cda083d1ed8ceb2db2fb815eadf042295c348 /m4 | |
parent | 572096be0da2690e3e32ad8fd19ae5758c870874 (diff) |
added new m4 directory
Diffstat (limited to 'm4')
-rw-r--r-- | m4/apache.m4 | 151 | ||||
-rw-r--r-- | m4/apache_test.m4 | 96 | ||||
-rw-r--r-- | m4/apr_memcache.m4 | 56 | ||||
-rw-r--r-- | m4/apreq.m4 | 43 | ||||
-rwxr-xr-x | m4/buildconf.py | 83 | ||||
-rw-r--r-- | m4/find_apr.m4 | 166 | ||||
-rw-r--r-- | m4/libgnutls.m4 | 174 | ||||
-rw-r--r-- | m4/libmemcache.m4 | 46 | ||||
-rw-r--r-- | m4/librsvg.m4 | 29 | ||||
-rw-r--r-- | m4/lua.m4 | 71 | ||||
-rw-r--r-- | m4/mod_ftpd_providers.m4 | 96 | ||||
-rw-r--r-- | m4/outoforder.m4 | 36 |
12 files changed, 1047 insertions, 0 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 | |||
2 | dnl CHECK_APACHE([MINIMUM13-VERSION [, MINIMUM20-VERSION [, | ||
3 | dnl ACTION-IF-FOUND13 [, ACTION-IF-FOUND20 [, ACTION-IF-NOT-FOUND]]]) | ||
4 | dnl Test for Apache apxs, APR, and APU | ||
5 | |||
6 | AC_DEFUN([CHECK_APACHE], | ||
7 | [dnl | ||
8 | AC_ARG_WITH( | ||
9 | apxs, | ||
10 | [AC_HELP_STRING([--with-apxs=PATH],[Path to apxs])], | ||
11 | apxs_prefix="$withval", | ||
12 | apxs_prefix="/usr" | ||
13 | ) | ||
14 | |||
15 | AC_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 @@ | |||
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 $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 | |||
25 | char* 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 | |||
38 | int 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, µ1) != 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, µ2) != 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 | |||
84 | int 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 @@ | |||
1 | dnl Check for memcache client libraries | ||
2 | dnl CHECK_APR_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | dnl Sets: | ||
4 | dnl APR_MEMCACHE_LIBS | ||
5 | AC_DEFUN([CHECK_APR_MEMCACHE], | ||
6 | [dnl | ||
7 | |||
8 | AC_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 | :) | ||
14 | AC_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 | :) | ||
20 | AC_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 | |||
28 | AC_LIBTOOL_SYS_DYNAMIC_LINKER | ||
29 | |||
30 | dnl # Determine memcache lib directory | ||
31 | save_CFLAGS=$CFLAGS | ||
32 | save_LDFLAGS=$LDFLAGS | ||
33 | CFLAGS="-I$apr_memcache_includes $APR_INCLUDES $CFLAGS" | ||
34 | LDFLAGS="-L$apr_memcache_libs $LDFLAGS" | ||
35 | AC_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 | ) | ||
43 | CFLAGS=$save_CFLAGS | ||
44 | LDFLAGS=$save_LDFLAGS | ||
45 | |||
46 | AC_SUBST(APR_MEMCACHE_LIBS) | ||
47 | AC_SUBST(APR_MEMCACHE_CFLAGS) | ||
48 | |||
49 | if 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) | ||
52 | else | ||
53 | AC_MSG_NOTICE([using '${APR_MEMCACHE_LIBS}' for memcache]) | ||
54 | ifelse([$1], , , $1) | ||
55 | fi | ||
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 @@ | |||
1 | dnl Check for apreq2 libraries | ||
2 | dnl CHECK_APREQ2(MINIMUM-VERSION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | AC_DEFUN([CHECK_APREQ2], | ||
4 | [dnl | ||
5 | |||
6 | AC_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 | |||
20 | import os | ||
21 | import sys | ||
22 | import popen2 | ||
23 | from optparse import OptionParser | ||
24 | |||
25 | cmd = {} | ||
26 | |||
27 | def 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 | |||
38 | def 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 | |||
52 | parser = OptionParser() | ||
53 | |||
54 | parser.add_option("--libtoolize", action="store_true", dest="libtoolize", default=False) | ||
55 | parser.add_option("--aclocal", action="store_true", dest="aclocal", default=False) | ||
56 | parser.add_option("--automake", action="store_true", dest="automake", default=False) | ||
57 | parser.add_option("--autoconf", action="store_true", dest="autoconf", default=False) | ||
58 | parser.add_option("--autoheader", action="store_true", dest="autoheader", default=False) | ||
59 | |||
60 | (options, args) = parser.parse_args() | ||
61 | |||
62 | if options.libtoolize: | ||
63 | select_cmd("libtoolize", ['libtoolize14','glibtoolize','libtoolize']) | ||
64 | if options.aclocal: | ||
65 | select_cmd("aclocal", ['aclocal-1.9','aclocal-1.8','aclocal-1.7','aclocal-1.6','aclocal']) | ||
66 | if options.autoheader: | ||
67 | select_cmd("autoheader", ['autoheader259','autoheader257','autoheader']) | ||
68 | if options.automake: | ||
69 | select_cmd("automake", ['automake-1.9','automake-1.8','automake-1.7','automake-1.6','automake']) | ||
70 | if options.autoconf: | ||
71 | select_cmd("autoconf", ['autoconf259','autoconf257','autoconf']) | ||
72 | |||
73 | if options.libtoolize: | ||
74 | run_cmd("libtoolize", "--force --copy") | ||
75 | if options.aclocal: | ||
76 | run_cmd("aclocal", "-I m4") | ||
77 | if options.autoheader: | ||
78 | run_cmd("autoheader") | ||
79 | if options.automake: | ||
80 | run_cmd("automake", "--add-missing --copy --foreign") | ||
81 | if 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 @@ | |||
1 | dnl -------------------------------------------------------- -*- autoconf -*- | ||
2 | dnl Copyright 2000-2005 The Apache Software Foundation | ||
3 | dnl | ||
4 | dnl Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | dnl you may not use this file except in compliance with the License. | ||
6 | dnl You may obtain a copy of the License at | ||
7 | dnl | ||
8 | dnl http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | dnl | ||
10 | dnl Unless required by applicable law or agreed to in writing, software | ||
11 | dnl distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | dnl See the License for the specific language governing permissions and | ||
14 | dnl limitations under the License. | ||
15 | |||
16 | dnl | ||
17 | dnl find_apr.m4 : locate the APR include files and libraries | ||
18 | dnl | ||
19 | dnl This macro file can be used by applications to find and use the APR | ||
20 | dnl library. It provides a standardized mechanism for using APR. It supports | ||
21 | dnl embedding APR into the application source, or locating an installed | ||
22 | dnl copy of APR. | ||
23 | dnl | ||
24 | dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors) | ||
25 | dnl | ||
26 | dnl where srcdir is the location of the bundled APR source directory, or | ||
27 | dnl empty if source is not bundled. | ||
28 | dnl | ||
29 | dnl where builddir is the location where the bundled APR will will be built, | ||
30 | dnl or empty if the build will occur in the srcdir. | ||
31 | dnl | ||
32 | dnl where implicit-install-check set to 1 indicates if there is no | ||
33 | dnl --with-apr option specified, we will look for installed copies. | ||
34 | dnl | ||
35 | dnl where acceptable-majors is a space separated list of acceptable major | ||
36 | dnl version numbers. Often only a single major version will be acceptable. | ||
37 | dnl If multiple versions are specified, and --with-apr=PREFIX or the | ||
38 | dnl implicit installed search are used, then the first (leftmost) version | ||
39 | dnl in the list that is found will be used. Currently defaults to [0 1]. | ||
40 | dnl | ||
41 | dnl Sets the following variables on exit: | ||
42 | dnl | ||
43 | dnl apr_found : "yes", "no", "reconfig" | ||
44 | dnl | ||
45 | dnl apr_config : If the apr-config tool exists, this refers to it. If | ||
46 | dnl apr_found is "reconfig", then the bundled directory | ||
47 | dnl should be reconfigured *before* using apr_config. | ||
48 | dnl | ||
49 | dnl Note: this macro file assumes that apr-config has been installed; it | ||
50 | dnl is normally considered a required part of an APR installation. | ||
51 | dnl | ||
52 | dnl If a bundled source directory is available and needs to be (re)configured, | ||
53 | dnl then apr_found is set to "reconfig". The caller should reconfigure the | ||
54 | dnl (passed-in) source directory, placing the result in the build directory, | ||
55 | dnl as appropriate. | ||
56 | dnl | ||
57 | dnl If apr_found is "yes" or "reconfig", then the caller should use the | ||
58 | dnl value of apr_config to fetch any necessary build/link information. | ||
59 | dnl | ||
60 | |||
61 | AC_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/m4/libgnutls.m4 b/m4/libgnutls.m4 new file mode 100644 index 0000000..960bb2a --- /dev/null +++ b/m4/libgnutls.m4 | |||
@@ -0,0 +1,174 @@ | |||
1 | dnl Autoconf macros for libgnutls-extra | ||
2 | dnl $id$ | ||
3 | |||
4 | # Modified for LIBGNUTLS_EXTRA -- nmav | ||
5 | # Configure paths for LIBGCRYPT | ||
6 | # Shamelessly stolen from the one of XDELTA by Owen Taylor | ||
7 | # Werner Koch 99-12-09 | ||
8 | |||
9 | dnl AM_PATH_LIBGNUTLS_EXTRA([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) | ||
10 | dnl Test for libgnutls-extra, and define LIBGNUTLS_EXTRA_CFLAGS and LIBGNUTLS_EXTRA_LIBS | ||
11 | dnl | ||
12 | AC_DEFUN([AM_PATH_LIBGNUTLS_EXTRA], | ||
13 | [dnl | ||
14 | dnl Get the cflags and libraries from the libgnutls-extra-config script | ||
15 | dnl | ||
16 | AC_ARG_WITH(libgnutls-extra-prefix, | ||
17 | [ --with-libgnutls-extra-prefix=PFX Prefix where libgnutls-extra is installed (optional)], | ||
18 | libgnutls_extra_config_prefix="$withval", libgnutls_extra_config_prefix="") | ||
19 | |||
20 | if test x$libgnutls_extra_config_prefix != x ; then | ||
21 | if test x${LIBGNUTLS_EXTRA_CONFIG+set} != xset ; then | ||
22 | LIBGNUTLS_EXTRA_CONFIG=$libgnutls_extra_config_prefix/bin/libgnutls-extra-config | ||
23 | fi | ||
24 | fi | ||
25 | |||
26 | AC_PATH_PROG(LIBGNUTLS_EXTRA_CONFIG, libgnutls-extra-config, no) | ||
27 | min_libgnutls_version=ifelse([$1], ,0.1.0,$1) | ||
28 | AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version) | ||
29 | no_libgnutls="" | ||
30 | if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then | ||
31 | no_libgnutls=yes | ||
32 | else | ||
33 | LIBGNUTLS_EXTRA_CFLAGS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --cflags` | ||
34 | LIBGNUTLS_EXTRA_LIBS=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --libs` | ||
35 | libgnutls_extra_config_version=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` | ||
36 | |||
37 | |||
38 | ac_save_CFLAGS="$CFLAGS" | ||
39 | ac_save_LIBS="$LIBS" | ||
40 | CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" | ||
41 | LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" | ||
42 | dnl | ||
43 | dnl Now check if the installed libgnutls is sufficiently new. Also sanity | ||
44 | dnl checks the results of libgnutls-extra-config to some extent | ||
45 | dnl | ||
46 | rm -f conf.libgnutlstest | ||
47 | AC_TRY_RUN([ | ||
48 | #include <stdio.h> | ||
49 | #include <stdlib.h> | ||
50 | #include <string.h> | ||
51 | #include <gnutls/extra.h> | ||
52 | |||
53 | int | ||
54 | main () | ||
55 | { | ||
56 | system ("touch conf.libgnutlstest"); | ||
57 | |||
58 | if( strcmp( gnutls_extra_check_version(NULL), "$libgnutls_extra_config_version" ) ) | ||
59 | { | ||
60 | printf("\n*** 'libgnutls-extra-config --version' returned %s, but LIBGNUTLS_EXTRA (%s)\n", | ||
61 | "$libgnutls_extra_config_version", gnutls_extra_check_version(NULL) ); | ||
62 | printf("*** was found! If libgnutls-extra-config was correct, then it is best\n"); | ||
63 | printf("*** to remove the old version of LIBGNUTLS_EXTRA. You may also be able to fix the error\n"); | ||
64 | printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | ||
65 | printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | ||
66 | printf("*** required on your system.\n"); | ||
67 | printf("*** If libgnutls-extra-config was wrong, set the environment variable LIBGNUTLS_EXTRA_CONFIG\n"); | ||
68 | printf("*** to point to the correct copy of libgnutls-extra-config, and remove the file config.cache\n"); | ||
69 | printf("*** before re-running configure\n"); | ||
70 | } | ||
71 | else if ( strcmp(gnutls_extra_check_version(NULL), LIBGNUTLS_EXTRA_VERSION ) ) | ||
72 | { | ||
73 | printf("\n*** LIBGNUTLS_EXTRA header file (version %s) does not match\n", LIBGNUTLS_EXTRA_VERSION); | ||
74 | printf("*** library (version %s). This is may be due to a different version of gnutls\n", gnutls_extra_check_version(NULL) ); | ||
75 | printf("*** and gnutls-extra.\n"); | ||
76 | } | ||
77 | else | ||
78 | { | ||
79 | if ( gnutls_extra_check_version( "$min_libgnutls_version" ) ) | ||
80 | { | ||
81 | return 0; | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | printf("no\n*** An old version of LIBGNUTLS_EXTRA (%s) was found.\n", | ||
86 | gnutls_extra_check_version(NULL) ); | ||
87 | printf("*** You need a version of LIBGNUTLS_EXTRA newer than %s. The latest version of\n", | ||
88 | "$min_libgnutls_version" ); | ||
89 | printf("*** LIBGNUTLS_EXTRA is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n"); | ||
90 | printf("*** \n"); | ||
91 | printf("*** If you have already installed a sufficiently new version, this error\n"); | ||
92 | printf("*** probably means that the wrong copy of the libgnutls-extra-config shell script is\n"); | ||
93 | printf("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
94 | printf("*** of LIBGNUTLS_EXTRA, but you can also set the LIBGNUTLS_EXTRA_CONFIG environment to point to the\n"); | ||
95 | printf("*** correct copy of libgnutls-extra-config. (In this case, you will have to\n"); | ||
96 | printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | ||
97 | printf("*** so that the correct libraries are found at run-time))\n"); | ||
98 | } | ||
99 | } | ||
100 | return 1; | ||
101 | } | ||
102 | ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
103 | CFLAGS="$ac_save_CFLAGS" | ||
104 | LIBS="$ac_save_LIBS" | ||
105 | fi | ||
106 | |||
107 | if test "x$no_libgnutls" = x ; then | ||
108 | AC_MSG_RESULT(yes) | ||
109 | ifelse([$2], , :, [$2]) | ||
110 | else | ||
111 | if test -f conf.libgnutlstest ; then | ||
112 | : | ||
113 | else | ||
114 | AC_MSG_RESULT(no) | ||
115 | fi | ||
116 | if test "$LIBGNUTLS_EXTRA_CONFIG" = "no" ; then | ||
117 | echo "*** The libgnutls-extra-config script installed by LIBGNUTLS_EXTRA could not be found" | ||
118 | echo "*** If LIBGNUTLS_EXTRA was installed in PREFIX, make sure PREFIX/bin is in" | ||
119 | echo "*** your path, or set the LIBGNUTLS_EXTRA_CONFIG environment variable to the" | ||
120 | echo "*** full path to libgnutls-extra-config." | ||
121 | else | ||
122 | if test -f conf.libgnutlstest ; then | ||
123 | : | ||
124 | else | ||
125 | echo "*** Could not run libgnutls test program, checking why..." | ||
126 | CFLAGS="$CFLAGS $LIBGNUTLS_EXTRA_CFLAGS" | ||
127 | LIBS="$LIBS $LIBGNUTLS_EXTRA_LIBS" | ||
128 | AC_TRY_LINK([ | ||
129 | #include <stdio.h> | ||
130 | #include <stdlib.h> | ||
131 | #include <string.h> | ||
132 | #include <gnutls/extra.h> | ||
133 | ], [ return !!gnutls_extra_check_version(NULL); ], | ||
134 | [ echo "*** The test program compiled, but did not run. This usually means" | ||
135 | echo "*** that the run-time linker is not finding LIBGNUTLS_EXTRA or finding the wrong" | ||
136 | echo "*** version of LIBGNUTLS_EXTRA. If it is not finding LIBGNUTLS_EXTRA, you'll need to set your" | ||
137 | echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
138 | echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
139 | echo "*** is required on your system" | ||
140 | echo "***" | ||
141 | echo "*** If you have an old version installed, it is best to remove it, although" | ||
142 | echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" | ||
143 | echo "***" ], | ||
144 | [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
145 | echo "*** exact error that occured. This usually means LIBGNUTLS_EXTRA was incorrectly installed" | ||
146 | echo "*** or that you have moved LIBGNUTLS_EXTRA since it was installed. In the latter case, you" | ||
147 | echo "*** may want to edit the libgnutls-extra-config script: $LIBGNUTLS_EXTRA_CONFIG" ]) | ||
148 | CFLAGS="$ac_save_CFLAGS" | ||
149 | LIBS="$ac_save_LIBS" | ||
150 | fi | ||
151 | fi | ||
152 | LIBGNUTLS_EXTRA_CFLAGS="" | ||
153 | LIBGNUTLS_EXTRA_LIBS="" | ||
154 | ifelse([$3], , :, [$3]) | ||
155 | fi | ||
156 | rm -f conf.libgnutlstest | ||
157 | AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) | ||
158 | AC_SUBST(LIBGNUTLS_EXTRA_LIBS) | ||
159 | |||
160 | LIBGNUTLS_LIBS=$LIBGNUTLS_EXTRA_LIBS | ||
161 | LIBGNUTLS_CFLAGS=$LIBGNUTLS_EXTRA_CFLAGS | ||
162 | LIBGNUTLS_VERSION=`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --version` | ||
163 | LIBGNUTLS_PREFIX="`$LIBGNUTLS_EXTRA_CONFIG $libgnutls_extra_config_args --prefix`" | ||
164 | GNUTLS_CERTTOOL="${LIBGNUTLS_PREFIX}/bin/certtool" | ||
165 | |||
166 | AC_SUBST(LIBGNUTLS_CFLAGS) | ||
167 | AC_SUBST(LIBGNUTLS_LIBS) | ||
168 | AC_SUBST(LIBGNUTLS_VERSION) | ||
169 | AC_SUBST(LIBGNUTLS_PREFIX) | ||
170 | AC_SUBST(LIBGNUTLS_CERTTOOL) | ||
171 | |||
172 | ]) | ||
173 | |||
174 | dnl *-*wedit:notab*-* Please keep this as the last line. | ||
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 @@ | |||
1 | dnl Check for memcache client libraries | ||
2 | dnl CHECK_MEMCACHE(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | AC_DEFUN([CHECK_MEMCACHE], | ||
4 | [dnl | ||
5 | |||
6 | AC_ARG_WITH( | ||
7 | memcache, | ||
8 | [AC_HELP_STRING([--with-memcache=PATH],[Path memcache libraries])], | ||
9 | mc_path="$withval", | ||
10 | :) | ||
11 | |||
12 | dnl # Determine memcache lib directory | ||
13 | if test -z $mc_path; then | ||
14 | test_paths="/usr/lib /usr/local/lib" | ||
15 | else | ||
16 | test_paths="${mc_path}/lib" | ||
17 | fi | ||
18 | |||
19 | for 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 | ||
35 | done | ||
36 | |||
37 | AC_SUBST(LIBMEMCACHE_LIBS) | ||
38 | |||
39 | if test -z "${LIBMEMCACHE_LIBS}"; then | ||
40 | AC_MSG_NOTICE([*** memcache library not found.]) | ||
41 | ifelse([$2], , AC_MSG_ERROR([memcache library is required]), $2) | ||
42 | else | ||
43 | AC_MSG_NOTICE([using '${LIBMEMCACHE_LIBS}' for memcache]) | ||
44 | ifelse([$1], , , $1) | ||
45 | fi | ||
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 @@ | |||
1 | dnl Check for librsvg libraries | ||
2 | dnl CHECK_RSVG(MINIMUM-VERSION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | AC_DEFUN([CHECK_RSVG], | ||
4 | [dnl | ||
5 | |||
6 | pname=librsvg-2.0 | ||
7 | |||
8 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) | ||
9 | |||
10 | if test x$PKG_CONFIG = xno ; then | ||
11 | ifelse([$3], , AC_MSG_ERROR([pkg-config not found. pkg-config is required for librsvg]), $3) | ||
12 | fi | ||
13 | |||
14 | AC_MSG_CHECKING(for librsvg - version >= $1) | ||
15 | |||
16 | if $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) | ||
26 | else | ||
27 | ifelse([$3], , AC_MSG_ERROR([librsvg >=$1 is not installed.]), $3) | ||
28 | fi | ||
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 @@ | |||
1 | dnl Check for Lua 5.0 Libraries | ||
2 | dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
3 | dnl Sets: | ||
4 | dnl LUA_CFLAGS | ||
5 | dnl LUA_LIBS | ||
6 | AC_DEFUN([CHECK_LUA], | ||
7 | [dnl | ||
8 | |||
9 | AC_ARG_WITH( | ||
10 | lua, | ||
11 | [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.0 prefix])], | ||
12 | lua_path="$withval", | ||
13 | :) | ||
14 | |||
15 | dnl # Determine memcache lib directory | ||
16 | if test -z $mc_path; then | ||
17 | test_paths="/usr/local /usr" | ||
18 | else | ||
19 | test_paths="${lua_path}" | ||
20 | fi | ||
21 | |||
22 | for 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 | ||
59 | done | ||
60 | |||
61 | AC_SUBST(LUA_LIBS) | ||
62 | AC_SUBST(LUA_CFLAGS) | ||
63 | |||
64 | if 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) | ||
67 | else | ||
68 | AC_MSG_NOTICE([using '${LUA_LIBS}' for Lua Library]) | ||
69 | ifelse([$1], , , $1) | ||
70 | fi | ||
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 @@ | |||
1 | dnl This file is Copyright 2003,2004 Edward Rudd | ||
2 | dnl Usage, modification, and distribution of this file in other projects is | ||
3 | dnl allowed and encouraged so long as this copyright notice is retained. | ||
4 | dnl You are encouraged to send any patches to the me at | ||
5 | dnl urkle <at> outoforder <dot> cc, but this is not a requirement | ||
6 | |||
7 | dnl | ||
8 | dnl MOD_FTPD_OUTPUT(file) | ||
9 | dnl adds "file" to the list of files generated by AC_OUPUT | ||
10 | AC_DEFUN([MOD_FTP_OUTPUT], [ | ||
11 | MOD_FTPD_OUTPUT_FILES="$MOD_FTPD_OUTPUT_FILES $1" | ||
12 | ])dnl | ||
13 | |||
14 | dnl | ||
15 | dnl MOD_FTPD_PROVIDER(name, helptext[, default[, config]]]]) | ||
16 | dnl default is one of: | ||
17 | dnl yes -- enabled by default. user must explicitly disable. | ||
18 | dnl no -- disabled under default, most, all. user must explicitly enable. | ||
19 | dnl most -- disabled by default. enabled explicitly or with most or all. | ||
20 | dnl "" -- disabled under default, most. enabled explicitly or with all. | ||
21 | dnl | ||
22 | dnl basically: yes/no is a hard setting. "most" means follow the "most" | ||
23 | dnl setting. otherwise, fall under the "all" setting. | ||
24 | dnl explicit yes/no always overrides. | ||
25 | dnl | ||
26 | AC_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 | |||
74 | dnl | ||
75 | dnl MOD_FTPD_INCLUDE_PROVIDERS(directory) | ||
76 | dnl searches directory for mod_ftpd provider config.m4 files | ||
77 | dnl | ||
78 | AC_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 @@ | |||
1 | dnl m4 for utility macros used by all out of order projects | ||
2 | |||
3 | dnl this writes a "config.nice" file which reinvokes ./configure with all | ||
4 | dnl of the arguments. this is different from config.status which simply | ||
5 | dnl regenerates the output files. config.nice is useful after you rebuild | ||
6 | dnl ./configure (via autoconf or autogen.sh) | ||
7 | AC_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 | |||
15 | EOF | ||
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 | |||
26 | dnl this macro adds a maintainer mode option to enable programmer specific | ||
27 | dnl code in makefiles | ||
28 | AC_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 | ]) | ||