From: Andy Dougherty Date: Tue, 21 Feb 1995 01:14:24 +0000 (+0000) Subject: perl5.000 patch.0l: MakeMaker 4.085 and upgrade Configure to dist3 PL 51. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40000a8c37c35cc00114329ca0add46bca36a0ec;p=p5sagit%2Fp5-mst-13.2.git perl5.000 patch.0l: MakeMaker 4.085 and upgrade Configure to dist3 PL 51. Here's what's new: Configure Generated by metaconfig PL 51. Correctly set ./mips on a MIPS system. Improved (we hope) handling of $archname. MANIFEST MANIFEST.new Made .SH files out of h2xs and makeaperl so that they get the correct path-to-perl at the top. Makefile.SH Propagate $(perllib) to extensions. U/dist3_051.patches Two patches to apply on top of metaconfig PL 51. I've sent them off for inclusion in the next metaconfig update. config_h.SH config.H Regenerated. Only the order of elements has changed. ext/DB_File/Makefile.PL ext/GDBM_File/Makefile.PL ext/NDBM_File/Makefile.PL Add -L/usr/local/lib to LIBS variable. ext/POSIX/POSIX.xs Place #ifdef around FD_CLOEXEC (needed for Apollo). ext/SDBM_File/sdbm/Makefile.PL Simplified, thanks to MakeMaker enhancements. ext/util/make_ext Pass through $(perllib) argument for cflags. h2xs.SH Changed from h2xs to h2xs.SH. Now finds correct path to perl. hints/next_3_2.sh Updated for hppa. hints/solaris_2.sh Remove potentially problematic -lmalloc from $libswanted. hints/unicos.sh Look in /usr/include/rpcsvc for dbm.h. installperl Install h2xs. lib/Cwd.pm Use 'my' variable to avoid clobbering $_. lib/ExtUtils/MakeMaker.pm Upgraded from 4.06 to 4.085. Lots of documentation improvements. EXE_FILES to refer to an array of executable files to install. Reduce chatter during build process. Don't count a useful -L/path option as a successful search for a particular library. Cleanup handling of aix external symbols. Create/update perllocal.pod to indicate what we've done. makeaperl.SH Changed from makeaperl to makeaperl.SH. Now finds correct path to perl. x2p/util.c Delete unused setenv() and envix() functions. x2p/util.h Delete unused setenv() and envix() prototypes. vms/config.vms Define I_SYS_STAT and I_SYS_TYPES. --- diff --git a/Configure b/Configure index 13e4ba5..2b3796d 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 Sat Feb 11 11:56:23 EST 1995 [metaconfig 3.0 PL50] +# Generated on Tue Feb 21 11:46:04 EST 1995 [metaconfig 3.0 PL51] cat >/tmp/c1$$ <&2 + -V) echo "$me generated by metaconfig 3.0 PL51." >&2 exit 0;; --) break;; -*) echo "$me: unknown option $1" >&2; shift; error=true;; @@ -1133,9 +1134,9 @@ EOH Much effort has been expended to ensure that this shell script will run on any Unix system. If despite that it blows up on yours, your best bet is to edit -Configure and run it again. Also, let me (lwall@netlabs.com) -know how I blew it. If you can't run Configure for some reason, you'll have to -generate a config.sh file by hand. +Configure and run it again. If you can't run Configure for some reason, +you'll have to generate a config.sh file by hand. Whatever problems you +have, let me (lwall@netlabs.com) know how I blew it. This installation script affects things in two ways: @@ -2326,11 +2327,12 @@ while test "$type"; do fi ;; Locate) - if test -d "$value"; then + if test -d "$ansexp"; then echo "(Looking for $loc_file in directory $value.)" value="$value/$loc_file" + ansexp="$ansexp/$loc_file" fi - if test -f "$value"; then + if test -f "$ansexp"; then type='' fi case "$nopath_ok" in @@ -2400,12 +2402,13 @@ EOCP fi $rm -f usr.c usr.out echo "and you're compiling with the $mips_type compiler and libraries." + echo "exit 0" >mips else echo "Doesn't look like a MIPS system." echo "exit 1" >mips - chmod +x mips - $eunicefix mips fi +chmod +x mips +$eunicefix mips echo " " case "$usrinc" in '') ;; @@ -3409,6 +3412,36 @@ $rm -f access* set alarm d_alarm eval $inlibc +: determine the architecture name +echo " " +if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then + tarch=`arch`"-$osname" +elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then + if uname -m > tmparch 2>&1 ; then + tarch=`$cat tmparch`"-$osname" + else + tarch="$osname" + fi + $rm -f tmparch +else + tarch="$osname" +fi +case "$myarchname" in +''|"$tarch") ;; +*) + echo "(Your architecture name used to be $myarchname.)" + archname='' + ;; +esac +case "$archname" in +'') dflt="$tarch";; +*) dflt="$archname";; +esac +rp='What is your architecture name' +. ./myread +archname="$ans" +myarchname="$tarch" + : is AFS running? echo " " if test -d /afs; then @@ -3526,22 +3559,6 @@ prefixup='case "$prefixexp" in esac' : determine where public architecture dependent libraries go -case "$archname" in -'') - if xxx=`./loc arch blurfl $pth`; test -f "$xxx"; then - tarchname=`arch` - archname="${tarchname}-$osname" - elif xxx=`./loc uname blurfl $pth`; test -f "$xxx" ; then - if uname -m > tmparch 2>&1 ; then - tarchname=`cat tmparch` - archname="${tarchname}-$osname" - fi - $rm -f tmparch - else - archname="$osname" - fi - ;; -esac set archlib archlib eval $prefixit case "$archlib" in @@ -5582,7 +5599,7 @@ if $test -d /usr/etc/yp || $test -d /etc/yp; then . ./myread case "$ans" in y*) hostcat='nidump hosts .';; - *) hostcat='cat /etc/hosts';; + *) ;; esac fi case "$hostcat" in @@ -7921,6 +7938,7 @@ models='$models' modetype='$modetype' more='$more' mv='$mv' +myarchname='$myarchname' mydomain='$mydomain' myhostname='$myhostname' myuname='$myuname' @@ -8045,11 +8063,15 @@ exit) cont) ;; '') - echo " " dflt='' nostick=true -echo "If you didn't make any mistakes, then just type a carriage return here." - rp="If you need to edit config.sh, do it as a shell escape here:" + $cat <>Makefile <<'!NO!SUBS!' # DynaLoader may be needed for extensions that use Makefile.PL. $(DYNALOADER): miniperl preplibrary FORCE - @sh ext/util/make_ext static $@ + @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib) d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE - @sh ext/util/make_ext dynamic $@ + @sh ext/util/make_ext dynamic $@ LIBPERL_A=$(perllib) s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE - @sh ext/util/make_ext static $@ + @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib) clean: rm -f *.o *.a all perlmain.c diff --git a/U/Oldconfig.pat.2 b/U/Oldconfig.pat.2 deleted file mode 100644 index 015c951..0000000 --- a/U/Oldconfig.pat.2 +++ /dev/null @@ -1,30 +0,0 @@ -Index: Oldconfig.U -Prereq: 3.0.1.6 -*** /home2/doughera/lib/dist/U/Oldconfig.U Thu Feb 2 14:42:37 1995 ---- Oldconfig.U Sat Feb 11 10:51:05 1995 -*************** -*** 261,272 **** - osvers="$3" - ;; - osf1) case "$5" in -! alpha) osname=dec_osf -! case "$3" in -! [vt]1\.*) osvers=1 ;; -! [vt]2\.*) osvers=2 ;; -! [vt]3\.*) osvers=3 ;; -! esac - ;; - hp*) osname=hp_osf1 ;; - mips) osname=mips_osf1 ;; ---- 261,271 ---- - osvers="$3" - ;; - osf1) case "$5" in -! alpha) -! ?X: DEC OSF/1 myuname -a output looks like: osf1 xxxx t3.2 123.4 alpha -! ?X: where the version number can be either vn.n or tn.n. -! osname=dec_osf -! osvers=`echo "$3" | sed 's/^[vt]//'` - ;; - hp*) osname=hp_osf1 ;; - mips) osname=mips_osf1 ;; diff --git a/U/archlib.U b/U/archlib.U deleted file mode 100644 index 6f8a3fb..0000000 --- a/U/archlib.U +++ /dev/null @@ -1,140 +0,0 @@ -?RCS: $Id: archlib.U,v 3.0.1.2 1995/01/30 14:32:22 ram Exp $ -?RCS: -?RCS: Copyright (c) 1991-1993, Raphael Manfredi -?RCS: -?RCS: You may redistribute only under the terms of the Artistic Licence, -?RCS: as specified in the README file that comes with the distribution. -?RCS: You may reuse parts of this distribution only within the terms of -?RCS: that same Artistic Licence; a copy of which may be found at the root -?RCS: of the source tree for dist 3.0. -?RCS: -?RCS: Original Author: Andy Dougherty -?RCS: -?RCS: $Log: archlib.U,v $ -?RCS: Revision 3.0.1.2 1995/01/30 14:32:22 ram -?RCS: patch49: archname is now systematically recomputed -?RCS: patch49: can now handle installation prefix changes (from WED) -?RCS: -?RCS: Revision 3.0.1.1 1994/10/29 16:02:36 ram -?RCS: patch36: created by ADO -?RCS: -?MAKE:d_archlib archlib archlibexp installarchlib archname: afs spackage \ - cat Getfile Loc Oldconfig prefixexp privlib osname test Prefixit rm \ - Prefixup -?MAKE: -pick add $@ %< -?S:d_archlib: -?S: This variable conditionally defines ARCHLIB to hold the pathname -?S: of architecture-dependent library files for $package. If -?S: $archlib is the same as $privlib, then this is set to undef. -?S:. -?S:archname: -?S: This variable is a short name to characterize the current -?S: architecture. It is used to construct the default archlib. -?S:. -?S:archlib: -?S: This variable holds the name of the directory in which the user wants -?S: to put architecture-dependent public library files for $package. -?S: It is most often a local directory such as /usr/local/lib. -?S: Programs using this variable must be prepared to deal -?S: with filename expansion. -?S:. -?S:archlibexp: -?S: This variable is the same as the archlib variable, but is -?S: filename expanded at configuration time, for convenient use. -?S:. -?S:installarchlib: -?S: This variable is really the same as archlibexp but may differ on -?S: those systems using AFS. For extra portability, only this variable -?S: should be used in makefiles. -?S:. -?C:ARCHLIB: -?C: This variable, if defined, holds the name of the directory in -?C: which the user wants to put architecture-dependent public -?C: library files for $package. It is most often a local directory -?C: such as /usr/local/lib. Programs using this variable must be -?C: prepared to deal with filename expansion. If ARCHLIB is the -?C: same as PRIVLIB, it is not defined, since presumably the -?C: program already searches PRIVLIB. -?C:. -?C:ARCHLIB_EXP: -?C: This symbol contains the ~name expanded version of ARCHLIB, to be used -?C: in programs that are not prepared to deal with ~ expansion at run-time. -?C:. -?H:#$d_archlib ARCHLIB "$archlib" /**/ -?H:#$d_archlib ARCHLIB_EXP "$archlibexp" /**/ -?H:. -?T:xxx tarchname -: determine where public architecture dependent libraries go -?X: Always recompute archname in case osname changes -- RAM -?X: But this prevents us from setting a sensible value in a hints file -?X: or on the command line. -- ADO. -case "$archname" in -'') - if xxx=`./loc arch blurfl $pth`; test -f "$xxx"; then - tarchname=`arch` - archname="${tarchname}-$osname" - elif xxx=`./loc uname blurfl $pth`; test -f "$xxx" ; then - if uname -m > tmparch 2>&1 ; then - tarchname=`cat tmparch` - archname="${tarchname}-$osname" - fi - $rm -f tmparch - else - archname="$osname" - fi - ;; -esac -set archlib archlib -eval $prefixit -case "$archlib" in -'') - case "$privlib" in - '') - dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` - set dflt - eval $prefixup - ;; - *) dflt="$privlib/$archname";; - esac - ;; -*) dflt="$archlib";; -esac -cat </dev/null || echo "not found") 2>&1` - case "$tmp" in -! 'not found') osvers=3.2.0 ;; - '<3240'|'<>3240') osvers=3.2.0 ;; - '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; - '=3250'|'>3250') osvers=3.2.5 ;; -! *) osvers='' ;; - esac - ;; - dnix) osname=dnix ---- 180,198 ---- - - case "$1" in - aix) osname=aix -+ ?X: aix 4.1 uname -a output looks like -+ ?X: AIX foo 1 4 000123456789 -+ ?X: where $4 is the major release number and $3 is the (minor) version. -+ ?X: More detail on the version is available with the oslevel command. -+ ?X: in 3.2.x, it output a string (see case statements below). In 4.1, -+ ?X: it puts out something like 4.1.1.0 - tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` - case "$tmp" in -! 'not found') osvers="$4"."$3" ;; - '<3240'|'<>3240') osvers=3.2.0 ;; - '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; - '=3250'|'>3250') osvers=3.2.5 ;; -! *) osvers=$tmp;; - esac - ;; - dnix) osname=dnix -Index: mansrc.U -Prereq: 3.0.1.6 -*** /home2/doughera/lib/dist/U/mansrc.U Tue Jan 31 10:31:56 1995 ---- mansrc.U Thu Feb 2 14:34:36 1995 -*************** -*** 1,5 **** - ?RCS: $Id: mansrc.U,v 3.0.1.6 1995/01/30 14:39:34 ram Exp $ -- ?RCS: - ?RCS: Copyright (c) 1991-1993, Raphael Manfredi - ?RCS: - ?RCS: You may redistribute only under the terms of the Artistic Licence, ---- 1,4 ---- -*************** -*** 74,80 **** - '') - lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1" - lookpath="$lookpath $prefixexp/man/l_man/man1" -! lookpath="$lookpath /usr/local/man/man1 /usr/local/man/man1 /usr/man/manl" - lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1" - lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" - lookpath="$lookpath /usr/man/man.L" ---- 73,79 ---- - '') - lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1" - lookpath="$lookpath $prefixexp/man/l_man/man1" -! lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl" - lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1" - lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" - lookpath="$lookpath /usr/man/man.L" diff --git a/U/dist3_051.patches b/U/dist3_051.patches new file mode 100644 index 0000000..8df367c --- /dev/null +++ b/U/dist3_051.patches @@ -0,0 +1,75 @@ + +This file contains 2 patches to dist 3 (PL 51) that I used to generate +Configure for perl. + +The first patch just cleans up and extends the $osvers detection for +DEC OSF/1 on the Alpha. + +The second patch ensures that the ./mips file exists. libpth.U calls +it. + + Andy Dougherty doughera@lafcol.lafayette.edu + + +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 +*************** +*** 264,275 **** + osvers="$3" + ;; + osf1) case "$5" in +! alpha) osname=dec_osf +! case "$3" in +! [vt]1\.*) osvers=1 ;; +! [vt]2\.*) osvers=2 ;; +! [vt]3\.*) osvers=3 ;; +! esac + ;; + hp*) osname=hp_osf1 ;; + mips) osname=mips_osf1 ;; +--- 264,274 ---- + osvers="$3" + ;; + osf1) case "$5" in +! alpha) +! ?X: DEC OSF/1 myuname -a output looks like: osf1 xxxx t3.2 123.4 alpha +! ?X: where the version number can be either vn.n or tn.n. +! osname=dec_osf +! osvers=`echo "$3" | sed 's/^[vt]//'` + ;; + hp*) osname=hp_osf1 ;; + mips) osname=mips_osf1 ;; +Index: usrinc.U +Prereq: 3.0.1.1 +*** mcon/U/usrinc.U Sun May 8 22:14:36 1994 +--- /home2/doughera/lib/dist/U/usrinc.U Tue Feb 21 11:00:10 1995 +*************** +*** 60,71 **** + fi + $rm -f usr.c usr.out + echo "and you're compiling with the $mips_type compiler and libraries." + else + echo "Doesn't look like a MIPS system." + echo "exit 1" >mips +- chmod +x mips +- $eunicefix mips + fi + echo " " + case "$usrinc" in + '') ;; +--- 60,72 ---- + fi + $rm -f usr.c usr.out + echo "and you're compiling with the $mips_type compiler and libraries." ++ echo "exit 0" >mips + else + echo "Doesn't look like a MIPS system." + echo "exit 1" >mips + fi ++ chmod +x mips ++ $eunicefix mips + echo " " + case "$usrinc" in + '') ;; diff --git a/config.H b/config.H index 1fe4d86..fd370bd 100644 --- a/config.H +++ b/config.H @@ -14,7 +14,7 @@ * $Id: Config_h.U,v 3.0.1.3 1995/01/30 14:25:39 ram Exp $ */ -/* Configuration time: Sat Feb 11 12:02:12 EST 1995 +/* Configuration time: Tue Feb 21 12:13:04 EST 1995 * Configured by: andy * Target system: crystal crystal 3.2 2 i386 */ @@ -28,6 +28,12 @@ */ #define MEM_ALIGNBYTES 4 /**/ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define ARCHLIB_EXP "/usr/local/lib/perl5/i386-isc" /**/ + /* BIN: * This symbol holds the path of the bin directory where the package will * be installed. Program must be prepared to deal with ~name substitution. @@ -1347,12 +1353,6 @@ */ #define LOC_SED "/bin/sed" /**/ -/* ARCHLIB_EXP: - * This symbol contains the ~name expanded version of ARCHLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define ARCHLIB_EXP "/usr/local/lib/perl5/i386-isc" /**/ - /* CSH: * This symbol, if defined, indicates that the C-shell exists. * If defined, contains the full pathname of csh. diff --git a/config_h.SH b/config_h.SH index aea3abb..33aad34 100755 --- a/config_h.SH +++ b/config_h.SH @@ -42,6 +42,12 @@ sed <config.h -e 's!^#undef!/\*#define!' -e 's!^#un-def!#undef!' */ #define MEM_ALIGNBYTES $alignbytes /**/ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#$d_archlib ARCHLIB_EXP "$archlibexp" /**/ + /* BIN: * This symbol holds the path of the bin directory where the package will * be installed. Program must be prepared to deal with ~name substitution. @@ -1361,12 +1367,6 @@ sed <config.h -e 's!^#undef!/\*#define!' -e 's!^#un-def!#undef!' */ #define LOC_SED "$full_sed" /**/ -/* ARCHLIB_EXP: - * This symbol contains the ~name expanded version of ARCHLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#$d_archlib ARCHLIB_EXP "$archlibexp" /**/ - /* CSH: * This symbol, if defined, indicates that the C-shell exists. * If defined, contains the full pathname of csh. diff --git a/ext/DB_File/Makefile.PL b/ext/DB_File/Makefile.PL index 7100ce6..c300d85 100644 --- a/ext/DB_File/Makefile.PL +++ b/ext/DB_File/Makefile.PL @@ -1,2 +1,2 @@ use ExtUtils::MakeMaker; -WriteMakefile(LIBS => ["-ldb"]); +WriteMakefile(LIBS => ["-L/usr/local/lib -ldb"]); diff --git a/ext/GDBM_File/Makefile.PL b/ext/GDBM_File/Makefile.PL index bd91b80..ababcc7 100644 --- a/ext/GDBM_File/Makefile.PL +++ b/ext/GDBM_File/Makefile.PL @@ -1,2 +1,2 @@ use ExtUtils::MakeMaker; -WriteMakefile(LIBS => ["-lgdbm", "-ldbm"]); +WriteMakefile(LIBS => ["-L/usr/local/lib -lgdbm", "-ldbm"]); diff --git a/ext/NDBM_File/Makefile.PL b/ext/NDBM_File/Makefile.PL index ecd89ea..37e4a5d 100644 --- a/ext/NDBM_File/Makefile.PL +++ b/ext/NDBM_File/Makefile.PL @@ -1,2 +1,2 @@ use ExtUtils::MakeMaker; -WriteMakefile(LIBS => ["-lndbm", "-ldbm -lucb"]); +WriteMakefile(LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"]); diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 941e59a..1a900f0 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -908,7 +908,12 @@ int arg; #endif break; } - if (strEQ(name, "FD_CLOEXEC")) return FD_CLOEXEC; + if (strEQ(name, "FD_CLOEXEC")) +#ifdef FD_CLOEXEC + return FD_CLOEXEC; +#else + goto not_there; +#endif if (strEQ(name, "FILENAME_MAX")) #ifdef FILENAME_MAX return FILENAME_MAX; diff --git a/ext/SDBM_File/sdbm/Makefile.PL b/ext/SDBM_File/sdbm/Makefile.PL index 1994f05..f42a165 100644 --- a/ext/SDBM_File/sdbm/Makefile.PL +++ b/ext/SDBM_File/sdbm/Makefile.PL @@ -4,46 +4,25 @@ WriteMakefile( 'DEFINE' => '-DSDBM -DDUFF', 'SKIP' => [qw(static static_lib dynamic dynamic_lib)], 'clean' - => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'} + => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'}, + 'H' => [qw(tune.h sdbm.h pair.h $(PERL_INC)/config.h)], + 'C' => [qw(sdbm.c pair.c hash.c)] ); sub MY::top_targets { ' -LIBOBJS = sdbm.o pair.o hash.o -LIBSRCS = sdbm.c pair.c hash.c -HDRS = tune.h sdbm.h pair.h - all :: static static :: libsdbm.a -libsdbm.a: $(LIBOBJS) - ar cr libsdbm.a $(LIBOBJS) - $(RANLIB) libsdbm.a - -$(LIBOBJS): $(HDRS) $(PERL_INC)/config.h - config :: +libsdbm.a: $(O_FILES) + ar cr libsdbm.a $(O_FILES) + $(RANLIB) libsdbm.a + lint: lint -abchx $(LIBSRCS) '; } - - -sub MY::realclean { - ' -realclean :: clean - rm -f Makefile -'; -} - - -sub MY::postamble { - ' -sdbm.o : sdbm.c $(PERL_INC)/config.h sdbm.h tune.h pair.h -hash.o : hash.c $(PERL_INC)/config.h sdbm.h -pair.o : pair.c $(PERL_INC)/config.h sdbm.h tune.h pair.h -'; -} diff --git a/ext/util/make_ext b/ext/util/make_ext index ae10a9d..84c4925 100644 --- a/ext/util/make_ext +++ b/ext/util/make_ext @@ -92,7 +92,7 @@ dynamic) makeargs="LINKTYPE=dynamic"; esac if test ! -f $makefile ; then - test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL + test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL $passthru fi if test ! -f $makefile ; then if test -f Makefile.SH; then diff --git a/h2xs b/h2xs.SH similarity index 92% rename from h2xs rename to h2xs.SH index 401600a..c87aa6e 100755 --- a/h2xs +++ b/h2xs.SH @@ -1,4 +1,27 @@ -#!/usr/bin/perl +case $CONFIG in +'') + if test -f config.sh; then TOP=.; + elif test -f ../config.sh; then TOP=..; + elif test -f ../../config.sh; then TOP=../..; + elif test -f ../../../config.sh; then TOP=../../..; + elif test -f ../../../../config.sh; then TOP=../../../..; + else + echo "Can't find config.sh."; exit 1 + fi + . $TOP/config.sh + ;; +esac +: This forces SH files to create target in same directory as SH file. +: This is so that make depend always knows where to find SH derivatives. +case "$0" in +*/*) cd `expr X$0 : 'X\(.*\)/'` ;; +esac +echo "Extracting h2xs (with variable substitutions)" +$spitshell >h2xs <>h2xs <<'!NO!SUBS!' =head1 NAME @@ -395,3 +418,6 @@ print PL ");\n"; system '/bin/ls > MANIFEST'; +!NO!SUBS! +chmod 755 h2xs +$eunicefix h2xs diff --git a/hints/next_3_2.sh b/hints/next_3_2.sh index ccdf12a..aba25b9 100644 --- a/hints/next_3_2.sh +++ b/hints/next_3_2.sh @@ -24,3 +24,10 @@ d_tcsetpgrp='define' # running ranlib. The '5' is an empirical number that's "long enough." # (Thanks to Andreas Koenig ) ranlib='sleep 5; /bin/ranlib' +# +# There where reports that the compiler on HPPA machines +# fails with the -O flag on pp.c. +if [ `arch` = "hppa" ]; then +pp_cflags='optimize="-g"' +fi + diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh index 4ae9063..b940663 100644 --- a/hints/solaris_2.sh +++ b/hints/solaris_2.sh @@ -2,7 +2,13 @@ usevfork=false d_suidsafe=define set `echo $glibpth | sed -e 's@/usr/ucblib@@'` glibpth="$*" -set `echo " $libswanted " | sed -e 's@ ld @ @' -e 's@ ucb @ @'` +# Remove bad libraries. -lucb contains incompatible routines. +# -lld doesn't do anything useful. +# -lmalloc can cause a problem with GNU CC & Solaris. Specifically, +# libmalloc.a may allocate memory that is only 4 byte aligned, but +# GNU CC on the Sparc assumes that doubles are 8 byte aligned. +# Thanks to Hallvard B. Furuseth +set `echo " $libswanted " | sed -e 's@ ld @ @' -e 's@ malloc @ @' -e 's@ ucb @ @'` libswanted="$*" # Look for architecture name. We want to suggest a useful default @@ -30,3 +36,4 @@ Remove /usr/ucb from your PATH if you have difficulties. END ;; esac + diff --git a/hints/unicos.sh b/hints/unicos.sh index d23cbe3..6c43129 100644 --- a/hints/unicos.sh +++ b/hints/unicos.sh @@ -6,3 +6,8 @@ optimize="-O1" libswanted=m d_setregid='undef' d_setreuid='undef' + +# Pick up dbm.h in +if test -f /usr/include/rpcsvc/dbm.h; then + ccflags="$ccflags -I/usr/include/rpcsvc" +fi diff --git a/installperl b/installperl index d41ff99..ed8912c 100755 --- a/installperl +++ b/installperl @@ -12,7 +12,7 @@ while (@ARGV) { umask 022; -@scripts = ('cppstdin', 'c2ph', 'pstruct', 'x2p/s2p', 'x2p/find2perl'); +@scripts = ('cppstdin', 'c2ph', 'h2xs', 'pstruct', 'x2p/s2p', 'x2p/find2perl'); @manpages = (, 'x2p/a2p.man', 'x2p/s2p.man'); # Read in the config file. diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 9aa57ec..b27e088 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -85,22 +85,23 @@ sub fastcwd { ($cdev, $cino) = stat('.'); for (;;) { + my $direntry; ($odev, $oino) = ($cdev, $cino); chdir('..'); ($cdev, $cino) = stat('.'); last if $odev == $cdev && $oino == $cino; opendir(DIR, '.'); for (;;) { - $_ = readdir(DIR); - next if $_ eq '.'; - next if $_ eq '..'; + $direntry = readdir(DIR); + next if $direntry eq '.'; + next if $direntry eq '..'; - last unless defined; - ($tdev, $tino) = lstat($_); + last unless defined $direntry; + ($tdev, $tino) = lstat($direntry); last unless $tdev != $odev || $tino != $oino; } closedir(DIR); - unshift(@path, $_); + unshift(@path, $direntry); } chdir($path = '/' . join('/', @path)); $path; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 6518bcc..ec17f1b 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -1,6 +1,6 @@ package ExtUtils::MakeMaker; -$Version = 4.06; # Last edited 10th Feb 1995 by Andreas Koenig +$Version = 4.085; # Last edited 21st Feb 1995 by Andreas Koenig use Config; check_hints(); @@ -62,15 +62,15 @@ to invoke perl Makefile.PL make - make test - make install # May need to invoke as root to write into INST_LIB + make test # optionally set TEST_VERBOSE=1 + make install # See below The Makefile to be produced may be altered by adding arguments of the form C. If the user wants to have the extension installed into a directory different from C<$Config{"installprivlib"}> it can be done by specifying - perl Makefile.PL INST_LIB=~/myperllib + perl Makefile.PL INST_LIB=~/myperllib INST_EXE=~/bin Note, that in this example MakeMaker does the tilde expansion for you and INST_ARCHLIB is set to either C if @@ -86,7 +86,7 @@ Other interesting targets in the generated Makefile are The macros in the produced Makefile may be overridden on the command line to the make call as in the following example: - make INST_LIB=/some/where INST_ARCHLIB=/some/where + make INST_LIB=/some/where INST_ARCHLIB=/some/where INST_EXE=/u/k/bin Note, that this is a solution provided by C in general, so tilde expansion will probably not be available and INST_ARCHLIB will not be @@ -95,7 +95,45 @@ set automatically when INST_LIB is given as argument. The generated Makefile does not set any permissions. The installer has to decide, which umask should be in effect. -=head2 Support to Link a New Perl Binary +=head2 Special case C + +The I target of the generated Makefile is for system +administrators only that have writing permissions on the +system-specific directories $Config{installprivlib}, +$Config{installarchlib}, and $Config{installbin}. This works, because +C alone in fact puts all relevant files into directories that +are named by the macros INST_LIB, INST_ARCHLIB, and INST_EXE. All +three default to ./blib if you are not building below the perl source +directory. C is just a recursive call to C with +the three relevant parameters set accordingly to the system-wide +defaults. + +C per default writes some documentation of what has been +done into the file C<$Config{'installarchlib'}/perllocal.pod>. This is +an experimental feature. It can be bypassed by calling C. + +Users that do not have privileges on the system but want to install +the relevant files of the module into their private library or binary +directories do not call C. In priciple they have the +choice to either say + + # case: trust the module + perl Makefile.PL INST_LIB=~/perllib INST_EXE=~/bin + make + make test + +or + + # case: want to run tests before installation + perl Makefile.PL + make + make test + make INST_LIB=/some/where INST_ARCHLIB=/foo/bar INST_EXE=/somebin + +(C is not necessarily supported for all modules.) + +=head2 Support to Link a new Perl Binary An extension that is built with the above steps is ready to use on systems supporting dynamic loading. On systems that do not support @@ -107,22 +145,40 @@ is built. You can invoke the corresponding section of the makefile with make perl That produces a new perl binary in the current directory with all -extensions that are present on the system (either in the current build -environment or in the perl library) linked in. +extensions linked in that can be found in INST_ARCHLIB and +PERL_ARCHLIB. The binary can be installed into the directory where perl normally resides on your machine with make inst_perl -Note, that there is a C scipt available, that supports the -linking of a new perl binary in a similar fashion, but with more -options for those, that want to build perl binaries of the -not-quite-everyday type. +To produce a perl binary with a different name than C, either say + + perl Makefile.PL MAP_TARGET=myperl + make myperl + make inst_perl + +or say -Warning: The perl: and inst_perl: targets are new in MakeMaker v4.06, -and should be watched with care. Watch out for what it does and what -you want! + perl Makefile.PL + make myperl MAP_TARGET=myperl + make inst_perl MAP_TARGET=myperl + +In any case you will be prompted with the correct invocation of the +C target that installs the new binary into +$Config{'installbin'}. + +Note, that there is a C scipt in the perl distribution, +that supports the linking of a new perl binary in a similar fashion, +but with more options. + +C per default writes some documentation of what has been +done into the file C<$Config{'installarchlib'}/perllocal.pod>. This +can be bypassed by calling C. + +Warning: the inst_perl: target is rather mighty and will probably +overwrite your existing perl binary. Use with care! =head2 Determination of Perl Library and Installation Locations @@ -310,7 +366,7 @@ $Attrib_Help = <<'END'; PMLIBDIRS: Ref to array of subdirectories containing library files. Defaults to [ 'lib', $(BASEEXT) ]. The directories will - be scanned and any *.pm and *.pl files they contain will + be scanned and any files they contain will be installed in the corresponding location in the library. A MY::libscan() function can be used to alter the behaviour. Defining PM in the Makefile.PL will override PMLIBDIRS. @@ -333,6 +389,14 @@ $Attrib_Help = <<'END'; H: Ref to array of *.h file names. Similar to C: above. + EXE_FILES: Ref to array of executable files. The files will be copied to + the INST_EXE directory. The installed files will be deleted + by a make realclean. + + INST_EXE: Directory, where executable scripts should be installed. Defaults + to "./blib", just to have a dummy location during testing. + C will set INST_EXE to $Config{'installbin'}. + LINKTYPE: =>'static' or 'dynamic' (default unless usedl=undef in config.sh) Should only be used to force static linking (also see linkext below). @@ -354,6 +418,12 @@ $Attrib_Help = <<'END'; CONFIG: =>[qw(archname manext)] defines ARCHNAME & MANEXT from config.sh SKIP: =>[qw(name1 name2)] skip (do not write) sections of the Makefile + MAP_TARGET: If it is intended, that a new perl binary be produced, this variable + may hold a name for that binary. Defaults to C + + LIBPERL_A: The filename of the perllibrary that will be used together + with this extension. Defaults to C. + PERL: FULLPERL: @@ -394,6 +464,7 @@ sub help {print $Attrib_Help;} 'static' => {}, 'static_lib' => {}, 'installpm' => {}, + 'installbin' => {}, 'subdirs' => {}, 'clean' => {}, 'realclean' => {}, @@ -679,6 +750,9 @@ sub init_main { "(not architecture independent).\n"; } } + $att{INST_EXE} = "./blib" unless $att{INST_EXE}; + $att{MAP_TARGET} = "perl" unless $att{MAP_TARGET}; + $att{LIBPERL_A} = 'libperl.a' unless $att{LIBPERL_A}; } # make a few simple checks @@ -794,8 +868,9 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm etc) # return unless m/\.p[ml]$/; return if -d $_; # anything else that Can't be copied? my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)'); - $prefix = '$(INST_LIB)' if ($path =~ s:^lib/::); - local($_) = "$prefix/$path"; + my $striplibpath; + $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^lib/::); + local($_) = "$prefix/$striplibpath"; my($inst) = MY->libscan(); print "libscan($path) => '$inst'" if ($Verbose >= 2); return unless $inst; @@ -815,6 +890,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm etc) sub libscan { + return undef if m:/RCS/: ; $_; } @@ -944,10 +1020,12 @@ VERSION = $att{VERSION} # (also see INST_LIBDIR and relationship to ROOTEXT) INST_LIB = $att{INST_LIB} INST_ARCHLIB = $att{INST_ARCHLIB} +INST_EXE = $att{INST_EXE} # Perl library to use when building the extension PERL_LIB = $att{PERL_LIB} PERL_ARCHLIB = $att{PERL_ARCHLIB} +LIBPERL_A = $att{LIBPERL_A} "; # Define I_PERL_LIBS to include the required -Ipaths @@ -1027,16 +1105,38 @@ INST_PM = '.join(" \\\n\t", sort values %{$att{PM}}).' sub const_cccmd{ + my($self,$libperl)=@_; + $libperl or $libperl = $att{LIBPERL_A} || "libperl.a" ; # This is implemented in the same manner as extliblist, # e.g., do both and compare results during the transition period. my($cc,$ccflags,$optimize,$large,$split, $shflags) = @Config{qw(cc ccflags optimize large split shellflags)}; $shflags = '' unless $shflags; - my($prog, $old); + my($prog, $old, $uc, $perltype); - chop($old = `cd $att{PERL_SRC}; sh $shflags ./cflags $att{BASEEXT}.c 2>/dev/null`) + chop($old = `cd $att{PERL_SRC}; sh $shflags ./cflags $libperl $att{BASEEXT}.c 2>/dev/null`) if $att{PERL_SRC}; + my(%map) = ( + D => '-DDEBUGGING', + E => '-DEMBED', + DE => '-DDEBUGGING -DEMBED', + M => '-DEMBED -DMULTIPLICITY', + DM => '-DDEBUGGING -DEMBED -DMULTIPLICITY', + ); + + if ($libperl =~ /libperl(\w*)\.a/){ + $uc = uc($1); + } else { + $uc = ""; # avoid warning + } + $perltype = $map{$uc} ? $map{$uc} : ""; + + if ($uc =~ /^D/) { + $optdebug = "-g"; + } + + my($name); ( $name = $att{NAME} . "_cflags" ) =~ s/:/_/g ; if ($prog = $Config{$name}) { @@ -1045,12 +1145,16 @@ sub const_cccmd{ my(@o)=`cc=\"$cc\" ccflags=\"$ccflags\" optimize=\"$optimize\" + perltype=\"$perltype\" + optdebug=\"$optdebug\" large=\"$large\" split=\"$split\" eval '$prog' echo cc=\$cc echo ccflags=\$ccflags echo optimize=\$optimize + echo perltype=\$perltype + echo optdebug=\$optdebug echo large=\$large echo split=\$split `; @@ -1064,10 +1168,15 @@ sub const_cccmd{ print STDOUT "Unrecognised result from hint: '$line'\n"; } } - ($cc,$ccflags,$optimize,$large,$split)=@cflags{qw(cc ccflags optimize large split)}; + ( $cc,$ccflags,$perltype,$optdebug,$optimize,$large,$split )=@cflags{ + qw( cc ccflags perltype optdebug optimize large split)}; + } + + if ($optdebug) { + $optimize = $optdebug; } - my($new) = "$cc -c $ccflags $optimize $large $split"; + my($new) = "$cc -c $ccflags $optimize $perltype $large $split"; if (defined($old) and $new ne $old) { print STDOUT "Warning (non-fatal): cflags evaluation in MakeMaker differs from shell output\n" ." package: $att{NAME}\n" @@ -1189,6 +1298,7 @@ sub post_constants{ # --- Translation Sections --- sub c_o { + my(@m); push @m, ' .c.o: $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c @@ -1215,6 +1325,7 @@ sub xs_o { # many makes are too dumb to use xs_c then c_o # --- Target Sections --- sub top_targets{ + my(@m); push @m, ' all :: config linkext $(INST_PM) '.$att{NOOP}.' @@ -1242,7 +1353,7 @@ $att{NOOP} sub dlsyms { my($self,%attribs) = @_; - return '' if ($Config{'osname'} ne 'AIX'); + return '' if ($Config{'osname'} ne 'aix'); my($funcs) = $attribs{DL_FUNCS} || $att{DL_FUNCS} || {}; my($vars) = $attribs{DL_VARS} || $att{DL_VARS} || []; @@ -1262,8 +1373,8 @@ static :: $att{BASEEXT}.exp $att{BASEEXT}.exp: Makefile.PL ",' $(PERL) $(I_PERL_LIBS) -e \'use ExtUtils::MakeMaker; \\ mksymlists(DL_FUNCS => ', - %$funcs ? neatvalue($funcs) : "''",', DL_VARS => ', - @$vars ? neatvalue($vars) : "''",")' + %$funcs ? neatvalue($funcs) : '""',', DL_VARS => ', + @$vars ? neatvalue($vars) : '""',")' "); join('',@m); @@ -1289,14 +1400,15 @@ BOOTSTRAP = '."$att{BASEEXT}.bs".' # we use touch to prevent make continually trying to remake it. # The DynaLoader only reads a non-empty file. $(BOOTSTRAP): '."$att{MAKEFILE} $att{BOOTDEP}".' - $(PERL) $(I_PERL_LIBS) \ + @ echo "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))" + @ $(PERL) $(I_PERL_LIBS) \ -e \'use ExtUtils::MakeMaker; &mkbootstrap("$(BSLOADLIBS)");\' \ INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) PERL_SRC=$(PERL_SRC) NAME=$(NAME) @ $(TOUCH) $(BOOTSTRAP) $(INST_BOOT): $(BOOTSTRAP) @ '.$att{RM_RF}.' $(INST_BOOT) - - '.$att{CP}.' $(BOOTSTRAP) $(INST_BOOT) + -'.$att{CP}.' $(BOOTSTRAP) $(INST_BOOT) '; } @@ -1352,7 +1464,6 @@ END push(@m, " $att{CP} \$(MYEXTLIB) \$\@\n") if $att{MYEXTLIB}; push(@m, <<'END'); - @ $(MKPATH) $(INST_ARCHAUTODIR) ar cr $@ $(OBJECT) && $(RANLIB) $@ @echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld END @@ -1396,12 +1507,42 @@ $inst: $dist Makefile @ $(MKPATH) '.$instdir.' '."$att{CP} $dist".' $@ '); - push(@m, "\t\$(AUTOSPLITFILE) \$@ $splitlib/auto\n") + push(@m, "\t\@\$(AUTOSPLITFILE) \$@ $splitlib/auto\n") if ($splitlib and $inst =~ m/\.pm$/); join('', @m); } +sub installbin { + return "" unless $att{EXE_FILES} && ref $att{EXE_FILES} eq "ARRAY"; + my(@m, $from, $to, %fromto, @to); + for $from (@{$att{EXE_FILES}}) { + local($_)= '$(INST_EXE)/' . basename($from); + $to = MY->exescan(); + print "exescan($from) => '$to'" if ($Verbose >=2); + $fromto{$from}=$to; + } + @to = values %fromto; + push(@m, " +EXE_FILES = @{$att{EXE_FILES}} + +all :: @to + +realclean :: + $att{RM_F} @to +"); + + while (($from,$to) = each %fromto) { + push @m, " +$to: $from $att{MAKEFILE} + $att{CP} $from $to +"; + } + join "", @m; +} +sub exescan { + $_; +} # --- Sub-directory Sections --- sub subdirs { @@ -1444,13 +1585,15 @@ sub subdir_x { # MY::subdir_x() method to override this one. qq{ config :: $subdir/$att{MAKEFILE} - cd $subdir ; \$(MAKE) config INST_LIB=\$(INST_LIB) INST_ARCHLIB=\$(INST_ARCHLIB) LINKTYPE=\$(LINKTYPE) + cd $subdir ; \$(MAKE) config INST_LIB=\$(INST_LIB) INST_ARCHLIB=\$(INST_ARCHLIB) \\ + INST_EXE=\$(INST_EXE) LINKTYPE=\$(LINKTYPE) LIBPERL_A=\$(LIBPERL_A) \$(SUBDIR_MAKEFILE_PL_ARGS) $subdir/$att{MAKEFILE}: $subdir/Makefile.PL \$(CONFIGDEP) }.' @echo "Rebuilding $@ ..." $(PERL) $(I_PERL_LIBS) \\ -e "use ExtUtils::MakeMaker; MM->runsubdirpl(qw('.$subdir.'))" \\ - INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) $(SUBDIR_MAKEFILE_PL_ARGS) + INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) \\ + INST_EXE=$(INST_EXE) LINKTYPE=\$(LINKTYPE) LIBPERL_A=$(LIBPERL_A) $(SUBDIR_MAKEFILE_PL_ARGS) @echo "Rebuild of $@ complete." '.qq{ @@ -1478,7 +1621,7 @@ clean :: push(@otherfiles, $attribs{FILES}) if $attribs{FILES}; push(@otherfiles, "./blib"); push(@m, " -$att{RM_RF} *~ t/*~ *.o *.a mon.out core so_locations " - ."\$(BOOTSTRAP) \$(BASEEXT).bso @otherfiles\n"); + ."\$(BOOTSTRAP) \$(BASEEXT).bso \$(BASEEXT).exp @otherfiles\n"); # See realclean and ext/utils/make_ext for usage of Makefile.old push(@m, " -$att{MV} $att{MAKEFILE} $att{MAKEFILE}.old 2>/dev/null\n"); push(@m, " $attribs{POSTOP}\n") if $attribs{POSTOP}; @@ -1502,7 +1645,7 @@ realclean purge :: clean push(@m, " $att{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n"); push(@m, " $att{RM_F} \$(INST_STATIC) \$(INST_PM)\n"); my(@otherfiles) = ($att{MAKEFILE}, - "Perl.make", "$att{MAKEFILE}.old"); # Makefiles last + "$att{MAKEFILE}.old"); # Makefiles last push(@otherfiles, $attribs{FILES}) if $attribs{FILES}; push(@m, " $att{RM_RF} @otherfiles\n") if @otherfiles; push(@m, " $attribs{POSTOP}\n") if $attribs{POSTOP}; @@ -1537,15 +1680,18 @@ sub test { my($tests) = $attribs{TESTS} || (-d "t" ? "t/*.t" : ""); my(@m); push(@m," +TEST_VERBOSE=0 + test :: all "); push(@m, <<"END") if $tests; - \$(FULLPERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) -e 'use Test::Harness; runtests \@ARGV;' $tests + \$(FULLPERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) -e 'use Test::Harness qw(&runtests \$\$verbose); \$\$verbose=\$(TEST_VERBOSE); runtests \@ARGV;' $tests END push(@m, <<'END') if -f "test.pl"; $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) test.pl END - push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test LINKTYPE=\$(LINKTYPE)\n",@{$att{DIR}})); + push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test LINKTYPE=\$(LINKTYPE)\n", + @{$att{DIR}})); push(@m, "\t\@echo 'No tests defined for \$(NAME) extension.'\n") unless @m > 1; join("", @m); } @@ -1554,15 +1700,25 @@ END sub install { my($self, %attribs) = @_; my(@m); + push @m, q{ +doc_install :: + @ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \\ + -e 'use ExtUtils::MakeMaker; MM->writedoc("Module", "$(NAME)", \\ + "LINKTYPE=$(LINKTYPE)", "VERSION=$(VERSION)", "EXE_FILES=$(EXE_FILES)")' +}; + push(@m, " -install :: all +install :: pure_install doc_install + +pure_install :: all "); # install subdirectories first push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) install\n",@{$att{DIR}})); push(@m, "\t: perl5.000 and MM pre 3.8 autosplit into INST_ARCHLIB, we delete these old files here - $att{RM_F} $Config{'installarchlib'}/auto/\$(FULLEXT)/*.al $Config{'installarchlib'}/auto/\$(FULLEXT)/*.ix - \$(MAKE) INST_LIB=$Config{'installprivlib'} INST_ARCHLIB=$Config{'installarchlib'} + $att{RM_F} $Config{'installarchlib'}/auto/\$(FULLEXT)/*.al + $att{RM_F} $Config{'installarchlib'}/auto/\$(FULLEXT)/*.ix + \$(MAKE) INST_LIB=$Config{'installprivlib'} INST_ARCHLIB=$Config{'installarchlib'} INST_EXE=$Config{'installbin'} "); join("",@m); @@ -1643,17 +1799,14 @@ sub staticmake { my(@searchdirs)=keys %searchdirs; # And as it's not yet built, we add the current extension my(@static)="$att{INST_ARCHLIB}/auto/$att{FULLEXT}/$att{BASEEXT}.a"; - my(@extra); - push(@extra, split(' ', $att{EXTRALIBS})) if defined $att{EXTRALIBS}; my(@perlinc) = ($att{INST_ARCHLIB}, $att{INST_LIB}, $att{PERL_ARCHLIB}, $att{PERL_LIB}); MY->makeaperl('MAKE' => $att{MAKEFILE}, 'DIRS' => \@searchdirs, 'STAT' => \@static, - 'EXTRA' => \@extra, 'INCL' => \@perlinc, - 'TARGET' => "perl", + 'TARGET' => $att{MAP_TARGET}, 'TMP' => "", - 'LIBPERL' => "$att{PERL_INC}/libperl.a" + 'LIBPERL' => $att{LIBPERL_A} ); } @@ -1662,10 +1815,10 @@ sub makeaperl { my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) = @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)}; my(@m); - my($cccmd, $linkcmd, %map); + my($cccmd, $linkcmd); # This emulates cflags to get the compiler invocation... - $cccmd = MY->const_cccmd(); + $cccmd = MY->const_cccmd($libperl); $cccmd =~ s/^CCCMD\s*=\s*//; chomp $cccmd; $cccmd =~ s/\s/ -I$att{PERL_INC} /; @@ -1677,38 +1830,31 @@ sub makeaperl { $linkcmd =~ s/\s+/ /g; # Which *.a files could we make use of... - local(%static,%libperl); + local(%static); File::Find::find(sub { return unless m/\.a$/; - if (m/^libperl/) { - $libperl{$File::Find::name}++; - return; - } - $static{$File::Find::name}++; + return if m/^libperl/; + $static{fastcwd() . "/" . $_}++; }, grep( -d $_, @{$searchdirs || []}) ); + # We trust that what has been handed in as argument, will be buildable + $static = [] unless $static; + @static{@{$static}} = (1) x @{$static}; + $extra = [] unless $extra && ref $extra eq 'ARRAY'; for (sort keys %static) { next unless /\.a$/; - s#^#./# unless m#/#; # Prepend "./" if it is in the current dir - s#(.*/).*#$1extralibs.ld#; - if (-f $_){ - push @$extra, split(' ',`cat $_`); - } else { - print STDOUT "$0: warning $_ not found"; - } + $_ = dirname($_) . "/extralibs.ld"; + push @$extra, "`cat $_`"; } - # These have been handed in explicitly, so we do not read extralibs.ld for them, - # they might not even exist, and extralibs.ld might be outdated. - @static{@{$static || []}} = (1) x @{$static || []}; grep(s/^/-I/, @$perlinc); $target = "perl" unless $target; $tmp = "." unless $tmp; push @m, " -# Fill in the target you want to produce if it's not perl +# --- MakeMaker makeaperl section --- MAP_TARGET = $target FULLPERL = $att{'FULLPERL'} MAP_LINKCMD = $linkcmd @@ -1718,74 +1864,63 @@ join(" ", sort keys %static), " MAP_EXTRA = @{$extra} MAP_PRELIBS = $Config{'libs'} $Config{'cryptlib'} "; - - my(@libperl); if ($libperl) { - @libperl = $libperl; - } else { - @libperl = sort keys %libperl; - if (@libperl==0 && defined $att{PERL_SRC}) { - push @libperl, "$att{PERL_SRC}/libperl.a"; - } - if (@libperl==0 && -f "$INC[0]/CORE/libperl.a") { - push @libperl, "$INC[0]/CORE/libperl.a"; - } - if (@libperl==0){ - push @m, "\nMAP_LIBPERL = ---NOT FOUND---\n\n"; + unless (-f $libperl || -f ($libperl = "$Config{'installarchlib'}/CORE/$libperl")){ + print STDOUT "Warning: $libperl not found"; + undef $libperl; } } - - # if we have to work with other libraries than libperl.a... - %map = ( - D => '-DDEBUGGING', - E => '-DEMBED', - DE => '-DDEBUGGING -DEMBED', - M => '-DEMBED -DMULTIPLICITY', - DM => '-DDEBUGGING -DEMBED -DMULTIPLICITY', - ); - for (@libperl) { - my($uc, $thiscccmd); - ( $uc = $_ ) =~ s!.*/libperl(\w*)\.a!uc($1)!e; - - # We have to tamper with the cccmd... - $thiscccmd = $cccmd; - # All perls of flavor D need a compilation with -g instead of - # whatever optimize was before - if ($uc =~ /^D/) { - $thiscccmd =~ s/\B$Config{'optimize'}\b/-g/; + unless ($libperl) { + if (defined $att{PERL_SRC}) { + $libperl = "$att{PERL_SRC}/libperl.a"; + } elsif ( -f ( $libperl = "$Config{'installarchlib'}/CORE/libperl.a" )) { + } else { + print STDOUT "Warning: $libperl not found"; } - $thiscccmd .= $map{$uc} if $uc; - $thiscccmd =~ s/\s+/ /g; - - # If we have to write the Makefile for only one - # target, we do not need the variable $uc - $uc = "" if @libperl == 1; - - push @m, "MAP_LIBPERL$uc = $_ -$target$uc: $tmp/perlmain$uc.o \$(MAP_LIBPERL$uc) \$(MAP_STATIC) - \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain$uc.o \$(MAP_LIBPERL$uc) \$(MAP_STATIC) \$(MAP_EXTRA) \$(MAP_PRELIBS) + } -$tmp/perlmain$uc.o: $tmp/perlmain$uc.c + push @m, " +MAP_LIBPERL = $libperl "; - push @m, "\tcd $tmp && $thiscccmd perlmain$uc.c\n"; - if ($uc) { - push @m, "$tmp/perlmain$uc.c: $tmp/perlmain.c - cp \$< \$\@\n\n"; - } - } + push @m, " +\$(MAP_TARGET): $tmp/perlmain.o \$(MAP_LIBPERL) \$(MAP_STATIC) + \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain.o \$(MAP_LIBPERL) \$(MAP_STATIC) \$(MAP_EXTRA) \$(MAP_PRELIBS) + @ echo 'To install the new \"\$(MAP_TARGET)\" binary, call' + @ echo ' make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)' + @ echo 'To remove the intermediate files say' + @ echo ' make -f $makefilename map_clean' + +$tmp/perlmain.o: $tmp/perlmain.c +"; + push @m, "\tcd $tmp && $cccmd perlmain.c\n"; push @m, qq{ $tmp/perlmain.c: $makefilename}, q{ - $(FULLPERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\ - writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@ + @ echo Writing $@ + @ $(FULLPERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\ + writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@ + +}; +# We write MAP_EXTRA outside the perl program to have it eval'd by the shell + push @m, q{ +doc_inst_perl: + @ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary", \\ + "$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)", \\ + "MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- $(MAP_EXTRA) }; push @m, qq{ -inst_perl: \$(MAP_TARGET) +inst_perl: pure_inst_perl doc_inst_perl + +pure_inst_perl: \$(MAP_TARGET) $att{CP} \$(MAP_TARGET) $Config{'installbin'}/\$(MAP_TARGET) +realclean :: map_clean + +map_clean : + $att{RM_F} $tmp/perlmain.o $tmp/perlmain.c $makefilename }; join '', @m; @@ -1794,58 +1929,9 @@ inst_perl: \$(MAP_TARGET) # --- Determine libraries to use and how to use them --- sub extliblist{ - my($self, $libs) = @_; - return ("", "", "") unless $libs; - print STDOUT "Potential libraries are '$libs':" if $Verbose; - my(@new) = MY->new_extliblist($libs); - - if ($att{PERL_SRC}){ - my(@old) = MY->old_extliblist($libs); - my($oldlibs) = join(" : ",@old); - my($newlibs) = join(" : ",@new); - print STDOUT "Warning (non-fatal): $att{NAME} extliblist consistency check failed:\n". - " old: $oldlibs\n". - " new: $newlibs\n". - "Using 'new' set. Please notify perl5-porters\@nicoh.com.\n" - if ("$newlibs" ne "$oldlibs"); - } - @new; -} - - -sub old_extliblist { - my($self, $potential_libs)=@_; - return ("", "", "") unless $potential_libs; - die "old_extliblist requires PERL_SRC" unless $att{PERL_SRC}; - - my(%attrib, @w); - # Now run ext/util/extliblist to discover what *libs definitions - # are required for the needs of $potential_libs - $ENV{'potential_libs'} = $potential_libs; - my(@o)=`. $att{PERL_SRC}/config.sh - . $att{PERL_SRC}/ext/util/extliblist; - echo EXTRALIBS=\$extralibs - echo BSLOADLIBS=\$dynaloadlibs - echo LDLOADLIBS=\$statloadlibs - `; - foreach $line (@o){ - chomp $line; - if ($line =~ /(.*)\s*=\s*(.*)\s*$/){ - $attrib{$1} = $2; - print STDOUT " $1 = $2" if $Verbose; - }else{ - push(@w, $line); - } - } - print STDOUT "Messages from extliblist:\n", join("\n",@w,'') - if @w ; - @attrib{qw(EXTRALIBS BSLOADLIBS LDLOADLIBS)}; -} - - -sub new_extliblist { my($self, $potential_libs)=@_; return ("", "", "") unless $potential_libs; + print STDOUT "Potential libraries are '$potential_libs':" if $Verbose; my($so) = $Config{'so'}; my($libs) = $Config{'libs'}; @@ -1857,11 +1943,10 @@ sub new_extliblist { my(@searchpath); # from "-L/path" entries in $potential_libs my(@libpath) = split " ", $Config{'libpth'}; - my(@ldloadlibs); - my(@bsloadlibs); - my(@extralibs); - my($fullname); + my(@ldloadlibs, @bsloadlibs, @extralibs); + my($fullname, $thislib, $thispth, @fullname); my($pwd) = fastcwd(); # from Cwd.pm + my($found) = 0; foreach $thislib (split ' ', $potential_libs){ @@ -1900,10 +1985,11 @@ sub new_extliblist { } elsif (-f ($fullname="$thispth/lib$thislib.a")){ } elsif (-f ($fullname="$thispth/Slib$thislib.a")){ } else { - print STDOUT "$thislib not found in $thispth\n" if $Verbose; + print STDOUT "$thislib not found in $thispth" if $Verbose; next; } print STDOUT "'-l$thislib' found at $fullname" if $Verbose; + $found++; $found_lib++; # Now update library lists @@ -1926,8 +2012,9 @@ sub new_extliblist { # it avoids hardwiring a fixed path into the .bs file. # mkbootstrap will automatically add dl_findfile() to # the .bs file if it sees a name in the -l format. - # USE THIS LATER: push(@bsloadlibs, "-l$thislib"); # " $fullname"; - # USE THIS while checking results against old_extliblist + # USE THIS, when dl_findfile() is fixed: + # push(@bsloadlibs, "-l$thislib"); + # OLD USE WAS while checking results against old_extliblist push(@bsloadlibs, "$fullname"); } else { if ($is_dyna){ @@ -1941,8 +2028,9 @@ sub new_extliblist { } last; # found one here so don't bother looking further } - print STDOUT "Warning (non-fatal): No library found for -l$thislib\n" unless $found_lib>0; + print STDOUT "Warning (non-fatal): No library found for -l$thislib" unless $found_lib>0; } + return ('','','') unless $found; ("@extralibs", "@bsloadlibs", "@ldloadlibs"); } @@ -2044,20 +2132,21 @@ sub mksymlists { # only AIX requires a symbol list at this point # (so does VMS, but that's handled by the MM_VMS package) - return '' unless $Config{'osname'} eq 'AIX'; + return '' unless $Config{'osname'} eq 'aix'; init_main(@ARGV) unless defined $att{'BASEEXT'}; if (! %{$att{DL_FUNCS}}) { - (my($bootfunc) = $att{NAME}) =~ s/\W/_/g; - $att{DL_FUNCS} = {$att{BASEEXT} => ["boot_$bootfunc"]}; + my($bootfunc); + ($bootfunc = $att{NAME}) =~ s/\W/_/g; + $att{DL_FUNCS} = {$att{BASEEXT} => ["boot_$bootfunc"]}; } rename "$att{BASEEXT}.exp", "$att{BASEEXT}.exp_old"; open(EXP,">$att{BASEEXT}.exp") or die $!; - print EXP join("\n",@{$att{DL_VARS}}) if @{$att{DL_VARS}}; - foreach $pkg (keys %{$att{DL_FUNC}}) { + print EXP join("\n",@{$att{DL_VARS}}) if $att{DL_VARS}; + foreach $pkg (keys %{$att{DL_FUNCS}}) { (my($prefix) = $pkg) =~ s/\W/_/g; - foreach $func (@{$att{DL_FUNC}->{$pkg}}) { + foreach $func (@{$att{DL_FUNCS}->{$pkg}}) { $func = "XS_${prefix}_$func" unless $func =~ /^boot_/; print EXP "$func\n"; } @@ -2072,6 +2161,33 @@ sub nicetext { # Just return the input - no action needed $text; } +# --- perllocal.pod section --- +sub writedoc { + my($self,$what,$name,@attribs)=@_; + -w $Config{'installarchlib'} or die "No write permission to $Config{'installarchlib'}"; + my($localpod) = "$Config{'installarchlib'}/perllocal.pod"; + my($time); + if (-f $localpod) { + print "Appending installation info to $localpod\n"; + open POD, ">>$localpod" or die "Couldn't open $localpod"; + } else { + print "Writing new file $localpod\n"; + open POD, ">$localpod" or die "Couldn't open $localpod"; + print POD "=head1 NAME + +perllocal - locally installed modules and perl binaries +\n=head1 HISTORY OF LOCAL INSTALLATIONS + +"; + } + require "ctime.pl"; + chop($time = ctime(time)); + print POD "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n"; + print POD join "\n\n=item *\n\n", map("C<$_>",@attribs); + print POD "\n\n=back\n\n"; + close POD; +} + =head1 AUTHORS Andy Dougherty Fdoughera@lafcol.lafayette.eduE>, Andreas @@ -2093,103 +2209,54 @@ v3.6 December 15th 1994 by Tim Bunce. v3.7 December 30th 1994 By Tim Bunce v3.8 January 17th 1995 By Andreas Koenig and Tim Bunce v3.9 January 19th 1995 By Tim Bunce - v3.10 January 23rd 1995 By Tim Bunce - -miniperl now given preference when defining PERL. This improves the -reliability of ext/*/Makefile's recreating themselves if needed. -$(XS), $(C) and $(H) renamed to XS_FILES C_FILES and H_FILES. -INST_STATIC now INST_ARCHLIBDIR/BASEEXT.a (alongside INST_DYNAMIC). -Static lib no longer copied back to local directory. - v3.11 January 24th 1995 By Andreas Koenig - -DynaLoader.c was not deleted by clean target, now fixed. -Added PMDIR attribute that allows directories to be named that contain -only *.p[pl] files to be installed into INST_LIB. Added some documentation. - v4.00 January 24th 1995 By Tim Bunce - -Revised some of the documentation. Changed version number to 4.00 to -avoid problems caused by my earlier poor choice of 3.10! Renamed PMDIR -to PMLIBDIRS and restructured find code to use inherited MY->libscan. -Added ability to say: "perl Makefile.PL help" to get help. -Added ability to say: "perl Makefile.PL verbose" to get debugging. -Added MakeMaker version number to generated Makefiles. - v4.01 January 25th 1995 By Tim Bunce - -Changes in the section that deals with PMLIBDIRS: some pm files were -put into INST_LIB instead of INST_LIBDIR. - v4.02 January 29th 1995 By Andreas Koenig +v4.03 January 30th 1995 By Andreas Koenig +v4.04 Februeary 5th 1995 By Andreas Koenig +v4.05 February 8th 1995 By Andreas Koenig +v4.06 February 10th 1995 By Andreas Koenig -Enabled the use of the XXX_cflags variable from Config.pm for nested -extensions: to change e.g. the $Config{"ccflags"} variable on the NeXT -for the nTk::pTk extension, say - nTk__pTk_cflags='ccflags="-posix $ccflags"' -in the hints-file. - -Hints may now be put in a hints/*.sh file within the the module's -directory tree. Any *.sh file in that directory acts as if it had been -parsed during the perl build process. - -Added O_FILES, which is an array like C_FILES. Done so to add a -dependency O_FILES from H_FILES. This has the effect, that the -extension gets rebuilt after some headerfiles have changed. - -Made life easier in some "I've just edited config.sh" situations and -reduce the risk of "MakeMaker is being pedantic" complaints by letting -the Makefile proceed with a warning if Config.pm is out of date (Tim's -suggestion). - -$Verbose now passed to the findperl routine, to get debugging output -from there, too. - -Make clean now also deletes the ./blib directory. +Cleaning up the new interface. Suggestion to freeze now until 5.001. -Added lots of ideas of Charles Bailey that enable VMS support. +v4.061 February 12th 1995 By Andreas Koenig -v4.03 January 30th 1995 By Andreas Koenig +Fixes of some my() declarations and of @extra computing in makeaperl(). -check_hints() now also called within runsubdirpl(). More VMS code -included. Trivial cosmetics. +v4.08 - 4.085 February 14th-21st 1995 by Andreas Koenig -v4.04 Februeary 5th 1995 By Andreas Koenig +Introduces EXE_FILES and INST_EXE for installing executable scripts +and fixes documentation to reflect the new variable. -Another VMS patch by Charles Bailey added. Documentation restructured. -ext/util/make_ext minor change. +Introduces the automated documentation of the installation history. Every + make install +and + make inst_perl +add some documentation to the file C<$installarchlib/perllocal.pod>. +This is done by the writedoc() routine in the MM_Unix class. The +documentation is rudimentary until we find an agreement, what +information is supposed to go into the pod. -All *.pm and *.pl files are now touched when MakeMaker finds -them. This inhibits that make omits their installation in -circumstances, where an older version has recently been built. +Added ability to specify the another name than C for a new binary. -installperl: perl.exp now goes into $installarchlib/CORE +Both C and C now prompt the user, how to install +the new binary after the build. -New files: lib/File/Path.pm, minimod.PL, perllink, and -vms/ext/MM_VMS.pm while writemain.SH is gone. minimod.PL writes a -trivial module, ExtUtils::Miniperl, which has the writemain function -in it to write perlmain.c files. perllink was not in the 4.01 patch -(which was 0i in fact), but it was introduced in 3.10. It is much -smaller now than it was -- most of its code has gone into minimod.PL -and MakeMaker. +Reduced noise during the make. -MakeMaker now writes a second Makefile that can be perused to make a -new perl binary from some extensions and some libperl libraries. This -Makefile has most likely to be adjusted to needs by hand, but it's a -quite reasonable starting point. The routines related to the writing -of the Makefile are also exploited by a new makeaperl script, that is -not in the patch, but distributed seperately. +Variable LIBPERL_A enables indirect setting of the switches -DEMBED, +-DDEBUGGING and -DMULTIPLICITY in the same way as done by cflags. -v4.05 February 8th 1995 By Andreas Koenig +old_extliblist() code deleted, new_extliblist() renamed to extliblist(). -When searching for static extensions makeaperl() now ignores -inexistent directories. Updated documentation (check_hints() now uses -eval instead of running a shell script) +Improved algorithm in extliblist, that returns ('','','') if no +library has been found, even if a -L directory has been found. -v4.06 February 10th 1995 By Andreas Koenig +Fixed a bug that didn't allow lib/ directory work as documented. -Cleaning up the new interface. Suggestion to freeze now until 5.001. +Allowed C =head1 NOTES @@ -2200,9 +2267,6 @@ Needs more complete documentation. Add a html: target when there has been found a general solution to installing html files. -Create a perllocal.pod somewhere that documents what has been done -on this system. (Thanks to Jarkko Hietaniemi for the idea) - =cut # the following keeps AutoSplit happy diff --git a/makeaperl b/makeaperl.SH similarity index 80% rename from makeaperl rename to makeaperl.SH index 9123609..c65b41d 100644 --- a/makeaperl +++ b/makeaperl.SH @@ -1,4 +1,27 @@ -#!/usr/bin/perl +case $CONFIG in +'') + if test -f config.sh; then TOP=.; + elif test -f ../config.sh; then TOP=..; + elif test -f ../../config.sh; then TOP=../..; + elif test -f ../../../config.sh; then TOP=../../..; + elif test -f ../../../../config.sh; then TOP=../../../..; + else + echo "Can't find config.sh."; exit 1 + fi + . $TOP/config.sh + ;; +esac +: This forces SH files to create target in same directory as SH file. +: This is so that make depend always knows where to find SH derivatives. +case "$0" in +*/*) cd `expr X$0 : 'X\(.*\)/'` ;; +esac +echo "Extracting makeaperl (with variable substitutions)" +$spitshell >makeaperl <>makeaperl <<'!NO!SUBS!' =head1 NAME @@ -61,7 +84,7 @@ $0 version $Version $0: [options] [object_files] [static_extensions ...] [directories to search through] -l perllibrary perl library to link from (the first libperl.a found) - -m makefilename name of the makefile to be written (/tmp/Makefile.$$) + -m makefilename name of the makefile to be written (/tmp/Makefile.\$\$) -o name name for perl executable (perl) -t directory directory where intermediate files reside (/tmp) END @@ -99,3 +122,6 @@ print MAKE MM->makeaperl('MAKE' => $opt_m, ); close MAKE; (system "make -f $opt_m") == 0 or die "$0 failed: Please check file $opt_m and run make -f $opt_m\n"; +!NO!SUBS! +chmod 755 makeaperl +$eunicefix makeaperl diff --git a/vms/config.vms b/vms/config.vms index 5133266..0c2c4f4 100644 --- a/vms/config.vms +++ b/vms/config.vms @@ -719,6 +719,11 @@ */ #undef I_SYS_SELECT /**/ +/* I_SYS_STAT: + * This symbol, if defined, indicates to the C program that it should + * include . + */ +#define I_SYS_STAT /**/ /* I_SYS_TIMES: * This symbol, if defined, indicates to the C program that it should @@ -726,6 +731,12 @@ */ #undef I_SYS_TIMES /**/ +/* I_SYS_TYPES: + * This symbol, if defined, indicates to the C program that it should + * include . + */ +#define I_SYS_TYPES /**/ + /* I_TERMIO: * This symbol, if defined, indicates that the program should include * rather than . There are also differences in diff --git a/x2p/util.c b/x2p/util.c index a7fdaea..aa8a7a3 100644 --- a/x2p/util.c +++ b/x2p/util.c @@ -218,53 +218,3 @@ int a1,a2,a3,a4; fprintf(stderr,pat,a1,a2,a3,a4); } -static bool firstsetenv = TRUE; -extern char **environ; - -void -setenv(nam,val) -char *nam, *val; -{ - register int i=envix(nam); /* where does it go? */ - - if (!environ[i]) { /* does not exist yet */ - if (firstsetenv) { /* need we copy environment? */ - int j; -#ifndef lint - char **tmpenv = (char**) /* point our wand at memory */ - safemalloc((i+2) * sizeof(char*)); -#else - char **tmpenv = Null(char **); -#endif /* lint */ - - firstsetenv = FALSE; - for (j=0; j