summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/compiler.mk5
-rw-r--r--mk/compiler/ido.mk76
-rw-r--r--mk/wrapper/bsd.wrapper.mk16
-rw-r--r--mk/wrapper/transform-ido-cc105
4 files changed, 199 insertions, 3 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index ec0c2219978..14be434b1e6 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -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_LANGUAGES:= c ${USE_LANGUAGES}
_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 --git a/mk/compiler/ido.mk b/mk/compiler/ido.mk
new file mode 100644
index 00000000000..c1f8d85e825
--- /dev/null
+++ b/mk/compiler/ido.mk
@@ -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 --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index be4f3b50dac..0d8ff3c9b90 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -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_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC}
_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 @@ ${WRAPPER_TMPDIR}/cmd-sink-sunpro-cxx: \
${_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 --git a/mk/wrapper/transform-ido-cc b/mk/wrapper/transform-ido-cc
new file mode 100644
index 00000000000..e71d39ab7f2
--- /dev/null
+++ b/mk/wrapper/transform-ido-cc
@@ -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