1 ?RCS: $Id: startperl.U,v 3.0 1993/08/18 12:09:50 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: This file is included with or a derivative work of a file included
6 ?RCS: with the metaconfig program of Raphael Manfredi's "dist" distribution.
7 ?RCS: In accordance with clause 7 of dist's modified Artistic License:
9 ?RCS: You may distribute under the terms of either the GNU General Public
10 ?RCS: License or the Artistic License, as specified in the README file.
12 ?RCS: $Log: startperl.U,v $
13 ?RCS: Perl5 version -- I always have d_portable=define.
15 ?RCS: Revision 3.0 1993/08/18 12:09:50 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
18 ?MAKE:startperl: cat Myread sharpbang initialinstalllocation test \
20 ?MAKE: -pick add $@ %<
22 ?X: This is different from dist's standard startperl.U unit because
23 ?X: we can't directly test #!/usr/local/bin/perl (or whatever) because
24 ?X: we haven't built and installed perl yet.
26 ?S: This variable contains the string to put on the front of a perl
27 ?S: script to make sure (hopefully) that it runs with perl and not some
28 ?S: shell. Of course, that leading line must be followed by the classical
30 ?S: eval 'exec perl -S $0 ${1+"$@"}'
31 ?S: if $running_under_some_shell;
32 ?S: to guarantee perl startup should the shell execute the script. Note
33 ?S: that this magic incatation is not understood by csh.
36 ?C: This variable contains the string to put in front of a perl
37 ?C: script to make sure (one hopes) that it runs with perl and not
40 ?H:#define STARTPERL "$startperl" /**/
42 : figure out how to guarantee perl startup
43 : XXX Note that this currently takes advantage of the bug that binexp ignores
44 : the Configure -Dinstallprefix setting, which in turn means that under
45 : relocatable @INC, initialinstalllocation is what binexp started as.
52 I can use the #! construct to start perl on your system. This will
53 make startup of perl scripts faster, but may cause problems if you
54 want to share those scripts and perl is not in a standard place
55 ($initialinstalllocation/perl) on all your platforms. The alternative
56 is to force a shell by starting the script with a single ':' character.
59 case "$versiononly" in
60 "$define") dflt="$initialinstalllocation/perl$version";;
61 *) dflt="$initialinstalllocation/perl";;
63 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
66 none) startperl=": # use perl";;
68 if $test 30 -lt `echo "$ans" | wc -c`; then
71 WARNING: Some systems limit the #! command to 32 characters.
72 If you experience difficulty running Perl scripts with #!, try
73 installing Perl in a directory with a shorter pathname.
79 *) startperl=": # use perl"
84 echo "I'll use $startperl to start perl scripts."