This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport of dd6c21bebf897e04754ff0d50210c6e54cc753c7
authorH.Merijn Brand <merijn@nb09.procura.nl>
Thu, 24 Sep 2009 10:26:00 +0000 (12:26 +0200)
committerH.Merijn Brand <merijn@nb09.procura.nl>
Thu, 24 Sep 2009 10:26:00 +0000 (12:26 +0200)
Search for extensions in cpan/ as well as ext/

This required inverting the logic of test for "are we flattened or not".
Currently we can only build XS extensions on Unix from cpan/

U/perl/Extensions.U

index 33e00d3..258c367 100644 (file)
@@ -84,19 +84,7 @@ find_extensions='
            *)
            this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
            leaf=`echo $xxx | $sed -e s/.*-//`;
-           if $test -d File-Glob; then
-               $ls -1 $xxx > $$.tmp;
-               if   $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $contains "\.c$"  $$.tmp > /dev/null 2>&1; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $test "$this_ext" = "IO/Compress"; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $test -d $xxx; then
-                   nonxs_extensions="$nonxs_extensions $this_ext";
-               fi;
-               $rm -f $$.tmp;
-           else
+           if $test -d File; then
                if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
                    known_extensions="$known_extensions $1$this_ext";
                elif $test -f $xxx/Makefile.PL; then
@@ -110,11 +98,27 @@ find_extensions='
                        shift;
                    fi;
                fi;
+           else
+               $ls -1 $xxx > $$.tmp;
+               if   $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
+                   known_extensions="$known_extensions $this_ext";
+               elif $contains "\.c$"  $$.tmp > /dev/null 2>&1; then
+                   known_extensions="$known_extensions $this_ext";
+               elif $test "$this_ext" = "IO/Compress"; then
+                   known_extensions="$known_extensions $this_ext";
+               elif $test -d $xxx; then
+                   nonxs_extensions="$nonxs_extensions $this_ext";
+               fi;
+               $rm -f $$.tmp;
            fi
            ;;
        esac;
     done'
 tdir=`pwd`
+cd "$rsrc/cpan"
+set X
+shift
+eval $find_extensions
 cd "$rsrc/ext"
 set X
 shift