# Compile SDL with build-scripts/fatbuild.sh

**URL:** <https://discourse.libsdl.org/t/compile-sdl-with-build-scripts-fatbuild-sh/15610>\
**Category:** SDL Development\
**Created:** [August 27, 2008, 9:29pm UTC](https://discourse.libsdl.org/t/compile-sdl-with-build-scripts-fatbuild-sh/15610 "2008-08-27T21:29:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolfgang\_Meyerle](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/9fc29f/32.png) [@Wolfgang\_Meyerle](https://discourse.libsdl.org/u/Wolfgang_Meyerle)\
**Post date:** [August 27, 2008, 9:29pm UTC](https://discourse.libsdl.org/t/compile-sdl-with-build-scripts-fatbuild-sh/15610/1 "2008-08-27T21:29:27Z")

</div>

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](https://cctkMESi.out)  
configure:42225: $? = 1

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

So, where’s the problem?

Perhaps I should note that I changed the [fatbuild.sh](http://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](http://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?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Greco](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/8edcca/32.png) [@Gabriele\_Greco](https://discourse.libsdl.org/u/Gabriele_Greco)\
**Post date:** [August 28, 2008, 7:58am UTC](https://discourse.libsdl.org/t/compile-sdl-with-build-scripts-fatbuild-sh/15610/2 "2008-08-28T07:58:11Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Meyerle](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/9fc29f/32.png) [@Wolfgang\_Meyerle](https://discourse.libsdl.org/u/Wolfgang_Meyerle)\
**Post date:** [August 31, 2008, 7:05pm UTC](https://discourse.libsdl.org/t/compile-sdl-with-build-scripts-fatbuild-sh/15610/3 "2008-08-31T19:05:24Z")

</div>

> 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)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
