fix libnet build on osx
authorFelix Fietkau <nbd@openwrt.org>
Sun, 1 Apr 2007 16:48:05 +0000 (16:48 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 1 Apr 2007 16:48:05 +0000 (16:48 +0000)
SVN-Revision: 6799

libs/libnet-1.1.x/Makefile
libs/libnet-1.1.x/patches/100-debian-subset.patch.gz [new file with mode: 0644]
libs/libnet-1.1.x/patches/150-portability.patch [new file with mode: 0644]
libs/libnet-1.1.x/patches/500-debian-subset.patch.gz [deleted file]

index a8c204095a0416b3e569caeac228a0b298eab30c..b76e651410b1a7d71fcc9f853ef6caeaf8117af3 100644 (file)
@@ -35,6 +35,16 @@ ifeq ($(CONFIG_BIG_ENDIAN),y)
   ENDIANESS:=big
 endif
 
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-pf_packet=yes
+
+CONFIGURE_VARS += \
+       ac_cv_libnet_endianess=$(ENDIANESS) \
+       ac_libnet_have_pf_packet=yes \
+       LL_INT_TYPE=linux
+
 define Build/Configure
        (cd $(PKG_BUILD_DIR); touch \
                configure.in \
@@ -43,19 +53,13 @@ define Build/Configure
                Makefile.in \
                configure \
        );
-       $(call Build/Configure/Default, \
-               --enable-shared \
-               --enable-static \
-               --with-pf_packet=yes \
-               , \
-               ac_cv_libnet_endianess=$(ENDIANESS) \
-               ac_libnet_have_pf_packet=yes \
-               ac_libnet_have_packet_socket=yes \
-       )
+       $(call Build/Configure/Default)
 endef
 
 define Build/Compile
+       # pass CFLAGS again to override -O2 set by configure
        $(MAKE) -C $(PKG_BUILD_DIR) \
+               CFLAGS="$(TARGET_CFLAGS)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all install
 endef
diff --git a/libs/libnet-1.1.x/patches/100-debian-subset.patch.gz b/libs/libnet-1.1.x/patches/100-debian-subset.patch.gz
new file mode 100644 (file)
index 0000000..6ebd6b5
Binary files /dev/null and b/libs/libnet-1.1.x/patches/100-debian-subset.patch.gz differ
diff --git a/libs/libnet-1.1.x/patches/150-portability.patch b/libs/libnet-1.1.x/patches/150-portability.patch
new file mode 100644 (file)
index 0000000..67fc804
--- /dev/null
@@ -0,0 +1,35 @@
+diff -ur libnet.old/configure libnet.dev/configure
+--- libnet.old/configure       2007-04-01 17:48:16.000000000 +0200
++++ libnet.dev/configure       2007-04-01 18:43:46.000000000 +0200
+@@ -19537,7 +19537,15 @@
+ echo "$as_me:$LINENO: checking link-layer packet interface type" >&5
+ echo $ECHO_N "checking link-layer packet interface type... $ECHO_C" >&6
+-if test -r /dev/bpf0 ; then
++if test -n "$LL_INT_TYPE"; then
++    case $LIBOBJS in
++    "libnet_link_$LL_INT_TYPE.$ac_objext"   | \
++  *" libnet_link_$LL_INT_TYPE.$ac_objext"   | \
++    "libnet_link_$LL_INT_TYPE.$ac_objext "* | \
++  *" libnet_link_$LL_INT_TYPE.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS libnet_link_$LL_INT_TYPE.$ac_objext" ;;
++esac
++elif test -r /dev/bpf0 ; then
+     case $LIBOBJS in
+     "libnet_link_bpf.$ac_objext"   | \
+   *" libnet_link_bpf.$ac_objext"   | \
+diff -ur libnet.old/configure.in libnet.dev/configure.in
+--- libnet.old/configure.in    2007-04-01 17:48:16.000000000 +0200
++++ libnet.dev/configure.in    2007-04-01 18:44:29.000000000 +0200
+@@ -67,7 +67,10 @@
+ dnl
+ AC_MSG_CHECKING(link-layer packet interface type)
+-if test -r /dev/bpf0 ; then
++if test -n "$LL_INT_TYPE"; then
++      AC_LIBOBJ($LL_INT_TYPE)
++      AC_MSG_RESULT(found $LL_INT_TYPE (cached))
++elif test -r /dev/bpf0 ; then
+     AC_LIBOBJ([libnet_link_bpf])
+     AC_MSG_RESULT(found bpf)
+ elif test -r /usr/include/net/pfilt.h ; then
diff --git a/libs/libnet-1.1.x/patches/500-debian-subset.patch.gz b/libs/libnet-1.1.x/patches/500-debian-subset.patch.gz
deleted file mode 100644 (file)
index 6ebd6b5..0000000
Binary files a/libs/libnet-1.1.x/patches/500-debian-subset.patch.gz and /dev/null differ