Friday, May 26, 2017

games/ioquake3 with clang

Hi,

Allow games/ioquake3 to be compiled with clang by using libc's getopt instead
of an handrolled one, similar to what has been done yesterday by sthen@ on
net/trickle.

Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile 26 May 2017 09:02:28 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -1474,7 +1474,6 @@ Q3CPPOBJ = \
+ $(B)/tools/cpp/eval.o \
+ $(B)/tools/cpp/include.o \
+ $(B)/tools/cpp/hideset.o \
+- $(B)/tools/cpp/getopt.o \
+ $(B)/tools/cpp/unix.o
+
+ $(B)/tools/cpp/%.o: $(Q3CPPDIR)/%.c
Index: patches/patch-code_tools_lcc_cpp_unix_c
===================================================================
RCS file: patches/patch-code_tools_lcc_cpp_unix_c
diff -N patches/patch-code_tools_lcc_cpp_unix_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-code_tools_lcc_cpp_unix_c 26 May 2017 09:02:28 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Index: code/tools/lcc/cpp/unix.c
+--- code/tools/lcc/cpp/unix.c.orig
++++ code/tools/lcc/cpp/unix.c
+@@ -2,10 +2,10 @@
+ #include <stddef.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ #include "cpp.h"
+
+-extern int lcc_getopt(int, char *const *, const char *);
+ extern char *optarg, rcsid[];
+ extern int optind;
+ int verbose;
+@@ -24,7 +24,7 @@ setup(int argc, char **argv)
+ int numIncludeDirs = 0;
+
+ setup_kwtab();
+- while ((c = lcc_getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1)
++ while ((c = getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1)
+ switch (c) {
+ case 'N':
+ for (i=0; i<NINCLUDE; i++)

No comments:

Post a Comment