blob: 5021a7504730bd3abb2fe5d0240ba4b2e1c81d6e (
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
|
# $NetBSD: buildlink2.mk,v 1.10 2003/05/28 13:24:36 grant Exp $
.if !defined(GCC2_BUILDLINK2_MK)
GCC2_BUILDLINK2_MK= # defined
.include "../../mk/bsd.prefs.mk"
# If you want to allow EGCS to satisfy the GCC requirement, then set
# GCC_REQD to "2.8.0".
#
GCC_REQD?= 2.95.3
BUILDLINK_DEPENDS.gcc?= gcc>=${GCC_REQD}
BUILDLINK_PKGSRCDIR.gcc?= ../../lang/gcc
# Packages that use the C++ compiler and subsequently link against the
# shared libstdc++ from the package need a full dependency.
#
.if defined(USE_CXX)
BUILDLINK_DEPMETHOD.gcc+= full
.else
BUILDLINK_DEPMETHOD.gcc?= build
.endif
BUILDLINK_PREFIX.gcc= ${LOCALBASE}
_GCC_SUBPREFIX= gcc-2.95.3/
_GCC_PREFIX= ${BUILDLINK_PREFIX.gcc}/${_GCC_SUBPREFIX}
_GCC_ARCHSUBDIR= lib/gcc-lib/${MACHINE_GNU_PLATFORM}/2.95.3
_GCC_ARCHDIR= ${_GCC_PREFIX}${_GCC_ARCHSUBDIR}
BUILDLINK_LDFLAGS.gcc= -L${_GCC_ARCHDIR} -Wl,-R${_GCC_ARCHDIR}
_GCC_VERSION!= ( gcc -dumpversion ) 2>/dev/null || ${ECHO} 0
#
# GCC_VERSION is the version number of the gcc detected above. EGCS gcc is
# considered to be "gcc-2.8.1" so that it will match "gcc>=2.8.0".
#
# GCC_PKG is the package name "gcc-${GCC_VERSION} for the gcc detected above.
#
.if !empty(_GCC_VERSION:Megcs-[0-9]*)
GCC_VERSION= 2.8.1
.else
GCC_VERSION= ${_GCC_VERSION}
.endif
GCC_PKG= gcc-${GCC_VERSION}
.if defined(USE_PKGSRC_GCC)
_NEED_PKGSRC_GCC= YES
.else
_NEED_PKGSRC_GCC!= \
if ${PKG_ADMIN} pmatch '${BUILDLINK_DEPENDS.gcc}' ${GCC_PKG}; then \
gccpath=`${TYPE} gcc | ${AWK} '{ print $$NF }'`; \
if [ "$$gccpath" = "${_GCC_PREFIX}bin/gcc" ]; then \
${ECHO} "YES"; \
else \
${ECHO} "NO"; \
fi; \
else \
${ECHO} "YES"; \
fi
.endif
.if ${_NEED_PKGSRC_GCC} == "YES"
BUILDLINK_PACKAGES+= gcc
PATH:= ${_GCC_PREFIX}bin:${PATH}
CC= ${_GCC_PREFIX}bin/gcc
CPP= ${_GCC_PREFIX}bin/cpp
CXX= ${_GCC_PREFIX}bin/g++
F77= ${_GCC_PREFIX}bin/g77
PKG_FC= ${F77}
. if defined(USE_CXX)
LDFLAGS+= ${BUILDLINK_LDFLAGS.gcc}
. endif
BUILDLINK_WRAPPER_ENV+= \
COMPILER_PATH="${BUILDLINK_DIR}/bin"; export COMPILER_PATH
.endif # _NEED_PKGSRC_GCC == YES
# These files are from gcc>=2.95.3.
BUILDLINK_FILES.gcc= ${_GCC_SUBPREFIX}include/g++-3/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}include/g++-3/*/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/include/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/include/*/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/include/*/*/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/include/*/*/*/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/lib*.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${_GCC_ARCHSUBDIR}/specs
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${MACHINE_GNU_PLATFORM}/include/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}${MACHINE_GNU_PLATFORM}/include/*/*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libiberty.*
BUILDLINK_FILES.gcc+= ${_GCC_SUBPREFIX}lib/libstdc++.*
BUILDLINK_TARGETS+= gcc-buildlink
gcc-buildlink: _BUILDLINK_USE
.endif # GCC2_BUILDLINK2_MK
|