sci-mathematics/the-omega-project: respect LDFLAGS, build PIE

Closes: https://bugs.gentoo.org/807929
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri 2021-09-05 05:37:43 +02:00
parent c24bc27c8f
commit 1dc1bcfb73
No known key found for this signature in database
GPG Key ID: 4E4140121372C837
2 changed files with 21 additions and 2 deletions

View File

@ -32,7 +32,7 @@
-LIB_DESTDIR=$(DESTDIR)/lib
-BIN_DESTDIR=$(DESTDIR)/bin
+INCL_DESTDIR=$(DESTDIR)/usr/include/omega
+LIB_DESTDIR=$(DESTDIR)/usr/lib
+LIB_DESTDIR=$(DESTDIR)/usr/lib64
+BIN_DESTDIR=$(DESTDIR)/usr/bin
# This is only used if you modify the grammar file. Use bison if you have it.
@ -43,3 +43,22 @@
MAKEDEPEND=makedepend
-AR=ar
-
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -32,14 +32,14 @@
LIBS=$(REQ_LIBS) $(STD_LIBS) $(TARGET_LIBS) $(OS_LIBS) $(EXTRA_LIBS)
CFLAGS=$(STD_CFLAGS) $(OPTIMIZATION_CFLAGS) $(COMPILER_CFLAGS) $(OS_CFLAGS) $(TARGET_CFLAGS) $(INCL_PATH)
-LDFLAGS=$(STD_LDFLAGS) $(OPTIMIZATION_CFLAGS) $(TARGET_LDFLAGS) $(LIB_PATH) $(LIBS)
+LDFLAGS+=$(STD_LDFLAGS) $(OPTIMIZATION_CFLAGS) $(TARGET_LDFLAGS) $(LIB_PATH) $(LIBS)
ALLDIRS=omega_lib omega_calc petit uniform code_gen basic parse_lib
#ALLDIRS=omega_lib omega_calc petit code_gen basic
# Executable target; can have only one per directory
.executable: required_libs $(OBJS)
- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(TARGET)
+ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -fPIE -o $(TARGET)
touch .executable

View File

@ -45,7 +45,7 @@ src_prepare() {
use debug || append-cxxflags '-DNDEBUG'
use gui || append-cxxflags '-DBATCH_ONLY_PETIT'
tc-export CXX RANLIB
sed -e "s|/usr/lib|/usr/$(get_libdir)|g" -i Makefile.config || die
sed -e "s|/usr/lib64|/usr/$(get_libdir)|g" -i Makefile.config || die
}
src_compile() {