# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Tue Jul 6 11:02:34 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Tue Jul 6 13:40:46 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
echo " "
echo "Looking for extensions..." >&4
-tdir=`pwd`
-cd $rsrc/ext
: If we are using the old config.sh, known_extensions may contain
: old or inaccurate or duplicate values.
known_extensions=''
: We do not just use MANIFEST because the user may have dropped
: some additional extensions into the source tree and expect them
: to be built.
-for xxx in * ; do
- case "$xxx" in
- DynaLoader|dynaload) ;;
- *) if $test -f $xxx/$xxx.xs; then
- known_extensions="$known_extensions $xxx"
- elif $test -f $xxx/Makefile.PL; then
- nonxs_extensions="$nonxs_extensions $xxx"
- else
- if $test -d $xxx; then
- # Look for nested extensions, eg. Devel/Dprof.
- cd $xxx
- for yyy in * ; do
- if $test -f $yyy/$yyy.xs; then
- known_extensions="$known_extensions $xxx/$yyy"
- elif $test -f $yyy/Makefile.PL; then
- nonxs_extensions="$nonxs_extensions $xxx/$yyy"
- fi
- done
- cd ..
- fi
- fi
- ;;
- esac
-done
+
+: Function to recursively find available extensions, ignoring DynaLoader
+: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
+find_extensions='
+ for xxx in *; do
+ case "$xxx" in
+ DynaLoader|dynaload) ;;
+ *)
+ if $test -f $xxx/$xxx.xs; then
+ known_extensions="$known_extensions $1$xxx";
+ elif $test -f $xxx/Makefile.PL; then
+ nonxs_extensions="$nonxs_extensions $1$xxx";
+ else
+ if $test -d $xxx -a $# -lt 10; then
+ set $1$xxx/ $*;
+ cd $xxx;
+ eval $find_extensions;
+ cd ..;
+ shift;
+ fi
+ fi
+ ;;
+ esac
+ done'
+tdir=`pwd`
+cd $rsrc/ext
+set --
+eval $find_extensions
set X $nonxs_extensions
shift
nonxs_extensions="$*"