mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 08:03:16 -04:00
games-action/blackvoxel: Remove hardcoded tools, set CXX, CC and AR.
Changes proposed upstream: <https://github.com/Blackvoxel/Blackvoxel/pull/35>. Closes: https://bugs.gentoo.org/787074 Signed-off-by: Ronny (tastytea) Gutbrod <gentoo@tastytea.de>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Copyright 2020 Gentoo Authors
|
||||
# Copyright 2020-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit desktop xdg
|
||||
inherit desktop toolchain-funcs xdg
|
||||
|
||||
DESCRIPTION="Blackvoxel Video Game"
|
||||
HOMEPAGE="https://www.blackvoxel.com/"
|
||||
@@ -32,6 +32,10 @@ PATCHES=(
|
||||
)
|
||||
|
||||
src_compile() {
|
||||
export CXX="$(tc-getCXX)"
|
||||
export CC="$(tc-getCC)"
|
||||
export AR="$(tc-getAR)"
|
||||
|
||||
emake blackvoxeldatadir="/usr/share/${PN}" bindir="/usr/bin"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,183 @@
|
||||
From a4fbc416e1c9884353f743f84ca98207f792b502 Mon Sep 17 00:00:00 2001
|
||||
From: tastytea <tastytea@tastytea.de>
|
||||
Date: Mon, 3 May 2021 02:26:12 +0200
|
||||
Subject: [PATCH] Don't overwrite build-flags, replace hardcoded tools with
|
||||
variables.
|
||||
|
||||
---
|
||||
Makefile | 29 ++++++++++++++---------------
|
||||
src/sc_Squirrel3/sq/Makefile | 8 ++++----
|
||||
src/sc_Squirrel3/sqstdlib/Makefile | 16 ++++++++--------
|
||||
src/sc_Squirrel3/squirrel/Makefile | 16 ++++++++--------
|
||||
4 files changed, 34 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 3fac7f3..a85dd7e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -11,7 +11,7 @@
|
||||
CC=g++
|
||||
LD=g++
|
||||
@@ -8,10 +8,9 @@ ifndef bindir
|
||||
endif
|
||||
|
||||
# Base options
|
||||
-CC=g++
|
||||
-LD=g++
|
||||
+CXX?=g++
|
||||
PROGNAME=blackvoxel
|
||||
-CFLAGS=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
|
||||
+CFLAGS+=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
|
||||
+CXXFLAGS+=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
|
||||
SRC= $(wildcard src/*.cpp) $(wildcard src/z/*.cpp)
|
||||
OBJ= $(SRC:src/%.cpp=obj/%.o)
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
@@ -19,8 +18,8 @@ OBJ= $(SRC:src/%.cpp=obj/%.o)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
CPU_BITS=32
|
||||
- CFLAGS+= -O3 -c -fmessage-length=0 -march=i686
|
||||
- LDFLAGS= -s -Xlinker --large-address-aware -mwindows -L"src/sc_Squirrel3/lib" -lmingw32 -lSDLmain -lSDL -llibglew32 -lglu32 -lopengl32 -llibglut -lsquirrel -lsqstdlib
|
||||
+ CXXFLAGS+= -O3 -c -fmessage-length=0 -march=i686
|
||||
+ LDFLAGS+= -s -Xlinker --large-address-aware -mwindows -L"src/sc_Squirrel3/lib" -lmingw32 -lSDLmain -lSDL -llibglew32 -lglu32 -lopengl32 -llibglut -lsquirrel -lsqstdlib
|
||||
else
|
||||
# Unix like operating systems
|
||||
CPU_BITS= $(shell getconf LONG_BIT)
|
||||
@@ -28,31 +27,31 @@ else
|
||||
KERNELNAME =$(shell uname -s)
|
||||
|
||||
ifeq ($(KERNELNAME),Linux)
|
||||
- CFLAGS+= -O3 -c -fmessage-length=0
|
||||
- LDFLAGS=-s -zrelro -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
+ LDFLAGS+= -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
+ CXXFLAGS+= -O3 -c -fmessage-length=0
|
||||
+ LDFLAGS+=-s -zrelro -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
else ifeq ($(KERNELNAME), FreeBSD)
|
||||
# To be done...
|
||||
CFLAGS+= -O3 -c -fmessage-length=0
|
||||
@@ -57,7 +56,7 @@
|
||||
- CFLAGS+= -O3 -c -fmessage-length=0
|
||||
- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
+ CXXFLAGS+= -O3 -c -fmessage-length=0
|
||||
+ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
else ifeq ($(KERNELNAME), Darwin)
|
||||
- CFLAGS+= -O3 -c -fmessage-length=0
|
||||
- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -L"/usr/local/Cellar/glew" -L"/usr/local/Cellar/sdl" -I"/usr/local/Cellar/glew" -I"/usr/local/Cellar/sdl" -framework Cocoa -framework OpenGL -lSDLmain -lSDL -lGLEW -lsquirrel -lsqstdlib
|
||||
+ CXXFLAGS+= -O3 -c -fmessage-length=0
|
||||
+ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -L"/usr/local/Cellar/glew" -L"/usr/local/Cellar/sdl" -I"/usr/local/Cellar/glew" -I"/usr/local/Cellar/sdl" -framework Cocoa -framework OpenGL -lSDLmain -lSDL -lGLEW -lsquirrel -lsqstdlib
|
||||
else
|
||||
# Unknow kernel... trying default flags
|
||||
- CFLAGS+= -O3 -c -fmessage-length=0
|
||||
- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
+ CXXFLAGS+= -O3 -c -fmessage-length=0
|
||||
+ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
squirrel:
|
||||
- cd src/sc_Squirrel3 ; make sq$(CPU_BITS)
|
||||
+ +make -C src/sc_Squirrel3 sq$(CPU_BITS)
|
||||
obj/%.o: src/%.cpp
|
||||
@mkdir -p obj/z
|
||||
- $(CC) -o $@ -c $< $(CFLAGS)
|
||||
+ $(CXX) -o $@ -c $< $(CXXFLAGS)
|
||||
|
||||
all: $(PROGNAME)
|
||||
|
||||
clean:
|
||||
@rm -rf obj
|
||||
$(PROGNAME): $(OBJ) squirrel
|
||||
- $(LD) -o $(PROGNAME) $(OBJ) $(LDFLAGS)
|
||||
+ $(CXX) -o $(PROGNAME) $(OBJ) $(LDFLAGS)
|
||||
|
||||
|
||||
|
||||
diff --git a/src/sc_Squirrel3/sq/Makefile b/src/sc_Squirrel3/sq/Makefile
|
||||
index c2cfc7e..08fb2ef 100644
|
||||
--- a/src/sc_Squirrel3/sq/Makefile
|
||||
+++ b/src/sc_Squirrel3/sq/Makefile
|
||||
@@ -12,16 +12,16 @@ SRCS= sq.c
|
||||
|
||||
|
||||
sq32:
|
||||
- g++ -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
+ $(CXX) -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
|
||||
sqprof:
|
||||
- g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
+ $(CXX) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
|
||||
sq64:
|
||||
- g++ -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
+ $(CXX) -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
|
||||
sq64d:
|
||||
- g++ -O0 -g3 -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
+ $(CXX) -O0 -g3 -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
diff --git a/src/sc_Squirrel3/sqstdlib/Makefile b/src/sc_Squirrel3/sqstdlib/Makefile
|
||||
index 643d7fc..41ee3f7 100644
|
||||
--- a/src/sc_Squirrel3/sqstdlib/Makefile
|
||||
+++ b/src/sc_Squirrel3/sqstdlib/Makefile
|
||||
@@ -26,23 +26,23 @@ SRCS= \
|
||||
|
||||
|
||||
sq32:
|
||||
- gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sqprof:
|
||||
- gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sq64:
|
||||
- gcc -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sq64d:
|
||||
- gcc -O0 -g3 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O0 -g3 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
diff --git a/src/sc_Squirrel3/squirrel/Makefile b/src/sc_Squirrel3/squirrel/Makefile
|
||||
index b03257b..be2c281 100644
|
||||
--- a/src/sc_Squirrel3/squirrel/Makefile
|
||||
+++ b/src/sc_Squirrel3/squirrel/Makefile
|
||||
@@ -37,23 +37,23 @@ SRCS= \
|
||||
|
||||
|
||||
sq32:
|
||||
- gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sqprof:
|
||||
- gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sq64:
|
||||
- gcc -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
rm *.o
|
||||
|
||||
sq64d:
|
||||
- gcc -O0 -g3 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
- ar rc $(OUT) *.o
|
||||
+ $(CC) -O0 -g3 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
|
||||
+ $(AR) rc $(OUT) *.o
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
--
|
||||
2.26.3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user