summaryrefslogtreecommitdiff
path: root/lang/gcc34/options.mk
blob: d8bc55c739e45a0fe534b7fdb473d4b7e582a9b3 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# $NetBSD: options.mk,v 1.6 2016/02/25 14:42:55 jperkin Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.gcc34
PKG_SUPPORTED_OPTIONS=	nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc gcc-ada
PKG_SUGGESTED_OPTIONS=	gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc

PKG_SUGGESTED_OPTIONS.NetBSD+=	nls
PKG_SUGGESTED_OPTIONS.SunOS+=	gcc-inplace-math

PKG_OPTIONS_LEGACY_VARS+=	BUILD_CXX:gcc-c++
PKG_OPTIONS_LEGACY_VARS+=	BUILD_F77:gcc-fortran
PKG_OPTIONS_LEGACY_VARS+=	BUILD_JAVA:gcc-java
PKG_OPTIONS_LEGACY_VARS+=	BUILD_OBJC:gcc-objc

.include "../../mk/bsd.options.mk"

###
### Build math libraries in place
###
.if !empty(PKG_OPTIONS:Mgcc-fortran)
.  if !empty(PKG_OPTIONS:Mgcc-inplace-math)
.  include "../../devel/gmp/inplace.mk"
.  else
CONFIGURE_ARGS+=	--with-gmp=${BUILDLINK_PREFIX.gmp}
.  include "../../devel/gmp/buildlink3.mk"
.  endif
.endif

###
### Native Language Support
###
.if !empty(PKG_OPTIONS:Mnls)
CONFIGURE_ARGS+=	--enable-nls
CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
MAKE_ENV+=		ICONVPREFIX=${BUILDLINK_PREFIX.iconv}
USE_TOOLS+=		msgfmt
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.else
CONFIGURE_ARGS+=	--disable-nls
.endif

###
### Optional languages
###

LANGS=			c

.if !empty(PKG_OPTIONS:Mgcc-c++)
LANGS+=			c++
CONFIGURE_ARGS+=	--enable-__cxa_atexit
.endif

.if !empty(PKG_OPTIONS:Mgcc-fortran)
USE_TOOLS+=             chmod
MAKE_ENV+=              ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q}
LANGS+=			f77
.endif

.if !empty(PKG_OPTIONS:Mgcc-java)
LANGS+=			java
REPLACE_AWK+=		libjava/addr2name.awk

USE_TOOLS+=		awk:run unzip zip:run
CONFIGURE_ARGS+=	--with-system-zlib

.include "../../devel/zlib/buildlink3.mk"
.endif

.if !empty(PKG_OPTIONS:Mgcc-objc)
LANGS+=			objc
.endif

.if !empty(PKG_OPTIONS:Mgcc-ada)
PTHREAD_OPTS+=          require native
LANGS+=		ada

# Ada bootstrap compiler section
# An Ada compiler is required to build the Ada compiler.
# You may specify the path of any gcc/gnat Ada compiler
# by providing the full path of the compiler (example) below:
ALT_GCC=	/usr/pkg/bin/gnatgcc
.  if defined(ALT_GCC)
.     if exists(${ALT_GCC})
ALT_GCC_RTS!=	${ALT_GCC} --print-file-name=adalib
.	if !empty(ALT_GCC_RTS)
RALT_GCC_RTS=	${ALT_GCC_RTS:S%${LOCALBASE}%%:S%/%%}
.	else
PKG_FAIL_REASON+=	"${ALT_GCC} does not appear to be an Ada compiler"
.	endif
.     else
PKG_FAIL_REASON+=	"Missing bootstrap Ada compiler"
.     endif
.  endif
.  if !defined(ALT_GCC)
PKG_FAIL_REASON+=	"An Ada bootstrap compiler must be specified to build Ada"
.  endif

.  if defined(ALT_GCC)
pre-configure:
	(${TEST} -d ${WRKDIR}/.gcc/bin/ || ${MKDIR} ${WRKDIR}/.gcc/bin/)
	(cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \
	cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .)
	(cd ${ALT_GCC:H} && \
		bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \
	cd ${WRKDIR}/.gcc/bin/ && \
	for filename in ${ALT_GCC:T} $${bin_files} ; do \
		${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \
		${ECHO_N} "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \
		${ECHO} '"$$@"' >>$${filename}; \
		${CHMOD} +x $${filename}; \
	done )
.  endif
.endif