summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoradam <adam>2010-11-03 18:05:05 +0000
committeradam <adam>2010-11-03 18:05:05 +0000
commit661b28e0723cc435b9097b851fef5c78fb66ed79 (patch)
tree59241501f34186a898d21d6eb3ba5a141e49c090 /mk
parent836a5b7851af9166404ac460f61c85250847f03f (diff)
downloadpkgsrc-661b28e0723cc435b9097b851fef5c78fb66ed79.tar.gz
* Use LOCALBASE instead of PREFIX for PCC and Clang compiler detection
(otherwise Makefiles with mk/compiler.mk included fall back to GCC). * Simplified compiler/clang.mk.
Diffstat (limited to 'mk')
-rw-r--r--mk/compiler/clang.mk36
-rw-r--r--mk/compiler/pcc.mk4
2 files changed, 15 insertions, 25 deletions
diff --git a/mk/compiler/clang.mk b/mk/compiler/clang.mk
index 2c58e8cf028..7c4026589ca 100644
--- a/mk/compiler/clang.mk
+++ b/mk/compiler/clang.mk
@@ -1,4 +1,4 @@
-# $NetBSD: clang.mk,v 1.2 2010/10/21 13:55:13 adam Exp $
+# $NetBSD: clang.mk,v 1.3 2010/11/03 18:05:05 adam Exp $
#
# This is the compiler definition for the clang compiler.
#
@@ -17,33 +17,23 @@ COMPILER_CLANG_MK= defined
.include "../../mk/bsd.prefs.mk"
-CLANGBASE?= ${PREFIX}
-
+CLANGBASE?= ${LOCALBASE}
LANGUAGES.clang= # empty
-_CLANG_DIR= ${CLANGBASE}/bin
-_CLANG_VARS= # empty
-
.if exists(${CLANGBASE}/bin/clang)
-LANGUAGES.clang+= c
-_CLANG_VARS+= CC
-_CLANG_CC= ${_CLANG_DIR}/clang
-_ALIASES.CC= cc gcc c89 c99
-CCPATH= ${_CLANG_DIR}/clang
-PKG_CC:= ${_CLANG_CC}
+LANGUAGES.clang+= c objc
+_COMPILER_STRIP_VARS+= CC
+CCPATH= ${CLANGBASE}/bin/clang
+PKG_CC:= ${CCPATH}
.endif
.if exists(${CLANGBASE}/bin/clang++)
LANGUAGES.clang+= c++
-_CLANG_VARS+= CXX
-_CLANG_CXX= ${_CLANG_DIR}/clang++
-_ALIASES.CXX= c++ g++
-CXXPATH= ${_CLANG_DIR}/clang++
-PKG_CXX:= ${_CLANG_CXX}
+_COMPILER_STRIP_VARS+= CXX
+CXXPATH= ${CLANGBASE}/bin/clang++
+PKG_CXX:= ${CXXPATH}
.endif
-_COMPILER_STRIP_VARS+= ${_CLANG_VARS}
-
# Mimic GCC behaviour by defaulting to C89
#.if !empty(USE_LANGUAGES:Mc99)
#_WRAP_EXTRA_ARGS.CC+= -std=gnu99
@@ -51,10 +41,6 @@ _COMPILER_STRIP_VARS+= ${_CLANG_VARS}
#_WRAP_EXTRA_ARGS.CC+= -std=gnu89
#.endif
-_LINKER_RPATH_FLAG= -rpath,
-
-_COMPILER_RPATH_FLAG= -Wl,-rpath,
-
.if exists(${CCPATH})
CC_VERSION_STRING!= ${CCPATH} -v 2>&1
CC_VERSION!= ${CCPATH} -dumpversion 2>&1
@@ -63,6 +49,10 @@ CC_VERSION_STRING?= ${CC_VERSION}
CC_VERSION?= clang
.endif
+_COMPILER_LD_FLAG= -Wl,
+_LINKER_RPATH_FLAG= -rpath
+_COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG},
+
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
# ones requested by the package in USE_LANGUAGES.
#
diff --git a/mk/compiler/pcc.mk b/mk/compiler/pcc.mk
index 1a814b526f8..c7fed7818b0 100644
--- a/mk/compiler/pcc.mk
+++ b/mk/compiler/pcc.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pcc.mk,v 1.2 2010/07/30 07:58:59 asau Exp $
+# $NetBSD: pcc.mk,v 1.3 2010/11/03 18:05:05 adam Exp $
#
# This is the compiler definition for the PCC compiler.
#
@@ -18,7 +18,7 @@ COMPILER_PCC_MK= defined
.include "../../mk/bsd.prefs.mk"
-PCCBASE?= ${PREFIX}
+PCCBASE?= ${LOCALBASE}
# common definitions
_COMPILER_TYPE.c= CC