diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2023-07-04 05:41:52 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2023-07-04 05:41:52 +0000 |
commit | b5772e3fcc106a71e3bfd49abbf73af151645647 (patch) | |
tree | 2cd186aec1a4c2ce590788ac4dba4258d43778c5 /games | |
parent | 12211587418acc86ccd9af4655a2d1fd8045281f (diff) | |
download | ports-b5772e3fcc106a71e3bfd49abbf73af151645647.tar.gz ports-b5772e3fcc106a71e3bfd49abbf73af151645647.zip |
games/gtkradiant: try to fix the port's build against Clang 16
Ancient `register' keyword is gone with C++17, drop it from various
places. Also, ISO C99 and later no longer tolerate implicit function
declarations, but the code in question is too convoluted and fragile
to fix properly, so just disable the warning for the time being.
While here, do not hardcode -O2 for release builds (system-provided
compilation flags being correctly upheld) and spell -Wextra correctly
(quoting the GCC docs*, this option used to be called -W; the older
name is still supported, but the newer name is more descriptive).
Reported by: pkg-fallout
*) https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wextra
Diffstat (limited to 'games')
-rw-r--r-- | games/gtkradiant/Makefile | 10 | ||||
-rw-r--r-- | games/gtkradiant/files/patch-SConstruct | 25 |
2 files changed, 22 insertions, 13 deletions
diff --git a/games/gtkradiant/Makefile b/games/gtkradiant/Makefile index 907426700916..3fb93b36f945 100644 --- a/games/gtkradiant/Makefile +++ b/games/gtkradiant/Makefile @@ -19,7 +19,7 @@ LIB_DEPENDS= libgtkglext-x11-1.0.so:x11-toolkits/gtkglext \ libpng.so:graphics/png USES= compiler:c++11-lang gnome pkgconfig python:build scons zip -USE_GNOME= gtk20 libxml2 +USE_GNOME= gdkpixbuf2 gtk20 libxml2 MAKE_ARGS= ${MAKE_ENV} BUILD=release SSP_UNSAFE= yes @@ -44,7 +44,13 @@ post-patch: ${WRKSRC}/radiant/patch.cpp \ ${WRKSRC}/radiant/watchbsp.cpp \ ${WRKSRC}/tools/quake3/common/inout.c -# Fix the build against Clang +# Fix the build against Clang and possibly other modern compilers + @${REINPLACE_CMD} -e 's,register ,,g' \ + ${WRKSRC}/libs/container/hashfunc.h \ + ${WRKSRC}/libs/jpeg6/jdcolor.cpp \ + ${WRKSRC}/libs/jpeg6/jdhuff.* \ + ${WRKSRC}/libs/jpeg6/jdsample.cpp \ + ${WRKSRC}/libs/jpeg6/jutils.cpp @${REINPLACE_CMD} -e '/#include "generic\/reference\.h"/x ; 318G' \ ${WRKSRC}/libs/scenelib.h @${REINPLACE_CMD} -e '/#include "generic\/referencecounted\.h/ { \ diff --git a/games/gtkradiant/files/patch-SConstruct b/games/gtkradiant/files/patch-SConstruct index 7484c3a34b55..1e8ca062178f 100644 --- a/games/gtkradiant/files/patch-SConstruct +++ b/games/gtkradiant/files/patch-SConstruct @@ -121,20 +121,23 @@ p = pickle.Pickler(site_file) p.dump(site_dict) site_file.close() -@@ -172,8 +166,8 @@ LINK = CXX +@@ -170,7 +164,7 @@ SetOption('num_jobs', JOBS) + + LINK = CXX # common flags - warningFlags = '-W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter ' +-warningFlags = '-W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter ' ++warningFlags = '-Wall -Wextra -Wcast-align -Wcast-qual -Wno-implicit-function-declaration -Wno-unused-parameter ' warningFlagsCXX = '-Wno-non-virtual-dtor -Wreorder ' # -Wold-style-cast --CCFLAGS = '' + warningFlags --CXXFLAGS = '-pipe -DQ_NO_STLPORT ' + warningFlags + warningFlagsCXX -+CCFLAGS += ' ' -+CXXFLAGS += ' -pipe -DQ_NO_STLPORT ' - CPPPATH = [] - if (BUILD == 'debug'): + CCFLAGS = '' + warningFlags + CXXFLAGS = '-pipe -DQ_NO_STLPORT ' + warningFlags + warningFlagsCXX +@@ -179,18 +173,17 @@ if (BUILD == 'debug'): CXXFLAGS += '-g -D_DEBUG ' -@@ -182,15 +176,14 @@ elif (BUILD == 'release'): - CXXFLAGS += '-O2 ' - CCFLAGS += '-O2 ' + CCFLAGS += '-g -D_DEBUG ' + elif (BUILD == 'release'): +- CXXFLAGS += '-O2 ' +- CCFLAGS += '-O2 ' ++ # uphold system-provided compilation flags ++ pass elif ( BUILD == 'info' ): - print 'Preparing OSX release' + print('Preparing OSX release') |