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.
*/
#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.
*/
*/
#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.
*/
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");
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.
}