VOGONS


First post, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

Is there any guide for this ? except this one, http://www.dosbox.com/wiki/BuildingDOSBox
it sais nothing about universal binaries or a static SDL.

Thanks

Reply 1 of 12, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

You somehow need to tell the compiler to produce a static library when compiling SDL.

1+1=10

Reply 2 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

The readme said :
On OS X, you can
achieve that by linkinag against the libraries listed by
sdl-config --static-libs
instead of those listed by
sdl-config --libs
Depending on how exactly SDL is integrated into your build systems, the
way to achieve that varies, so I won't describe it here in detail

Reply 3 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

look up the last line of the compile process
something like this

g++  -g -O2    -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a  hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a  -lSDL_sound -lasound -lm -ldl -lpthread -L/usr/lib -lSDL -lpng -lz -lSDL_net -lGL

repeat that line manually and try replacing the SDL parts with their static counterparts.
It takes some skill and patience to find every piece you need

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

When I build SDL,

First I type ./configure, after that "make" and the end looks like this

gcc -g -O2 -I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -fvisibility=hidden -I/usr/X11R6/include -DXTHREADS -D_THREAD_SAFE -maltivec -force_cpusubtype_ALL -fpascal-strings -c ./src/main/macosx/SDLMain.m -o build/SDLMain.o
ar cru build/libSDLmain.a build/SDLMain.o
ranlib build/libSDLmain.a

Reply 5 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

it's about the dosbox build process.

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

Oops,
The end of compiling looks like

g++ -g -O2 -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -lm -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lpcap -lSDL_net -framework OpenGL -framework CoreMidi -framework AudioUnit -framework AudioToolbox

Reply 7 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

So what I did,
I compiled SDL (as universal binary) <succesfully>
then I built DOSBox (again as universal binary)
I replace the ./configure with this :

env CFLAGS="-0 -g -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc" \ LDFLAGS="-arch i386 -arch ppc" ./configure --prefix=$dosbox --disable-dependency-tracking

(the site from Apple said that's the way of building uninversal binaries)
after make, I got a dosbox executable, to test if it was UB, Apple said :
file ./src/dosbox
It told me it's only PPC 😖

But then,
This man/woman was trying to build DOSBox 0.65 for intel (later UB)
To build a static SDL he/she said :
http://www.spam-filter.de/dosbox/dosbox_0.65_for_intel_macs

g++ -g -O2 -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a \ fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints […]
Show full quote

g++ -g -O2 -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a dos/libdos.a \
fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a \
misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a \
/opt/local/lib/libSDL_mixer.a \
/opt/local/lib/libSDL_sound.a \
(...)
-framework OpenGL \
-framework QuickTime \
(...)
-lm

(I've left out some stuff to make this post less long)
So what I did, copied the g++ -g -02 thing from my build of DOSBox
and then changed "/opt/local/lib" with "/usr/local/bin/lib" because "/opt/" didn't exist here. And I didn't install SDL_Sound etc so I left "/usr/local/lib/SDL_sound.a \" out (I only found libSDL_net.a, libSDL.a and libSDLmain.a)
after that it gave me this

ld: in dosbox.o, file too small
collect2: ld returned 1 exit status

and the executable was dissapeared from the src folder.

Can somebody help me or can somebody tell me what to change Makefile so it makes a UB with a static SDL ?
Maybe "Shawn, Johannes and Marcus for creating the MAC OS X version." from the official DOSBox thanks file ?
Thanks

Reply 8 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

Isn't there anyone who can help me? please ??
Thanks

Reply 9 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Please stop bumping threads.

Reply 10 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie

Sorry, didn't mean to do that 😐
I'll stop asking stuff about DOSBox. But I was just learning...
Sorry for all the trouble...

Reply 11 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I'll stop asking stuff about DOSBox.

Oh feel free to continue asking, just if nobody responds it doesn't mean
nobody likes you or whatever, just that at the moment nobody knows an
answer or doesn't have the time to check it out. Repeatedly posting about
it isn't helpful in that case.

Reply 12 of 12, by Farnsworth

User metadata
Rank Newbie
Rank
Newbie
Oh feel free to continue asking, just if nobody responds it doesn't mean nobody likes you or whatever, just that at the moment […]
Show full quote

Oh feel free to continue asking, just if nobody responds it doesn't mean
nobody likes you or whatever, just that at the moment nobody knows an
answer or doesn't have the time to check it out. Repeatedly posting about
it isn't helpful in that case.

Oops, I actualy didn't knew what "bumping threads" meant...
But thanks for learning me...
I'll stop pushing people to answer...