r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: FreeBSD patches for r1q2
Pages: [1]
Print
Author Topic: FreeBSD patches for r1q2  (Read 6043 times)
ale
Member

Posts: 6


« on: April 27, 2007, 11:59:04 am »

Hello.

I have made a FreeBSD port of r1q2 (a long time ago).

The changes are here:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/games/r1q2/files/

Also I have changed "game$(ARCH)" into "game", because there are new
platforms being added and define different macros on each Unix
variation, so it's more portable this way. And it's not needed in my
opinion, but feel free to do what you want.

Would you like to integrate the patches (they are compatible with
Linux/Win32)?

Thanks and Best Regards,
Ale
Logged
R1CH
Administrator
Member

Posts: 2625



« Reply #1 on: April 27, 2007, 01:36:48 pm »

The multiple game.so loading can be useful in cases where an admin wants/needs to run mixed 32 bit and 64 bit servers, although I agree there are a lot of names, many of them are very platform specific (I've never seen a Sparc .so for example), and it's almost too late as every Linux server already has gamei386.so or similar, releasing an updated R1Q2 which breaks this scheme will likely result in a lot of angry admins Smiley.

Aside from that, the patches seem fine for inclusion, I'll try and get them merged by the next release. Sorry it's taken so long, I did have a look at them when you originally posted them but got sidetracked as usual Smiley
Logged
ale
Member

Posts: 6


« Reply #2 on: April 27, 2007, 11:52:03 pm »

Thank you.
Logged
turol
Member

Posts: 10


« Reply #3 on: April 30, 2007, 08:50:01 am »

binaries/client/Makefile
-LDFLAGS+=-lm -lz
+LDFLAGS+=-lm -lz $(PTHREAD_LIBS)

Why did you add this? Unnecessary libs are bad. If it's absolutely necessary, guard it with bsd-specific ifeq.

binaries/make.inc
same here about cflags and ldflags, please don't break the linux build

binaries/ref_gl/Makefile
-LDFLAGS+=$(shell sdl-config --libs) -lm -lGL -ljpeg -lpng12
+LDFLAGS+=$(shell sdl-config --libs) -lm -lGL -ljpeg -lpng

This might break linux build, haven't tested. Guard it.


linux/q_shlinux.c
Sys_DebugBreak should have something in it. R1CH?


qcommon/files.c
Are you sure this doesn't break anything?

Other than these it looks ok.
Logged
ale
Member

Posts: 6


« Reply #4 on: May 01, 2007, 11:27:18 pm »

binaries/client/Makefile
-LDFLAGS+=-lm -lz
+LDFLAGS+=-lm -lz $(PTHREAD_LIBS)

Why did you add this? Unnecessary libs are bad. If it's absolutely necessary, guard it with bsd-specific ifeq.

These are for -pthread (the variable is to maintain compatibility with FreeBSD 4.x, but it's unsupported since a few months). If it's not needed for Linux then just add the 'ifeq'.

binaries/make.inc
same here about cflags and ldflags, please don't break the linux build

This doesn't break the Linux build, it just adds "-I$(LOCALBASE)/include -I$(X11BASE)/include". They aren't required if everything is in the compiler's default search path, but there are systems (and maybe even Linux distributions) which have them in other locations. The only problem here is that LOCALBASE/X11BASE are undefined. So please add a:

LOCALBASE?=/usr/local
X11BASE?=/usr/X11R6

Or whatever values you consider more "general", since the "?=" is to allow overriding it from the environment. That's defined by the port by default.

binaries/ref_gl/Makefile
-LDFLAGS+=$(shell sdl-config --libs) -lm -lGL -ljpeg -lpng12
+LDFLAGS+=$(shell sdl-config --libs) -lm -lGL -ljpeg -lpng

This might break linux build, haven't tested. Guard it.

I never saw the PNG library installed as png12 in any application I ported, maybe it was detected or there is a symlink. This is not specific to Linux/FreeBSD but to OSes in general and Linux distributions (in fact to what their package management system considers better).

Please test it if you have time.

linux/q_shlinux.c
Sys_DebugBreak should have something in it. R1CH?

Maybe "abort()"? It would make the program dump the core so it can be debugged (or if inside the debugger, will stop). At least the signal is catched by a custom signal handler.

qcommon/files.c
Are you sure this doesn't break anything?

No, it just does the following:
* Adds DATADIR/<game> to the search path.
* Adds LIBDIR/<game> to the search path.
* Adds ~/.r1q2/<game> to the search path.
* Writes to ~/.r1q2/<game> (and creates it if doesn't exist) because it's the last added entry.

This is to keep a global binary/data that all users can access, but keeping their configuration and saved games in their homes. The use of 2 data directories is to respect FreeBSD's hierarchy and to share the Q2 data between all the engines, so Q2 data goes to DATADIR and R1Q2 specific data/libs to LIBDIR.

If you want you can keep only some parts of it, and the rest of them will be applied locally.

Now that I think of it, maybe this should be removed for Win32 with #ifndef _WIN32 or #ifdef __unix__, as it has everything on one directory.

Other than these it looks ok.

Thanks for the review. If you have more comments or questions, tell me.

Best Regards,
Ale
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: FreeBSD patches for r1q2
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines