summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore20
-rw-r--r--Makefile.am2
-rwxr-xr-xautogen.sh18
-rw-r--r--configure.ac36
-rw-r--r--lib/Makefile.am4
-rw-r--r--m4/.gitignore2
-rw-r--r--src/.gitignore1
7 files changed, 49 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9f6660e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+*~
+*.la
+*.lo
+*.o
+.deps
+.libs
+Makefile
+Makefile.in
+
+/aclocal.m4
+/autom4te.cache
+/compile
+/config.*
+/configure
+/depcomp
+/install-sh
+/libtool
+/ltmain.sh
+/missing
+/stamp-h1
diff --git a/Makefile.am b/Makefile.am
index 2ddb5c9..c68544a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
+
include $(top_srcdir)/Make_global.am
if ! WITH_KBUILDDIR
diff --git a/autogen.sh b/autogen.sh
index d65b0b7..72240f7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,18 +1,4 @@
#!/bin/sh
-run ()
-{
- echo "running: $*"
- eval $*
-
- if test $? != 0 ; then
- echo "error: while running '$*'"
- exit 1
- fi
-}
-
-run aclocal
-run autoheader
-run libtoolize -f
-run automake -a
-run autoconf
+autoreconf -fi
+rm -Rf autom4te.cache
diff --git a/configure.ac b/configure.ac
index 7622ac4..0bff332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,9 @@
dnl Boilerplate
AC_INIT([ipset], [5.0], [kadlec@blackhole.kfki.hu])
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_TARGET
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
dnl Shortcut: Linux supported alone
case $target in
@@ -12,10 +13,14 @@ esac
dnl Additional arguments
dnl Kernel build directory or source tree
-AC_ARG_WITH([kernel],
- AS_HELP_STRING([--with-kernel=PATH],
- [Path to kernel source/build directory]),
- [KBUILDDIR="$withval";])
+AC_ARG_WITH([kbuild],
+ AS_HELP_STRING([--with-kbuild=PATH],
+ [Path to kernel build directory]),
+ [KBUILDDIR="$withval";])
+AC_ARG_WITH([ksource],
+ AS_HELP_STRING([--with-ksource=PATH],
+ [Path to kernel source directory]),
+ [KSOURCEDIR="$withval";])
AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "")
AC_SUBST(KBUILDDIR)
@@ -27,9 +32,10 @@ else
kbuilddir="/lib/modules/`uname -r`/build"
fi
-if test ! -e "$kbuilddir/include/linux/netfilter/nfnetlink.h"
-then
- AC_MSG_ERROR([Invalid kernel build directory $kbuilddir])
+if test -n "$KSOURCEDIR"; then
+ ksourcedir="$KSOURCEDIR"
+else
+ ksourcedir="/lib/modules/$(uname -r)/source"
fi
if test ! -e "$kbuilddir/.config"
@@ -45,11 +51,11 @@ then
fi
dnl Check kernel dependencies: nfnetlink.h
-NFNL_CB_CONST="`./check_const $kbuilddir/include/linux/netfilter/nfnetlink.h`"
+NFNL_CB_CONST="`./check_const $ksourcedir/include/linux/netfilter/nfnetlink.h`"
AC_SUBST(NFNL_CB_CONST)
dnl Check kernel dependencies: netlink.h
-NETLINK_DUMP_CONST="`./check_const $kbuilddir/include/linux/netlink.h`"
+NETLINK_DUMP_CONST="`./check_const $ksourcedir/include/linux/netlink.h`"
AC_SUBST(NETLINK_DUMP_CONST)
dnl Maximal number of sets supported by the kernel, default 256
@@ -98,15 +104,13 @@ AM_CONDITIONAL([DISABLE_EXTRA_FLAGS], [test "x$extra_flags" = xno])
dnl Checks for programs
AC_PROG_CC
-AC_PROG_LIBTOOL
+AM_PROG_CC_C_O
+LT_INIT
AC_PROG_INSTALL
AC_PROG_LN_S
dnl Checks for libraries
-AC_CHECK_LIB([mnl], [mnl_socket_open])
-if test x"${ac_cv_lib_mnl_mnl_socket_open}" = xno; then
- AC_MSG_ERROR(libmnl not found)
-fi
+PKG_CHECK_MODULES([libmnl], [libmnl >= 1])
dnl Checks for header files
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 2d3df03..7913877 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,11 +1,11 @@
include $(top_srcdir)/Make_global.am
-AM_CFLAGS += -fPIC
-LIBS =
+AM_CFLAGS += ${libmnl_CFLAGS}
lib_LTLIBRARIES = libipset.la
libipset_la_LDFLAGS = -version-info $(LIBVERSION)
+libipset_la_LIBADD = ${libmnl_LIBS}
libipset_la_SOURCES = \
data.c \
icmp.c \
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..64d9bbc
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,2 @@
+/libtool.m4
+/lt*.m4
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..6166aba
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1 @@
+/ipset