From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] snort: new package
Date: Wed, 10 Jan 2018 11:12:19 +0100 [thread overview]
Message-ID: <20180110111219.10aeca4b@windsurf.lan> (raw)
In-Reply-To: <1515575890-29518-1-git-send-email-sergio.prado@e-labworks.com>
Hello,
On Wed, 10 Jan 2018 07:18:10 -0200, Sergio Prado wrote:
> diff --git a/package/snort/0001-Fix-cross-compilation-errors.patch b/package/snort/0001-Fix-cross-compilation-errors.patch
> new file mode 100644
> index 000000000000..b3cad44229c3
> --- /dev/null
> +++ b/package/snort/0001-Fix-cross-compilation-errors.patch
> @@ -0,0 +1,290 @@
> +From 0c3d43c5f189b24504a809af9eaa1d2741a18bea Mon Sep 17 00:00:00 2001
> +From: Sergio Prado <sergio.prado@e-labworks.com>
> +Date: Tue, 9 Jan 2018 22:24:40 -0200
> +Subject: [PATCH] Fix cross compilation errors
> +
> +Prevent configure script from trying to run programs in a cross
> +compilation environment.
> +
> +Also remove unsafe header/library path used in cross-compilation.
> +
> +Signed-off-by: Sergio Prado <sergio.prado@e-labworks.com>
> +---
> + configure.in | 160 +++++------------------------------------------------------
> + 1 file changed, 13 insertions(+), 147 deletions(-)
> +
> +diff --git a/configure.in b/configure.in
> +index 4b3a5dbbf450..13798ce80ae7 100644
> +--- a/configure.in
> ++++ b/configure.in
> +@@ -71,7 +71,6 @@ case "$host" in
> + linux="yes"
> + AC_DEFINE([LINUX],[1],[Define if Linux])
> + AC_SUBST(extra_incl)
> +- extra_incl="-I/usr/include/pcap"
> + ;;
> + *-hpux10*|*-hpux11*)
> + AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11])
> +@@ -282,21 +281,8 @@ AC_CHECK_TYPES([int8_t,int16_t,int32_t,int64_t])
> + AC_CHECK_TYPES([boolean])
> +
> + # In case INADDR_NONE is not defined (like on Solaris)
> +-have_inaddr_none="no"
> ++have_inaddr_none="yes"
> + AC_MSG_CHECKING([for INADDR_NONE])
> +-AC_RUN_IFELSE(
> +-[AC_LANG_PROGRAM(
> +-[[
> +-#include <sys/types.h>
> +-#include <netinet/in.h>
> +-#include <arpa/inet.h>
> +-]],
> +-[[
> +- if (inet_addr("10,5,2") == INADDR_NONE);
> +- return 0;
> +-]])],
> +-[have_inaddr_none="yes"],
> +-[have_inaddr_none="no"])
That's not the right way of fixing the problem, as your patch is not
upstreamable. The right way is to use AC_CACHE_CHECK(), so that you can
preseed the variable value from the environment to avoid the
AC_TRY_RUN() test, and still do the test if no value is preseeded in
the environment.
AC_CACHE_CHECK([whether ... is available], [have_inaddr_none],
[AC_RUN_IFELSE(......, [have_inaddr_none=yes], [have_inaddr_none=no])])
if test "x$have_inaddr_none" = "xno"; then
...
fi
With this in place, you can pass have_inaddr_none=yes in
SNORT_CONF_ENV. The configure script will skip the AC_RUN_IFELSE() test
and assume have_inaddr_none=yes is correct.
And if you do this, you can send the patch upstream.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2018-01-10 10:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 9:18 [Buildroot] [PATCH v2] snort: new package Sergio Prado
2018-01-10 10:12 ` Thomas Petazzoni [this message]
2018-01-10 10:18 ` Sergio Prado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180110111219.10aeca4b@windsurf.lan \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.