From: Andy Dougherty Date: Sat, 8 Mar 1997 17:45:08 +0000 (-0500) Subject: perl -P path patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bba014945c609b5474f61f5e82ed2ff3e83a6e47;p=p5sagit%2Fp5-mst-13.2.git perl -P path patch On Fri, 7 Mar 1997, Robin Barker wrote: > This is a bug report for perl from rmb1@npl.co.uk, > generated with the help of perlbug 1.16 running under perl 5.00392. > > > ----------------------------------------------------------------- > [Please enter your report here] > > I can't get perl -P to work. > > In particular > % perl -P t/comp/cpp.aux > sh: /home/rmb1/local/perl/bin/cppstdin: not found > > the make process constructs cppstdin in the src directory > and would copy that to $installbin > but both t/comp/cpp.t and the perl binary look for a cppstdin > executable in $scriptdir. Thanks for the report. This is a bug. cppstdin belongs in $installbin, not $scriptdir. Why? Because cppstdin is architecture-dependent. It depends, in detail, on the particular compiler required for that architecture. True, we could rewrite it in portable perl to use all the appropriate Config.pm variables, but really, why bother? It's a tiny script that is rarely used, and I don't want to further encourage its use. Here's a patch. Hmm. It's a bit longer than I first imagined because I need to use BIN_EXP instead of BIN, and since perl currently doesn't use BIN_EXP, metaconfig hadn't stuck it in config.h. Alternatively, we could have put cppstdin in $installarch or something like that, but we'd better keep it in $bin just in case some-one's been relying on that. Ok. Here it is. (Mind you, I haven't yet *tested* this on a machine that needs cppstdin :-). p5p-msgid: Pine.SOL.3.95q.970308120242.23766D-100000@fractal.lafayette.edu private-msgid: Pine.SOL.3.95q.970308120242.23766D-100000@fractal.lafayette. --- diff --git a/config_H b/config_H index 39dd436..3cf388d 100644 --- a/config_H +++ b/config_H @@ -42,6 +42,12 @@ */ #define BIN "/opt/perl/bin" /**/ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. + */ +#define BIN_EXP "/opt/perl/bin" /**/ + /* CAT2: * This macro catenates 2 tokens together. */ diff --git a/config_h.SH b/config_h.SH index 893e71e..617684d 100755 --- a/config_h.SH +++ b/config_h.SH @@ -56,6 +56,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define BIN "$bin" /**/ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. + */ +#define BIN_EXP "$binexp" /**/ + /* CAT2: * This macro catenates 2 tokens together. */ diff --git a/perl.c b/perl.c index d799f2b..9ae13b8 100644 --- a/perl.c +++ b/perl.c @@ -1650,7 +1650,7 @@ SV *sv; char *cpp = CPPSTDIN; if (strEQ(cpp,"cppstdin")) - sprintf(tokenbuf, "%s/%s", SCRIPTDIR, cpp); + sprintf(tokenbuf, "%s/%s", BIN_EXP, cpp); else sprintf(tokenbuf, "%s", cpp); sv_catpv(sv,"-I"); diff --git a/t/comp/cpp.t b/t/comp/cpp.t index 880aed8..00a9e68 100755 --- a/t/comp/cpp.t +++ b/t/comp/cpp.t @@ -9,7 +9,7 @@ BEGIN { use Config; if ( ($Config{'cppstdin'} =~ /\bcppstdin\b/) and - ( ! -x $Config{'scriptdir'} . "/cppstdin") ) { + ( ! -x $Config{'binexp'} . "/cppstdin") ) { print "1..0\n"; exit; # Cannot test till after install, alas. }