Re: mod_wombat build help

2008-01-10 Thread josh rotenberg
On linux, the check for lua needs to include libm:

(from config.log ..)
configure:2689: checking for luaL_newstate in -llua
configure:2719: gcc -o conftest -g -O2  -L/home/jrotenberg/src/lua-5.1.2//lib
conftest.c -llua   5
/home/jrotenberg/src/lua-5.1.2//lib/liblua.a(lvm.o): In function `Arith':
lvm.c:(.text+0xbeb): undefined reference to `pow'
/home/jrotenberg/src/lua-5.1.2//lib/liblua.a(lvm.o): In function `luaV_execute':
lvm.c:(.text+0x20c9): undefined reference to `pow'
/home/jrotenberg/src/lua-5.1.2//lib/liblua.a(lcode.o): In function `codearith':
lcode.c:(.text+0x11ec): undefined reference to `pow'
collect2: ld returned 1 exit status
configure:2725: $? = 1


the following patch seems to do the trick:

Index: 
build/ac-macros/lua.m4===
--- build/ac-macros/lua.m4  (revision 610998)
+++ build/ac-macros/lua.m4  (working copy)
@@ -19,6 +19,7 @@
 test_paths=${lua_path}
 fi

+AC_CHECK_LIB([m], [pow], lib_m= -lm)
 for x in $test_paths ; do
 AC_MSG_CHECKING([for lua.h in ${x}/include/lua5.1])
 if test -f ${x}/include/lua5.1/lua.h; then
@@ -26,7 +27,7 @@
 save_CFLAGS=$CFLAGS
 save_LDFLAGS=$LDFLAGS
 CFLAGS=$CFLAGS
-LDFLAGS=-L$x/lib $LDFLAGS
+LDFLAGS=-L$x/lib $LDFLAGS $lib_m
 AC_CHECK_LIB(lua5.1, luaL_newstate,
 [
 LUA_LIBS=-L$x/lib -llua5.1
@@ -44,7 +45,7 @@
 save_CFLAGS=$CFLAGS
 save_LDFLAGS=$LDFLAGS
 CFLAGS=$CFLAGS
-LDFLAGS=-L$x/lib $LDFLAGS
+LDFLAGS=-L$x/lib $LDFLAGS $lib_m
 AC_CHECK_LIB(lua, luaL_newstate,
 [
 LUA_LIBS=-L$x/lib -llua




On Jan 3, 2008 6:42 AM, Brian McCallister [EMAIL PROTECTED] wrote:

 On Jan 1, 2008, at 10:15 PM, Justin Erenkrantz wrote:

  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.)

 Please go ahead and apply it.

 THANKS!

 -Brian




Re: mod_wombat build help

2008-01-03 Thread Brian McCallister


On Jan 1, 2008, at 10:15 PM, Justin Erenkrantz wrote:


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.)


Please go ahead and apply it.

THANKS!

-Brian



Re: mod_wombat build help

2008-01-01 Thread Justin Erenkrantz
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