From ae006b4d5d64c1a5e1ac2b5bd45350d4d3ebb060 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 2 Sep 2011 01:35:53 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ m4/strtoimax.m4 | 6 +++--- modules/strtoimax | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41bcc813d..47f2e31d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-09-01 Bruno Haible + 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 + 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. diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 index 47fb1bc9c..a8d0b69c2 100644 --- 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_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 ]) diff --git a/modules/strtoimax b/modules/strtoimax index 567ce78c9..0e20a84b9 100644 --- a/modules/strtoimax +++ b/modules/strtoimax @@ -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 -- 2.11.0