Trying to build .96 on Linux

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
kvh
Posts: 9
Joined: Sat Dec 25, 2004 8:10 pm

Trying to build .96 on Linux

Post by kvh »

It doesn't work, but it gets as far as the linking...

Code: Select all



1. mkdir zdoom-0.96src
2. cd zdoom-0.96src
3. unrar x ~/96src.rar
4. mkdir config
5. # Find config.sub and config.guess somewhere on your system.
  cp /usr/share/automake-1.8/config.sub config/
  cp /usr/share/automake-1.8/config.guess config/
6. sh bootstrap
7. # You should have a working configure
  ./configure
8. # You can try to make it now... you'll get errors...

#### Patches....
a. src/c_console.cpp

--- src/c_console.cpp.orig      2004-12-25 20:57:58.206853688 -0500
+++ src/c_console.cpp   2004-12-25 20:58:06.102653344 -0500
@@ -634,8 +634,8 @@
 //#endif
        }

-       I_PrintStr (outline, false);
-
+   /* 1st arg doesn't do anything in .96 */
+       I_PrintStr (0, outline, strlen(outline), false);
        AddToConsole (printlevel, outline);
        if (vidactive && screen && screen->Font)
        {


b. Add the strlwr function

--- src/thingdef.cpp.orig       2004-12-25 21:06:26.369601208 -0500
+++ src/thingdef.cpp    2004-12-25 21:14:29.018227464 -0500
@@ -447,6 +447,17 @@
 static const ActorProps *is_weaponprop (const char *str);
 static const ActorProps *is_weapondefprop (const char *str);

+char *strlwr(char *string)
+{
+   char *p = string;
+   while (*p)
+   {
+      *p = tolower(*p);
+      p++;
+   }
+   return string;
+}
+
 //==========================================================================
 //
 // Customizable attack functions which use actor parameters.


c. Remove included file

--- src/sound/i_sound.cpp.orig  2004-12-25 21:21:19.390841344 -0500
+++ src/sound/i_sound.cpp       2004-12-25 21:21:29.868248536 -0500
@@ -53,7 +53,7 @@
 #include <math.h>

 #include "fmodsound.h"
-#include "altsound.h"
+//#include "altsound.h"

 #include "m_swap.h"
 #include "stats.h"

d. remove virtual

--- src/sdl/hardware.h.orig     2004-12-25 21:22:39.249700952 -0500
+++ src/sdl/hardware.h  2004-12-25 21:22:51.937772072 -0500
@@ -48,7 +48,7 @@
        virtual DFrameBuffer *CreateFrameBuffer (int width, int height, bool fs, DFrameBuffer *old) = 0;

        virtual bool FullscreenChanged (bool fs) = 0;
-       virtual int GetModeCount () = 0;
+       int GetModeCount ();
        virtual void StartModeIterator (int bits) = 0;
        virtual bool NextMode (int *width, int *height) = 0;
 };


e. add bool Windowed

--- src/sdl/sdlvideo.cpp.orig   2004-12-25 21:24:11.975604472 -0500
+++ src/sdl/sdlvideo.cpp        2004-12-25 21:24:29.769899328 -0500
@@ -396,6 +396,7 @@
        if (NeedGammaUpdate)
        {
                NeedGammaUpdate = false;
+      bool Windowed = !IsFullscreen ();
                CalcGamma (Windowed || rgamma == 0.f ? Gamma : Gamma * rgamma, GammaTable[0]);
                CalcGamma (Windowed || ggamma == 0.f ? Gamma : Gamma * ggamma, GammaTable[1]);
                CalcGamma (Windowed || bgamma == 0.f ? Gamma : Gamma * bgamma, GammaTable[2]);

f. Add empty file
% touch src/sdl/i_altsound.cpp

And after all that....

Code: Select all

/usr/src/zdoom-0.96src/src/tempfiles.cpp:46: warning: the use of `tempnam' is dangerous, better use `mkstemp'
m_options.o(.text+0x1a9): In function `M_OptInit()':
/usr/src/zdoom-0.96src/src/m_options.cpp:935: undefined reference to `I_NextMode(int*, int*, bool*)'
m_options.o(.text+0x2655): In function `BuildModesList':
/usr/src/zdoom-0.96src/src/m_options.cpp:2270: undefined reference to `I_NextMode(int*, int*, bool*)'
m_options.o(.data+0x1bbc): In function `M_OptResponder(event_t*)':
/usr/src/zdoom-0.96src/src/m_options.cpp:1542: undefined reference to `snd_waterreverb'
m_options.o(.data+0x1c9c):/usr/src/zdoom-0.96src/src/m_options.cpp:1924: undefined reference to `snd_3d'
a_spectral.o(.data+0x5ac): In function `__static_initialization_and_destruction_0':
/usr/src/zdoom-0.96src/src/dobject.h:111: undefined reference to `A_Tracer2(AActor*)'
a_spectral.o(.data+0x5c0): In function `__static_initialization_and_destruction_0':
g_strife/a_spectral.cpp:181: undefined reference to `A_Tracer2(AActor*)'
a_spectral.o(.data+0x5d4): In function `__static_initialization_and_destruction_0':
/usr/src/zdoom-0.96src/src/dobject.h:111: undefined reference to `A_Tracer2(AActor*)'
a_spectral.o(.data+0x5e8):/usr/src/zdoom-0.96src/src/dobject.h:111: undefined reference to `A_Tracer2(AActor*)'
a_spectral.o(.data+0x5fc): In function `__static_initialization_and_destruction_0':
g_strife/a_spectral.cpp:181: undefined reference to `A_Tracer2(AActor*)'
i_music.o(.text+0x661): In function `I_RegisterSong(char const*, int, int)':
sound/i_music.cpp:295: undefined reference to `SPCSong::SPCSong(_IO_FILE*, int)'
collect2: ld returned 1 exit status
make[2]: *** [zdoom] Error 1
make[2]: Leaving directory `/mnt/disc1_part2/usr/src/zdoom-0.96src/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/disc1_part2/usr/src/zdoom-0.96src'
make: *** [all] Error 2
I don't really understand what the A_Tracer2 stuff is...


gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
Attachments
building-zdoom-0.96.txt
Text of above message
(4.67 KiB) Downloaded 26 times
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

I posted a patch in the thread about .95 (it still works in 96). Extract the tar.bz to a clean 96src directory, run patch -p0 < changes.diff, then run make (no need to configure or anything, the archive has its own makefile).
kvh
Posts: 9
Joined: Sat Dec 25, 2004 8:10 pm

Post by kvh »

Thanks! It compiled O.K. However, doesn't run.

usr/src/zdoom-0.96src)> ./zdoom -nomusic -nosound
Please select a game wad:
1. DOOM 2: Hell on Earth (doom2.wad)
2. DOOM Shareware (doom1.wad)
Which one? 1
adding zdoom.wad (134 lumps)
adding /mnt/part5/usr/share/games/doom/doom2.wad (2919 lumps)
CPU Speed: ~0.030288 MHz
CPU Vendor ID: AuthenticAMD
Name: AMD Duron(tm) processor
Family 6 (7), Model 7, Stepping 1
Features: MMX MMX+ SSE 3DNow! 3DNow!+
Resolution: 640 x 480
Segmentation fault


Also, tools/makewad is not compiled and zdoom.wad is not compiled. Although those were easy to do myself.

I get a lot of errors if I remove the -nosound
Setting ALSA (Advanced Linux Sound Architecture) output failed (error 1)
Got OSS (Open Sound System) output instead.
Setting ESD (Enlightenment Sound Daemon) output failed (error 1)
Got OSS (Open Sound System) output instead.
Setting OSS (Open Sound System) output failed (error 1)
Setting driver 0 failed (error 1)
Initialization succeeded
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

Thanks! It compiled O.K. However, doesn't run.
Hmm.. yes, I noticed this sometimes, too. I wasn't sure if it was just me, though. Run make clean, then build it again with 'OPTLEVEL=2 make".
Also, tools/makewad is not compiled and zdoom.wad is not compiled.
I haven't delved to deep into the new stuff added for .95/.96. Normally I'd just grab the zdoom.wad from the binary distro and use that. But it's nice to know there is that tool to do it automatically now. I'll work on that for my next patch.
I get a lot of errors if I remove the -nosound
That's odd. Do you have ALSA, ESD, or OSS support? The recent version of FMOD has problems with ALSA for me, but OSS works fine. I'll check into it.
rpeter
Posts: 150
Joined: Mon Jul 21, 2003 10:52 pm

Post by rpeter »

>CPU Speed: ~0.030288 MHz

Seems like ZDoom is like a bicycle. It crashes if it cannot run fast enough.
kvh
Posts: 9
Joined: Sat Dec 25, 2004 8:10 pm

Post by kvh »

Chris wrote: Hmm.. yes, I noticed this sometimes, too. I wasn't sure if it was just me, though. Run make clean, then build it again with 'OPTLEVEL=2 make".
That worked great. It actually works using -nosound -nomusic.

It locks up when using ./zdoom; something not correct with the sound....

Code: Select all

(/usr/src/zdoom-0.96src)> ./zdoom
Please select a game wad:
1. DOOM 2: Hell on Earth (doom2.wad)
2. DOOM Shareware (doom1.wad)
Which one? 1
 adding zdoom.wad (134 lumps)
 adding /mnt/part5/usr/share/games/doom/doom2.wad (2919 lumps)
CPU Speed: ~1300.628814 MHz
CPU Vendor ID: AuthenticAMD
  Name: AMD Duron(tm) processor
  Family 6 (7), Model 7, Stepping 1
  Features: MMX MMX+ SSE 3DNow! 3DNow!+
I_InitSound: Initializing FMOD
  Setting ALSA (Advanced Linux Sound Architecture) output succeeded
  Setting driver 0 succeeded
  Initialization succeeded
Resolution: 640 x 480
Init DOOM refresh subsystem.
Init miscellaneous info.
Init Playloop state.
Setting up sound.
S_Init
Checking network game status.
player 1 of 1 (1 nodes)
Quit                                                                            
I'm running KDE CVS on Gentoo's Linux.... ALSA with OSS compat.
User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

>CPU Speed: ~0.030288 MHz

Seems like ZDoom is like a bicycle. It crashes if it cannot run fast enough.
It's actually a timing problem. AFAIK, there is no sure-fire way to measure CPU speed in a multi-tasking environment (short of giving yourself real-time priority, but any user-level program that can do that should be deleted from existance). Most of the time it works well enough, but once in a while, as you see, it gets it wrong.
It locks up when using ./zdoom; something not correct with the sound....
What if you try setting +snd_output oss on the command line?
kvh
Posts: 9
Joined: Sat Dec 25, 2004 8:10 pm

Post by kvh »

Chris wrote: What if you try setting +snd_output oss on the command line?
That seems to fix the sound. :D

Another problem, fullscreen tries to above-sync my monitor :cry:
fullscreen works O.K. in prboom-2.3.1.

I'm currently using a windowed 1024 x 768.

The display is so dark...sign...maybe that's the wad or zdoom or my system...

Code: Select all

 adding /home/kvh/WADS/Cchest2.wad (616 lumps)
CPU Speed: ~1300.628650 MHz
CPU Vendor ID: AuthenticAMD
  Name: AMD Duron(tm) processor
  Family 6 (7), Model 7, Stepping 1
  Features: MMX MMX+ SSE 3DNow! 3DNow!+
I_InitSound: Initializing FMOD
  Setting OSS (Open Sound System) output succeeded
  Setting driver 0 succeeded
  Initialization succeeded
Resolution: 1024 x 768
Init DOOM refresh subsystem.
Patch installed
Init miscellaneous info.
Init Playloop state.
Setting up sound.
S_Init
Checking network game status.
player 1 of 1 (1 nodes)
Playing demo DEMO1
Cannot play non-ZDoom demos.
(They would go out of sync badly.)
Playing demo DEMO2
Cannot play non-ZDoom demos.
(They would go out of sync badly.)

User avatar
Chris
Posts: 2983
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

Another problem, fullscreen tries to above-sync my monitor
What do you mean by "above sync"? You mean use too high of a refresh rate? I'm not really sure how to fix that, since SDL handles the mode setting. You can try making sure your X config has the right refresh settings for your monitor (if you're not sure, a search on Google should yield helpful results). You can probably also modify X's config file to use a specific refresh rate for each mode.. just append a @<hz> to the mode in question in the Screen/Display subsection (usually near the bottom).
kvh
Posts: 9
Joined: Sat Dec 25, 2004 8:10 pm

Post by kvh »

Chris wrote:
Another problem, fullscreen tries to above-sync my monitor
What do you mean by "above sync"? You mean use too high of a refresh rate? I'm not really sure how to fix that, since SDL handles the mode setting. You can try making sure your X config has the right refresh settings for your monitor (if you're not sure, a search on Google should yield helpful results). You can probably also modify X's config file to use a specific refresh rate for each mode.. just append a @<hz> to the mode in question in the Screen/Display subsection (usually near the bottom).
I recompiled some stuff and now fullscreen works great. Thanks for the work. Now I can play Cchest2 like it was suppose to be played... :D
Post Reply

Return to “General”