[irrtoolset]Getting irrtoolset 4.8.2 built on NetBSD-2.0_BETA
Havard Eidnes he at uninett.no
Fri Sep 3 11:58:50 CEST 2004
Hi, "me again". This time around I've had to apply a few patches to get IRRToolSet 4.8.2 built on NetBSD 2.0_BETA, which uses gcc 3.3.3. The patches to get it to build are attached below. Some comments (some of which has been made before -- can someone please incorporate them for the next version?): - IRRToolSet, being a user program with any aspirations of portability, has no business using implementation-specific headers or names from the implementation name space. I'm referring to usage of "#include <_G_config.h>" and usage of the types _G_uint32_t and _G_int32_t. It appears that the only two thing the code uses from _G_config.h are those 32-bit types and the _G_ARGS macro. The former can just as well be replaced with uint32_t / int32_t from <inttypes.h>, the latter can be omitted, as it only seems sensible to require that the C++ compiler supports ANSI function argument declarations. - I've once again fixed various makefile templates not to hide the actual compiler invocation, suppressing any flags, defines and include directories. This makes it easier to follow and reproduce the compiler invocations for debugging/porting. In particular, I found this little pearl, which I fixed/simplified: .c.o: - @echo Compiling: `basename $<` - @echo $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @echo $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< - The README file seems to be a bit inconsistent with respect to the requirements on the host platform. Point 0 under installations mentions GCC 3.3.2 and GNU Make, whereas further down it is said that the development platform is using gcc-2.95.3 and libstdc++-2.9.0. Under "Known problems" it is said that on Dec Alpha's, one needs to use GNU make. However, it is evident from trying to use NetBSD's make that it is a universal requirement that the package absolutely needs GNU make to build. I've not supplied any patch against this file. With these changes in place it builds and install the subset of the programs which the irrtoolset 4.8.2 package is set up to build and install, and peval seems to work well enough for our intended purpose. Regards, - Håvard -------------- next part -------------- diff -ru IRRToolSet-4.8.2/src/Core/gnu/ACG.cc IRRToolSet-4.8.2-new/src/Core/gnu/ACG.cc --- IRRToolSet-4.8.2/src/Core/gnu/ACG.cc 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/ACG.cc 2004-09-02 14:24:51.000000000 +0200 @@ -123,7 +123,7 @@ // #define RANDOM_PERM_SIZE 64 -_G_uint32_t randomPermutations[RANDOM_PERM_SIZE] = { +uint32_t randomPermutations[RANDOM_PERM_SIZE] = { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, // 3210 0x0000ffff, 0x00ff0000, 0x00000000, 0xff000000, // 2310 0xff0000ff, 0x0000ff00, 0x00000000, 0x00ff0000, // 3120 @@ -149,7 +149,7 @@ // SEED_TABLE_SIZE must be a power of 2 // #define SEED_TABLE_SIZE 32 -static _G_uint32_t seedTable[SEED_TABLE_SIZE] = { +static uint32_t seedTable[SEED_TABLE_SIZE] = { 0xbdcc47e5, 0x54aea45d, 0xec0df859, 0xda84637b, 0xc8c6cb4f, 0x35574b01, 0x28260b7d, 0x0d07fdbf, 0x9faaeeb0, 0x613dd169, 0x5ce2d818, 0x85b9e706, @@ -171,15 +171,15 @@ // LC_C = result of a long trial & error series = 3907864577 // -static const _G_uint32_t LC_A = 66049; -static const _G_uint32_t LC_C = 3907864577u; -static inline _G_uint32_t LCG(_G_uint32_t x) +static const uint32_t LC_A = 66049; +static const uint32_t LC_C = 3907864577u; +static inline uint32_t LCG(uint32_t x) { return( x * LC_A + LC_C ); } -ACG::ACG(_G_uint32_t seed, int size) +ACG::ACG(uint32_t seed, int size) { register int l; initialSeed = seed; @@ -205,7 +205,7 @@ // Allocate the state table & the auxillary table in a single malloc // - state = new _G_uint32_t[stateSize + auxSize]; + state = new uint32_t[stateSize + auxSize]; auxState = &state[stateSize]; reset(); @@ -217,7 +217,7 @@ void ACG::reset() { - register _G_uint32_t u; + register uint32_t u; if (initialSeed < SEED_TABLE_SIZE) { u = seedTable[ initialSeed ]; @@ -247,7 +247,7 @@ lcgRecurr = u; - assert(sizeof(double) == 2 * sizeof(_G_int32_t)); + assert(sizeof(double) == 2 * sizeof(int32_t)); } ACG::~ACG() @@ -261,16 +261,16 @@ // Returns 32 bits of random information. // -_G_uint32_t +uint32_t ACG::asLong() { - _G_uint32_t result = state[k] + state[j]; + uint32_t result = state[k] + state[j]; state[k] = result; j = (j <= 0) ? (stateSize-1) : (j-1); k = (k <= 0) ? (stateSize-1) : (k-1); short int auxIndex = (result >> 24) & (auxSize - 1); - register _G_uint32_t auxACG = auxState[auxIndex]; + register uint32_t auxACG = auxState[auxIndex]; auxState[auxIndex] = lcgRecurr = LCG(lcgRecurr); // @@ -278,7 +278,7 @@ // do not want to run off the end of the permutation table. // This insures that we have always got four entries left. // - register _G_uint32_t *perm = & randomPermutations[result & 0x3c]; + register uint32_t *perm = & randomPermutations[result & 0x3c]; result = *(perm++) & auxACG; result |= *(perm++) & ((auxACG << 24) diff -ru IRRToolSet-4.8.2/src/Core/gnu/ACG.h IRRToolSet-4.8.2-new/src/Core/gnu/ACG.h --- IRRToolSet-4.8.2/src/Core/gnu/ACG.h 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/ACG.h 2004-09-02 14:24:51.000000000 +0200 @@ -42,26 +42,26 @@ class ACG : public RNG { - _G_uint32_t initialSeed; // used to reset generator + uint32_t initialSeed; // used to reset generator int initialTableEntry; - _G_uint32_t *state; - _G_uint32_t *auxState; + uint32_t *state; + uint32_t *auxState; short stateSize; short auxSize; - _G_uint32_t lcgRecurr; + uint32_t lcgRecurr; short j; short k; protected: public: - ACG(_G_uint32_t seed = 0, int size = 55); + ACG(uint32_t seed = 0, int size = 55); virtual ~ACG(); // // Return a long-words word of random bits // - virtual _G_uint32_t asLong(); + virtual uint32_t asLong(); virtual void reset(); }; diff -ru IRRToolSet-4.8.2/src/Core/gnu/MLCG.cc IRRToolSet-4.8.2-new/src/Core/gnu/MLCG.cc --- IRRToolSet-4.8.2/src/Core/gnu/MLCG.cc 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/MLCG.cc 2004-09-02 14:24:51.000000000 +0200 @@ -25,7 +25,7 @@ #define SEED_TABLE_SIZE 32 -static _G_int32_t seedTable[SEED_TABLE_SIZE] = { +static int32_t seedTable[SEED_TABLE_SIZE] = { 0xbdcc47e5, 0x54aea45d, 0xec0df859, 0xda84637b, 0xc8c6cb4f, 0x35574b01, 0x28260b7d, 0x0d07fdbf, 0x9faaeeb0, 0x613dd169, 0x5ce2d818, 0x85b9e706, @@ -36,7 +36,7 @@ 0xb89cff2b, 0x12164de1, 0xa865168d, 0x32b56cdf }; -MLCG::MLCG(_G_int32_t seed1, _G_int32_t seed2) +MLCG::MLCG(int32_t seed1, int32_t seed2) { initialSeedOne = seed1; initialSeedTwo = seed2; @@ -46,8 +46,8 @@ void MLCG::reset() { - _G_int32_t seed1 = initialSeedOne; - _G_int32_t seed2 = initialSeedTwo; + int32_t seed1 = initialSeedOne; + int32_t seed2 = initialSeedTwo; // // Most people pick stupid seed numbers that do not have enough @@ -79,9 +79,9 @@ seedTwo = (seedTwo % 2147483397) + 1; } -_G_uint32_t MLCG::asLong() +uint32_t MLCG::asLong() { - _G_int32_t k = seedOne % 53668; + int32_t k = seedOne % 53668; seedOne = 40014 * (seedOne-k * 53668) - k * 12211; if (seedOne < 0) { @@ -94,7 +94,7 @@ seedTwo += 2147483399; } - _G_int32_t z = seedOne - seedTwo; + int32_t z = seedOne - seedTwo; if (z < 1) { z += 2147483562; } diff -ru IRRToolSet-4.8.2/src/Core/gnu/MLCG.h IRRToolSet-4.8.2-new/src/Core/gnu/MLCG.h --- IRRToolSet-4.8.2/src/Core/gnu/MLCG.h 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/MLCG.h 2004-09-02 14:24:51.000000000 +0200 @@ -29,55 +29,55 @@ // class MLCG : public RNG { - _G_int32_t initialSeedOne; - _G_int32_t initialSeedTwo; - _G_int32_t seedOne; - _G_int32_t seedTwo; + int32_t initialSeedOne; + int32_t initialSeedTwo; + int32_t seedOne; + int32_t seedTwo; protected: public: - MLCG(_G_int32_t seed1 = 0, _G_int32_t seed2 = 1); + MLCG(int32_t seed1 = 0, int32_t seed2 = 1); // // Return a long-words word of random bits // - virtual _G_uint32_t asLong(); + virtual uint32_t asLong(); virtual void reset(); - _G_int32_t seed1(); - void seed1(_G_int32_t); - _G_int32_t seed2(); - void seed2(_G_int32_t); - void reseed(_G_int32_t, _G_int32_t); + int32_t seed1(); + void seed1(int32_t); + int32_t seed2(); + void seed2(int32_t); + void reseed(int32_t, int32_t); }; -inline _G_int32_t +inline int32_t MLCG::seed1() { return(seedOne); } inline void -MLCG::seed1(_G_int32_t s) +MLCG::seed1(int32_t s) { initialSeedOne = s; reset(); } -inline _G_int32_t +inline int32_t MLCG::seed2() { return(seedTwo); } inline void -MLCG::seed2(_G_int32_t s) +MLCG::seed2(int32_t s) { initialSeedTwo = s; reset(); } inline void -MLCG::reseed(_G_int32_t s1, _G_int32_t s2) +MLCG::reseed(int32_t s1, int32_t s2) { initialSeedOne = s1; initialSeedTwo = s2; diff -ru IRRToolSet-4.8.2/src/Core/gnu/Makefile.in IRRToolSet-4.8.2-new/src/Core/gnu/Makefile.in --- IRRToolSet-4.8.2/src/Core/gnu/Makefile.in 2002-03-27 14:56:37.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/Makefile.in 2004-09-02 14:37:17.000000000 +0200 @@ -60,12 +60,10 @@ .y.o: .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< .SUFFIXES: .cc diff -ru IRRToolSet-4.8.2/src/Core/gnu/RNG.cc IRRToolSet-4.8.2-new/src/Core/gnu/RNG.cc --- IRRToolSet-4.8.2/src/Core/gnu/RNG.cc 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/RNG.cc 2004-09-02 14:24:51.000000000 +0200 @@ -40,7 +40,7 @@ if (!initialized) { - assert (sizeof(double) == 2 * sizeof(_G_uint32_t)); + assert (sizeof(double) == 2 * sizeof(uint32_t)); // // The following is a hack that I attribute to diff -ru IRRToolSet-4.8.2/src/Core/gnu/RNG.h IRRToolSet-4.8.2-new/src/Core/gnu/RNG.h --- IRRToolSet-4.8.2/src/Core/gnu/RNG.h 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/RNG.h 2004-09-02 14:24:51.000000000 +0200 @@ -23,16 +23,16 @@ #include <assert.h> #include <math.h> -#include <_G_config.h> +#include <inttypes.h> union PrivateRNGSingleType { // used to access floats as unsigneds float s; - _G_uint32_t u; + uint32_t u; }; union PrivateRNGDoubleType { // used to access doubles as unsigneds double d; - _G_uint32_t u[2]; + uint32_t u[2]; }; // @@ -46,7 +46,7 @@ // // Return a long-words word of random bits // - virtual _G_uint32_t asLong() = 0; + virtual uint32_t asLong() = 0; virtual void reset() = 0; // // Return random bits converted to either a float or a double diff -ru IRRToolSet-4.8.2/src/Core/gnu/std.h IRRToolSet-4.8.2-new/src/Core/gnu/std.h --- IRRToolSet-4.8.2/src/Core/gnu/std.h 2002-03-27 12:32:59.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/gnu/std.h 2004-09-02 14:35:27.000000000 +0200 @@ -19,7 +19,7 @@ #ifndef _std_h #define _std_h 1 -#include <_G_config.h> +#include <inttypes.h> #include <cstddef> #include <cstdlib> #include <cstring> @@ -31,7 +31,7 @@ extern "C" { #ifndef HAVE_STRINGS_H -int strcasecmp _G_ARGS((const char*, const char*)); +int strcasecmp (const char*, const char*); #endif // HAVE_STRINGS_H } diff -ru IRRToolSet-4.8.2/src/Core/network/Makefile.in IRRToolSet-4.8.2-new/src/Core/network/Makefile.in --- IRRToolSet-4.8.2/src/Core/network/Makefile.in 2002-03-27 14:56:37.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/network/Makefile.in 2004-09-02 14:24:51.000000000 +0200 @@ -48,12 +48,10 @@ .y.o: .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< .SUFFIXES: .cc diff -ru IRRToolSet-4.8.2/src/Core/sched/Makefile.in IRRToolSet-4.8.2-new/src/Core/sched/Makefile.in --- IRRToolSet-4.8.2/src/Core/sched/Makefile.in 2002-03-27 14:56:37.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/sched/Makefile.in 2004-09-02 14:37:36.000000000 +0200 @@ -45,12 +45,10 @@ .y.o: .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< .SUFFIXES: .cc diff -ru IRRToolSet-4.8.2/src/Core/sys/Makefile.in IRRToolSet-4.8.2-new/src/Core/sys/Makefile.in --- IRRToolSet-4.8.2/src/Core/sys/Makefile.in 2002-03-27 14:56:37.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/Core/sys/Makefile.in 2004-09-02 14:37:46.000000000 +0200 @@ -65,12 +65,10 @@ .y.o: .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< .SUFFIXES: .cc diff -ru IRRToolSet-4.8.2/src/Core/util/Makefile.in IRRToolSet-4.8.2-new/src/Core/util/Makefile.in --- IRRToolSet-4.8.2/src/Core/util/Makefile.in 2004-07-30 12:58:10.000000000 +0200 +++ IRRToolSet-4.8.2-new/src/Core/util/Makefile.in 2004-09-02 14:38:00.000000000 +0200 @@ -49,14 +49,10 @@ .y.o: .c.o: - @echo Compiling: `basename $<` - @echo $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @echo $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< .SUFFIXES: .cc diff -ru IRRToolSet-4.8.2/src/aoe/Makefile.in IRRToolSet-4.8.2-new/src/aoe/Makefile.in --- IRRToolSet-4.8.2/src/aoe/Makefile.in 2002-04-09 13:48:46.000000000 +0200 +++ IRRToolSet-4.8.2-new/src/aoe/Makefile.in 2004-09-02 14:24:51.000000000 +0200 @@ -128,12 +128,10 @@ mv lex.`basename $< .l`.c `basename $<`.cc .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< # Transformations applied to each line of the file: # eliminate blank lines diff -ru IRRToolSet-4.8.2/src/gnug++/std.h IRRToolSet-4.8.2-new/src/gnug++/std.h --- IRRToolSet-4.8.2/src/gnug++/std.h 2002-03-27 12:32:57.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/gnug++/std.h 2004-09-02 14:39:28.000000000 +0200 @@ -19,7 +19,7 @@ #ifndef _std_h #define _std_h 1 -#include <_G_config.h> +#include <inttypes.h> #include <cstddef> #include <cstdlib> #include <cstring> @@ -29,7 +29,7 @@ #include <fcntl.h> extern "C" { -int strcasecmp _G_ARGS((const char*, const char*)); +int strcasecmp (const char*, const char*); } #endif diff -ru IRRToolSet-4.8.2/src/roe/Makefile.in IRRToolSet-4.8.2-new/src/roe/Makefile.in --- IRRToolSet-4.8.2/src/roe/Makefile.in 2002-03-27 14:56:39.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/roe/Makefile.in 2004-09-02 14:24:52.000000000 +0200 @@ -72,12 +72,10 @@ mv lex.`basename $< .l`.c $<.cc .c.o: - @echo Compiling: `basename $<` - @$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFINES) $(INCDIRS) $< .cc.o: - @echo Compiling: `basename $<` - @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< + $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCDIRS) $< # Transformations applied to each line of the file: # eliminate blank lines diff -ru IRRToolSet-4.8.2/src/rpsl/gnu/std.h IRRToolSet-4.8.2-new/src/rpsl/gnu/std.h --- IRRToolSet-4.8.2/src/rpsl/gnu/std.h 2002-03-27 12:33:00.000000000 +0100 +++ IRRToolSet-4.8.2-new/src/rpsl/gnu/std.h 2004-09-02 14:33:07.000000000 +0200 @@ -19,7 +19,7 @@ #ifndef _std_h #define _std_h 1 -#include <_G_config.h> +#include <inttypes.h> #include <cstddef> #include <cstdlib> #include <cstring> @@ -29,7 +29,7 @@ #include <fcntl.h> extern "C" { -int strcasecmp _G_ARGS((const char*, const char*)); +int strcasecmp (const char*, const char*); } #endif