From d87cc4d9a6945daf48848022c93d0d9a0489a87e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 19 Oct 2016 19:16:37 +0200 Subject: create empty static files conditionally --- Makefile.in | 26 +++++++++++++++++++++++++- libc/Makefile.in | 12 ++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index c289ed34b..877a0b69d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -363,7 +363,31 @@ else $(Q)cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -f wchar-stub.h endif -EMPTY_LIB_NAMES = m crypt nsl resolv util dl rt pthread intl +EMPTY_LIB_NAMES = dl +ifeq ($(DO_C99_MATH),y) +EMPTY_LIB_NAMES += m +endif +ifeq ($(UCLIBC_HAS_THREADS),y) +EMPTY_LIB_NAMES += pthread +endif +ifeq ($(UCLIBC_HAS_REALTIME),y) +EMPTY_LIB_NAMES += rt +endif +ifeq ($(UCLIBC_HAS_CRYPT),y) +EMPTY_LIB_NAMES += crypt +endif +ifeq ($(UCLIBC_HAS_LIBUTIL),y) +EMPTY_LIB_NAMES += util +endif +ifeq ($(UCLIBC_HAS_LIBRESOLV_STUB),y) +EMPTY_LIB_NAMES += resolv +endif +ifeq ($(UCLIBC_HAS_LIBNSL_STUB),y) +EMPTY_LIB_NAMES += nsl +endif +ifeq ($(UCLIBC_HAS_GETTEXT_AWARENESS),y) +EMPTY_LIB_NAMES += intl +endif EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a) $(EMPTY_LIBS): diff --git a/libc/Makefile.in b/libc/Makefile.in index 85986a7e9..714a66ea8 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -42,9 +42,9 @@ else libc-a-y = $(libc-y) $(libc-static-y) endif -libc-a-y += $(libnsl-a-y) -libc-a-y += $(libresolv-a-y) -libc-a-y += $(libm-a-y) +libc-a-$(DO_C99_MATH) += $(libm-a-y) +libc-a-$(UCLIBC_HAS_LIBNSL_STUB) += $(libnsl-a-y) +libc-a-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(libresolv-a-y) libc-a-$(UCLIBC_HAS_LIBUTIL) += $(libutil-a-y) libc-a-$(UCLIBC_HAS_CRYPT) += $(libcrypt-a-y) libc-a-$(UCLIBC_HAS_ARGP) += $(libuargp-a-y) @@ -55,10 +55,10 @@ libc-a-$(UCLIBC_HAS_BACKTRACE) += $(libubacktrace-a-y) libc-so-y = $(libc-y:.o=.os) $(libc-shared-y) -libc-so-y += $(libnsl-so-y) -libc-so-y += $(libresolv-so-y) libc-so-y += $(libdl-so-y) -libc-so-y += $(libm-so-y) +libc-so-$(DO_C99_MATH) += $(libm-so-y) +libc-so-$(UCLIBC_HAS_LIBNSL_STUB) += $(libnsl-so-y) +libc-so-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(libresolv-so-y) libc-so-$(UCLIBC_HAS_LIBUTIL) += $(libutil-so-y) libc-so-$(UCLIBC_HAS_CRYPT) += $(libcrypt-so-y) libc-so-$(UCLIBC_HAS_ARGP) += $(libuargp-so-y) -- cgit v1.2.3