File: devel/gcc/Makefile
lnx-bbc--stable--2.1--patch-38 lnx-bbc--research--0.0--patch-33
Line 1Line 1
GARNAME = gcc
GARVERSION = $(GCC_VERSION)
CATEGORIES = devel
GARNAME = gcc
GARVERSION = $(GCC_VERSION)
CATEGORIES = devel
MASTER_SITES = ftp://ftp.gnu.org/gnu/gcc/
DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz
MAINTAINER = Ian Harding <iharding@att.net>
MASTER_SITES = ftp://ftp.gnu.org/gnu/gcc/$(DISTNAME)/
DISTFILES = $(GARNAME)-$(GARVERSION).tar.bz2
PATCHFILES = gcc-uclibc-3.3.x-combined.patch gar-base.diff
MAINTAINER = Nate Riffe <inkblot@movealong.org>
LICENSE = GPL2

LICENSE = GPL2

WORKSRC=$(WORKDIR)/$(GARNAME)-$(GARVERSION)
# Differentiate builds by image and target
COOKIEDIR = $(COOKIEROOTDIR)/$(DESTIMG)_$(GARTARGET)
WORKDIR = $(WORKROOTDIR)/$(DESTIMG)_$(GARTARGET)

WORKSRC = $(WORKDIR)/$(GARNAME)-$(GARVERSION)
WORKBUILD = $(WORKDIR)/$(GARTARGET)

ifdef TARGETIMG
GARTARGET=$($(TARGETIMG)_GARHOST)
endif
DESCRIPTION = GNU Compiler Collection
define BLURB
#XXX: gcc package blurb goes here.
endef

DESCRIPTION = GNU Compiler Collection
define BLURB
#XXX: gcc package blurb goes here.
endef

LIBDEPS = devel/glibc
SOURCE_LANGUAGES = c
DEPENDS = utils/binutils
DEPENDS = utils/binutils
CONFIGURE_SCRIPTS = custom #$(WORKSRC)/configure
CONFIGURE_ARGS = $(DIRPATHS) --enable-version-specific-runtime-libs --host=$(GARHOST) --build=$(GARBUILD) --target=$(GARTARGET) --enable-threads=posix --enable-shared --enable-languages=c++
ifdef TARGETIMG
IMGDEPS = $(TARGETIMG)
$(TARGETIMG)_DEPENDS = $($(TARGETIMG)_LIBC)
endif

CONFIGURE_SCRIPTS += custom #$(WORKSRC)/configure
CONFIGURE_ARGS += --prefix=$(prefix) --exec-prefix=$(exec_prefix) --host=$(GARHOST) --build=$(GARBUILD) --target=$(GARTARGET) --with-gnu-ld
ifdef TARGETIMG
CONFIGURE_ARGS += --with-headers=$($(TARGETIMG)_DESTDIR)$($(TARGETIMG)_includedir) --with-libs=$($(TARGETIMG)_DESTDIR)$($(TARGETIMG)_libdir) --with-gxx-include-dir=$($(TARGETIMG)_DESTDIR)$($(TARGETIMG)_includedir)/c++/3.3
else
CONFIGURE_ARGS += --with-gxx-include-dir=$(includedir)/c++/3.3
endif
BUILD_SCRIPTS = $(WORKDIR)/$(GARTARGET)/Makefile
BUILD_SCRIPTS = $(WORKBUILD)/Makefile
BUILD_ARGS = -j1
BUILD_ARGS = -j1

#ifdef TARGETIMG
#BUILD_ARGS += LIBGCC2_INCLUDES="-D$($(TARGETIMG)_DESTDIR)$($(TARGETIMG)_includedir)"
#BUILD_ENV = NATIVE_SYSTEM_HEADER_DIR=$($(TARGETIMG)_includedir)
#endif
INSTALL_SCRIPTS = $(WORKDIR)/$(GARTARGET)/Makefile cc-symlink
INSTALL_SCRIPTS = $(WORKBUILD)/Makefile #cc-symlink
#INSTALL_OVERRIDE_DIRS = prefix bindir libdir datadir sysconfdir sharedstatedir libexecdir datadir localstatedir

include ../../gar.mk

#INSTALL_OVERRIDE_DIRS = prefix bindir libdir datadir sysconfdir sharedstatedir libexecdir datadir localstatedir

include ../../gar.mk


ifeq ($($(TARGETIMG)_LIBC),devel/glibc)
CONFIGURE_ARGS += --enable-version-specific-runtime-libs --enable-languages=c,c++ --enable-threads=posix --enable-shared
endif
ifeq ($($(TARGETIMG)_LIBC),lib/uclibc)
CONFIGURE_ARGS += --enable-languages=c --disable-threads --disable-shared
endif

pre-configure:
pre-configure:
        @mkdir -p $(WORKDIR)/$(GARTARGET)
        @mkdir -p $(WORKBUILD)
        @$(MAKECOOKIE)

configure-custom:
        @$(MAKECOOKIE)

configure-custom:
        cd $(WORKDIR)/$(GARTARGET) && $(CONFIGURE_ENV) ../$(GARNAME)-$(GARVERSION)/configure $(CONFIGURE_ARGS)
        cd $(WORKBUILD) && $(CONFIGURE_ENV) ./$(call DIRSTODOTS,$(WORKBUILD))/$(WORKSRC)/configure $(CONFIGURE_ARGS)
        $(MAKECOOKIE)

# cc -> gcc doesn't actual do us any good on the BUILDDEPS'd cross-compiler
        $(MAKECOOKIE)

# cc -> gcc doesn't actual do us any good on the BUILDDEPS'd cross-compiler
Line 45Line 76
# whether the compiler has changed. It would be much better if it checksummed it
# instead.
post-install:
# whether the compiler has changed. It would be much better if it checksummed it
# instead.
post-install:
        touch -r /usr/bin/gcc $(DESTDIR)$(bindir)/*gcc $(DESTDIR)$(bindir)/*cc $(DESTDIR)$(bindir)/*c++ $(DESTDIR)$(bindir)/*g++
        touch -r /usr/bin/$(build_CC) $(foreach IMG,$(TARGETIMG),$(DESTDIR)$(bindir)/$($(IMG)_CC) $(DESTDIR)$(bindir)/$($(IMG)_CXX)) $(WORKDIR)/junk
        $(MAKECOOKIE)
        $(MAKECOOKIE)