PATCH TO GET QUAKE3 SOURCE CODE TO COMPILE ON LINUX.

Building has been tested (and quake3-1.32b-linux.patch created)
on Slackware 9.0 Linux [gcc 3.2.2, glibc 2.3.1, Linux 2.4.30, GNU make 3.80,
nasm 0.98.36, XFree86 4.3.0], and should work with newer environment, too.

Here goes the (alternative, but verified) way of how to compile
Q3A from sources:

unzip quake3-1.32b-source.zip
cd quake3-1.32b/code/unix
patch -p0 < path/to/quake3-1.32b-linux.patch
make build_release

After building finishes, you'll find the binaries in ./releasei386-glibc

Optionally if you want to produce a ready-to-install tarball, do the following:

make tar

After this, you'll find a tarball with name of something like
"quake3-1.32b-1.i386.tar.gz" in ./archives directory.
To use it, you'd then only need to extract this tarball under your Q3A
installation prefix (original files will be overwritten).

--- ./Makefile.orig	2002-05-05 12:21:10.000000000 +0200
+++ ./Makefile	2005-08-20 17:27:00.000000000 +0200
@@ -25,7 +25,7 @@
 ###
 
 # Where we are building from (where the source code should be!)
-MOUNT_DIR=../
+MOUNT_DIR=..
 
 # Where we are building to, libMesaVoodooGL.so.3.3 should be here, etc.
 # the demo pk3 file should be here in demoq3/pak0.pk3 or baseq3/pak0.pk3
@@ -34,7 +34,7 @@
 
 # Build name
 # BUILD_NAME=$(BUILD_NAME)
-BUILD_NAME=quake3.x86
+BUILD_NAME=quake3
 
 
 
@@ -65,7 +65,7 @@
 SPLNDIR=$(MOUNT_DIR)/splines
 
 # extract version info
-VERSION=$(shell ./extract_ver.pl)
+VERSION=$(shell cat ../game/q_shared.h | grep Q3_VERSION | sed -e 's/.*Q3\ \(.*\)"/\1/')
 RPM_RELEASE=1
 
 # NOTE: used by dcp rcp targets, not referenced
@@ -146,7 +146,7 @@
 # TTimo: legacy RELEASE_CFLAGS
 # NOTE: the -fomit-frame-pointer option leads to an unstable binary on my test box if it was built on the main box
 #   but building on the Mdk 7.2 baseline seems to work
-      RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
+      RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce
 # TTimo: use this for building on P3 gcc 2.95.3 libc2.2 for all targets (experimental! -fomit-fram-pointer removed)
 #      RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
     endif
@@ -516,7 +516,7 @@
 	$(B)/client/unix_net.o \
 	$(B)/client/unix_shared.o \
 	\
-	$(B)/client/ahoptim.o  \
+#	$(B)/client/ahoptim.o  \
 	$(B)/client/autohint.o \
 	$(B)/client/ftbase.o   \
 	$(B)/client/ftdebug.o  \
@@ -577,6 +577,7 @@
 	Q3POBJ=\
 		$(B)/client/linux_common.o \
 		$(B)/client/linux_qgl.o \
+		$(B)/client/linux_signals.o \
 		$(B)/client/linux_glimp.o \
 		$(B)/client/linux_joystick.o \
 		$(B)/client/linux_snd.o \
@@ -586,6 +587,7 @@
 	Q3POBJ_SMP=\
 		$(B)/client/linux_common.o \
 		$(B)/client/linux_qgl.o \
+		$(B)/client/linux_signals.o \
 		$(B)/client/linux_glimp_smp.o \
 		$(B)/client/linux_joystick.o \
 		$(B)/client/linux_snd.o \
@@ -756,6 +758,7 @@
 $(B)/client/linux_glimp_smp.o : $(UDIR)/linux_glimp.c; $(DO_SMP_CC)  $(GL_CFLAGS) 
 $(B)/client/linux_joystick.o : $(UDIR)/linux_joystick.c; $(DO_CC)  
 $(B)/client/linux_qgl.o : $(UDIR)/linux_qgl.c; $(DO_CC)  $(GL_CFLAGS) 
+$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC)  $(GL_CFLAGS) 
 $(B)/client/linux_input.o : $(UDIR)/linux_input.c; $(DO_CC) 
 $(B)/client/linux_snd.o : $(UDIR)/linux_snd.c; $(DO_CC) 
 $(B)/client/snd_mixa.o : $(UDIR)/snd_mixa.s; $(DO_AS) 
@@ -909,6 +912,7 @@
 	$(B)/ded/l_struct.o \
 	\
 	$(B)/ded/linux_common.o \
+	$(B)/ded/linux_signals.o \
 	$(B)/ded/unix_main.o \
 	$(B)/ded/unix_net.o \
 	$(B)/ded/unix_shared.o \
@@ -985,6 +989,7 @@
 $(B)/ded/l_struct.o : $(BLIBDIR)/l_struct.c; $(DO_BOT_CC) 
 
 $(B)/ded/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC)
+$(B)/ded/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_DED_CC)
 $(B)/ded/unix_main.o : $(UDIR)/unix_main.c; $(DO_DED_CC) 
 $(B)/ded/unix_net.o : $(UDIR)/unix_net.c; $(DO_DED_CC) 
 $(B)/ded/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_DED_CC) 
@@ -1410,7 +1415,7 @@
 $(B)/baseq3/ui/ui_startserver.o : $(Q3UIDIR)/ui_startserver.c; $(DO_SHLIB_CC) 
 $(B)/baseq3/ui/ui_team.o : $(Q3UIDIR)/ui_team.c; $(DO_SHLIB_CC) 
 $(B)/baseq3/ui/ui_teamorders.o : $(Q3UIDIR)/ui_teamorders.c; $(DO_SHLIB_CC) 
-$(B)/baseq3/ui/ui_syscalls.o : $(Q3UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) 
+$(B)/baseq3/ui/ui_syscalls.o : $(UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) 
 $(B)/baseq3/ui/ui_video.o : $(Q3UIDIR)/ui_video.c; $(DO_SHLIB_CC) 
 
 # bk001205 - these wre the only SHLIB compiles in 1.17
@@ -2058,21 +2063,32 @@
 	mv $(RPMROOT)/RPMS/$(RPMARCH)/$(BUILD_NAME)-$(VERSION)-$(RPM_RELEASE).$(RPMARCH).rpm archives/$(BUILD_NAME)-$(VERSION)-$(RPM_RELEASE).$(RPMARCH).rpm 
 
 copyfiles:
-	-mkdirhier $(COPYDIR)
-	cp $(BR)/linuxquake3 $(COPYDIR)/quake3.x86
-	strip $(COPYDIR)/quake3.x86
-	chmod 755 $(COPYDIR)/quake3.x86
-	cp $(BR)/linuxq3ded $(COPYDIR)/q3ded
-	strip $(COPYDIR)/q3ded
-	chmod 755 $(COPYDIR)/q3ded
-	cp $(BDIR)/libMesaVoodooGL.so.3.2 $(COPYDIR)/.
-	chmod 755 $(COPYDIR)/libMesaVoodooGL.so.3.2
-	( cd $(COPYDIR); ln -s libMesaVoodooGL.so.3.2 libMesaVoodooGL.so )
-	cp $(BDIR)/Quake_III_Arena_FAQ.html $(COPYDIR)/.
-	chmod 644 $(COPYDIR)/Quake_III_Arena_FAQ.html
-	mkdir $(COPYDIR)/baseq3
-	cp $(BASEQ3_DIR)/pak2.pk3 $(COPYDIR)/baseq3/.
-	chmod 644 $(COPYDIR)/baseq3/pak2.pk3
+	-mkdir -p -m 0755 $(COPYDIR)
+	install -s -m 0755 $(BR)/linuxquake3 $(COPYDIR)/quake3.x86
+	install -s -m 0755 $(BR)/linuxquake3-smp $(COPYDIR)/quake3-smp.x86
+	install -s -m 0755 $(BR)/linuxq3ded $(COPYDIR)/q3ded
+	-mkdir -p -m 0755 $(COPYDIR)/baseq3
+	install -s -m 0755 $(BR)/baseq3/cgame$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/baseq3/.
+	install -s -m 0755 $(BR)/baseq3/qagame$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/baseq3/.
+	install -s -m 0755 $(BR)/baseq3/ui$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/baseq3/.
+	-mkdir -p -m 0755 $(COPYDIR)/missionpack
+	install -s -m 0755 $(BR)/missionpack/cgame$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/missionpack/.
+	install -s -m 0755 $(BR)/missionpack/qagame$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/missionpack/.
+	install -s -m 0755 $(BR)/missionpack/ui$(ARCH).$(SHLIBEXT) \
+		$(COPYDIR)/missionpack/.
+#	cp $(BDIR)/libMesaVoodooGL.so.3.2 $(COPYDIR)/.
+#	chmod 755 $(COPYDIR)/libMesaVoodooGL.so.3.2
+#	( cd $(COPYDIR); ln -s libMesaVoodooGL.so.3.2 libMesaVoodooGL.so )
+#	cp $(BDIR)/Quake_III_Arena_FAQ.html $(COPYDIR)/.
+#	chmod 644 $(COPYDIR)/Quake_III_Arena_FAQ.html
+#	mkdir $(COPYDIR)/baseq3
+#	cp $(BASEQ3_DIR)/pak2.pk3 $(COPYDIR)/baseq3/.
+#	chmod 644 $(COPYDIR)/baseq3/pak2.pk3
 
 $(BUILD_NAME).spec : $(UDIR)/$(BUILD_NAME).spec.sh Makefile
 	sh $< $(VERSION) $(RPM_RELEASE) $(ARCH) $(INSTALLDIR) > $@
--- ./linux_glimp.c.orig	2005-08-16 01:10:07.000000000 +0200
+++ ./linux_glimp.c	2005-08-20 15:52:35.000000000 +0200
@@ -63,6 +63,13 @@
 
 #include <GL/glx.h>
 
+/*
+ * Pointers to functions defined as types in earlier OpenGL versions:
+ */
+typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
+typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum target);
+
 #include <X11/keysym.h>
 #include <X11/cursorfont.h>
 
