diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-22 00:33:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-22 00:33:37 -0700 |
commit | aaa935591793937f354024fd094d2630d0399abc (patch) | |
tree | 42db7b1a06dd97ab8ae20bbc6a63cd18594db331 /m4 | |
parent | 36009a21cb540401591a4891e05e1c4b32a8c593 (diff) | |
download | emacs-aaa935591793937f354024fd094d2630d0399abc.tar.gz |
Simpler version of strtoumax module.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gl-comp.m4 | 37 | ||||
-rw-r--r-- | m4/inttypes-pri.m4 | 42 | ||||
-rw-r--r-- | m4/inttypes.m4 | 250 | ||||
-rw-r--r-- | m4/strtoimax.m4 | 30 | ||||
-rw-r--r-- | m4/strtol.m4 | 10 | ||||
-rw-r--r-- | m4/strtoll.m4 | 25 | ||||
-rw-r--r-- | m4/strtoul.m4 | 10 | ||||
-rw-r--r-- | m4/strtoumax.m4 | 35 | ||||
-rw-r--r-- | m4/wchar_h.m4 | 232 | ||||
-rw-r--r-- | m4/wint_t.m4 | 32 |
10 files changed, 33 insertions, 670 deletions
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4 index 5318a3fb61c..4ab10b54e8a 100644 --- a/m4/gl-comp.m4 +++ b/m4/gl-comp.m4 @@ -45,6 +45,7 @@ AC_DEFUN([gl_EARLY], # Code from module intprops: # Code from module inttypes: # Code from module lstat: + # Code from module manywarnings: # Code from module mktime: # Code from module multiarch: # Code from module readlink: @@ -57,11 +58,6 @@ AC_DEFUN([gl_EARLY], # Code from module stdio: # Code from module stdlib: # Code from module strftime: - # Code from module strtoimax: - # Code from module strtol: - # Code from module strtoll: - # Code from module strtoul: - # Code from module strtoull: # Code from module strtoumax: # Code from module symlink: # Code from module sys_stat: @@ -70,7 +66,7 @@ AC_DEFUN([gl_EARLY], # Code from module unistd: # Code from module verify: # Code from module warn-on-use: - # Code from module wchar: + # Code from module warnings: ]) # This macro should be invoked from ./configure.in, in the section @@ -122,6 +118,7 @@ AC_DEFUN([gl_INIT], # Code from module lstat: gl_FUNC_LSTAT gl_SYS_STAT_MODULE_INDICATOR([lstat]) + # Code from module manywarnings: # Code from module mktime: gl_FUNC_MKTIME gl_TIME_MODULE_INDICATOR([mktime]) @@ -149,19 +146,6 @@ AC_DEFUN([gl_INIT], gl_STDLIB_H # Code from module strftime: gl_FUNC_GNU_STRFTIME - # Code from module strtoimax: - gl_FUNC_STRTOIMAX - gl_INTTYPES_MODULE_INDICATOR([strtoimax]) - # Code from module strtol: - gl_FUNC_STRTOL - # Code from module strtoll: - gl_FUNC_STRTOLL - gl_STDLIB_MODULE_INDICATOR([strtoll]) - # Code from module strtoul: - gl_FUNC_STRTOUL - # Code from module strtoull: - gl_FUNC_STRTOULL - gl_STDLIB_MODULE_INDICATOR([strtoull]) # Code from module strtoumax: gl_FUNC_STRTOUMAX gl_INTTYPES_MODULE_INDICATOR([strtoumax]) @@ -180,8 +164,8 @@ AC_DEFUN([gl_INIT], gl_UNISTD_H # Code from module verify: # Code from module warn-on-use: - # Code from module wchar: - gl_WCHAR_H + # Code from module warnings: + AC_SUBST([WARN_CFLAGS]) # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -360,7 +344,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/strftime.h lib/strtoimax.c lib/strtol.c - lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c @@ -370,7 +353,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/time_r.c lib/unistd.in.h lib/verify.h - lib/wchar.in.h m4/00gnulib.m4 m4/c-strtod.m4 m4/extensions.m4 @@ -379,10 +361,10 @@ AC_DEFUN([gl_FILE_LIST], [ m4/getopt.m4 m4/gnulib-common.m4 m4/include_next.m4 - m4/inttypes-pri.m4 m4/inttypes.m4 m4/longlong.m4 m4/lstat.m4 + m4/manywarnings.m4 m4/md5.m4 m4/mktime.m4 m4/multiarch.m4 @@ -397,10 +379,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/stdio_h.m4 m4/stdlib_h.m4 m4/strftime.m4 - m4/strtoimax.m4 - m4/strtol.m4 - m4/strtoll.m4 - m4/strtoul.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/symlink.m4 @@ -410,7 +388,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/tm_gmtoff.m4 m4/unistd_h.m4 m4/warn-on-use.m4 - m4/wchar_h.m4 + m4/warnings.m4 m4/wchar_t.m4 - m4/wint_t.m4 ]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 deleted file mode 100644 index e252b27e8cb..00000000000 --- a/m4/inttypes-pri.m4 +++ /dev/null @@ -1,42 +0,0 @@ -# inttypes-pri.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1997-2002, 2006, 2008-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, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ([2.53]) - -# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -AC_DEFUN([gt_INTTYPES_PRI], -[ - AC_CHECK_HEADERS([inttypes.h]) - if test $ac_cv_header_inttypes_h = yes; then - AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], - [gt_cv_inttypes_pri_broken], - [ - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -#include <inttypes.h> -#ifdef PRId32 -char *p = PRId32; -#endif - ]], - [[]])], - [gt_cv_inttypes_pri_broken=no], - [gt_cv_inttypes_pri_broken=yes]) - ]) - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], - [Define if <inttypes.h> exists and defines unusable PRI* macros.]) - PRI_MACROS_BROKEN=1 - else - PRI_MACROS_BROKEN=0 - fi - AC_SUBST([PRI_MACROS_BROKEN]) -]) diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 92a4ac019f5..46a00c6d7aa 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 18 +# inttypes.m4 serial 19 dnl Copyright (C) 2006-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, @@ -10,138 +10,11 @@ dnl Test whether <inttypes.h> is supported or must be substituted. AC_DEFUN([gl_INTTYPES_H], [ AC_REQUIRE([gl_STDINT_H]) - AC_REQUIRE([gt_INTTYPES_PRI]) - AC_CHECK_HEADERS_ONCE([inttypes.h]) - AC_CHECK_DECLS_ONCE([imaxabs]) - AC_CHECK_DECLS_ONCE([imaxdiv]) - AC_CHECK_DECLS_ONCE([strtoimax]) - AC_CHECK_DECLS_ONCE([strtoumax]) - - dnl Now see if we need a substitute <inttypes.h>. - dnl A complete <inttypes.h> requires - dnl - a complete <stdint.h>, - dnl - the existence of an <inttypes.h>, - dnl - that imaxabs, imaxdiv, strtoimax, strtoumax are declared, - dnl - some additional tests. - AC_CACHE_CHECK([whether inttypes.h conforms to C99], - [gl_cv_header_working_inttypes_h], - [gl_cv_header_working_inttypes_h=no - if test "$gl_cv_header_working_stdint_h" = yes \ - && test $ac_cv_header_inttypes_h = yes \ - && test "$ac_cv_have_decl_imaxabs" = yes \ - && test "$ac_cv_have_decl_imaxdiv" = yes \ - && test "$ac_cv_have_decl_strtoimax" = yes \ - && test "$ac_cv_have_decl_strtoumax" = yes; then - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ -#include <stddef.h> -#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ -#define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */ -#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */ -#include <inttypes.h> - -/* No need to duplicate the tests of stdint.m4; they are subsumed by - $gl_cv_header_working_stdint_h = yes. */ - -/* Tests for macros supposed to be defined in inttypes.h. */ - -const char *k = /* implicit string concatenation */ -#ifdef INT8_MAX - PRId8 PRIi8 -#endif -#ifdef UINT8_MAX - PRIo8 PRIu8 PRIx8 PRIX8 -#endif -#ifdef INT16_MAX - PRId16 PRIi16 -#endif -#ifdef UINT16_MAX - PRIo16 PRIu16 PRIx16 PRIX16 -#endif -#ifdef INT32_MAX - PRId32 PRIi32 -#endif -#ifdef UINT32_MAX - PRIo32 PRIu32 PRIx32 PRIX32 -#endif -#ifdef INT64_MAX - PRId64 PRIi64 -#endif -#ifdef UINT64_MAX - PRIo64 PRIu64 PRIx64 PRIX64 -#endif - PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8 - PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16 - PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32 - PRIdLEAST64 PRIiLEAST64 - PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64 - PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8 - PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16 - PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32 - PRIdFAST64 PRIiFAST64 - PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64 - PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX -#ifdef INTPTR_MAX - PRIdPTR PRIiPTR -#endif -#ifdef UINTPTR_MAX - PRIoPTR PRIuPTR PRIxPTR PRIXPTR -#endif - ; -const char *l = /* implicit string concatenation */ -#ifdef INT8_MAX - SCNd8 SCNi8 -#endif -#ifdef UINT8_MAX - SCNo8 SCNu8 SCNx8 -#endif -#ifdef INT16_MAX - SCNd16 SCNi16 -#endif -#ifdef UINT16_MAX - SCNo16 SCNu16 SCNx16 -#endif -#ifdef INT32_MAX - SCNd32 SCNi32 -#endif -#ifdef UINT32_MAX - SCNo32 SCNu32 SCNx32 -#endif -#ifdef INT64_MAX - SCNd64 SCNi64 -#endif -#ifdef UINT64_MAX - SCNo64 SCNu64 SCNx64 -#endif - SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8 - SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16 - SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32 - SCNdLEAST64 SCNiLEAST64 - SCNoLEAST64 SCNuLEAST64 SCNxLEAST64 - SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8 - SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16 - SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32 - SCNdFAST64 SCNiFAST64 - SCNoFAST64 SCNuFAST64 SCNxFAST64 - SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX -#ifdef INTPTR_MAX - SCNdPTR SCNiPTR -#endif -#ifdef UINTPTR_MAX - SCNoPTR SCNuPTR SCNxPTR -#endif - ; - ]])], - [gl_cv_header_working_inttypes_h=yes]) - fi]) dnl Override <inttypes.h> always, so that the portability warnings work. AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([inttypes.h]) - AC_REQUIRE([gl_MULTIARCH]) - dnl Ensure that <stdint.h> defines the limit macros, since gnulib's dnl <inttypes.h> relies on them. This macro is only needed when a dnl C++ compiler is in use; it has no effect for a C compiler. @@ -158,129 +31,12 @@ const char *l = /* implicit string concatenation */ #endif ]) - PRIPTR_PREFIX= - if test -n "$STDINT_H"; then - dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'. - PRIPTR_PREFIX='"l"' - else - dnl Using the system's <stdint.h>. - for glpfx in '' l ll I64; do - case $glpfx in - '') gltype1='int';; - l) gltype1='long int';; - ll) gltype1='long long int';; - I64) gltype1='__int64';; - esac - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include <stdint.h> - extern intptr_t foo; - extern $gltype1 foo;]])], - [PRIPTR_PREFIX='"'$glpfx'"']) - test -n "$PRIPTR_PREFIX" && break - done - fi - AC_SUBST([PRIPTR_PREFIX]) - - if test "$ac_cv_have_decl_imaxabs" = yes; then - HAVE_DECL_IMAXABS=1 - else - HAVE_DECL_IMAXABS=0 - fi - - if test "$ac_cv_have_decl_imaxdiv" = yes; then - HAVE_DECL_IMAXDIV=1 - else - HAVE_DECL_IMAXDIV=0 - fi - - if test "$ac_cv_have_decl_strtoimax" = yes; then - HAVE_DECL_STRTOIMAX=1 - else - HAVE_DECL_STRTOIMAX=0 - fi - - if test "$ac_cv_have_decl_strtoumax" = yes; then - HAVE_DECL_STRTOUMAX=1 - else - HAVE_DECL_STRTOUMAX=0 - fi - - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( - [INT32_MAX_LT_INTMAX_MAX], - [defined INT32_MAX && defined INTMAX_MAX], - [INT32_MAX < INTMAX_MAX], - [sizeof (int) < sizeof (long long int)]) - if test $APPLE_UNIVERSAL_BUILD = 0; then - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( - [INT64_MAX_EQ_LONG_MAX], - [defined INT64_MAX], - [INT64_MAX == LONG_MAX], - [sizeof (long long int) == sizeof (long int)]) - else - INT64_MAX_EQ_LONG_MAX=-1 - fi - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( - [UINT32_MAX_LT_UINTMAX_MAX], - [defined UINT32_MAX && defined UINTMAX_MAX], - [UINT32_MAX < UINTMAX_MAX], - [sizeof (unsigned int) < sizeof (unsigned long long int)]) - if test $APPLE_UNIVERSAL_BUILD = 0; then - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( - [UINT64_MAX_EQ_ULONG_MAX], - [defined UINT64_MAX], - [UINT64_MAX == ULONG_MAX], - [sizeof (unsigned long long int) == sizeof (unsigned long int)]) - else - UINT64_MAX_EQ_ULONG_MAX=-1 - fi - dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include <inttypes.h> ]], [imaxabs imaxdiv strtoimax strtoumax]) ]) -# Define the symbol $1 to be 1 if the condition is true, 0 otherwise. -# If $2 is true, the condition is $3; otherwise if long long int is supported -# approximate the condition with $4; otherwise, assume the condition is false. -# The condition should work on all C99 platforms; the approximations should be -# good enough to work on all practical pre-C99 platforms. -# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants. -AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], -[ - AC_CACHE_CHECK([whether $3], - [gl_cv_test_$1], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[/* Work also in C++ mode. */ - #define __STDC_LIMIT_MACROS 1 - - /* Work if build is not clean. */ - #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - - #include <limits.h> - #if HAVE_STDINT_H - #include <stdint.h> - #endif - - #if $2 - #define CONDITION ($3) - #elif HAVE_LONG_LONG_INT - #define CONDITION ($4) - #else - #define CONDITION 0 - #endif - int test[CONDITION ? 1 : -1];]])], - [gl_cv_test_$1=yes], - [gl_cv_test_$1=no])]) - if test $gl_cv_test_$1 = yes; then - $1=1; - else - $1=0; - fi - AC_SUBST([$1]) -]) - AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. @@ -299,4 +55,8 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS], HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) ]) diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 deleted file mode 100644 index e82e7cd08f8..00000000000 --- a/m4/strtoimax.m4 +++ /dev/null @@ -1,30 +0,0 @@ -# strtoimax.m4 serial 8 -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, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRTOIMAX], -[ - AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro], - gl_cv_func_strtoimax_macro, - [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h> -#ifdef strtoimax - inttypes_h_defines_strtoimax -#endif], - gl_cv_func_strtoimax_macro=yes, - gl_cv_func_strtoimax_macro=no)]) - - if test "$gl_cv_func_strtoimax_macro" != yes; then - AC_REPLACE_FUNCS([strtoimax]) - if test $ac_cv_func_strtoimax = no; then - gl_PREREQ_STRTOIMAX - fi - fi -]) - -# Prerequisites of lib/strtoimax.c. -AC_DEFUN([gl_PREREQ_STRTOIMAX], [ - AC_CHECK_DECLS([strtoll]) - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) -]) diff --git a/m4/strtol.m4 b/m4/strtol.m4 deleted file mode 100644 index 10f0284bec5..00000000000 --- a/m4/strtol.m4 +++ /dev/null @@ -1,10 +0,0 @@ -# strtol.m4 serial 5 -dnl Copyright (C) 2002-2003, 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, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRTOL], -[ - AC_REPLACE_FUNCS([strtol]) -]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 deleted file mode 100644 index fd0a13db1bb..00000000000 --- a/m4/strtoll.m4 +++ /dev/null @@ -1,25 +0,0 @@ -# strtoll.m4 serial 6 -dnl Copyright (C) 2002, 2004, 2006, 2008-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, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRTOLL], -[ - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl We don't need (and can't compile) the replacement strtoll - dnl unless the type 'long long int' exists. - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - if test "$ac_cv_type_long_long_int" = yes; then - AC_REPLACE_FUNCS([strtoll]) - if test $ac_cv_func_strtoll = no; then - HAVE_STRTOLL=0 - gl_PREREQ_STRTOLL - fi - fi -]) - -# Prerequisites of lib/strtoll.c. -AC_DEFUN([gl_PREREQ_STRTOLL], [ - : -]) diff --git a/m4/strtoul.m4 b/m4/strtoul.m4 deleted file mode 100644 index 06979d16cd5..00000000000 --- a/m4/strtoul.m4 +++ /dev/null @@ -1,10 +0,0 @@ -# strtoul.m4 serial 4 -dnl Copyright (C) 2002, 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, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_FUNC_STRTOUL], -[ - AC_REPLACE_FUNCS([strtoul]) -]) diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4 index 448c4d9b777..d69c1f79c79 100644 --- a/m4/strtoumax.m4 +++ b/m4/strtoumax.m4 @@ -1,4 +1,4 @@ -# strtoumax.m4 serial 8 +# strtoumax.m4 serial 9 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, @@ -6,25 +6,32 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOUMAX], [ - AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro], - gl_cv_func_strtoumax_macro, - [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h> -#ifdef strtoumax - inttypes_h_defines_strtoumax -#endif], - gl_cv_func_strtoumax_macro=yes, - gl_cv_func_strtoumax_macro=no)]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) - if test "$gl_cv_func_strtoumax_macro" != yes; then - AC_REPLACE_FUNCS([strtoumax]) - if test $ac_cv_func_strtoumax = no; then - gl_PREREQ_STRTOUMAX + AC_CHECK_DECLS_ONCE([strtoumax]) + if test "$ac_cv_have_decl_strtoumax" != yes; then + HAVE_DECL_STRTOUMAX=0 + + AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro], + gl_cv_func_strtoumax_macro, + [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h> + #ifdef strtoumax + inttypes_h_defines_strtoumax + #endif], + gl_cv_func_strtoumax_macro=yes, + gl_cv_func_strtoumax_macro=no)]) + + if test "$gl_cv_func_strtoumax_macro" != yes; then + AC_REPLACE_FUNCS([strtoumax]) + if test $ac_cv_func_strtoumax = no; then + gl_PREREQ_STRTOUMAX + fi fi fi ]) # Prerequisites of lib/strtoumax.c. AC_DEFUN([gl_PREREQ_STRTOUMAX], [ - AC_CHECK_DECLS([strtoull]) AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + gl_FUNC_STRTOULL ]) diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 deleted file mode 100644 index 6255ff352de..00000000000 --- a/m4/wchar_h.m4 +++ /dev/null @@ -1,232 +0,0 @@ -dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. - -dnl Copyright (C) 2007-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, -dnl with or without modifications, as long as this notice is preserved. - -dnl Written by Eric Blake. - -# wchar_h.m4 serial 38 - -AC_DEFUN([gl_WCHAR_H], -[ - AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) - dnl Prepare for creating substitute <wchar.h>. - dnl Check for <wchar.h> (missing in Linux uClibc when built without wide - dnl character support). - dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK. - gl_CHECK_NEXT_HEADERS([wchar.h]) - if test $ac_cv_header_wchar_h = yes; then - HAVE_WCHAR_H=1 - else - HAVE_WCHAR_H=0 - fi - AC_SUBST([HAVE_WCHAR_H]) - - AC_REQUIRE([gl_FEATURES_H]) - - AC_REQUIRE([gt_TYPE_WINT_T]) - if test $gt_cv_c_wint_t = yes; then - HAVE_WINT_T=1 - else - HAVE_WINT_T=0 - fi - AC_SUBST([HAVE_WINT_T]) - - dnl Check for declarations of anything we want to poison if the - dnl corresponding gnulib module is not in use. - gl_WARN_ON_USE_PREPARE([[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include <stddef.h> -# include <stdio.h> -# include <time.h> -#endif -#include <wchar.h> - ]], - [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb - wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset - wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp - wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr - wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth - ]) -]) - -dnl Check whether <wchar.h> is usable at all. -AC_DEFUN([gl_WCHAR_H_INLINE_OK], -[ - dnl Test whether <wchar.h> suffers due to the transition from '__inline' to - dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022> - dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary, - dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and - dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>. - AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly], - [gl_cv_header_wchar_h_correct_inline], - [gl_cv_header_wchar_h_correct_inline=yes - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -extern int zero (void); -int main () { return zero(); } -]])]) - if AC_TRY_EVAL([ac_compile]); then - mv conftest.$ac_objext conftest1.$ac_objext - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be - included before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> -int zero (void) { return 0; } -]])]) - if AC_TRY_EVAL([ac_compile]); then - mv conftest.$ac_objext conftest2.$ac_objext - if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then - : - else - gl_cv_header_wchar_h_correct_inline=no - fi - fi - fi - rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext - ]) - if test $gl_cv_header_wchar_h_correct_inline = no; then - AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). -This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in -C99 mode. You have four options: - - Add the flag -fgnu89-inline to CC and reconfigure, or - - Fix your include files, using parts of - <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or - - Use a gcc version older than 4.3, or - - Don't use the flags -std=c99 or -std=gnu99. -Configuration aborted.]) - fi -]) - -dnl Unconditionally enables the replacement of <wchar.h>. -AC_DEFUN([gl_REPLACE_WCHAR_H], -[ - dnl This is a no-op, because <wchar.h> is always overridden. - : -]) - -AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], -[ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - gl_MODULE_INDICATOR_SET_VARIABLE([$1]) - dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR_FOR_TESTS([$1]) -]) - -AC_DEFUN([gl_WCHAR_H_DEFAULTS], -[ - GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) - GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) - GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) - GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) - GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) - GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) - GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) - GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) - GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) - GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) - GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) - GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) - GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) - GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) - GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) - GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) - GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) - GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) - GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) - GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) - GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) - GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) - GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) - GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) - GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) - GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) - GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) - GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) - GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) - GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) - GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) - GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) - GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) - GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) - GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) - GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) - GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) - GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) - dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) - HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) - HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) - HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) - HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) - HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) - HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) - HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) - HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) - HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) - HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) - HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) - HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) - HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) - HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) - HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) - HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) - HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) - HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) - HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) - HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) - HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) - HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) - HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) - HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) - HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) - HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) - HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) - HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) - HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) - HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) - HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) - HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) - HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) - HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) - HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) - HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) - HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) - HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) - REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) - REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) - REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) - REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) - REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) - REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) - REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) - REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS]) - REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) - REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) - REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) - REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) - REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) -]) diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 deleted file mode 100644 index da1ce3df601..00000000000 --- a/m4/wint_t.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# wint_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007-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, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. -dnl Test whether <wchar.h> has the 'wint_t' type. -dnl Prerequisite: AC_PROG_CC - -AC_DEFUN([gt_TYPE_WINT_T], -[ - AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before - <wchar.h>. - BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included - before <wchar.h>. */ -#include <stddef.h> -#include <stdio.h> -#include <time.h> -#include <wchar.h> - wint_t foo = (wchar_t)'\0';]], - [[]])], - [gt_cv_c_wint_t=yes], - [gt_cv_c_wint_t=no])]) - if test $gt_cv_c_wint_t = yes; then - AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) - fi -]) |