make/devkit/Tools.gmk
changeset 34470 a62fa89499d0
parent 34100 e3293031f83d
child 34592 77d3edda8e8e
equal deleted inserted replaced
34469:9bf78b6b2cdb 34470:a62fa89499d0
     1 #
     1 #
     2 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    61 CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz
    61 CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz
    62 MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
    62 MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
    63 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
    63 GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
    64 MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz
    64 MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz
    65 
    65 
    66 # RPMs in OEL5.5
    66 # RPMs in OEL6.4
    67 LINUX_VERSION := OEL5.5
    67 LINUX_VERSION := OEL6.4
    68 RPM_LIST := \
    68 RPM_LIST := \
    69     kernel-headers \
    69     kernel-headers \
    70     glibc-2 glibc-headers glibc-devel \
    70     glibc glibc-headers glibc-devel \
    71     cups-libs cups-devel \
    71     cups-libs cups-devel \
    72     libX11 libX11-devel \
    72     libX11 libX11-devel \
    73     xorg-x11-proto-devel \
    73     xorg-x11-proto-devel \
    74     alsa-lib alsa-lib-devel \
    74     alsa-lib alsa-lib-devel \
    75     libXext libXext-devel \
    75     libXext libXext-devel \
    85     libgcc
    85     libgcc
    86 
    86 
    87 
    87 
    88 ifeq ($(ARCH),x86_64)
    88 ifeq ($(ARCH),x86_64)
    89   RPM_DIR ?= $(RPM_DIR_x86_64)
    89   RPM_DIR ?= $(RPM_DIR_x86_64)
    90   RPM_ARCHS := x86_64
    90   RPM_ARCHS := x86_64 noarch
    91   ifeq ($(BUILD),$(HOST))
    91   ifeq ($(BUILD),$(HOST))
    92     ifeq ($(TARGET),$(HOST))
    92     ifeq ($(TARGET),$(HOST))
    93       # When building the native compiler for x86_64, enable mixed mode.
    93       # When building the native compiler for x86_64, enable mixed mode.
    94       RPM_ARCHS += i386 i686
    94       RPM_ARCHS += i386 i686
    95     endif
    95     endif
    99   RPM_ARCHS := i386 i686
    99   RPM_ARCHS := i386 i686
   100 endif
   100 endif
   101 
   101 
   102 # Sort to remove duplicates
   102 # Sort to remove duplicates
   103 RPM_FILE_LIST := $(sort $(foreach a,$(RPM_ARCHS),$(wildcard $(patsubst %,$(RPM_DIR)/%*$a.rpm,$(RPM_LIST)))))
   103 RPM_FILE_LIST := $(sort $(foreach a,$(RPM_ARCHS),$(wildcard $(patsubst %,$(RPM_DIR)/%*$a.rpm,$(RPM_LIST)))))
       
   104 
       
   105 #$(info RPM_FILE_LIST $(RPM_FILE_LIST))
   104 
   106 
   105 ifeq ($(RPM_FILE_LIST),)
   107 ifeq ($(RPM_FILE_LIST),)
   106   $(error Found no RPMs, RPM_DIR must point to list of directories to search for RPMs)
   108   $(error Found no RPMs, RPM_DIR must point to list of directories to search for RPMs)
   107 endif
   109 endif
   108 
   110 
   471 	echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@
   473 	echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@
   472 	echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$$host/sysroot"' >> $@
   474 	echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$$host/sysroot"' >> $@
   473 
   475 
   474 ##########################################################################################
   476 ##########################################################################################
   475 
   477 
       
   478 ifeq ($(TARGET), $(HOST))
       
   479   $(PREFIX)/bin/%:
       
   480 	@echo 'Creating missing $* soft link'
       
   481 	ln -s $(TARGET)-$* $@
       
   482 
       
   483   missing-links := $(addprefix $(PREFIX)/bin/, \
       
   484       addr2line ar as c++ c++filt elfedit g++ gcc gprof ld nm objcopy ranlib readelf \
       
   485       size strings strip)
       
   486 endif
       
   487 
       
   488 ##########################################################################################
       
   489 
   476 bfdlib : $(bfdlib)
   490 bfdlib : $(bfdlib)
   477 binutils : $(binutils)
   491 binutils : $(binutils)
   478 rpms : $(rpms)
   492 rpms : $(rpms)
   479 libs : $(libs)
   493 libs : $(libs)
   480 sysroot : rpms libs
   494 sysroot : rpms libs
   481 gcc : sysroot $(gcc) $(gccpatch)
   495 gcc : sysroot $(gcc) $(gccpatch)
   482 all : binutils gcc bfdlib $(PREFIX)/devkit.info
   496 all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links)
   483 
   497 
   484 # this is only built for host. so separate.
   498 # this is only built for host. so separate.
   485 ccache : $(ccache)
   499 ccache : $(ccache)
   486 
   500 
   487 # Force target
   501 # Force target