Subject: | All tests fail on recent debian/g++ versions. "iostream.h" not found problem. |
Two patches are provided.
a) All tests fail on recent debian/g++ versions. The persistant default
value for STD_IOSTREAM is asked when Makefile.PL is invoked now (and is
set to true per default).
b) Additionally, the path for the output CPP.pm is changed; it does not
overwrite the template itself. Thats desired, as people might call for
testing Makefile.PL more than once.
Tested on ubuntu 8.10 32bit.
[FORENSIC]
The STD_IOSTREAM config value is "undef" per default, which leads to
#include "iostream.h"
as a prefix to all code. On recent (ubuntu 8.10/) g++ installs, and
likely many new compilers, this is obsolete and
#include <iostream>
is required instead. Setting STD_IOSTREAM to a true value helps, and all
tests pass nicely.
Subject: | CPP.pm.patch |
--- CPP.pm 2003-08-13 02:17:59.000000000 +0200
+++ /home/murat/Inline-CPP-0.25-C4TSSt/CPP.pm 2009-01-20 10:19:10.000000000 +0100
@@ -31,6 +31,8 @@
my $o = shift;
$o->{ILSM}{MAKEFILE}{CC} ||= '@COMPILER'; # default compiler
$o->{ILSM}{MAKEFILE}{LIBS} ||= ['@DEFAULTLIBS']; # default libs
+ $o->{ILSM}{STD_IOSTREAM} ||= '@STD_IOSTREAM'; # default iostream
+
# I haven't traced it out yet, but $o->{STRUCT} gets set before getting
# properly set from Inline::C's validate().
@@ -90,7 +92,9 @@
# Replace %iostream% with the correct iostream library
my $iostream = "iostream";
+
$iostream .= ".h" unless $o->{ILSM}{STD_IOSTREAM};
+
$o->{ILSM}{AUTO_INCLUDE} =~ s|%iostream%|$iostream|g;
# Forward all unknown requests up to Inline::C
Subject: | Makefile.PL.patch |
--- Makefile.PL 2003-08-13 01:48:04.000000000 +0200
+++ /home/murat/Inline-CPP-0.25-C4TSSt/Makefile.PL 2009-01-20 10:19:10.000000000 +0100
@@ -59,6 +59,9 @@
my $libs = prompt("What default libraries would you like to include?",
$libs_guess);
+my $std_iostream = prompt("Which default you want to use for STD_IOSTREAM ?",
+ 'true' );
+
# Apply the defaults:
open CPP, "CPP.pm";
my @lines = <CPP>;
@@ -67,10 +70,11 @@
for (@lines) {
s|\@COMPILER|$cpp_compiler| if m|\# default compiler|;
s|\@DEFAULTLIBS|$libs| if m|\# default libs|;
+ s|\@STD_IOSTREAM|$std_iostream| if m|\# default iostream|;
}
-open CPP, ">CPP.pm"
- or die "Can't write to CPP.pm!";
+open CPP, ">lib/Inline/CPP.pm"
+ or die "Can't write to lib/Inline/CPP.pm!";
print CPP @lines;
close CPP;