fix libnet build on osx
[openwrt/svn-archive/archive.git] / libs / libnet-1.1.x / Makefile
index e67a4d60d1f0982ef4c495e9a37f7044a8d33119..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,18 +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
@@ -73,7 +78,7 @@ define Build/UninstallDev
 endef
 
 define Package/libnet1/install
-       install -m0755 -d $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/
 endef