Post clang switch, mednafen fails to link with:
/usr/bin/ld: debug.o: relocation R_X86_64_32S against `a local symbol' can not
be used when making a shared object; recompile with -fPIC
debug.o: could not read symbols: Bad value c++: error: linker command failed
with exit code 1 (use -v to see invocation)
Despite the fact that COMPILER=gcc is already set, it still picks
clang.
This patch seems to force gcc and results in a working link.
Tested on amd64.
OK?
Thanks,
Jeremy
Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/mednafen/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile 26 Jul 2017 22:45:19 -0000 1.18
+++ Makefile 31 Jul 2017 01:37:48 -0000
@@ -26,6 +26,8 @@ WANTLIB += FLAC ogg vorbis vorbisenc ${C
USE_GMAKE = Yes
COMPILER = gcc
+BUILD_DEPENDS = gcc-*:lang/gcc/4.9 g++-*:lang/gcc/4.9,-c++
+
LIB_DEPENDS = audio/libsndfile \
devel/sdl
@@ -35,6 +37,8 @@ USE_WXNEEDED = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ENV = CFLAGS="-I${LOCALBASE}/include
-I${LOCALBASE}/include/SDL" \
+ CC="${LOCALBASE}/bin/egcc" \
+ CXX="${LOCALBASE}/bin/eg++" \
LDFLAGS="-L${LOCALBASE}/lib -pthread"
CONFIGURE_ARGS = --disable-alsa \
--disable-rpath \