X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2Futil%2Fmake_ext;h=317dd5c8ce3eafb7967c5e26619ae977153110ba;hb=f54fca96add61189e2fde1d41312bc8885ac2d97;hp=8c1abbbc013eeb36903f1ae74e832347ca017f96;hpb=76c7ba2e4a4392e5e7538b69dfaf5c0656bdfaf4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/util/make_ext b/ext/util/make_ext index 8c1abbb..317dd5c 100644 --- a/ext/util/make_ext +++ b/ext/util/make_ext @@ -4,16 +4,35 @@ # It primarily used by the perl Makefile: # # d_dummy $(dynamic_ext): miniperl preplibrary FORCE -# ext/util/make_ext dynamic $@ +# @sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) # # It may be deleted in a later release of perl so try to # avoid using it for other purposes. target=$1; shift extspec=$1; shift +makecmd=$1; shift # Should be something like MAKE=make passthru="$*" # allow extra macro=value to be passed through echo "" +# Previously, $make was taken from config.sh. However, the user might +# instead be running a possibly incompatible make. This might happen if +# the user types "gmake" instead of a plain "make", for example. The +# correct current value of MAKE will come through from the main perl +# makefile as MAKE=/whatever/make in $makecmd. We'll be cautious in +# case third party users of this script (are there any?) don't have the +# MAKE=$(MAKE) argument, which was added after 5.004_03. +case "$makecmd" in +MAKE=*) + eval $makecmd + ;; +*) echo 'ext/util/make_ext: WARNING: Please include MAKE=$(MAKE)' + echo ' in your call to make_ext. See ext/util/make_ext for details.' + exit 1 + ;; +esac + + case $CONFIG in '') if test -f config.sh; then TOP=.; @@ -34,14 +53,16 @@ if test "X$extspec" = X; then fi # The Perl Makefile.SH will expand all extensions to -# lib/auto/X/X.a (or lib/auto/X/Y/Y.a is nested) +# lib/auto/X/X.a (or lib/auto/X/Y/Y.a if nested) # A user wishing to run make_ext might use -# X (or X/Y or X::Y is nested) +# X (or X/Y or X::Y if nested) # canonise into X/Y form (pname) case "$extspec" in lib*) # Remove lib/auto prefix and /*.* suffix pname=`echo "$extspec" | sed -e 's:^lib/auto/::' -e 's:/[^/]*\.[^/]*$::' ` ;; +ext*) # Remove ext/ prefix and /pm_to_blib suffix + pname=`echo "$extspec" | sed -e 's:^ext/::' -e 's:/pm_to_blib$::' ` ;; *::*) # Convert :: to / pname=`echo "$extspec" | sed -e 's/::/\//g' ` ;; *) pname="$extspec" ;; @@ -50,7 +71,6 @@ esac mname=`echo "$pname" | sed -e 's!/!::!g'` depth=`echo "$pname" | sed -e 's![^/][^/]*!..!g'` -make=${altmake-make} makefile=Makefile makeargs='' makeopts='' @@ -75,6 +95,10 @@ dynamic) makeargs="LINKTYPE=dynamic"; target=all ;; +nonxs) makeargs=""; + target=all + ;; + *clean) # If Makefile has been moved to Makefile.old by a make clean # then use Makefile.old for realclean rather than rebuild it if test ! -f $makefile -a -f Makefile.old; then @@ -92,7 +116,7 @@ dynamic) makeargs="LINKTYPE=dynamic"; esac if test ! -f $makefile ; then - test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL INSTALLDIRS=perl $passthru + test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL INSTALLDIRS=perl PERL_CORE=1 $passthru fi if test ! -f $makefile ; then if test -f Makefile.SH; then @@ -108,10 +132,10 @@ clean) ;; realclean) ;; *) # Give makefile an opportunity to rewrite itself. # reassure users that life goes on... - $make config $passthru || echo "$make config failed, continuing anyway..." + $MAKE config $passthru || echo "$MAKE config failed, continuing anyway..." ;; esac -$make $makeopts $target $makeargs $passthru || exit +$MAKE $makeopts $target $makeargs $passthru || exit exit $?