changeset 12765:2614b91f7908

Avoid duplicate -lm.
author Bruno Haible <bruno@clisp.org>
date Wed, 20 Jan 2010 11:55:20 +0100
parents 602d53045ee7
children 2c14f1e449e5
files 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
diffstat 13 files changed, 180 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- 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+.
--- a/m4/acosl.m4
+++ b/m4/acosl.m4
@@ -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_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])
 ])
--- a/m4/asinl.m4
+++ b/m4/asinl.m4
@@ -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 @@
     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])
 ])
--- a/m4/atanl.m4
+++ b/m4/atanl.m4
@@ -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 @@
     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])
 ])
--- a/m4/cosl.m4
+++ b/m4/cosl.m4
@@ -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_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])
 ])
--- a/m4/isnan.m4
+++ b/m4/isnan.m4
@@ -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 @@
      && 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
--- a/m4/logl.m4
+++ b/m4/logl.m4
@@ -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_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])
 ])
--- a/m4/round.m4
+++ b/m4/round.m4
@@ -1,5 +1,5 @@
-# round.m4 serial 6
-dnl Copyright (C) 2007, 2009, 2010 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 @@
     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])
 ])
--- a/m4/roundf.m4
+++ b/m4/roundf.m4
@@ -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 @@
       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
--- a/m4/roundl.m4
+++ b/m4/roundl.m4
@@ -1,5 +1,5 @@
-# roundl.m4 serial 5
-dnl Copyright (C) 2007, 2009, 2010 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 @@
       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
--- a/m4/sinl.m4
+++ b/m4/sinl.m4
@@ -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_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])
 ])
--- a/m4/sqrtl.m4
+++ b/m4/sqrtl.m4
@@ -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_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])
 ])
--- a/m4/tanl.m4
+++ b/m4/tanl.m4
@@ -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_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])
 ])