+2020-02-10 Bruno Haible <bruno@clisp.org>
+
+ 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 <bruno@clisp.org>
pthread-mutex-tests, pthread-rwlock-tests: Fix link errors on HP-UX.
-# 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,
AC_DEFUN([gl_FUNC_COPYSIGNF],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <math.h> to declare copysignf().
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
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])
])