Subject: perl's configure vs IRIX / MIPSPro compiler
To: None <tech-pkg@netbsd.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: tech-pkg
Date: 03/26/2004 17:11:07
--VrqPEDrXMn8OVzN4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

During perl5's configure stage, the Configure script checks, by using
the preprocessor, if you can stringify and catify.  The problem under
IRIX is that the MIPSPro compiler behaves differently if it gets input
from stdin vs when it operates on a file.  The test is done on stdin,
but lateron, operations are done on a file.

So I came up with the silly hack below:

--- Configure.orig      Fri Mar 26 10:34:43 2004
+++ Configure   Fri Mar 26 10:43:17 2004
@@ -12495,7 +12495,14 @@
 ACAT(Cir,cus)
 EOCP
 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
-if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
+# yuck, what a hack.
+# MIPSPro compiler/preprocessor behaves differently if invoked on
+# stdin vs file.  Here we test for stdin, but lateron we use files.
+# So force it to work the way we know it does:
+if [ x"${OPSYS}" =3D x"IRIX" ]; then
+       echo "IRIX / MIPSPro hack - yay!"
+       cpp_stuff=3D42=20
+elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
        echo "Oh!  Smells like ANSI's been here." >&4
        echo "We can catify or stringify, separately or together!"
        cpp_stuff=3D42=20


This should work fine, since either we're using MIPSPro, or we're using
gcc, which should be fine as well.  I'd rather test for the compiler in
cleaner way, but that really is a headache.

Does anybody have any other ideas for this?

-Jan

--=20
I always said there was something fundamentally wrong with the universe.

--VrqPEDrXMn8OVzN4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAZKp7fFtkr68iakwRArc3AJ9oXXh2hoMV2mPP0TcZw8r6c5SBLwCg8ChI
Szb/tNr1RaZp5NgJOqaU4Lk=
=HiEd
-----END PGP SIGNATURE-----

--VrqPEDrXMn8OVzN4--