Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 526 forks source link

compiling three deep modules within ext/ #57

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#859 (status was 'resolved')

Searchable as RT859$

p5pRT commented 24 years ago

From nate@valleytel.net

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\,

--nate

Inline Patch ```diff --- Configure Fri Jun 11 20:59:48 1999 +++ Configure.new Fri Jun 11 21:06:43 1999 @@ -12010,8 +12010,6 @@ 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='' @@ -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 +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 + done' +tdir=`pwd` +cd $rsrc/ext +set -- +eval $find_extensions set X $nonxs_extensions shift 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: Platform: 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 Compiler: 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/libc.so.5.4.44, 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: /usr/lib/perl5/5.00502/i586-linux /usr/lib/perl5/5.00502 /usr/lib/perl5/site_perl/5.005/i586-linux /usr/lib/perl5/site_perl/5.005 . Environment for perl 5.00502: HOME=/home/nate LANG (unset) LD_LIBRARY_PATH=/usr/local/qt/lib::/usr/local/rvplayer5.0 LOGDIR (unset) PATH=/usr/local/qt/bin:/usr/local/qt/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/lib/teTeX/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/etc/java/bin:/usr/local/netpbm/bin:/usr/local/insure/bin.linux:/usr/X11R6/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/lib/teTeX/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/etc/java/bin:/usr/local/netpbm/bin:/usr/local/insure/bin.linux PERL_BADLANG (unset) SHELL=/bin/bash ```