# $Id: Head.U,v 3.0.1.7 1995/03/21 08:46:15 ram Exp $
#
-# Generated on Thu Apr 6 11:09:32 EDT 1995 [metaconfig 3.0 PL53]
+# Generated on Fri Apr 14 15:43:12 EDT 1995 [metaconfig 3.0 PL53]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
rp="Any special flags to pass to $cc -c to compile shared library modules?"
. ./myread
case "$ans" in
- none) cccdlflags='' ;;
+ none) cccdlflags=' ' ;;
*) cccdlflags="$ans" ;;
esac
fi
rm -f try.c a.out
;;
- *) dflt=ld
+ *) dflt="$ld"
;;
esac
- rp="What comnmand should be used to create dynamic libraries?"
+ rp="What command should be used to create dynamic libraries?"
. ./myread
ld="$ans"
rp="Any special flags to pass to $ld to create a dynamically loaded library?"
. ./myread
case "$ans" in
- none) lddlflags='' ;;
+ none) lddlflags=' ' ;;
*) lddlflags="$ans" ;;
esac
rp="Any special flags to pass to $cc to use dynamic loading?"
. ./myread
case "$ans" in
- none) ccdlflags='' ;;
+ none) ccdlflags=' ' ;;
*) ccdlflags="$ans" ;;
esac
;;
EOM
case "$dynamic_ext" in
- ''|' ') dflt="$avail_ext" ;;
+ '') dflt="$avail_ext" ;;
*) dflt="$dynamic_ext" ;;
esac
case "$dflt" in
rp="What extensions do you wish to load dynamically?"
. ./myread
case "$ans" in
- none) dynamic_ext='' ;;
+ none) dynamic_ext=' ' ;;
*) dynamic_ext="$ans" ;;
esac
case "$static_ext" in
- ''|' ')
+ '')
: Exclude those already listed in dynamic linking
dflt=''
for xxx in $avail_ext; do
rp="What extensions do you wish to load statically?"
. ./myread
case "$ans" in
- none) static_ext='' ;;
+ none) static_ext=' ' ;;
*) static_ext="$ans" ;;
esac
;;
EOM
case "$static_ext" in
- ''|' ') dflt="$avail_ext" ;;
+ '') dflt="$avail_ext" ;;
*) dflt="$static_ext" ;;
esac
rp="What extensions do you wish to include?"
. ./myread
case "$ans" in
- none) static_ext='' ;;
+ none) static_ext=' ' ;;
*) static_ext="$ans" ;;
esac
;;
pod/perlsyn.pod Syntax info
pod/perltrap.pod Trap info
pod/perlvar.pod Variable info
-pod/pod2html Translator to turn pod into HTML
-pod/pod2latex Translator to turn pod into LaTeX
-pod/pod2man Translator to turn pod into manpage
+pod/pod2html.SH Precursor for translator to turn pod into HTML
+pod/pod2latex.SH Precursor for translator to turn pod into LaTeX
+pod/pod2man.SH Precursor for translator to turn pod into manpage
pod/splitman Splits perlfunc into multiple man pages
pp.c Push/Pop code
pp.h Push/Pop code defs
;;
*)
$spitshell >>Makefile <<'!NO!SUBS!'
+ rm -f $(perllib)
ar rcu $(perllib) perl.o $(obj)
@$(ranlib) $(perllib)
!NO!SUBS!
realclean: clean
-cd x2p; $(MAKE) realclean
+ -cd pod; $(MAKE) realclean
@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
sh ext/util/make_ext realclean $$x ; \
done
#endif
#ifndef HAS_DLERROR
-#define dlerror() "Unknown error - dlerror() not implemented"
+# ifdef __NetBSD__
+# define dlerror() strerror(errno)
+# else
+# define dlerror() "Unknown error - dlerror() not implemented"
+# endif
#endif
#define Nullsv Null(SV*)
/* bool is built-in for g++-2.6.3, which might be used for an extension.
- gcc-2.6.2 under Linux defines _G_HAVE_BOOL to 0, and does not
- define bool. */
-#if !defined(HAS_BOOL) && !(_G_HAVE_BOOL)
-#ifdef UTS
-#define bool int
-#else
-#define bool char
+ If the extension includes <_G_config.h> before this file then
+ _G_HAVE_BOOL will be properly set. If, however, the extension includes
+ this file first, then you will have to manually set -DHAS_BOOL in
+ your command line to avoid a conflict.
+*/
+#ifdef _G_HAVE_BOOL
+# if _G_HAVE_BOOL
+# ifndef HAS_BOOL
+# define HAS_BOOL 1
+# endif
+# endif
+#endif
+
+#ifndef HAS_BOOL
+# ifdef UTS
+# define bool int
+# else
+# define bool char
+# endif
#endif
-#endif /* !defined(HAS_BOOL) && !(_G_HAVE_BOOL) */
#ifdef TRUE
#undef TRUE
cc='/bin/cc -Xa'
cccdlflags='-Zelf -Zpic'
ccdlflags='-Zelf -Zlink=dynamic -Wl,-Bexport -u sigaction'
-lddlflags='-G'
+lddlflags='-Zlink=so'
# Configure imagines that stdio.h is "standard", but it really isn't.
# Things like the -T and -B file test operators (on file handles) fail when
-# Oringal based on info from
+# Original based on info from
# Carl M. Fongheiser <cmf@ins.infonet.net>
# Date: Thu, 28 Jul 1994 19:17:05 -0500 (CDT)
#
# Ollivier Robert <Ollivier.Robert@keltia.frmug.fr.net>
# Date: Wed, 28 Sep 1994 00:37:46 +0100 (MET)
#
+# Additional 2.* defines from
+# Ollivier Robert <Ollivier.Robert@keltia.frmug.fr.net>
+# Date: Sat, 8 Apr 1995 20:53:41 +0200 (MET DST)
+#
+# FreeBSD has the dynamic loading dl*() functions in /usr/lib/crt0.o,
+# so Configure doesn't find them (unless you abandon the nm scan).
+#
+# The two flags "-fpic -DPIC" are used to indicate a
+# will-be-shared object. Configure will guess the -fpic, (and the
+# -DPIC is not used by perl proper) but the full define is included to
+# be consistent with the FreeBSD general shared libs building process.
+#
+# setreuid and friends are inherently broken in all versions of FreeBSD.
+#
+
case "$osvers" in
0.*|1.0*)
usedl="$undef"
;;
-*) d_dlopen="$define"
+1.1*) d_dlopen="$define"
cccdlflags='-DPIC -fpic'
- lddlflags='-Bshareable'
+ lddlflags='-Bshareable $lddlflags'
malloctype='void *'
groupstype='int'
d_setregid='undef'
d_setreuid='undef'
d_setrgid='undef'
d_setruid='undef'
- i_unistd='undef'
+ ;;
+*)
+ d_dlopen="$define"
+ cccdlflags='-DPIC -fpic'
+ lddlflags='-Bshareable $lddlflags'
+ d_setregid='undef'
+ d_setreuid='undef'
+ d_setrgid='undef'
+ d_setruid='undef'
;;
esac
# Avoid telldir prototype conflict in pp_sys.c (FreeBSD uses const DIR *)
+# Configure should test for this. Volunteers?
pp_sys_cflags='ccflags="$ccflags -DHAS_TELLDIR_PROTOTYPE"'
#
# Use Configure -Dcc=gcc to use gcc
#
-set `echo X "$libswanted "| sed -e 's/ c / /'`
+
+# We don't want to explicitly mention -lc (since we're using POSIX mode.)
+# We also don't want -lx (the Xenix compatability libraries.) The only
+# thing that it seems to pick up is chsize(), which has been reported to
+# not work. chsize() can also be implemented via fcntl() in perl (if you
+# define -D_SYSV3). We'll leave in -lPW since it's harmless. Some
+# extension might eventually need it for alloca, though perl doesn't use
+# it.
+
+set `echo X "$libswanted "| sed -e 's/ c / /' -e 's/ x / /'`
shift
libswanted="$*"
+
case "$cc" in
*gcc*) ccflags="$ccflags -posix"
ldflags="$ldflags -posix"
ldflags="$ldflags -Xp"
;;
esac
+
+# You can also include -D_SYSV3 to pick up "traditionally visible"
+# symbols hidden by name-space pollution rules. This raises some
+# compilation "redefinition" warnings, but they appear harmless.
+# ccflags="$ccflags -D_SYSV3"
+
# Pick up dbm.h in <rpcsvc/dbm.h>
ccflags="$ccflags -I/usr/include/rpcsvc"
esac
# Perl expects BSD style signal handling.
-ccflags="-D__USE_BSD_SIGNAL $ccflags"
+# gcc defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
+ccflags="-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL $ccflags"
-# The following functions are gcc built-ins, but the Configure test
+# The following functions are gcc built-ins, but the Configure tests
# may fail because it doesn't supply a proper prototype.
d_memcmp=define
d_memcpy=define
You appear to have ELF support. I'll try to use it for dynamic loading.
EOM
- # Be careful not to overwrite lddlflags, since the user might
- # have specified some -L/path options on the Configure command line.
- lddlflags="-shared $lddlflags"
- ccdlflags='-rdynamic'
- so='so'
- dlext='so'
- ld=gcc
+ # Configure now handles these automatically.
else
echo "You don't have an ELF gcc, using dld if available."
# We might possibly have a version of DLD around.
lddlflags="-r $lddlflags"
+ # These empty values are so that Configure doesn't put in the
+ # Linux ELF values.
+ ccdlflags=' '
+ cccdlflags=' '
so='sa'
dlext='o'
## If you are using DLD 3.2.4 which does not support shared libs,
# hints/netbsd.sh
-# netbsd keeps dynamic loading dl*() functions in /lib/crt0.o,
+# netbsd keeps dynamic loading dl*() functions in /usr/lib/crt0.o,
# so Configure doesn't find them (unless you abandon the nm scan).
case "$osvers" in
0.9*|0.8*)
useposix='undef'
ldflags='-u libsys_s'
libswanted='dbm gdbm db'
+#
lddlflags='-r'
+# Give cccdlflags an empty value since Configure will detect we are
+# using GNU cc and try to specify -fpic for cccdlflags.
+cccdlflags=' '
+#
i_utime='undef'
groupstype='int'
direntrytype='struct direct'
POSIX_cflags='ccflags="-posix $ccflags"'
ldflags='-u libsys_s'
libswanted='dbm gdbm db'
+
lddlflags='-r'
+# Give cccdlflags an empty value since Configure will detect we are
+# using GNU cc and try to specify -fpic for cccdlflags.
+cccdlflags=' '
+
i_utime='undef'
groupstype='int'
direntrytype='struct direct'
cc='/bin/cc'
cccdlflags='-Zpic'
ccdlflags='-Zlink=dynamic -Wl,-Bexport'
-lddlflags='-G'
+lddlflags='-Zlink=so'
# Configure imagines that stdio.h is "standard", but it really isn't.
# Things like the -T and -B file test operators (on file handles) fail when
ccflags="$ccflags -U M_XENIX"
optimize="$optimize -O2"
;;
+scocc) ;;
+
*)
ccflags="$ccflags -W0 -U M_XENIX"
;;
esac
i_varargs=undef
+
+# I have received one report that nm extraction doesn't work if you're
+# using the scocc compiler. This system had the following 'myconfig'
+# uname='xxx xxx 3.2 2 i386 '
+# cc='scocc', optimize='-O'
+usenm='false'
+
+# If you want to use nm, you'll probably have to use nm -p. The
+# following does that for you:
nm_opt='-p'
makedir("$installarchlib/CORE");
foreach $file (<*.h libperl*.*>) {
cp_if_diff($file,"$installarchlib/CORE/$file");
- if ($file =~ /\.a$/ && $osname eq 'next') {
- #on NeXTs we have to rerun ranlib after copying libraries
+ if ($file =~ /\.a$/ && $osname =~ /^(next|sunos)$/) {
+ # on NeXTs and Suns we have to rerun ranlib after copying libraries
+ # (maybe on all platforms which have ranlib ?)
&cmd("$ranlib $installarchlib/CORE/$file");
}
}
-f $from || die "$0: $from not found";
system "cmp", "-s", $from, $to;
if ($?) {
+ unlink($to); # In case we don't have write permissions.
cmd("cp $from $to");
}
}
package ExtUtils::MakeMaker;
-$Version = 4.091; # Last edited 31 Mar 1995 by Andreas Koenig
+$Version = 4.093; # Last edited 12 Apr 1995 by Andy Dougherty
use Config;
-check_hints();
use Carp;
use Cwd;
hash table of Config.pm by supplying hints files in a C<hints/>
directory. The hints files are expected to be named like their
counterparts in C<PERL_SRC/hints>, but with an C<.pl> file name
-extension (eg. C<next_3_2.sh>). They are simply C<eval>ed by MakeMaker
-and can be used to execute commands as well as to include special
-variables. If there is no hintsfile for the actual system, but for
-some previous releases of the same operating system, the latest one of
-those is used.
+extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by MakeMaker
+within the WriteMakefile() subroutine, and can be used to execute
+commands as well as to include special variables. If there is no
+hintsfile for the actual system, but for some previous releases of the
+same operating system, the latest one of those is used.
=head2 Default Makefile Behaviour
make config # to check if the Makefile is up-to-date
make clean # delete local temporary files (Makefile gets renamed)
make realclean # delete all derived files (including installed files)
- make distclean # produce a gzipped file ready for shipping
+ make dist # produce a gzipped file ready for shipping
The macros in the produced Makefile may be overridden on the command
line to the make call as in the following example:
=cut
sub check_hints {
- # We allow extension-specific hints files. If we find one we act as if Config.pm
- # had read the contents
+ # We allow extension-specific hints files.
# First we look for the best hintsfile we have
my(@goodhints);
closedir DIR;
return unless @goodhints; # There was no hintsfile
# the last one in lexical ordering is our choice:
- $hint=(reverse sort @goodhints)[0];
+ $hint=(sort @goodhints)[-1];
# execute the hintsfile:
open HINTS, "hints/$hint.pl";
@goodhints = <HINTS>;
close HINTS;
+ print STDOUT "Processing hints file hints/$hint.pl";
eval join('',@goodhints);
+ print STDOUT $@ if $@;
}
# Setup dummy package:
dynamic_lib: {ARMAYBE => 'ar', OTHERLDFLAGS => '...'}
clean: {FILES => "*.xyz foo"}
realclean: {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
- distclean: {TARNAME=>'MyTarFile', TARFLAGS=>'cvfF', COMPRESS=>'gzip'}
+ dist: {TARNAME=>'MyTarFile', TARFLAGS=>'cvfF', COMPRESS=>'gzip'}
tool_autosplit: {MAXLEN => 8}
END
'subdirs' => {},
'clean' => {},
'realclean' => {},
- 'distclean' => {},
+ 'dist' => {},
'test' => {},
'install' => {},
'force' => {},
parse_args(\%att, @ARGV);
my(%initial_att) = %att; # record initial attributes
+
+ check_hints();
+
my($key);
MY->init_main();
} else {
my(%a) = %{$att{$section} || {}};
print MAKE "\n# --- MakeMaker $section section:";
- print MAKE "# ",%a if $Verbose;
+ print MAKE "# ", join ", ", %a if $Verbose;
print(MAKE MY->nicetext(MY->$section( %a )));
}
}
sub find_perl{
my($self, $ver, $names, $dirs, $trace) = @_;
my($name, $dir);
- if ($trace){
+ if ($trace >= 2){
print "Looking for perl $ver by these names: ";
print "@$names, ";
print "in these dirs:";
$name .= ".exe" unless -x "$dir/$name";
}
next unless -x "$dir/$name";
- print "Executing $dir/$name" if ($trace);
+ print "Executing $dir/$name" if ($trace >= 2);
my($out);
if ($Is_VMS) {
my($vmscmd) = 'MCR ' . vmsify("$dir/$name");
} else {
$out = `$dir/$name -e 'require $ver; print "VER_OK\n" ' 2>&1`;
}
- return "$dir/$name" if $out =~ /VER_OK/;
+ if ($out =~ /VER_OK/) {
+ print "Using $dir/$name" if $trace;
+ return "$dir/$name";
+ }
}
}
print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
."Please notify perl5-porters\@nicoh.com\n";
}
my($cccmd)=($old) ? $old : $new;
+ $cccmd =~ s/\b\Q$Config{'cc'}\E\b/\$(CC)/;
"CCCMD = $cccmd\n";
}
# This method provides a mechanism to automatically deal with
# subdirectories containing further Makefile.PL scripts.
# It calls the subdir_x() method for each subdirectory.
- foreach(<*/Makefile.PL>){
- s:/Makefile\.PL$:: ;
+ foreach(grep -d, &lsdir()){
+ next if /^\./;
+ next unless -f "$_/Makefile\.PL" ;
print "Including $_ subdirectory" if ($Verbose);
push(@m, MY->subdir_x($_));
}
}
-sub distclean {
+sub dist {
my($self, %attribs) = @_;
# VERSION should be sanitised before use as a file name
my($tarname) = $attribs{TARNAME} || '$(DISTNAME)-$(VERSION)';
my($postop) = $attribs{POSTOP} || '@:';
my($mkfiles) = join(' ', map("$_/$att{MAKEFILE} $_/$att{MAKEFILE}.old", ".", @{$att{DIR}}));
"
-distclean: clean
+dist: clean
$preop
$att{RM_F} $mkfiles
cd .. && tar $tarflags $tarname.tar \$(BASEEXT)
$cccmd .= " $Config{'cccdlflags'}" if ($Config{'d_shrplib'});
# The front matter of the linkcommand...
- $linkcmd = join ' ', $Config{'cc'},
+ $linkcmd = join ' ', "\$(CC)",
grep($_, @Config{qw(large split ldflags ccdlflags)});
$linkcmd =~ s/\s+/ /g;
for (sort keys %static) {
next unless /\.a$/;
$_ = dirname($_) . "/extralibs.ld";
- push @$extra, "`cat $_`";
+ push @$extra, $_;
}
grep(s/^/-I/, @$perlinc);
MAP_PERLINC = @{$perlinc}
MAP_STATIC = ",
join(" ", sort keys %static), "
-MAP_EXTRA = @{$extra}
MAP_PRELIBS = $Config{'libs'} $Config{'cryptlib'}
";
";
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)
+extralibs.ld: @$extra
+ \@ $att{RM_F} \$\@
+ \@ \$(TOUCH) \$\@
+";
+
+ foreach (@$extra){
+ push @m, "\tcat $_ >> \$\@\n";
+ }
+
+ push @m, "
+\$(MAP_TARGET): $tmp/perlmain.o \$(MAP_LIBPERL) \$(MAP_STATIC) extralibs.ld
+ \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain.o \$(MAP_LIBPERL) \$(MAP_STATIC) `cat extralibs.ld` \$(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'
};
-# We write MAP_EXTRA outside the perl program to have it eval'd by the shell
+# We write 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",' \\
-e '"$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)",' \\
- -e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- $(MAP_EXTRA)
+ -e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- `cat extralibs.ld`
};
push @m, qq{
realclean :: map_clean
+distclean :: realclean
+
map_clean :
$att{RM_F} $tmp/perlmain.o $tmp/perlmain.c $makefilename
};
# 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!
+ if (@fullname = lsdir($thispth,"^lib$thislib\.$so\.[0-9]+")){
+ # Take care that libfoo.so.10 wins against libfoo.so.9.
+ # Compare two libraries to find the most recent version
+ # number. E.g. if you have libfoo.so.9.0.7 and
+ # libfoo.so.10.1, first convert all digits into two
+ # decimal places. Then we'll add ".00" to the shorter
+ # strings so that we're comparing strings of equal length
+ # Thus we'll compare libfoo.so.09.07.00 with
+ # libfoo.so.10.01.00. Some libraries might have letters
+ # in the version. We don't know what they mean, but will
+ # try to skip them gracefully -- we'll set any letter to
+ # '0'. Finally, sort in reverse so we can take the
+ # first element.
+ $fullname = "$thispth/" .
+ (sort { my($ma) = $a;
+ my($mb) = $b;
+ $ma =~ tr/A-Za-z/0/s;
+ $ma =~ s/\b(\d)\b/0$1/g;
+ $mb =~ tr/A-Za-z/0/s;
+ $mb =~ s/\b(\d)\b/0$1/g;
+ while (length($ma) < length($mb)) { $ma .= ".00"; }
+ while (length($mb) < length($ma)) { $mb .= ".00"; }
+ # Comparison deliberately backwards
+ $mb cmp $ma;} @fullname)[0];
} elsif (-f ($fullname="$thispth/lib$thislib.$so")
- && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){
+ && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){
} elsif (-f ($fullname="$thispth/lib${thislib}_s.a")
- && ($thislib .= "_s") ){ # we must explicitly ask for _s version
+ && ($thislib .= "_s") ){ # we must explicitly use _s version
} elsif (-f ($fullname="$thispth/lib$thislib.a")){
} elsif (-f ($fullname="$thispth/Slib$thislib.a")){
} else {
# Do not add it into the list if it is already linked in
# with the main perl executable.
- # We have to special-case the NeXT, because all the math is also in libsys_s
- unless ( $in_perl || ($Config{'osname'} eq 'next' && $thislib eq 'm') ){
+ # We have to special-case the NeXT, because all the math
+ # is also in libsys_s
+ unless ($in_perl ||
+ ($Config{'osname'} eq 'next' && $thislib eq 'm') ){
push(@extralibs, "-l$thislib");
}
-
# We might be able to load this archive file dynamically
if ( $Config{'dlsrc'} =~ /dl_next|dl_dld/){
# We push -l$thislib instead of $fullname because
}
last; # found one here so don't bother looking further
}
- print STDOUT "Warning (non-fatal): No library found for -l$thislib" 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");
Another attempt to fix writedoc() from Dean Roehrich.
+
+v4.092 April 11 1994 by Andreas Koenig
+
+Fixed a docu bug in hint file description. Added printing of a warning
+from eval in the hintfile section if the eval has errors. Moved
+check_hints() into the WriteMakefile() subroutine to avoid evaling
+hintsfiles for other uses of the module (mkbootstrap, mksymlists).
+
+Eliminated csh globbing to work around buggy Linux csh.
+
+In extliblist() libfoo.so.10 now wins against libfoo.so.9.
+
+Use $(CC) instead of $Config{'cc'} everywhere to allow overriding
+according to a patch by Dean Roehrich.
+
+Introduce a ./extralibs.ld file that contains the contents of all
+relevant extralibs.ld files for a static build to shorten the command
+line for the linking of a new static perl.
+
+Minor cosmetics.
+
+v4.093 April 12 1994 by Andy Dougherty
+
+Rename distclean target to plain dist. Insert a dummy distclean
+target that's the same as realclean. This is more consistent with the
+main perl makefile.
+
+Fix up extliblist() so even bizarre names like libfoo.so.10.0.1
+are handled.
+
+Include Tim's suggestions about $verbose and more careful substitution
+of $(CC) for $Config{'cc'}.
+
+Minor cosmetic fixes for my 80-character wide terminal.
+
=head1 NOTES
MakeMaker development work still to be done:
Add a html: target when there has been found a general solution to
installing html files.
+Add an uninstall target.
+
+Add a FLAVOR variable that makes it easier to build debugging,
+embedded or multiplicity perls.
+
=cut
# the following keeps AutoSplit happy
sub TIEHASH {
my $pack = shift;
- if (defined &{"{$pack}::new"}) {
- carp "WARNING: calling ${pack}->new since ${pack}->TIEHASH is missing"
+ if (defined &{"$pack\::new"}) {
+ carp "WARNING: calling $pack\->new since $pack\->TIEHASH is missing"
if $^W;
$pack->new(@_);
}
#ifdef CASTI32
#define I_32(what) ((I32)(what))
#define I_V(what) ((IV)(what))
+#define U_V(what) ((UV)(what))
#else
I32 cast_i32 _((double));
#define I_32(what) (cast_i32((double)(what)))
IV cast_iv _((double));
#define I_V(what) (cast_iv((double)(what)))
+UV cast_uv _((double));
+#define U_V(what) (cast_uv((double)(what)))
#endif
struct Outrec {
all: man
+PERL = ../miniperl
+
POD = \
perl.pod \
perlapi.pod \
man: $(MAN)
-html: $(HTML)
+# pod2html runs on all the pods at once in order to build up
+# cross-references.
+html:
+ $(PERL) pod2html *.pod
.SUFFIXES: .pod .man
.pod.man:
- ../miniperl pod2man $*.pod >$*.man
+ $(PERL) pod2man $*.pod >$*.man
.SUFFIXES: .pod .html
.pod.html:
- ../miniperl pod2html $*.pod >$*.html
+ $(PERL) pod2html $*.pod
clean:
rm -f $(MAN) $(HTML)
realclean: clean
+ rm -f pod2man pod2latex pod2html
+
+distclean: realclean
+
+# Dependencies.
+pod2latex: pod2latex.SH ../config.sh
+ sh pod2latex.SH
+
+pod2html: pod2html.SH ../config.sh
+ sh pod2html.SH
+
+pod2man: pod2man.SH ../config.sh
+ sh pod2man.SH
-#!/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
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting pod/pod2html (with variable substitutions)"
+rm -f pod2html
+$spitshell >pod2html <<!GROK!THIS!
+#!$bin/perl
+eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+!GROK!THIS!
+
+$spitshell >>pod2html <<'!NO!SUBS!'
#
# pod2html - convert pod format to html
#
# loop twice through the pods, first to learn the links, then to produce html
for $count (0,1){
+ (print "Scanning pods...\n") unless $count;
foreach $podfh ( @Pods ) {
($pod = $podfh) =~ s/\.pod$//;
Debug("files", "opening 2 $podfh" );
+ (print "Creating $pod.html from $podfh\n") if $count;
$RS = "\n=";
open($podfh,"<".$podfh) || die "can't open $podfh: $ERRNO";
@all=<$podfh>;
$in_list=0;
$html=$pod.".html";
if($count){
- #open(HTML,">&STDOUT") || die "can't create $html: $ERRNO";
open(HTML,">$html") || die "can't create $html: $ERRNO";
print HTML <<'HTML__EOQ', <<"HTML__EOQQ";
- <!-- $RCSfile$$Date$ -->
- <!-- $Log$ -->
+ <!-- \$RCSfile\$\$Revision\$\$Date\$ -->
+ <!-- \$Log\$ -->
<HTML>
HTML__EOQ
<TITLE> \U$pod\E </TITLE>
($cmd, $title, $rest) = ($1,$2,$3);
if ($cmd eq "item") {
if($count ){
- ($depth) or &do_list("over",$all[$i],\$in_list,\$depth);
- &do_item($title,$rest,$in_list);
+ ($depth) or do_list("over",$all[$i],\$in_list,\$depth);
+ do_item($title,$rest,$in_list);
}
else{
# scan item
- &scan_thing("item",$title,$pod);
+ scan_thing("item",$title,$pod);
}
}
elsif ($cmd =~ /^head([12])/){
$num=$1;
if($count){
- &do_hdr($num,$title,$rest,$depth);
+ do_hdr($num,$title,$rest,$depth);
}
else{
# header scan
- &scan_thing($cmd,$title,$pod); # skip head1
+ scan_thing($cmd,$title,$pod); # skip head1
}
}
elsif ($cmd =~ /^over/) {
- $depth and &do_list("over",$all[$i+1],\$in_list,\$depth);
+ $count and $depth and do_list("over",$all[$i+1],\$in_list,\$depth);
}
elsif ($cmd =~ /^back/) {
if($count){
($depth) or next; # just skip it
- &do_list("back",$all[$i+1],\$in_list,\$depth);
- &do_rest("$title.$rest");
+ do_list("back",$all[$i+1],\$in_list,\$depth);
+ do_rest("$title.$rest");
}
}
elsif ($cmd =~ /^cut/) {
- &do_rest($rest);
+ next;
}
- else {
- warn "unrecognized header: $cmd";
+ elsif($Debug){
+ (warn "unrecognized header: $cmd") if $Debug;
}
}
+ # close open lists without '=back' stmts
if($count){
while($depth){
- &do_list("back",$all[$i+1],\$in_list,\$depth);
+ do_list("back",$all[$i+1],\$in_list,\$depth);
}
print HTML "\n</HTML>\n";
}
my($which,$next_one,$list_type,$depth)=@_;
my($key);
if($which eq "over"){
- ($next_one =~ /^item\s+(.*)/ ) or warn "Bad list, $1\n";
+ ($next_one =~ /^item\s+(.*)/ ) or (warn "Bad list, $1\n") if $Debug;
$key=$1;
if($key =~ /^1\.?/){
$$list_type = "OL";
$$list_type="DL";
}
else{
- warn "unknown list type for item $key";
+ (warn "unknown list type for item $key") if $Debug;
}
print HTML qq{\n};
print HTML qq{<$$list_type>};
sub do_hdr{
my($num,$title,$rest,$depth)=@_;
($num == 1) and print HTML qq{<p><hr>\n};
- &process_thing(\$title,"NAME");
+ process_thing(\$title,"NAME");
print HTML qq{\n<H$num> };
print HTML $title;
print HTML qq{</H$num>\n};
- &do_rest($rest);
+ do_rest($rest);
}
sub do_item{
my($title,$rest,$list_type)=@_;
- &process_thing(\$title,"NAME");
+ process_thing(\$title,"NAME");
if($list_type eq "DL"){
print HTML qq{\n<DT><STRONG>\n};
print HTML $title;
print HTML qq{\n<LI>};
($list_type ne "OL") && (print HTML $title,"\n");
}
- &do_rest($rest);
+ do_rest($rest);
print HTML ($list_type eq "DL" )? qq{</DD>} : qq{</LI>};
}
sub do_rest{
my($rest)=@_;
- my(@lines,$p,$q,$line,@paras,$inpre);
+ my(@lines,$p,$q,$line,,@paras,$inpre);
@paras=split(/\n\n+/,$rest);
for($p=0;$p<=$#paras;$p++){
@lines=split(/\n/,$paras[$p]);
foreach $q (@lines){
if($paras[$p]=~/>>|<</){
if($inpre){
- &process_thing(\$q,"HTML");
+ process_thing(\$q,"HTML");
}
else {
print HTML qq{\n</XMP>\n};
print HTML qq{<PRE>\n};
$inpre=1;
- &process_thing(\$q,"HTML");
+ process_thing(\$q,"HTML");
}
}
while($q =~ s/\t+/' 'x (length($&) * 8 - length($`) % 8)/e){
else{ # other text
@lines=split(/\n/,$paras[$p]);
foreach $line (@lines){
- &process_thing(\$line,"HTML");
+ process_thing(\$line,"HTML");
print HTML qq{$line\n};
}
}
sub process_thing{
my($thing,$htype)=@_;
- &pre_escapes($thing);
- &find_refs($thing,$htype);
- &post_escapes($thing);
+ pre_escapes($thing);
+ find_refs($thing,$htype);
+ post_escapes($thing);
}
sub scan_thing{
Debug("headers", "header $_");
}
else {
- warn "unrecognized header: $cmd";
+ (warn "unrecognized header: $cmd") if $Debug;
}
}
}
if ($char =~ /[IF]/) {
return "<EM> $bigkey </EM>";
+ } elsif($char =~ /C/) {
+ return "<CODE> $bigkey </CODE>";
} else {
return "<STRONG> $bigkey </STRONG>";
- }
+ }
}
sub find_refs {
$$thing=~s/L<([^>]*)>/lrefs($1,$htype)/ge;
$$thing=~s/([CIBF])<(\W*?(-?\w*).*?)>/picrefs($1, $2, $3, $htype)/ge;
$$thing=~s/((\w+)\(\))/picrefs("I", $1, $2,$htype)/ge;
- $$thing=~s/([\$\@%]([\w:]+|\W\b))/varrefs($1,$htype)/ge;
+ $$thing=~s/([\$\@%](?!&[gl]t)([\w:]+|\W\b))/varrefs($1,$htype)/ge;
(($$thing eq $orig) && ($htype eq "NAME")) &&
($$thing=picrefs("I", $$thing, "", $htype));
}
if (!defined $section && defined $Podnames{$page}) {
return "\n$type$page.html\">\nthe <EM> $page </EM> manpage<\/A>\n";
} else {
- warn "Bizarre entry $page/$item";
+ (warn "Bizarre entry $page/$item") if $Debug;
return "the <EM> $_[0] </EM> manpage\n";
}
}
}
}
}
- warn "No $ref reference for $item (@_)";
+ (warn "No $ref reference for $item (@_)") if $Debug;
return $text;
}
sub post_escapes {
my($thing)=@_;
$$thing=~s/[^GM]>>/\>\;\>\;/g;
- $$thing=~s/([^"MGA])>/$1\>\;/g;
+ $$thing=~s/([^"MGAE])>/$1\>\;/g;
$$thing=~tr/\200-\377/\000-\177/;
}
}
+!NO!SUBS!
+chmod 755 pod2html
+$eunicefix pod2html
-#!/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
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting pod/pod2latex (with variable substitutions)"
+rm -f pod2latex
+$spitshell >pod2latex <<!GROK!THIS!
+#!$bin/perl
+eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+!GROK!THIS!
+
+$spitshell >>pod2latex <<'!NO!SUBS!'
+#
# pod2latex, version 1.1
# by Taro Kawagish (kawagish@imslab.co.jp), Jan 11, 1995.
#
"yuml" => '\\"{y}', # small y, dieresis or umlaut mark
);
}
+!NO!SUBS!
+chmod 755 pod2latex
+$eunicefix pod2latex
-#!/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
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting pod/pod2man (with variable substitutions)"
+rm -f pod2man
+$spitshell >pod2man <<!GROK!THIS!
+#!$bin/perl
+eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
+ if \$running_under_some_shell;
+!GROK!THIS!
+
+$spitshell >>pod2man <<'!NO!SUBS!'
$/ = "";
$cutting = 1;
"yuml" => "y\\*:", # small y, dieresis or umlaut mark
);
}
+!NO!SUBS!
+chmod 755 pod2man
+$eunicefix pod2man
HV *stash;
register CV *cv;
register CONTEXT *cx;
+ I32 gimme;
if (!sv)
DIE("Not a CODE reference");
DIE("No DBsub routine");
}
+ gimme = GIMME;
+
if (CvXSUB(cv)) {
if (CvOLDSTYLE(cv)) {
I32 (*fp3)_((int,int,int));
(void)(*CvXSUB(cv))(cv);
/* Enforce some sanity in scalar context. */
- if (GIMME == G_SCALAR && ++markix != stack_sp - stack_base ) {
+ if (gimme == G_SCALAR && ++markix != stack_sp - stack_base ) {
if (markix > stack_sp - stack_base)
*(stack_base + markix) = &sv_undef;
else
dMARK;
register I32 items = SP - MARK;
I32 hasargs = (op->op_flags & OPf_STACKED) != 0;
- I32 gimme = GIMME;
AV* padlist = CvPADLIST(cv);
SV** svp = AvARRAY(padlist);
push_return(op->op_next);
GV *tmpgv;
SETERRNO(0,0);
-#if defined(HAS_TRUNCATE) || defined(HAS_CHSIZE)
+#if defined(HAS_TRUNCATE) || defined(HAS_CHSIZE) || defined(F_FREESP)
#ifdef HAS_TRUNCATE
if (op->op_flags & OPf_SPECIAL) {
tmpgv = gv_fetchpv(POPp,FALSE, SVt_PVIO);
char *filename;
{
char mybuf[8192];
- char *s, *tmps;
+ char *s,
+ *save_filename = filename;
int anum = 1;
FILE *myfp;
return 0;
}
else { /* some mkdirs return no failure indication */
- anum = (Stat(filename, &statbuf) >= 0);
+ anum = (Stat(save_filename, &statbuf) >= 0);
if (op->op_type == OP_RMDIR)
anum = !anum;
if (anum)
if (SvNVX(sv) < 0.0)
return I_V(SvNVX(sv));
else
- return (IV)(UV)SvNVX(sv);
+ return (IV) U_V(SvNVX(sv));
}
if (SvPOKp(sv) && SvLEN(sv)) {
if (dowarn && !looks_like_number(sv))
if (SvNVX(sv) < 0.0)
return I_V(SvNVX(sv));
else
- return (IV)(UV)SvNVX(sv);
+ return (IV) U_V(SvNVX(sv));
}
if (SvPOKp(sv) && SvLEN(sv)) {
if (dowarn && !looks_like_number(sv))
if (SvNVX(sv) < 0.0)
SvIVX(sv) = I_V(SvNVX(sv));
else
- SvIVX(sv) = (IV)(UV)SvNVX(sv);
+ SvIVX(sv) = (IV) U_V(SvNVX(sv));
}
else if (SvPOKp(sv) && SvLEN(sv)) {
if (dowarn && !looks_like_number(sv))
# include <vfork.h>
#endif
+#ifdef I_LIMITS /* Needed for cast_xxx() functions below. */
+# include <limits.h>
+#endif
+
/* Put this after #includes because fork and vfork prototypes may
conflict.
*/
#endif
#ifndef CASTI32
+
+/* Look for MAX and MIN integral values. If we can't find them,
+ we'll use 32-bit two's complement defaults.
+*/
+#ifndef LONG_MAX
+# ifdef MAXLONG /* Often used in <values.h> */
+# define LONG_MAX MAXLONG
+# else
+# define LONG_MAX 2147483647L
+# endif
+#endif
+
+#ifndef LONG_MIN
+# define LONG_MIN (-LONG_MAX - 1)
+#endif
+
+#ifndef ULONG_MAX
+# ifdef MAXULONG
+# define LONG_MAX MAXULONG
+# else
+# define ULONG_MAX 4294967295L
+# endif
+#endif
+
+/* Unfortunately, on some systems the cast_uv() function doesn't
+ work with the system-supplied definition of ULONG_MAX. The
+ comparison (f >= ULONG_MAX) always comes out true. It must be a
+ problem with the compiler constant folding.
+
+ In any case, this workaround should be fine on any two's complement
+ system. If it's not, supply a '-DMY_ULONG_MAX=whatever' in your
+ ccflags.
+ --Andy Dougherty <doughera@lafcol.lafayette.edu>
+*/
+#ifndef MY_ULONG_MAX
+# define MY_ULONG_MAX ((UV)LONG_MAX * (UV)2 + (UV)1)
+#endif
+
I32
cast_i32(f)
double f;
{
-# define BIGDOUBLE 2147483647.0 /* Assume 32 bit int's ! */
-# define BIGNEGDOUBLE (-2147483648.0)
- if (f >= BIGDOUBLE)
- return (I32) BIGDOUBLE;
- if (f <= BIGNEGDOUBLE)
- return (I32) BIGNEGDOUBLE;
+ if (f >= LONG_MAX)
+ return (I32) LONG_MAX;
+ if (f <= LONG_MIN)
+ return (I32) LONG_MIN;
return (I32) f;
}
-# undef BIGDOUBLE
-# undef BIGNEGDOUBLE
IV
cast_iv(f)
double f;
{
- /* XXX This should be fixed. It assumes 32 bit IV's. */
-# define BIGDOUBLE 2147483647.0 /* Assume 32 bit IV's ! */
-# define BIGNEGDOUBLE (-2147483648.0)
- if (f >= BIGDOUBLE)
- return (IV) BIGDOUBLE;
- if (f <= BIGNEGDOUBLE)
- return (IV) BIGNEGDOUBLE;
+ if (f >= LONG_MAX)
+ return (IV) LONG_MAX;
+ if (f <= LONG_MIN)
+ return (IV) LONG_MIN;
return (IV) f;
}
-# undef BIGDOUBLE
-# undef BIGNEGDOUBLE
+
+UV
+cast_uv(f)
+double f;
+{
+ if (f >= MY_ULONG_MAX)
+ return (UV) MY_ULONG_MAX;
+ return (UV) f;
+}
+
#endif
#ifndef HAS_RENAME