1 # $NetBSD: hp.mk,v 1.6 2009/05/30 18:16:26 joerg Exp $
3 # This is the compiler definition for the HP-UX C/aC++ compilers.
6 .if !defined(COMPILER_HP_MK)
7 COMPILER_HP_MK= defined
9 .include "../../mk/bsd.prefs.mk"
11 # LANGUAGES.<compiler> is the list of supported languages by the
16 _HP_DIR= ${WRKDIR}/.hp
18 .if exists(/usr/bin/cc)
26 .if exists(/opt/aCC/bin/aCC)
29 _HP_CXX= ${_HP_DIR}/aCC
31 CXXPATH= /opt/aCC/bin/aCC
34 _COMPILER_STRIP_VARS+= ${_HP_VARS}
36 .if exists(${CXXPATH}) && !defined(CC_VERSION_STRING)
37 CC_VERSION_STRING!= ${CXXPATH} -V 2>&1
38 CC_VERSION= ${CC_VERSION_STRING:S/ /_/Wg}
40 CC_VERSION_STRING?= ${CC_VERSION}
44 # Turn ANSI C++ features like namespace std, STL and correct scoping
45 _WRAP_EXTRA_ARGS.CXX+= -AA -Aa
47 # HP comilers pass flags to the linker using "-Wl,".
48 _COMPILER_LD_FLAG= -Wl,
50 # linker syntax for rpath is +b /path1:/path2:...
51 _LINKER_RPATH_FLAG= +b
53 # HP compilers pass rpath directives to the linker using "-Wl,+b,"
54 _COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG},
56 # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
57 # ones requested by the package in USE_LANGUAGES.
59 _LANGUAGES.hp= # empty
60 .for _lang_ in ${USE_LANGUAGES}
61 _LANGUAGES.hp+= ${LANGUAGES.hp:M${_lang_}}
64 # Prepend the path to the compiler to the PATH.
65 .if !empty(_LANGUAGES.hp)
66 PREPEND_PATH+= ${_HP_DIR}/bin
69 # Create compiler driver scripts in ${WRKDIR}.
70 .for _var_ in ${_HP_VARS}
71 . if !target(${_HP_${_var_}})
72 override-tools: ${_HP_${_var_}}
74 ${RUN}${MKDIR} ${.TARGET:H}
75 . if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
76 ${RUN}${RM} -f ${.TARGET}
77 ${RUN}${LN} -s ${${_var_}PATH} ${.TARGET}
80 (${ECHO} '#!${TOOLS_SHELL}'; \
81 ${ECHO} 'exec ${${_var_}PATH} "$$@"'; \
83 ${RUN}${CHMOD} +x ${.TARGET}
85 . for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
87 if [ ! -x "${_alias_}" ]; then \
88 ${LN} -f -s ${.TARGET} ${_alias_}; \
94 _COMPILER_ABI_FLAG.32=+DD32
95 _COMPILER_ABI_FLAG.64=+DD64
97 .endif # COMPILER_HP_MK