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.
pull/10496/head
Jason Ish 2 years ago committed by Victor Julien
parent 69f0e85785
commit 5ed3f905ac

@ -1660,6 +1660,7 @@
fi
fi
AM_CONDITIONAL([HTP_LDADD], [test "x${HTP_LDADD}" != "x"])
# Check for libcap-ng
case $host in

@ -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)

Loading…
Cancel
Save