]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
examples/lib: work with bundled libhtp
authorJason Ish <jason.ish@oisf.net>
Thu, 22 Feb 2024 17:24:52 +0000 (11:24 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 24 Feb 2024 07:41:05 +0000 (08:41 +0100)
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.

configure.ac
examples/lib/simple/Makefile.am

index c342cb34d55105c8fe65b7c00ab8b813eedf4999..e2b437bc20d141b856a45857092f447adf606376 100644 (file)
         fi
     fi
 
+    AM_CONDITIONAL([HTP_LDADD], [test "x${HTP_LDADD}" != "x"])
 
   # Check for libcap-ng
     case $host in
index 9ebc9a358eb55b6ca141afb809ee8d7fe5c57812..afc6505c3baef08a036bbe81c10c110aca6de227 100644 (file)
@@ -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)