pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk add support for the HP-UX C/aC++ compilers



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d0343a5941d5
branches:  trunk
changeset: 527961:d0343a5941d5
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Tue Apr 17 11:05:33 2007 +0000

description:
add support for the HP-UX C/aC++ compilers

diffstat:

 mk/compiler.mk    |   5 +-
 mk/compiler/hp.mk |  89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 2 deletions(-)

diffs (119 lines):

diff -r 60df40d441e8 -r d0343a5941d5 mk/compiler.mk
--- a/mk/compiler.mk    Tue Apr 17 10:48:29 2007 +0000
+++ b/mk/compiler.mk    Tue Apr 17 11:05:33 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.58 2006/12/03 08:34:45 seb Exp $
+# $NetBSD: compiler.mk,v 1.59 2007/04/17 11:05:33 tnn Exp $
 #
 # This Makefile fragment implements handling for supported C/C++/Fortran
 # compilers.
@@ -17,6 +17,7 @@
 #              icc             Intel C++ Compiler (Linux)
 #              ido             SGI IRIS Development Option cc (IRIX 5)
 #              gcc             GNU
+#              hp              HP-UX C/aC++ compilers
 #              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
 #              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
 #              sunpro          Sun Microsystems, Inc. WorkShip/Forte/Sun
@@ -85,7 +86,7 @@
 _USE_PKGSRC_GCC=       yes
 .endif
 
-_COMPILERS=            ccc gcc icc ido mipspro mipspro-ucode sunpro xlc
+_COMPILERS=            ccc gcc icc ido mipspro mipspro-ucode sunpro xlc hp
 _PSEUDO_COMPILERS=     ccache distcc f2c
 
 .if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
diff -r 60df40d441e8 -r d0343a5941d5 mk/compiler/hp.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/compiler/hp.mk Tue Apr 17 11:05:33 2007 +0000
@@ -0,0 +1,89 @@
+# $NetBSD $
+#
+# This is the compiler definition for the HP-UX C/aC++ compilers.
+#
+
+.if !defined(COMPILER_HP_MK)
+COMPILER_HP_MK=                defined
+
+.include "../../mk/bsd.prefs.mk"
+
+# LANGUAGES.<compiler> is the list of supported languages by the
+# compiler.
+#
+LANGUAGES.hp=          # empty
+
+_HP_DIR=               ${WRKDIR}/.hp
+_HP_VARS=              # empty
+.if exists(/usr/bin/cc)
+LANGUAGES.hp+=         c
+_HP_VARS+=             CC
+_HP_CC=                        ${_HP_DIR}/cc
+_ALIASES.CC=           cc
+CCPATH=                        /usr/bin/cc
+PKG_CC:=               ${_HP_CC}
+.endif
+.if exists(/opt/aCC/bin/aCC)
+LANGUAGES.hp+=         c++
+_HP_VARS+=             CXX
+_HP_CXX=               ${_HP_DIR}/aCC
+_ALIASES.CXX=          c++
+CXXPATH=               /opt/aCC/bin/aCC
+PKG_CXX:=              ${_HP_CXX}
+.endif
+_COMPILER_STRIP_VARS+= ${_HP_VARS}
+
+.if exists(${CXXPATH}) && !defined(CC_VERSION_STRING)
+CC_VERSION_STRING!=    ${CXXPATH} -V 2>&1
+CC_VERSION=            ${CC_VERSION_STRING:S/ /_/Wg}
+.else
+CC_VERSION_STRING?=    ${CC_VERSION}
+CC_VERSION?=           hp
+.endif
+
+# HP comilers pass flags to the linker using "-Wl,".
+_COMPILER_LD_FLAG=     -Wl,
+
+# linker syntax for rpath is +b /path1:/path2:...
+_LINKER_RPATH_FLAG=    +b
+
+# HP compilers pass rpath directives to the linker using "-Wl,+b,"
+_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.
+# 
+_LANGUAGES.hp=         # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.hp+=        ${LANGUAGES.hp:M${_lang_}}
+.endfor
+
+# Prepend the path to the compiler to the PATH.
+.if !empty(_LANGUAGES.hp)
+PREPEND_PATH+= ${_HP_DIR}/bin
+.endif
+
+# Create compiler driver scripts in ${WRKDIR}.
+.for _var_ in ${_HP_VARS}
+.  if !target(${_HP_${_var_}})
+override-tools: ${_HP_${_var_}}        
+${_HP_${_var_}}:
+       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       (${ECHO} '#!${TOOLS_SHELL}';                                    \
+        ${ECHO} 'exec ${${_var_}PATH} "$$@"';                  \
+       ) > ${.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
+
+_COMPILER_ABI_FLAG.32=+DD32
+_COMPILER_ABI_FLAG.64=+DD64
+
+.endif # COMPILER_HP_MK



Home | Main Index | Thread Index | Old Index