The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / glibc / glibc.mk
1 ################################################################################
2 #
3 # glibc/eglibc
4 #
5 ################################################################################
6
7 GLIBC_VERSION = $(call qstrip,$(BR2_GLIBC_VERSION_STRING))
8
9 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_EGLIBC),y)
10 GLIBC_SITE = http://downloads.yoctoproject.org/releases/eglibc
11 GLIBC_SOURCE = eglibc-$(GLIBC_VERSION).tar.bz2
12 GLIBC_SRC_SUBDIR = libc
13 else
14 GLIBC_SITE = $(BR2_GNU_MIRROR)/libc
15 GLIBC_SOURCE = glibc-$(GLIBC_VERSION).tar.xz
16 GLIBC_SRC_SUBDIR = .
17 endif
18
19 GLIBC_LICENSE = GPLv2+ (programs), LGPLv2.1+, BSD-3c, MIT (library)
20 GLIBC_LICENSE_FILES = $(addprefix $(GLIBC_SRC_SUBDIR)/,COPYING COPYING.LIB LICENSES)
21
22 # glibc is part of the toolchain so disable the toolchain dependency
23 GLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
24
25 # Before (e)glibc is configured, we must have the first stage
26 # cross-compiler and the kernel headers
27 GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-gawk
28
29 GLIBC_SUBDIR = build
30
31 GLIBC_INSTALL_STAGING = YES
32
33 GLIBC_INSTALL_STAGING_OPTS = install_root=$(STAGING_DIR) install
34
35 # Thumb build is broken, build in ARM mode
36 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
37 GLIBC_EXTRA_CFLAGS += -marm
38 endif
39
40 # MIPS64 defaults to n32 so pass the correct -mabi if
41 # we are using a different ABI. OABI32 is also used
42 # in MIPS so we pass -mabi=32 in this case as well
43 # even though it's not strictly necessary.
44 ifeq ($(BR2_MIPS_NABI64),y)
45 GLIBC_EXTRA_CFLAGS += -mabi=64
46 else ifeq ($(BR2_MIPS_OABI32),y)
47 GLIBC_EXTRA_CFLAGS += -mabi=32
48 endif
49
50 ifeq ($(BR2_ENABLE_DEBUG),y)
51 GLIBC_EXTRA_CFLAGS += -g
52 endif
53
54 # The stubs.h header is not installed by install-headers, but is
55 # needed for the gcc build. An empty stubs.h will work, as explained
56 # in http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html. The same trick
57 # is used by Crosstool-NG.
58 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_GLIBC),y)
59 define GLIBC_ADD_MISSING_STUB_H
60         mkdir -p $(STAGING_DIR)/usr/include/gnu
61         touch $(STAGING_DIR)/usr/include/gnu/stubs.h
62 endef
63 endif
64
65 # Even though we use the autotools-package infrastructure, we have to
66 # override the default configure commands for several reasons:
67 #
68 #  1. We have to build out-of-tree, but we can't use the same
69 #     'symbolic link to configure' used with the gcc packages.
70 #
71 #  2. We have to execute the configure script with bash and not sh.
72 #
73 # Note that as mentionned in
74 # http://patches.openembedded.org/patch/38849/, eglibc/glibc must be
75 # built with -O2, so we pass our own CFLAGS and CXXFLAGS below.
76 define GLIBC_CONFIGURE_CMDS
77         mkdir -p $(@D)/build
78         # Do the configuration
79         (cd $(@D)/build; \
80                 $(TARGET_CONFIGURE_OPTS) \
81                 CFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \
82                 CXXFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" \
83                 $(SHELL) $(@D)/$(GLIBC_SRC_SUBDIR)/configure \
84                 ac_cv_path_BASH_SHELL=/bin/bash \
85                 libc_cv_forced_unwind=yes \
86                 libc_cv_ssp=no \
87                 --target=$(GNU_TARGET_NAME) \
88                 --host=$(GNU_TARGET_NAME) \
89                 --build=$(GNU_HOST_NAME) \
90                 --prefix=/usr \
91                 --enable-shared \
92                 $(if $(BR2_SOFT_FLOAT),--without-fp,--with-fp) \
93                 --with-pkgversion="Buildroot" \
94                 --without-cvs \
95                 --disable-profile \
96                 --without-gd \
97                 --enable-obsolete-rpc \
98                 --with-headers=$(STAGING_DIR)/usr/include)
99         $(GLIBC_ADD_MISSING_STUB_H)
100 endef
101
102
103 #
104 # We also override the install to target commands since we only want
105 # to install the libraries, and nothing more.
106 #
107
108 GLIBC_LIBS_LIB = \
109         ld*.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* libm.so.*        \
110         libnsl.so.* libpthread.so.* libresolv.so.* librt.so.* libutil.so.*   \
111         libnss_files.so.* libnss_dns.so.*
112
113 ifeq ($(BR2_PACKAGE_GDB),y)
114 GLIBC_LIBS_LIB += libthread_db.so.*
115 endif
116
117 define GLIBC_INSTALL_TARGET_CMDS
118         for libs in $(GLIBC_LIBS_LIB); do \
119                 $(call copy_toolchain_lib_root,$(STAGING_DIR)/,,lib,$$libs,/lib) ; \
120         done
121 endef
122
123 $(eval $(autotools-package))