ports/quake2: Clenaup build script and patches
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
From fd08d90bb7ee8388a9e005bae23edcccbfc73dbb Mon Sep 17 00:00:00 2001
|
||||
From: Oskari Alaranta <[email protected]>
|
||||
Date: Sun, 10 Aug 2025 19:52:20 +0300
|
||||
Subject: [PATCH] add support for custom SDL path and add sound support
|
||||
|
||||
---
|
||||
Makefile | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8edbffa..de2f605 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
-SDL_CFLAGS = `sdl2-config --cflags`
|
||||
-SDL_LIBS = `sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
+SDL_CFLAGS = `$(SDL_PATH)sdl2-config --cflags`
|
||||
+SDL_LIBS = `$(SDL_PATH)sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
|
||||
MOUNT_DIR=.
|
||||
|
||||
@@ -124,7 +124,7 @@ QUAKE2_OBJS = \
|
||||
\
|
||||
$(BUILDDIR)/net/net_unix.o \
|
||||
\
|
||||
- $(BUILDDIR)/sound/snddma_null.o \
|
||||
+ $(BUILDDIR)/sound/snd_sdl.o \
|
||||
\
|
||||
$(BUILDDIR)/port_platform_unix.o
|
||||
|
||||
@@ -353,7 +353,7 @@ $(BUILDDIR)/client/vid_menu.o : $(OTHER_DIR)/vid_menu.c
|
||||
$(BUILDDIR)/client/vid_lib.o : $(OTHER_DIR)/vid_lib.c
|
||||
$(DO_CC)
|
||||
|
||||
-$(BUILDDIR)/client/snddma_null.o : $(NULL_DIR)/snddma_null.c
|
||||
+$(BUILDDIR)/client/snd_sdl.o : $(NULL_DIR)/snd_sdl.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/client/q_system.o : $(OTHER_DIR)/q_system.c
|
||||
@@ -368,7 +368,7 @@ $(BUILDDIR)/net/net_unix.o : $(NET_DIR)/net_unix.c
|
||||
$(BUILDDIR)/port_platform_unix.o : $(MOUNT_DIR)/port_platform_unix.c
|
||||
$(DO_CC)
|
||||
|
||||
-$(BUILDDIR)/sound/snddma_null.o : $(SOUND_DIR)/snddma_null.c
|
||||
+$(BUILDDIR)/sound/snd_sdl.o : $(SOUND_DIR)/snd_sdl.c
|
||||
$(DO_GL_SHLIB_CC)
|
||||
|
||||
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From e93c43f5c55e67cd3fb79bc890d698492cb5861d Mon Sep 17 00:00:00 2001
|
||||
From: Oskari Alaranta <[email protected]>
|
||||
Date: Mon, 13 Jul 2026 23:05:59 +0300
|
||||
Subject: [PATCH] cleanup-makefile-for-cross-compile
|
||||
|
||||
---
|
||||
Makefile | 16 +++++++++-------
|
||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8edbffa..88709bd 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
-SDL_CFLAGS = `sdl2-config --cflags`
|
||||
-SDL_LIBS = `sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
+SDL_CFLAGS = `$(SDL_PREFIX)sdl2-config --cflags`
|
||||
+SDL_LIBS = `$(SDL_PREFIX)sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
|
||||
MOUNT_DIR=.
|
||||
|
||||
@@ -28,10 +28,9 @@ RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -ffast-math -funroll-loops \
|
||||
|
||||
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
|
||||
LDFLAGS=-ldl -lm
|
||||
-XCFLAGS=-I/opt/X11/include
|
||||
+XCFLAGS=
|
||||
|
||||
-GLLDFLAGS=-L/usr/X11/lib -L/usr/local/lib \
|
||||
- $(SDL_LIBS) -lGL
|
||||
+GLLDFLAGS=$(SDL_LIBS) -lGL
|
||||
GLCFLAGS=$(SDL_CFLAGS)
|
||||
|
||||
SHLIBEXT=so
|
||||
@@ -124,7 +123,7 @@ QUAKE2_OBJS = \
|
||||
\
|
||||
$(BUILDDIR)/net/net_unix.o \
|
||||
\
|
||||
- $(BUILDDIR)/sound/snddma_null.o \
|
||||
+ $(BUILDDIR)/sound/snd_sdl.o \
|
||||
\
|
||||
$(BUILDDIR)/port_platform_unix.o
|
||||
|
||||
@@ -227,7 +226,7 @@ REF_GL_OBJS = \
|
||||
|
||||
|
||||
$(BUILDDIR)/quake2-soft : $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_SOFT_OBJS) $(REF_SOFT_SDL_OBJS)
|
||||
- $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_SOFT_OBJS) $(REF_SOFT_SDL_OBJS) $(LDFLAGS) $(GLLDFLAGS)
|
||||
+ $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_SOFT_OBJS) $(REF_SOFT_SDL_OBJS) $(LDFLAGS) $(SDL_LIBS)
|
||||
|
||||
$(BUILDDIR)/quake2-gl : $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_GL_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(GAME_OBJS) $(REF_GL_OBJS) $(LDFLAGS) $(GLLDFLAGS)
|
||||
@@ -368,6 +367,9 @@ $(BUILDDIR)/net/net_unix.o : $(NET_DIR)/net_unix.c
|
||||
$(BUILDDIR)/port_platform_unix.o : $(MOUNT_DIR)/port_platform_unix.c
|
||||
$(DO_CC)
|
||||
|
||||
+$(BUILDDIR)/sound/snd_sdl.o : $(SOUND_DIR)/snd_sdl.c
|
||||
+ $(DO_GL_SHLIB_CC)
|
||||
+
|
||||
$(BUILDDIR)/sound/snddma_null.o : $(SOUND_DIR)/snddma_null.c
|
||||
$(DO_GL_SHLIB_CC)
|
||||
|
||||
--
|
||||
2.55.0
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
From fbdf3e7c40c1de83a2361bb904d8dbd3464ccebd Mon Sep 17 00:00:00 2001
|
||||
From: Oskari Alaranta <[email protected]>
|
||||
Date: Sun, 10 Aug 2025 19:54:38 +0300
|
||||
Subject: [PATCH 2/2] fix socket creation
|
||||
|
||||
---
|
||||
net/net_unix.c | 10 +---------
|
||||
1 file changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/net/net_unix.c b/net/net_unix.c
|
||||
index a92e57c..f297dff 100644
|
||||
--- a/net/net_unix.c
|
||||
+++ b/net/net_unix.c
|
||||
@@ -451,24 +451,16 @@ int NET_Socket (char *net_interface, int port)
|
||||
qboolean _true = true;
|
||||
int i = 1;
|
||||
|
||||
- if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
||||
+ if ((newsocket = socket (PF_INET, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP)) == -1)
|
||||
{
|
||||
Com_Printf ("ERROR: UDP_OpenSocket: socket:", NET_ErrorString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
- // make it non-blocking
|
||||
- if (ioctl (newsocket, FIONBIO, &_true) == -1)
|
||||
- {
|
||||
- Com_Printf ("ERROR: UDP_OpenSocket: ioctl FIONBIO:%s\n", NET_ErrorString());
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
// make it broadcast capable
|
||||
if (setsockopt(newsocket, SOL_SOCKET, SO_BROADCAST, (char *)&i, sizeof(i)) == -1)
|
||||
{
|
||||
Com_Printf ("ERROR: UDP_OpenSocket: setsockopt SO_BROADCAST:%s\n", NET_ErrorString());
|
||||
- return 0;
|
||||
}
|
||||
|
||||
if (!net_interface || !net_interface[0] || !stricmp(net_interface, "localhost"))
|
||||
--
|
||||
2.50.1
|
||||
|
||||
Reference in New Issue
Block a user