summaryrefslogtreecommitdiff
path: root/ext/util
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-26 00:40:50 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-26 00:40:50 +0000
commit75f926282bd78abe2f394977be7dd4dc52cb21ba (patch)
treefd86369fb52a5fa00387d1ce65c7086f0ac41b94 /ext/util
parent420218e7eb4fa5ceefe298e6d9121548b8d806d6 (diff)
downloadperl-75f926282bd78abe2f394977be7dd4dc52cb21ba.tar.gz
perl5.000 patch.0i: fix glaring mistakes in patches a-h
This patch does the following things: 1. Fix various bonehead errors I introduced in patches a-g. 2. Incorporate MakeMaker changes to bring it up to version 4.01 (mostly). 3. Stick in things I forgot in patches a-g (e.g. AIX). 4. Some minor additional cleanup in x2p/ for even pickier compilers. 5. More hints updates (hpux and next). 6. Include newest dl_hpux.xs. I didn't have time to 1. Fix the overlapping strcpy() in op.c 2. Restore h2xs to Larry's original design to process <>. 3. take out unnecessary "use Config" in installperl. 4. Add in vms patches. I forgot to [If I remembered what i forgot, I wouldn't have forgotten it. :] I deliberately decided *not* to 1. Touch pod/* 2. deal with overloading Specifically, here's what's included: Configure Regenerated to be sure it's up-to-date. Makefile.SH Build extension libraries right into lib/auto/whatever. Don't set CCCDLFLAGS since we don't use it anyway. Take care to avoid modifying lib/Config.pm without reason Visit DynaLoader for `make clean'. (Previously only did so for `make realclean'.) @echo "Note that make realclean does not delete config.sh" Include config.h dependency. U/i_db.U config_h.SH config.H Remove unwanted quotes around db_hashtype and db_prefixtype. configpm Allow specification of alternate name for lib/Config.pm, so the makefile mv-if-diff trick saves needless re-making. ext/DynaLoader/DynaLoader.pm Updated warning messages and comments. ext/DynaLoader/dl_hpux.xs Updated to version 2.1. Now uses bootstrap files. ext/util/make_ext Explicitly use #!/bin/sh to start it up. This is useful for testing make_ext. Improve & simplify Nested::Extension::Processing. More robust handling of `make clean'. hints/hpux_9.sh Support both the bundled and unbundled compilers. hints/next_3_2.sh Back to using -posix rather than POSIX_SOURCE. And that only for ext/POSIX/POSIX.xs. installperl Special ranlib treatment for NeXT, which gets confused about timestamps in libraries, even when you just copy the library. Supply missing '$' in samepath() function. lib/AutoSplit.pm New parameters. lib/ExtUtils/MakeMaker.pm Upgraded from 3.8 to 4.01. lib/ExtUtils/xsubpp Documentation changed from man to pod. lib/Getopt/Long.pm Avoid typo warning. Drop unused $optx. lib/Text/Tabs.pm Fix package name. makedepend.SH Explicitly start with $startsh. Catch cpp that prints # <stdin> instead of line numbers. perl.h Fix bonehead mistake that ended up calling my_fmod even if not needed. perl_exp.SH also add symbols from interp.sym proto.h Delete 2 redundant prototypes (newBINOP and newUNOP). util.c Add (char *) casts to unsigned char args to bcmp. x2p/a2p.h Rearrange order of <string?.h> and bcopy & bzero stuff. Change a few function prototypes to void, to reflect actual usage. x2p/a2py.c Change a few function types to void, to reflect actual usage. x2p/handy.h Make *alloc declarations match those in x2p/util.c. x2p/util.c Make *alloc declarations match those in x2p/handy.h. x2p/walk.c Add a (Size_t) cast for comparison of 1 to the result of strlen(). Thanks to all who's work is included here. Little of it is mine.
Diffstat (limited to 'ext/util')
-rw-r--r--ext/util/make_ext76
1 files changed, 52 insertions, 24 deletions
diff --git a/ext/util/make_ext b/ext/util/make_ext
index f4a1b8884e..ae10a9d628 100644
--- a/ext/util/make_ext
+++ b/ext/util/make_ext
@@ -1,3 +1,5 @@
+#!/bin/sh
+
# This script acts as a simple interface for building extensions.
# It primarily used by the perl Makefile:
#
@@ -31,24 +33,27 @@ if test "X$extspec" = X; then
exit 1;
fi
-# canonise
-extspec=`echo "$extspec" | sed -e 's:^ext/::' -e 's:\.[^\.]*$::'`
-extspec="ext/$extspec"
-tailext=`echo "$extspec" | sed -e 's:.*/\([^/]*\)$:\1:'"`
-headext=`echo "$extspec" | sed -e 's:/[^/]*$::'"`
-if test -d "$headext/$tailext"; then
- extspec="$headext/$tailext"
-fi
-if test -f "$extspec/$tailext.xs"; then
- extspec="$extspec/$tailext"
-fi
+# The Perl Makefile.SH will expand all extensions to
+# lib/auto/X/X.a (or lib/auto/X/Y/Y.a is nested)
+# A user wishing to run make_ext might use
+# X (or X/Y or X::Y is nested)
+
+# canonise into X/Y form (pname)
+case "$extspec" in
+lib*) # Remove lib/auto prefix and /*.* suffix
+ pname=`echo "$extspec" | sed -e 's:^lib/auto/::' -e 's:/[^/]*\.[^/]*$::' ` ;;
+*::*) # Convert :: to /
+ pname=`echo "$extspec" | sed -e 's/::/\//g' ` ;;
+*) pname="$extspec" ;;
+esac
+# echo "Converted $extspec to $pname"
-# get extension directory path, module name and depth
-pname=`echo "$extspec" | sed -e 's:^ext/::' -e 's:/[^/]*$::'`
mname=`echo "$pname" | sed -e 's!/!::!g'`
depth=`echo "$pname" | sed -e 's![^/][^/]*!..!g'`
make=${altmake-make}
+makefile=Makefile
makeargs=''
+makeopts=''
if test ! -d "ext/$pname"; then
echo " Skipping $extspec (directory does not exist)"
@@ -62,28 +67,51 @@ cd ext/$pname
# check link type and do any preliminaries
case "$target" in
- # convert 'static' or 'dynamic' into 'all LINKTYPE=XXX'
-static) makeargs="LINKTYPE=static CCCDLFLAGS="; target=all ;;
-dynamic) makeargs="LINKTYPE=dynamic"; target=all ;;
-*clean) ;;
+ # convert 'static' or 'dynamic' into 'all LINKTYPE=XXX'
+static) makeargs="LINKTYPE=static CCCDLFLAGS="
+ target=all
+ ;;
+dynamic) makeargs="LINKTYPE=dynamic";
+ target=all
+ ;;
+
+*clean) # If Makefile has been moved to Makefile.old by a make clean
+ # then use Makefile.old for realclean rather than rebuild it
+ if test ! -f $makefile -a -f Makefile.old; then
+ makefile=Makefile.old
+ makeopts="-f $makefile"
+ echo "Note: Using Makefile.old"
+ fi
+ ;;
+
*) # for the time being we are strict about what make_ext is used for
- echo "make_ext: unknown make target '$target'"; exit 1;;
-'') echo "make_ext: no make target specified (eg static or dynamic)"; exit 1;;
+ echo "make_ext: unknown make target '$target'"; exit 1
+ ;;
+'') echo "make_ext: no make target specified (eg static or dynamic)"; exit 1
+ ;;
esac
-if test ! -f Makefile ; then
+if test ! -f $makefile ; then
test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL
fi
-if test ! -f Makefile ; then
- test -f Makefile.SH && sh Makefile.SH
+if test ! -f $makefile ; then
+ if test -f Makefile.SH; then
+ echo "Warning: Writing $makefile from old-style Makefile.SH!"
+ sh Makefile.SH
+ else
+ echo "Warning: No Makefile!"
+ fi
fi
case "$target" in
clean) ;;
realclean) ;;
-*) $make config $passthru;;
+*) # Give makefile an opportunity to rewrite itself.
+ # reassure users that life goes on...
+ $make config $passthru || echo "$make config failed, continuing anyway..."
+ ;;
esac
-$make $target $makeargs $passthru || exit
+$make $makeopts $target $makeargs $passthru || exit
exit $?