Fix how we build pjproject.

Allow parallel builds, better tolerate failures, build faster.

This also stops running dependencies before top-level configure has been run.

(closes issue ASTERISK-20815)

Review: https://reviewboard.asterisk.org/r/2292/
........

Merged revisions 380816 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jason Parker
2013-02-04 19:52:14 +00:00
parent 8bb9aa2f6d
commit eb61bb96b7
6 changed files with 46 additions and 45 deletions

View File

@@ -67,21 +67,25 @@ endif
ael/pval.o: ael/pval.c
clean::
$(MAKE) -C pjproject realclean
@if [ -f pjproject/build.mak ]; then $(MAKE) -C pjproject realclean; fi
rm -f snmp/*.o snmp/*.i ael/*.o ael/*.i ais/*.o ais/*.i
pjproject/build.mak:
cd pjproject && ./configure AR="" CFLAGS=-fPIC --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec
dist-clean::
rm -f pjproject/build.mak
.PHONY : pjproject
pjproject: pjproject/build.mak
# Make sure we always build pjproject with a single job.
$(MAKE) -j1 -C pjproject dep
$(MAKE) -j1 -C pjproject
pjproject/build.mak: pjproject/aconfigure
(cd pjproject && CFLAGS="-fPIC" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --disable-floating-point --disable-sound --disable-oss --disable-speex-aec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-g711-codec)
include pjproject/build.mak
ifneq ($(findstring $(MAKECMDGOALS),all),)
-include pjproject/build.mak
endif
.PHONY: FORCE
FORCE:
$(PJ_LIB_FILES): FORCE
$(MAKE) -C $(patsubst %/lib/,%,$(dir $@))/build/ ../lib/$(notdir $@)
$(PJ_LIB_FILES): pjproject
res_rtp_asterisk.o: $(PJ_LIB_FILES)
res_rtp_asterisk.o: _ASTCFLAGS+=$(PJ_CFLAGS)
res_rtp_asterisk.so: _ASTLDFLAGS+=$(PJ_LDFLAGS)

View File

@@ -2403,7 +2403,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
ac_config_headers="$ac_config_headers pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h pjsip/include/pjsip/sip_autoconf.h"
ac_config_files="$ac_config_files build.mak build/os-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/os-auto.mak third_party/build/portaudio/os-auto.mak"
ac_config_files="$ac_config_files build.mak build/os-auto.mak build/cc-auto.mak pjlib/build/os-auto.mak pjlib-util/build/os-auto.mak pjmedia/build/os-auto.mak pjsip/build/os-auto.mak third_party/build/os-auto.mak third_party/build/portaudio/os-auto.mak"
@@ -7988,6 +7988,7 @@ do
"pjsip/include/pjsip/sip_autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS pjsip/include/pjsip/sip_autoconf.h" ;;
"build.mak") CONFIG_FILES="$CONFIG_FILES build.mak" ;;
"build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES build/os-auto.mak" ;;
"build/cc-auto.mak") CONFIG_FILES="$CONFIG_FILES build/cc-auto.mak" ;;
"pjlib/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES pjlib/build/os-auto.mak" ;;
"pjlib-util/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES pjlib-util/build/os-auto.mak" ;;
"pjmedia/build/os-auto.mak") CONFIG_FILES="$CONFIG_FILES pjmedia/build/os-auto.mak" ;;

View File

@@ -13,6 +13,7 @@ AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
])
AC_CONFIG_FILES([build.mak
build/os-auto.mak
build/cc-auto.mak
pjlib/build/os-auto.mak
pjlib-util/build/os-auto.mak
pjmedia/build/os-auto.mak

View File

@@ -16,6 +16,15 @@ include $(PJDIR)/build/cc-$(CC_NAME).mak
#
-include cc-$(CC_NAME).mak
#
# Include auto configured compiler specification.
# This will override the compiler settings above.
# Currently this is made OPTIONAL, to prevent people
# from getting errors because they don't re-run ./configure
# after downloading new PJSIP.
#
-include $(PJDIR)/build/cc-auto.mak
#
# Include global machine specific definitions
#

View File

@@ -1,8 +1,8 @@
# @configure_input@
export OS_CFLAGS := $(CC_DEF)PJ_AUTOCONF=1 @CFLAGS@ -g
export OS_CFLAGS := $(CC_DEF)PJ_AUTOCONF=1 @CFLAGS@
export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 @CXXFLAGS@ -g
export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 @CXXFLAGS@
export OS_LDFLAGS := @LDFLAGS@ @LIBS@