- Switch to more correct way of avoiding C++11 related build errors

- Make upstream build system properly respect CXX/CXXFLAGS
- Add missing USES
This commit is contained in:
Dmitry Marakasov 2019-03-01 13:06:09 +00:00
parent 0069879e37
commit a8d9d3dcf5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=494293
2 changed files with 24 additions and 8 deletions

View file

@ -12,13 +12,11 @@ DISTNAME= ${PORTNAME}_${PORTVERSION}
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Navigate a mech through a 3D world and fire at enemies
USES= compiler gmake openal:al,alut
USES= gl gmake openal:al,alut sdl
USE_GL= gl glu
USE_SDL= sdl
LLD_UNSAFE= yes
CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}}
CFLAGS_clang= -Wno-c++11-narrowing
USE_CXXSTD= gnu++98
WRKSRC= ${WRKDIR}/${PORTNAME}

View file

@ -9,7 +9,7 @@
# Automatic searching for source files.
# Objects to compile are all sources (cpp) and put the .o below build-dir.
@@ -20,18 +20,17 @@ ifneq (,$(findstring Win,$(OS)))
@@ -20,40 +20,38 @@ ifneq (,$(findstring Win,$(OS)))
LIMITER=$(dir \file)
CFLAGS+= -static-libgcc
else
@ -29,12 +29,30 @@
-CFLAGS += -Wp,-M,-MP,-MT,$@,-MF,dep/$(subst /,-,$@).d
# Print warnings when compiling.
CFLAGS += -Wall
@@ -40,7 +39,6 @@ CFLAGS += -Wall
CFLAGS += $(INCLUDES)
-CFLAGS += -Wall
+CXXFLAGS += -Wall
# Use the given includepathes.
-CFLAGS += $(INCLUDES)
+CXXFLAGS += $(INCLUDES)
# Optimizations.
-CFLAGS += -O1 -funroll-loops
# Default makefile Target.
all: $(TARGET)
# For executable we need all sources compiled to objects.
$(TARGET): $(OBJECTS)
- $(CPP) -o $(TARGET) $(OBJECTS) $(LIBRARIES)
+ $(CXX) -o $(TARGET) $(OBJECTS) ${LDFLAGS} $(LIBRARIES)
# Compile all Source files, creates output directories as necessary.
build/%.o: %.cpp
$(shell $(MKDIR) build 2>/dev/null)
$(shell $(MKDIR) $(dir $@) 2>/dev/null)
- $(CPP) $(CFLAGS) -c $< -o $@
+ $(CXX) $(CXXFLAGS) -c $< -o $@
# IDE may call makefile with target "build" instead of "all".
build: all