summaryrefslogtreecommitdiff
path: root/mk/compiler/ido.mk
blob: 9f8b83e657fdf8614967c51858e7b46bdb7d8860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# $NetBSD: ido.mk,v 1.6 2008/02/07 20:59:05 rillig Exp $
#
# This is the compiler definition for the SGI IRIS Development Option
# cc (IRIX 5).
#
# User-settable variables:
#
# IDOBASE
#	The base directory where the compiler is installed.
#

.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
.if exists(${IDOBASE}/lib/cpp)
_IDO_VARS+=		CPP
_IDO_CPP=		${_IDO_DIR}/bin/cpp
_ALIASES.CPP=		cpp
CPPPATH=		${IDOBASE}/lib/cpp
PKG_CPP:=		${_IDO_CPP}
.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_}}:
	${RUN}${MKDIR} ${.TARGET:H}
	${RUN}					\
	(${ECHO} '#!${TOOLS_SHELL}';					\
	 ${ECHO} 'exec ${${_var_}PATH} "$$@"';			\
	) > ${.TARGET}
	${RUN}${CHMOD} +x ${.TARGET}
.    for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
	${RUN}					\
	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