Skip to content

Commit

Permalink
Autotools: move libhtp conditionals to configure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
victorjulien committed Jul 11, 2013
1 parent 73e27c1 commit aafc65c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
3 changes: 0 additions & 3 deletions Makefile.am
Expand Up @@ -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:
Expand Down
32 changes: 24 additions & 8 deletions configure.ac
Expand Up @@ -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=<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
Expand Down
6 changes: 1 addition & 5 deletions src/Makefile.am
Expand Up @@ -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
Expand Down

0 comments on commit aafc65c

Please sign in to comment.