From: Sebastian Kemper Date: Sat, 19 Aug 2017 14:35:40 +0000 (+0200) Subject: asterisk13: clean up compile stage X-Git-Url: http://git.openwrt.org/?p=feed%2Ftelephony.git;a=commitdiff_plain;h=92e04ad4cc72578eb06921b4b99e0c7ba0da9b76 asterisk13: clean up compile stage - Don't add extra TARGET_LDFLAGS for asterisk13-pbx-lua. It is not needed anymore (apart from that the module isn't available currently, see next commit). - Stop setting -Wl,-rpath-link in LDFLAGS. There seems to be no point to do that (anymore). - Stop calling specific make targets like version.h; make handles the build properly without it. - Use the default compile routine instead of the custom one. - Add AST_FORTIFY_SOURCE to MAKE_FLAGS (seen in Debian rules file, prevents asterisk's build system to mess with OpenWrt/LEDE flags). Signed-off-by: Sebastian Kemper --- diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 8b7cf3d..a5e391f 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -180,11 +180,9 @@ else --without-tonezone endif -TARGET_LDFLAGS+= \ - $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pbx-lua),-ldl -lcrypt) - -EXTRA_CFLAGS+=$(TARGET_CPPFLAGS) -EXTRA_LDFLAGS+=$(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib +# Pass CPPFLAGS in the CFLAGS as otherwise the build system will +# ignore them. +TARGET_CFLAGS+=$(TARGET_CPPFLAGS) CONFIGURE_ARGS+= \ --without-execinfo \ @@ -232,6 +230,20 @@ CONFIGURE_VARS += \ ac_cv_lib_srtp2_srtp_init=no \ ac_cv_path_ac_pt_CONFIG_LIBXML2=$(STAGING_DIR)/host/bin/xml2-config +MAKE_FLAGS+= \ + ASTDATADIR="/usr/share/asterisk" \ + DESTDIR="$(PKG_INSTALL_DIR)" + +# show full gcc arguments instead of [CC] and [LD] +MAKE_FLAGS+= \ + NOISY_BUILD="yes" + +# don't let asterisk mess with build flags +MAKE_FLAGS+= \ + AST_FORTIFY_SOURCE="" \ + DEBUG="" \ + OPTIMIZE="" + AST_MENUSELECT_OPTS = \ --without-newt \ --without-curses \ @@ -271,18 +283,7 @@ define Build/Compile --disable BUILD_NATIVE \ $(if $(CONFIG_ASTERISK13_LOW_MEMORY),--enable LOW_MEMORY) \ menuselect.makeopts - $(MAKE) -C "$(PKG_BUILD_DIR)" \ - include/asterisk/version.h \ - include/asterisk/buildopts.h defaults.h - ASTCFLAGS="$(EXTRA_CFLAGS)" \ - ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ - $(MAKE) -C "$(PKG_BUILD_DIR)" \ - ASTDATADIR="/usr/share/asterisk" \ - NOISY_BUILD="yes" \ - DEBUG="" \ - OPTIMIZE="" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install samples + $(call Build/Compile/Default,all install samples) endef define Build/InstallDev