add LTO support to toolchain settings. Cleanup SYSROOT mess.
[openadk.git] / toolchain / eglibc / Makefile
blobc5f2a56531b138a357559f800446e3c10d51a55d
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(TOPDIR)/rules.mk
5 include ../rules.mk
6 include Makefile.inc
7 include ${TOPDIR}/mk/buildhlp.mk
9 ifneq ($(ADK_DEBUG),)
10 TARGET_CFLAGS+= -O2
11 endif
13 EGLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
14 --host=$(REAL_GNU_TARGET_NAME) \
15 --disable-nls \
16 --without-cvs \
17 --disable-profile \
18 --disable-debug \
19 --enable-kernel=2.6.0 \
20 --without-gd \
21 --with-__thread \
22 --with-tls \
23 --enable-add-ons
25 EGLIBC_ENV:= PATH='${TARGET_PATH}' \
26 BUILD_CC=${HOSTCC} \
27 CFLAGS="$(TARGET_CFLAGS)" \
28 CC=${REAL_GNU_TARGET_NAME}-gcc \
29 CXX=${REAL_GNU_TARGET_NAME}-g++ \
30 AR=${REAL_GNU_TARGET_NAME}-ar \
31 RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
32 libc_cv_forced_unwind=yes \
33 libc_cv_c_cleanup=yes \
34 libc_cv_gnu99_inline=yes \
35 libc_cv_slibdir="/lib"
37 ifeq ($(ADK_TARGET_NO_FPU),y)
38 EGLIBC_CONFOPTS+= --without-fp
39 endif
41 EGLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
42 EGLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
44 $(WRKBUILD)/.headers_configure:
45 mkdir -p $(EGLIBC_BUILD_DIR_INITIAL)
46 (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
47 ln -sf ../ports ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc);
48 $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
49 $(EGLIBC_BUILD_DIR_INITIAL)/option-groups.config
50 (cd $(EGLIBC_BUILD_DIR_INITIAL); \
51 ${EGLIBC_ENV} \
52 $(WRKBUILD)/libc/configure \
53 --prefix=$(STAGING_TARGET_DIR)/usr \
54 --with-headers=$(STAGING_TARGET_DIR)/usr/include \
55 ${EGLIBC_CONFOPTS} \
57 touch $@
59 $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
60 (cd $(EGLIBC_BUILD_DIR_INITIAL); \
61 PATH='${TARGET_PATH}' \
62 $(MAKE) install-headers install-bootstrap-headers=yes \
64 touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
65 touch $@
67 ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
68 EGLIBC_ENV+= libc_cv_ssp=yes
69 else
70 EGLIBC_ENV+= libc_cv_ssp=no
71 endif
73 $(WRKBUILD)/.configured:
74 mkdir -p $(EGLIBC_BUILD_DIR_FINAL)
75 $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
76 $(EGLIBC_BUILD_DIR_FINAL)/option-groups.config
77 (cd $(EGLIBC_BUILD_DIR_FINAL); \
78 ${EGLIBC_ENV} \
79 $(WRKBUILD)/libc/configure \
80 --prefix=/usr \
81 --enable-shared \
82 --enable-stackguard-randomization \
83 ${EGLIBC_CONFOPTS} \
85 touch $@
87 $(EGLIBC_BUILD_DIR_FINAL)/libc.so:
88 $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
89 ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) all
90 touch $@
92 $(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
93 ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
94 ${INSTALL_DATA} ${WRKBUILD}/libc/posix/gai.conf ${STAGING_TARGET_DIR}/etc/
95 ${INSTALL_DATA} ${WRKBUILD}/libc/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc/
96 ${INSTALL_DATA} ${WRKBUILD}/libc/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc/
97 touch $@
99 include ${TOPDIR}/mk/toolchain.mk