1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

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
This commit is contained in:
Alexey Dokuchaev 2023-07-04 05:41:52 +00:00
parent 1221158741
commit b5772e3fcc
2 changed files with 22 additions and 13 deletions

View File

@ -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/ { \

View File

@ -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')