From: Andy Dougherty Date: Fri, 10 Mar 1995 23:34:12 +0000 (+0000) Subject: perl5.000 patch.0o: [address] a few more Configure and build nits. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fec02dd38faf8f83471b031857d89cb76fea1ca0;p=p5sagit%2Fp5-mst-13.2.git perl5.000 patch.0o: [address] a few more Configure and build nits. This patch addresses a few more Configure and build nits. Full details are given below, but the main hightligths are (slightly) better support for nested extensions and DLD and AIX MakeMaker fixes. Configure Detect MachTen. Thanks to Mark Pease . Delete some tabs that caused a MachTen /bin/sh core dump! Detect extensions nested 1 level deep, e.g. Devel/DProf/DProf.xs MANIFEST MANIFEST.new Include new hints/machten.sh hint file. Makefile.SH Document why we use ./makedir instead of mkdir. U/Extensions.U Detect extensions nested 1 level deep, e.g. Devel/DProf/DProf.xs U/dist3_051.pat Include MachTen patches. configpm Convert nested extension names from filesytem-dependent Devel/DProf to perl5's internal naming scheme Devel::DProf. doio.c A dup-related buglet fix from Hallvard B. Furuseth . ext/DB_File/DB_File.pm ext/DynaLoader/DynaLoader.pm ext/Fcntl/Fcntl.pm ext/GDBM_File/GDBM_File.pm ext/POSIX/POSIX.pm ext/Socket/Socket.pm Throw a qw() around @ISA elements to show "good style". hints/machten.sh new file. lib/ExtUtils/MakeMaker.pm Bump version number to 4.086. Fix AIX buglet -- needed to specify NAME. Linux/DLD/gcc-2.6.2: We no longer load .sa libraries (except libm.sa, which is apparently still o.k. util.c Another dup-related buglet fix. --- diff --git a/Configure b/Configure index e6153de..cd728d2 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.6 1994/10/29 15:54:19 ram Exp $ # -# Generated on Mon Mar 6 11:00:02 EST 1995 [metaconfig 3.0 PL51] +# Generated on Fri Mar 10 09:48:55 EST 1995 [metaconfig 3.0 PL51] cat >/tmp/c1$$ < $instead.\" >&4"; @@ -6314,10 +6317,26 @@ eval $setvar echo " " echo "Looking for extensions..." >&4 cd ../ext +: If we are using the old config.sh, known_extensions may contain +: old or inaccurate or duplicate values. known_extensions='' +: We do not use find because it might not be available. +: 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 if $test -f $xxx/$xxx.xs; then known_extensions="$known_extensions $xxx" + else + if $test -d $xxx; then + cd $xxx + for yyy in * ; do + if $test -f $yyy/$yyy.xs; then + known_extensions="$known_extensions $xxx/$yyy" + fi + done + cd .. + fi fi done set X $known_extensions diff --git a/MANIFEST b/MANIFEST index fcb1ec3..9df2155 100644 --- a/MANIFEST +++ b/MANIFEST @@ -201,6 +201,7 @@ hints/irix_6.sh Hints for named architecture hints/isc.sh Hints for named architecture hints/isc_2.sh Hints for named architecture hints/linux.sh Hints for named architecture +hints/machten.sh Hints for named architecture hints/mips.sh Hints for named architecture hints/mpc.sh Hints for named architecture hints/mpeix.sh Hints for named architecture diff --git a/MANIFEST.new b/MANIFEST.new index fcb1ec3..9df2155 100644 --- a/MANIFEST.new +++ b/MANIFEST.new @@ -201,6 +201,7 @@ hints/irix_6.sh Hints for named architecture hints/isc.sh Hints for named architecture hints/isc_2.sh Hints for named architecture hints/linux.sh Hints for named architecture +hints/machten.sh Hints for named architecture hints/mips.sh Hints for named architecture hints/mpc.sh Hints for named architecture hints/mpeix.sh Hints for named architecture diff --git a/Makefile.SH b/Makefile.SH index 6bbd7fe..9de1de7 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -254,6 +254,9 @@ opcode.h: opcode.pl embed.h: embed_h.sh global.sym interp.sym sh embed_h.sh +# We have to call our ./makedir because Ultrix 4.3 make can't handle the line +# test -d lib/auto || mkdir lib/auto +# preplibrary: miniperl lib/Config.pm @./makedir lib/auto @echo " AutoSplitting perl library" diff --git a/U/Extensions.U b/U/Extensions.U index bcaffc0..2cba199 100644 --- a/U/Extensions.U +++ b/U/Extensions.U @@ -36,18 +36,32 @@ ?S: for hints files to indicate that POSIX will not compile ?S: on a particular system. ?S:. -?T:xxx avail_ext +?T:xxx yyy avail_ext ?INIT:: set useposix=false in your hint file to disable the POSIX extension. ?INIT:useposix=true echo " " echo "Looking for extensions..." >&4 cd ../ext -?X: If we're using the old config.sh, known_extensions may contain -?X: old or inaccurate (or duplicate) values. +: If we are using the old config.sh, known_extensions may contain +: old or inaccurate or duplicate values. known_extensions='' +: We do not use find because it might not be available. +: 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 if $test -f $xxx/$xxx.xs; then known_extensions="$known_extensions $xxx" + else + if $test -d $xxx; then + cd $xxx + for yyy in * ; do + if $test -f $yyy/$yyy.xs; then + known_extensions="$known_extensions $xxx/$yyy" + fi + done + cd .. + fi fi done set X $known_extensions diff --git a/U/dist3_051.pat b/U/dist3_051.pat index 1a671d8..c1c877d 100644 --- a/U/dist3_051.pat +++ b/U/dist3_051.pat @@ -5,8 +5,11 @@ These patches do the following: Oldconfig.U Clean up and extend the $osvers detection for DEC OSF/1 on the Alpha. + Add MachTen detection (requires adding awk to ?MAKE line). archname.U Protect against spaces in the output of uname -m. +Inhdr.U + Delete tabs that caused /bin/sh to core dump on Mach Ten 2.1.1. libc.U Pick up Linux nm output with leading __IO. sig_name.U @@ -18,10 +21,70 @@ usrinc.U Dept. of Physics Lafayette College, Easton, PA 18042 USA +Index: Inhdr.U +Prereq: 3.0.1.1 +*** mcon/U/Inhdr.U Sat Oct 29 15:28:15 1994 +--- /home2/doughera/lib/dist/U/Inhdr.U Wed Mar 8 15:52:13 1995 +*************** +*** 52,61 **** + var=$2; eval "was=\$$2"; + if $test "$xxx" && $test -r "$xxx"; + then eval $xxf; +! eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; + cont=""; + else eval $xxnf; +! eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; + set $yyy; shift; shift; yyy=$@; + case $# in 0) cont="";; + 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; +--- 52,65 ---- + var=$2; eval "was=\$$2"; + if $test "$xxx" && $test -r "$xxx"; + then eval $xxf; +! ?X: This line deliberately shifted left 1 tabstop to avoid /bin/sh core dump +! ?X: on MachTen 2.1.1. --AD March 8, 1995 +! eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; + cont=""; + else eval $xxnf; +! ?X: This line deliberately shifted left 1 tabstop to avoid /bin/sh core dump +! ?X: on MachTen 2.1.1. --AD March 8, 1995 +! eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; + set $yyy; shift; shift; yyy=$@; + case $# in 0) cont="";; + 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; Index: Oldconfig.U Prereq: 3.0.1.7 *** mcon/U/Oldconfig.U Thu Feb 16 09:52:38 1995 ---- /home2/doughera/lib/dist/U/Oldconfig.U Thu Feb 16 16:26:25 1995 +--- /home2/doughera/lib/dist/U/Oldconfig.U Fri Mar 10 09:43:30 1995 +*************** +*** 45,51 **** + ?X: for the sake of setting defaults. + ?X: + ?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname \ +! sed test cat rm lns n c contains Loc Options Tr + ?MAKE: -pick wipe $@ %< + ?S:myuname: + ?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix, +--- 45,51 ---- + ?X: for the sake of setting defaults. + ?X: + ?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname \ +! awk sed test cat rm lns n c contains Loc Options Tr + ?MAKE: -pick wipe $@ %< + ?S:myuname: + ?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix, +*************** +*** 150,155 **** +--- 150,158 ---- + $test -d /usr/apollo/bin && osname=apollo + $test -f /etc/saf/_sactab && osname=svr4 + $test -d /usr/include/minix && osname=minix ++ $test -d /MachTen && osname=machten && \ ++ osvers=`/usr/etc/version | $awk '{print $2}' | \ ++ $sed -e 's/[A-Za-z]$//'` + ?X: If we have uname, we already computed a suitable uname -a output, correctly + ?X: formatted for Xenix, and it lies in $myuname. + if $test -f $uname; then *************** *** 264,275 **** osvers="$3" @@ -36,7 +99,7 @@ Prereq: 3.0.1.7 ;; hp*) osname=hp_osf1 ;; mips) osname=mips_osf1 ;; ---- 264,274 ---- +--- 267,277 ---- osvers="$3" ;; osf1) case "$5" in diff --git a/configpm b/configpm index acce1e0..bee74a9 100755 --- a/configpm +++ b/configpm @@ -9,6 +9,9 @@ $config_pm = $ARGV[0] || 'lib/Config.pm'; dynamic_ext static_ext extensions dl_src sig_name ccflags cppflags intsize); +# names of things which may need to have slashes changed to double-colons +@extensions = qw(dynamic_ext static_ext extensions known_extensions); + open CONFIG, ">$config_pm" or die "Can't open $config_pm: $!\n"; $myver = sprintf("%.3f", $]); @@ -27,6 +30,7 @@ require Exporter; ENDOFBEG @fast{@fast} = @fast; +@extensions{@extensions} = @extensions; @non_v=(); @v_fast=(); @v_others=(); @@ -39,7 +43,9 @@ while (<>) { push(@non_v, "#$_"); # not a name='value' line next; } - if (!$fast{$1}){ push(@v_others, $_); next; } + $name = $1; + if ($extensions{$name}) { s,/,::,g } + if (!$fast{$name}){ push(@v_others, $_); next; } push(@v_fast,$_); } diff --git a/doio.c b/doio.c index 7d8e617..7362903 100644 --- a/doio.c +++ b/doio.c @@ -168,7 +168,8 @@ FILE *supplied_fp; if (dodup) fd = dup(fd); if (!(fp = fdopen(fd,mode))) - close(fd); + if (dodup) + close(fd); } } else { diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index af56cc0..4cff8da 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -179,7 +179,7 @@ require TieHash; require Exporter; require AutoLoader; require DynaLoader; -@ISA = (TieHash, Exporter, DynaLoader); +@ISA = qw(TieHash Exporter DynaLoader); @EXPORT = qw( $DB_BTREE $DB_HASH $DB_RECNO BTREEMAGIC diff --git a/ext/DynaLoader/DynaLoader.pm b/ext/DynaLoader/DynaLoader.pm index 9a21dfd..2c375d0 100644 --- a/ext/DynaLoader/DynaLoader.pm +++ b/ext/DynaLoader/DynaLoader.pm @@ -18,7 +18,7 @@ use Config; use Carp; use AutoLoader; -@ISA=(AutoLoader); +@ISA=qw(AutoLoader); # enable messages from DynaLoader perl code diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index d55d4e3..b18d136 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -3,7 +3,7 @@ package Fcntl; require Exporter; require AutoLoader; require DynaLoader; -@ISA = (Exporter, DynaLoader); +@ISA = qw(Exporter DynaLoader); # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @EXPORT = diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index 99b6390..cf260b5 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -5,7 +5,7 @@ require TieHash; require Exporter; require AutoLoader; require DynaLoader; -@ISA = (TieHash, Exporter, DynaLoader); +@ISA = qw(TieHash Exporter DynaLoader); @EXPORT = qw( GDBM_CACHESIZE GDBM_FAST diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index f59b4c3..24e09fc 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -5,7 +5,7 @@ require Exporter; require AutoLoader; require DynaLoader; require Config; -@ISA = (Exporter, DynaLoader); +@ISA = qw(Exporter DynaLoader); $H{assert_h} = [qw(assert NDEBUG)]; diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index a129ec6..8e6e097 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -4,7 +4,7 @@ use Carp; require Exporter; require AutoLoader; require DynaLoader; -@ISA = (Exporter, DynaLoader); +@ISA = qw(Exporter DynaLoader); @EXPORT = qw( AF_802 AF_APPLETALK diff --git a/hints/machten.sh b/hints/machten.sh new file mode 100644 index 0000000..cbf634a --- /dev/null +++ b/hints/machten.sh @@ -0,0 +1,27 @@ +# machten.sh +# This file has been put together by Mark Pease +# Comments, questions, and improvements welcome! +# +# MachTen does not support dynamic loading. If you wish to, you +# can get +# compile and install. This is the version of DLD that works with the +# ext/DynaLoader/dl_dld.xs in the perl5 package. Have fun! +# +# Original version was for MachTen 2.1.1. +# Last modified by Andy Dougherty +# Wed Mar 8 15:58:05 EST 1995 + +# I don't know why this is needed. It might be similar to NeXT's +# problem. See hints/next_3_2.sh. +usemymalloc='n' + +so='none' +# These are useful only if you have DLD, but harmless otherwise. +lddlflags='-r' +dlext='o' + +# MachTen does not support POSIX enough to compile the POSIX module. +useposix=false + +#MachTen might have an incomplete Berkeley DB implementation. +i_db=$undef diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index dbb877e..f619108 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -1,6 +1,6 @@ package ExtUtils::MakeMaker; -$Version = 4.085; # Last edited 21st Feb 1995 by Andreas Koenig +$Version = 4.086; # Last edited 9 Mar 1995 by Andy Dougherty use Config; check_hints(); @@ -1374,7 +1374,7 @@ $att{BASEEXT}.exp: Makefile.PL ",' $(PERL) $(I_PERL_LIBS) -e \'use ExtUtils::MakeMaker; \\ mksymlists(DL_FUNCS => ', %$funcs ? neatvalue($funcs) : '""',', DL_VARS => ', - @$vars ? neatvalue($vars) : '""',")' + @$vars ? neatvalue($vars) : '""', ", NAME => \"$att{NAME}\")' "); join('',@m); @@ -1977,9 +1977,16 @@ sub extliblist{ my($found_lib)=0; foreach $thispth (@searchpath, @libpath){ + # Try to find the full name of the library. We need this to + # determine whether it's a dynamically-loadable library or not. + # This tends to be subject to various os-specific quirks. + # For gcc-2.6.2 on linux (March 1995), DLD can not load + # .sa libraries, with the exception of libm.sa, so we + # deliberately skip them. if (@fullname=<${thispth}/lib${thislib}.${so}.[0-9]*>){ $fullname=$fullname[-1]; #ATTN: 10 looses against 9! - } elsif (-f ($fullname="$thispth/lib$thislib.$so")){ + } elsif (-f ($fullname="$thispth/lib$thislib.$so") + && (($Config{'dlsrc'} ne "dl_dld") || ($thislib eq "m"))){ } elsif (-f ($fullname="$thispth/lib${thislib}_s.a") && ($thislib .= "_s") ){ # we must explicitly ask for _s version } elsif (-f ($fullname="$thispth/lib$thislib.a")){ @@ -2258,6 +2265,10 @@ Fixed a bug that didn't allow lib/ directory work as documented. Allowed C +v4.086 March 9 1995 by Andy Dougherty + +Fixed some AIX buglets. Fixed DLD support for Linux with gcc 2.6.2. + =head1 NOTES MakeMaker development work still to be done: diff --git a/util.c b/util.c index 2c2cba8..6c1d3dc 100644 --- a/util.c +++ b/util.c @@ -1322,25 +1322,29 @@ char *s; #endif #ifndef HAS_DUP2 +int dup2(oldfd,newfd) int oldfd; int newfd; { #if defined(HAS_FCNTL) && defined(F_DUPFD) + if (oldfd == newfd) + return oldfd; close(newfd); - fcntl(oldfd, F_DUPFD, newfd); + return fcntl(oldfd, F_DUPFD, newfd); #else int fdtmp[256]; I32 fdx = 0; int fd; if (oldfd == newfd) - return 0; + return oldfd; close(newfd); - while ((fd = dup(oldfd)) != newfd) /* good enough for low fd's */ + while ((fd = dup(oldfd)) != newfd && fd >= 0) /* good enough for low fd's */ fdtmp[fdx++] = fd; while (fdx > 0) close(fdtmp[--fdx]); + return fd; #endif } #endif