From 93e4c2a4a5d72af30dead4f31a3df00b63cbc3af Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Sat, 30 Jul 2005 20:32:58 +0000 Subject: shuffle files to new directory structure --- configure.in | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index ec3a15b..4aa6a8c 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,9 @@ dnl Process this file with autoconf to create configure. -AC_INIT(libnfnetlink.c) +AC_INIT + +AC_CANONICAL_SYSTEM + AM_INIT_AUTOMAKE(libnfnetlink, 0.10) AC_PROG_CC @@ -8,5 +11,51 @@ AC_EXEEXT AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) +case $target in +*-*-linux*) ;; +*) AC_MSG_ERROR([Linux only, dude!]);; +esac + + +dnl-------------------------------- + +AC_DEFUN([NF_KERNEL_SOURCE],[ + + if test "$with_kernel" = ""; then + KERNEL="`uname -r`" + else + KERNEL="$with_kernel" + fi + + THIS_PREFIX="" + for i in "/lib/modules/$KERNEL/build/include" "$KERNEL" "$KERNEL/include" "/usr/src/linux-$KERNEL" "/usr/src/kernel-$KERNEL" "/usr/src/linux-headers-$KERNEL" "/usr/src/kernel-headers-$KERNEL" + do + AC_MSG_CHECKING([Looking for kernel source or headers in $i]) + if test -r "$i/linux/config.h" + then + THIS_PREFIX="$i" + AC_MSG_RESULT([found]) + break + fi + AC_MSG_RESULT([ ]) + done + if test -r "$THIS_PREFIX/linux/config.h" ; then + AC_SUBST(KERNELDIR,[$THIS_PREFIX]) + AC_MSG_RESULT([found]) + else + AC_MSG_ERROR([not found $THIS_PREFIX]) + fi + + # somehow add this as an include path +]) + +AC_ARG_WITH(kernel, + AC_HELP_STRING([--with-kernel=DIR], + [ Show location of kernel source. Default is to use uname -r and look in /lib/modules/KERNEL/build/include. ]), + NF_KERNEL_SOURCE($with_kernel),NF_KERNEL_SOURCE()) + +dnl-------------------------------- + + dnl Output the makefile -AC_OUTPUT(Makefile) +AC_OUTPUT(Makefile src/Makefile include/Makefile include/libnfnetlink/Makefile) -- cgit v1.2.3