[svn-commits] dlee: trunk r372610 - in /trunk: ./ res/Makefile

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 7 15:53:50 CDT 2012


Author: dlee
Date: Fri Sep  7 15:53:48 2012
New Revision: 372610

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372610
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)
........

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

Modified:
    trunk/   (props changed)
    trunk/res/Makefile

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/res/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/res/Makefile?view=diff&rev=372610&r1=372609&r2=372610
==============================================================================
--- trunk/res/Makefile (original)
+++ trunk/res/Makefile Fri Sep  7 15:53:48 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 svn-commits mailing list