Avoid duplicate -lm.
authorBruno Haible <bruno@clisp.org>
Wed, 20 Jan 2010 10:55:20 +0000 (11:55 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 20 Jan 2010 10:55:20 +0000 (11:55 +0100)
13 files changed:
ChangeLog
m4/acosl.m4
m4/asinl.m4
m4/atanl.m4
m4/cosl.m4
m4/isnan.m4
m4/logl.m4
m4/round.m4
m4/roundf.m4
m4/roundl.m4
m4/sinl.m4
m4/sqrtl.m4
m4/tanl.m4

index a5e0da60b9a2b3d1dc5c2e3355b0efd222c228ad..444f5b6aa5d43723272ee0efb7fba560f25899b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-20  Bruno Haible  <bruno@clisp.org>
+
+       Avoid duplicate -lm.
+       * m4/isnan.m4 (gl_ISNAN): Avoid duplicate -lm in $ISNAN_LIBM.
+       * m4/round.m4 (gl_FUNC_ROUND): Avoid duplicate -lm in $ROUND_LIBM.
+       * m4/roundf.m4 (gl_FUNC_ROUNDF): Avoid duplicate -lm in $ROUNDF_LIBM.
+       * m4/roundl.m4 (gl_FUNC_ROUNDL): Avoid duplicate -lm in $ROUNDL_LIBM.
+       * m4/acosl.m4 (gl_FUNC_ACOSL): Avoid duplicate -lm in $ACOSL_LIBM.
+       * m4/cosl.m4 (gl_FUNC_COSL): Avoid duplicate -lm in $COSL_LIBM.
+       * m4/logl.m4 (gl_FUNC_LOGL): Avoid duplicate -lm in $LOGL_LIBM.
+       * m4/sinl.m4 (gl_FUNC_SINL): Avoid duplicate -lm in $SINL_LIBM.
+       * m4/sqrtl.m4 (gl_FUNC_SQRTL): Avoid duplicate -lm in $SQRTL_LIBM.
+       * m4/tanl.m4 (gl_FUNC_TANL): Avoid duplicate -lm in $TANL_LIBM.
+       * m4/asinl.m4 (gl_FUNC_ASINL): Same change, for consistency.
+       * m4/atanl.m4 (gl_FUNC_ATANL): Likewise.
+       Reported by Paolo Bonzini.
+
 2010-01-19  Bruno Haible  <bruno@clisp.org>
 
        langinfo, nl_langinfo: Relicense under LGPLv2+.
index 0e57df5b25e1a45f7277166ed61c15d09d12cdb0..66cbd6cd9e583dc6eb031cde53812a38b24729a2 100644 (file)
@@ -1,4 +1,4 @@
-# acosl.m4 serial 1
+# acosl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -54,7 +54,16 @@ AC_DEFUN([gl_FUNC_ACOSL],
     AC_LIBOBJ([acosl])
     AC_REQUIRE([gl_FUNC_ASINL])
     AC_REQUIRE([gl_FUNC_SQRTL])
-    ACOSL_LIBM="$ASINL_LIBM $SQRTL_LIBM"
+    dnl Append $ASINL_LIBM to ACOSL_LIBM, avoiding gratuitous duplicates.
+    case " $ACOSL_LIBM " in
+      *" $ASINL_LIBM "*) ;;
+      *) ACOSL_LIBM="$ACOSL_LIBM $ASINL_LIBM" ;;
+    esac
+    dnl Append $SQRTL_LIBM to ACOSL_LIBM, avoiding gratuitous duplicates.
+    case " $ACOSL_LIBM " in
+      *" $SQRTL_LIBM "*) ;;
+      *) ACOSL_LIBM="$ACOSL_LIBM $SQRTL_LIBM" ;;
+    esac
   fi
   AC_SUBST([ACOSL_LIBM])
 ])
index f2281a2327125dd3c1378ef960a1a8fd71832702..1f5bc6df4a8e627e0924dc9bdf55f4d92587ee11 100644 (file)
@@ -1,4 +1,4 @@
-# asinl.m4 serial 1
+# asinl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -53,7 +53,11 @@ AC_DEFUN([gl_FUNC_ASINL],
     HAVE_ASINL=0
     AC_LIBOBJ([asinl])
     AC_REQUIRE([gl_FUNC_SQRTL])
-    ASINL_LIBM="$SQRTL_LIBM"
+    dnl Append $SQRTL_LIBM to ASINL_LIBM, avoiding gratuitous duplicates.
+    case " $ASINL_LIBM " in
+      *" $SQRTL_LIBM "*) ;;
+      *) ASINL_LIBM="$ASINL_LIBM $SQRTL_LIBM" ;;
+    esac
   fi
   AC_SUBST([ASINL_LIBM])
 ])
index 507f22b8ba30daa389b6cb951bddf9616cc2ffa9..28cf7b3a81f4112e5059800235f4d95cdae7d49c 100644 (file)
@@ -1,4 +1,4 @@
-# atanl.m4 serial 1
+# atanl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -53,7 +53,11 @@ AC_DEFUN([gl_FUNC_ATANL],
     HAVE_ATANL=0
     AC_LIBOBJ([atanl])
     AC_REQUIRE([gl_FUNC_ISNANL])
-    ATANL_LIBM="$ISNANL_LIBM"
+    dnl Append $ISNANL_LIBM to ATANL_LIBM, avoiding gratuitous duplicates.
+    case " $ATANL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) ATANL_LIBM="$ATANL_LIBM $ISNANL_LIBM" ;;
+    esac
   fi
   AC_SUBST([ATANL_LIBM])
 ])
index 460d0f00244ff4d5388c0acbf6bf35f25b1fe958..74c9e7c6d591da9eb490f1d23fb7f9b375ac9332 100644 (file)
@@ -1,4 +1,4 @@
-# cosl.m4 serial 1
+# cosl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,7 +57,21 @@ AC_DEFUN([gl_FUNC_COSL],
     AC_REQUIRE([gl_FUNC_ISNANL])
     AC_REQUIRE([gl_FUNC_FLOOR])
     AC_REQUIRE([gl_FUNC_FLOORL])
-    COSL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+    dnl Append $ISNANL_LIBM to COSL_LIBM, avoiding gratuitous duplicates.
+    case " $COSL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) COSL_LIBM="$COSL_LIBM $ISNANL_LIBM" ;;
+    esac
+    dnl Append $FLOOR_LIBM to COSL_LIBM, avoiding gratuitous duplicates.
+    case " $COSL_LIBM " in
+      *" $FLOOR_LIBM "*) ;;
+      *) COSL_LIBM="$COSL_LIBM $FLOOR_LIBM" ;;
+    esac
+    dnl Append $FLOORL_LIBM to COSL_LIBM, avoiding gratuitous duplicates.
+    case " $COSL_LIBM " in
+      *" $FLOORL_LIBM "*) ;;
+      *) COSL_LIBM="$COSL_LIBM $FLOORL_LIBM" ;;
+    esac
   fi
   AC_SUBST([COSL_LIBM])
 ])
index 848c2f9b929316c8b06f1c14fda8c89147ebe58a..eb61d5667876a5c0b6620f82d27651e99207d101 100644 (file)
@@ -1,4 +1,4 @@
-# isnan.m4 serial 2
+# isnan.m4 serial 3
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,22 @@ AC_DEFUN([gl_ISNAN],
      && test $gl_func_isnand = yes \
      && test $gl_func_isnanl = yes; then
     AC_MSG_RESULT([yes])
-    ISNAN_LIBM="$ISNANF_LIBM $ISNAND_LIBM $ISNANL_LIBM"
+    ISNAN_LIBM=
+    dnl Append $ISNANF_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
+    case " $ISNAN_LIBM " in
+      *" $ISNANF_LIBM "*) ;;
+      *) ISNAN_LIBM="$ISNAN_LIBM $ISNANF_LIBM" ;;
+    esac
+    dnl Append $ISNAND_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
+    case " $ISNAN_LIBM " in
+      *" $ISNAND_LIBM "*) ;;
+      *) ISNAN_LIBM="$ISNAN_LIBM $ISNAND_LIBM" ;;
+    esac
+    dnl Append $ISNANL_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
+    case " $ISNAN_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) ISNAN_LIBM="$ISNAN_LIBM $ISNANL_LIBM" ;;
+    esac
   else
     AC_MSG_RESULT([no])
     REPLACE_ISNAN=1
index 196dcbdaa118c82ed0ce4671d13e5b538db456ac..eab591e2e3857485f6c89b4ec2f082261165f88e 100644 (file)
@@ -1,4 +1,4 @@
-# logl.m4 serial 1
+# logl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -55,7 +55,21 @@ AC_DEFUN([gl_FUNC_LOGL],
     AC_REQUIRE([gl_FUNC_FREXPL])
     AC_REQUIRE([gl_FUNC_ISNANL])
     AC_REQUIRE([gl_FUNC_FLOORL])
-    LOGL_LIBM="$FREXPL_LIBM $ISNANL_LIBM $FLOORL_LIBM"
+    dnl Append $FREXPL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates.
+    case " $LOGL_LIBM " in
+      *" $FREXPL_LIBM "*) ;;
+      *) LOGL_LIBM="$LOGL_LIBM $FREXPL_LIBM" ;;
+    esac
+    dnl Append $ISNANL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates.
+    case " $LOGL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) LOGL_LIBM="$LOGL_LIBM $ISNANL_LIBM" ;;
+    esac
+    dnl Append $FLOORL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates.
+    case " $LOGL_LIBM " in
+      *" $FLOORL_LIBM "*) ;;
+      *) LOGL_LIBM="$LOGL_LIBM $FLOORL_LIBM" ;;
+    esac
   fi
   AC_SUBST([LOGL_LIBM])
 ])
index 2e13b44570057193d68a2959134ac9ceefa99977..8860e0151b21d004da41eb7b8f156dc65679f54c 100644 (file)
@@ -1,5 +1,5 @@
-# round.m4 serial 6
-dnl Copyright (C) 2007, 20092010 Free Software Foundation, Inc.
+# round.m4 serial 7
+dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -56,7 +56,17 @@ int main()
     AC_LIBOBJ([round])
     gl_FUNC_FLOOR_LIBS
     gl_FUNC_CEIL_LIBS
-    ROUND_LIBM="$FLOOR_LIBM $CEIL_LIBM"
+    ROUND_LIBM=
+    dnl Append $FLOOR_LIBM to ROUND_LIBM, avoiding gratuitous duplicates.
+    case " $ROUND_LIBM " in
+      *" $FLOOR_LIBM "*) ;;
+      *) ROUND_LIBM="$ROUND_LIBM $FLOOR_LIBM" ;;
+    esac
+    dnl Append $CEIL_LIBM to ROUND_LIBM, avoiding gratuitous duplicates.
+    case " $ROUND_LIBM " in
+      *" $CEIL_LIBM "*) ;;
+      *) ROUND_LIBM="$ROUND_LIBM $CEIL_LIBM" ;;
+    esac
   fi
   AC_SUBST([ROUND_LIBM])
 ])
index 6614241e74df19ff24b3cf8755558db20d0b36b4..b246d0432d33e7e890e5bbaeda24abbe9b832c7b 100644 (file)
@@ -1,4 +1,4 @@
-# roundf.m4 serial 7
+# roundf.m4 serial 8
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,7 +59,17 @@ int main()
       if test "$FLOORF_LIBM" != '?' && test "$CEILF_LIBM" != '?'; then
         AC_DEFINE([HAVE_FLOORF_AND_CEILF], [1],
           [Define if the both the floorf() and ceilf() functions exist.])
-        ROUNDF_LIBM="$FLOORF_LIBM $CEILF_LIBM"
+        ROUNDF_LIBM=
+        dnl Append $FLOORF_LIBM to ROUNDF_LIBM, avoiding gratuitous duplicates.
+        case " $ROUNDF_LIBM " in
+          *" $FLOORF_LIBM "*) ;;
+          *) ROUNDF_LIBM="$ROUNDF_LIBM $FLOORF_LIBM" ;;
+        esac
+        dnl Append $CEILF_LIBM to ROUNDF_LIBM, avoiding gratuitous duplicates.
+        case " $ROUNDF_LIBM " in
+          *" $CEILF_LIBM "*) ;;
+          *) ROUNDF_LIBM="$ROUNDF_LIBM $CEILF_LIBM" ;;
+        esac
       else
         ROUNDF_LIBM=
       fi
index 66bdd00907067feee0e3c43bcbbccdca3e50b73e..3011c378460d2496f47aa4e1c6a68f0d26147d58 100644 (file)
@@ -1,5 +1,5 @@
-# roundl.m4 serial 5
-dnl Copyright (C) 2007, 20092010 Free Software Foundation, Inc.
+# roundl.m4 serial 6
+dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -24,7 +24,17 @@ AC_DEFUN([gl_FUNC_ROUNDL],
       if test "$FLOORL_LIBM" != '?' && test "$CEILL_LIBM" != '?'; then
         AC_DEFINE([HAVE_FLOORL_AND_CEILL], [1],
           [Define if the both the floorl() and ceill() functions exist.])
-        ROUNDL_LIBM="$FLOORL_LIBM $CEILL_LIBM"
+        ROUNDL_LIBM=
+        dnl Append $FLOORL_LIBM to ROUNDL_LIBM, avoiding gratuitous duplicates.
+        case " $ROUNDL_LIBM " in
+          *" $FLOORL_LIBM "*) ;;
+          *) ROUNDL_LIBM="$ROUNDL_LIBM $FLOORL_LIBM" ;;
+        esac
+        dnl Append $CEILL_LIBM to ROUNDL_LIBM, avoiding gratuitous duplicates.
+        case " $ROUNDL_LIBM " in
+          *" $CEILL_LIBM "*) ;;
+          *) ROUNDL_LIBM="$ROUNDL_LIBM $CEILL_LIBM" ;;
+        esac
       else
         ROUNDL_LIBM=
       fi
index 12393264b680c0961432b3069fcf2e57b0136a9c..c9c0e5c48e4b26a46d9fe2053808902dc4dfaa50 100644 (file)
@@ -1,4 +1,4 @@
-# sinl.m4 serial 1
+# sinl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,7 +57,21 @@ AC_DEFUN([gl_FUNC_SINL],
     AC_REQUIRE([gl_FUNC_ISNANL])
     AC_REQUIRE([gl_FUNC_FLOOR])
     AC_REQUIRE([gl_FUNC_FLOORL])
-    SINL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+    dnl Append $ISNANL_LIBM to SINL_LIBM, avoiding gratuitous duplicates.
+    case " $SINL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) SINL_LIBM="$SINL_LIBM $ISNANL_LIBM" ;;
+    esac
+    dnl Append $FLOOR_LIBM to SINL_LIBM, avoiding gratuitous duplicates.
+    case " $SINL_LIBM " in
+      *" $FLOOR_LIBM "*) ;;
+      *) SINL_LIBM="$SINL_LIBM $FLOOR_LIBM" ;;
+    esac
+    dnl Append $FLOORL_LIBM to SINL_LIBM, avoiding gratuitous duplicates.
+    case " $SINL_LIBM " in
+      *" $FLOORL_LIBM "*) ;;
+      *) SINL_LIBM="$SINL_LIBM $FLOORL_LIBM" ;;
+    esac
   fi
   AC_SUBST([SINL_LIBM])
 ])
index 7a29f9ad4f9b8d4eb1d19efb7ce5adfd3a57835e..21b1c6835d2b49eb5ad130a1a5c76bfa6ad5a578 100644 (file)
@@ -1,4 +1,4 @@
-# sqrtl.m4 serial 1
+# sqrtl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,7 +56,26 @@ AC_DEFUN([gl_FUNC_SQRTL],
     AC_REQUIRE([gl_FUNC_FREXPL])
     AC_REQUIRE([gl_FUNC_LDEXPL])
     AC_REQUIRE([gl_FUNC_SQRT])
-    SQRTL_LIBM="$ISNANL_LIBM $FREXPL_LIBM $LDEXPL_LIBM $SQRT_LIBM"
+    dnl Append $ISNANL_LIBM to SQRTL_LIBM, avoiding gratuitous duplicates.
+    case " $SQRTL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) SQRTL_LIBM="$SQRTL_LIBM $ISNANL_LIBM" ;;
+    esac
+    dnl Append $FREXPL_LIBM to SQRTL_LIBM, avoiding gratuitous duplicates.
+    case " $SQRTL_LIBM " in
+      *" $FREXPL_LIBM "*) ;;
+      *) SQRTL_LIBM="$SQRTL_LIBM $FREXPL_LIBM" ;;
+    esac
+    dnl Append $LDEXPL_LIBM to SQRTL_LIBM, avoiding gratuitous duplicates.
+    case " $SQRTL_LIBM " in
+      *" $LDEXPL_LIBM "*) ;;
+      *) SQRTL_LIBM="$SQRTL_LIBM $LDEXPL_LIBM" ;;
+    esac
+    dnl Append $SQRT_LIBM to SQRTL_LIBM, avoiding gratuitous duplicates.
+    case " $SQRTL_LIBM " in
+      *" $SQRT_LIBM "*) ;;
+      *) SQRTL_LIBM="$SQRTL_LIBM $SQRT_LIBM" ;;
+    esac
   fi
   AC_SUBST([SQRTL_LIBM])
 ])
index 8f4ee101ab9e9e7294e9626e2381d562a4d272c3..0e785057fd891b03ff2960454f46a72e25703995 100644 (file)
@@ -1,4 +1,4 @@
-# tanl.m4 serial 1
+# tanl.m4 serial 2
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,7 +56,21 @@ AC_DEFUN([gl_FUNC_TANL],
     AC_REQUIRE([gl_FUNC_ISNANL])
     AC_REQUIRE([gl_FUNC_FLOOR])
     AC_REQUIRE([gl_FUNC_FLOORL])
-    TANL_LIBM="$ISNANL_LIBM $FLOOR_LIBM $FLOORL_LIBM"
+    dnl Append $ISNANL_LIBM to TANL_LIBM, avoiding gratuitous duplicates.
+    case " $TANL_LIBM " in
+      *" $ISNANL_LIBM "*) ;;
+      *) TANL_LIBM="$TANL_LIBM $ISNANL_LIBM" ;;
+    esac
+    dnl Append $FLOOR_LIBM to TANL_LIBM, avoiding gratuitous duplicates.
+    case " $TANL_LIBM " in
+      *" $FLOOR_LIBM "*) ;;
+      *) TANL_LIBM="$TANL_LIBM $FLOOR_LIBM" ;;
+    esac
+    dnl Append $FLOORL_LIBM to TANL_LIBM, avoiding gratuitous duplicates.
+    case " $TANL_LIBM " in
+      *" $FLOORL_LIBM "*) ;;
+      *) TANL_LIBM="$TANL_LIBM $FLOORL_LIBM" ;;
+    esac
   fi
   AC_SUBST([TANL_LIBM])
 ])