components/gcc47/Makefile
changeset 1414 9eeb516d9fdd
child 1462 bcf516ed6959
equal deleted inserted replaced
1413:5993f361061f 1414:9eeb516d9fdd
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     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.
       
     7 #
       
     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.
       
    12 #
       
    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]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
       
    22 #
       
    23 include ../../make-rules/shared-macros.mk
       
    24 
       
    25 COMPONENT_NAME=		gcc
       
    26 COMPONENT_VERSION=	4.7.3
       
    27 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
       
    28 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
       
    29 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    30 COMPONENT_ARCHIVE_HASH= \
       
    31     sha256:34a273937eb63ee710784b65bcf9fb3cfcd79d02848f80c75f8254abd14c79c8
       
    32 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
       
    33 COMPONENT_BUGDB=        utility/gnu-compiler
       
    34 
       
    35 include ../../make-rules/prep.mk
       
    36 include ../../make-rules/configure.mk
       
    37 include ../../make-rules/ips.mk
       
    38 
       
    39 # The GNU compiler wants the GNU utilities.
       
    40 PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
       
    41 
       
    42 PARCH =         $(MACH:i386=i386-pc)
       
    43 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
       
    44 
       
    45 PKG_MACROS +=   GNU_ARCH="$(GNU_ARCH)"
       
    46 
       
    47 # This product bootstraps itself.  The gcc flags are not the same
       
    48 # as Studio flags. -O2 means different things for the two compilers
       
    49 CFLAGS=-g -O2 
       
    50 CFLAGS_FOR_BUILD=$(CFLAGS)
       
    51 
       
    52 # CC_BITS may get in the way
       
    53 CC_BITS=
       
    54 
       
    55 # LD_OPTIONS
       
    56 # /usr/lib/ld/map.noexbss  destroys SPARC
       
    57 # /usr/lib/ld/map.noexdata destroys Intel
       
    58 GCC_LD_OPTIONS.sparc=-M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.pagealign -z ignore
       
    59 GCC_LD_OPTIONS.i386=-M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.pagealign -z ignore
       
    60 GCC_LD_OPTIONS = $(GCC_LD_OPTIONS.$(MACH))
       
    61 LD_OPTIONS := -z relax=secadj $(GCC_LD_OPTIONS)
       
    62 
       
    63 CONFIG_SHELL = /bin/sh
       
    64 MAKESHELL = /bin/sh
       
    65 
       
    66 CONFIGURE_PREFIX = /usr/gcc/4.7
       
    67 
       
    68 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
       
    69 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
       
    70 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
       
    71 CONFIGURE_OPTIONS +=	--enable-shared
       
    72 CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
       
    73 CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
       
    74 CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
       
    75 
       
    76 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
       
    77 CONFIGURE_ENV     += LD_OPTIONS="$(LD_OPTIONS)"
       
    78 
       
    79 # sparc and x86 use different assemblers
       
    80 CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=/usr/bin/as
       
    81 CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=/usr/gnu/bin/as
       
    82 CONFIGURE_OPTIONS +=    $(CONFIGURE_OPTIONS.$(MACH))
       
    83 
       
    84 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
       
    85 
       
    86 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
       
    87 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
       
    88 
       
    89 COMPONENT_BUILD_TARGETS=bootstrap
       
    90 
       
    91 COMPONENT_POST_INSTALL_ACTION = \
       
    92     ( cd $(PROTOUSRDIR)/gcc/4.7/lib  ; \
       
    93 	$(PYTHON) -m compileall . ; \
       
    94       cd $(PROTOUSRDIR)/gcc/4.7/lib/$(MACH64) ; \
       
    95 	$(PYTHON) -m compileall . ; \
       
    96       cd $(PROTOUSRDIR)/gcc/4.7/share/gcc-4.7.3/python/libstdcxx ; \
       
    97 	$(PYTHON) -m compileall . ; \
       
    98       cd $(PROTOUSRDIR)/gcc/4.7/share/gcc-4.7.3/python/libstdcxx/v6 ; \
       
    99 	$(PYTHON) -m compileall . )
       
   100 
       
   101 # ASLR has side-effects with libitm and libgomp.
       
   102 # Disable ASLR for now.
       
   103 ASLR_MODE=$(ASLR_DISABLE)
       
   104 
       
   105 build:		$(BUILD_32)
       
   106 
       
   107 install:	$(INSTALL_32)
       
   108 
       
   109 # To ensure that all tests that are expected to pass actually
       
   110 # pass, we have to increase the stacksize limit to at least 
       
   111 # 16384 Kb. Otherwise we'll get spurious failures in the test
       
   112 # harness (gcc.c-torture/compile/limits-exprparen.c and others).
       
   113 # With the soft stacksize limit set to 16384 we get very good
       
   114 # test results.
       
   115 test:
       
   116 	( cd $(BUILD_DIR_32)/gcc ; \
       
   117 	    ulimit -Ss 16384 ; \
       
   118 	    env - LD_OPTIONS=$(LD_OPTIONS) $(GMAKE) -k -i check ; \
       
   119 	    cd $(BUILD_DIR_32) ; \
       
   120 	    env - LD_OPTIONS=$(LD_OPTIONS) $(GMAKE) -k -i check-target )
       
   121 
       
   122 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
       
   123 
       
   124 include ../../make-rules/depend.mk
       
   125