Autotools: move libhtp conditionals to configure

In preparation of the libhtp upgrade, move all libhtp related conditionals
to configure. This allows for one set of build scripts that works regardless
of the presence of a local libhtp dir.
pull/421/merge
Victor Julien 13 years ago
parent 73e27c1fb7
commit aafc65c757

@ -5,9 +5,6 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml.in \ EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml.in \
classification.config threshold.config \ classification.config threshold.config \
reference.config reference.config
if BUILD_LIBHTP
HTP_DIR = libhtp
endif
SUBDIRS = $(HTP_DIR) src qa rules doc contrib scripts SUBDIRS = $(HTP_DIR) src qa rules doc contrib scripts
install-data-am: install-data-am:

@ -1072,14 +1072,30 @@ AC_INIT(configure.ac)
AC_EGREP_HEADER(htp_config_set_path_decode_u_encoding, htp/htp.h, AC_DEFINE_UNQUOTED([HAVE_HTP_SET_PATH_DECODE_U_ENCODING],[1],[Found usable htp_config_set_path_decode_u_encoding function in libhtp]) ) AC_EGREP_HEADER(htp_config_set_path_decode_u_encoding, htp/htp.h, AC_DEFINE_UNQUOTED([HAVE_HTP_SET_PATH_DECODE_U_ENCODING],[1],[Found usable htp_config_set_path_decode_u_encoding function in libhtp]) )
]) ])
# even if we are using an installed htp lib we still need to gen Makefiles inside of htp if test "x$enable_non_bundled_htp" = "xno"; then
AC_CONFIG_SUBDIRS([libhtp]) # test if we have a bundled htp
AM_CONDITIONAL([BUILD_LIBHTP], [test "x$enable_non_bundled_htp" = "xno"]) if test -d "$srcdir/libhtp"; then
AS_IF([test "x$enable_non_bundled_htp" = "xno"], [ AC_CONFIG_SUBDIRS([libhtp])
AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Assuming htp_config_register_request_uri_normalize function in bundled libhtp]) HTP_DIR="libhtp"
AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Assuming htp_tx_get_response_headers_raw function in bundled libhtp]) AC_SUBST(HTP_DIR)
AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Assuming htp_decode_query_inplace function in bundled libhtp]) HTP_LDADD="../libhtp/htp/libhtp.la"
]) AC_SUBST(HTP_LDADD)
# make sure libhtp is added to the includes
CPPFLAGS="${CPPFLAGS} -I${srcdir}/../libhtp/"
AC_DEFINE_UNQUOTED([HAVE_HTP_URI_NORMALIZE_HOOK],[1],[Assuming htp_config_register_request_uri_normalize function in bundled libhtp])
AC_DEFINE_UNQUOTED([HAVE_HTP_TX_GET_RESPONSE_HEADERS_RAW],[1],[Assuming htp_tx_get_response_headers_raw function in bundled libhtp])
AC_DEFINE_UNQUOTED([HAVE_HTP_DECODE_QUERY_INPLACE],[1],[Assuming htp_decode_query_inplace function in bundled libhtp])
else
echo
echo " ERROR: Libhtp is not bundled. Get libhtp from https://github.com/ironbee/libhtp"
echo " and pass --enable-non-bundled-htp to Suricata's configure script."
echo " Add --with-libhtp-includes=<dir> and --with-libhtp-libraries=<dir> if"
echo " libhtp is not installed in the include and library paths."
echo
exit 1
fi
fi
# enable CUDA output # enable CUDA output

@ -342,11 +342,7 @@ INCLUDES= $(all_includes)
# the library search path. # the library search path.
suricata_LDFLAGS = $(all_libraries) suricata_LDFLAGS = $(all_libraries)
suricata_LDADD = $(HTP_LDADD)
if BUILD_LIBHTP
suricata_LDADD = $(top_builddir)/libhtp/htp/libhtp.la
INCLUDES += -I$(top_srcdir)/libhtp
endif
# Rules to build CUDA ptx modules # Rules to build CUDA ptx modules
if BUILD_CUDA if BUILD_CUDA

Loading…
Cancel
Save