asterisk-chan-dongle: fix uclibc build
authorSebastian Kemper <sebastian_ml@gmx.net>
Fri, 1 Sep 2017 22:28:16 +0000 (00:28 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Fri, 1 Sep 2017 22:28:19 +0000 (00:28 +0200)
uclibc doesn't include iconv, so we need to use libiconv-full. This
fixes the ARC builds as they still default to uclibc.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk-chan-dongle/Makefile
net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch

index 891d79937718554fdb05898fb33ae5951ea2da5b..43ed2d344cb1ec49b1214291e59ad722699a256f 100644 (file)
@@ -32,7 +32,7 @@ define Package/asterisk-chan-dongle/Default
   SECTION:=net
   CATEGORY:=Network
   URL:=https://github.com/wdoekes/asterisk-chan-dongle
   SECTION:=net
   CATEGORY:=Network
   URL:=https://github.com/wdoekes/asterisk-chan-dongle
-  DEPENDS:=+kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +usb-modeswitch
+  DEPENDS:=+USE_UCLIBC:libiconv-full +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +usb-modeswitch
   TITLE:=Huawei UMTS 3G dongle support
 endef
 
   TITLE:=Huawei UMTS 3G dongle support
 endef
 
@@ -73,6 +73,12 @@ CONFIGURE_ARGS+= \
 TARGET_CFLAGS+= \
        -I$(CHAN_DONGLE_AST_HEADERS)
 
 TARGET_CFLAGS+= \
        -I$(CHAN_DONGLE_AST_HEADERS)
 
+# 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
+endif
+
 # -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self to fix Asterisk 14
 # compile issues
 CHAN_DONGLE_EXTRA_CFLAGS:= \
 # -DAST_MODULE_SELF_SYM=__internal_chan_dongle_self to fix Asterisk 14
 # compile issues
 CHAN_DONGLE_EXTRA_CFLAGS:= \
@@ -88,11 +94,11 @@ MAKE_ARGS:= \
        CC="$(TARGET_CC)" \
        LD="$(TARGET_CC)" \
        CFLAGS="$(TARGET_CFLAGS) $(CHAN_DONGLE_EXTRA_CFLAGS)" \
        CC="$(TARGET_CC)" \
        LD="$(TARGET_CC)" \
        CFLAGS="$(TARGET_CFLAGS) $(CHAN_DONGLE_EXTRA_CFLAGS)" \
-       LDFLAGS="$(TARGET_LDFLAGS)"
+       LDFLAGS="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_UCLIBC),-L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv)"
 
 
-# $TOOLCHAIN_DIR used by 200-fix-iconv-detection.patch
+# $CHAN_DONGLE_ICONV_INC used by 200-fix-iconv-detection.patch
 CONFIGURE_VARS += \
 CONFIGURE_VARS += \
-       TOOLCHAIN_DIR=$(TOOLCHAIN_DIR) \
+       CHAN_DONGLE_ICONV_INC="$(TOOLCHAIN_DIR)/include $(STAGING_DIR)/usr/lib/libiconv-full/include" \
        ac_cv_type_size_t=yes \
        ac_cv_type_ssize_t=yes
 
        ac_cv_type_size_t=yes \
        ac_cv_type_ssize_t=yes
 
index bc9d94d9ee332692c75e18ac16ca4af2794a8475..211764fc754e097f08eae2faa4a7067190d8df75 100644 (file)
@@ -5,7 +5,7 @@
  
  AC_HEADER_FIND([asterisk.h], $with_asterisk)
 -AC_HEADER_FIND([iconv.h], /usr/include /usr/local/include /opt/local/include)
  
  AC_HEADER_FIND([asterisk.h], $with_asterisk)
 -AC_HEADER_FIND([iconv.h], /usr/include /usr/local/include /opt/local/include)
-+AC_HEADER_FIND([iconv.h], "${TOOLCHAIN_DIR}/include")
++AC_HEADER_FIND([iconv.h], ${CHAN_DONGLE_ICONV_INC})
  
  AC_DEFINE([ICONV_CONST],[], [Define to const if you has iconv() const declaration of input buffer])
  AC_MSG_CHECKING([for iconv use const inbuf])
  
  AC_DEFINE([ICONV_CONST],[], [Define to const if you has iconv() const declaration of input buffer])
  AC_MSG_CHECKING([for iconv use const inbuf])