Add the ability to build mlogc if it is in the mlogc-src subdir.

This commit is contained in:
brectanus
2008-01-11 17:51:06 +00:00
parent b5033e6e29
commit 0a6ac05590
3 changed files with 52 additions and 26 deletions

View File

@@ -9,9 +9,13 @@ MOD_SECURITY2_H = re.h modsecurity.h msc_logging.h msc_multipart.h msc_parsers.h
msc_pcre.h msc_util.h msc_xml.h persist_dbm.h apache2.h pdf_protect.h \ msc_pcre.h msc_util.h msc_xml.h persist_dbm.h apache2.h pdf_protect.h \
msc_geo.h acmp.h utf8tables.h msc_lua.h msc_geo.h acmp.h utf8tables.h msc_lua.h
### Must be in APXS format: -Wc,-flag CC = @CC@
EXTRA_CFLAGS = @EXTRA_CFLAGS@ EXTRA_CFLAGS = @EXTRA_CFLAGS@
MODSEC_EXTRA_CFLAGS = @MODSEC_EXTRA_CFLAGS@
### Note: must be in APXS format: -Wc,-flag
APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
MODSEC_APXS_EXTRA_CFLAGS = @MODSEC_APXS_EXTRA_CFLAGS@
APXS = @APXS@ APXS = @APXS@
APXS_INCLUDES = @APXS_INCLUDES@ APXS_INCLUDES = @APXS_INCLUDES@
@@ -50,7 +54,13 @@ all: mod_security2.la
install: install-mods install: install-mods
clean: clean-extras:
@for dir in mlogc-src; do \
test -e $$dir && $(MAKE) -C $$dir clean; \
done;
rm -rf mlogc mlogc-static
clean: clean-extras
@rm -rf *.la *.lo *.o *.slo .libs msc_test @rm -rf *.la *.lo *.o *.slo .libs msc_test
maintainer-clean: clean maintainer-clean: clean
@@ -70,7 +80,7 @@ mod_security2.la: $(MOD_SECURITY2_H) *.c
for f in $(MOD_SECURITY2); do \ for f in $(MOD_SECURITY2); do \
src="$$src $$f.c"; \ src="$$src $$f.c"; \
done; \ done; \
$(COMPILE_APACHE_MOD) $(EXTRA_CFLAGS) $$src $(COMPILE_APACHE_MOD) $(APXS_EXTRA_CFLAGS) $(MODSEC_APXS_EXTRA_CFLAGS) $$src
### Experimental Test Framework (UNIX only right now) ### Experimental Test Framework (UNIX only right now)
TESTOBJS = re.o re_operators.o re_actions.o re_tfns.o re_variables.o \ TESTOBJS = re.o re_operators.o re_actions.o re_tfns.o re_variables.o \
@@ -79,13 +89,15 @@ TESTOBJS = re.o re_operators.o re_actions.o re_tfns.o re_variables.o \
msc_reqbody.o msc_geo.o acmp.o msc_lua.o msc_reqbody.o msc_geo.o acmp.o msc_lua.o
msc_test: mod_security2.la msc_test.c msc_test: mod_security2.la msc_test.c
@cflags=""; \ $(CC) $(CPPFLAGS) $(LDFLAGS) $(APXS_INCLUDES) $(EXTRA_CFLAGS) $(MODSEC_EXTRA_CFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test $(TESTOBJS) msc_test.c $(LIBS) $(APR_LIBS) $(APU_LIBS) $(APXS_LIBS) $(APR_LINK_LD) $(APU_LINK_LD)
for f in $(EXTRA_CFLAGS); do \
F=`echo $$f | cut -c 5-`; \
cflags="$$cflags $$F"; \
done; \
$(CC) $(CPPFLAGS) $(LDFLAGS) $(APXS_INCLUDES) $$cflags $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test $(TESTOBJS) msc_test.c $(LIBS) $(APR_LIBS) $(APU_LIBS) $(APXS_LIBS) $(APR_LINK_LD) $(APU_LINK_LD)
test: msc_test test: msc_test
@t/run-tests.pl @t/run-tests.pl
mlogc:
@$(MAKE) -C mlogc-src mlogc \
&& cp -p mlogc-src/mlogc .
mlogc-static:
@$(MAKE) -C mlogc-src static \
&& cp -p mlogc-src/mlogc mlogc-static

View File

@@ -45,7 +45,7 @@ done
if test -n "${with_apr}"; then if test -n "${with_apr}"; then
APR_CONFIG="${with_apr}/${APR_CONFIG}" APR_CONFIG="${with_apr}/${APR_CONFIG}"
AC_MSG_RESULT([${APR_CONFIG}]) AC_MSG_RESULT([${APR_CONFIG}])
APR_CFLAGS="`${APR_CONFIG} --includes`" APR_CFLAGS="`${APR_CONFIG} --includes --cppflags`"
APR_LDFLAGS="`${APR_CONFIG} --ldflags`" APR_LDFLAGS="`${APR_CONFIG} --ldflags`"
APR_LIBS="`${APR_CONFIG} --libs`" APR_LIBS="`${APR_CONFIG} --libs`"
APR_LINK_LD="`${APR_CONFIG} --link-ld`" APR_LINK_LD="`${APR_CONFIG} --link-ld`"

View File

@@ -84,10 +84,10 @@ VERSION_OK
[AC_MSG_NOTICE(httpd is recent enough)], [AC_MSG_NOTICE(httpd is recent enough)],
[AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)]) [AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)])
fi fi
APXS_INCLUDES="`$APXS -q EXTRA_INCLUDES`" APXS_INCLUDES="`$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
APXS_CFLAGS="`$APXS -q CFLAGS`" APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q EXTRA_CFLAGS`"
APXS_LDFLAGS="`$APXS -q LDFLAGS`" APXS_LDFLAGS="`$APXS -q LDFLAGS` `$APXS -q EXTRA_LDFLAGS`"
APXS_LIBS="`$APXS -q LIBS`" APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
else else
AC_MSG_ERROR(couldn't find APXS) AC_MSG_ERROR(couldn't find APXS)
fi fi
@@ -112,11 +112,7 @@ sinclude(build/find_apr.m4)
sinclude(build/find_apu.m4) sinclude(build/find_apu.m4)
sinclude(build/find_xml.m4) sinclude(build/find_xml.m4)
sinclude(build/find_lua.m4) sinclude(build/find_lua.m4)
sinclude(build/find_curl.m4)
### Defaults
EXTRA_CFLAGS="-Wc,-O2 -Wc,-g -Wc,-Wall -Wc,-Werror"
### Configure Options ### Configure Options
@@ -127,7 +123,7 @@ AC_ARG_ENABLE(debug-conf,
[Enable debug during configuration.]), [Enable debug during configuration.]),
[ [
if test "$enableval" != "no"; then if test "$enableval" != "no"; then
debug_conf="-Wc,-DDEBUG_CONF" debug_conf="-DDEBUG_CONF"
else else
debug_conf= debug_conf=
fi fi
@@ -142,7 +138,7 @@ AC_ARG_ENABLE(debug-cache,
[Enable debug for transformation caching.]), [Enable debug for transformation caching.]),
[ [
if test "$enableval" != "no"; then if test "$enableval" != "no"; then
debug_cache="-Wc,-DCACHE_DEBUG" debug_cache="-DCACHE_DEBUG"
else else
debug_cache= debug_cache=
fi fi
@@ -157,7 +153,7 @@ AC_ARG_ENABLE(performance-measurement,
[Enable performance-measurement stats.]), [Enable performance-measurement stats.]),
[ [
if test "$enableval" != "no"; then if test "$enableval" != "no"; then
perf_meas="-Wc,-DPERFORMANCE_MEASUREMENT" perf_meas="-DPERFORMANCE_MEASUREMENT"
else else
perf_meas= perf_meas=
fi fi
@@ -172,7 +168,7 @@ AC_ARG_ENABLE(modsec-api,
[Disable the API; compiling against some older Apache versions require this.]), [Disable the API; compiling against some older Apache versions require this.]),
[ [
if test "$enableval" != "yes"; then if test "$enableval" != "yes"; then
modsec_api="-Wc,-DNO_MODSEC_API" modsec_api="-DNO_MODSEC_API"
else else
modsec_api= modsec_api=
fi fi
@@ -181,8 +177,19 @@ AC_ARG_ENABLE(modsec-api,
modsec_api= modsec_api=
]) ])
### Build *EXTRA_CFLAGS vars
EXTRA_CFLAGS="$EXTRA_CFLAGS $debug_conf $debug_cache $perf_meas $modsec_api" EXTRA_CFLAGS="-O2 -g -Wall -Werror"
MODSEC_EXTRA_CFLAGS="$debug_conf $debug_cache $perf_meas $modsec_api"
APXS_EXTRA_CFLAGS=""
for f in $EXTRA_CFLAGS; do
APXS_EXTRA_CFLAGS="$APXS_EXTRA_CFLAGS -Wc,$f"
done;
MODSEC_APXS_EXTRA_CFLAGS=""
for f in $MODSEC_EXTRA_CFLAGS; do
MODSEC_APXS_EXTRA_CFLAGS="$MODSEC_APXS_EXTRA_CFLAGS -Wc,$f"
done;
### Substitute the vars ### Substitute the vars
@@ -190,19 +197,26 @@ save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$APXS_INCLUDES $CPPFLAGS" CPPFLAGS="$APXS_INCLUDES $CPPFLAGS"
CPPFLAGS=$save_CPPFLAGS CPPFLAGS=$save_CPPFLAGS
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(MODSEC_EXTRA_CFLAGS)
AC_SUBST(APXS) AC_SUBST(APXS)
AC_SUBST(APXS_INCLUDES) AC_SUBST(APXS_INCLUDES)
AC_SUBST(APXS_CFLAGS) AC_SUBST(APXS_EXTRA_CFLAGS)
AC_SUBST(MODSEC_APXS_EXTRA_CFLAGS)
AC_SUBST(APXS_LDFLAGS) AC_SUBST(APXS_LDFLAGS)
AC_SUBST(APXS_LIBS) AC_SUBST(APXS_LIBS)
AC_SUBST(EXTRA_CFLAGS) AC_SUBST(APXS_CFLAGS)
CHECK_PCRE() CHECK_PCRE()
CHECK_APR() CHECK_APR()
CHECK_APU() CHECK_APU()
CHECK_LIBXML() CHECK_LIBXML()
CHECK_LUA() CHECK_LUA()
CHECK_CURL()
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
if test -e "mlogc-src/Makefile.in"; then
AC_CONFIG_FILES([mlogc-src/Makefile])
fi
AC_OUTPUT AC_OUTPUT