VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Probably this is just user stupidity, but I'm trying to build current SVN under macOS Sierra and High Sierra, using a script that I put together entirely with help from Dominus. (I wouldn't know how to begin, and everything in the script is basically Dominus's work.) I'm trying to build a dynamic-linked DOSBox because the current code won't build a static-linked version in my script, and the code builds correctly - but it doesn't take any keyboard input. Nothing that I type appears at the Z: prompt.

Obviously, this is my fault, because Dominus's 64-bit build works perfectly. But I'm trying to learn how to build current SVN so that I can eventually build my custom code that works under Windows, but which I can't yet build under macOS.

If there's an easy answer to this, please let me know.

My build script is here:

https://github.com/emendelson/OneStopDOSBoxOSX

It won't build a static version with current code, but it builds a dynamic version - and that dynamic version doesn't take keyboard input.

Reply 1 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Sorry for not replying to your personal message, holiday stress 😀
So, I've been down that road and had the no keyboard input happen to me, too. That was in September and during our big move... so most of it is forgotten. if you start the Dosbox binary from terminal you will notice that whatever you type in Dosbox is actually redirected to the terminal 😀 Fun times 😀
BUT I think it was important to limit the 64bit building to 10.10 upwards and and 32bit from 10.5 upwards, and using the latest SDL 1.2 branch *and* making sure the libraries were all built identically (same arches and minimal os x version).
My build script for the 0.74-2 release:

#!/usr/bin/env bash
DIE=0
function error_exit
{
echo -e "\033[1;31m **Error** line #${1:-"Unknown Error"}\033[0m" 1>&2
exit 1
}

cd ~/Code/SVN/Dosbox-2/dosbox/branches/0_74_2

#configure options for all arches
CONF_OPT='-q --disable-sdltest --disable-alsatest --enable-core-inline'

#x86_64
OPT=' -O2 -msse -msse2 -force_cpusubtype_ALL '
SDK=' -w -isysroot /opt/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.10 '
export PATH=/opt/x86_64/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
export CPPFLAGS='-I/opt/x86_64/include '$SDK
export CFLAGS='-I/opt/x86_64/include '$SDK' '$OPT
export CXXFLAGS='-I/opt/x86_64/include '$SDK' '$OPT
export LDFLAGS='-L/opt/x86_64/lib '$SDK' '$OPT
export PKG_CONFIG_PATH=
./autogen.sh
./configure $CONF_OPT --prefix=/opt/x86_64 || {
DIE=1
error_exit "$(( $LINENO -2 )) : x86_64 configure failed."
}
make -s clean
patch -p0 -i ~/code/sh/dosbox-patches/intel64.diff
make -j9 -s
strip ./src/dosbox -o ./src/dosbox_x86_64
make -s distclean

#i386
OPT=' -arch i386 -m32 -O2 -msse -msse2 -force_cpusubtype_ALL '
SDK=' -w -isysroot /opt/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 '
export MACOSX_DEPLOYMENT_TARGET=10.5
export PATH=/opt/i386/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/opt/xcode3/usr/bin/gcc-4.0 -arch i386"
export CXX="/opt/xcode3/usr/bin/g++-4.0 -arch i386"
export CPPFLAGS='-I/opt/i386/include '$SDK
export CFLAGS='-I/opt/i386/include '$SDK' '$OPT
export CXXFLAGS='-I/opt/i386/include '$SDK' '$OPT
export LDFLAGS='-L/opt/i386/lib '$SDK' '$OPT
export PKG_CONFIG_PATH=
./autogen.sh
./configure $CONF_OPT --prefix=/opt/i386 --build=i386-apple-darwin || {
DIE=1
error_exit "$(( $LINENO -2 )) : i386 configure failed."
}
make -s clean
patch -p0 -i ~/code/sh/dosbox-patches/intel.diff
make -j9 -s || {
DIE=1
error_exit "$(( $LINENO -2 )) : i386 make failed."
}
strip ./src/dosbox -o ./src/dosbox_i386
make -s distclean
Show last 81 lines

#ppc
OPT=' -arch ppc -O2 '
SDK=' -w -isysroot /opt/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 '
export MACOSX_DEPLOYMENT_TARGET=10.4
export PATH=/opt/ppc/bin/:/opt/xcode3/usr/bin:/opt/xcode3/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CC="/opt/xcode3/usr/bin/gcc-4.2 -arch ppc"
export CXX="/opt/xcode3/usr/bin/g++-4.2 -arch ppc"
export GCOV="/opt/xcode3/usr/bin/gcov-4.2 -arch ppc"
export CPPFLAGS='-I/opt/ppc/include '$SDK
export CFLAGS='-I/opt/ppc/include '$SDK' '$OPT
export CXXFLAGS='-I/opt/ppc/include '$SDK' '$OPT
export LDFLAGS='-L/opt/ppc/lib '$SDK' '$OPT
export PKG_CONFIG_PATH=
./autogen.sh
./configure $CONF_OPT --prefix=/opt/ppc --host=powerpc-apple-darwin || {
DIE=1
error_exit "$(( $LINENO -2 )) : PPC configure failed."
}
make -s clean
patch -p0 -i ~/code/sh/dosbox-patches/ppc.diff
make -j9 -s || {
DIE=1
error_exit "$(( $LINENO -2 )) : PPC make failed."
}
strip ./src/dosbox -o ./src/dosbox_ppc

# make fat build
lipo -create -arch x86_64 ./src/dosbox_x86_64 -arch i386 ./src/dosbox_i386 -arch ppc ./src/dosbox_ppc -output ./src/DOSBox || {
DIE=1
error_exit "$(( $LINENO -2 )) : lipo failed."
}

# bundle
cp ./src/DOSBox ./src/dosbox.app/contents/MacOS/DOSBox || {
DIE=1
error_exit "$(( $LINENO -2 )) : Bundle failed."
}

# codesign to satisfy OS X 10.8 Gatekeeper
codesign --deep --force --sign "Developer ID Application: Dominik Reichardt" ./src/dosbox.app || {
DIE=1
error_exit "$(( $LINENO -2 )) : codesign failed."
}


#make disk image
mkdir DOSBox-0.74-2
CpMac -r ./src/dosbox.app ./DOSBox-0.74-2
cp ./AUTHORS ./DOSBox-0.74-2/Authors
cp ./COPYING ./DOSBox-0.74-2/License
cp ./NEWS ./DOSBox-0.74-2/News
cp ./README ./DOSBox-0.74-2/ReadMe
cp ./Changelog ./DOSBox-0.74-2/ChangeLog
cp ./Thanks ./DOSBox-0.74-2/Thanks
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/Authors
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/License
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/News
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/ReadMe
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/ChangeLog
SetFile -t ttro -c ttxt ./DOSBox-0.74-2/Thanks
hdiutil create -ov -format UDZO -imagekey zlib-level=9 -fs HFS+ -srcfolder DOSBox-0.74-2 -volname "DOSBox 0.74-2" DOSBox-0.74-2.dmg || {
DIE=1
error_exit "$(( $LINENO -2 )) : disk image failed."
}

# copy app to applications and file the snapshots
#cp -R ./src/DOSBoxSVN.app /Applications/
cp -p DOSBox-0.74-2.dmg ~/Snapshots/dosbox/`date +%y-%m-%d-%H%M`DOSBox-0.74-2.dmg
mv DOSBox-0.74-2.dmg ~/Snapshots/dosbox/

#"upload"
cp -p ~/Snapshots/dosbox/DOSBox-0.74-2.dmg ~/dropbox/public/dosbox/

# cleanup
make -s distclean
rm -r DOSBox-0.74-2

if test "$DIE" -eq 1; then
exit 1
fi

and the intel64.diff:

--- ./Makefile 
+++ ./Makefile
139c139
< LIBS = -lSDL_sound -L/opt/x86_64/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lpng -lz -lSDL_net -framework OpenGL -framework CoreMIDI -framework AudioUnit -framework AudioToolbox
---
> LIBS = -L/opt/x86_64/lib /opt/x86_64/lib/libSDLmain.a /opt/x86_64/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit -framework CoreMIDI /opt/x86_64/lib/libpng.a /opt/x86_64/lib/libz.a /opt/x86_64/lib/libSDL_net.a /opt/x86_64/lib/libSDL_sound.a /opt/x86_64/lib/libogg.a /opt/x86_64/lib/libvorbis.a /opt/x86_64/lib/libvorbisfile.a /opt/x86_64/lib/libvorbisenc.a
155c155
< SDL_LIBS = -L/opt/x86_64/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
---
> SDL_LIBS = -L/opt/x86_64/lib /opt/x86_64/lib/libSDLmain.a /opt/x86_64/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit

--- ./src/Makefile
+++ ./src/Makefile
143c143
< LIBS = -lSDL_sound -L/opt/x86_64/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lpng -lz -lSDL_net -framework OpenGL -framework CoreMIDI -framework AudioUnit -framework AudioToolbox
---
> LIBS = -L/opt/x86_64/lib /opt/x86_64/lib/libSDLmain.a /opt/x86_64/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit -framework CoreMIDI /opt/x86_64/lib/libpng.a /opt/x86_64/lib/libz.a /opt/x86_64/lib/libSDL_net.a /opt/x86_64/lib/libSDL_sound.a /opt/x86_64/lib/libogg.a /opt/x86_64/lib/libvorbis.a /opt/x86_64/lib/libvorbisfile.a /opt/x86_64/lib/libvorbisenc.a
159c159
< SDL_LIBS = -L/opt/x86_64/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
---
> SDL_LIBS = -L/opt/x86_64/lib /opt/x86_64/lib/libSDLmain.a /opt/x86_64/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox

Reply 2 of 4, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

OK - thank you for that, and no need to send a reply to the private message! I think this tells me what I need to know. I'll try to figure out how to build the libraries, etc., for 64-bit architecture. For my project, I don't need to support anything older than 10.10, so I'll use your new diff.

Some holiday stress here too, but I'll find time to work on this after Christmas. Thank you again! And stay calm and cool!

Last edited by emendelson on 2018-12-23, 23:25. Edited 1 time in total.

Reply 4 of 4, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Here's what I've done:

1. I modified my one-stop script to build all the libraries, etc., with x86_64 architecture in a separate x86_64 folder

2. I modified your build script to use the folder names on my system, and I commented out the patch line because I'm not yet ready to build a static version.

3. I used your build script to build a 64-bit dynamic-linked version - but, once again, all the keyboard input is going into the terminal window!

There's no urgency about this - but if you remember how you got the keyboard input to go into the DOSBox window, I'll be very glad to know it!

But this probably for AFTER Weihnacht...