diff options
author | joerg <joerg> | 2008-12-29 16:53:06 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-12-29 16:53:06 +0000 |
commit | 6121668f6e4ac289bb5a7fa507a238f230b4f049 (patch) | |
tree | b060d263a708e6a544e2271de0b9a6491ed48f67 /mk | |
parent | e790dcc67b6ebb6aa088a31a09c0a37623ef0e5f (diff) | |
download | pkgsrc-6121668f6e4ac289bb5a7fa507a238f230b4f049.tar.gz |
Improve AIX/XLC support:
- provide cpp wrapper using cc -E
- provide c++_r wrapper working like c++
- provide -rpath handling for cc
- fix some debug messages to provide the correct script name
Diffstat (limited to 'mk')
-rw-r--r-- | mk/compiler/xlc.mk | 22 | ||||
-rw-r--r-- | mk/wrapper/bsd.wrapper.mk | 7 | ||||
-rw-r--r-- | mk/wrapper/cmd-sink-aix-cc | 14 | ||||
-rw-r--r-- | mk/wrapper/cmd-sink-aix-xlc | 6 |
4 files changed, 40 insertions, 9 deletions
diff --git a/mk/compiler/xlc.mk b/mk/compiler/xlc.mk index 9cbaff10eba..2b4a483db73 100644 --- a/mk/compiler/xlc.mk +++ b/mk/compiler/xlc.mk @@ -1,4 +1,4 @@ -# $NetBSD: xlc.mk,v 1.19 2008/11/27 17:56:52 joerg Exp $ +# $NetBSD: xlc.mk,v 1.20 2008/12/29 16:53:06 joerg Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -71,6 +71,9 @@ LANGUAGES.xlc+= c _XLC_VARS+= CC _XLC_CC= ${_XLC_DIR}/bin/xlc _ALIASES.CC= cc xlc +_XLC_VARS+= CPP +_XLC_CPP= ${_XLC_DIR}/bin/cpp +PKG_CPP:= ${_XLC_CPP} CCPATH= ${XLCBASE}/bin/xlc PKG_CC:= ${_XLC_CC} .endif @@ -90,6 +93,14 @@ CC_RPATH= ${XLCBASE}/bin/xlc_r PKG_CC_R:= ${_XLC_CC_R} CC_R?= cc_r .endif +.if exists(${XLCBASE}/bin/xlc++_r) +_XLC_VARS+= CXX_R +_XLC_CXX_R= ${_XLC_DIR}/bin/xlc++_r +_ALIASES.CXX_R= c++_r xlc++_r +CXX_RPATH= ${XLCBASE}/bin/xlc++_r +PKG_CXX_R:= ${_XLC_CXX_R} +CXX_R?= c++_r +.endif _COMPILER_STRIP_VARS+= ${_XLC_VARS} _COMPILER_RPATH_FLAG= -Wl,-R _LINKER_RPATH_FLAG= -R @@ -119,6 +130,15 @@ _LANGUAGES.xlc+= ${LANGUAGES.xlc:M${_lang_}} PREPEND_PATH+= ${_XLC_DIR}/bin .endif +override-tools: ${_XLC_CPP} +${_XLC_CPP}: + ${RUN}${MKDIR} ${.TARGET:H} + ${RUN} \ + {${ECHO} '#!${TOOLS_SHELL}'; \ + ${ECHO} 'exec ${XLCBASE}/bin/xlc -E @$$@"'; \ + ) > ${.TARGET} + ${RUN}${CHMOD} +x ${.TARGET} + # Create compiler driver scripts in ${WRKDIR}. .for _var_ in ${_XLC_VARS} . if !target(${_XLC_${_var_}}) diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index 363e4eae64d..5d751fb58d5 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.wrapper.mk,v 1.80 2008/11/27 18:00:06 joerg Exp $ +# $NetBSD: bsd.wrapper.mk,v 1.81 2008/12/29 16:53:06 joerg Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -142,6 +142,8 @@ WRAPPEES+= LD .if !empty(PKGSRC_COMPILER:Mxlc) && ${OPSYS} == "AIX" CC_R?= ${_XLC_DIR}/bin/cc_r WRAPPEES+= CC_R +CXX_R?= ${_XLC_DIR}/bin/c++_r +WRAPPEES+= CXX_R .endif _WRAPPEE_UNIQUE_CMDS= # empty @@ -288,8 +290,9 @@ _WRAP_TRANSFORM.CPP= ${_WRAP_TRANSFORM.CC} .if !empty(PKGSRC_COMPILER:Mxlc) . if ${OPSYS} == "AIX" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc -_WRAP_CMD_SINK.CC_R= ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc +_WRAP_CMD_SINK.CC_R= ${_WRAP_CMD_SINK.CC} _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} +_WRAP_CMD_SINK.CXX_R= ${_WRAP_CMD_SINK.CC} . elif ${OPSYS} == "Darwin" _WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-darwin-xlc _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC} diff --git a/mk/wrapper/cmd-sink-aix-cc b/mk/wrapper/cmd-sink-aix-cc index 8dcb2679e8c..7d1923364a6 100644 --- a/mk/wrapper/cmd-sink-aix-cc +++ b/mk/wrapper/cmd-sink-aix-cc @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink-aix-cc,v 1.3 2008/11/14 14:04:12 joerg Exp $ +# $NetBSD: cmd-sink-aix-cc,v 1.4 2008/12/29 16:53:06 joerg Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -45,12 +45,12 @@ while ! queue_is_empty cmdbuf; do case $arg in -blibpath:*) orig_blibpath=${arg#-blibpath:} - $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" + $debug_log $wrapperlog " (cmd-sink-aix-cc) drop: $dir [setting orig_blibpath]" dynamic=yes ;; -Wl,-blibpath:*) orig_blibpath=${arg#-Wl,-blibpath:} - $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" + $debug_log $wrapperlog " (cmd-sink-aix-cc) drop: $dir [setting orig_blibpath]" dynamic=yes ;; ############################################################## @@ -74,6 +74,14 @@ while ! queue_is_empty cmdbuf; do $debug_log $wrapperlog " (cmd-sink-aix-cc) drop: $dir [adding to blibpath]" dynamic=yes ;; + -rpath) + pop_queue argbuf dir + case $blibpath in + "") blibpath="$dir" ;; + *) blibpath="$blibpath:$dir" ;; + esac + $debug_log $wrapperlog " (cmd-sink-aix-cc) drop: $dir [adding to blibpath]" + ;; *) . $buildcmd ;; diff --git a/mk/wrapper/cmd-sink-aix-xlc b/mk/wrapper/cmd-sink-aix-xlc index a0705904fbc..8288a814f2a 100644 --- a/mk/wrapper/cmd-sink-aix-xlc +++ b/mk/wrapper/cmd-sink-aix-xlc @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink-aix-xlc,v 1.7 2008/12/29 11:25:39 joerg Exp $ +# $NetBSD: cmd-sink-aix-xlc,v 1.8 2008/12/29 16:53:06 joerg Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -43,11 +43,11 @@ while ! queue_is_empty cmdbuf; do case $arg in -blibpath:*) orig_blibpath=${arg#-blibpath:} - $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" + $debug_log $wrapperlog " (cmd-sink-aix-xlc) drop: $dir [setting orig_blibpath]" ;; -Wl,-blibpath:*) orig_blibpath=${arg#-Wl,-blibpath:} - $debug_log $wrapperlog " (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]" + $debug_log $wrapperlog " (cmd-sink-aix-xlc) drop: $dir [setting orig_blibpath]" ;; ############################################################## # AIX xlC doesn't support -Wl,-rpath,* but accumulate them |