[asterisk-commits] dlee: branch 11 r372609 - /branches/11/res/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 7 15:36:12 CDT 2012


Author: dlee
Date: Fri Sep  7 15:36:08 2012
New Revision: 372609

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372609
Log:
Fix parallel make for res_asterisk_rtp.

Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN
in res_rtp_asterisk and chan_sip." [1].

[1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517

When compiling asterisk in parallel like:
    $ make -j 10

It's possible to get errors like the following:

    .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator.  Stop.
    make[4]: *** [depend] Error 2
    make[3]: *** [dep] Error 1
    make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2
    make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.

This is because the build system is trying to build each of the libraries in
pjproject in parallel. Now the build will build pjproject in a single job and
link the results into res_asterisk_rtp.

Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk
build:

Single job:
    $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 )

    real    2m34.529s
    user    1m41.810s
    sys     0m15.970s

Parallel make:
    $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 )

    real    1m2.353s
    user    2m39.120s
    sys     0m18.850s

(closes issue ASTERISK-20362)
Reported by: Shaun Ruffel
Patches:
    0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417)

Modified:
    branches/11/res/Makefile

Modified: branches/11/res/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/Makefile?view=diff&rev=372609&r1=372608&r2=372609
==============================================================================
--- branches/11/res/Makefile (original)
+++ branches/11/res/Makefile Fri Sep  7 15:36:08 2012
@@ -67,17 +67,22 @@
 ael/pval.o: ael/pval.c
 
 clean::
+	$(MAKE) -C pjproject realclean
 	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
 
+.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
+
 include pjproject/build.mak
 
-res_rtp_asterisk.o: pjproject/build.mak $(PJ_LIB_FILES)
+$(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)
 res_rtp_asterisk.so: LIBS+=$(PJ_LDLIBS)
-
-$(PJ_LIB_FILES):
-	cd pjproject && make dep && make




More information about the asterisk-commits mailing list