[Midnightbsd-cvs] mports [24895] trunk/Mk/extensions/localbase.mk: add post

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Feb 2 17:32:30 EST 2019


Revision: 24895
          http://svnweb.midnightbsd.org/mports/?rev=24895
Author:   laffer1
Date:     2019-02-02 17:32:29 -0500 (Sat, 02 Feb 2019)
Log Message:
-----------
add post

Modified Paths:
--------------
    trunk/Mk/extensions/localbase.mk

Modified: trunk/Mk/extensions/localbase.mk
===================================================================
--- trunk/Mk/extensions/localbase.mk	2019-02-02 22:32:09 UTC (rev 24894)
+++ trunk/Mk/extensions/localbase.mk	2019-02-02 22:32:29 UTC (rev 24895)
@@ -3,15 +3,28 @@
 # handle enforcing localbase in path
 #
 # Feature:	localbase
-# Usage:	USES=localbase
-# Valid ARGS:	none
+# Usage:	USES=localbase or USES=localbase:args
+# Valid ARGS:	ldflags		Set LDFLAGS instead of LIBS
 #
 
 .if !defined(_INCLUDE_USES_LOCALBASE_MK)
 _INCLUDE_USES_LOCALBASE_MK=	yes
+_USES_POST+=	localbase
+.endif
 
-CPPFLAGS+=	-I${LOCALBASE}/include
-CFLAGS+=	-I${LOCALBASE}/include
-CXXFLAGS+=	-I${LOCALBASE}/include
+.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_LOCALBASE_POST_MK)
+_INCLUDE_USES_LOCALBASE_POST_MK=yes
+
+CPPFLAGS+=	-isystem ${LOCALBASE}/include
+CFLAGS+=	-isystem ${LOCALBASE}/include
+CXXFLAGS+=	-isystem ${LOCALBASE}/include
+.if ${localbase_ARGS:Mldflags}
 LDFLAGS+=	-L${LOCALBASE}/lib
+.else
+LIBS+=		-L${LOCALBASE}/lib
 .endif
+
+# Use CONFIGURE_ENV instead of CMAKE_ARGS because devel/cmake itself also needs
+# this, and CMAKE_ARGS is not used when bootstrapping CMake.
+CONFIGURE_ENV+=	CMAKE_PREFIX_PATH="${LOCALBASE}"
+.endif



More information about the Midnightbsd-cvs mailing list