On Dec 31, 2007 5:12 PM, Brian McCallister [EMAIL PROTECTED] wrote:
If anyone is familiar with autconf and modules, I would *love* if that
person could take a look at helping me clean up mod_wombat's build,
which is presently a mess.
I, to be honest, don't understand enough automake/autoconf + apxs to
know what needs doing, so will just say... please help?
See below. If you'd like, I can just commit it. (It's not perfect,
but it'll build out-of-the-box on Leopard.)
Enjoy. -- justin
Property changes on: .
___
Modified: svn:ignore
- wombat.tmproj
cycle
*.loT
Makefile
config
configure
config.log
config.status
*.slo
.libs
ref
+ wombat.tmproj
cycle
*.loT
Makefile
config
configure
config.log
config.status
*.slo
.libs
ref
mod_wombat_config.h.in
mod_wombat_config.h
Index: Makefile.in
===
--- Makefile.in (revision 608009)
+++ Makefile.in (working copy)
@@ -1,26 +1,33 @@
-APXS_CFLAGS = -Wc,-Wall -Wc,-Werror
+# Makefile for mod_wombat
-COMPILE_APACHE_MOD = @APXS@ -c [EMAIL PROTECTED]@ -q INCLUDEDIR`/apreq2
[EMAIL PROTECTED]@/include/apreq2 [EMAIL PROTECTED]@/lib -lapreq2 @LUA_LIBS@
@LUA_CFLAGS@ $(APXS_CFLAGS)
[EMAIL PROTECTED]@
-INSTALL_MOD_SHARED = @APXS@ -i
+EXTRA_CFLAGS = -Wc,-Wall -Wc,-Werror
+APREQ2_DIR = @APREQ2_DIR@
+APREQ2_INCLUDES = -I$(APREQ2_DIR)/include/apreq2
+APREQ2_LIBS = -L$(APREQ2_DIR)/lib -Wl,-R$(APREQ2_DIR)/lib -lapreq2
+
+LUA_CFLAGS = @LUA_CFLAGS@
+LUA_LIBS = @LUA_LIBS@
+
+CPPFLAGS=$(APREQ2_INCLUDES) $(LUA_CFLAGS) $(EXTRA_CFLAGS)
+LIBS=$(APREQ2_LIBS) $(LUA_LIBS)
+LDFLAGS=
+
+COMPILE_APACHE_MOD = $(APXS) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS)
+
+INSTALL_MOD_SHARED = $(APXS) -i
+
all: mod_wombat.la
install: install-mods
clean:
- @rm -rf *.la
- @rm -rf *.lo
- @rm -rf *.o
- @rm -rf *.slo
- @rm -rf .libs
+ @rm -rf *.la *.lo *.o *.slo .libs
maintainer-clean: clean
- @rm -rf Makefile
- @rm -rf config
- @rm -rf config.log
- @rm -rf config.status
- @rm -rf configure
+ @rm -rf Makefile config config.log config.status configure
dist-clean: maintainer-clean
Index: configure.in
===
--- configure.in(revision 608009)
+++ configure.in(working copy)
@@ -1,11 +1,15 @@
+AC_PREREQ(2.50)
+
AC_INIT
-AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_HEADER(mod_wombat_config.h)
+AC_CONFIG_AUX_DIR(build)
sinclude(build/ac-macros/lua.m4)
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
AC_ARG_WITH(apxs,
-[[ --with-apxs[=FILE] FILE is the path to apxs; defaults to apxs.]],
+[AS_HELP_STRING([[--with-apxs=[=FILE]]],
+[FILE is the path to apxs; defaults to apxs.])],
[
if test $withval = yes; then
APXS=apxs
@@ -14,13 +18,17 @@
fi
])
-if test $BINNAME = -a $APXS = ; then
+if test -z $APXS; then
for i in /usr/sbin \
/usr/local/apache/bin \
/usr/local/apache2/bin \
/usr/local/sbin ; do
-if test -f $i/apxs; then
+if test -f $i/apxs2; then
+ APXS=$i/apxs2
+ break
+elif test -f $i/apxs; then
APXS=$i/apxs
+ break
fi
done
fi
@@ -61,13 +69,18 @@
fi
])
-if test -n $APREQ2_DIR -a $APREQ2_DIR != no; then
- AC_MSG_NOTICE(found apreq2 at $APREQ2_DIR)
-else
- AC_MSG_ERROR(couldn't find apreq2)
-fi
+save_CPPFLAGS=$CPPFLAGS
+APXS_INCLUDES=`$APXS -q EXTRA_INCLUDES`
+CPPFLAGS=$APXS_INCLUDES -I$APREQ2_DIR/include/apreq2 $CPPFLAGS
+AC_CHECK_HEADERS([apreq2/apreq_module_apache2.h apreq.h],
+ [],
+ [AC_MSG_ERROR([APREQ headers not found. Try --with-apreq2])])
+CPPFLAGS=$save_CPPFLAGS
AC_SUBST(APXS)
+
AC_SUBST(APREQ2_DIR)
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
Index: vmprep.c
===
--- vmprep.c(revision 608009)
+++ vmprep.c(working copy)
@@ -121,8 +121,8 @@
lua_pushinteger(L, DONE);
lua_setfield(L, -2, DONE);
-
-lua_pushstring(L, ap_get_server_version());
+
+lua_pushstring(L, ap_get_server_banner());
lua_setfield(L, -2, version);
lua_pushinteger(L, HTTP_MOVED_TEMPORARILY);
Index: build/install.sh
===
--- build/install.sh(revision 0)
+++ build/install.sh(revision 0)
@@ -0,0 +1,112 @@
+#!/bin/sh
+##
+## install.sh -- install a program, script or datafile
+##
+## Based on `install-sh' from the X Consortium's X11R5 distribution
+## as of 89/12/18 which is freely available.
+## Cleaned up for Apache's Autoconf-style Interface (APACI)
+## by Ralf S. Engelschall [EMAIL PROTECTED]
+##
+#
+# This script falls under the Apache License.
+# See http://www.apache.org/docs/LICENSE
+
+
+#
+# put in absolute paths if you don't have them in your path;
+# or