Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/ceill.m4 @ 11386:23f58a4ffca0
Followup to 2008-12-22: Remove unnecessary AC_FUNC_MBRTOWC invocations.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 10 Mar 2009 01:19:40 +0100 |
parents | 6dad92faecd1 |
children | c2cbabec01dd |
rev | line source |
---|---|
11229
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
9425
diff
changeset
|
1 # ceill.m4 serial 4 |
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
9425
diff
changeset
|
2 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. |
9297 | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 AC_DEFUN([gl_FUNC_CEILL], | |
8 [ | |
9 AC_REQUIRE([gl_MATH_H_DEFAULTS]) | |
10 dnl Persuade glibc <math.h> to declare ceill(). | |
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | |
12 dnl Test whether ceill() is declared. | |
13 AC_CHECK_DECLS([ceill], , , [#include <math.h>]) | |
14 if test "$ac_cv_have_decl_ceill" = yes; then | |
15 dnl Test whether ceill() can be used without libm. | |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
16 gl_FUNC_CEILL_LIBS |
9297 | 17 if test "$CEILL_LIBM" = "?"; then |
9420
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
18 dnl Sun C 5.0 on Solaris declares ceill() and has it in the system-wide |
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
19 dnl libm.so, but not in the libm.so that the compiler uses. |
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
20 REPLACE_CEILL=1 |
9297 | 21 fi |
22 else | |
9420
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
23 REPLACE_CEILL=1 |
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
24 fi |
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
25 if test $REPLACE_CEILL = 1; then |
9297 | 26 AC_LIBOBJ([ceill]) |
27 CEILL_LIBM= | |
28 fi | |
9420
9e0484f26251
Fix link errors with Sun C 5.0 on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents:
9419
diff
changeset
|
29 AC_SUBST([REPLACE_CEILL]) |
9297 | 30 AC_SUBST([CEILL_LIBM]) |
31 ]) | |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
32 |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
33 # Determines the libraries needed to get the ceill() function. |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
34 # Sets CEILL_LIBM. |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
35 AC_DEFUN([gl_FUNC_CEILL_LIBS], |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
36 [ |
11229
6dad92faecd1
Avoid spurious "(cached)" in configure output.
Bruno Haible <bruno@clisp.org>
parents:
9425
diff
changeset
|
37 gl_CACHE_VAL_SILENT([gl_cv_func_ceill_libm], [ |
9425
b60ac48de79f
Rename the cache variable to contain the special marker '_cv_'.
Bruno Haible <bruno@clisp.org>
parents:
9420
diff
changeset
|
38 gl_cv_func_ceill_libm=? |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
39 AC_TRY_LINK([ |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
40 #ifndef __NO_MATH_INLINES |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
41 # define __NO_MATH_INLINES 1 /* for glibc */ |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
42 #endif |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
43 #include <math.h> |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
44 long double x;], |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
45 [x = ceill(x);], |
9425
b60ac48de79f
Rename the cache variable to contain the special marker '_cv_'.
Bruno Haible <bruno@clisp.org>
parents:
9420
diff
changeset
|
46 [gl_cv_func_ceill_libm=]) |
b60ac48de79f
Rename the cache variable to contain the special marker '_cv_'.
Bruno Haible <bruno@clisp.org>
parents:
9420
diff
changeset
|
47 if test "$gl_cv_func_ceill_libm" = "?"; then |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
48 save_LIBS="$LIBS" |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
49 LIBS="$LIBS -lm" |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
50 AC_TRY_LINK([ |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
51 #ifndef __NO_MATH_INLINES |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
52 # define __NO_MATH_INLINES 1 /* for glibc */ |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
53 #endif |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
54 #include <math.h> |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
55 long double x;], |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
56 [x = ceill(x);], |
9425
b60ac48de79f
Rename the cache variable to contain the special marker '_cv_'.
Bruno Haible <bruno@clisp.org>
parents:
9420
diff
changeset
|
57 [gl_cv_func_ceill_libm="-lm"]) |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
58 LIBS="$save_LIBS" |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
59 fi |
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
60 ]) |
9425
b60ac48de79f
Rename the cache variable to contain the special marker '_cv_'.
Bruno Haible <bruno@clisp.org>
parents:
9420
diff
changeset
|
61 CEILL_LIBM="$gl_cv_func_ceill_libm" |
9419
8c764a2deb81
Put the test whether the floor or ceil variant needs libm into a separate macro.
Bruno Haible <bruno@clisp.org>
parents:
9297
diff
changeset
|
62 ]) |