From: Jason Ish Date: Thu, 22 Feb 2024 17:24:52 +0000 (-0600) Subject: examples/lib: work with bundled libhtp X-Git-Tag: suricata-8.0.0-beta1~1717 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ed3f905acf41eafd1ec276c2cd1331d17da5eec;p=thirdparty%2Fsuricata.git examples/lib: work with bundled libhtp The simple example Makefile.am was unconditionally including $(HTP_LDADD) which might be empty resulting in "../.." ending up in the Makefile causing the build to fail. Instead, also make HTP_LDADD a conditional, so we can only include it when actually set, and its only set when libhtp is bundled. The reason this Makefile needs to include the path components "../.." is because the HTP_LDADD value is relative to the top level "src/" directory. --- diff --git a/configure.ac b/configure.ac index c342cb34d5..e2b437bc20 100644 --- a/configure.ac +++ b/configure.ac @@ -1660,6 +1660,7 @@ fi fi + AM_CONDITIONAL([HTP_LDADD], [test "x${HTP_LDADD}" != "x"]) # Check for libcap-ng case $host in diff --git a/examples/lib/simple/Makefile.am b/examples/lib/simple/Makefile.am index 9ebc9a358e..afc6505c3b 100644 --- a/examples/lib/simple/Makefile.am +++ b/examples/lib/simple/Makefile.am @@ -5,5 +5,8 @@ simple_SOURCES = main.c AM_CPPFLAGS = -I$(top_srcdir)/src simple_LDFLAGS = $(all_libraries) $(SECLDFLAGS) -simple_LDADD = $(top_builddir)/src/libsuricata_c.a ../../$(RUST_SURICATA_LIB) ../../$(HTP_LDADD) $(RUST_LDADD) +simple_LDADD = $(top_builddir)/src/libsuricata_c.a ../../$(RUST_SURICATA_LIB) $(RUST_LDADD) +if HTP_LDADD +simple_LDADD += ../../$(HTP_LDADD) +endif simple_DEPENDENCIES = $(top_builddir)/src/libsuricata_c.a ../../$(RUST_SURICATA_LIB)