VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Hello,

A few months ago, I successfully built SDL 1.2 under Lion from the Hg sources, using this build script, based on instructions from Dominus:

#!/bin/sh

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'

./autogen.sh

## REPLACE path shown below with correct path for current system
./configure --enable-static --enable-joystick --enable-cdrom --disable-video-x11 --enable-video-cocoa --enable-video-opengl --without-x --prefix=/Users/edward/Development/SDL-forDB

make clean

make

make install

I updated SDL 1.2 again today via Hg, and tried to build again, but got the error reported in these last lines of the output:

/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -arch i386 -g -O2 -I./include -mmmx -m3dnow -msse -msse2 -DTARGET_API_MAC_CA […]
Show full quote

/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -arch i386 -g -O2 -I./include -mmmx -m3dnow -msse -msse2 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -D_THREAD_SAFE -falign-loops=16 -force_cpusubtype_ALL -fpascal-strings -MMD -MT build/SDL_cocoawindow.lo -c src/video/cocoa/SDL_cocoawindow.m -o build/SDL_cocoawindow.lo
libtool: compile: /usr/bin/gcc-4.2 -arch i386 -g -O2 -I./include -mmmx -m3dnow -msse -msse2 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -D_THREAD_SAFE -falign-loops=16 -force_cpusubtype_ALL -fpascal-strings -MMD -MT build/SDL_cocoawindow.lo -c src/video/cocoa/SDL_cocoawindow.m -fno-common -DPIC -o build/.libs/SDL_cocoawindow.o
In file included from src/video/cocoa/SDL_cocoavideo.h:26,
from src/video/cocoa/SDL_cocoawindow.m:30:
./include/SDL_opengl.h:5119: error: conflicting types for ‘GLintptrARB’
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:102: error: previous declaration of ‘GLintptrARB’ was here
./include/SDL_opengl.h:5120: error: conflicting types for ‘GLsizeiptrARB’
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:103: error: previous declaration of ‘GLsizeiptrARB’ was here
src/video/cocoa/SDL_cocoawindow.m: In function ‘-[Cocoa_WindowListener handleTouches:withEvent:]’:
src/video/cocoa/SDL_cocoawindow.m:404: warning: cast from pointer to integer of different size
src/video/cocoa/SDL_cocoawindow.m:424: warning: cast from pointer to integer of different size
make: *** [build/SDL_cocoawindow.lo] Error 1
/bin/sh ./build-scripts/updaterev.sh
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -arch i386 -g -O2 -I./include -mmmx -m3dnow -msse -msse2 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -D_THREAD_SAFE -falign-loops=16 -force_cpusubtype_ALL -fpascal-strings -MMD -MT build/SDL_cocoawindow.lo -c src/video/cocoa/SDL_cocoawindow.m -o build/SDL_cocoawindow.lo
libtool: compile: /usr/bin/gcc-4.2 -arch i386 -g -O2 -I./include -mmmx -m3dnow -msse -msse2 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -D_THREAD_SAFE -falign-loops=16 -force_cpusubtype_ALL -fpascal-strings -MMD -MT build/SDL_cocoawindow.lo -c src/video/cocoa/SDL_cocoawindow.m -fno-common -DPIC -o build/.libs/SDL_cocoawindow.o
In file included from src/video/cocoa/SDL_cocoavideo.h:26,
from src/video/cocoa/SDL_cocoawindow.m:30:
./include/SDL_opengl.h:5119: error: conflicting types for ‘GLintptrARB’
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:102: error: previous declaration of ‘GLintptrARB’ was here
./include/SDL_opengl.h:5120: error: conflicting types for ‘GLsizeiptrARB’
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:103: error: previous declaration of ‘GLsizeiptrARB’ was here
src/video/cocoa/SDL_cocoawindow.m: In function ‘-[Cocoa_WindowListener handleTouches:withEvent:]’:
src/video/cocoa/SDL_cocoawindow.m:404: warning: cast from pointer to integer of different size
src/video/cocoa/SDL_cocoawindow.m:424: warning: cast from pointer to integer of different size
make: *** [build/SDL_cocoawindow.lo] Error 1

Is it worth the effort to try to make this work? I understand that there have been various improvements in SDL for OS X since we last discussed this on the board a few months ago.

MacPorts is fully up to date on this system, by the way.

Reply 1 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Pull & update hg again. It's being worked on atm, seemingly to get a new 1.2 release out.
And try a
Make distclean
(don't know whether that is available in SDL makefile but if it is it might help.
Or/and try to get rid of everything that is not from hg in that folder.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Success: thank you. Make distclean didn't help, so I created a new folder, pulled the current repository into it, copied my build-script (see message above) into the new folder, and all worked perfectly. Thank you again.

Reply 4 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Glad it solved so easy. Always helps if one knows that the problem is on your side and not the sources 😉
We should search for a mac programming/development novice forum somewhere so our off topic discussions are better suited 😉
(don't get me wrong our mac developer discussions proved friuitful for me as well)

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

We should search for a mac programming/development novice forum somewhere so our off topic discussions are better suited ;)
(don't get me wrong our mac developer discussions proved friuitful for me as well)

I've been looking for exactly that kind of forum, but haven't found it. I spend a lot of time at http://www.emaculation.com/forum/ but that's devoted to SheepShaver and BasiliskII, and I haven't found any good reason to try to build either of them. (I maintain an AppleScript application that runs WordPerfect for the Mac in more or less the same way I run DOSBox under an AppleScript application, but the builds created by the moderators at the emaculation.com site do the job perfectly well.)

Is any chance that the moderators here might create separate sub-forums for development on specific platforms (OS X, Linux, "other platforms")? That way, we wouldn't clutter up this forum with threads that are of no interest to anyone on a non-OS X platform.

Reply 6 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I've now tried to build SDL 1.2 under Mountain Lion, still using the script that I got from Dominus in the first message. No luck, I'm afraid. I tried removing the "-4.2" string from each export. That didn't help either. If anyone has any suggestions for building SDL 1.2 for use with DOSBox under OS X, I would be very grateful.

Reply 7 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator
#64bit
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/gcc"
export CXX="/usr/bin/g++"
export GCOV="/usr/bin/gcov"
./configure --enable-static --disable-video-x11 --without-x --disable-video-x11

#32bit
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/gcc -arch i386"
export CXX="/usr/bin/g++ -arch i386"
export GCOV="/usr/bin/gcov -arch i386"
export CPPFLAGS="-arch i386"
export CFLAGS="-arch i386"
export CXXFLAGS="-arch i386"
export LDFLAGS="-arch i386"
./configure --enable-static --disable-video-x11 --without-x --disable-video-x11

Works for me. This is the easy build way, which makes both 32 and 64bit builds against SDK 10.8. Only problematic thing is that X11 is not available in the old default locations anymore since Apple is not using it anymore and advises people to install xquartz instead. Hence the disable x11 stuff.

To make it compatible with older Mac OS X versions, I advise to have the old SDKs around and build 32bit against the 10.5 SDK and 64bit against the 10.6 SDK.
If you want to build for PPC you need the old Xcode 3.2x around somewhere since you need its gcc.

example

#64bit
OPT=' -O2 -m64 -msse -msse2 -force_cpusubtype_ALL '
SDK=' -w -isysroot /Developer-old/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -I/Developer-old/SDKs/MacOSX10.6.sdk/usr/X11R6/include/ '
export MACOSX_DEPLOYMENT_TARGET=10.6
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/gcc"
export CXX="/usr/bin/g++"
export CPPFLAGS=$SDK
export CFLAGS=$SDK' '$OPT
export CXXFLAGS=$SDK' '$OPT
export LDFLAGS=$SDK' '$OPT
./configure --enable-static --disable-video-x11 --without-x --disable-video-x11

#32bit
OPT=' -arch i386 -m32 -O2 -msse -msse2 -force_cpusubtype_ALL '
SDK=' -w -isysroot /Developer-old/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/Developer-old/SDKs/MacOSX10.5.sdk/usr/X11R6/include/ '
export MACOSX_DEPLOYMENT_TARGET=10.5
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/gcc -arch i386"
export CXX="/usr/bin/g++ -arch i386"
export CPPFLAGS=$SDK
export CFLAGS=$SDK' '$OPT
export CXXFLAGS=$SDK' '$OPT
export LDFLAGS=$SDK' '$OPT
./configure --enable-static --disable-video-x11 --without-x --disable-video-x11

#ppc
OPT=' -arch ppc -m32 -O2 '
SDK=' -w -isysroot /Developer-old/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I/Developer-old/SDKs/MacOSX10.5.sdk/usr/X11R6/include/ '
export MACOSX_DEPLOYMENT_TARGET=10.4
export PATH=/developer-old/usr/bin:/developer-old/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/developer-old/usr/bin/llvm-gcc-4.2 -arch ppc"
export CXX="/developer-old/usr/bin/llvm-g++-4.2 -arch ppc"
export CPPFLAGS=$SDK
export CFLAGS=$SDK' '$OPT
export CXXFLAGS=$SDK' '$OPT
export LDFLAGS=$SDK' '$OPT
./configure --enable-static --disable-video-x11 --without-x --disable-video-x11 --host=powerpc-apple-darwin

Good luck. Make sure you use a clean source and best use the hg of SDL 1.2 branch.

Edit: for ppc you need to pass host to the configure step.
Edit 2: I needed to correct some ' '...
Edit 3: I accidently left the gcc and g++ for ppc out... 😀
Edit 4: tested all this out and all three arches built correctly for me using this way.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 8 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for this - but, unfortunately, I get an error message about "windres":

checking how to hardcode library paths into programs... immediate checking for a BSD-compatible install... /usr/bin/install -c c […]
Show full quote

checking how to hardcode library paths into programs... immediate
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for windres... no
configure: error:
*** When building from Mercurial you should configure and build in a
separate directory so you don't clobber SDL_config.h, SDL_revision.h

I think windres involves checking for Windows resources. Do you have any idea of how I ended up with this problem? Apologies for bothering you with my own problems!

Reply 9 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Look in config.log for the real error/failure. Something is probably wrong with the source (are you using latest SDL 1.2 branch ?) or you might have something in your .profile that screws things up.
Please check these thingsand then start a new terminal (quit and start terminal, not close and start terminal) and only do the easy 64bit building of sdl. Copy paste your whole terminal and attach config.log.

Oh and make sure that in xcode 4.4.1 preferences you download/install the unix development tools.

Edit, just checked and windrws=no message is normal. So you definitely need to check config.log. The message to build outside of the source really makes me think you are trying to build SDL trunk (SDL 2) and not the SDL 1.2 branch.

Edit 2: just chekced the message you see is from running configure with SDL trunk. Check the ReadMe, it says SDL 2.0 at the top you are trying to build the wrong SDL 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

That explains it! I thought I was pulling source from SDL 1.2, but obviously wasn't. Will begin again - and many thanks for your patient help with this!

Reply 11 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Of course you were right - thank you yet again.

I couldn't figure out how to use MacHG to pull source for 1.2 from the SDL repository, so I downloaded the 1.2.15 code from here:

http://www.libsdl.org/download-1.2.php

If you know the string to use in MacHG to download the current state of the 1.2 branch, I'd be very grateful. Everything I've tried ends up either with a "non found" message or it downloads 2.0. I know this is a beginner's error, but I'm still baffled by it.

EDIT: OK - I figured out how to use MacHG to download a specific branch. In the Clone dialog, choose Advanced Options, and then clone the specific branch SDL-1.2. And, again following your instructions, I successfully built DOSBox from the latest SDL and the latest DOSBox SVN. Thank you!!!

Reply 12 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You're welcome 😉

I just used command line mercurial following the instructions on the SDL page, I think (it's bern a while).

As for SDL 2.0 don't even use that when the SDL guys finally release something, Dosbox is not compatible to it.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 13 of 14, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

I just used command line mercurial following the instructions on the SDL page, I think (it's bern a while).

I tried that, using the command-line mercurial downloaded from the same site as MacHg, but got error messages. But MacHg worked when I figured out the advanced option. (Unfortunately, I can't make that advanced option "stick" so I'll need to enter it every time I update, in order to avoid downloading 2.0.

I noticed that you're very active over at MacScripter.net. See you there!

Reply 14 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

It should be enough to "hg pull && hg update". This should stick but then I'm not really an expert on mercurial...
I'm not really active there, it's just where I look for help when I'm stuck at dome script once a year 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper