Marcel Telka
2024-04-02 f1b1912adc00984cd165470b728dda03ac81b2c6
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
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
#
include ../../../make-rules/shared-macros.mk
 
COMPONENT_NAME=        gcc
COMPONENT_VERSION=    3.4.3
COMPONENT_REVISION=    4
COMPONENT_PROJECT_URL=    http://gcc.gnu.org/
COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
# unfortunately we have our own "special" tarball and not the community version, so use that.
COMPONENT_ARCHIVE_HASH=    \
    sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
COMPONENT_ARCHIVE_URL=    http://dlc.openindiana.org/oi-build/source-archives/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB=    utility/gnu-compiler
COMPONENT_FMRI =        developer/gcc-3
COMPONENT_SUMMARY =        gcc - The GNU C compiler
COMPONENT_CLASSIFICATION =    Development/C
COMPONENT_LICENSE_FILE =    gcc.license
COMPONENT_LICENSE =        GPLv2
 
include $(WS_MAKE_RULES)/common.mk
 
# we build gcc with gcc
COMPILER =    gcc
 
# CC_BITS may get in the way
CC_BITS=
 
# Set standard
CFLAGS   += -std=gnu89
CXXFLAGS += -std=c++98
 
# enabling this causes libstdc++ to break
LD_B_DIRECT=
 
COMPONENT_BUILD_ARGS=
 
CONFIGURE_PREFIX =    /usr/gcc/3.4
 
# we need to override CONFIGURE_OPTIONS because GCC uses a configure that
# can't deal with CC as an argument
CONFIGURE_OPTIONS =     --prefix=$(CONFIGURE_PREFIX)
CONFIGURE_OPTIONS +=     --mandir=$(CONFIGURE_MANDIR)
CONFIGURE_OPTIONS +=     --infodir=$(CONFIGURE_PREFIX)/share/info
CONFIGURE_OPTIONS +=    --without-gnu-ld --with-ld=/usr/bin/ld
CONFIGURE_OPTIONS +=    --enable-languages='c,c++,f77,objc'
CONFIGURE_OPTIONS +=    --enable-shared
# sparc and x86 use different assemblers
CONFIGURE_OPTIONS.sparc +=    --without-gnu-as --with-as=/usr/bin/as
CONFIGURE_OPTIONS.i386 +=    --with-gnu-as --with-as=/usr/gnu/bin/as
CONFIGURE_OPTIONS +=    $(CONFIGURE_OPTIONS.$(MACH))
 
CONFIGURE_ENV +=     CC="$(CC)"
CONFIGURE_ENV +=    CFLAGS="$(CFLAGS)"
 
COMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
COMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
COMPONENT_BUILD_TARGETS = bootstrap
 
PKG_HARDLINKS +=    usr/gcc/3.4/bin/gcc
PKG_HARDLINKS +=    usr/gcc/3.4/bin/g++
PKG_HARDLINKS +=    usr/gcc/3.4/bin/$(GNU_TRIPLET)-gcc
 
# common targets
build:        $(BUILD_32)
 
$(PROTO_DIR)/.sedded:    $(INSTALL_32)
    (cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
        sed -i -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib -lgcc_s -lm';" usr/gcc/3.4/lib/$$file ; \
        sed -i -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib/$(MACH64) -lgcc_s -lm';" usr/gcc/3.4/lib/$(MACH64)/$$file ; \
     done)
    $(TOUCH) $@
 
install:    $(PROTO_DIR)/.sedded
 
BUILD_PKG_DEPENDENCIES =    $(BUILD_TOOLS)
 
test: $(TEST_32)
 
# Auto-generated dependencies
REQUIRED_PACKAGES += developer/gnu-binutils
REQUIRED_PACKAGES += developer/linker
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/library/c-runtime
REQUIRED_PACKAGES += system/library/gcc-3-runtime
REQUIRED_PACKAGES += system/library/math