pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk added support for the SGI IDO (IRIX Development Opt...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bf6f52924e72
branches:  trunk
changeset: 501099:bf6f52924e72
user:      schwarz <schwarz%pkgsrc.org@localhost>
date:      Sun Oct 16 19:44:44 2005 +0000

description:
added support for the SGI IDO (IRIX Development Option) cc used by IRIX 5.3.
changes approved by jschauma and recht.

diffstat:

 mk/compiler.mk              |    5 +-
 mk/compiler/ido.mk          |   76 +++++++++++++++++++++++++++++++
 mk/wrapper/bsd.wrapper.mk   |   16 ++++++-
 mk/wrapper/transform-ido-cc |  105 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 199 insertions(+), 3 deletions(-)

diffs (252 lines):

diff -r 02ff2dd53752 -r bf6f52924e72 mk/compiler.mk
--- a/mk/compiler.mk    Sun Oct 16 19:38:05 2005 +0000
+++ b/mk/compiler.mk    Sun Oct 16 19:44:44 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.46 2005/02/16 08:41:20 grant Exp $
+# $NetBSD: compiler.mk,v 1.47 2005/10/16 19:44:44 schwarz Exp $
 #
 # This Makefile fragment implements handling for supported C/C++/Fortran
 # compilers.
@@ -15,6 +15,7 @@
 #              distcc          distributed C/C++ (chainable)
 #              f2c             Fortran 77 to C compiler (chainable)
 #              icc             Intel C++ Compiler (Linux)
+#              ido             SGI IRIS Development Option cc (IRIX 5)
 #              gcc             GNU
 #              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
 #              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
@@ -82,7 +83,7 @@
 _USE_PKGSRC_GCC=       yes
 .endif
 
-_COMPILERS=            ccc gcc icc mipspro mipspro-ucode sunpro xlc
+_COMPILERS=            ccc gcc icc ido mipspro mipspro-ucode sunpro xlc
 _PSEUDO_COMPILERS=     ccache distcc f2c
 
 .if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
diff -r 02ff2dd53752 -r bf6f52924e72 mk/compiler/ido.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/compiler/ido.mk        Sun Oct 16 19:44:44 2005 +0000
@@ -0,0 +1,76 @@
+.if !defined(COMPILER_IDO_MK)
+COMPILER_IDO_MK=       defined
+
+.include "../../mk/bsd.prefs.mk"
+
+IDOBASE?=      /usr
+
+# LANGUAGES.<compiler> is the list of supported languages by the
+# compiler.
+#
+LANGUAGES.ido=         # empty
+
+_IDO_DIR=              ${WRKDIR}/.ido
+_IDO_VARS=             # empty
+.if exists(${IDOBASE}/bin/cc)
+LANGUAGES.ido+=                c
+_IDO_VARS+=            CC
+_IDO_CC=               ${_IDO_DIR}/bin/cc
+_ALIASES.CC=           cc
+CCPATH=                        ${IDOBASE}/bin/cc
+PKG_CC:=               ${_IDO_CC}
+.endif
+_COMPILER_STRIP_VARS+= ${_IDO_VARS}
+
+CC_VERSION?=           ${LOWER_OPSYS} ido cc
+
+# IDO linker option used to set the rpath.
+_LINKER_RPATH_FLAG=    -rpath
+
+# IDO passes rpath directives to the linker using "-Wl,-rpath,".
+_COMPILER_RPATH_FLAG=  -Wl,${_LINKER_RPATH_FLAG},
+
+# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
+# ones requested by the package in USE_LANGUAGES.
+# 
+_LANGUAGES.ido=                # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.ido+=       ${LANGUAGES.ido:M${_lang_}}
+.endfor
+
+# Prepend the path to the compiler to the PATH.
+.if !empty(_LANGUAGES.ido)
+PREPEND_PATH+= ${_IDO_DIR}/bin
+.endif
+
+# Create compiler driver scripts in ${WRKDIR}.
+.for _var_ in ${_IDO_VARS}
+.  if !target(${_IDO_${_var_}})
+override-tools: ${_IDO_${_var_}}        
+${_IDO_${_var_}}:
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       (${ECHO} '#!${TOOLS_SHELL}';                                    \
+        ${ECHO} 'exec ${IDOBASE}/bin/${.TARGET:T} "$$@"';              \
+       ) > ${.TARGET}
+       ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+.    for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       if [ ! -x "${_alias_}" ]; then                                  \
+               ${LN} -f ${.TARGET} ${_alias_};                         \
+       fi
+.    endfor
+.  endif
+.endfor
+
+# Force the use of f2c-f77 for compiling Fortran.
+_IDO_USE_F2C=  no
+FCPATH=                        /nonexistent
+.if !exists(${FCPATH})
+_IDO_USE_F2C=  yes
+.endif
+.if !empty(_IDO_USE_F2C:M[yY][eE][sS])
+.  include "../../mk/compiler/f2c.mk"
+.endif
+
+.endif # COMPILER_IDO_MK
diff -r 02ff2dd53752 -r bf6f52924e72 mk/wrapper/bsd.wrapper.mk
--- a/mk/wrapper/bsd.wrapper.mk Sun Oct 16 19:38:05 2005 +0000
+++ b/mk/wrapper/bsd.wrapper.mk Sun Oct 16 19:44:44 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.37 2005/08/20 14:37:53 grant Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.38 2005/10/16 19:44:44 schwarz Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -255,6 +255,14 @@
 _WRAP_TRANSFORM.CXX=   ${_WRAP_TRANSFORM.CC}
 .endif
 
+.if !empty(PKGSRC_COMPILER:Mido)
+_WRAP_CACHE_BODY.CC=    ${WRAPPER_TMPDIR}/cache-body-ido-cc
+_WRAP_TRANSFORM.CC=     ${WRAPPER_TMPDIR}/transform-ido-cc
+# enable C++ style (//) commments with the IDO cc
+# just in case increase the optimization threshold from the default 1000
+_WRAP_EXTRA_ARGS.CC+=  -Xcpluscomm -Olimit 6000
+.endif
+
 .if !empty(PKGSRC_COMPILER:Msunpro)
 _WRAP_ARG_PP.CXX=      ${WRAPPER_TMPDIR}/arg-pp-sunpro-cxx
 _WRAP_CMD_SINK.CXX=    ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx
@@ -576,6 +584,12 @@
        ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC}                    \
                | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
 
+${WRAPPER_TMPDIR}/transform-ido-cc:                                    \
+               ${WRAPPER_SRCDIR}/transform-ido-cc
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC}                    \
+               | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
 ${WRAPPER_TMPDIR}/transform-sunpro-cc:                                 \
                ${WRAPPER_SRCDIR}/transform-sunpro-cc
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
diff -r 02ff2dd53752 -r bf6f52924e72 mk/wrapper/transform-ido-cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/wrapper/transform-ido-cc       Sun Oct 16 19:44:44 2005 +0000
@@ -0,0 +1,105 @@
+case $arg in
+######################################################################
+# IDO 5.3 handles these -O statements, so just pass them through
+# preserve -Olimit settings
+######################################################################
+-O0|-O|-O1|-O2|-Olimit)
+       addtocache=yes
+       ;;
+######################################################################
+# IDO 5.3 seems to have problems with -O3, so downgrade it
+######################################################################
+-O3)
+       arg=-O2
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+######################################################################
+# Directories for the runtime library search path are passed via
+# "-Wl,-rpath,<dir>", not "-Wl,-R<dir>".
+# Path elements are separated by ":".
+######################################################################
+-Wl,-R*)
+       arg=`$echo "X$arg" | $Xsed -e "s|,|:|g" -e "s|^-Wl:-R|-Wl,-rpath,|"`
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+-Wl,-rpath,*)
+       arg=`$echo "X$arg" | $Xsed -e "s|,|:|g" -e "s|^-Wl:-rpath:|-Wl,-rpath,|"`
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+-rpath*)
+       arg=`$echo "X$arg" | $Xsed -e "s|,|:|g" -e "s|^-rpath.|-Wl,-rpath,|"`
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+-R*)
+       arg=`$echo "X$arg" | $Xsed -e "s|,|:|g" -e "s|^-R|-Wl,-rpath,|"`
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+######################################################################
+# different syntax
+######################################################################
+-fsigned-char|-fno-unsigned-char)
+       arg=-signed
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+;;
+######################################################################
+# use -g3 in order to prevent disabling optimization
+######################################################################
+-g)
+       arg=-g3
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+;;
+######################################################################
+# The IDO 5.3 compiler accepts these -W* directives, so just pass them
+# on through.
+######################################################################
+-W[pKMfjusmocabyz]*,*)
+       addtocache=yes
+       ;;
+######################################################################
+# Ignore all of the other -W*, -O*, -f*, -m* directives, which are
+# likely to be GCCisms.
+# Ignore -pipe
+# Kill all -nostd* directives, since the standard libs and headers
+# will not be considered by buildlink3 even if a respective
+# -L or -I option is issued.
+# ignore options that should prevent the use of shared libraries.
+# ignore -n32, which is a MIPSpro-specific option.
+######################################################################
+-[WOfm]*|-pipe|-MM|-nostd*|--disable-shared|-non_shared|-n32)
+       arg=
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+######################################################################
+# different syntax for profiling
+######################################################################
+-pg)
+       arg=-p
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+######################################################################
+# different syntax
+######################################################################
+-static)
+       arg="-B static"
+       split_arg=yes
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+######################################################################
+# different syntax
+######################################################################
+-notall)
+       arg=-none
+       msg_log $wrapperlog "   (transform-ido-cc) to: $arg"
+       addtocache=yes
+       ;;
+esac



Home | Main Index | Thread Index | Old Index