1N/Acase $PERL_CONFIG_SH in
1N/A'')
1N/A if test -f config.sh; then TOP=.;
1N/A elif test -f ../config.sh; then TOP=..;
1N/A elif test -f ../../config.sh; then TOP=../..;
1N/A elif test -f ../../../config.sh; then TOP=../../..;
1N/A elif test -f ../../../../config.sh; then TOP=../../../..;
1N/A else
1N/A echo "Can't find config.sh."; exit 1
1N/A fi
1N/A . $TOP/config.sh
1N/A ;;
1N/Aesac
1N/A: This forces SH files to create target in same directory as SH file.
1N/A: This is so that make depend always knows where to find SH derivatives.
1N/Acase "$0" in
1N/A*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
1N/Aesac
1N/Aecho "Extracting writemain (with variable substitutions)"
1N/A: This section of the file will have variable substitutions done on it.
1N/A: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
1N/A: Protect any dollar signs and backticks that you do not want interpreted
1N/A: by putting a backslash in front. You may delete these comments.
1N/Arm -f writemain
1N/A$spitshell >writemain <<!GROK!THIS!
1N/A$startsh
1N/A!GROK!THIS!
1N/A
1N/A: In the following dollars and backticks do not need the extra backslash.
1N/A$spitshell >>writemain <<'!NO!SUBS!'
1N/A# This script takes the plain miniperlmain.c and writes out perlmain.c
1N/A# which includes all the extensions.
1N/A# The command line arguments name extensions to be used.
1N/A# E.g.: sh writemain SDBM_File POSIX > perlmain.c
1N/A#
1N/A
1N/Aorig="$*"
1N/Aargs=''
1N/A: Remove any .a suffixes and any leading path components
1N/Afor file in $orig ; do
1N/A case "$file" in
1N/A *.a) file=`echo $file | sed 's/\.a//g'`
1N/A ;;
1N/A esac
1N/A case "$file" in
1N/A ext/*) file=`echo $file | sed 's:ext/\(.*\)/[^/]*:\1:'`
1N/A ;;
1N/A lib/auto/*) file=`echo $file | sed 's:lib/auto/\(.*\)/[^/]*:\1:'`
1N/A ;;
1N/A */*)
1N/A file=`expr X$file : 'X.*/\(.*\)'`
1N/A ;;
1N/A esac
1N/A args="$args $file"
1N/Adone
1N/A
1N/A
1N/Ased '/Do not delete this line--writemain depends on it/q' miniperlmain.c
1N/A
1N/A
1N/Aif test X"$args" != "X" ; then
1N/A for ext in $args ; do
1N/A: $ext will either be 'Name' or 'Name1/Name2' etc
1N/A: convert ext into cname and mname
1N/Amname=`echo $ext | sed 's!/!::!g'`
1N/Acname=`echo $mname | sed 's!:!_!g'`
1N/A
1N/Aecho "EXTERN_C void boot_${cname} (pTHX_ CV* cv);"
1N/A done
1N/Afi
1N/A
1N/Acat << 'EOP'
1N/A
1N/Astatic void
1N/Axs_init(pTHX)
1N/A{
1N/AEOP
1N/A
1N/Aif test X"$args" != "X" ; then
1N/A echo " char *file = __FILE__;"
1N/A echo " dXSUB_SYS;"
1N/A
1N/A ai=''
1N/A
1N/A for ext in $args ; do
1N/A
1N/A : $ext will either be 'Name' or 'Name1/Name2' etc
1N/A : convert ext into cname and mname
1N/A mname=`echo $ext | sed 's!/!::!g'`
1N/A cname=`echo $mname | sed 's!:!_!g'`
1N/A
1N/A if test "$ext" = "DynaLoader"; then
1N/A : Must NOT install 'DynaLoader::boot_DynaLoader' as 'bootstrap'!
1N/A : boot_DynaLoader is called directly in DynaLoader.pm
1N/A echo " newXS(\"${mname}::boot_${ext}\", boot_${cname}, file);"
1N/A else
1N/A echo " newXS(\"${mname}::bootstrap\", boot_${cname}, file);"
1N/A fi
1N/A done
1N/Afi
1N/A
1N/Acat << 'EOP'
1N/A}
1N/AEOP
1N/A
1N/A!NO!SUBS!
1N/Achmod 755 writemain
1N/A$eunicefix writemain