summaryrefslogtreecommitdiff
path: root/x2p
diff options
context:
space:
mode:
authorLarry Wall <lwall@scalpel.netlabs.com>1995-11-21 10:01:00 +1200
committerLarry <lwall@scalpel.netlabs.com>1995-11-21 10:01:00 +1200
commit4633a7c4bad06b471d9310620b7fe8ddd158cccd (patch)
tree37ebeb26a64f123784fd8fac6243b124767243b0 /x2p
parent8e07c86ebc651fe92eb7e3b25f801f57cfb8dd6f (diff)
downloadperl-4633a7c4bad06b471d9310620b7fe8ddd158cccd.tar.gz
5.002 beta 1
If you're adventurous, have a look at ftp://ftp.sems.com/pub/outgoing/perl5.0/perl5.002beta1.tar.gz Many thanks to Andy for doing the integration. Obviously, if you consult the bugs database, you'll note there are still plenty of buglets that need fixing, and several enhancements that I've intended to put in still haven't made it in (Hi, Tim and Ilya). But I think it'll be pretty stable. And you can start to fiddle around with prototypes (which are, of course, still totally undocumented). Packrats, don't worry too much about readvertising this widely. Nowadays we're on a T1 here, so our bandwidth is okay. Have the appropriate amount of jollity. Larry
Diffstat (limited to 'x2p')
-rwxr-xr-xx2p/Makefile.SH13
-rw-r--r--x2p/a2p.h12
-rwxr-xr-xx2p/cflags.SH2
-rw-r--r--[-rwxr-xr-x]x2p/find2perl.PL (renamed from x2p/find2perl.SH)83
-rw-r--r--[-rwxr-xr-x]x2p/s2p.PL (renamed from x2p/s2p.SH)79
5 files changed, 108 insertions, 81 deletions
diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH
index bb26d4e5e4..d34caea22f 100755
--- a/x2p/Makefile.SH
+++ b/x2p/Makefile.SH
@@ -48,9 +48,13 @@ manpages = a2p.man s2p.man
util =
-sh = Makefile.SH cflags.SH find2perl.SH s2p.SH
+sh = Makefile.SH cflags.SH
+shextract = Makefile cflags
-addedbyconf = Makefile cflags find2perl s2p
+pl = find2perl.PL s2p.PL
+plextract = find2perl s2p
+
+addedbyconf = $(shextract) $(plextract)
h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
@@ -116,6 +120,11 @@ hlist:
shlist:
echo $(sh) | tr ' ' '\012' >.shlist
+# These should be automatically generated
+
+$(plextract):
+ ../miniperl -I../lib $@.PL
+
malloc.c: ../malloc.c
rm -f malloc.c
sed <../malloc.c >malloc.c \
diff --git a/x2p/a2p.h b/x2p/a2p.h
index 0f5a7edaff..77d55ced7a 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -79,6 +79,18 @@
# endif
#endif
+#ifdef DOSISH
+# if defined(OS2)
+# include "../os2ish.h"
+# else
+# include "../dosish.h"
+# endif
+#else
+# if defined(VMS)
+# include "../vmsish.h"
+# endif
+#endif
+
#ifndef STANDARD_C
/* All of these are in stdlib.h or time.h for ANSI C */
Time_t time();
diff --git a/x2p/cflags.SH b/x2p/cflags.SH
index e20c3a478b..531ef65805 100755
--- a/x2p/cflags.SH
+++ b/x2p/cflags.SH
@@ -49,7 +49,7 @@ case $# in
0) set *.c; echo "The current C flags are:" ;;
esac
-set `echo "$* " | sed 's/\.[oc] / /g'`
+set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g'`
for file do
diff --git a/x2p/find2perl.SH b/x2p/find2perl.PL
index 3652bde07c..785ffa63ca 100755..100644
--- a/x2p/find2perl.SH
+++ b/x2p/find2perl.PL
@@ -1,44 +1,45 @@
-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 x2p/find2perl (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.
-rm -f find2perl
-$spitshell >find2perl <<!GROK!THIS!
-#!$binexp/perl
+#!/usr/local/bin/perl
+
+use Config;
+use File::Basename qw(&basename &dirname);
+
+# List explicitly here the variables you want Configure to
+# generate. Metaconfig only looks for shell variables, so you
+# have to mention them as if they were shell variables, not
+# %Config entries. Thus you write
+# $startperl
+# to ensure Configure will look for $Config{startperl}.
+
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+chdir(dirname($0));
+($file = basename($0)) =~ s/\.PL$//;
+$file =~ s/\.pl$//
+ if ($Config{'osname'} eq 'VMS' or
+ $Config{'osname'} eq 'OS2'); # "case-forgiving"
+
+open OUT,">$file" or die "Can't create $file: $!";
+
+print "Extracting $file (with variable substitutions)\n";
+
+# In this section, perl variables will be expanded during extraction.
+# You can use $Config{...} to use Configure variables.
+
+print OUT <<"!GROK!THIS!";
+$Config{'startperl'}
+ eval 'exec perl -S \$0 "\$@"'
+ if 0;
+\$startperl = $Config{startperl};
+!GROK!THIS!
+
+# In the following, perl variables are not expanded during extraction.
+
+print OUT <<'!NO!SUBS!';
#
# Modified September 26, 1993 to provide proper handling of years after 1999
# Tom Link <tml+@pitt.edu>
# University of Pittsburgh
-eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
- if \$running_under_some_shell;
-
-\$bin = "$bin";
-
-!GROK!THIS!
-
-: In the following dollars and backticks do not need the extra backslash.
-$spitshell >>find2perl <<'!NO!SUBS!'
-
while ($ARGV[0] =~ /^[^-!(]/) {
push(@roots, shift);
}
@@ -240,9 +241,9 @@ while (@ARGV) {
}
print <<"END";
-#!$bin/perl
+$startperl
-eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
+eval 'exec perl -S \$0 \${1+"\$@"}'
if \$running_under_some_shell;
END
@@ -600,5 +601,7 @@ sub quote {
"'$string'";
}
!NO!SUBS!
-chmod 755 find2perl
-$eunicefix find2perl
+
+close OUT or die "Can't close $file: $!";
+chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
+exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
diff --git a/x2p/s2p.SH b/x2p/s2p.PL
index a4d5a39dfc..fe82b02325 100755..100644
--- a/x2p/s2p.SH
+++ b/x2p/s2p.PL
@@ -1,39 +1,40 @@
-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 x2p/s2p (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.
-rm -f s2p
-$spitshell >s2p <<!GROK!THIS!
-#!$binexp/perl
-
-eval 'exec perl -S \$0 \${1+"\$@"}'
- if \$running_under_some_shell;
-
-\$bin = '$bin';
+#!/usr/local/bin/perl
+
+use Config;
+use File::Basename qw(&basename &dirname);
+
+# List explicitly here the variables you want Configure to
+# generate. Metaconfig only looks for shell variables, so you
+# have to mention them as if they were shell variables, not
+# %Config entries. Thus you write
+# $startperl
+# to ensure Configure will look for $Config{startperl}.
+
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+chdir(dirname($0));
+($file = basename($0)) =~ s/\.PL$//;
+$file =~ s/\.pl$//
+ if ($Config{'osname'} eq 'VMS' or
+ $Config{'osname'} eq 'OS2'); # "case-forgiving"
+
+open OUT,">$file" or die "Can't create $file: $!";
+
+print "Extracting $file (with variable substitutions)\n";
+
+# In this section, perl variables will be expanded during extraction.
+# You can use $Config{...} to use Configure variables.
+
+print OUT <<"!GROK!THIS!";
+$Config{'startperl'}
+ eval 'exec perl -S \$0 "\$@"'
+ if 0;
+\$startperl = $Config{startperl};
!GROK!THIS!
-: In the following dollars and backticks do not need the extra backslash.
-$spitshell >>s2p <<'!NO!SUBS!'
+# In the following, perl variables are not expanded during extraction.
+
+print OUT <<'!NO!SUBS!';
# $RCSfile: s2p.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:23 $
#
@@ -293,8 +294,8 @@ unless ($debug) {
close HEAD;
print &q(<<"EOT");
-: #!$bin/perl
-: eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
+: $startperl
+: eval 'exec perl -S \$0 \${1+"\$@"}'
: if \$running_under_some_shell;
:
EOT
@@ -775,5 +776,7 @@ sub simplify {
}
!NO!SUBS!
-chmod 755 s2p
-$eunicefix s2p
+
+close OUT or die "Can't close $file: $!";
+chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
+exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';