From 4939ecc887f5a1f313e1f9f28d1a230b395d6150 Mon Sep 17 00:00:00 2001 From: jlam Date: Sat, 16 Aug 2003 08:33:31 +0000 Subject: Make the SunPro compilers look-and-feel a bit more like GCC, which is what pkgsrc basically assumes is present. We sanitize rpath arguments (buildlink2 already did this via sanitize-rpath, but we do it another way here) and we do something new: convert GCC's "-Werror" into the flag with corresponding functionality for the SunPro compiler (suggested in private email from salo). --- mk/buildlink3/bsd.buildlink3.mk | 21 ++++++++++++++++++--- mk/buildlink3/sunpro-cc-post-cache | 12 ++++++++++++ mk/buildlink3/sunpro-cc-post-logic | 30 ++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 mk/buildlink3/sunpro-cc-post-cache create mode 100644 mk/buildlink3/sunpro-cc-post-logic diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk index d916e9e6f14..ecfb92b9596 100644 --- a/mk/buildlink3/bsd.buildlink3.mk +++ b/mk/buildlink3/bsd.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink3.mk,v 1.1.2.1 2003/08/14 13:16:48 jlam Exp $ +# $NetBSD: bsd.buildlink3.mk,v 1.1.2.2 2003/08/16 08:33:31 jlam Exp $ # # Assume PKG_INSTALLATION_TYPE == "pkgviews". @@ -352,8 +352,6 @@ _BLNK_TRANSFORM+= r: # .if defined(_USE_RPATH) && empty(_USE_RPATH:M[yY][eE][sS]) _BLNK_TRANSFORM+= no-rpath -.elif defined(USE_SUNPRO) -_BLNK_TRANSFORM+= sanitize-rpath .endif # # Undo the protection for the directories that we allow to be specified @@ -492,6 +490,23 @@ _BLNK_WRAP_SETENV.SHLIBTOOL= # empty _BLNK_WRAPPER_SH.SHLIBTOOL= ${.CURDIR}/../../mk/buildlink3/libtool.sh _BLNK_WRAP_SANITIZE_PATH.SHLIBTOOL= # empty +.if defined(USE_SUNPRO) +_BLNK_WRAP_PRIVATE_PRE_CACHE.CC= ${_BLNK_WRAP_PRE_CACHE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.CC= ${BUILDLINK_DIR}/bin/.sunpro-cc-cache-add +_BLNK_WRAP_PRIVATE_CACHE.CC= ${BUILDLINK_DIR}/bin/.sunpro-cc-cache +_BLNK_WRAP_PRIVATE_POST_CACHE.CC= ${BUILDLINK_DIR}/bin/.sunpro-cc-post-cache +_BLNK_WRAP_POST_LOGIC.CC= ${BUILDLINK_DIR}/bin/.sunpro-cc-post-logic +# +# The SunPro C++ compiler wrapper shares cache information with the C +# compiler. +# +_BLNK_WRAP_PRIVATE_PRE_CACHE.CXX= ${_BLNK_WRAP_PRE_CACHE} +_BLNK_WRAP_PRIVATE_CACHE_ADD.CXX= ${BUILDLINK_DIR}/bin/.sunpro-cc-cache-add +_BLNK_WRAP_PRIVATE_CACHE.CXX= ${BUILDLINK_DIR}/bin/.sunpro-cc-cache +_BLNK_WRAP_PRIVATE_POST_CACHE.CXX= ${BUILDLINK_DIR}/bin/.sunpro-cc-post-cache +_BLNK_WRAP_POST_LOGIC.CXX= ${BUILDLINK_DIR}/bin/.sunpro-cc-post-logic +.endif # USE_SUNPRO + _BLNK_WRAP_PRIVATE_PRE_CACHE.LD= ${_BLNK_WRAP_PRE_CACHE} _BLNK_WRAP_PRIVATE_CACHE_ADD.LD= ${BUILDLINK_DIR}/bin/.ld-cache-add _BLNK_WRAP_PRIVATE_CACHE.LD= ${BUILDLINK_DIR}/bin/.ld-cache diff --git a/mk/buildlink3/sunpro-cc-post-cache b/mk/buildlink3/sunpro-cc-post-cache new file mode 100644 index 00000000000..67150374ef8 --- /dev/null +++ b/mk/buildlink3/sunpro-cc-post-cache @@ -0,0 +1,12 @@ +# $NetBSD: sunpro-cc-post-cache,v 1.1.2.1 2003/08/16 08:33:32 jlam Exp $ +# +# This file implements the default action of the "cc" private cache +# for the SunPro suite of compilers, and tells the wrapper to skip the +# common cache lookup for all GCC arguments that the SunPro compiler +# can't handle; they will instead by handled directly by +# sunpro-cc-post-logic. + +-W*) + skipcache=yes + ;; +esac diff --git a/mk/buildlink3/sunpro-cc-post-logic b/mk/buildlink3/sunpro-cc-post-logic new file mode 100644 index 00000000000..20f6d7205fe --- /dev/null +++ b/mk/buildlink3/sunpro-cc-post-logic @@ -0,0 +1,30 @@ +# $NetBSD: sunpro-cc-post-logic,v 1.1.2.1 2003/08/16 08:33:32 jlam Exp $ +# +# Silently accept some GCC compiler arguments by silently converting +# them to the SunPro compiler equivalents. This makes the SunPro +# compiler wrappers work with more software that seems to assume GCC +# nowadays. + +case $arg in +-Werror) + # "-errwarn" is the right way to convince the SunPro compiler + # to stop on compilation warnings. + # + arg="-errwarn" + addtoprivatecache=yes + ;; +-Wl,-R*) + # Directories for the runtime library search path are passed + # via simply "-R", not "-Wl,-R". + # + arg=`$echo "X$arg" | $Xsed -e "s|^-Wl,||g" -e "s|,| |g"` + addtoprivatecache=yes + ;; +-W*) + # In fact, SunPro compilers don't even understand any -W* + # arguments, so just silently ignore them all. + # + arg= + addtoprivatecache=yes + ;; +esac -- cgit v1.2.3