How to build 32-bit library for Mac?

I built SDL library on Mac using:

Code:
./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I need 32-bit libraries. What can be tweaked to make 32-bit libraries?

On osx everything will be built in the default architecture of the OS. If you need another arch, you will need to define it in the flags and also the target OSX.
I’ll write something tomorrow when I’m at my machine.

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"On 11/10/2011 02:17 PM, Cooler wrote:

I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Nikos Chantziaras wrote:> On 11/10/2011 02:17 PM, Cooler wrote:

I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.
Also if what you build is supposed to run on other machines, especially 10.5 ones, you will need to use and point at the 10.5 SDK and set the target.
Add “-isysroot /Developer-old/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/Developer-old/SDKs/MacOSX10.5.sdk/usr/X11R6/include/” to the CFLAGS, CXXFLAGS and LDFLAGS (along with what Nikos wrote).
Also, before running configure,
export MACOSX_DEPLOYMENT_TARGET=10.5

Nikos Chantziaras wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.On 12/30/2011 12:17 AM, Dominus wrote:

On 11/10/2011 02:17 PM, Cooler wrote:

Nikos Chantziaras wrote:> On 12/30/2011 12:17 AM, Dominus wrote:

Nikos Chantziaras wrote:
On 11/10/2011 02:17 PM, Cooler wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.


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

With 1.3 or 1.2?
I got 1.2 branch to compile statically fine and I thought that the buildbot for 1.3 makes fine compiles for 1.3 as well.
When the message comes for mixing 32 and 64 bit it’s a sign there is some flag wrong. I’ll post my complete set of exports I do for building 32bit on OS X Lion. I do know that I not only use configure but autogen as well.

Nikos Chantziaras wrote:

Nikos Chantziaras wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.


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

With 1.3 or 1.2?
I got 1.2 branch to compile statically fine and I thought that the buildbot
for 1.3 makes fine compiles for 1.3 as well.
When the message comes for mixing 32 and 64 bit it’s a sign there is some
flag wrong. I’ll post my complete set of exports I do for building 32bit on
OS X Lion. I do know that I not only use configure but autogen as well.

Just in case you don’t already know this, the Xcode project is already
configured to build Universal Binaries for all architectures. And the
pre-built 1.2 framework we distribute should already have everything
you need.
This page is a bit dated, but much of the info is still relevant:
http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html

-EricOn 12/29/11, Dominus wrote:

On 12/30/2011 12:17 AM, Dominus wrote:

On 11/10/2011 02:17 PM, Cooler wrote:

Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Eric Wing wrote:> On 12/29/11, Dominus <@Dominus> wrote:

Nikos Chantziaras wrote:

On 12/30/2011 12:17 AM, Dominus wrote:

Nikos Chantziaras wrote:
On 11/10/2011 02:17 PM, Cooler wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.


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

With 1.3 or 1.2?
I got 1.2 branch to compile statically fine and I thought that the buildbot
for 1.3 makes fine compiles for 1.3 as well.
When the message comes for mixing 32 and 64 bit it’s a sign there is some
flag wrong. I’ll post my complete set of exports I do for building 32bit on
OS X Lion. I do know that I not only use configure but autogen as well.

Just in case you don’t already know this, the Xcode project is already
configured to build Universal Binaries for all architectures. And the
pre-built 1.2 framework we distribute should already have everything
you need.
This page is a bit dated, but much of the info is still relevant:
http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html

If you mean the 1.2.14 pre-built framework I will have to disagree, it doesn’t have everything one needs since Lion got released.
And if you are going after non-xcode projects then a manually built SDL is much easier to use than a framework, since frameworks don’t tend to be picked up by autotools, libtool.

Nikos Chantziaras wrote:> On 12/30/2011 12:17 AM, Dominus wrote:

Nikos Chantziaras wrote:
On 11/10/2011 02:17 PM, Cooler wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.

I just tested with latest SDL 1.3 and 1.2 branch. -arch i386 builds static fine for me.
I used following commands to build:

Code:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/gcc-4.2 -arch i386"
export CXX="/usr/bin/g+±4.2 -arch i386"
export GCOV="/usr/bin/gcov-4.2 -arch i386"
export CPPFLAGS="-arch i386"
export CFLAGS="-arch i386"
export CXXFLAGS="-arch i386"
export LDFLAGS="-arch i386"
./autogen.sh
./configure
make

(I set PATH anew to make sure nothing like MacPorts or any other prefix I have on my machine interferes)

I am building static snapshots for two projects I’m part of and those link fine against this static SDL.

Dominus wrote:

Eric Wing wrote:

Nikos Chantziaras wrote:

Nikos Chantziaras wrote:
Quote:
I built SDL library on Mac using:

Code:

./configure
make
sudo make install

as described in readme file. But the result is 64-bit libraries while I
need 32-bit libraries. What can be tweaked to make 32-bit libraries?

Try:

./configure --disable-static CFLAGS="-arch i386 -O2 -pipe"
CXXFLAGS="-arch i386 -O2 -pipe" LDFLAGS="-arch i386"

If you plan to use more stuff with SDL don’t disable static.

static builds don’t work with “-arch i386”. I reported that a couple of
times months ago, but no one knows why it doesn’t work. You get
messages about mixing i386 with x86_64.


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

With 1.3 or 1.2?
I got 1.2 branch to compile statically fine and I thought that the buildbot
for 1.3 makes fine compiles for 1.3 as well.
When the message comes for mixing 32 and 64 bit it’s a sign there is some
flag wrong. I’ll post my complete set of exports I do for building 32bit on
OS X Lion. I do know that I not only use configure but autogen as well.

Just in case you don’t already know this, the Xcode project is already
configured to build Universal Binaries for all architectures. And the
pre-built 1.2 framework we distribute should already have everything
you need.
This page is a bit dated, but much of the info is still relevant:
http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html

If you mean the 1.2.14 pre-built framework I will have to disagree, it doesn’t have everything one needs since Lion got released.
And if you are going after non-xcode projects then a manually built SDL is much easier to use than a framework, since frameworks don’t tend to be picked up by autotools, libtool.

But I see Sam has had a busy day and it seems a SDL 1.2.15 release is on its long awaited way :)> > On 12/29/11, Dominus <@Dominus> wrote:

On 12/30/2011 12:17 AM, Dominus wrote:

On 11/10/2011 02:17 PM, Cooler wrote: