So, vlc gets too complicated.

The LIBCXX / LIBECXX thingy predates new COMPILER choice.

Now that it's there, after some thinking it's possible to do
things in a simpler way.

The following patch creates a variable that's correctly set for the 
current compiler in every case, unsurprisingly named (for now) 
COMPILER_LIBCXX.


Stuart had the radical idea that it should be even shorter, and replace
LIBCXX...  I pointed out that the transition period would be chaos.

The current plan is
- introduce that variable
- use it everywhere that it is possible to use it.
- see what's left of direct use of LIBCXX and LIBECXX (a few ports "inherit"
a C++ lib from other ports)
- rename things accordingly (iirr, the renaming would be
COMPILER_LIBCXX -> LIBCXX
LIBCXX -> LIBCXX_BASE
LIBECXX -> LIBCXX11)

This is hopefully the last turmoil.

It will get rid of one problematic development, namely that there is exactly
zero check that we have the right library on a clang arch... so having the
compiler choose correctly gets rid of that problem in most cases...

Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1352
diff -u -p -r1.1352 bsd.port.mk
--- bsd.port.mk 31 May 2017 08:08:16 -0000      1.1352
+++ bsd.port.mk 11 Jul 2017 17:02:07 -0000
@@ -302,6 +302,7 @@ _MODULES_DONE =
 .  include "${PORTSDIR}/infrastructure/mk/modules.port.mk"
 .endif
 
+COMPILER_LIBCXX ?= ${LIBCXX}
 ###
 ### Variable setup that can happen after modules
 ###
Index: compiler.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/compiler.port.mk,v
retrieving revision 1.1
diff -u -p -r1.1 compiler.port.mk
--- compiler.port.mk    31 May 2017 08:08:16 -0000      1.1
+++ compiler.port.mk    11 Jul 2017 17:02:07 -0000
@@ -67,3 +67,10 @@ CHOSEN_COMPILER = error
 .endfor
 # okay we went through, we didn't find anything
 CHOSEN_COMPILER ?= old
+.if $(CHOSEN_COMPILER) == "clang" || $(CHOSEN_COMPILER) == "gcc"
+.  if ${COMPILER_LANGS:Mc++}
+COMPILER_LIBCXX = ${LIBECXX}
+.  endif
+.endif
+
+

Reply via email to