Compile SDL with build-scripts/fatbuild.sh

Hi,

I wanted to compile wxWidgets 2.8.8 on MacOsX with the option as an
universal binary. I also wanted to include the SDL library as an SDL.
So I thought I had also to compile the SDL as an universal binary with
the fatbuild script delivered with SDL SDL-1.2.13.
It seems to compile fine but when the SDL is checked within the
configure script of wxWidgets the check fails because of the following
error written to the config.log

—8<---- Schnipp -------8<------- config.log

configure:42222: gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
mmacosx-version-min=10.4 -o conftest -arch ppc -arch i386 -I/usr/
local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -fpascal-strings -I$
{top_srcdir}/src/mac/carbon/morefilex -I/Developer/Headers/
FlatCarbon -arch ppc -arch i386 conftest.c -lpthread -liconv -L/
usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa >&5
In file included from /usr/local/include/SDL/SDL_stdinc.h:61,
from /usr/local/include/SDL/SDL_main.h:26,
from /usr/local/include/SDL/SDL.h:28,
from conftest.c:139:
/Developer/Headers/FlatCarbon/strings.h:1:2: warning: #warning
Strings.h is not available on Mac OS X
In file included from /usr/local/include/SDL/SDL_stdinc.h:61,
from /usr/local/include/SDL/SDL_main.h:26,
from /usr/local/include/SDL/SDL.h:28,
from conftest.c:139:
/Developer/Headers/FlatCarbon/strings.h:1:2: warning: #warning
Strings.h is not available on Mac OS X
In file included from /usr/local/include/SDL/SDL_main.h:26,
from /usr/local/include/SDL/SDL.h:28,
from conftest.c:139:
/usr/local/include/SDL/SDL_stdinc.h:581: error: syntax error before
’cd’In file included from /usr/local/include/SDL/SDL_main.h:26,
from /usr/local/include/SDL/SDL.h:28,
from conftest.c:139:
/usr/local/include/SDL/SDL_stdinc.h:581: error: syntax error before
’cd’^@
lipo: can’t figure out the architecture type of: /var/folders/ak/ak
+saHFSGVeJd0YiPcB2uE+++TI/-Tmp-//cctkMESi.out
configure:42225: $? = 1

—8<---- Schnipp -------8<-------

So, where’s the problem?

Perhaps I should note that I changed the fatbuild.sh script by the
follwing lines because it was missing the /developer/SDKs/MacOSX10.3.x
folder, so I changed it to the following lines:

—8<---- Schnipp -------8<------- fatbuild.sh
else # 10.2 or 10.3 SDK

 # PowerPC configure flags (10.3 runtime compatibility)
 # We dynamically load X11, so using the system X11 headers is fine.
 CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple- 

darwin
–x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"

 # PowerPC compiler flags
 CC_PPC="gcc -arch ppc"
 CXX_PPC="g++ -arch ppc"
 CFLAGS_PPC=""
 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \

-nostdinc
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks
-I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/
include
-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"

 # PowerPC linker flags
 LFLAGS_PPC="-arch ppc -mmacosx-version-min=10.3 \

-L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks
-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"

fi # 10.2 or 10.3 SDK
—8<---- Schnipp -------8<-------

Any ideas?

Perhaps I should note that I changed the fatbuild.sh script by the follwing
lines because it was missing the /developer/SDKs/MacOSX10.3.x folder, so I
changed it to the following lines:

You can install the SDK in the XCode options, I suggest you to do that
because fatbuild uses for the PPC part the old header struct of older SDKs
and gcc3 and may be not suited if you want to do a 10.4u compile.

In that case it’s better to build autoconf based projects something like
this:

export CC=“gcc -arch i386 -arch ppc -isysroot
/Developer/SDKs/MacOSX10.4u.sdk”

./configure

You only have to take care that the configure script don’t use something to
set in config.h if the machine is big endian or little endian, and in that
case you have to replace the setting with a dynamic one like the
BIG_ENDIAN gcc define.–
Bye,
Gabry

You only have to take care that the configure script don’t use
something to set in config.h if the machine is big endian or little
endian, and in that case you have to replace the setting with a
dynamic one like the BIG_ENDIAN gcc define.

I don’t know exactly what you mean with this sentence. Can you explain
it to me. It is important that I can compile wxWidgets and sdl support
with the configure scipt. Isn’t there an approach in the sdl community
to keep the fatbuild.sh script up-to-date? Really strange because the
thing is documented in the readme. I also don’t know why the configure
check against the sdl gets wrong perhaps you have an idea for this…

Greetings

Wolfgang MeyerleAm 28.08.2008 um 09:58 schrieb Gabriele Greco:

Perhaps I should note that I changed the fatbuild.sh script by the
follwing lines because it was missing the /developer/SDKs/
MacOSX10.3.x folder, so I changed it to the following lines:

You can install the SDK in the XCode options, I suggest you to do
that because fatbuild uses for the PPC part the old header struct of
older SDKs and gcc3 and may be not suited if you want to do a 10.4u
compile.

In that case it’s better to build autoconf based projects something
like this:

export CC=“gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/
MacOSX10.4u.sdk”

./configure

You only have to take care that the configure script don’t use
something to set in config.h if the machine is big endian or little
endian, and in that case you have to replace the setting with a
dynamic one like the BIG_ENDIAN gcc define.


Bye,
Gabry


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org