summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeri Harris <keri@gentoo.org>2020-07-22 09:07:44 +0200
committerKeri Harris <keri@gentoo.org>2020-07-22 09:12:55 +0200
commit785fbb939cba2dc8194e43b39c032949623a8d1f (patch)
tree377893e2fb05a35d3f89315777f7a9c760cb571d /dev-lang/cxprolog
parentmedia-libs/lv2: added missing dep to 1.18.0 (diff)
downloadgentoo-785fbb939cba2dc8194e43b39c032949623a8d1f.tar.gz
gentoo-785fbb939cba2dc8194e43b39c032949623a8d1f.tar.bz2
gentoo-785fbb939cba2dc8194e43b39c032949623a8d1f.zip
dev-lang/cxprolog: respect LDFLAGS
Package-Manager: Portage-2.3.103, Repoman-2.3.22 Signed-off-by: Keri Harris <keri@gentoo.org>
Diffstat (limited to 'dev-lang/cxprolog')
-rw-r--r--dev-lang/cxprolog/cxprolog-0.98.2.ebuild30
-rw-r--r--dev-lang/cxprolog/files/cxprolog-0.98.2-portage.patch77
2 files changed, 87 insertions, 20 deletions
diff --git a/dev-lang/cxprolog/cxprolog-0.98.2.ebuild b/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
index ca85e4badada..d1b773c84e51 100644
--- a/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
+++ b/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
@@ -44,25 +44,31 @@ src_prepare() {
}
src_compile() {
- local CXPROLOG_EXT_LIBS
+ local CX_EXT_DEFINES
+ local CX_EXT_CFLAGS
+ local CX_EXT_LDFLAGS
+ local CX_EXT_LIBS
if use readline; then
- append-cflags "-DUSE_READLINE"
- CXPROLOG_EXT_LIBS="$CXPROLOG_EXT_LIBS -lreadline"
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_READLINE"
+ CX_EXT_LIBS="$CX_EXT_LIBS -lreadline"
fi
if use java; then
local java_arch
use x86 && java_arch=i386
use amd64 && java_arch=amd64
- CXPROLOG_JVM="${JAVA_HOME}/jre/lib/${java_arch}/server"
- append-cflags "-DUSE_JAVA $(java-pkg_get-jni-cflags) -Wl,-rpath,${CXPROLOG_JVM}"
- CXPROLOG_EXT_LIBS="$CXPROLOG_EXT_LIBS -L${CXPROLOG_JVM} -ljvm -Wl,-rpath,${CXPROLOG_JVM}"
+ CX_JVM="${JAVA_HOME}/jre/lib/${java_arch}/server"
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_JAVA"
+ CX_EXT_CFLAGS="$CX_EXT_CFLAGS $(java-pkg_get-jni-cflags)"
+ CX_EXT_LDFLAGS="$CX_EXT_LDFLAGS -Wl,-rpath,${CX_JVM}"
+ CX_EXT_LIBS="$CX_EXT_LIBS -L${CX_JVM} -ljvm"
fi
if use wxwidgets; then
- append-cflags "-DUSE_WXWIDGETS $(${WX_CONFIG} --cflags)"
- CXPROLOG_EXT_LIBS="$CXPROLOG_EXT_LIBS $(${WX_CONFIG} --libs)"
+ CX_EXT_DEFINES="$CX_EXT_DEFINES -DUSE_WXWIDGETS"
+ CX_EXT_CFLAGS="$CX_EXT_CFLAGS $(${WX_CONFIG} --cflags)"
+ CX_EXT_LIBS="$CX_EXT_LIBS $(${WX_CONFIG} --libs)"
fi
emake lib \
@@ -71,8 +77,12 @@ src_compile() {
CC=$(tc-getCC) \
CPP=$(tc-getCXX) \
LD=$(tc-getLD) \
- CFLAGS="-g -Wall ${CFLAGS}" \
- EXT_LIBS="${CXPROLOG_EXT_LIBS}"
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ EXT_DEFINES="${CX_EXT_DEFINES}" \
+ EXT_CFLAGS="-Wall ${CX_EXT_CFLAGS}" \
+ EXT_LDFLAGS="${CX_EXT_LDFLAGS}" \
+ EXT_LIBS="${CX_EXT_LIBS}"
if use java; then
JAVA_SRC_DIR="${S}/lib/cxprolog/java"
diff --git a/dev-lang/cxprolog/files/cxprolog-0.98.2-portage.patch b/dev-lang/cxprolog/files/cxprolog-0.98.2-portage.patch
index ed9fb3864c69..32e22a0eb620 100644
--- a/dev-lang/cxprolog/files/cxprolog-0.98.2-portage.patch
+++ b/dev-lang/cxprolog/files/cxprolog-0.98.2-portage.patch
@@ -1,5 +1,5 @@
--- cxprolog-0.98.2.orig/Makefile 2016-09-17 20:33:35.000000000 +0200
-+++ cxprolog-0.98.2/Makefile 2020-07-18 18:18:02.605499273 +0200
++++ cxprolog-0.98.2/Makefile 2020-07-22 09:01:24.785919309 +0200
@@ -20,9 +20,9 @@
######################################################################
@@ -12,7 +12,41 @@
#
# Nothing more is required.
# This functionality is active by default.
-@@ -165,8 +165,7 @@
+@@ -83,6 +83,7 @@
+ EXT_OBJ_DIR := src/ext
+ EXT_CFLAGS :=
+ EXT_DEFINES :=
++EXT_LDFLAGS :=
+ EXT_LIBS :=
+ EXT_NAMES :=
+
+@@ -91,6 +92,7 @@
+ # EXT_OBJ_DIR := src/obj/ext
+ # EXT_CFLAGS := -I/usr/include
+ # EXT_DEFINES := -DUSE_X=2 -DCOMPASS=1
++# EXT_LDFLAGS := -Wl,--as-needed
+ # EXT_LIBS := -L/usr/lib -lcrypt
+ # EXT_NAMES := ext/file1 ext/file2
+ ##############################################################################
+@@ -121,6 +123,7 @@
+ CFLAGS := -Wall -Wextra -O1
+ ONLYCFLAGS := # -Wmissing-prototypes
+ DEFINES :=
++LDFLAGS :=
+ LIBS := -lm
+ OBJ_DIR := src/obj
+ TMP_DIR := /var/tmp/$(APP)
+@@ -157,16 +160,16 @@
+
+ ifeq ($(VERBOSE),y)
+ CFLAGS := -v $(CFLAGS)
+- LIBS := -v $(LIBS)
++ LDFLAGS := -v $(LDFLAGS)
+ endif
+
+ ZFLAGS := $(DEBUG) $(EXT_CFLAGS)
+ ZDEFINES := $(EXTRA) $(ZPREFIX) -DOS=$(OS) $(DEFINES) $(EXT_DEFINES)
++ZLDFLAGS := $(DEBUG) $(LDFLAGS) $(EXT_LDFLAGS)
ZLIBS := $(EXTRA) $(LIBS) $(EXT_LIBS)
ZPRE :=
@@ -22,31 +56,54 @@
ifneq ($(OS),MINGW32)
ifeq ($(shell if test -e "/usr/local/opt/readline"; then echo "y" ; fi),y)
ZDEFINES += -DUSE_READLINE=4 -I/usr/local/opt/readline/include
-@@ -329,7 +328,7 @@
+@@ -294,7 +297,7 @@
+ ##############################################################################
+
+ $(APP): $(OBJS)
+- $(CPP) -o $(TMP_DIR)/$(APP) $(OBJS) $(ZLIBS)
++ $(CPP) $(ZLDFLAGS) -o $(TMP_DIR)/$(APP) $(OBJS) $(ZLIBS)
+ ln -sf $(TMP_DIR)/$(APP) $(APP)
+ @$(ZPOST)
+
+@@ -319,32 +322,32 @@
+
+ ifeq ($(OS),MINGW32)
+ libcxprolog.a cxprolog.dll: $(OBJ_DIR) $(OBJS)
+- $(CPP) -shared -o cxprolog.dll $(OBJS) -Wl,--out-implib,libcxprolog.a $(ZLIBS)
++ $(CPP) $(ZLDFLAGS) -shared -o cxprolog.dll $(OBJS) -Wl,--out-implib,libcxprolog.a $(ZLIBS)
+
+ cxprolog_shared.exe: libcxprolog.a cxprolog.dll
+ ifeq ($(WXWIDGETS),y)
+- $(CPP) -o cxprolog_shared.exe -lmingw32 -L./ -lcxprolog
++ $(CPP) $(ZLDFLAGS) -o cxprolog_shared.exe -lmingw32 -L./ -lcxprolog
+ else
+- $(CPP) -o cxprolog_shared.exe -L./ -lcxprolog
++ $(CPP) $(ZLDFLAGS) -o cxprolog_shared.exe -L./ -lcxprolog
endif
cxprolog_testlib.exe: libcxprolog.a cxprolog.dll
- gcc -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
-+ $(CC) -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
- $(CPP) -enable-auto-import -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog
+- $(CPP) -enable-auto-import -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog
++ $(CC) $(ZFLAGS) -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
++ $(CPP) $(ZLDFLAGS) -enable-auto-import -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog
rm src/TestLib.o
-@@ -337,14 +336,14 @@
+ lib: libcxprolog.a cxprolog_shared.exe cxprolog_testlib.exe
else # Assume Unix
libcxprolog.so: $(OBJ_DIR) $(OBJS)
- $(CPP) -shared -o libcxprolog.so $(OBJS) -lc $(ZLIBS)
-+ $(CPP) -shared -Wl,-soname,libcxprolog.so -o libcxprolog.so $(filter-out src/obj/CxProlog.o,$(OBJS)) -lc $(ZLIBS)
++ $(CPP) $(ZLDFLAGS) -shared -Wl,-soname,libcxprolog.so -o libcxprolog.so $(filter-out src/obj/CxProlog.o,$(OBJS)) -lc $(ZLIBS)
cxprolog_shared: libcxprolog.so
- $(CPP) $(ZDEFINES) -o cxprolog_shared -L./ -lcxprolog
-+ $(CPP) $(ZDEFINES) -o cxprolog_shared src/obj/CxProlog.o -L./ -lcxprolog $(ZLIBS)
++ $(CPP) $(ZLDFLAGS) -o cxprolog_shared src/obj/CxProlog.o -L./ -lcxprolog $(ZLIBS)
cxprolog_testlib: libcxprolog.so
- gcc $(ZDEFINES) -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
- $(CPP) $(ZDEFINES) -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog
-+ $(CC) $(ZDEFINES) -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
-+ $(CPP) $(ZDEFINES) -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog $(ZLIBS)
++ $(CC) $(ZFLAGS) $(ZDEFINES) -DTESTLIB=1 -o src/TestLib.o -c src/TestLib.c
++ $(CPP) $(ZLDFLAGS) -o cxprolog_testlib src/TestLib.o -L./ -lcxprolog $(ZLIBS)
rm src/TestLib.o
lib: libcxprolog.so cxprolog_shared cxprolog_testlib