]> Savannah Git Hosting - gnulib.git/commitdiff
copysignf: Fix link error on HP-UX with cc.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Feb 2020 03:13:39 +0000 (04:13 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 11 Feb 2020 03:13:39 +0000 (04:13 +0100)
* m4/copysignf.m4 (gl_FUNC_COPYSIGNF): Require AC_CANONICAL_HOST. On
HP-UX, set COPYSIGNF_LIBM to -lm.

ChangeLog
m4/copysignf.m4

index a256b809e7df7c598a3e30d685e92ea4fc0a4d89..321477d3de539ad2bb71f7dd9ea501d7839dbc78 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index c6dea3e0db03c8f6835813e94966746522af20b0..284eb7489faebec3198b04e7d40182aaa47af042 100644 (file)
@@ -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 <math.h> 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])
 ])