chan-sccp-b: fix variant build 238/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Thu, 11 Jan 2018 19:33:23 +0000 (20:33 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Thu, 11 Jan 2018 19:33:25 +0000 (20:33 +0100)
The variant builing is not working properly because PKG_BUILD_DIR is
unset. This fixes that.

Also the Makefile is cleaned up. LOW_MEMORY is not explicitly defined
anymore because chan-sccp-b is getting the define from the Asterisk
headers.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/chan-sccp-b/Makefile
net/chan-sccp-b/patches/01-prevent-extra-optimization.patch [new file with mode: 0644]

index f8f88d9888004c5bdf48d98f40140be89143765d..99605f4355631cbc363f0c902d6d534f5290fb62 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=chan-sccp-b
 PKG_REV:=6139
 PKG_VERSION:=v4.2-r$(PKG_REV)
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/branches/v4.2
@@ -19,21 +19,39 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_PROTO:=svn
 
-PKG_FIXUP:=autoreconf -fi
+PKG_FIXUP:=autoreconf
 
 PKG_LICENSE:=GPL-1.0
 PKG_LICENSE_FILES:=COPYING LICENSE
 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
 
+PKG_INSTALL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=libiconv
+
 include $(INCLUDE_DIR)/package.mk
 
+# musl and glibc include their own iconv, but uclibc does not
+ifneq ($(CONFIG_USE_UCLIBC),)
+TARGET_CPPFLAGS+= \
+       -I$(STAGING_DIR)/usr/lib/libiconv-full/include
+TARGET_LDFLAGS+= \
+       -L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv
+endif
+
+CONFIGURE_ARGS += \
+       --enable-optimization=no \
+       --enable-debug=no
+
 define Package/chan-sccp-b/Default
   SUBMENU:=Telephony
   SECTION:=net
   CATEGORY:=Network
   TITLE:=SCCP channel provider support
   URL:=http://chan-sccp-b.sourceforge.net/
-  DEPENDS:= +libltdl
+  DEPENDS:=+USE_UCLIBC:libiconv-full +libltdl
 endef
 
 define Package/asterisk18-chan-sccp-b
@@ -90,13 +108,6 @@ Package/asterisk18-chan-sccp-b/conffiles = $(Package/conffiles/Default)
 Package/asterisk11-chan-sccp-b/conffiles = $(Package/conffiles/Default)
 Package/asterisk13-chan-sccp-b/conffiles = $(Package/conffiles/Default)
 
-define Build/Compile
-       $(MAKE) -C "$(PKG_BUILD_DIR)" \
-               CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY -fno-stack-protector" \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
-
 define Package/Install/Default
        $(INSTALL_DIR) $(1)/etc/asterisk
        $(CP) ./files/sccp.conf $(1)/etc/asterisk/sccp.conf
diff --git a/net/chan-sccp-b/patches/01-prevent-extra-optimization.patch b/net/chan-sccp-b/patches/01-prevent-extra-optimization.patch
new file mode 100644 (file)
index 0000000..e9fa9b0
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/autoconf/extra.m4
++++ b/autoconf/extra.m4
+@@ -460,23 +460,8 @@ AC_DEFUN([CS_ENABLE_OPTIMIZATION], [
+       AC_MSG_NOTICE([--enable-optimization: ${enable_optimization}]) 
+       AC_MSG_NOTICE([--enable-debug: ${enable_debug}])
+-      if test -n "${CPPFLAGS_saved}"; then
+-              CPPFLAGS_saved="${CPPFLAGS_saved} -U_FORTIFY_SOURCE"
+-      else 
+-              CPPFLAGS_saved="-U_FORTIFY_SOURCE"
+-      fi
+       if test "$enable_optimization" == "no"; then 
+               strip_binaries="no"
+-              optimize_flag="-O0"
+-              case "${CC}" in
+-                      *gcc*)
+-                              AX_CHECK_COMPILE_FLAG(-Og, [
+-                                      optimize_flag="-Og"
+-                              ])
+-                      ;;
+-              esac
+-              CFLAGS_saved="${CFLAGS_saved} ${optimize_flag} "
+-              CPPFLAGS_saved="${CPPFLAGS_saved} ${optimize_flag}"
+       else
+               strip_binaries="yes"
+               CFLAGS_saved="${CFLAGS_saved} -O2 "