mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Cleanup configure script and add back unit tests (make test).
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
# Makefile for ModSecurity
|
# Makefile for ModSecurity
|
||||||
|
|
||||||
APXS=@APXS@
|
|
||||||
|
|
||||||
MOD_SECURITY2 = mod_security2 apache2_config apache2_io apache2_util \
|
MOD_SECURITY2 = mod_security2 apache2_config apache2_io apache2_util \
|
||||||
re re_operators re_actions re_tfns re_variables \
|
re re_operators re_actions re_tfns re_variables \
|
||||||
msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre \
|
msc_logging msc_xml msc_multipart modsecurity msc_parsers msc_util msc_pcre \
|
||||||
@@ -11,8 +9,15 @@ 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
|
||||||
EXTRA_CFLAGS = -Wc,-O2 -Wc,-g -Wc,-Wall -Wc,-Werror
|
EXTRA_CFLAGS = -Wc,-O2 -Wc,-g -Wc,-Wall -Wc,-Werror
|
||||||
#EXTRA_CFLAGS = -Wc,-O2 -Wc,-g -Wc,-Wuninitialized -Wc,-Wall -Wc,-Werror -Wc,-Wmissing-prototypes -Wc,-Wshadow -Wc,-Wunused-variable -Wc,-Wunused-value -Wc,-Wchar-subscripts -Wc,-Wsign-compare
|
|
||||||
|
|
||||||
|
APXS = @APXS@
|
||||||
|
APXS_INCLUDES = @APXS_INCLUDES@
|
||||||
|
APXS_CFLAGS = @APXS_CFLAGS@
|
||||||
|
APXS_LDFLAGS = @APXS_LDFLAGS@
|
||||||
|
APXS_LIBS = @APXS_LIBS@
|
||||||
|
|
||||||
PCRE_CFLAGS = @PCRE_CFLAGS@
|
PCRE_CFLAGS = @PCRE_CFLAGS@
|
||||||
PCRE_LIBS = @PCRE_LIBS@
|
PCRE_LIBS = @PCRE_LIBS@
|
||||||
@@ -23,7 +28,17 @@ LUA_LIBS = @LUA_LIBS@
|
|||||||
LIBXML_CFLAGS = @LIBXML_CFLAGS@
|
LIBXML_CFLAGS = @LIBXML_CFLAGS@
|
||||||
LIBXML_LIBS = @LIBXML_LIBS@
|
LIBXML_LIBS = @LIBXML_LIBS@
|
||||||
|
|
||||||
CPPFLAGS=$(PCRE_CFLAGS) $(LIBXML_CFLAGS) $(LUA_CFLAGS) $(EXTRA_CFLAGS)
|
APR_CFLAGS = @APR_CFLAGS@
|
||||||
|
APR_LDFLAGS = @APR_LDFLAGS@
|
||||||
|
APR_LIBS = @APR_LIBS@
|
||||||
|
APR_LINK_LD = @APR_LINK_LD@
|
||||||
|
|
||||||
|
APU_CFLAGS = @APU_CFLAGS@
|
||||||
|
APU_LDFLAGS = @APU_LDFLAGS@
|
||||||
|
APU_LIBS = @APU_LIBS@
|
||||||
|
APU_LINK_LD = @APU_LINK_LD@
|
||||||
|
|
||||||
|
CPPFLAGS=$(PCRE_CFLAGS) $(LIBXML_CFLAGS) $(LUA_CFLAGS)
|
||||||
LIBS=$(PCRE_LIBS) $(LIBXML_LIBS) $(LUA_LIBS)
|
LIBS=$(PCRE_LIBS) $(LIBXML_LIBS) $(LUA_LIBS)
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
|
||||||
@@ -36,7 +51,7 @@ all: mod_security2.la
|
|||||||
install: install-mods
|
install: install-mods
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf *.la *.lo *.o *.slo .libs
|
@rm -rf *.la *.lo *.o *.slo .libs msc_test
|
||||||
|
|
||||||
maintainer-clean: clean
|
maintainer-clean: clean
|
||||||
@rm -rf Makefile config config.log config.status configure mod_security2_config.h
|
@rm -rf Makefile config config.log config.status configure mod_security2_config.h
|
||||||
@@ -46,16 +61,32 @@ dist-clean: maintainer-clean
|
|||||||
install-mods: mod_security2.la
|
install-mods: mod_security2.la
|
||||||
$(INSTALL_MOD_SHARED) mod_security2.la
|
$(INSTALL_MOD_SHARED) mod_security2.la
|
||||||
|
|
||||||
${MOD_SECURITY2:=.slo}: ${MOD_SECURITY2_H}
|
${MOD_SECURITY2:=.slo}: $(MOD_SECURITY2_H)
|
||||||
|
${MOD_SECURITY2:=.lo}: $(MOD_SECURITY2_H)
|
||||||
|
${MOD_SECURITY2:=.o}: $(MOD_SECURITY2_H})
|
||||||
|
|
||||||
${MOD_SECURITY2:=.lo}: ${MOD_SECURITY2_H}
|
mod_security2.la: $(MOD_SECURITY2_H) *.c
|
||||||
|
|
||||||
${MOD_SECURITY2:=.o}: ${MOD_SECURITY2_H}
|
|
||||||
|
|
||||||
mod_security2.la: ${MOD_SECURITY2:=.slo}
|
|
||||||
@src=""; \
|
@src=""; \
|
||||||
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) $$src
|
echo "$(COMPILE_APACHE_MOD) $(EXTRA_CFLAGS) $$src"; \
|
||||||
|
$(COMPILE_APACHE_MOD) $(EXTRA_CFLAGS) $$src
|
||||||
|
|
||||||
|
### Experimental Test Framework (UNIX only right now)
|
||||||
|
TESTOBJS = re.o re_operators.o re_actions.o re_tfns.o re_variables.o \
|
||||||
|
msc_logging.o msc_xml.o msc_multipart.o modsecurity.o \
|
||||||
|
msc_parsers.o msc_util.o msc_pcre.o persist_dbm.o \
|
||||||
|
msc_reqbody.o msc_geo.o acmp.o msc_lua.o
|
||||||
|
|
||||||
|
msc_test: mod_security2.la msc_test.c
|
||||||
|
@cflags=""; \
|
||||||
|
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
|
||||||
|
@t/run-tests.pl
|
||||||
|
|
||||||
|
@@ -2,11 +2,15 @@ dnl Check for APR Libraries
|
|||||||
dnl CHECK_APR(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
|
dnl CHECK_APR(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
|
||||||
dnl Sets:
|
dnl Sets:
|
||||||
dnl APR_CFLAGS
|
dnl APR_CFLAGS
|
||||||
|
dnl APR_LDFLAGS
|
||||||
dnl APR_LIBS
|
dnl APR_LIBS
|
||||||
|
dnl APR_LINK_LD
|
||||||
|
|
||||||
APR_CONFIG="apr-config"
|
APR_CONFIG="apr-config"
|
||||||
APR_CFLAGS=""
|
APR_CFLAGS=""
|
||||||
|
APR_LDFLAGS=""
|
||||||
APR_LIBS=""
|
APR_LIBS=""
|
||||||
|
APR_LINK_LD=""
|
||||||
|
|
||||||
AC_DEFUN([CHECK_APR],
|
AC_DEFUN([CHECK_APR],
|
||||||
[dnl
|
[dnl
|
||||||
@@ -36,8 +40,10 @@ done
|
|||||||
if test -n "${with_apr}"; then
|
if test -n "${with_apr}"; then
|
||||||
APR_CONFIG="${with_apr}/bin/${APR_CONFIG}"
|
APR_CONFIG="${with_apr}/bin/${APR_CONFIG}"
|
||||||
AC_MSG_RESULT([${APR_CONFIG}])
|
AC_MSG_RESULT([${APR_CONFIG}])
|
||||||
APR_CFLAGS="`${APR_CONFIG} --cflags`"
|
APR_CFLAGS="`${APR_CONFIG} --includes`"
|
||||||
|
APR_LDFLAGS="`${APR_CONFIG} --ldflags`"
|
||||||
APR_LIBS="`${APR_CONFIG} --libs`"
|
APR_LIBS="`${APR_CONFIG} --libs`"
|
||||||
|
APR_LINK_LD="`${APR_CONFIG} --link-ld`"
|
||||||
CFLAGS=$save_CFLAGS
|
CFLAGS=$save_CFLAGS
|
||||||
LDFLAGS=$save_LDFLAGS
|
LDFLAGS=$save_LDFLAGS
|
||||||
else
|
else
|
||||||
@@ -46,6 +52,8 @@ fi
|
|||||||
|
|
||||||
AC_SUBST(APR_LIBS)
|
AC_SUBST(APR_LIBS)
|
||||||
AC_SUBST(APR_CFLAGS)
|
AC_SUBST(APR_CFLAGS)
|
||||||
|
AC_SUBST(APR_LDFLAGS)
|
||||||
|
AC_SUBST(APR_LINK_LD)
|
||||||
|
|
||||||
if test -z "${APR_LIBS}"; then
|
if test -z "${APR_LIBS}"; then
|
||||||
AC_MSG_NOTICE([*** apr library not found.])
|
AC_MSG_NOTICE([*** apr library not found.])
|
||||||
|
@@ -2,11 +2,15 @@ dnl Check for APU Libraries
|
|||||||
dnl CHECK_APU(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
|
dnl CHECK_APU(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
|
||||||
dnl Sets:
|
dnl Sets:
|
||||||
dnl APU_CFLAGS
|
dnl APU_CFLAGS
|
||||||
|
dnl APU_LDFLAGS
|
||||||
dnl APU_LIBS
|
dnl APU_LIBS
|
||||||
|
dnl APU_LINK_LD
|
||||||
|
|
||||||
APU_CONFIG="apu-1-config"
|
APU_CONFIG="apu-1-config"
|
||||||
APU_CFLAGS=""
|
APU_CFLAGS=""
|
||||||
|
APU_LDFLAGS=""
|
||||||
APU_LIBS=""
|
APU_LIBS=""
|
||||||
|
APU_LINK_LD=""
|
||||||
|
|
||||||
AC_DEFUN([CHECK_APU],
|
AC_DEFUN([CHECK_APU],
|
||||||
[dnl
|
[dnl
|
||||||
@@ -36,8 +40,10 @@ done
|
|||||||
if test -n "${with_apu}"; then
|
if test -n "${with_apu}"; then
|
||||||
APU_CONFIG="${with_apu}/bin/${APU_CONFIG}"
|
APU_CONFIG="${with_apu}/bin/${APU_CONFIG}"
|
||||||
AC_MSG_RESULT([${APU_CONFIG}])
|
AC_MSG_RESULT([${APU_CONFIG}])
|
||||||
APU_CFLAGS="`${APU_CONFIG} --cflags`"
|
APU_CFLAGS="`${APU_CONFIG} --includes`"
|
||||||
|
APU_LDFLAGS="`${APU_CONFIG} --ldflags`"
|
||||||
APU_LIBS="`${APU_CONFIG} --libs`"
|
APU_LIBS="`${APU_CONFIG} --libs`"
|
||||||
|
APU_LINK_LD="`${APU_CONFIG} --link-ld`"
|
||||||
CFLAGS=$save_CFLAGS
|
CFLAGS=$save_CFLAGS
|
||||||
LDFLAGS=$save_LDFLAGS
|
LDFLAGS=$save_LDFLAGS
|
||||||
else
|
else
|
||||||
@@ -46,6 +52,8 @@ fi
|
|||||||
|
|
||||||
AC_SUBST(APU_LIBS)
|
AC_SUBST(APU_LIBS)
|
||||||
AC_SUBST(APU_CFLAGS)
|
AC_SUBST(APU_CFLAGS)
|
||||||
|
AC_SUBST(APU_LDFLAGS)
|
||||||
|
AC_SUBST(APU_LINK_LD)
|
||||||
|
|
||||||
if test -z "${APU_LIBS}"; then
|
if test -z "${APU_LIBS}"; then
|
||||||
AC_MSG_NOTICE([*** apu library not found.])
|
AC_MSG_NOTICE([*** apu library not found.])
|
||||||
|
@@ -62,20 +62,30 @@ 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_CFLAGS="`$APXS -q CFLAGS`"
|
||||||
|
APXS_LDFLAGS="`$APXS -q LDFLAGS`"
|
||||||
|
APXS_LIBS="`$APXS -q LIBS`"
|
||||||
|
AC_MSG_NOTICE([APXS_INCLUDES=${APXS_INCLUDES}])
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR(couldn't find APXS)
|
AC_MSG_ERROR(couldn't find APXS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CHECK_PCRE()
|
|
||||||
CHECK_LUA()
|
|
||||||
CHECK_LIBXML()
|
|
||||||
|
|
||||||
save_CPPFLAGS=$CPPFLAGS
|
save_CPPFLAGS=$CPPFLAGS
|
||||||
APXS_INCLUDES="`$APXS -q EXTRA_INCLUDES`"
|
|
||||||
CPPFLAGS="$APXS_INCLUDES $CPPFLAGS"
|
CPPFLAGS="$APXS_INCLUDES $CPPFLAGS"
|
||||||
CPPFLAGS=$save_CPPFLAGS
|
CPPFLAGS=$save_CPPFLAGS
|
||||||
|
|
||||||
AC_SUBST(APXS)
|
AC_SUBST(APXS)
|
||||||
|
AC_SUBST(APXS_INCLUDES)
|
||||||
|
AC_SUBST(APXS_CFLAGS)
|
||||||
|
AC_SUBST(APXS_LDFLAGS)
|
||||||
|
AC_SUBST(APXS_LIBS)
|
||||||
|
|
||||||
|
CHECK_PCRE()
|
||||||
|
CHECK_LUA()
|
||||||
|
CHECK_LIBXML()
|
||||||
|
CHECK_APR()
|
||||||
|
CHECK_APU()
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user