summaryrefslogtreecommitdiff
path: root/writemain.SH
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1994-05-04 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1994-05-04 23:00:00 +0000
commit85e6fe838fb25b257a1b363debf8691c0992ef71 (patch)
treefd5340cd6c3bbabfc21d3b0cac48e7ab3a481ebf /writemain.SH
parent2304df62caa7d9be70e8b8bcdb454e139c9c103d (diff)
downloadperl-85e6fe838fb25b257a1b363debf8691c0992ef71.tar.gz
perl 5.0 alpha 9perl-5a9
[editor's note: the sparc executables have not been included, and emacs backup files have been removed]
Diffstat (limited to 'writemain.SH')
-rw-r--r--writemain.SH55
1 files changed, 55 insertions, 0 deletions
diff --git a/writemain.SH b/writemain.SH
new file mode 100644
index 0000000000..ea8aeabbd2
--- /dev/null
+++ b/writemain.SH
@@ -0,0 +1,55 @@
+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."; exit 1
+ fi
+ . $TOP/config.sh
+ ;;
+esac
+: This forces SH files to create target in same directory as SH file.
+: This is so that make depend always knows where to find SH derivatives.
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+echo "Extracting writemain (with variable substitutions)"
+: This section of the file will have variable substitutions done on it.
+: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
+: Protect any dollar signs and backticks that you do not want interpreted
+: by putting a backslash in front. You may delete these comments.
+$spitshell >writemain <<!GROK!THIS!
+$startsh
+!GROK!THIS!
+
+: In the following dollars and backticks do not need the extra backslash.
+$spitshell >>writemain <<'!NO!SUBS!'
+: This script takes the plain miniperlmain.c and writes out perlmain.c
+: which includes all the extensions.
+: The command line arguments name extensions to be used.
+: E.g.: sh writemain SDBM_File POSIX > perlmain.c
+:
+args="$*"
+if test X"$args" = "X" ; then
+ cat miniperlmain.c
+else
+ sed '/Do not delete this line--writemain depends on it/q' miniperlmain.c
+ cat << 'EOP'
+
+#ifdef USE_DYNAMIC_LOADING
+ boot_DynamicLoader();
+#endif
+
+EOP
+ for ext in $args; do
+ echo " newXSUB(\"${ext}::bootstrap\", 0, boot_${ext}, file);"
+ done
+ echo '}'
+fi
+
+!NO!SUBS!
+chmod 755 writemain
+$eunicefix writemain