This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #36909] $^R undefined on matches involving backreferences
[perl5.git] / ext / util / make_ext
index 70a5d2e..cd1db5a 100644 (file)
@@ -61,8 +61,11 @@ fi
 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' ` ;;
+*.o)    pname=`echo "$extspec" | sed -e 's/\.o//'` ;;
 *)     pname="$extspec" ;;
 esac
 # echo "Converted $extspec to $pname"
@@ -83,13 +86,20 @@ echo "      Making $mname ($target)"
 
 cd ext/$pname
 
-# check link type and do any preliminaries
+# check link type and do any preliminaries.  Valid link types are
+# 'dynamic', 'static', and 'static_pic' (the last one respects
+# CCCDLFLAGS such as -fPIC -- see static_target in the main Makefile.SH)
 case "$target" in
-           # convert 'static' or 'dynamic' into 'all LINKTYPE=XXX'
+dynamic)    makeargs="LINKTYPE=dynamic";
+           target=all
+           ;;
 static)     makeargs="LINKTYPE=static CCCDLFLAGS="
            target=all
            ;;
-dynamic)    makeargs="LINKTYPE=dynamic";
+static_pic) makeargs="LINKTYPE=static"
+           target=all
+           ;;
+nonxs)      makeargs="";
            target=all
            ;;
 
@@ -110,15 +120,10 @@ 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
-               echo "Warning: Writing $makefile from old-style Makefile.SH!"
-               sh Makefile.SH
-       else
-               echo "Warning: No Makefile!"
-       fi
+       echo "Warning: No Makefile!"
 fi
 
 case "$target" in
@@ -126,10 +131,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 MAKE=$MAKE $passthru || echo "$MAKE config failed, continuing anyway..."
        ;;
 esac
 
-$MAKE $makeopts $target $makeargs $passthru || exit
+$MAKE $makeopts $target MAKE=$MAKE $makeargs $passthru || exit
 
 exit $?