Mailing List Archive

$startperl fixes for 1g
This patch fixes a bug in find2perl and s2p (the versions in 1g don't
compile because of some missing quotes) and adds $startperl to the
places I spotted which were missing it (a2p and makeaperl).

The best way I could think of fixing a2p was to add a #define to hold
$startperl to config.h. (At first I wanted to put it into
x2p/Makefile.SH but I had some trouble because make would treat the
expanded #! as the start of a comment.) I'm afraid I've only shoved the
STARTPERL #define into config_h.SH though, I haven't supplied an actual
patch to a metaconfig unit. Sorry about that. I keep intending to dig
into metaconfig, but I haven't done it yet.

Index: x2p/find2perl.PL
--- x2p/find2perl.PL Sun Nov 19 23:11:58 1995
+++ ../perl/x2p/find2perl.PL Sun Dec 31 23:54:40 1995
@@ -29,7 +29,7 @@
$Config{'startperl'}
eval 'exec perl -S \$0 "\$@"'
if 0;
-\$startperl = $Config{startperl};
+\$startperl = "$Config{startperl}";
!GROK!THIS!

# In the following, perl variables are not expanded during extraction.
Index: x2p/s2p.PL
--- x2p/s2p.PL Sun Nov 19 23:14:59 1995
+++ ../perl/x2p/s2p.PL Sun Dec 31 23:55:19 1995
@@ -29,7 +29,7 @@
$Config{'startperl'}
eval 'exec perl -S \$0 "\$@"'
if 0;
-\$startperl = $Config{startperl};
+\$startperl = "$Config{startperl}";
!GROK!THIS!

# In the following, perl variables are not expanded during extraction.
Index: config_h.SH
Prereq: 3.0.1.4
--- config_h.SH Sat Dec 2 16:50:50 1995
+++ ../perl/config_h.SH Sun Dec 31 23:13:38 1995
@@ -1527,6 +1527,9 @@
*/
#define SITELIB_EXP "$sitelibexp" /**/

+/* XXX This needs to be properly integrated into Perl's metaconfig units. */
+#define STARTPERL "$startperl"
+
/* VOIDFLAGS:
* This symbol indicates how much support of the void type is given by this
* compiler. What various bits mean:
Index: makeaperl.SH
--- makeaperl.SH Thu Jun 1 11:20:52 1995
+++ ../perl/makeaperl.SH Thu Dec 7 19:58:43 1995
@@ -18,7 +18,9 @@
esac
echo "Extracting makeaperl (with variable substitutions)"
$spitshell >makeaperl <<!GROK!THIS!
-#!$binexp/perl
+$startperl
+ eval 'exec perl -S \$0 "\$@"'
+ if 0;
!GROK!THIS!

$spitshell >>makeaperl <<'!NO!SUBS!'
Index: x2p/a2py.c
--- x2p/a2py.c Tue Mar 7 11:53:10 1995
+++ ../perl/x2p/a2py.c Sun Dec 31 23:13:41 1995
@@ -153,11 +153,8 @@
/* second pass to produce new program */

tmpstr = walk(0,0,root,&i,P_MIN);
- str = str_make("#!");
- str_cat(str, BIN);
- str_cat(str, "/perl\neval \"exec ");
- str_cat(str, BIN);
- str_cat(str, "/perl -S $0 $*\"\n\
+ str = str_make(STARTPERL);
+ str_cat(str, "\neval 'exec perl -S $0 \"$@\"'\n\
if $running_under_some_shell;\n\
# this emulates #! processing on NIH machines.\n\
# (remove #! line above if indigestible)\n\n");

--
Roderick Schertler
roderick@gate.net
Re: $startperl fixes for 1g [ In reply to ]
On Mon, 1 Jan 1996, Roderick Schertler wrote:

> This patch fixes a bug in find2perl and s2p (the versions in 1g don't
> compile because of some missing quotes) and adds $startperl to the
> places I spotted which were missing it (a2p and makeaperl).

Thanks. I'll look at integrating this stuff in. In particular, I'll
check on the STARTPERL stuff for a2p.

Andy Dougherty doughera@lafcol.lafayette.edu