add --with-kernel-includes configure option to libnetfilter_queue
PATCH 1/1 add --with-kernel-includes configure option to libnetfilter_queue
Hi,
This adds the --with-kernel-includes configure option to libnetfilter_queue and creates a README. This option allows compiling with kernel headers not located at /usr/include.
configure.in renamed from configure.in.old +0 -0
@@ -19,14 +19,37 @@ esac
dnl Dependencies
LIBNFNETLINK_REQUIRED=0.0.38
- +
PKG_CHECK_MODULES(LIBNFNETLINK, libnfnetlink >= $LIBNFNETLINK_REQUIRED,,
AC_MSG_ERROR(Cannot find libnfnetlink >= $LIBNFNETLINK_REQUIRED))
- -CFLAGS="$CFLAGS $LIBNFNETLINK_CFLAGS"
+
LIBNFQUEUE_LIBS="$LIBNFNETLINK_LIBS"
- +AC_SUBST(LIBNFQUEUE_LIBS)
+dnl Allows compiling the library with kernel include headers not located +dnl at /usr/include
+AC_ARG_WITH([kernel-includes],
+ [AS_HELP_STRING([--with-kernel-includes=PATH], + [Path to kernel source include files @<:@default=/usr/include@:>@])], + [ + if test x$withval = xyes -o x$withval = x ; then
+ AC_MSG_ERROR(--with-kernel-includes must be given the path to your kernel source include files.)
+ fi
+ if ! test -d $withval ; then
+ AC_MSG_ERROR(The --with-kernel-includes path $withval is not a directory.)
+ fi
+ if ! test -d $withval/linux ; then
+ AC_MSG_ERROR(The --with-kernel-includes directory $withval must contain the directory 'linux'.)
+ fi
+ if ! test -r $withval/linux ; then
+ AC_MSG_ERROR(You must have read permissions for the kernel source include files.)
+ fi + KERNEL_INCLUDES=`(cd $withval; /bin/pwd)` + TMP_CFLAGS_OTHER=`$PKG_CONFIG libnfnetlink --cflags-only-other` + TMP_CFLAGS_I=`$PKG_CONFIG libnfnetlink --cflags-only-I` + CFLAGS="$CFLAGS $TMP_CFLAGS_OTHER -I$KERNEL_INCLUDES $TMP_CFLAGS_I"], + CFLAGS="$CFLAGS $LIBNFNETLINK_CFLAGS")
+
dnl Output the makefiles
AC_OUTPUT(Makefile include/Makefile include/libnetfilter_queue/Makefile src/Makefile utils/Makefile libnetfilter_queue.pc doxygen.cfg)
README renamed from README.old +45 -0
45 lines not on this page · raw message
Review
Quoted 12 lines · Bart De Schuymer
(quoted diff) +8
-0+dnl Allows compiling the library with kernel include headers not located +dnl at /usr/include +AC_ARG_WITH([kernel-includes], + [AS_HELP_STRING([--with-kernel-includes=PATH], + [Path to kernel source include files @<:@default=/usr/include@:>@])], + [ + if test x$withval = xyes -o x$withval = x ; then + AC_MSG_ERROR(--with-kernel-includes must be given the path to yourkernel source include files.)
(quoted diff) +2
-0+ fi + if ! test -d $withval ; then
I would say this should be
if test ! -d "$withval"
similarly below and for the other patches.
Quoted 2 lines
(quoted diff) +2
-0+ if ! test -d $withval/linux ; then + if ! test -r $withval/linux ; then