# This script acts as a simple interface for building extensions.
# It primarily used by the perl Makefile:
#
# d_dummy $(dynamic_ext): miniperl preplibrary FORCE
#
# It may be deleted in a later release of perl so try to
# avoid using it for other purposes.
target=$1; shift
extspec=$1; shift
echo ""
# Previously, $make was taken from config.sh. However, the user might
# instead be running a possibly incompatible make. This might happen if
# the user types "gmake" instead of a plain "make", for example. The
# correct current value of MAKE will come through from the main perl
# case third party users of this script (are there any?) don't have the
# MAKE=$(MAKE) argument, which was added after 5.004_03.
MAKE=*)
eval $makecmd
;;
exit 1
;;
esac
'')
else
echo "Can't find config.sh generated by Configure"; exit 1
fi
;;
esac
if test "X$extspec" = X; then
echo "make_ext: no extension specified"
exit 1;
fi
# The Perl Makefile.SH will expand all extensions to
# A user wishing to run make_ext might use
# X (or X/Y or X::Y if nested)
# canonise into X/Y form (pname)
ext*) # Remove ext/ prefix and /pm_to_blib suffix
*::*) # Convert :: to /
esac
# echo "Converted $extspec to $pname"
makeargs=''
makeopts=''
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. Valid link types are
# 'dynamic', 'static', and 'static_pic' (the last one respects
# CCCDLFLAGS such as -fPIC -- see static_target in the main Makefile.SH)
;;
;;
;;
;;
*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
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
;;
esac
if test ! -f $makefile ; then
test -f Makefile.PL && ../$depth/miniperl -I../$depth/lib Makefile.PL INSTALLDIRS=perl PERL_CORE=1 $passthru
fi
if test ! -f $makefile ; then
if test -f Makefile.SH; then
echo "Warning: Writing $makefile from old-style Makefile.SH!"
else
echo "Warning: No Makefile!"
fi
fi
clean) ;;
realclean) ;;
*) # Give makefile an opportunity to rewrite itself.
# reassure users that life goes on...
;;
esac
exit $?