3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
9 echo "Can't find config.sh."; exit 1
14 : This forces SH files to create target in same directory as SH file.
15 : This is so that make depend always knows where to find SH derivatives.
17 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
19 echo "Extracting writemain (with variable substitutions)"
20 : This section of the file will have variable substitutions done on it.
21 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
22 : Protect any dollar signs and backticks that you do not want interpreted
23 : by putting a backslash in front. You may delete these comments.
25 $spitshell >writemain <<!GROK!THIS!
30 : In the following dollars and backticks do not need the extra backslash.
31 $spitshell >>writemain <<'!NO!SUBS!'
32 # This script takes the plain miniperlmain.c and writes out perlmain.c
33 # which includes all the extensions.
34 # The command line arguments name extensions to be used.
35 # E.g.: sh writemain SDBM_File POSIX > perlmain.c
40 : Remove any .a suffixes and any leading path components
41 for file in $orig ; do
43 *.a) file=`echo $file | sed 's/\.a//g'`
47 ext/*) file=`echo $file | sed 's:ext/\(.*\)/[^/]*:\1:'`
49 lib/auto/*) file=`echo $file | sed 's:lib/auto/\(.*\)/[^/]*:\1:'`
52 file=`expr X$file : 'X.*/\(.*\)'`
59 sed '/Do not delete this line--writemain depends on it/q' $src/miniperlmain.c
62 if test X"$args" != "X" ; then
64 : $ext will either be 'Name' or 'Name1/Name2' etc
65 : convert ext into cname and mname
66 mname=`echo $ext | sed 's!/!::!g'`
67 cname=`echo $mname | sed 's!:!_!g'`
69 echo "EXTERN_C void boot_${cname} (pTHX_ CV* cv);"
80 if test X"$args" != "X" ; then
81 echo " char *file = __FILE__;"
88 : $ext will either be 'Name' or 'Name1/Name2' etc
89 : convert ext into cname and mname
90 mname=`echo $ext | sed 's!/!::!g'`
91 cname=`echo $mname | sed 's!:!_!g'`
93 if test "$ext" = "DynaLoader"; then
94 : Must NOT install 'DynaLoader::boot_DynaLoader' as 'bootstrap'!
95 : boot_DynaLoader is called directly in DynaLoader.pm
96 echo " newXS(\"${mname}::boot_${ext}\", boot_${cname}, file);"
98 echo " newXS(\"${mname}::bootstrap\", boot_${cname}, file);"