SDL library header issue

Michael_google gmail_Gersten keybounce at gmail.com
Fri May 21 14:55:19 PDT 2010


I'm trying to compile a PPC port of Ufo AI for the 2.3 release.

A long time ago (about 8 months), I had compiled and posted several
versions. (If interested: 23530, 23783, 24430, 24953, and 26262).

In trying to test the current version, it failed, with a horrible
byteswap error. So, the question is, where did this byteswap issue
arise?

Going back to the last good build (26262) resulted in compile errors.
Checking showed that libjpeg had a header that now defined a function
with an incompatible (but functionally equivalent) definition. This
was simple enough -- activate the older libjpeg. (Now I understand why
the older versions are kept around.)

But things still hit byte swap issues. On something that had worked
before. The problem was in LittleLong().

So what's happening in LittleLong()? It's in
/opt/local/include/SDL/SDL_endian.h, and there's a set of ifdef's,
optimized assembler inlines, etc.

But it starts with
#ifndef SDL_BYTEORDER   /* Not defined in SDL_config.h? */

So what does SDL_config.h do for SDL_BYTEORDER?


stbmac:trunk Michael$ port provides /opt/local/include/SDL/SDL_config.h
/opt/local/include/SDL/SDL_config.h is provided by: libsdl
stbmac:trunk Michael$ port installed libsdl
The following ports are currently installed:
  libsdl @1.2.13_6+universal
  libsdl @1.2.14_8+universal (active)
stbmac:trunk Michael$

I've got the right version installed and active? Right?

stbmac:trunk Michael$ egrep BYTE  /opt/local/include/SDL/SDL_config.h
#define SDL_BYTEORDER 1234

That can't be right. Can it?

Well, that's what it has. A single fixed value. No ifdefs, no nothing.

Looking at SDL_config.h, it doesn't seem that cross compilation /
+universal would work at all. It seems to be very system dependent.

So, try going back to the previous version.

stbmac:trunk Michael$ port installed libsdl
The following ports are currently installed:
  libsdl @1.2.13_6+universal
  libsdl @1.2.14_8+universal (active)
stbmac:trunk Michael$ sudo port deactivate libsdl
--->  Deactivating libsdl
stbmac:trunk Michael$ sudo port install libsdl @1.2.13_6+universal
--->  Computing dependencies for libsdl
--->  Activating libsdl @1.2.14_8+universal
--->  Cleaning libsdl

So why did it NOT activate the version I said to activate?

Manually commenting out that hard-coded BYTEORDER line, so that the
system determines it at compile time? That seems to be a workaround.
-- 
Political and economic blog of a strict constitutionalist
http://StrictConstitution.BlogSpot.com


More information about the macports-users mailing list