Hi I am running gnu make 4.1 on Ubuntu. Make builds my C++ application that requires glibc 2.22 or higher. Ubuntu 14.04 has only glibc 2.19 so my makefile checks the host o/s and, if it's Ubuntu, it links to my private copy of glibc 2.22:
GLIBC_FLAGS= ifeq ($(DISTRO),debian) echo "Warning: detected Ubuntu o/s so using different glibc to that installed on this system" GLIBC=$(MY_OPEN_SOURCE_LIBS)/glibc/v2_22/ GLIBC_FLAGS= -Wl,-rpath=${GLIBC}:${GLIBC}/math:${GLIBC}/elf:${GLIBC}/dlfcn:${GLIBC}/nss:${GLIBC}/nis:${GLIBC}/rt:${GLIBC}/resolv:${GLIBC}/crypt:${GLIBC}/nptl\ -Wl,--dynamic-linker=${GLIBC}/elf/ld.so endif Now, Ubuntu 16.04 has glibc 2.23, so there I can use the standard glibc packaged for the o/s. So I want to change the makefile code to only use my private copy of glibc if glibc is <2.22. I'm not sure whether it's best to detect the o/s version or the glibc version. I can do the latter with: ~$ ldd --version ldd (Ubuntu GLIBC 2.23-0ubuntu2) 2.23 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. My question is, how can I extract the glibc version number from that ldd response and use it in my makefile to only set GLIBC and GLIBC_FLAGS if the glibc version is <2.22? Best regards David _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make