From: Victor Julien Date: Wed, 10 Jul 2013 13:10:32 +0000 (+0200) Subject: Autotools: move libhtp conditionals to configure X-Git-Tag: suricata-2.0beta1~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aafc65c7578f5cdd1b6159f61e98cb1923fc0358;p=thirdparty%2Fsuricata.git 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. --- diff --git a/Makefile.am b/Makefile.am index e9b55c6e51..20b06aea46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,9 +5,6 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = ChangeLog COPYING LICENSE suricata.yaml.in \ classification.config threshold.config \ reference.config -if BUILD_LIBHTP - HTP_DIR = libhtp -endif SUBDIRS = $(HTP_DIR) src qa rules doc contrib scripts install-data-am: diff --git a/configure.ac b/configure.ac index 6493729fee..680904871c 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) ) ]) - # even if we are using an installed htp lib we still need to gen Makefiles inside of htp - AC_CONFIG_SUBDIRS([libhtp]) - AM_CONDITIONAL([BUILD_LIBHTP], [test "x$enable_non_bundled_htp" = "xno"]) - AS_IF([test "x$enable_non_bundled_htp" = "xno"], [ - 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]) - ]) + if test "x$enable_non_bundled_htp" = "xno"; then + # test if we have a bundled htp + if test -d "$srcdir/libhtp"; then + AC_CONFIG_SUBDIRS([libhtp]) + HTP_DIR="libhtp" + AC_SUBST(HTP_DIR) + 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= and --with-libhtp-libraries= if" + echo " libhtp is not installed in the include and library paths." + echo + exit 1 + fi + fi # enable CUDA output diff --git a/src/Makefile.am b/src/Makefile.am index 85c28a87e8..ddf8d3740c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -342,11 +342,7 @@ INCLUDES= $(all_includes) # the library search path. suricata_LDFLAGS = $(all_libraries) - -if BUILD_LIBHTP -suricata_LDADD = $(top_builddir)/libhtp/htp/libhtp.la -INCLUDES += -I$(top_srcdir)/libhtp -endif +suricata_LDADD = $(HTP_LDADD) # Rules to build CUDA ptx modules if BUILD_CUDA