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 $(ADK_TOPDIR
)/rules.mk
7 TARGET_CFLAGS
:= $(filter-out -ffast-math
,$(TARGET_CFLAGS
))
9 # glibc does not compile with Os
10 TARGET_CFLAGS
:= $(subst Os
,O2
,$(TARGET_CFLAGS
))
16 include ${ADK_TOPDIR}/mk
/buildhlp.mk
18 GLIBC_MAKEOPTS
+= cross-compiling
=yes
19 ifeq (${ADK_MAKE_PARALLEL},y
)
20 GLIBC_MAKEOPTS
+= PARALLELMFLAGS
="-j$(ADK_MAKE_JOBS)"
24 GLIBC_BUILD_DIR_INITIAL
:= ${WRKDIR}/$(PKG_NAME
)-$(PKG_VERSION
)-headers
25 GLIBC_BUILD_DIR_FINAL
:= ${WRKDIR}/$(PKG_NAME
)-$(PKG_VERSION
)-final
27 $(WRKBUILD
)/.headers_configure
:
28 mkdir
-p
$(GLIBC_BUILD_DIR_INITIAL
)
29 (cd
$(GLIBC_BUILD_DIR_INITIAL
); \
31 $(WRKBUILD
)/configure \
32 --prefix=$(STAGING_TARGET_DIR
)/usr \
33 --with-sysroot
=$(STAGING_TARGET_DIR
) \
38 $(WRKBUILD
)/.headers
: $(WRKBUILD
)/.headers_configure
39 (cd
$(GLIBC_BUILD_DIR_INITIAL
); \
41 $(MAKE
) ${GLIBC_MAKEOPTS} install-headers \
43 touch
$(STAGING_TARGET_DIR
)/usr
/include/gnu
/stubs.h
44 touch
$(STAGING_TARGET_DIR
)/usr
/include/gnu
/stubs-
{32,x32
,64,soft
,hard
}.h
47 $(WRKBUILD
)/.configured
:
48 mkdir
-p
$(GLIBC_BUILD_DIR_FINAL
)
49 (cd
$(GLIBC_BUILD_DIR_FINAL
); \
51 $(WRKBUILD
)/configure \
54 --enable-stackguard-randomization \
59 $(WRKBUILD
)/.compiled
:
60 ${GLIBC_ENV} $(MAKE
) ${GLIBC_MAKEOPTS} asm-CPPFLAGS
='$${CFLAGS}' -C
$(GLIBC_BUILD_DIR_FINAL
) all
63 $(WRKBUILD
)/.installed
:
64 ${GLIBC_ENV} $(MAKE
) -C
$(GLIBC_BUILD_DIR_FINAL
) install_root
=$(STAGING_TARGET_DIR
) install
65 mkdir
-p
${STAGING_TARGET_DIR}/etc
66 ${INSTALL_DATA} ${WRKBUILD}/posix
/gai.conf
${STAGING_TARGET_DIR}/etc
67 ${INSTALL_DATA} ${WRKBUILD}/nss
/nsswitch.conf
${STAGING_TARGET_DIR}/etc
71 -find
$(STAGING_TARGET_DIR
) $(STAGING_HOST_DIR
) -name \
*.la
-exec
rm {} \
;
72 rm -rf
$(STAGING_TARGET_DIR
)/usr
/share
/locale
$(STAGING_TARGET_DIR
)/usr
/share
/i18n
73 ifeq ($(ADK_TARGET_TOOLCHAIN
),y
)
74 # strip target libs and host tools for toolchain builds
75 PATH
="$(TARGET_PATH)" debug
='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
76 $(STAGING_TARGET_DIR
) $(TOOLCHAIN_DIR
)/usr
/lib
/gcc
/$(GNU_TARGET_NAME
)
77 debug
='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh
$(TOOLCHAIN_DIR
)/usr
/bin
81 include ${ADK_TOPDIR}/mk
/toolchain.mk