shared-macros.mk: simplify java settings
[oi-userland.git] / components / developer / gcc3 / Makefile
blobeee5eedd9893363192825606e079dbaca8b80f15
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
23 include ../../../make-rules/shared-macros.mk
25 COMPONENT_NAME= gcc
26 COMPONENT_VERSION= 3.4.3
27 COMPONENT_REVISION= 4
28 COMPONENT_PROJECT_URL= http://gcc.gnu.org/
29 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
30 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
31 # unfortunately we have our own "special" tarball and not the community version, so use that.
32 COMPONENT_ARCHIVE_HASH= \
33 sha256:3ab488fe2df01bf54a57acd70e745266e19232edacf77512f77655296748e7a0
34 COMPONENT_ARCHIVE_URL= http://dlc.openindiana.org/oi-build/source-archives/$(COMPONENT_ARCHIVE)
35 COMPONENT_BUGDB= utility/gnu-compiler
36 COMPONENT_FMRI = developer/gcc-3
37 COMPONENT_SUMMARY = gcc - The GNU C compiler
38 COMPONENT_CLASSIFICATION = Development/C
39 COMPONENT_LICENSE_FILE = gcc.license
40 COMPONENT_LICENSE = GPLv2
42 include $(WS_MAKE_RULES)/common.mk
44 # we build gcc with gcc
45 COMPILER = gcc
47 # CC_BITS may get in the way
48 CC_BITS=
50 # Set standard
51 CFLAGS += -std=gnu89
52 CXXFLAGS += -std=c++98
54 # enabling this causes libstdc++ to break
55 LD_B_DIRECT=
57 COMPONENT_BUILD_ARGS=
59 CONFIGURE_PREFIX = /usr/gcc/3.4
61 # we need to override CONFIGURE_OPTIONS because GCC uses a configure that
62 # can't deal with CC as an argument
63 CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
64 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
65 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info
66 CONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld
67 CONFIGURE_OPTIONS += --enable-languages='c,c++,f77,objc'
68 CONFIGURE_OPTIONS += --enable-shared
69 # sparc and x86 use different assemblers
70 CONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as
71 CONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as
72 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
74 CONFIGURE_ENV += CC="$(CC)"
75 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
77 COMPONENT_BUILD_ENV += STAGE1_CFLAGS="$(CFLAGS)"
78 COMPONENT_BUILD_ENV += CFLAGS_FOR_TARGET="$(CFLAGS)"
79 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
80 COMPONENT_BUILD_TARGETS = bootstrap
82 PKG_HARDLINKS += usr/gcc/3.4/bin/gcc
83 PKG_HARDLINKS += usr/gcc/3.4/bin/g++
84 PKG_HARDLINKS += usr/gcc/3.4/bin/$(GNU_TRIPLET)-gcc
86 # common targets
87 build: $(BUILD_32)
89 $(PROTO_DIR)/.sedded: $(INSTALL_32)
90 (cd $(@D) ; for file in libstdc++.la libsupc++.la ; do \
91 sed -i -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib -lgcc_s -lm';" usr/gcc/3.4/lib/$$file ; \
92 sed -i -e "s;\\(dependency_libs=\\).*;\\1' -L/usr/gcc/3.4/lib/$(MACH64) -lgcc_s -lm';" usr/gcc/3.4/lib/$(MACH64)/$$file ; \
93 done)
94 $(TOUCH) $@
96 install: $(PROTO_DIR)/.sedded
98 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
100 test: $(TEST_32)
102 # Auto-generated dependencies
103 REQUIRED_PACKAGES += developer/gnu-binutils
104 REQUIRED_PACKAGES += developer/linker
105 REQUIRED_PACKAGES += shell/ksh93
106 REQUIRED_PACKAGES += system/library
107 REQUIRED_PACKAGES += system/library/c-runtime
108 REQUIRED_PACKAGES += system/library/gcc-3-runtime
109 REQUIRED_PACKAGES += system/library/math