diff options
author | Larry Wall <lwall@netlabs.com> | 1994-10-17 23:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1994-10-17 23:00:00 +0000 |
commit | a0d0e21ea6ea90a22318550944fe6cb09ae10cda (patch) | |
tree | faca1018149b736b1142f487e44d1ff2de5cc1fa /ext/util/make_ext | |
parent | 85e6fe838fb25b257a1b363debf8691c0992ef71 (diff) | |
download | perl-a0d0e21ea6ea90a22318550944fe6cb09ae10cda.tar.gz |
perl 5.000perl-5.000
[editor's note: this commit combines approximate 4 months of furious
releases of Andy Dougherty and Larry Wall - see pod/perlhist.pod for
details. Andy notes that;
Alas neither my "Irwin AccuTrack" nor my DC 600A quarter-inch cartridge
backup tapes from that era seem to be readable anymore. I guess 13 years
exceeds the shelf life for that backup technology :-(.
]
Diffstat (limited to 'ext/util/make_ext')
-rw-r--r-- | ext/util/make_ext | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/ext/util/make_ext b/ext/util/make_ext new file mode 100644 index 0000000000..fba77c0c9f --- /dev/null +++ b/ext/util/make_ext @@ -0,0 +1,74 @@ +# This script acts as a simple interface for building extensions. +# It primarily used by the perl Makefile: +# +# d_dummy $(dynamic_ext): miniperl preplibrary FORCE +# ext/util/make_ext dynamic $@ +# +# It may be deleted in a later release of perl so try to +# avoid using it for other purposes. + +linktype=$1 +extspec=$2 + +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 generated by Configure"; exit 1 + fi + . $TOP/config.sh + ;; +esac + +if test "X$extspec" = X; then + echo "make_ext: no extension specified" + exit 1; +fi + +# convert old style Name.a into ext/Name/Name.a format +case "$extspec" in +ext/*) ;; +*) extspec=`echo "$extspec" | sed -e 's:\(.*\)\.\(.*\):ext/\1/\1.\2:'` +esac + +# get extension directory path, module name and depth +pname=`echo "$extspec" | sed -e 's:^ext/::' -e 's:/[^/]*$::'` +mname=`echo "$pname" | sed -e 's!/!::!'` +depth=`echo "$pname" | sed -e 's![^/][^/]*!..!g'` + +if test ! -d "ext/$pname"; then + echo " Skipping $extspec (directory does not exist)" + exit 0 # not an error ? +fi + +# check link type and do any preliminaries +case "$linktype" in +static) makeargs='CCCDLFLAGS=' ;; +dynamic) makeargs='' ;; +*) echo "make_ext: unknown link type '$linktype'"; exit 1;; +'') echo "make_ext: no link type specified (eg static or dynamic)"; exit 1;; +esac + +echo "" +echo " Making $mname ($linktype)" + +cd ext/$pname + +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 +fi + +make=${altmake-make} + +$make config + +$make $linktype $makeargs + +exit $? |