[GRASS5] Re: [NVIZ] Code for PPM dumps

Markus Neteler neteler at geog.uni-hannover.de
Wed Sep 27 11:16:44 EDT 2000


On Tue, Sep 26, 2000 at 12:56:48PM +0200, Andreas Lange wrote:
> Markus,
> 
> the big endian/little endian part of the code will give problems, as not
> only sun machines are big-endian. There are more general solutions, have
> a look at tifflib. There must be other code within grass where this
> problem is solved, but i have currently no time to search. I don't know
> exactly if a config-solution or a solution within the code is better,
> 
> cu,

Hi Andreas,
you are right. Here is the extracted test from libtiff:

CheckForBigEndian()
{
    echo 'main() { int one = 1; char* cp = (char*)&one; exit(*cp!=0); }'>t.c
    capture cat t.c
    runMake t "t:; ${CCOMPILER} ${ENVOPTS} t.c" && ./a.out
}

if CheckForBigEndian; then
        echo "#define HOST_BIGENDIAN    1"
        Note "... using big-endian byte order for your $CPU cpu"
    else
        echo "#define HOST_BIGENDIAN    0"
        Note "... using little-endian byte order for your $CPU cpu"
fi

It should be written to config.h.

Does anyone know how to implement this test into current "configure"?

Thanks
 
 Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list