VOGONS

Common searches


[solved] How I get an actual build for Mac OS X?

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 20 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You would need to apply it to Dosbox' source and compile it for OS X

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 22 of 51, by pherosiden

User metadata
Rank Newbie
Rank
Newbie

Hi Lebostein,

I'm currently build DosBox from SVN https://sourceforge.net/p/dosbox/code-0/HEAD/ … ee/dosbox/trunk for the lasted code, on MAC OS 10.12.1
To build from source, please follow this thread: How to build standalone DOSBox SVN for OS X Lion with new SDL code

Current build only support i386, in x64 build will errors.

My build does not display correct color on mac (red and green is swap for pixel color > 8bits). This's a bug in SDL_SetVideoMode and threre're no fix at this time.
I Google some where but no results.

Reply 23 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'd point people at my straight SVN build for OS X which works for OS X from 10.4 ppc up to current 10.12 intel 😉

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 24 of 51, by pherosiden

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

I'd point people at my straight SVN build for OS X which works for OS X from 10.4 ppc up to current 10.12 intel 😉

Is your build display correct color in 15/16/24/32 bitsperpixel?

How to build with enable_dynamic_x86 and enable_dynrec? if i build with param will errors, i'm using gcc 4.8?

Here is my configure: ./configure --enable-core-inline --disable_dynamic_x86 --disable_dynrec --prefix=/opt/local --host=i386

Reply 25 of 51, by u_fan

User metadata
Rank Newbie
Rank
Newbie

@Dominus

Sorry to be such a newbie idiot, but is there source or instructions for building the DOSBox app bundle for MacOS? I have read the "How to build standalone DOSBox SVN for OS X Lion with new SDL code" thread. I actually got a non-bundled SVN-lfn build working a few days ago, but couldn't make it portable. Now I can't even parse the thread enough to figure out how I did it.

My goal is a portable SVN build with lfn support. I presume an app bundle is my best bet.

Ultimately the bundled SDL would be headless. I just need to execute a DOS exe (UNACE.EXE) file from a bash script with long filename support.

Thanks

Reply 26 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I've written instructions a couple of times. You will need to edit the makefiles to point at the static libs instead of the dynamic ones.

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 27 of 51, by u_fan

User metadata
Rank Newbie
Rank
Newbie

Thanks for the reply. I'm not trying to be obtuse, but I'm new to the board. I've only found the "How to build standalone DOSBox SVN for OS X Lion with new SDL code" thread so far which appears more of you responding to someone else's attempt to document (which I found confusing with the back & forth). I tried to find a link to all your originated posts but no luck. Your sig doesn't include any links to the topic I'm searching for.

The following TLDR paragraphs are some of my research. Partly they are to show I'm not just looking to be spoon-fed (just "de-confused"). And partly (in case you feel like reviewing them) to see where I'm off-track.

"You will need to edit the makefiles to point at the static libs instead of the dynamic ones." seems to point that I don't need a bundled app. I went back and examined the DOSBox.app bundle (from your Dosbox-SVN-snapshot.dmg) executable strings with otool and the only lib references appear to be the system standard ones.

	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 830.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

I had got off track because some dosbox custom SVN build executables I've encountered have "@executable_path/../lib" strings indicating a bundle or similar folder structure.

I did confirm that the DOSBox executable in the SVN dmg you provided does function outside the app bundle without any non-standard libs installed (libpng, SDL).

I went back and rechecked my dosbox-lfn build from a few days ago and it fails for libpng (if not installed). No reference to libz in the otool results. I actually don't need screen capture (or audio/networking/joystick/cdrom/midi) as I want to run headless.

Rereading the "How to build standalone.." thread again I zeroed in on:

You want to edit Makefile and replace the "Libs = ..." line and replace it with your own to make it build a static version of Dosbox. 

...

execute /path/for/SDL/binaries/bin/sdl-config --libs
and /path/for/SDL/binaries/bin/sdl-config --static-libs

...

LIBS = -L/opt/exult.i386/lib /opt/exult.i386/lib/libSDLmain.a /opt/exult.i386/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit /opt/local/lib/libpng14.a /opt/local/lib/libz.a -framework CoreMIDI

The "/opt/exult.i386/..." references confuse me since I don't have this folder on the full SDL installed system (nor on the clean system, though I would not expect them there).

Some good news:

export SDL_VIDEODRIVER=dummy

seems to be working now. No idea while it failed for me earlier (probably overly tired/confused). But it led me on a merry chase for a custom headless SDL build that isn't needed. But I do wonder if it would be more efficient if I did a custom build disabling those features. So far my attempts to build SDL 1.2.15 from source result in the dosbox build failing with

configure: error: *** SDL version 1.2.0 not found!

indicating that something is wrong with my SDL build, but reading various threads on this error hasn't helped me fix it (yet). So far I can only build DOSBox with the homebrew installed SDL.

My SDL builds looks to have installed:

> find /usr/local -iname *sdl*
/usr/local/bin/sdl-config
/usr/local/include/SDL
/usr/local/include/SDL/SDL.h

---cut various header files ---

/usr/local/lib/libSDL-1.2.0.dylib
/usr/local/lib/libSDL.a
/usr/local/lib/libSDL.dylib
/usr/local/lib/libSDL.la
/usr/local/lib/libSDLmain.a
/usr/local/lib/libSDLmain.la
/usr/local/lib/pkgconfig/sdl.pc

/usr/local/share/aclocal/sdl.m4
/usr/local/share/man/man3/SDL_ActiveEvent.3

---cut various man files ---

Any pointers on what I missed would be greatly appreciated.

Reply 28 of 51, by u_fan

User metadata
Rank Newbie
Rank
Newbie

Ok, I've figured out that the "/opt/exult.i386/lib" path is Dominus' path to his custom SDL build. Now I feel dumb...

Searching for that string I found two more threads where he helps other users on building on Mac. "Building under OS X and Xcode 5.0" (Building under OS X and Xcode 5.0) has more hints but is obviously pretty outdated given Apple's furious upgrade schedule.

I preferred when Apple fixed more and changed less. Emoji and gee-whiz visual features are lost on me. And Siri doesn't even work well on the iPhone... /rant off

Reply 29 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Actually it's all still pretty valid 😉
I don't meanto be rude in my replies, I'm just often on my phone when I reply, so I sometimes appear more rude than I actually am 😉

About /opt/local paths, these are because I recommend getting all the needed libs via MacPorts for the novice. If you manage to compile SDL yourself you might need to point DOSBox' configure at the location where you installed SDL to (make install in the SDL sources) via a configure switch (--with-sdl-prefix=/usr/local/ or so, run ./configure --help for the correct one). And of course pay attention tat you grabbed the SDL 1.2x branch of SDL's development- it has fixes for newer OS X. The main SDL branch is for SDL2 and DOSBox is not compatible to that yet (there is a patch though).

Finally you can either look at the dosbox binary with otool and replace all the dynamic lib calls with bundled ones or change the makefile to compile the libs in. That's what I refered to in the makefile changes, changing lib calls from dynamic (e.g. -lpng to -l/path/libpng.a).
If you want screenshots support you will need to build libz and libpng yourself as well.
If you want to have it work on many different OSX systems you will need to pass min version to building the libs and DOSBox.

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 30 of 51, by u_fan

User metadata
Rank Newbie
Rank
Newbie

OK.

1. I re-downloaded the latest SVN (hopefully): 2016-10-03 at sourceforge.
2. Merged the lfn src changes
3. sdl-config --libs
4. sdl-config --static-libs
5. autogen.sh
6. make -j9 -s

Since I'm using the standard sdl 1.2, libpng and libz, I didn't change any of the LIBS = lines (as a first test).

Makefile:
LIBS = -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -framework OpenGL -framework CoreMIDI -framework AudioUnit -framework AudioToolbox
SDL_LIBS = -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa

src/Makefile:
LIBS = -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -framework OpenGL -framework CoreMIDI -framework AudioUnit -framework AudioToolbox
SDL_LIBS = -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa

Binary runs fine on development machine but a quick check with otool shows:

	/usr/local/opt/sdl/lib/libSDL-1.2.0.dylib (compatibility version 12.0.0, current version 12.4.0)

indicating it isn't staticly linked. Neither libpng or libz are listed so I assume they are staticly linked.

7. Tested with libpng and libzip unlinked --> app runs fine
8. Tested with sdl unlinked --> app fails (as expected per strings) --> dyld: Library not loaded: /usr/local/opt/sdl/lib/libSDL-1.2.0.dylib

So where did the static linking for SDL go wrong? And why did libpng and libzip not?

Reply 31 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

1. according to your makefile there Dosbox is not linking to libpng at all, hence no libz as well.
2. if you don't change the LIBS lines then there will not be any static linking of SDL.
To link SDL statical, run
/usr/local/bin/sdl-config --libs
(this should match parts of LIBS and SDL_LIBS in the makefiles)

and then run
/usr/local/bin/sdl-config --static-libs

The output of static-libs is what you replace the output of --libs with in the makefiles

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 32 of 51, by u_fan

User metadata
Rank Newbie
Rank
Newbie

@Dominus

Thank you! That did it.

I completely misunderstood the function of the --libs and --static-libs options for sdl-config.

I did suspect the libpng and libz part, but it's functioning. So is

export SDL_VIDEODRIVER=dummy

AFter my last post, I have been trying to build a custom SDL 1.2.15 under 10.12 Sierra. I'm seeing a lot more deprecated errors related to 10.12 and the build failed. Have you been able to build 1.2.15 under 10.12? Or am I wasting my time? At this point it's just to disable the unneeded features for efficiency.

Reply 33 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

As I wrote, use the development branch of SDL 1.2. It has needed fixes.

Edit: libpng is not needed for Dosbox to function. You will just not be able to make screenshots using the DOSBox screenshot shortcut.
Nor will you be able to use images that have their audio tracks as ogg files, without building SDL_sound

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 35 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

For future reference, my automated build script for DOSBox under OS X works perfectly under Sierra:

https://github.com/emendelson/OneStopDOSBoxOSX

I call it "my" script, but every idea in it comes from Dominus and all I did was put them together in one place.

Reply 36 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Thanks for the praise but you are the one who makes it into such a nice painless script;)

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 37 of 51, by nahum

User metadata
Rank Newbie
Rank
Newbie
emendelson wrote:

For future reference, my automated build script for DOSBox under OS X works perfectly under Sierra:

https://github.com/emendelson/OneStopDOSBoxOSX

I call it "my" script, but every idea in it comes from Dominus and all I did was put them together in one place.

hi,
Upon launch, your script trapped this error:

sam-MacBook-Pro:Desktop hill$ ./db_osxsr.sh
-bash: ./bb_osxsr.sh: /bin/sh^M: bad interpreter: No such file or directory
sam-MacBook-Pro:Desktop hill$

I made the script executable w/'chmod 744' and please explain what other prerequisite is required to get it functional??
Cheers!
nahum

Reply 39 of 51, by nahum

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

Launch a script with "sh script.sh"

Hi,
Next group of errors trapped:

sam-MacBook-Pro:Desktop hill$ sh db_osxsr.sh
: command not found:
: command not found:
: command not found:
: command not found:
: command not found:
: command not found:
: command not found1:
: command not found3:
: command not found5:
: command not found6:
: command not found7:
: command not found8:
: command not found0:
: command not found2:
: command not found4:
: command not found5:
: command not found6:
: command not found7:
: command not found9:
: command not found1:
: command not found3:
: command not found5:
: command not found7:
: command not found9:
: command not found1:
: command not found3:
: command not found4:
: command not found5:
: command not found6:
: command not found8:
: command not found9:
: command not found0:
: command not found1:
: command not found3:
: command not found5:
: command not found7:
: command not found8:
: command not found9:
: command not found0:
: command not found2:
: command not found4:
: command not found6:
: command not found8:
: command not found0:
: command not found2:
: command not found3:
: command not found4:
: command not found5:
: command not found7:
: command not found8:
: command not found9:
: command not found0:
: command not found2:
: command not found4:
: command not found5:
: command not found6:
: command not found7:
db_osxsr.sh: line 102: syntax error near unexpected token `elif'
db_osxsr.sh: line 102: ` elif [ $1 = "help" ] || [ $1 = "--help" ] || [ $' = "-help" ] || [ $1 = "-h" ] || [ $1 = "-?" ] ; then
Show last 2 lines
sam-MacBook-Pro:Desktop hill$ 

Q1: Is script compatible w/Maverick 10.9.5?
Q2: Is script based on dosbox.com 0.74, Hal MegaBuild, or something else?
nahum