summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@fractal.phys.lafayette.edu>1997-03-08 12:45:08 -0500
committerChip Salzenberg <chip@atlantic.net>1997-03-07 04:01:12 +1200
commitbba014945c609b5474f61f5e82ed2ff3e83a6e47 (patch)
tree683972af96346c4c7f9b5961e88b41406d462fab
parentb06b64f805517c26cbd7c4d2f74efd5f36b4692c (diff)
downloadperl-bba014945c609b5474f61f5e82ed2ff3e83a6e47.tar.gz
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.
-rw-r--r--config_H6
-rwxr-xr-xconfig_h.SH6
-rw-r--r--perl.c2
-rwxr-xr-xt/comp/cpp.t2
4 files changed, 14 insertions, 2 deletions
diff --git a/config_H b/config_H
index 39dd436b90..3cf388dbd5 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 893e71eb42..617684d14f 100755
--- a/config_h.SH
+++ b/config_h.SH
@@ -56,6 +56,12 @@ sed <<!GROK!THIS! >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 d799f2b61f..9ae13b88d8 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 880aed836e..00a9e6806a 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.
}