changeset 15556:d67698854fea

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.
author Bruno Haible <bruno@clisp.org>
date Fri, 02 Sep 2011 01:35:53 +0200
parents caabcfbb39a5
children 420f45741b92
files ChangeLog m4/strtoimax.m4 modules/strtoimax
diffstat 3 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -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_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
 ])
 
--- a/modules/strtoimax
+++ b/modules/strtoimax
@@ -8,13 +8,13 @@
 
 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