_MIPS_SZLONG undefined on SGI after doing h2ph
Quote:
> I built perl on an SGI rinning IRIX 5.2. Now I'm trying to run swatch
> (a perl appl to monitor log files in real time).
> Whenever I try to invoke it, I get the following error:
> Undefined subroutine "main'_MIPS_SZLONG" called
> at /usr/local/lib/perl/sys/types.ph line 6.
[...]
Quote:
> In sgidefs.h, it appears that _MIPS_SZLONG is defined by the compiler
> rather then a header file, which mean it remains an undefined
> subroutine (every reference inb a *.ph file is to &_MIPS_SZLONG).
Correct, it is a compiler definition. The way we handle it is to
patch h2ph which them fixes the .ph files. Look at /usr/sbin/h2ph
from the perl that comes with Irix (in the eoe2.sw.gifts_perl
subsystem which is perl-4.036) for the patch. It's a very
straight-forward merge.
Here's a patch for perl5.000:h2ph
*** h2ph.orig Tue Sep 27 11:49:31 1994
--- h2ph Tue Sep 27 16:01:22 1994
***************
*** 53,58 ****
--- 53,76 ----
}
}
if (s/^#\s*//) {
+ # check for sgidefs.h, where we need to insert the compiler
+ # defined macros:
+ if ($file eq 'sgidefs.h' && /__cplusplus/) {
+ print OUT <<END
+ # Grrr. Compiler defines in include files...
+ eval 'sub _MIPS_FPSET {16;}';
+ eval 'sub _MIPS_SZINT {32;}';
+ eval 'sub _MIPS_SZLONG {32;}';
+ eval 'sub _MIPS_SZPTR {32;}';
+ eval 'sub _MIPS_ISA {_MIPS_ISA_MIPS1;}';
+ eval 'sub _MIPS_SIM {_MIPS_SIM_ABI32;}';
+ #
+ END
+ }
+ if ($file =~ /select.h/ && /^ifndef NBBY/) {
+ print OUT "require 'sgidefs.ph';\n";
+ }
+
if (s/^define\s+(\w+)//) {
$name = $1;
$new = '';
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Networking Services, / GIGO *really* means: Garbage in, Gospel Out
Silicon Graphics, Inc /
<a href="http://reality.sgi.com/employees/scotth/">non-virtual home page</a>