make asterisk chan_bluetooth and chan_h323 modules optional, link openh323 and pwlib...
authorNicolas Thill <nico@openwrt.org>
Sun, 7 May 2006 19:05:51 +0000 (19:05 +0000)
committerNicolas Thill <nico@openwrt.org>
Sun, 7 May 2006 19:05:51 +0000 (19:05 +0000)
SVN-Revision: 3737

openwrt/package/Makefile
openwrt/package/asterisk/Config.in
openwrt/package/asterisk/Makefile
openwrt/package/asterisk/ipkg/asterisk-chan-h323.control
openwrt/package/asterisk/patches/asterisk-1.0.9-chan_bluetooth.patch
openwrt/package/asterisk/patches/asterisk-1.2.1-chan_h323.patch [new file with mode: 0644]
openwrt/package/depend.mk
openwrt/package/openh323/Config.in
openwrt/package/openh323/Makefile
openwrt/package/pwlib/Config.in
openwrt/package/pwlib/Makefile

index bc5f1f287b36fb6bfb14f85071f0a7688324f8e8..7782afc570106d8b02bd3e2e205042416b11534e 100644 (file)
@@ -170,7 +170,7 @@ package-$(BR2_PACKAGE_NTPCLIENT) += ntpclient
 package-$(BR2_PACKAGE_NVRAM) += nvram
 package-$(BR2_PACKAGE_OLSRD) += olsrd
 package-$(BR2_COMPILE_OPENCDK) += opencdk
-package-$(BR2_PACKAGE_OPENH323) += openh323
+package-$(BR2_COMPILE_OPENH323) += openh323
 package-$(BR2_COMPILE_OPENLDAP) += openldap
 package-$(BR2_PACKAGE_OPENNTPD) += openntpd
 package-$(BR2_PACKAGE_OPENSER) += openser
@@ -203,7 +203,7 @@ package-$(BR2_PACKAGE_PRIVOXY) += privoxy
 package-$(BR2_PACKAGE_PROCMAIL) += procmail
 package-$(BR2_PACKAGE_PSYBNC) += psybnc
 package-$(BR2_PACKAGE_PTUNNEL) += ptunnel
-package-$(BR2_PACKAGE_PWLIB) += pwlib
+package-$(BR2_COMPILE_PWLIB) += pwlib
 package-$(BR2_PACKAGE_QUAGGA) += quagga
 package-$(BR2_COMPILE_RADIUSCLIENT_NG) += radiusclient-ng
 package-$(BR2_PACKAGE_RADVD) += radvd
index 7efaee57715d4891740b4c67dc9cbc76ff7c6a58..a78300f59dd4db6cc1b33cfd65b80594d234e816 100644 (file)
@@ -26,7 +26,9 @@ config BR2_PACKAGE_ASTERISK_CHAN_H323
        tristate
        default m if CONFIG_DEVEL
        depends BR2_PACKAGE_ASTERISK
-       select BR2_PACKAGE_OPENH323
+       select BR2_COMPILE_OPENH323
+       select BR2_PACKAGE_LIBPTHREAD
+       select BR2_PACKAGE_UCLIBCXX
        help
          H.323 support for Asterisk
 
index 015f0cc2195cd242d2a1c3a92988f77c00c5015b..194e7eb667709306e2ae8889ce059b1d5b88c624 100644 (file)
@@ -49,6 +49,16 @@ endif
 ifneq ($(BR2_PACKAGE_ASTERISK_SQLITE),)
 EXTRA_CDR_MODULES += cdr_sqlite.so
 endif
+ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_BLUETOOTH),)
+EXTRA_CHAN_MODULES += chan_bluetooth.so
+endif
+ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_H323),)
+EXTRA_DEFINES += \
+       OPENH323DIR="$(BUILD_DIR)/openh323" \
+       PWLIBDIR="$(BUILD_DIR)/pwlib" \
+       CXXLIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc"
+EXTRA_CHAN_MODULES += chan_h323.so
+endif
 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
 EXTRA_CFLAGS += -I$(STAGING_DIR)/usr/include/speex
 EXTRA_CODEC_MODULES += codec_speex.so
@@ -58,21 +68,12 @@ $(PKG_BUILD_DIR)/.configured:
        touch $@
 
 $(PKG_BUILD_DIR)/.built:
-       (cd $(PKG_BUILD_DIR)/channels/h323/ ; \
-               $(MAKE) \
-               CROSS_ARCH="Linux" \
-               CROSS_COMPILE="$(TARGET_CROSS)" \
-               CROSS_COMPILE_BIN="/void/" \
-               CROSS_COMPILE_TARGET="/void/" \
+ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_H323),)
+       $(MAKE) -C "$(PKG_BUILD_DIR)/channels/h323" \
                $(TARGET_CONFIGURE_OPTS) \
-               HOST_CC="$(HOSTCC)" \
-               OPTIMIZE="$(TARGET_CFLAGS)" \
-               PROC="$(ARCH)" \
-               DEBUG="" \
-               OPTIONS="-DLOW_MEMORY -Dlinux" \
-               OPENH323DIR=$(BUILD_DIR)/openh323-cvs-20051230 \
-               opt ; \
-       );
+               $(EXTRA_DEFINES) \
+               optnoshared
+endif
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                CROSS_ARCH="Linux" \
                CROSS_COMPILE="$(TARGET_CROSS)" \
@@ -89,12 +90,12 @@ $(PKG_BUILD_DIR)/.built:
                EXTRA_LDFLAGS="$(EXTRA_LDFLAGS)" \
                EXTRA_APP_MODULES="$(EXTRA_APP_MODULES)" \
                EXTRA_CDR_MODULES="$(EXTRA_CDR_MODULES)" \
+               EXTRA_CHAN_MODULES="$(EXTRA_CHAN_MODULES)" \
                EXTRA_CODEC_MODULES="$(EXTRA_CODEC_MODULES)" \
                EXTRA_RES_MODULES="$(EXTRA_RES_MODULES)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                ASTVARLIBDIR="/usr/lib/asterisk" \
-               OPENH323DIR=$(BUILD_DIR)/openh323-cvs-20051230 \
-               PWLIBDIR=$(BUILD_DIR)/pwlib \
+               $(EXTRA_DEFINES) \
                all install samples
        rm -f $(PKG_INSTALL_DIR)/etc/asterisk/*.old
        touch $@
@@ -117,6 +118,7 @@ $(IPKG_ASTERISK):
                        *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
                        *zapateller* *jpeg*; \
                rm -f chan_bluetooth.so ; \
+               rm -f chan_h323.so ; \
                rm -f chan_mgcp.so ; \
                rm -f chan_skinny.so ; \
                rm -f {codec,format}_ilbc.so ; \
index 55af6f1421f2543a089cc0c3f6dde0e3eec6ebfc..fe6bf9a48dbda1fbad7ca905cc6de7cffe2c9bc4 100644 (file)
@@ -2,4 +2,4 @@ Package: asterisk-chan-h323
 Priority: optional
 Section: net
 Description: H.323 support for Asterisk
-Depends: asterisk, openh323
+Depends: asterisk, libpthead, uclibc++
index 7c278a71b417bcea62c430b794c3f644cc5114db..4f3425db3d0fc8f56a359d4f30b57e6b863ee349 100644 (file)
@@ -1,23 +1,14 @@
 diff -ruN asterisk-1.0.9-old/channels/Makefile asterisk-1.0.9-new/channels/Makefile
 --- asterisk-1.0.9-old/channels/Makefile       2005-08-22 20:42:22.000000000 +0200
 +++ asterisk-1.0.9-new/channels/Makefile       2005-08-22 21:12:14.000000000 +0200
-@@ -37,6 +37,12 @@
- #
- #CHANNEL_LIBS+=chan_vofr
+@@ -202,6 +202,13 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a
+       $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
  
 +#
 +# Asterisk Bluetooth Support
 +# http://www.crazygreek.co.uk/content/chan_bluetooth
 +#
-+CHANNEL_LIBS += chan_bluetooth.so
-+
- ifeq (${OSARCH},OpenBSD)
- MYSQLLIB=-L/usr/local/lib/mysql -lmysqlclient
- CFLAGS+=-I/usr/local/include
-@@ -202,6 +208,9 @@
- chan_h323.so: chan_h323.o h323/libchanh323.a
-       $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
 +chan_bluetooth.so: chan_bluetooth.o
 +      $(CC) $(SOLINK) -o $@ $< $(EXTRA_LDFLAGS) -lbluetooth
 +
diff --git a/openwrt/package/asterisk/patches/asterisk-1.2.1-chan_h323.patch b/openwrt/package/asterisk/patches/asterisk-1.2.1-chan_h323.patch
new file mode 100644 (file)
index 0000000..10760de
--- /dev/null
@@ -0,0 +1,32 @@
+diff -ruN asterisk-1.2.1-old/channels/Makefile asterisk-1.2.1-new/channels/Makefile
+--- asterisk-1.2.1-old/channels/Makefile       2006-05-07 13:06:06.000000000 +0200
++++ asterisk-1.2.1-new/channels/Makefile       2006-05-07 15:26:00.000000000 +0200
+@@ -15,6 +15,7 @@
+ #
+ CHANNEL_LIBS=chan_sip.so chan_agent.so chan_mgcp.so chan_iax2.so chan_local.so chan_skinny.so chan_features.so
++CXXLIBS=-lstdc++
+ ifneq (${OSARCH},CYGWIN)
+ # if you really, really want to use these drivers, uncomment the line below
+@@ -230,7 +231,7 @@
+ ifeq (${OSARCH},Linux)
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+-      $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
++      $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) $(CXXLIBS)
+ else
+ chan_h323.so: chan_h323.o h323/libchanh323.a
+       $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+diff -ruN asterisk-1.2.1-old/channels/h323/Makefile asterisk-1.2.1-new/channels/h323/Makefile
+--- asterisk-1.2.1-old/channels/h323/Makefile  2005-11-29 19:24:39.000000000 +0100
++++ asterisk-1.2.1-new/channels/h323/Makefile  2006-05-07 13:18:46.000000000 +0200
+@@ -30,7 +30,7 @@
+       touch $(SOURCES)
+ libchanh323.a:        $(OBJS)
+-      ar crv $@ $(OBJS)
++      $(AR) crv $@ $(OBJS)
+ Makefile.ast: FORCE
+       @echo H323CFLAGS  = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
index 63e185b2b298a9e8eaccbd8b5320dd83ae5d9203..f265cb581dd68ea76f40e81266a43ec97d15adbd 100644 (file)
@@ -116,7 +116,13 @@ wpa_supplicant-compile: openssl-compile
 wx200d-compile: postgresql-compile
 xsupplicant-compile: openssl-compile
 
-asterisk-compile: bluez-libs-compile ncurses-compile openssl-compile openh323-compile
+asterisk-compile: ncurses-compile openssl-compile
+ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_BLUETOOTH),)
+asterisk-compile: bluez-libs-compile
+endif
+ifneq ($(BR2_PACKAGE_ASTERISK_CHAN_H323),)
+asterisk-compile: openh323-compile uclibc++-compile
+endif
 ifneq ($(BR2_PACKAGE_ASTERISK_CODEC_SPEEX),)
 asterisk-compile: speex-compile
 endif
index 1aa3202e9c9a419976978b6a6ee534df8e868e3a..6dfe1f97a6ec855fc35c22f2663e78ac9173222f 100644 (file)
@@ -1,6 +1,6 @@
-config BR2_PACKAGE_OPENH323
-       prompt "openh323.......................... OpenH323 implementation"
+config BR2_COMPILE_OPENH323
+#      prompt "openh323.......................... OpenH323 implementation"
        tristate
-       select BR2_PACKAGE_PWLIB
+       select BR2_COMPILE_PWLIB
        default n
        help
index f9b8a514f975270a7d9515dc2d08aea8202161a2..a17ac0099976d05143a9e4f9342ad0bfd86d5110 100644 (file)
@@ -12,45 +12,57 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,OPENH323,openh323,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured:
-       rm -rf $(PKG_INSTALL_DIR);
-       mkdir -p $(PKG_INSTALL_DIR);
-       ln -s $(PKG_BUILD_DIR)/../pwlib-cvs-20051227 $(PKG_BUILD_DIR)/../pwlib; 
-       cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       PWLIBDIR="$(STAGING_DIR)" \
-           ./configure \
-           --prefix=$(STAGING_DIR) \
-           --target=$(GNU_TARGET_NAME) \
-           --host=$(GNU_TARGET_NAME) \
-           --build=$(GNU_HOST_NAME) \
-       cd $(PKG_BUILD_DIR)/plugins; rm -rf config.{cache,status}; \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       PWLIBDIR="$(STAGING_DIR)" \
-           ./configure \
-           --prefix=$(STAGING_DIR)
+       ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti"  \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+               $(TARGET_CONFIGURE_OPTS) \
+               ./configure \
+                       --target=$(GNU_TARGET_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --build=$(GNU_HOST_NAME) \
+                       --program-prefix="" \
+                       --program-suffix="" \
+                       --prefix=/usr \
+                       --exec-prefix=/usr \
+                       --bindir=/usr/bin \
+                       --datadir=/usr/share \
+                       --includedir=/usr/include \
+                       --infodir=/usr/share/info \
+                       --libdir=/usr/lib \
+                       --libexecdir=/usr/lib \
+                       --localstatedir=/var \
+                       --mandir=/usr/share/man \
+                       --sbindir=/usr/sbin \
+                       --sysconfdir=/etc \
+                         $(DISABLE_LARGEFILE) \
+                         $(DISABLE_NLS) \
+                       \
+                       --enable-minsize \
+                       --enable-audio \
+                       --disable-video \
+       );
        touch $@
 
+
 $(PKG_BUILD_DIR)/.built:
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       PWLIBDIR="$(PKG_BUILD_DIR)/../pwlib-cvs-20051227/" \
-       $(MAKE) -C $(PKG_BUILD_DIR)/plugins $(TARGET_CONFIGURE_OPTS)
-       
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       PWLIBDIR="$(PKG_BUILD_DIR)/../pwlib-cvs-20051227/" \
-       $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) opt install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               optnoshared
        touch $@
+
+install-link:
+       ln -s $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME)
+
+uninstall-link:
+       rm -rf $(BUILD_DIR)/$(PKG_NAME)
+
+compile-targets: $(PKG_BUILD_DIR)/.built install-link
+clean-targets: uninstall-link
index 1ad5429435624e44987e87934c0f88274018447c..0d9d11c7685222d744d3fae8970f49a277bd8d63 100644 (file)
@@ -1,5 +1,5 @@
-config BR2_PACKAGE_PWLIB
-       prompt "pwlib............................. Portable Windows library"
+config BR2_COMPILE_PWLIB
+#      prompt "pwlib............................. Portable Windows library"
        tristate
        select BR2_PACKAGE_LIBPTHREAD
        default n
index cb933e1db9c832733010ed3958b80d01caa194eb..66e806dc17ad3ca3a705db981875b8620c192e36 100644 (file)
@@ -12,48 +12,95 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_CAT:=zcat
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,PWLIB,pwlib,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured:
-       rm -rf $(PKG_INSTALL_DIR)
-       mkdir -p $(PKG_INSTALL_DIR)
-       cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
-       CFLAGS="$(TARGET_CFLAGS)" \
-       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       $(TARGET_CONFIGURE_OPTS) \
-           ./configure \
-           --prefix=$(STAGING_DIR) \
-           --target=$(GNU_TARGET_NAME) \
-           --host=$(GNU_TARGET_NAME) \
-           --build=$(GNU_HOST_NAME) \
-           --enable-openh323 \
-           --disable-openldap \
-           --disable-openssl \
-           --disable-ftp \
-           --disable-qos \
-           --disable-expat \
-           --disable-jabber \
-           --disable-xmlrpc \
-           --disable-ipv6 \
-           --disable-sdl \
-           --disable-video \
-           --disable-socks \
-           --disable-ftp \
-           --disable-snmp \
-           --disable-telnet \
-           --disable-serial
-           --disable-pop3smtp \
-           --disable-http \
-           --disable-httpsvc
+       ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti"  \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
+               $(TARGET_CONFIGURE_OPTS) \
+               ./configure \
+                       --target=$(GNU_TARGET_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --build=$(GNU_HOST_NAME) \
+                       --program-prefix="" \
+                       --program-suffix="" \
+                       --prefix=/usr \
+                       --exec-prefix=/usr \
+                       --bindir=/usr/bin \
+                       --datadir=/usr/share \
+                       --includedir=/usr/include \
+                       --infodir=/usr/share/info \
+                       --libdir=/usr/lib \
+                       --libexecdir=/usr/lib \
+                       --localstatedir=/var \
+                       --mandir=/usr/share/man \
+                       --sbindir=/usr/sbin \
+                       --sysconfdir=/etc \
+                         $(DISABLE_LARGEFILE) \
+                         $(DISABLE_NLS) \
+                       \
+                       --enable-minsize \
+                       --enable-openh323 \
+                       --disable-opal \
+                       --disable-internalregex \
+                       --disable-plugins \
+                       --enable-audio \
+                       --disable-alsa \
+                       --disable-asn \
+                       --disable-avc \
+                       --disable-dc \
+                       --disable-dtmf \
+                       --disable-expat \
+                       --disable-ftp \
+                       --disable-http \
+                       --disable-httpsvc \
+                       --disable-ipv6 \
+                       --disable-jabber \
+                       --disable-openldap \
+                       --disable-openssl \
+                       --disable-oss \
+                       --disable-pipechan \
+                       --disable-pop3smtp \
+                       --disable-remconn \
+                       --disable-resolver \
+                       --disable-qos \
+                       --disable-sasl \
+                       --disable-sdl \
+                       --disable-serial \
+                       --disable-shm-video \
+                       --disable-snmp \
+                       --disable-soap \
+                       --disable-socks \
+                       --disable-stun \
+                       --disable-telnet \
+                       --disable-tts \
+                       --disable-v4l \
+                       --disable-v4l2 \
+                       --disable-bsdvideo \
+                       --disable-video \
+                       --disable-vxml \
+                       --disable-wavfile \
+                       --disable-xmlrpc \
+       );
        touch $@
 
 $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
-               all install
+               optnoshared
        touch $@
+
+install-link:
+       ln -s $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR)/$(PKG_NAME)
+
+uninstall-link:
+       rm -rf $(BUILD_DIR)/$(PKG_NAME)
+
+compile-targets: $(PKG_BUILD_DIR)/.built install-link
+clean-targets: uninstall-link