VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Hello,

Back in December, I was able to create a portable build of SVN under OS X, by using the methods described in this message in another thread:

Dominus's instructions made it possible for me to build a portable copy of SVN under OS X. In case anyone wants to do the same t […]
Show full quote

Dominus's instructions made it possible for me to build a portable copy of SVN under OS X. In case anyone wants to do the same thing, here is a summary of the instructions, all in one place. Remember that all of this is Dominus's work; I've just put it all together in one message.

1. Install MacPorts from http://www.macports.org

2. To make this version of DOSBox portable, and if (like me) you don't need sdl_net or sdl_sound, then install these items only:

Code:
sudo port install libsdl +universal +no_x11
sudo port install libpng +universal
sudo port install pkgconfig +universal

3. Then use a script to automate the whole process of setting environment variables and editing the Makefiles to create a static-linked sdl:

Code:
#!/bin/sh

export CFLAGS='-I/opt/local/include -O2 -arch i386'
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export LDFLAGS='-L/opt/local/lib -O2 -arch i386'
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'

make clean
./autogen.sh
./configure

sed -i.old -e "s@-L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa@-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@g" -e "s@-lX11@ @g" Makefile

cd src

sed -i.old -e "s@-L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa@-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@g" -e "s@-lX11@ @g" Makefile

cd ..
make

The two sed commands perform the replacement in the Makefile that Dominus spelled out in another message.

Put this script in the "trunk" folder (or whatever you call the folder that contains the folders "src", "include", "docs", etc.) Make the script executable with the command chmod +x filename. In the terminal, navigate to the folder that contains the script, src, include, docs, etc, and run the script from the terminal to build DOSBox, which will be created in the src folder.

Today, when I tried the same method under OS X 10.6.7, using exactly the same source code that I used in December (I have a backup), nothing got built. I had exactly the same problem on another 10.6.7 system.

Has anything changed in OS X in the past five months that causes this failure? Is there anything else that needs to be changed in the EXPORT lines or anything else in these instructions?

Many thanks for any help,

Reply 1 of 44, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Nothing got built? So there should be an error message by make.
If there is, post it, if there isn't and it's compiling something, did you look in the src folder?

If there is an error, then only perform the steps to ./configure and post the output of configure.

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 2 of 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for offering to look at this problem. Nothing got built in the src folder. Here is the output of configure and make, as requested:

From configure:

configure: WARNING: png.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: png.h: proceeding with th […]
Show full quote

configure: WARNING: png.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: png.h: proceeding with the compiler's result
configure: WARNING: Can't find SDL_net, internal modem and ipx disabled
configure: WARNING: Can't find libSDL_sound, libSDL_sound support disabled

From make (the error messages displayed in the terminal only; full output posted in the link below):

make[4]: *** [hardware.o] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-re […]
Show full quote

make[4]: *** [hardware.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

And the full output from make (redirecting it to a file) is this 20KB file:

http://dl.dropbox.com/u/271144/makeoutput.txt

And here is the full output from the terminal when I run the script above (actually a copy of the script that changes the line "make" to "make > makeoutput.txt" and produced the text above):

http://dl.dropbox.com/u/271144/fullterminaloutput.txt

I tried changing the 4.2 strings in the export lines to 4.2.1, which is what seems to be current, but it didn't make any difference.

Thank you again for taking the trouble over this. I could only build my portable version thanks to your help last time.

Reply 4 of 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Make clean is one of the commands in the script I posted in the first message. It runs immediately after the EXPORT lines, and just before .autogen.sh.

Reply 5 of 44, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Hmm, its reporting darwin 10.7, did you play with Lion?
And can you use a totally clean source? Best check out SVN again.
Did you update xcode?
(osx 10.6.7 isn't responsible for this)

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

User metadata
Rank Oldbie
Rank
Oldbie

Weird! I haven't even seen Lion, and it never got near my disk.

But you're right about xcode, I think - I'm fairly certain I did update it.

I did try the portable build on clean SVN - same result. So it may be that xcode is at fault. I don't think I know how to revert it if that's what I need to do.

Reply 9 of 44, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

And btw, dosbox might compile and run without the flags being set. The dynamic core has been fixed on 64bit, quite a bit slower but if you don't need to run something that fast...

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 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for any help. Xcode says it's version 3.2.6 (1761). I updated it two months ago from 3.2.5.

And the full output from the terminal, with the command entered by hand, is here:

http://dl.dropbox.com/u/271144/fullcommandoutput.txt

Thank you again!

Reply 11 of 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

And btw, dosbox might compile and run without the flags being set. The dynamic core has been fixed on 64bit, quite a bit slower but if you don't need to run something that fast...

Speed is fairly important, because this will be used to run WordPerfect 6.x in its graphic mode, which is painfully slow

Reply 13 of 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Will try that when I get back to my Mac in a few hours. Will report.

Reply 14 of 44, by megatron-uk

User metadata
Rank l33t
Rank
l33t

Looks like you don't have libpng header files available on your system:

/usr/bin/g++-4.2 -arch i386 -DHAVE_CONFIG_H -I. -I../..  -I../../include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE  -O2 -mdynamic-no-pic -arch i386  -MT hardware.o -MD -MP -MF .deps/hardware.Tpo -c -o hardware.o hardware.cpp
hardware.cpp:35:17: error: png.h: No such file or directory
hardware.cpp: In function ‘void CAPTURE_AddImage(Bitu, Bitu, Bitu, Bitu, Bitu, float, Bit8u*, Bit8u*)’:
hardware.cpp:319: error: ‘png_structp’ was not declared in this scope
hardware.cpp:319: error: expected `;' before ‘png_ptr’
hardware.cpp:320: error: ‘png_infop’ was not declared in this scope
hardware.cpp:320: error: expected `;' before ‘info_ptr’
hardware.cpp:321: error: ‘png_color’ was not declared in this scope
hardware.cpp:321: error: expected `;' before ‘palette’
hardware.cpp:328: error: ‘png_ptr’ was not declared in this scope
hardware.cpp:328: error: ‘PNG_LIBPNG_VER_STRING’ was not declared in this scope
hardware.cpp:328: error: ‘png_create_write_struct’ was not declared in this scope
hardware.cpp:330: error: ‘info_ptr’ was not declared in this scope
hardware.cpp:330: error: ‘png_create_info_struct’ was not declared in this scope
hardware.cpp:332: error: ‘png_infopp’ was not declared in this scope
hardware.cpp:332: error: ‘png_destroy_write_struct’ was not declared in this scope
hardware.cpp:337: error: ‘png_init_io’ was not declared in this scope
hardware.cpp:338: error: ‘png_set_compression_level’ was not declared in this scope
hardware.cpp:341: error: ‘png_set_compression_mem_level’ was not declared in this scope
hardware.cpp:342: error: ‘png_set_compression_strategy’ was not declared in this scope
hardware.cpp:343: error: ‘png_set_compression_window_bits’ was not declared in this scope
hardware.cpp:344: error: ‘png_set_compression_method’ was not declared in this scope
hardware.cpp:345: error: ‘png_set_compression_buffer_size’ was not declared in this scope
hardware.cpp:349: error: ‘PNG_COLOR_TYPE_PALETTE’ was not declared in this scope
hardware.cpp:349: error: ‘PNG_INTERLACE_NONE’ was not declared in this scope
hardware.cpp:350: error: ‘PNG_COMPRESSION_TYPE_DEFAULT’ was not declared in this scope
hardware.cpp:350: error: ‘PNG_FILTER_TYPE_DEFAULT’ was not declared in this scope
hardware.cpp:350: error: ‘png_set_IHDR’ was not declared in this scope
hardware.cpp:352: error: ‘palette’ was not declared in this scope
hardware.cpp:356: error: ‘palette’ was not declared in this scope
hardware.cpp:356: error: ‘png_set_PLTE’ was not declared in this scope
hardware.cpp:358: error: ‘png_set_bgr’ was not declared in this scope
hardware.cpp:360: error: ‘PNG_COLOR_TYPE_RGB’ was not declared in this scope
hardware.cpp:360: error: ‘PNG_INTERLACE_NONE’ was not declared in this scope
hardware.cpp:361: error: ‘PNG_COMPRESSION_TYPE_DEFAULT’ was not declared in this scope
hardware.cpp:361: error: ‘PNG_FILTER_TYPE_DEFAULT’ was not declared in this scope
hardware.cpp:361: error: ‘png_set_IHDR’ was not declared in this scope
hardware.cpp:363: error: ‘png_write_info’ was not declared in this scope
hardware.cpp:434: error: ‘png_bytep’ was not declared in this scope
hardware.cpp:434: error: ‘png_write_row’ was not declared in this scope
hardware.cpp:437: error: ‘png_write_end’ was not declared in this scope
hardware.cpp:439: error: ‘png_destroy_write_struct’ was not declared in this scope
make[4]: *** [hardware.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

They should be installed as part of libpng - depending on where you got the libpng package from (if you even have it, on a new OS X system; possibly not).

Try a 'locate png.h' at the terminal to see if it's actually installed.

My collection database and technical wiki:
https://www.target-earth.net

Reply 15 of 44, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Macports should have provided that. And yes, even configure complains, AFAIK dosbox should compile without png, though...

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 16 of 44, by megatron-uk

User metadata
Rank l33t
Rank
l33t

Looking at hardware.cpp it seems to try and include png.h if C_SSHOT is defined:

#if (C_SSHOT)
#include <png.h>
#include "../libs/zmbv/zmbv.cpp"
#endif

So if that is getting defined somewhere, then it's not going to compile if that header is missing.

My collection database and technical wiki:
https://www.target-earth.net

Reply 17 of 44, by megatron-uk

User metadata
Rank l33t
Rank
l33t

It's in configure....

if test x$have_png_lib = xyes -a x$have_png_h = xyes ; then
LIBS="$LIBS -lpng -lz"
$as_echo "#define C_SSHOT 1" >>confdefs.h

else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find libpng, screenshot support disabled" >&5
$as_echo "$as_me: WARNING: Can't find libpng, screenshot support disabled" >&2;}
fi

It's picking up the installed libpng, defining C_SSHOT and then barfing when it tries to include png.h to build (I presume) screenshot functionality.

Either remove libpng (drastic!), undefine C_SSHOT in configure, or get a full package of libpng, including the development libs and header files.

My collection database and technical wiki:
https://www.target-earth.net

Reply 18 of 44, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for narrowing that down. I wonder if the problem could be that the compiler is looking at the wrong libpng. Here is the output from locate png.h:

/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentatio […]
Show full quote

/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools/Tcl/Tcllib/png.html
/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools/Tcl/TkImg/img-png.html
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/libpng12/png.h
/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/png.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/wx-2.8/wx/imagpng.h
/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/libpng12/png.h
/Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/png.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/wx-2.8/wx/imagpng.h
/Users/edward/Development/DOSBox2/libpng-1.2.37/include/png.h
/Users/edward/Development/DOSBox2/lpng142/contrib/gregbook/readpng.h
/Users/edward/Development/DOSBox2/lpng142/contrib/gregbook/writepng.h
/Users/edward/Development/DOSBox2/lpng142/png.h
/Users/edward/Development/ghostpdl-9.01/gs/libpng/contrib/gregbook/readpng.h
/Users/edward/Development/ghostpdl-9.01/gs/libpng/contrib/gregbook/writepng.h
/Users/edward/Development/ghostpdl-9.01/gs/libpng/png.h
/Volumes/Old OS X/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.DeveloperTools.docset/Contents/Resources/Documents/documentation/DeveloperTools/Tcl/TkImg/img-png.html
/Volumes/Old OS X/Developer/SDKs/MacOSX10.4u.sdk/usr/include/wx-2.5/wx/imagpng.h
/Volumes/Old OS X/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/libpng12/png.h
/Volumes/Old OS X/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include/png.h
/Volumes/Old OS X/Developer/SDKs/MacOSX10.5.sdk/usr/include/wx-2.8/wx/imagpng.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-8.71/gs/libpng/contrib/gregbook/readpng.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-8.71/gs/libpng/contrib/gregbook/writepng.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-8.71/gs/libpng/png.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-9.01/gs/libpng/contrib/gregbook/readpng.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-9.01/gs/libpng/contrib/gregbook/writepng.h
/Volumes/Old OS X/Users/edward/Development/ghostpdl-9.01/gs/libpng/png.h
/Volumes/Old OS X/usr/X11/include/libpng12/png.h
/Volumes/Old OS X/usr/X11/include/png.h
/Volumes/Old OS X/usr/include/wx-2.8/wx/imagpng.h
/opt/local/include/libpng14/png.h
/opt/local/include/png.h
/opt/local/var/macports/software/libpng/1.4.5_0+universal/opt/local/include/libpng14/png.h
/opt/local/var/macports/software/libpng/1.4.5_0+universal/opt/local/include/png.h
/opt/local/var/macports/software/libpng/1.4.7_0+universal/opt/local/include/libpng14/png.h
/opt/local/var/macports/software/libpng/1.4.7_0+universal/opt/local/include/png.h
/usr/X11/include/libpng12/png.h
/usr/X11/include/png.h
/usr/include/wx-2.8/wx/imagpng.h

I'm too much of a beginner to know which of these (if any) is the right one, and how to make the compiler look for it.

Again, many thanks for your help and expertise.

PS: The volume "Old OS X" has Leopard, which I use to build various other projects that need to work on 10.5 and above; I haven't been able to achieve that goal for some of these projects under 10.6.