Source: suricata
Version: 1:4.0.4-1
Tags: patch
User: [email protected]
Usertags: rebootstrap

suricata fails to cross build from source for a number of reasons. For
two of them I understood the cause and am attaching a patch. Please
consider applying them even though suricata will continue to fail cross
building.

For one thing debian/rules uses dpkg --print-architecture as the host
architecture. That's wrong. DEB_HOST_ARCH is the variable you are
looking for. The present code tries to enable luajit when cross building
for ppc64el without installing luajit.

The other issue described in lintian warning
autotools-pkg-config-macro-not-cross-compilation-safe. Applying this
patch makes the lintian warning go away.

Please close this bug when addressing these issues even though suricata
will continue to fail cross building.

Helmut
--- a/debian/rules
+++ b/debian/rules
@@ -6,17 +6,16 @@
 SURICATA_DESTDIR = $(CURDIR)/debian/suricata
 export DEB_BUILD_MAINT_OPTIONS=hardening=+pie,+bindnow
 
-ARCH ?= $(shell dpkg --print-architecture)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+include /usr/share/dpkg/architecture.mk
 
 LUAJIT_ARCHS = i386 amd64 powerpc mips mipsel armel armhf
 HYPERSCAN_ARCHS = i386 amd64 hurd-i386 kfreebsd-amd64 x32
 
-ifneq (,$(findstring $(ARCH),$(LUAJIT_ARCHS)))
+ifneq (,$(findstring $(DEB_HOST_ARCH),$(LUAJIT_ARCHS)))
 	ENABLE_LUAJIT="--enable-luajit"
 endif
 
-ifneq (,$(findstring $(ARCH),$(HYPERSCAN_ARCHS)))
+ifneq (,$(findstring $(DEB_HOST_ARCH),$(HYPERSCAN_ARCHS)))
 	ENABLE_HYPERSCAN="--enable-libhs"
 endif
 
Index: suricata-4.0.4/configure.ac
===================================================================
--- suricata-4.0.4.orig/configure.ac
+++ suricata-4.0.4/configure.ac
@@ -75,8 +75,8 @@
     AC_PROG_LN_S
     AC_PROG_MAKE_SET
 
-    AC_PATH_PROG(HAVE_PKG_CONFIG, pkg-config, "no")
-    if test "$HAVE_PKG_CONFIG" = "no"; then
+    PKG_PROG_PKG_CONFIG
+    if test "x$PKG_CONFIG" = "x"; then
         echo
         echo "   ERROR! pkg-config not found, go get it  "
         echo "   http://pkg-config.freedesktop.org/wiki/ "

Reply via email to