From 579213bdb0a2c5e82257c62364d99ad3533f2e2c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 11 Feb 2020 04:13:39 +0100 Subject: [PATCH] copysignf: Fix link error on HP-UX with cc. * m4/copysignf.m4 (gl_FUNC_COPYSIGNF): Require AC_CANONICAL_HOST. On HP-UX, set COPYSIGNF_LIBM to -lm. --- ChangeLog | 6 ++++++ m4/copysignf.m4 | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a256b809e7..321477d3de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-02-10 Bruno Haible + + copysignf: Fix link error on HP-UX with cc. + * m4/copysignf.m4 (gl_FUNC_COPYSIGNF): Require AC_CANONICAL_HOST. On + HP-UX, set COPYSIGNF_LIBM to -lm. + 2020-02-10 Bruno Haible pthread-mutex-tests, pthread-rwlock-tests: Fix link errors on HP-UX. diff --git a/m4/copysignf.m4 b/m4/copysignf.m4 index c6dea3e0db..284eb7489f 100644 --- a/m4/copysignf.m4 +++ b/m4/copysignf.m4 @@ -1,4 +1,4 @@ -# copysignf.m4 serial 3 +# copysignf.m4 serial 4 dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_COPYSIGNF], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl Persuade glibc to declare copysignf(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -28,7 +29,12 @@ AC_DEFUN([gl_FUNC_COPYSIGNF], else HAVE_COPYSIGNF=0 HAVE_DECL_COPYSIGNF=0 - COPYSIGNF_LIBM= + dnl On HP-UX 11.31/ia64, cc has a built-in for copysignf that redirects + dnl to the symbol '_copysignf', defined in libm, not libc. + case "$host_os" in + hpux*) COPYSIGNF_LIBM='-lm' ;; + *) COPYSIGNF_LIBM= ;; + esac fi AC_SUBST([COPYSIGNF_LIBM]) ]) -- 2.39.5