Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling three deep modules within ext/ #57

p5pRT opened this issue Jun 12, 1999 · 1 comment

compiling three deep modules within ext/ #57

p5pRT opened this issue Jun 12, 1999 · 1 comment


Copy link

p5pRT commented Jun 12, 1999

Migrated from (status was 'resolved')

Searchable as RT859$

Copy link

p5pRT commented Jun 12, 1999


Perl currently does not automatically compile extension modules put
under PERL_SRC/ext/ if the module has more than two layers of depth
before the .xs file. For example, Configure does not find
"ext/XML/Parser/Expat" and thus does not compile it. The following
patch should help to fix this.

This patch is against the Configure distributed with 5.00554, but I
assume that it should work against the current version as well. Note
that even with this patch, MakeMaker will still give a spurious error
message. It can safely be ignored, and probably could be fixed most
easily by passing PERL_SRC to ext/util/make_ext in Makefile.SH.

I'm guessing the patch is as portable as the rest of Configure, but if
it is not I suppose one could ditch the recursion and just add another
couple layers of checking by brute force.

Hope this is useful,


Inline Patch
--- Configure	Fri Jun 11 20:59:48 1999
+++	Fri Jun 11 21:06:43 1999
@@ -12010,8 +12010,6 @@
 echo " "
 echo "Looking for extensions..." >&4
-cd $rsrc/ext
 : If we are using the old, known_extensions may contain
 : old or inaccurate or duplicate values.
@@ -12020,30 +12018,33 @@
 : 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 
-		;;
+: function to recursively find available extensions, ignoring DynaLoader
+: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
+    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
+	    ;;
+    done'
+cd $rsrc/ext
+set --
+eval $find_extensions
 set X $nonxs_extensions
Perl Info

This perlbug was built using Perl 5.00554 - Mon Apr  5 17:08:35 CDT 1999
It is being executed now by  Perl 5.00502 - Fri Oct 23 19:20:09 EDT 1998.

Site configuration information for perl 5.00502:

Configured by nate at Fri Oct 23 19:20:09 EDT 1998.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
    osname=linux, osvers=2.0.35, archname=i586-linux
    uname='linux trinkpad 2.0.35 #3 thu oct 22 19:19:19 edt 1998 i586 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    cc='cc', optimize='-O2', gccversion=egcs-2.90.29 980515 (egcs-1.0.3 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /shlib /lib /usr/lib
    libs=-lndbm -lgdbm -ldbm -ldb -ldl -lm -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl 5.00502:

Environment for perl 5.00502:
    LANG (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

@p5pRT p5pRT closed this as completed Nov 28, 2003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant