SOLVED - help editing SDL_config.h to get DOSbox working
#1
SOLVED - help editing SDL_config.h to get DOSbox working
so I was able to compile the latest dosbox 0.74-2 via this environment:



Code:
# needed beta/neko_gmp11-5.0.2-p1.tardist
# needed libFLAC from freeware
# final link line needs -lgen after dos/libdos.a 

export CC=gcc
export CXX=g++
export CFLAGS=" -g0 -O2 -mips4"
export CXXFLAGS="-g0 -O2 -mips4"
export CPPFLAGS="-I/usr/nekoware/include/SDL"
export LDFLAGS=""
export LD_LIBRARYN32_PATH=/usr/nekoware/lib
#export ac_ct_CXX=g++

./configure -prefix=/usr/local
gmake 

the issue is dosbox dies because (dummy) CDROM support isn't configured by default:


Code:
-bash-4.2$ ./dosbox
DOSBox version 0.74-2
Copyright 2002-2018 DOSBox Team, published under GNU GPL.
---
Exit to error: Can't init SDL SDL not built with cdrom support

-bash-4.2$ 

reading up on this issue via:

https://web.archive.org/web/201412152142...ox_on_irix

it appears I need to edit the SDL_config.h file to add dummy CDROM support, I've been trying multiple things, but I can't seem to figure out the right edits.  Here are a few I tried:


Code:
-bash-4.2$ grep dosbox /usr/nekoware/include/SDL/SDL_config.h
#define SDL_CDROM_DISABLED 0 /* # Disabled to compile dosbox */
/* #undef SDL_CDROM_DUMMY /* uncomment for dosbox */
#define SDL_CDROM_DUMMY 1 /* added for dosbox */
-bash-4.2$ 


Does anyone have an idea what I'm doing wrong?
(This post was last modified: 12-14-2018, 12:32 AM by gijoe77.)
gijoe77
Tezro

Posts: 469
Threads: 28
Joined: Jun 2018
Find Reply
11-30-2018, 02:07 AM
#2
RE: help editing SDL_config.h to get DOSbox working
ok so I got the gcc build working.  

https://imgur.com/eNpOAl2

I edited "src/gui/sdlmain.cpp" and changed:

Code:
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO | /*SDL_INIT_TIMER |*/ SDL_INIT_CDROM
to:

Code:
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO //| /*SDL_INIT_TIMER |*/ SDL_INIT_CDROM

It seems cdrom support works fine in dosbox, it was just not getting initialized in SDL, but I wasn't able to trace back the root cause of the problem.
one important note is that in the "dosbox-0.74-2.conf" file, the keyboard mapping is screwed up by default, I had to set

Code:
usescancodes=false


Now on to the MIPSpro build...
(This post was last modified: 12-01-2018, 05:39 PM by gijoe77.)
gijoe77
Tezro

Posts: 469
Threads: 28
Joined: Jun 2018
Find Reply
12-01-2018, 05:33 PM
#3
RE: help editing SDL_config.h to get DOSbox working
I'm having some problems with the MIPSpro build - I have to admit I don't have much C++ experience on IRIX, so this might be a very basic issue I hope.

Anyway here are my notes to  compile with MIPSpro:

Code:
-line 43 in src/cpu/cpu.cpp change "#define CPU_LOG(...)" to "#define CPU_LOG"
-line 33 in /include/ipx.h  change "#define LOG_IPX(...)" to "#define LOG_IPX"

-define and undefine __c99 in src/hardware/mame/emu.h:

 #include "dosbox.h"
 #if defined(_MSC_VER) && (_MSC_VER  <= 1500)
 #include <SDL.h>
 #else
-#if defined(__sgi)
-#define __c99
-#endif
 #include <stdint.h>
-#if defined(__sgi)
-#undef __c99
-#endif
 #endif
 #include <math.h>
 #include <float.h>
 #include <stdlib.h>
 #include <memory.h>

-after the #includes in src/dos/cdrom_image.cpp, add:
 #if defined(__sgi) || defined(_sgi_)
   long int lround(double x);
 #endif

I compiled using this env:

Code:
export CC=cc
export CXX=CC
export CFLAGS="-c99 -g0 -O2 -mips4"
export CXXFLAGS="-g0 -O2 -mips4"
export CPPFLAGS="-I/usr/nekoware/include/SDL"
export LDFLAGS=""
export LD_LIBRARYN32_PATH=/usr/nekoware/lib


./configure -prefix=/usr/local
gmake 

I also tried this:

Code:
export CC=cc
export CXX=CC
export CFLAGS="-c99 -g0 -O2 -mips4"
export CXXFLAGS="-g0 -woff all -O2 -mips4"
export CPPFLAGS="-I/usr/local/include -I/usr/nekoware/include"
export LDFLAGS=" -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -L/usr/freeware/lib32"
export LD_LIBRARYN32_PATH=/usr/local/lib:/usr/local/lib32:/usr/nekoware/lib:/usr/freeware/lib32

./configure -prefix=/usr/local
gmake 

both gave me a long list of link errors,  which I can't really make heads or tails out of:
Code:
gmake[3]: Entering directory '/usr/people/develop/dev/DOSbox/dosbox-0.74-2/src'
CC  -g0 -woff all -O2 -mips4   -L/usr/local/lib -L/usr/local/lib32 -L/usr/nekoware/lib -L/usr/Motif-2.1/lib32 -o dosbox dosbox.o  cpu/libcpu.a debug/libdebug.a dos/libdos.a -lgen fpu/libfpu.a -lm hardware/libhardware.a -lm gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -lSDL_sound  -L/usr/nekoware/lib -Wl,-rpath,/usr/nekoware/lib -lSDL -lpthread -lpng -lz -lSDL_net -lX11 -lGL
ld32: ERROR   33 : Unresolved text symbol "std::basic_istream<char,std::char_traits<char> >::_M_get_num(int&)" -- 1st referenced by cpu/libcpu.a(cpu.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<DOS_Drive*,std::allocator<DOS_Drive*> >::_M_insert_aux(DOS_Drive**,DOS_Drive *const&)" -- 1st referenced by dos/libdos.a(drives.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::__destroy_aux(CDROM_Interface_Image::Track*,CDROM_Interface_Image::Track*,__false_type)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "lround(double)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<CDROM_Interface_Image::Track,std::allocator<CDROM_Interface_Image::Track> >::_M_insert_aux(CDROM_Interface_Image::Track*,const CDROM_Interface_Image::Track&)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::operator>>(std::basic_istream<char,std::char_traits<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "__introsort_loop__3stdGPPQ2_15DOS_Drive_Cache9CFileInfoN21iPGRCPQ2_15DOS_Drive_Cache9CFileInfoT1_b" -- 1st referenced by dos/libdos.a(drive_cache.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "__final_insertion_sort__3stdGPPQ2_15DOS_Drive_Cache9CFileInfoT1PGRCPQ2_15DOS_Drive_Cache9CFileInfoT1_b" -- 1st referenced by dos/libdos.a(drive_cache.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "clear__Q2_3std55_List_base__pt__37_PGv_bQ2_3std22allocator__pt__6_PGv_bGv" -- 1st referenced by dos/libdos.a(dos_misc.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::__destroy_aux(std::basic_string<char,std::char_traits<char>,std::allocator<char> >*,std::basic_string<char,std::char_traits<char>,std::allocator<char> >*,__false_type)" -- 1st referenced by dos/libdos.a(dos_programs.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::basic_string<char,std::char_traits<char>,std::allocator<char> >::replace(char*,char*,const char*,const char*,std::forward_iterator_tag)" -- 1st referenced by dos/libdos.a(dos_programs.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_M_insert_aux(std::basic_string<char,std::char_traits<char>,std::allocator<char> >*,const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)" -- 1st referenced by dos/libdos.a(dos_programs.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "AddXorFrame<short>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "AddXorFrame<long>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "AddXorFrame<char>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "UnXorFrame<short>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "UnXorFrame<long>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "UnXorFrame<char>" -- 1st referenced by hardware/libhardware.a(hardware.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::basic_ostream<char,std::char_traits<char> >::_M_put_num(unsigned long)" -- 1st referenced by hardware/libhardware.a(sblaster.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::basic_ostream<char,std::char_traits<char> >::_M_put_num(long)" -- 1st referenced by hardware/libhardware.a(gus.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<CEvent*,std::allocator<CEvent*> >::_M_insert_aux(CEvent**,CEvent *const&)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<CButton*,std::allocator<CButton*> >::_M_insert_aux(CButton**,CButton *const&)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<CBindGroup*,std::allocator<CBindGroup*> >::_M_insert_aux(CBindGroup**,CBindGroup *const&)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<CHandlerEvent*,std::allocator<CHandlerEvent*> >::_M_insert_aux(CHandlerEvent**,CHandlerEvent *const&)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::_List_base<CBind*,std::allocator<CBind*> >::clear(void)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::list<CBind*,std::allocator<CBind*> >::remove(CBind *const&)" -- 1st referenced by gui/libgui.a(sdl_mapper.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::__uninitialized_copy_aux(const Value*,const Value*,Value*,__false_type)" -- 1st referenced by misc/libmisc.a(setup.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::getline(std::basic_istream<char,std::char_traits<char> >&,std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,char)" -- 1st referenced by misc/libmisc.a(setup.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::operator<<(std::basic_ostream<char,std::char_traits<char> >&,const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&)" -- 1st referenced by misc/libmisc.a(setup.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "_M_put_num__Q2_3std52basic_ostream__pt__31_cQ2_3std20char_traits__pt__2_cGb" -- 1st referenced by misc/libmisc.a(setup.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::_List_base<MessageBlock,std::allocator<MessageBlock> >::clear(void)" -- 1st referenced by misc/libmisc.a(messages.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::transform(char*,char*,char*,int (*)(int))" -- 1st referenced by misc/libmisc.a(support.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<void (*)(Program**),std::allocator<void (*)(Program**)> >::_M_insert_aux(void (**)(Program**),void (*const&)(Program**))" -- 1st referenced by misc/libmisc.a(programs.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::__destroy_aux(copysource*,copysource*,__false_type)" -- 1st referenced by shell/libshell.a(shell_cmds.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::basic_string<char,std::char_traits<char>,std::allocator<char> >::insert(char*,const char*,const char*,std::forward_iterator_tag)" -- 1st referenced by shell/libshell.a(shell_cmds.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "std::vector<copysource,std::allocator<copysource> >::_M_insert_aux(copysource*,const copysource&)" -- 1st referenced by shell/libshell.a(shell_cmds.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_1__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_5__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_6__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_7__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_8__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_2__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_3__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__27_XCQ2_5DBOPL9SynthModeL_1_0__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__28_XCQ2_5DBOPL9SynthModeL_2_11__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "BlockTemplate__pt__28_XCQ2_5DBOPL9SynthModeL_2_10__Q2_5DBOPL7ChannelGPQ2_5DBOPL4ChipUiPi_PQ2_5DBOPL7Channel" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "TemplateVolume__pt__32_XCQ3_5DBOPL8Operator5StateL_1_0__Q2_5DBOPL8OperatorGv_i" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "TemplateVolume__pt__32_XCQ3_5DBOPL8Operator5StateL_1_1__Q2_5DBOPL8OperatorGv_i" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "TemplateVolume__pt__32_XCQ3_5DBOPL8Operator5StateL_1_2__Q2_5DBOPL8OperatorGv_i" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "TemplateVolume__pt__32_XCQ3_5DBOPL8Operator5StateL_1_3__Q2_5DBOPL8OperatorGv_i" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol "TemplateVolume__pt__32_XCQ3_5DBOPL8Operator5StateL_1_4__Q2_5DBOPL8OperatorGv_i" -- 1st referenced by hardware/libhardware.a(dbopl.o).
        Use linker option -v to see when and which objects, archives and dsos are loaded.  
ld32: INFO    152: Output file removed because of error.
gmake[3]: *** [Makefile:407: dosbox] Error 2
gmake[3]: Leaving directory '/usr/people/develop/dev/DOSbox/dosbox-0.74-2/src'
gmake[2]: *** [Makefile:438: all-recursive] Error 1
gmake[2]: Leaving directory '/usr/people/develop/dev/DOSbox/dosbox-0.74-2/src'
gmake[1]: *** [Makefile:377: all-recursive] Error 1
gmake[1]: Leaving directory '/usr/people/develop/dev/DOSbox/dosbox-0.74-2'
gmake: *** [Makefile:318: all] Error 2
-bash-4.2$ 
anyone have any ideas?  I can't even figure out how to google this...
gijoe77
Tezro

Posts: 469
Threads: 28
Joined: Jun 2018
Find Reply
12-02-2018, 05:52 AM
#4
RE: SOLVED - help editing SDL_config.h to get DOSbox working
turns out the issue is the makefiles assume your using "ar cru" for lib archiving, the makefiles had to be edited manually with AR=CC and ARFLAGS="-ar -o"

The MIPSpro build doesn't actually work correctly, the dos command "mount" gets broken somehow, but I will play some more and create a new thread about when I do some more poking around
(This post was last modified: 12-14-2018, 12:36 AM by gijoe77.)
gijoe77
Tezro

Posts: 469
Threads: 28
Joined: Jun 2018
Find Reply
12-14-2018, 12:35 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)