VOGONS


Reply 20 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

This is also the reason for the smaller binary., the libs are not compiled into the binary...

Apologies for more questions: Is that why I needed to install MacPorts and "port install dosbox" before I could create a new executable? Because the MacPorts install added the libs?

Thanks again!

Reply 21 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

yes. MacPorts gives you a development library and provides you with a lot of software and takes care of the dependencies of a software. In the case of Dosbox it provides SDL, SDL_net, SDL_sound and libpng. Furthermore it takes care of building it correctly, applying patches if needed for building the libs (and programs) on OS X, also taking care of the 32bit and 64bit problems (Dosbox only works correctly AND fast when compiled in 32bit).
You CAN do that all manually but believe me it's a troublesome way and takes much longer than letting MacPorts install/compile all the needed stuff. Especially when you are new to this the MacPorts way is way safer 😀

And no need to apologize, everyone is a beginner at some point. Last year when I switched to Mac I was a beginner and asked Rhoenie (the OS X maintaienr of Dosbox) all those beginner questions and some stuff I had to figure out for myself...

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 emendelson

User metadata
Rank Oldbie
Rank
Oldbie

OK - that explains a lot. Thank you again.

I hope you'll let me exploit your knowledge a bit more. I'm working on this project mostly so that I can distribute it to other people, so I hope to make it reasonably portable. I know how to put together a PackageMaker installer that could install the libraries to /opt, but I really don't want to mess with other people's systems that way.

Instead, are the following two things possible?

(1) My project doesn't need or use libpng, SDL_sound, or SDL_net. Is it reasonably easy to modify the configuration files so that these are ignored by the build? (I don't include png or sound support in my Windows version of this project.)

(2) Is it possible to build the executable so that it can use a copy of SDL.dll in the same folder (which is what a lot of other applications seem to do)?

I know I am only guessing here, but it seems as if these two things could make it possible for me to make this project portable. But if I'm wrong, I'll be glad to know it now, and avoid a lot of pointless work. Thanks again.

Reply 23 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

(1) My project doesn't need or use libpng, SDL_sound, or SDL_net. Is it reasonably easy to modify the configuration files so that these are ignored by the build? (I don't include png or sound support in my Windows version of this project.)

(2) Is it possible to build the executable so that it can use a copy of SDL.dll in the same folder (which is what a lot of other applications seem to do)?

1) yes, just pass along the necessary configure switches (type ./configure --help to get to know them)
2) there is no sdl.dll, you are not in Windows anymore 😀 But you can built Dosbox statically by modifying the makefile.
First type in terminal "sdl-config --libs" (output should be "-L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa") then type "sdl-config --static-libs" (output should be "-L/opt/local/lib /opt/local/lib/libSDLmain.a /opt/local/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit"). In the makefile(s) replace the first output with the second one... then make

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

User metadata
Rank Oldbie
Rank
Oldbie

OK, I think I'm beginning to see my way. But I'm not certain of which option to use. If I want to build an executable that won't use libpng and SDL_net (for example), do I use something like:

./configure --without-libpng --without-SDL_net [etc.]

Or am I completely confused? Thanks again.

And when you say to modify the makefile, am I right in thinking that you're telling me to edit makefile (in the top-level folder of the project) and change the line that begins LIBS=, and then manually copy this changed makefile into all the folders in the src folder? Or do I need to make the change by hand in all the separate makefile files?

Thanks again!!

Reply 26 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

hmm, not sure whether you can actually disable those via configure... if ./configure --help doesn't show them then you can't. BUT mostly configure is intelligent and if it can't find the libs that are not vital for running you can try to disable them in MacPorts. In terminal execute
sudo port deactivate libpng
sudo port deactivate libsdl_net
sudo port deactivate libsdl_sound
(you can also uninstall them but this way they are just disabled and not uninstalled so you can just activate them if you need them again)
then do all the stuff you need to build dosbox again and see whether configure fails or works.

You might need to try out which makefile you need to edit. I *think* either the top level one or the one in /src or both 😀 Most likely not all.
AND most important DON'T replace them with an edited makefile, edit the makefiles as I wrote. The makefiles might have different entries and if you screw up make will not work.
To test whether you succeded start the activity monitor that comes with OS X, start dosbox, doubleclick dosbox in the activity monitor then go to the tab "opened files and ports" (or similar my os x is in German so the tab description might vary - the most right one). If this tab shows files in /opt/local/... you have a problem 😀 report back if you do 😀

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

User metadata
Rank Oldbie
Rank
Oldbie

No luck yet, I'm afraid.

Before I could deactivate libpng, libsdl_net, and libsdl_sound, I had to use "port uninstall dosbox". That was all right with me, because I didn't want to use 0.73 anyway. I was able to compile svn after uninstalling dosbox. But when I deactivated libpng, libsdl_net, and libsdl_sound, I was unable to compile svn. Make failed with Error 2, after a few hundred lines of error messages.

I'm now going to reactivate those three libraries, and try to compile with sdl statically linked, just to see if that will work. More reports coming next.

Reply 29 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I followed your instructions about statically linking sdl, and successfully compiled it. The executable ran successfully. It produced this output:

MacBook24:~ edward$ /Users/edward/test-trunk/src/dosbox ; exit;
objc[43621]: Class SDLTranslatorResponder is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /Users/edward/test-trunk/src/dosbox. One of the two will be used. Which one is undefined.
objc[43621]: Class SDL_QuartzView is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /Users/edward/test-trunk/src/dosbox. One of the two will be used. Which one is undefined.
objc[43621]: Class SDL_QuartzWindowDelegate is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /Users/edward/test-trunk/src/dosbox. One of the two will be used. Which one is undefined.
objc[43621]: Class SDL_QuartzWindow is implemented in both /opt/local/lib/libSDL-1.2.0.dylib and /Users/edward/test-trunk/src/dosbox. One of the two will be used. Which one is undefined.
DOSBox version SVN
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file /Users/edward/Library/Preferences/DOSBox SVN Preferences
MIDI:Opened device:coreaudio
logout

Is this all right? The executable is 3.8 MB. The executable that was dynamically linked was 3.3 MB.

Reply 30 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I think I may have made *some* progress on this, but not enough. In an attempt to create a portable dosbox with MacPorts, I used this command to edit the MacPorts port file:

sudo port edit dosbox

In the editor (I prefer nano, so I actually used the command sudo port edit --editor nano dosbox) I commented out the six lines that referred to sdl_net, sdl_sound, and libpng and saved the file.

I then did ./autogen.sh and ./configure, and edited the makefile as Dominus suggested. I found that there was still a reference to the sdl_sound library in the makefile, so I deleted that in the LIBS= line. I compiled and ran the build on another machine.

Unfortunately, the new build gave me the message that it couldn't find /opt/local/lib/libSDL_sound-1.0.1.dylib - so I wasn't able to get rid of whatever requires SDL_sound.

So I don't know if this is progress or not... If anyone has any advice, I'll be grateful.

Reply 31 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'll probably take a look later, but why are you messing with the portfile, when you are compiling Svn?
If you cant get rid of the dependencies you have to compile them also statically into 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 32 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

I realize that it seems to make no sense to edit the portfile when compiling svn, but the environment variables that you posted seem to point the ./configure process toward the MacPorts directories in /opt.

When I run ./configure on the svn source, the resulting makefile includes the line:

INSTALL = /opt/local/bin/ginstall -c

plus a few other references to /opt so it seemed to be worth trying. Apologies for wasting time if I was wrong!

Reply 33 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Editing the portfile is a waste of time.
Background: apple does provide some unix stuff, sometimes castrated. That's why macports does most of the stuff new and correctly and puts it in /opt/local so it doesn't collide or overwrite the appple stuff - that's something you don't want. So the libs pulled in by macports for building dosbox are in /opt/local.

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

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

Editing the portfile is a waste of time.

As I discovered by further experiment. I also tried hex-editing the executable so that it pointed to libraries in the same directory (./libraryname) instead of /opt, but that didn't work either - the executable reported that it couldn't find the library. This whole effort is probably far beyond me, but I was hoping to get a portable custom build put together before the next official release comes out.

Thanks again!

Reply 35 of 51, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

you need otool to point to the libraries. Or edit the makefile, and point to the .a file instead...
I actually do have Dosbox configuring correctly with SDL_Sound/net not being installed. So you need to find out why that doesn't work for you.
Then when you change the makefile in the "LIBS=" section exchange -lz with /opt/local/lib/libz.a and -lpng with /opt/local/lib/libpng.a...

What is your overall goal with this whole thing? And why is it important to you that it is portable?

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

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for those instructions. Will test them tonight.

My goal is this:

I've already created a system that uses the release version of DOSBox to run WordPerfect for DOS 5.1 or 6.2 under OS X, wrapped in an AppleScript application that installs a folder action script which makes it possible to print to the current OS X printer and also to create PDF files from WordPerfect for DOS. I've posted a link and a description here:

http://www.columbia.edu/~em36/wpdos/wpdosmac.html#dosbox

It doesn't work "out of the box" because I don't distribute the copyrighted WordPerfect program files; the user has to add them by himself. However, if the user changes the name of the WPDOSBox51 or WPDOSBox62 application to WPDOSBox (no 51 or 62), it WILL start up in the default DOSBox environment. (The AppleScript tests for the name of the script/application.)

This system works well, but I would like to improve it by using a custom build of DOSBox that includes four improvements:

1. The 512-character VGA font fix provided by @ripsaw8080 in this thread: Patch to fix display of VGA 512-character font?.

2. The mode-mono underline fix provided by @h-a-l-9000 in this thread: Underline attribute in "mode mono" - correct only with vgaonly

3. The original IBM vga fonts (to avoid MMM and mmm with no gaps between the letters), provided to me through a private message by a member who may or may not want to be identfied here. (I'll gladly post his modified file if he says he wants to make his fix available publicly.)

4. A fix that allows some WordPerfect Corp. task-switching programs to start, provided to me through a private message by a member who may or may not want to be identfiied. (Again, I'll gladly post his fix if he wants to make it available publicly.)

So basically, I'm trying to build from SVN, with four files changed, so that I can update my existing system. It needs to be portable because I offer it to any user who wants it, and I don't want to offer to mess with their top-level directories. I'd also like to use it myself, and of course on my own systems I could manage perfectly well without a portable system. But I'm doing this mostly in order to distribute it.

Reply 38 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
wd wrote:

Be very sure that you are not violating any IBM copyrights by using/distributing fonts.

Good point. I've written quite a lot about typography in computer magazines, and it's clear that font designs can be copyrighted in some countries (e.g. Deutschland) but not in others (e.g. USA). So, to be safe, I won't use the IBM fonts in in a distributed version if I can manage to make one.

Reply 39 of 51, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

I actually do have Dosbox configuring correctly with SDL_Sound/net not being installed. So you need to find out why that doesn't work for you.
Then when you change the makefile in the "LIBS=" section exchange -lz with /opt/local/lib/libz.a and -lpng with /opt/local/lib/libpng.a...

At the risk of outlasting my welcome, could I ask for a copy of your makefile? I don't have -lz or -lpng anywhere in the makefile here.

Also, I still haven't been able to get dosbox to compile so that it doesn't require SDL_sound on another system.

Again, I know I'm asking a lot of questions. It may be best if I simply wait for the next released version...