src/toolchain/glibc/Makefile

58 lines
1.6 KiB
Makefile

# Makefile - hhl - /usr/src/toolchain/glibc
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = glibc
patches += glibc-2.31-fhs-1.patch
patches += glibc-no-test-installation.patch
patches += ldd-rewrite-nobash.patch
include world.mk
-include locales.mk
config_opts += --host=$(tgt)
config_opts += --enable-kernel=3.2
config_opts += --disable-werror
config_opts += --enable-stack-protector=strong
config_opts += libc_cv_slibdir=/lib
ifeq ($(arch),x86_64)
define makelinks
ln -sfv ../lib/ld-linux-x86-64.so.2 $(DESTDIR)/lib64
ln -sfv ../lib/ld-linux-x86-64.so.2 $(DESTDIR)/lib64/ld-lsb-x86-64.so.3
endef
else ifeq ($(arch),armv7l)
makelinks = ln -sfv ld-2.31.so $(DESTDIR)/lib/ld-linux.so.3
else ifeq ($(arch),riscv64)
makelinks = ln -sfv ../lib/ld-linux-riscv64-lp64d.so.1 $(DESTDIR)/lib64
endif
ifdef locales
define makelocales
install -d $(DESTDIR)/usr/lib/locale
localedef -i POSIX -f UTF-8 C.UTF-8 --prefix=$(DESTDIR) 2> /dev/null || true
for l in ${locales} ; \
do localedef -i $$(echo $${l} | cut -f 1 -d '.') -f \
$$(echo $${l} | cut -f 2 -d '.') $${l} --prefix=$(DESTDIR) ; done
endef
else
makelocales = $(MAKE) DESTDIR=$(DESTDIR) -C $(objdir) localedata/install-locales
endif
define post_install
${makelinks}
install -d $(DESTDIR)/var/cache/nscd
install -m0644 $(srcdir)/nscd/nscd.conf $(DESTDIR)/etc
install -m0644 $(wkgdir)/etc/nsswitch.conf $(DESTDIR)/etc
install -m0644 $(wkgdir)/etc/ld.so.conf $(DESTDIR)/etc
$(makelocales)
endef
include targets.mk
$(srcdir)/.dirstamp: | $(global_srcdir)
$(global_srcdir):
install -d $@