Wrap the apxs command so we can fix -R option not working on solaris.

This commit is contained in:
brectanus 2008-01-29 20:50:35 +00:00
parent d350c5f5d9
commit 764fe94ab0
3 changed files with 18 additions and 2 deletions

View File

@ -19,6 +19,7 @@ APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@
APXS = @APXS@
APXS_WRAPPER = @APXS_WRAPPER@
APXS_INCLUDES = @APXS_INCLUDES@
APXS_CFLAGS = @APXS_CFLAGS@
APXS_LDFLAGS = @APXS_LDFLAGS@
@ -47,9 +48,9 @@ CPPFLAGS=$(PCRE_CFLAGS) $(LIBXML_CFLAGS) $(LUA_CFLAGS)
LIBS=$(PCRE_LIBS) $(LIBXML_LIBS) $(LUA_LIBS)
LDFLAGS=
COMPILE_APACHE_MOD = $(APXS) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS)
COMPILE_APACHE_MOD = $(APXS_WRAPPER) -c $(CPPFLAGS) $(LDFLAGS) $(LIBS)
INSTALL_MOD_SHARED = $(APXS) -i
INSTALL_MOD_SHARED = $(APXS_WRAPPER) -i
all: mod_security2.la

12
apache2/build/apxs-wrapper.in Executable file
View File

@ -0,0 +1,12 @@
#!@SHELL@
WRAPPED_OPTS=""
for opt in "$@"; do
case "$opt" in
# Fix for -R not working w/apxs
-R*) WRAPPED_OPTS="$WRAPPED_OPTS -Wl,$opt" ;;
*) WRAPPED_OPTS="$WRAPPED_OPTS $opt" ;;
esac
done
exec @APXS@ $WRAPPED_OPTS

View File

@ -202,6 +202,7 @@ AC_ARG_ENABLE(modsec-api,
EXTRA_CFLAGS="-O2 -g -Wall -Werror"
MODSEC_EXTRA_CFLAGS="$debug_conf $debug_cache $debug_acmp $perf_meas $modsec_api"
APXS_WRAPPER=build/apxs-wrapper
APXS_EXTRA_CFLAGS=""
for f in $EXTRA_CFLAGS; do
APXS_EXTRA_CFLAGS="$APXS_EXTRA_CFLAGS -Wc,$f"
@ -220,6 +221,7 @@ CPPFLAGS=$save_CPPFLAGS
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(MODSEC_EXTRA_CFLAGS)
AC_SUBST(APXS)
AC_SUBST(APXS_WRAPPER)
AC_SUBST(APXS_INCLUDES)
AC_SUBST(APXS_EXTRA_CFLAGS)
AC_SUBST(MODSEC_APXS_EXTRA_CFLAGS)
@ -235,6 +237,7 @@ CHECK_LUA()
CHECK_CURL()
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([build/apxs-wrapper], [chmod +x build/apxs-wrapper])
if test -e "$PERL"; then
AC_CONFIG_FILES([t/run-tests.pl], [chmod +x t/run-tests.pl])