summaryrefslogtreecommitdiff
path: root/lang/gcc5-aux/options.mk
blob: d30ac072e51fdd8ca423cbd04e3c0cfb8caaaa8b (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# $NetBSD: options.mk,v 1.6 2019/09/08 14:05:38 maya Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.gcc5-aux
PKG_SUPPORTED_OPTIONS=  fortran objc testsuite static bootstrap allstages always-libgcc
PKG_SUGGESTED_OPTIONS=  #fortran objc 

.include "../../mk/compiler.mk"
.if empty(PKGSRC_COMPILER:Mgcc)
PKG_SUGGESTED_OPTIONS+=		always-libgcc
.endif

PKG_SUGGESTED_OPTIONS.SunOS+=	always-libgcc

# disable nls for now (build error involving iconv)
# disable fortran, breaks during build on NetBSD 7.0-beta

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


# Bootstrap is essentially a maintainer option and it will ignore
# all other options because it is intent on building a bootstrap compiler.


#############################
##  ADD LANGUAGE: Fortran  ##
#############################

.if empty(PKG_OPTIONS:Mfortran) || !empty(PKG_OPTIONS:Mbootstrap)
EXTRA_CONFARGS+= --disable-libquadmath
.else
LANGS+= fortran
APPLY_DIFFS+= fortran
.if ${OPSYS} == NetBSD
EXTRA_CONFARGS+= --disable-libquadmath
.else
EXTRA_CONFARGS+= --enable-libquadmath
.endif
.endif


#############################
##  Don't install libgcc   ##
#############################

.if empty(PKG_OPTIONS:Malways-libgcc)
post-install:	delete-installed-libgcc

delete-installed-libgcc:
	${FIND} ${DESTDIR} -name 'libgcc_s.so*' -delete

.endif


#################################
##  ADD LANGUAGE: Objective-C  ##
#################################

.if !empty(PKG_OPTIONS:Mobjc) && empty(PKG_OPTIONS:Mbootstrap)
LANGS+= objc
.endif


#########################
##  TESTSUITE SUPPORT  ##
#########################

.if !empty(PKG_OPTIONS:Mtestsuite) && empty(PKG_OPTIONS:Mbootstrap)
BUILD_DEPENDS+= dejagnu>=1.4:../../devel/dejagnu
APPLY_DIFFS+= ada-testsuite
APPLY_DIFFS+= cxx-testsuite
APPLY_DIFFS+= gcc-testsuite
.endif


#################################
##  NATIONAL LANGUAGE SUPPORT  ##
#################################

EXTRA_CONFARGS+= --disable-nls


###############################
##  STATICALLY BUILT OPTION  ##
###############################

.if !empty(PKG_OPTIONS:Mstatic)
STATIC_BUILD = yes
.endif

.if defined(STATIC_BUILD) && empty(PKG_OPTIONS:Mbootstrap)
.  if ${OPSYS} == SunOS
PKG_FAIL_REASON+= SunOS does not support static builds
.  else
EXTRA_CONFARGS+= --with-stage1-ldflags=-static
.  endif
.endif


#################################
##  BOOTSTRAP COMPILER OPTION  ##
#################################

# Solaris does not support static linking system libraries, so bootstraps
# on SunOS require gmp&co to be built with gcc.  Also, OpenBSD x86-64
# fails configuration during the linking of -lmpc -lmpfr -lgmp in a contest;
# it complains of missing references in libm.  These libraries are built by
# a different compiler (the base) so perhaps that's the problem.  Building
# gmp&co in the tree allows the configure step to succeed on OpenBSD.

.if ${OPSYS} == OpenBSD || ${OPSYS} == MirBSD || \
   (${OPSYS} == SunOS && !empty(PKG_OPTIONS:Mbootstrap))
.include "../../devel/gmp/inplace.mk"
.include "../../math/mpcomplex/inplace.mk"
.include "../../math/mpfr/inplace.mk"
.else
EXTRA_CONFARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp}
EXTRA_CONFARGS+= --with-mpfr=${BUILDLINK_PREFIX.mpfr}
EXTRA_CONFARGS+= --with-mpc=${BUILDLINK_PREFIX.mpcomplex}
.include "../../devel/gmp/buildlink3.mk"
.include "../../math/mpfr/buildlink3.mk"
.include "../../math/mpcomplex/buildlink3.mk"
.endif

.if !empty(PKG_OPTIONS:Mbootstrap)
EXTRA_CONFARGS+= --disable-shared --disable-lto
.  if ${OPSYS} != SunOS
EXTRA_CONFARGS+= --with-stage1-ldflags=-static
EXTRA_CONFARGS+= --with-boot-ldflags=-static
EXTRA_CONFARGS+= --with-system-zlib
.  endif
.else
.  if empty(PKG_OPTIONS:Mallstages)
EXTRA_CONFARGS+= --disable-bootstrap
EXTRA_CONFARGS+= --disable-libcc1
.  endif
EXTRA_CONFARGS+= --enable-shared
.endif