Author Topic: DOSBox-x - infinite loop in configure/make  (Read 1445 times)

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
DOSBox-x - infinite loop in configure/make
« on: November 05, 2024, 10:22:02 am »
Hello all,
I'm having a real PITA trying to port DosBox-x under OS/2 with the latest tool (Gcc 9.2.0, the rest is up-to-date with ANPM netlabs repo).

I've issued the usual autoreconf and given a detailed configure script call with these options

./configure --prefix=/DosBox-x --enable-sdl2 --enable-force-menu-sdldraw --disable-sdlnet --disable-opengl --disable-alsatest --disable-alsa-midi --disable-libslirp --disable-x11

But then I notice that the created makefile contains a lot of calls to am<things> (which should be autotools) and starts configuring again, everytime restarting all the process with these starting lines

CDPATH="${ZSH_VERSION+.};" && cd . && /usr/bin/sh D:/Sviluppo/Sorgenti/dbox/dosb
ox/missing aclocal-1.16
 cd . && /usr/bin/sh D:/Sviluppo/Sorgenti/dbox/dosbox/missing automake-1.16 --fo
reign
CDPATH="${ZSH_VERSION+.};" && cd . && /usr/bin/sh D:/Sviluppo/Sorgenti/dbox/dosb
ox/missing autoconf
/usr/bin/sh ./config.status --recheck
running CONFIG_SHELL=/usr/bin/sh /usr/bin/sh ./configure --prefix=/DosBox-x --en
able-sdl2 --enable-force-menu-sdldraw --disable-sdlnet --disable-opengl --disabl
e-alsatest --disable-alsa-midi --disable-libslirp --disable-x11 CC=gcc.exe CFLAG
S=-O2 -g -DOS2 LDFLAGS=-Zomf -Zhigh-mem -Zmap -Zbin-files -Zargs-wild -Zargs-res
p LIBS=-lcx CPP=/usr/bin/cpp.exe CXX=gcc.exe CXXFLAGS=-O2 -g -DOS2 --no-create -
-no-recursion


What puzzles me is the continue reference (in bold) to config.status --recheck which starts again the configuration process. I'm searching in forums and other places but without any hint. I also tried to remove and force --recheck to disappear from the config* files and the created makefiles but without any result - it still keeps regenerating files which loops indefinitely.
Even trying to use bash instead of sh changes nothing.

I really can't understand what the problem may be - I remember in the past I got stuck on a similar issue with another project, but solved it modifying an already available makefile. Can't get a grip on this.

Mentore

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #1 on: November 05, 2024, 05:07:47 pm »
Better to edit configure.ac, about line 368 and remove the CXXFLAGS line, the -Zmt on the LDFLAGS line and add -Zomf -Zhigh-mem -Zbin-files there. There's also a hard dependency on sdl-net in configure.ac you might want to comment out.
Then run "bash autogen.sh" rather then sh autoreconf then try configure.
There's other emxism's in the source to watch out for as you go.

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #2 on: November 06, 2024, 08:01:25 am »
Better to edit configure.ac, about line 368 and remove the CXXFLAGS line, the -Zmt on the LDFLAGS line and add -Zomf -Zhigh-mem -Zbin-files there. There's also a hard dependency on sdl-net in configure.ac you might want to comment out.
Then run "bash autogen.sh" rather then sh autoreconf then try configure.
There's other emxism's in the source to watch out for as you go.

You're a wonderful source of information, Dave.
On a side note - I've ported RetroArch (!!!) and it's basically working. Have to include network support (it seems heavily bound to IPv6, though) and Qt tools (already started, but there are some differences in the needed files which I didn't understand).

But - it - WORKS.

Mentore

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #3 on: November 06, 2024, 12:02:46 pm »
Better to edit configure.ac, about line 368 and remove the CXXFLAGS line, the -Zmt on the LDFLAGS line and add -Zomf -Zhigh-mem -Zbin-files there. There's also a hard dependency on sdl-net in configure.ac you might want to comment out.
Then run "bash autogen.sh" rather then sh autoreconf then try configure.
There's other emxism's in the source to watch out for as you go.

OK, tried to modify it and no - still loops; make keeps calling configure. I'll have to delve deeper into this.
Mentore

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #4 on: November 06, 2024, 05:56:27 pm »
I usually start with simple configure arguments, in this case,
Code: [Select]
--prefix=/dosbox-x  --enable-sdl2  LDFLAGS="-Zomf -Zhigh-mem -lcx"

The -lcx is optional at this time.
The configure script does a good job of figuring out the environment and finishes. Often I do have to add more configure options but not here, at least yet.
Make fails in src/dos/dos_programs.c with a bunch of errors. I worked on this a bit a few weeks back and decided I didn't really have the skills to fix. There's old OS/2 code that needs sorting as some is EMXism's and other fixes needed.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #5 on: November 07, 2024, 06:25:13 am »
Hmm, revisited this and compared to DosBox, no EMXism's besides the -Zmt which is unneeded and ignored as kilbc is always muti-threaded. There's just various bad coding I think as DosBox compiles fine, DosBox-X is very strict with its flags and various of the OS/2 parts fail to compile.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #6 on: November 07, 2024, 07:03:01 am »
As an example. this code compiles fine with DosBox,
Code: [Select]
    FSINFO fsinfo;
    ULONG drivenumber = drive[0];
    if (drivenumber > 26) { // drive letter was lowercase
        drivenumber = drive[0] - 'a' + 1;
    }
    APIRET rc = DosQueryFSInfo(drivenumber, FSIL_VOLSER, &fsinfo, sizeof(FSINFO));
    if (rc == NO_ERROR) {
        bool cdrom = false;
Whereas with DosBox-x, the error is,
Code: [Select]
drive_cache.cpp: In member function 'void DOS_Drive_Cache::SetBaseDir(const char*, DOS_Drive*)':
drive_cache.cpp:159:32: error: cannot convert 'DOS_Drive' to 'ULONG' {aka 'long unsigned int'} in initialization
  159 |     ULONG drivenumber = drive[0];
      |                         ~~~~~~~^
      |                                |
      |                                DOS_Drive
drive_cache.cpp:161:32: error: no match for 'operator-' (operand types are 'DOS_Drive' and 'char')
  161 |         drivenumber = drive[0] - 'a' + 1;
      |                       ~~~~~~~~ ^ ~~~
      |                              |   |
      |                              |   char
      |                              DOS_Drive

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #7 on: November 07, 2024, 07:51:49 am »
As an example. this code compiles fine with DosBox,
Code: [Select]
    FSINFO fsinfo;
    ULONG drivenumber = drive[0];
    if (drivenumber > 26) { // drive letter was lowercase
        drivenumber = drive[0] - 'a' + 1;
    }
    APIRET rc = DosQueryFSInfo(drivenumber, FSIL_VOLSER, &fsinfo, sizeof(FSINFO));
    if (rc == NO_ERROR) {
        bool cdrom = false;
Whereas with DosBox-x, the error is,
Code: [Select]
drive_cache.cpp: In member function 'void DOS_Drive_Cache::SetBaseDir(const char*, DOS_Drive*)':
drive_cache.cpp:159:32: error: cannot convert 'DOS_Drive' to 'ULONG' {aka 'long unsigned int'} in initialization
  159 |     ULONG drivenumber = drive[0];
      |                         ~~~~~~~^
      |                                |
      |                                DOS_Drive
drive_cache.cpp:161:32: error: no match for 'operator-' (operand types are 'DOS_Drive' and 'char')
  161 |         drivenumber = drive[0] - 'a' + 1;
      |                       ~~~~~~~~ ^ ~~~
      |                              |   |
      |                              |   char
      |                              DOS_Drive

Thanks a million for all of these contributions on your side, Dave. It seems DosBox-x is not viable - too bad, but hey, I did try at least 8)
Now back to RetroArch. I'll try to delve deeper into the network part and see if I can go a little further than my first attempt (there are some interesting TLS libraries, I shall try them all).

Mentore

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 371
  • Karma: +29/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #8 on: November 07, 2024, 09:01:42 am »
In DOSBOX, drive is a char array, but on DOSBOX-X it seems to be a struct or object. So, there is some work to do.

Lars

  • Hero Member
  • *****
  • Posts: 1367
  • Karma: +70/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #9 on: November 07, 2024, 01:59:58 pm »
So why not like this:

bool cdrom = drive->isRemovable() ? true : false;

Because that is a method that the "DOS_Drive" class offers (should offer, it's a virtual method that needs to be filled "with life").
Then, you do not need all that other test nonsense to test for CDROM yes/no.
In the end, all that #ifdef'ed code is nonsense as "labellocal" is not used anywhere.
I think all the (outer) //Get Volume label #ifdef block can therefore go away.


« Last Edit: November 07, 2024, 04:09:13 pm by Lars »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5098
  • Karma: +117/-1
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #10 on: November 08, 2024, 04:33:16 am »
In DOSBOX, drive is a char array, but on DOSBOX-X it seems to be a struct or object. So, there is some work to do.

Yes, I should have looked at drives.h

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 371
  • Karma: +29/-0
    • View Profile
Re: DOSBox-x - infinite loop in configure/make
« Reply #11 on: November 08, 2024, 09:25:17 am »
In DOSBOX, drive is a char array, but on DOSBOX-X it seems to be a struct or object. So, there is some work to do.

Yes, I should have looked at drives.h
Sure. I already thought, it wouldn't be a straight compile, because of all the native GUI element DOSBOX-X has.