All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@netfilter.org>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Harald Welte <laforge@netfilter.org>
Subject: [PATCH 2/2] update in-tree headers automatically
Date: Sun, 13 Nov 2005 18:34:39 +0100	[thread overview]
Message-ID: <4377792F.1030804@netfilter.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

This patch add the ability to copy and mangle the kernel headers
required by libnfnetlink and libnetfilter_[queue|log|conntrack] at
autogen.sh stage.

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[-- Attachment #2: autogen.patch --]
[-- Type: text/plain, Size: 5016 bytes --]

Index: libnfnetlink/autogen.sh
===================================================================
--- libnfnetlink/autogen.sh	(revision 4511)
+++ libnfnetlink/autogen.sh	(working copy)
@@ -1,5 +1,24 @@
 #!/bin/sh
 
+include ()
+{
+    # If we keep a copy of the kernel header in the SVN tree, we'll have
+    # to worry about synchronization issues forever. Instead, we just copy 
+    # the headers that we need from the lastest kernel version at autogen
+    # stage.
+
+    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    if [ -f $INCLUDEDIR/netfilter/nfnetlink.h ]
+    then
+    	TARGET=include/libnfnetlink/linux_nfnetlink.h
+    	echo "Copying nfnetlink.h to linux_nfnetlink.h"
+    	cp $INCLUDEDIR/netfilter/nfnetlink.h $TARGET
+    else
+    	echo "can't find nfnetlink.h kernel file"
+    	exit 1
+    fi
+}
+
 run ()
 {
     echo "running: $*"
@@ -11,6 +30,7 @@
     fi
 }
 
+include
 run aclocal
 #run autoheader
 run libtoolize -f
Index: libnetfilter_conntrack/autogen.sh
===================================================================
--- libnetfilter_conntrack/autogen.sh	(revision 4511)
+++ libnetfilter_conntrack/autogen.sh	(working copy)
@@ -1,5 +1,27 @@
 #!/bin/sh
 
+include ()
+{
+    # If we keep a copy of the kernel header in the SVN tree, we'll have
+    # to worry about synchronization issues forever. Instead, we just copy 
+    # the headers that we need from the lastest kernel version at autogen
+    # stage.
+
+    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    if [ -f $INCLUDEDIR/netfilter/nfnetlink_conntrack.h ]
+    then
+    	TARGET=include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h
+    	echo "Copying nfnetlink_conntrack.h to linux_nfnetlink_conntrack.h"
+    	cp $INCLUDEDIR/netfilter/nfnetlink_conntrack.h $TARGET
+	TEMP=`tempfile`
+	sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
+	mv $TEMP $TARGET
+    else
+    	echo "can't find nfnetlink_conntrack.h kernel file"
+    	exit 1
+    fi
+}
+
 run ()
 {
     echo "running: $*"
@@ -11,6 +33,7 @@
     fi
 }
 
+include
 run aclocal
 run libtoolize -f
 #run autoheader
Index: libnetfilter_queue/autogen.sh
===================================================================
--- libnetfilter_queue/autogen.sh	(revision 4511)
+++ libnetfilter_queue/autogen.sh	(working copy)
@@ -1,5 +1,39 @@
 #!/bin/sh
 
+include ()
+{
+    # If we keep a copy of the kernel header in the SVN tree, we'll have
+    # to worry about synchronization issues forever. Instead, we just copy 
+    # the headers that we need from the lastest kernel version at autogen
+    # stage.
+
+    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    if [ -f $INCLUDEDIR/netfilter/nfnetlink_queue.h ]
+    then
+    	TARGET=include/libnetfilter_queue/linux_nfnetlink_queue.h
+    	echo "Copying nfnetlink_queue.h to linux_nfnetlink_queue.h"
+    	cp $INCLUDEDIR/netfilter/nfnetlink_queue.h $TARGET
+	TEMP=`tempfile`
+	sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
+	# Add aligned_u64 definition after #define _NFNETLINK_QUEUE_H
+	awk '{
+        if ( $0 == "#define _NFNETLINK_QUEUE_H" ) {
+		print $0
+		getline
+		print $0
+		print "#ifndef aligned_u64"
+		print "#define aligned_u64 unsigned long long __attribute__((aligned(8)))"
+		print "#endif"
+	}
+
+	print $0
+	}' $TEMP > $TARGET
+    else
+    	echo "can't find nfnetlink_queue.h kernel file"
+    	exit 1
+    fi
+}
+
 run ()
 {
     echo "running: $*"
@@ -11,6 +45,7 @@
     fi
 }
 
+include
 run libtoolize
 run aclocal
 #run autoheader
Index: libnetfilter_log/autogen.sh
===================================================================
--- libnetfilter_log/autogen.sh	(revision 4511)
+++ libnetfilter_log/autogen.sh	(working copy)
@@ -1,5 +1,39 @@
 #!/bin/sh
 
+include ()
+{
+    # If we keep a copy of the kernel header in the SVN tree, we'll have
+    # to worry about synchronization issues forever. Instead, we just copy 
+    # the headers that we need from the lastest kernel version at autogen
+    # stage.
+
+    INCLUDEDIR=/lib/modules/`uname -r`/build/include/linux
+    if [ -f $INCLUDEDIR/netfilter/nfnetlink_log.h ]
+    then
+    	TARGET=include/libnetfilter_log/linux_nfnetlink_log.h
+    	echo "Copying nfnetlink_log.h to linux_nfnetlink_log.h"
+    	cp $INCLUDEDIR/netfilter/nfnetlink_log.h $TARGET
+	TEMP=`tempfile`
+	sed 's/linux\/netfilter\/nfnetlink.h/libnfnetlink\/linux_nfnetlink.h/g' $TARGET > $TEMP
+	# Add aligned_u64 definition after #define _NFNETLINK_LOG_H
+	awk '{
+        if ( $0 == "#define _NFNETLINK_LOG_H" ) {
+		print $0
+		getline
+		print $0
+		print "#ifndef aligned_u64"
+		print "#define aligned_u64 unsigned long long __attribute__((aligned(8)))"
+		print "#endif"
+	}
+
+	print $0
+	}' $TEMP > $TARGET
+    else
+    	echo "can't find nfnetlink_log.h kernel file"
+    	exit 1
+    fi
+}
+
 run ()
 {
     echo "running: $*"
@@ -11,6 +45,7 @@
     fi
 }
 
+include
 run aclocal
 #run autoheader
 run libtoolize -f

             reply	other threads:[~2005-11-13 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-13 17:34 Pablo Neira [this message]
2005-11-14 14:38 ` [PATCH 2/2] update in-tree headers automatically Harald Welte

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=4377792F.1030804@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.org \
    /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.