Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145725301
D7223.id18555.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D7223.id18555.diff
View Options
Index: Mk/bsd.gcc.mk
===================================================================
--- Mk/bsd.gcc.mk
+++ Mk/bsd.gcc.mk
@@ -17,6 +17,17 @@
# do so by specifying USE_GCC=X.Y+ which requests at least GCC version
# X.Y. To request a specific version omit the trailing + sign.
#
+# Optional comma-separated arguments may be specified after the version
+# specifier. The following arguments are supported:
+# build add gcc to BUILD_DEPENDS
+# run add gcc to RUN_DEPENDS
+# test add gcc to TEST_DEPENDS
+# if no arguments are specified, gcc is added to BUILD_DEPENDS, RUN_DEPENDS and
+# TEST_DEPENDS.
+#
+# USE_GCC=build, USE_GCC=run and USE_GCC=test are aliases to yes:build, yes:run
+# and yes:test, respectively.
+#
# Examples:
# USE_GCC= yes # port requires a current version of GCC
# # as defined in bsd.default-versions.mk.
@@ -23,7 +34,10 @@
# USE_GCC= any # port requires GCC 4.2 or later.
# USE_GCC= 4.9+ # port requires GCC 4.9 or later.
# USE_GCC= 4.9 # port requires GCC 4.9.
-#
+# USE_GCC= 4.9:build # port requires GCC 4.9 at build-time only.
+# USE_GCC= build # port requires a current version of GCC at
+# # build-time only.
+#
# If you are wondering what your port exactly does, use "make test-gcc"
# to see some debugging.
#
@@ -52,6 +66,42 @@
# No configurable parts below this. ####################################
#
+# Alias {build,run,test} -> yes:{build,run,test}
+.if ${USE_GCC} == build || ${USE_GCC} == run || ${USE_GCC} == test
+USE_GCC:= yes:${USE_GCC}
+.endif
+
+# Split args
+.if defined(USE_GCC)
+__USE_GCC:= ${USE_GCC:C/\:.*//}
+_USE_GCC_ARGS:= ${USE_GCC:C/^[^\:]*(\:|\$)//:S/,/ /g}
+USE_GCC= ${__USE_GCC}
+.endif # defined(USE_GCC)
+
+# Make sure that no dependency or some other environment variable
+# pollutes the build/run dependency detection
+.undef _USE_GCC_BUILD_DEP
+.undef _USE_GCC_RUN_DEP
+.undef _USE_GCC_TEST_DEP
+.if ${_USE_GCC_ARGS:Mbuild}
+_USE_GCC_BUILD_DEP= yes
+.endif
+.if ${_USE_GCC_ARGS:Mrun}
+_USE_GCC_RUN_DEP= yes
+.endif
+.if ${_USE_GCC_ARGS:Mtest}
+_USE_GCC_TEST_DEP= yes
+.endif
+
+# The port does not specify a build, run or test dependency, assume all are
+# required.
+.if !defined(_USE_GCC_BUILD_DEP) && !defined(_USE_GCC_RUN_DEP) && \
+ !defined(_USE_GCC_TEST_DEP) && !defined(USE_GCC_NO_DEPENDS)
+_USE_GCC_BUILD_DEP= yes
+_USE_GCC_RUN_DEP= yes
+_USE_GCC_TEST_DEP= yes
+.endif
+
.if defined(USE_GCC) && ${USE_GCC} == yes
USE_GCC= ${GCC_DEFAULT}+
.endif
@@ -173,8 +223,15 @@
.undef V
.if defined(_GCC_PORT_DEPENDS)
+. if defined(_USE_GCC_BUILD_DEP)
BUILD_DEPENDS+= ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT}
+. endif
+. if defined(_USE_GCC_RUN_DEP)
RUN_DEPENDS+= ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT}
+. endif
+. if defined(_USE_GCC_TEST_DEP)
+TEST_DEPENDS+= ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT}
+. endif
# Later GCC ports already depend on binutils; make sure whatever we
# build leverages this as well.
USE_BINUTILS= yes
@@ -188,11 +245,23 @@
@echo "IGNORE: ${IGNORE}"
.else
.if defined(USE_GCC)
+.if defined(_USE_GCC_ARGS)
+ @echo "ARGS: ${_USE_GCC_ARGS}"
+.endif
.if defined(_GCC_ORLATER)
@echo Port can use later versions.
.else
@echo Port cannot use later versions.
.endif
+.if defined(_USE_GCC_BUILD_DEP)
+ @echo ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT} will be added to BUILD_DEPENDS.
+.endif
+.if defined(_USE_GCC_RUN_DEP)
+ @echo ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT} will be added to RUN_DEPENDS.
+.endif
+.if defined(_USE_GCC_TEST_DEP)
+ @echo ${_GCC_PORT_DEPENDS}:lang/${_GCC_PORT} will be added to TEST_DEPENDS.
+.endif
.for v in ${GCCVERSIONS}
@echo -n "GCC version: ${_GCCVERSION_${v}_V} "
.if defined(_GCC_FOUND${v})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 24, 3:08 PM (4 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28975383
Default Alt Text
D7223.id18555.diff (3 KB)
Attached To
Mode
D7223: Mk/bsd.gcc.mk: add support for conditional dependencies for USE_GCC
Attached
Detach File
Event Timeline
Log In to Comment