strtoimax: Avoid link error on OSF/1 with DTK cc.
authorBruno Haible <bruno@clisp.org>
Thu, 1 Sep 2011 23:35:53 +0000 (01:35 +0200)
committerIan Beckwith <ianb@erislabs.net>
Thu, 8 Sep 2011 01:56:53 +0000 (02:56 +0100)
* m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Always test whether strtoimax is
defined as a function.
* modules/strtoimax (Depends-on, configure.ac): Test only whether
strtoimax is defined, not whether it is declared.
(cherry picked from commit ae006b4d5d64c1a5e1ac2b5bd45350d4d3ebb060)

ChangeLog
m4/strtoimax.m4
modules/strtoimax

index 37dae77..b2d6e07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-09-01  Bruno Haible  <bruno@clisp.org>
 
+       strtoimax: Avoid link error on OSF/1 with DTK cc.
+       * m4/strtoimax.m4 (gl_FUNC_STRTOIMAX): Always test whether strtoimax is
+       defined as a function.
+       * modules/strtoimax (Depends-on, configure.ac): Test only whether
+       strtoimax is defined, not whether it is declared.
+
+2011-09-01  Bruno Haible  <bruno@clisp.org>
+
        imaxdiv: Avoid link error on OSF/1 with DTK cc.
        * m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Also test whether imaxdiv is defined
        as a function.
index 47fb1bc..a8d0b69 100644 (file)
@@ -1,4 +1,4 @@
-# strtoimax.m4 serial 10
+# strtoimax.m4 serial 11
 dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,11 +8,11 @@ AC_DEFUN([gl_FUNC_STRTOIMAX],
 [
   AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
 
+  dnl On OSF/1 5.1 with cc, this function is declared but not defined.
+  AC_CHECK_FUNCS_ONCE([strtoimax])
   AC_CHECK_DECLS_ONCE([strtoimax])
   if test "$ac_cv_have_decl_strtoimax" != yes; then
     HAVE_DECL_STRTOIMAX=0
-
-    AC_CHECK_FUNCS([strtoimax])
   fi
 ])
 
index 567ce78..0e20a84 100644 (file)
@@ -8,13 +8,13 @@ m4/strtoimax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no]
-stdint          [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no]
-strtoll         [test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes]
+verify          [test $ac_cv_func_strtoimax = no]
+stdint          [test $ac_cv_func_strtoimax = no]
+strtoll         [test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes]
 
 configure.ac:
 gl_FUNC_STRTOIMAX
-if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then
+if test $ac_cv_func_strtoimax = no; then
   AC_LIBOBJ([strtoimax])
   gl_PREREQ_STRTOIMAX
 fi