You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian McCallister <br...@apache.org> on 2008/01/01 02:12:43 UTC
mod_wombat build help
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?
Thanks!
-Brian
Re: mod_wombat build help
Posted by josh rotenberg <jo...@gmail.com>.
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 <br...@apache.org> wrote:
>
> On Jan 1, 2008, at 10:15 PM, Justin Erenkrantz wrote:
>
> > On Dec 31, 2007 5:12 PM, Brian McCallister <br...@apache.org> 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
Posted by Brian McCallister <br...@apache.org>.
On Jan 1, 2008, at 10:15 PM, Justin Erenkrantz wrote:
> On Dec 31, 2007 5:12 PM, Brian McCallister <br...@apache.org> 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
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Dec 31, 2007 5:12 PM, Brian McCallister <br...@apache.org> 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 -I`@APXS@ -q INCLUDEDIR`/apreq2
-I@APREQ2_DIR@/include/apreq2 -L@APREQ2_DIR@/lib -lapreq2 @LUA_LIBS@
@LUA_CFLAGS@ $(APXS_CFLAGS)
+APXS=@APXS@
-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 <rs...@apache.org>
+##
+#
+# 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 use env. vars.
+#
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+
+#
+# parse argument line
+#
+instcmd="$mvprog"
+chmodcmd=""
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+ext=""
+src=""
+dst=""
+while [ "x$1" != "x" ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift; continue
+ ;;
+ -m) chmodcmd="$chmodprog $2"
+ shift; shift; continue
+ ;;
+ -o) chowncmd="$chownprog $2"
+ shift; shift; continue
+ ;;
+ -g) chgrpcmd="$chgrpprog $2"
+ shift; shift; continue
+ ;;
+ -s) stripcmd="$stripprog"
+ shift; continue
+ ;;
+ -S) stripcmd="$stripprog $2"
+ shift; shift; continue
+ ;;
+ -e) ext="$2"
+ shift; shift; continue
+ ;;
+ *) if [ "x$src" = "x" ]; then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift; continue
+ ;;
+ esac
+done
+if [ "x$src" = "x" ]; then
+ echo "install.sh: no input file specified"
+ exit 1
+fi
+if [ "x$dst" = "x" ]; then
+ echo "install.sh: no destination specified"
+ exit 1
+fi
+
+#
+# If destination is a directory, append the input filename; if
+# your system does not like double slashes in filenames, you may
+# need to add some logic
+#
+if [ -d $dst ]; then
+ dst="$dst/`basename $src`"
+fi
+
+# Add a possible extension (such as ".exe") to src and dst
+src="$src$ext"
+dst="$dst$ext"
+
+# Make a temp file name in the proper directory.
+dstdir=`dirname $dst`
+dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+$instcmd $src $dsttmp
+
+# And set any options; do chmod last to preserve setuid bits
+if [ "x$chowncmd" != "x" ]; then $chowncmd $dsttmp; fi
+if [ "x$chgrpcmd" != "x" ]; then $chgrpcmd $dsttmp; fi
+if [ "x$stripcmd" != "x" ]; then $stripcmd $dsttmp; fi
+if [ "x$chmodcmd" != "x" ]; then $chmodcmd $dsttmp; fi
+
+# Now rename the file to the real destination.
+$rmcmd $dst
+$mvcmd $dsttmp $dst
+
+exit 0
+
Property changes on: build/install.sh
___________________________________________________________________
Added: svn:executable
+ *
Index: build/buildcheck.sh
===================================================================
--- build/buildcheck.sh (revision 0)
+++ build/buildcheck.sh (revision 0)
@@ -0,0 +1,66 @@
+#! /bin/sh
+
+echo "buildconf: checking installation..."
+
+# any python
+python=`build/PrintPath python`
+if test -z "$python"; then
+echo "buildconf: python not found."
+echo " You need python installed"
+echo " to build APR from SVN."
+exit 1
+else
+py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'`
+echo "buildconf: python version $py_version (ok)"
+fi
+
+# autoconf 2.50 or newer
+ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e
's/^[^0-9]*//;s/[a-z]* *$//;q'`
+if test -z "$ac_version"; then
+echo "buildconf: autoconf not found."
+echo " You need autoconf version 2.50 or newer installed"
+echo " to build APR from SVN."
+exit 1
+fi
+IFS=.; set $ac_version; IFS=' '
+if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then
+echo "buildconf: autoconf version $ac_version found."
+echo " You need autoconf version 2.50 or newer installed"
+echo " to build APR from SVN."
+exit 1
+else
+echo "buildconf: autoconf version $ac_version (ok)"
+fi
+
+# Sample libtool --version outputs:
+# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
+# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
+# output is multiline from 1.5 onwards
+
+# Require libtool 1.4 or newer
+libtool=`build/PrintPath glibtool libtool libtool15 libtool14`
+lt_pversion=`$libtool --version 2>/dev/null|sed -e
's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
+if test -z "$lt_pversion"; then
+echo "buildconf: libtool not found."
+echo " You need libtool version 1.4 or newer installed"
+echo " to build APR from SVN."
+exit 1
+fi
+lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
+IFS=.; set $lt_version; IFS=' '
+lt_status="good"
+if test "$1" = "1"; then
+ if test "$2" -lt "4"; then
+ lt_status="bad"
+ fi
+fi
+if test $lt_status = "good"; then
+ echo "buildconf: libtool version $lt_pversion (ok)"
+ exit 0
+fi
+
+echo "buildconf: libtool version $lt_pversion found."
+echo " You need libtool version 1.4 or newer installed"
+echo " to build APR from SVN."
+
+exit 1
Property changes on: build/buildcheck.sh
___________________________________________________________________
Added: svn:executable
+ *
Index: build/PrintPath
===================================================================
--- build/PrintPath (revision 0)
+++ build/PrintPath (revision 0)
@@ -0,0 +1,130 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+# Look for program[s] somewhere in $PATH.
+#
+# Options:
+# -s
+# Do not print out full pathname. (silent)
+# -pPATHNAME
+# Look in PATHNAME instead of $PATH
+#
+# Usage:
+# PrintPath [-s] [-pPATHNAME] program [program ...]
+#
+# Initially written by Jim Jagielski for the Apache configuration mechanism
+# (with kudos to Kernighan/Pike)
+
+##
+# Some "constants"
+##
+pathname=$PATH
+echo="yes"
+
+##
+# Find out what OS we are running for later on
+##
+os=`(uname) 2>/dev/null`
+
+##
+# Parse command line
+##
+for args in $*
+do
+ case $args in
+ -s ) echo="no" ;;
+ -p* ) pathname="`echo $args | sed 's/^..//'`" ;;
+ * ) programs="$programs $args" ;;
+ esac
+done
+
+##
+# Now we make the adjustments required for OS/2 and everyone
+# else :)
+#
+# First of all, all OS/2 programs have the '.exe' extension.
+# Next, we adjust PATH (or what was given to us as PATH) to
+# be whitespace separated directories.
+# Finally, we try to determine the best flag to use for
+# test/[] to look for an executable file. OS/2 just has '-r'
+# but with other OSs, we do some funny stuff to check to see
+# if test/[] knows about -x, which is the prefered flag.
+##
+
+if [ "x$os" = "xOS/2" ]
+then
+ ext=".exe"
+ pathname=`echo -E $pathname |
+ sed 's/^;/.;/
+ s/;;/;.;/g
+ s/;$/;./
+ s/;/ /g
+ s/\\\\/\\//g' `
+ test_exec_flag="-r"
+else
+ ext="" # No default extensions
+ pathname=`echo $pathname |
+ sed 's/^:/.:/
+ s/::/:.:/g
+ s/:$/:./
+ s/:/ /g' `
+ # Here is how we test to see if test/[] can handle -x
+ testfile="pp.t.$$"
+
+ cat > $testfile <<ENDTEST
+#!/bin/sh
+if [ -x / ] || [ -x /bin ] || [ -x /bin/ls ]; then
+ exit 0
+fi
+exit 1
+ENDTEST
+
+ if `/bin/sh $testfile 2>/dev/null`; then
+ test_exec_flag="-x"
+ else
+ test_exec_flag="-r"
+ fi
+ rm -f $testfile
+fi
+
+for program in $programs
+do
+ for path in $pathname
+ do
+ if [ $test_exec_flag $path/${program}${ext} ] && \
+ [ ! -d $path/${program}${ext} ]; then
+ if [ "x$echo" = "xyes" ]; then
+ echo $path/${program}${ext}
+ fi
+ exit 0
+ fi
+
+# Next try without extension (if one was used above)
+ if [ "x$ext" != "x" ]; then
+ if [ $test_exec_flag $path/${program} ] && \
+ [ ! -d $path/${program} ]; then
+ if [ "x$echo" = "xyes" ]; then
+ echo $path/${program}
+ fi
+ exit 0
+ fi
+ fi
+ done
+done
+exit 1
+
Property changes on: build/PrintPath
___________________________________________________________________
Added: svn:executable
+ *
Index: buildconf
===================================================================
--- buildconf (revision 0)
+++ buildconf (revision 0)
@@ -0,0 +1,90 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+# buildconf: Build the support scripts needed to compile from a
+# checked-out version of the source code.
+
+# Verify that the builder has the right config tools installed
+#
+build/buildcheck.sh || exit 1
+
+libtoolize=`build/PrintPath glibtoolize libtoolize15 libtoolize14 libtoolize`
+if [ "x$libtoolize" = "x" ]; then
+ echo "libtoolize not found in path"
+ exit 1
+fi
+
+# Create the libtool helper files
+#
+# Note: we copy (rather than link) them to simplify distribution.
+# Note: APR supplies its own config.guess and config.sub -- we do not
+# rely on libtool's versions
+#
+echo "Copying libtool helper files ..."
+
+# Remove any libtool files so one can switch between libtool 1.3
+# and libtool 1.4 by simply rerunning the buildconf script.
+(cd build ; rm -f ltconfig ltmain.sh libtool.m4)
+
+$libtoolize --copy --automake
+
+if [ -f libtool.m4 ]; then
+ ltfile=`pwd`/libtool.m4
+else
+ ltfindcmd="`sed -n \"/=[^\\\`]/p;/libtool_m4=/{s/.*=/echo /p;q;}\" \
+ < $libtoolize`"
+ ltfile=${LIBTOOL_M4-`eval "$ltfindcmd"`}
+ # Expecting the code above to be very portable, but just in case...
+ if [ -z "$ltfile" -o ! -f "$ltfile" ]; then
+ ltpath=`dirname $libtoolize`
+ ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4
+ fi
+fi
+
+if [ ! -f $ltfile ]; then
+ echo "$ltfile not found"
+ exit 1
+fi
+
+echo "buildconf: Using libtool.m4 at ${ltfile}."
+
+cat $ltfile | sed -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/'
> build/libtool.m4
+
+# libtool.m4 from 1.6 requires ltsugar.m4
+if [ -f ltsugar.m4 ]; then
+ rm -f build/ltsugar.m4
+ mv ltsugar.m4 build/ltsugar.m4
+fi
+
+# Clean up any leftovers
+rm -f aclocal.m4 libtool.m4
+
+#
+# Generate the autoconf header and ./configure
+#
+echo "Creating include/arch/unix/apr_private.h.in ..."
+${AUTOHEADER:-autoheader}
+
+echo "Creating configure ..."
+### do some work to toss config.cache?
+${AUTOCONF:-autoconf}
+
+# Remove autoconf 2.5x's cache directory
+rm -rf autom4te*.cache
+
+exit 0
Property changes on: buildconf
___________________________________________________________________
Added: svn:executable
+ *
Index: bootstrap
===================================================================
--- bootstrap (revision 608009)
+++ bootstrap (working copy)
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if [ ! -d config ]; then
- mkdir config
-fi
-
-aclocal -I config
-
-# heck, i'm lazy, let's just try both...
-glibtoolize --copy --force
-libtoolize --copy --force
-
-# this is just to get us install-sh, missing, and mkinstalldirs so configure
-# won't complain...
-automake --foreign --add-missing --copy >/dev/null 2>&1
-
-autoconf
-
-rm config/ltmain.sh
-rm -rf autom4te.cache
-rm aclocal.m4