From 160f29e1944956994a81c36a5d4eec5900dd08b3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:03:12 +0200 Subject: build: build: use autoconf-suggested naming of files Signed-off-by: Jan Engelhardt --- configure.ac | 33 +++++++++++++++++++++++++++++++++ configure.in | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.in diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a82c9f1 --- /dev/null +++ b/configure.ac @@ -0,0 +1,33 @@ +dnl Process this file with autoconf to create configure. + +AC_INIT +AC_CANONICAL_SYSTEM +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE(libnetfilter_queue, 1.0.0) + +AC_PROG_CC +AC_EXEEXT +AM_PROG_LIBTOOL +AC_PROG_INSTALL + +AC_SUBST(LIBTOOL_DEPS) + +case $target in +*-*-linux*) ;; +*) AC_MSG_ERROR([Linux only, dude!]);; +esac + +dnl Dependencies +LIBNFNETLINK_REQUIRED=0.0.41 + +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 Output the makefiles +AC_OUTPUT(Makefile include/Makefile include/libnetfilter_queue/Makefile src/Makefile utils/Makefile libnetfilter_queue.pc doxygen.cfg) diff --git a/configure.in b/configure.in deleted file mode 100644 index a82c9f1..0000000 --- a/configure.in +++ /dev/null @@ -1,33 +0,0 @@ -dnl Process this file with autoconf to create configure. - -AC_INIT -AC_CANONICAL_SYSTEM -AC_CONFIG_MACRO_DIR([m4]) - -AM_INIT_AUTOMAKE(libnetfilter_queue, 1.0.0) - -AC_PROG_CC -AC_EXEEXT -AM_PROG_LIBTOOL -AC_PROG_INSTALL - -AC_SUBST(LIBTOOL_DEPS) - -case $target in -*-*-linux*) ;; -*) AC_MSG_ERROR([Linux only, dude!]);; -esac - -dnl Dependencies -LIBNFNETLINK_REQUIRED=0.0.41 - -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 Output the makefiles -AC_OUTPUT(Makefile include/Makefile include/libnetfilter_queue/Makefile src/Makefile utils/Makefile libnetfilter_queue.pc doxygen.cfg) -- cgit v1.2.3 From 8c62e29f8408e3143678b7b8632e59c2fcec2d8a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:04:32 +0200 Subject: build: use modern call syntax for AC_INIT, AM_INIT_AUTOMAKE automake options also need to definitely go into configure.ac, otherwise they only apply to a single directory. Signed-off-by: Jan Engelhardt --- Makefile.am | 2 -- configure.ac | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 28641f8..b4e604b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,3 @@ -AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 - ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = $(man_MANS) diff --git a/configure.ac b/configure.ac index a82c9f1..3bd3e1c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ dnl Process this file with autoconf to create configure. -AC_INIT +AC_INIT([libnetfilter_queue], [1.0.0]) AC_CANONICAL_SYSTEM AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE(libnetfilter_queue, 1.0.0) +AM_INIT_AUTOMAKE([-Wall foreign subdir-objects dist-bzip2 1.6]) AC_PROG_CC AC_EXEEXT -- cgit v1.2.3 From b9b7caa43c98108009db29acfe2d1874eb426670 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:05:38 +0200 Subject: build: avoid use of deprecated INCLUDES Makefile.am: "INCLUDES" is the old name for "AM_CPPFLAGS" (or "*_CPPFLAGS") And remove unused $(all_includes) Signed-off-by: Jan Engelhardt --- src/Makefile.am | 2 +- utils/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 63d5bc8..c408961 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,7 @@ # LIBVERSION=2:0:1 -INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR} +AM_CPPFLAGS = -I$(top_srcdir)/include -I${KERNELDIR} AM_CFLAGS = -fPIC -Wall LIBS = @LIBNFQUEUE_LIBS@ diff --git a/utils/Makefile.am b/utils/Makefile.am index 9a5e9d6..1f52864 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,5 +1,5 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR} +AM_CPPFLAGS = -I$(top_srcdir)/include -I${KERNELDIR} check_PROGRAMS = nfqnl_test -- cgit v1.2.3 From 06d7168caf9304fb825275b983b534fede836ee4 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:02:33 +0200 Subject: build: use simpler autoreconf in autogen Note: the use of -i seems required, otherwise autoreconf barfs about missing tools (depcomp, etc.). Since they are provided in the tarballs as files anyway rather than like previously as symlinks, I do not see a problem using -i. Signed-off-by: Jan Engelhardt --- autogen.sh | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/autogen.sh b/autogen.sh index cf697c6..57c3532 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e include () { @@ -34,20 +34,6 @@ include () fi } -run () -{ - echo "running: $*" - eval $* - - if test $? != 0 ; then - echo "error: while running '$*'" - exit 1 - fi -} - [ "x$1" = "xdistrib" ] && include -run libtoolize -run aclocal -#run autoheader -run automake -a -run autoconf +autoreconf -fi +rm -Rf autom4te.cache -- cgit v1.2.3 From 9eefb0cf3ca7ecf10d0ad28de3413f39ac4438ef Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:07:13 +0200 Subject: build: run AC_CANONICAL_HOST only There is no need to call AC_CANONICAL_SYSTEM when only AC_CANONICAL_HOST is needed. Also, checking for $target is factually incorrect, since we do not produce object code like a compiler. Use $host, which specifies the triple/quadrople where the compiled program is supposed to run. Signed-off-by: Jan Engelhardt --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3bd3e1c..7c3468b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to create configure. AC_INIT([libnetfilter_queue], [1.0.0]) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([-Wall foreign subdir-objects dist-bzip2 1.6]) @@ -13,7 +13,7 @@ AC_PROG_INSTALL AC_SUBST(LIBTOOL_DEPS) -case $target in +case "$host" in *-*-linux*) ;; *) AC_MSG_ERROR([Linux only, dude!]);; esac -- cgit v1.2.3 From 76bc07182b724bf177197799ea5ade112aed931b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:09:45 +0200 Subject: build: no need for error message in PKG_CHECK_MODULES PKG_CHECK_MODULES already produces its own (and more verbose) messsage when a module cannot be found. Mucking around with CFLAGS and LIBS is also not needed since pkgconfig takes care of providing variables, so let's use them in Makefile.am. Signed-off-by: Jan Engelhardt --- configure.ac | 10 +--------- src/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 7c3468b..c4cc36e 100644 --- a/configure.ac +++ b/configure.ac @@ -19,15 +19,7 @@ case "$host" in esac dnl Dependencies -LIBNFNETLINK_REQUIRED=0.0.41 - -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) +PKG_CHECK_MODULES([LIBNFNETLINK], [libnfnetlink >= 0.0.41]) dnl Output the makefiles AC_OUTPUT(Makefile include/Makefile include/libnetfilter_queue/Makefile src/Makefile utils/Makefile libnetfilter_queue.pc doxygen.cfg) diff --git a/src/Makefile.am b/src/Makefile.am index c408961..aa1f5ba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,11 +21,11 @@ LIBVERSION=2:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I${KERNELDIR} -AM_CFLAGS = -fPIC -Wall -LIBS = @LIBNFQUEUE_LIBS@ +AM_CFLAGS = -fPIC -Wall ${LIBNFNETLINK_CFLAGS} lib_LTLIBRARIES = libnetfilter_queue.la libnetfilter_queue_la_LDFLAGS = -Wc,-nostartfiles -lnfnetlink \ -version-info $(LIBVERSION) libnetfilter_queue_la_SOURCES = libnetfilter_queue.c +libnetfilter_queue_la_LIBADD = ${LIBNFNETLINK_LIBS} -- cgit v1.2.3 From d8fd4dc472f827c8dcc2af7e6b4990b8c957ae65 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:11:26 +0200 Subject: build: set Libs.private for pkgconfig file Similar to the commit in iptables, add Libs.private to tell about dependencies for static linking. Signed-off-by: Jan Engelhardt --- libnetfilter_queue.pc.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libnetfilter_queue.pc.in b/libnetfilter_queue.pc.in index 962c686..9c6c2c4 100644 --- a/libnetfilter_queue.pc.in +++ b/libnetfilter_queue.pc.in @@ -12,4 +12,5 @@ Version: @VERSION@ Requires: libnfnetlink Conflicts: Libs: -L${libdir} -lnetfilter_queue +Libs.private: @LIBNFNETLINK_LIBS@ Cflags: -I${includedir} -- cgit v1.2.3 From a11cf002c56a59fdac4a6970847d137c7ecf8110 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:38:03 +0200 Subject: build: remove statements without effect Signed-off-by: Jan Engelhardt --- Makefile.am | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index b4e604b..576a69b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,3 @@ man_MANS = #nfnetlink_queue.3 nfnetlink_queue.7 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnetfilter_queue.pc - -$(OBJECTS): libtool -libtool: $(LIBTOOL_DEPS) - $(SHELL) ./config.status --recheck -- cgit v1.2.3 From 4558271002c2190d4ee559f6b7a5f499a23ae6a8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:54:44 +0200 Subject: build: remove -fPIC flag libtool automatically adds PIC flags as needed. Signed-off-by: Jan Engelhardt --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index aa1f5ba..a745129 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ LIBVERSION=2:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I${KERNELDIR} -AM_CFLAGS = -fPIC -Wall ${LIBNFNETLINK_CFLAGS} +AM_CFLAGS = -Wall ${LIBNFNETLINK_CFLAGS} lib_LTLIBRARIES = libnetfilter_queue.la -- cgit v1.2.3 From ddd8ea0add4eb4390763d066d0673c6d94dec1f3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 30 Oct 2010 23:15:19 +0200 Subject: Update .gitignore Signed-off-by: Jan Engelhardt --- .gitignore | 33 ++++++++++++++++++--------------- utils/.gitignore | 1 + 2 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 utils/.gitignore diff --git a/.gitignore b/.gitignore index 99e943d..dbd9ac7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,20 @@ -doxygen.cfg -doxygen +.deps +.libs +Makefile +Makefile.in +*.o +*.la +*.lo -config.guess -config.log -config.sub -config.status -configure -autom4te.cache -libtool -ltmain.sh -missing -install-sh -depcomp -aclocal.m4 +/aclocal.m4 +/autom4te.cache +/config.* +/configure +/depcomp +/install-sh +/libtool +/ltmain.sh +/missing -libnetfilter_queue.pc +/doxygen.cfg +/libnetfilter_queue.pc diff --git a/utils/.gitignore b/utils/.gitignore new file mode 100644 index 0000000..10fe6e9 --- /dev/null +++ b/utils/.gitignore @@ -0,0 +1 @@ +/nfqnl_test -- cgit v1.2.3