File: devel/glibc/Makefile
base-0 patch-1
Line 1Line 1
GARNAME = glibc
GARNAME = glibc
GARVERSION = 2.2.5
GARVERSION = $(GLIBC_VERSION)
CATEGORIES = devel
MASTER_SITES = ftp://ftp.gnu.org/gnu/glibc/
CATEGORIES = devel
MASTER_SITES = ftp://ftp.gnu.org/gnu/glibc/
DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz $(GARNAME)-linuxthreads-$(GARVERSION).tar.gz
MAINTAINER = Nick Moffitt <nick@zork.net>
DISTFILES = $(GARNAME)-$(GARVERSION).tar.bz2 $(GARNAME)-linuxthreads-$(GARVERSION).tar.bz2
PATCHFILES = gar-base.diff
PATCHFILES = gar-base.diff

MAINTAINER = Nick Moffitt <nick@zork.net>
LICENSE = LGPL2_1

DESCRIPTION = GNU C Library
LICENSE = LGPL2_1

DESCRIPTION = GNU C Library
Line 13Line 13
programs on the system.
endef

programs on the system.
endef

CFLAGS += -mcpu=i386 -O3
CONFIGURE_SCRIPTS = $(WORKSRC)/configure
BUILD_SCRIPTS = $(WORKSRC)/Makefile
INSTALL_SCRIPTS = $(WORKSRC)/Makefile
# glibc will actually use the PARALLELMFLAGS var itself
BUILD_ARGS = -j1
#WORKSRC = $(WORKDIR)/$(GARNAME)-$(GARVERSION)
WORKBUILD = $(WORKDIR)/$(GARHOST)

DEPENDS = kernel/linux-headers

# A lot of packages are still depending on glibc directly via a LIBDEPS. That
# is now deprecated in favor of including "c" in SOURCE_LANGUAGES. To ease
# transition, this test relies on one of the side-effects of the dependency
# chain that builds the toolchain, which is that TARGETIMG is set.
ifdef TARGETIMG
# TARGETIMG is set. This means:
# 1) glibc is being depped by devel/gcc as part of a toolchain
# 2) the toolchain is for cross-compiling
# So BUILDDEP on the bootstrap compiler
BUILDDEPS = devel/gcc-inhibited
else
# TARGETIMG is not set. This means some package has a direct dependency on
# glibc. Which means we still need C support.
SOURCE_LANGUAGES = c
endif

CONFIGURE_SCRIPTS = custom #$(WORKSRC)/configure
BUILD_SCRIPTS = $(WORKBUILD)/Makefile
INSTALL_SCRIPTS = $(WORKBUILD)/Makefile

CONFIGURE_ENV = BUILD_CC="$(build_CC)" BUILD_CFLAGS="$(build_CFLAGS)"
CONFIGURE_ARGS = $(DIRPATHS) --build=$(GARBUILD) --host=$(GARHOST) --disable-static --disable-profile --disable-omitfp --disable-bounded --enable-shared --with-elf --without-cvs --with-headers=$(KERNEL_INCLUDEDIR) --without-gd --enable-add-ons=linuxthreads
# setting this just makes sure that glibc doesn't think you have
# "." in the LD_LIBRARY_PATH, due to the way that gar.conf.mk
# setting this just makes sure that glibc doesn't think you have
# "." in the LD_LIBRARY_PATH, due to the way that gar.conf.mk
Line 26Line 47
# hasn't been set before, and doesn't bother exporting it because
# gar.conf.mk will end up doing that anyway.
LD_LIBRARY_PATH ?= $(DESTDIR)$(libdir)
# hasn't been set before, and doesn't bother exporting it because
# gar.conf.mk will end up doing that anyway.
LD_LIBRARY_PATH ?= $(DESTDIR)$(libdir)
DEPENDS = kernel/linux-headers devel/gcc-primitives
CFLAGS += -mcpu=$(ALTGARCH) -O3
BUILD_ARGS = install_root=$(DESTDIR) cross-compiling=$(CROSS_COMPILING)
CONFIGURE_ARGS = $(DIRPATHS) $(GARHOST) --with-elf --disable-static --enable-shared --enable-add-ons=linuxthreads --without-cvs --build=$(GARBUILD) --host=$(GARHOST) --without-gd --with-headers=$(DESTDIR)$(sourcedir)/linux/include --enable-kernel=$(KERNEL_VERSION) --disable-profile --enable-omitfp
INSTALL_ARGS = install_root=$(DESTDIR) cross-compiling=$(CROSS_COMPILING)
# BUILD_ARGS += --dynamic-linker=/lib/ld-linux.so.2
GAR_EXTRA_CONF += devel/glibc/package-api.mk kernel/linux/package-api.mk
include ../../gar.mk
INSTALL_ARGS = install_root=$(DESTDIR)
CROSS_COMPILING = $(if $(filter-out $(GARBUILD),$(GARHOST)),yes,no)
GAR_EXTRA_CONF += kernel/linux/package-api.mk
include ../../gar.mk
extract-$(GARNAME)-linuxthreads-$(GARVERSION).tar.bz2:
        @echo " ==> Extracting $(DOWNLOADDIR)/$(GARNAME)-linuxthreads-$(GARVERSION).tar.bz2"
        @tar xjf $(DOWNLOADDIR)/$(GARNAME)-linuxthreads-$(GARVERSION).tar.bz2 -C $(EXTRACTDIR)/$(GARNAME)-$(GARVERSION)/
        @$(MAKECOOKIE)

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

configure-custom:
        @echo " ==> Running configure in $(WORKBUILD)"
        @cd $(WORKBUILD) && $(CONFIGURE_ENV) ./$(call DIRSTODOTS,$(WORKBUILD))/$(WORKSRC)/configure $(CONFIGURE_ARGS)
        @$(MAKECOOKIE)
# low-down dirty-as-sin hack-with-a-dull-blade. I hate this
# thing. glibc just fails when parallel sometimes. It sucks
# like a nuclear-powered hoover. When revving up the version,
# check to see if cygnus fixed this.
post-configure:
# low-down dirty-as-sin hack-with-a-dull-blade. I hate this
# thing. glibc just fails when parallel sometimes. It sucks
# like a nuclear-powered hoover. When revving up the version,
# check to see if cygnus fixed this.
post-configure:
        echo '.NOTPARALLEL:' >> $(WORKSRC)/elf/Makefile
        $(MAKECOOKIE)
        @echo '.NOTPARALLEL:' >> $(WORKSRC)/elf/Makefile
        @$(MAKECOOKIE)
extract-$(GARNAME)-linuxthreads-$(GARVERSION).tar.gz:
        tar xzf $(DOWNLOADDIR)/$(GARNAME)-linuxthreads-$(GARVERSION).tar.gz -C $(EXTRACTDIR)/$(GARNAME)-$(GARVERSION)/
        $(MAKECOOKIE)
post-build:
        @echo "h8 u, $(GARNAME) :<"
        find $(WORKBUILD)/ | xargs touch -r $(WORKBUILD)
        @$(MAKECOOKIE)
post-install:
post-install:
        cp -R /usr/include/linux /usr/include/asm $(DESTDIR)$(includedir)
        echo 'GROUP ( $(DESTDIR)$(libdir)/libc.so.6 $(DESTDIR)$(libdir)/libc_nonshared.a /lib/libc.so.6 libc_nonshared.a )' > $(DESTDIR)$(libdir)/libc.so
        mkdir -p $(DESTDIR)$(includedir)/linux $(DESTDIR)$(includedir)/asm $(DESTDIR)$(includedir)/asm-generic
        rsync -pav $(KERNEL_INCLUDEDIR)/linux/ $(DESTDIR)$(includedir)/linux/
        rsync -pav $(KERNEL_INCLUDEDIR)/asm/ $(DESTDIR)$(includedir)/asm/
        rsync -pav $(KERNEL_INCLUDEDIR)/asm-generic/ $(DESTDIR)$(includedir)/asm-generic/
        echo 'GROUP ( $(DESTDIR)$(libdir)/libc.so.6 $(DESTDIR)$(libdir)/libc_nonshared.a )' > $(DESTDIR)$(libdir)/libc.so
        echo 'GROUP ( $(DESTDIR)$(libdir)/libpthread.so.0 $(DESTDIR)$(libdir)/libpthread_nonshared.a )' > $(DESTDIR)$(libdir)/libpthread.so
        $(MAKECOOKIE)
        $(MAKECOOKIE)