This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Patch by Ilya Zakharevich to give more meaningful error
[perl5.git] / ext / util / make_ext
index 70a5d2e..8bcd7d8 100644 (file)
@@ -61,6 +61,8 @@ 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' ` ;;
 *)     pname="$extspec" ;;
@@ -83,13 +85,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,7 +119,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