aboutsummaryrefslogtreecommitdiffstats
path: root/m4/stdint.m4
diff options
context:
space:
mode:
authorMichael R. Mauger2017-07-24 22:15:04 -0400
committerMichael R. Mauger2017-07-24 22:15:04 -0400
commitdf1a71272e5cdd10b511e2ffd702ca50ddd8a773 (patch)
tree9b9ac725394ee80891e2bff57b6407d0e491e71a /m4/stdint.m4
parenteb27fc4d49e8c914cd0e6a8a2d02159601542141 (diff)
parent32daa3cb54523006c88717cbeac87964cd687a1b (diff)
downloademacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.tar.gz
emacs-df1a71272e5cdd10b511e2ffd702ca50ddd8a773.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'm4/stdint.m4')
-rw-r--r--m4/stdint.m4108
1 files changed, 58 insertions, 50 deletions
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 4ac854d5198..4bf3e474515 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
1# stdint.m4 serial 50 1# stdint.m4 serial 51
2dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,7 @@ dnl Test whether <stdint.h> is supported or must be substituted.
10AC_DEFUN_ONCE([gl_STDINT_H], 10AC_DEFUN_ONCE([gl_STDINT_H],
11[ 11[
12 AC_PREREQ([2.59])dnl 12 AC_PREREQ([2.59])dnl
13 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13 14
14 AC_REQUIRE([gl_LIMITS_H]) 15 AC_REQUIRE([gl_LIMITS_H])
15 AC_REQUIRE([gt_TYPE_WINT_T]) 16 AC_REQUIRE([gt_TYPE_WINT_T])
@@ -288,8 +289,12 @@ static const char *macro_values[] =
288]])], 289]])],
289 [gl_cv_header_working_stdint_h=yes], 290 [gl_cv_header_working_stdint_h=yes],
290 [], 291 [],
291 [dnl When cross-compiling, assume it works. 292 [case "$host_os" in
292 gl_cv_header_working_stdint_h=yes 293 # Guess yes on native Windows.
294 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
295 # In general, assume it works.
296 *) gl_cv_header_working_stdint_h="guessing yes" ;;
297 esac
293 ]) 298 ])
294 ]) 299 ])
295 ]) 300 ])
@@ -299,15 +304,16 @@ static const char *macro_values[] =
299 HAVE_SYS_BITYPES_H=0 304 HAVE_SYS_BITYPES_H=0
300 HAVE_SYS_INTTYPES_H=0 305 HAVE_SYS_INTTYPES_H=0
301 STDINT_H=stdint.h 306 STDINT_H=stdint.h
302 if test "$gl_cv_header_working_stdint_h" = yes; then 307 case "$gl_cv_header_working_stdint_h" in
303 HAVE_C99_STDINT_H=1 308 *yes)
304 dnl Now see whether the system <stdint.h> works without 309 HAVE_C99_STDINT_H=1
305 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. 310 dnl Now see whether the system <stdint.h> works without
306 AC_CACHE_CHECK([whether stdint.h predates C++11], 311 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
307 [gl_cv_header_stdint_predates_cxx11_h], 312 AC_CACHE_CHECK([whether stdint.h predates C++11],
308 [gl_cv_header_stdint_predates_cxx11_h=yes 313 [gl_cv_header_stdint_predates_cxx11_h],
309 AC_COMPILE_IFELSE([ 314 [gl_cv_header_stdint_predates_cxx11_h=yes
310 AC_LANG_PROGRAM([[ 315 AC_COMPILE_IFELSE([
316 AC_LANG_PROGRAM([[
311#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ 317#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
312#include <stdint.h> 318#include <stdint.h>
313] 319]
@@ -315,45 +321,47 @@ gl_STDINT_INCLUDES
315[ 321[
316intmax_t im = INTMAX_MAX; 322intmax_t im = INTMAX_MAX;
317int32_t i32 = INT32_C (0x7fffffff); 323int32_t i32 = INT32_C (0x7fffffff);
318 ]])], 324 ]])],
319 [gl_cv_header_stdint_predates_cxx11_h=no])]) 325 [gl_cv_header_stdint_predates_cxx11_h=no])])
320 326
321 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then 327 if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
322 AC_DEFINE([__STDC_CONSTANT_MACROS], [1], 328 AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
323 [Define to 1 if the system <stdint.h> predates C++11.]) 329 [Define to 1 if the system <stdint.h> predates C++11.])
324 AC_DEFINE([__STDC_LIMIT_MACROS], [1], 330 AC_DEFINE([__STDC_LIMIT_MACROS], [1],
325 [Define to 1 if the system <stdint.h> predates C++11.]) 331 [Define to 1 if the system <stdint.h> predates C++11.])
326 fi 332 fi
327 AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], 333 AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
328 [gl_cv_header_stdint_width], 334 [gl_cv_header_stdint_width],
329 [gl_cv_header_stdint_width=no 335 [gl_cv_header_stdint_width=no
330 AC_COMPILE_IFELSE( 336 AC_COMPILE_IFELSE(
331 [AC_LANG_PROGRAM([[ 337 [AC_LANG_PROGRAM([[
332 /* Work if build is not clean. */ 338 /* Work if build is not clean. */
333 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 339 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
334 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ 340 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
335 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 341 #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
336 #endif 342 #endif
337 #include <stdint.h> 343 #include <stdint.h>
338 ]gl_STDINT_INCLUDES[ 344 ]gl_STDINT_INCLUDES[
339 int iw = UINTMAX_WIDTH; 345 int iw = UINTMAX_WIDTH;
340 ]])], 346 ]])],
341 [gl_cv_header_stdint_width=yes])]) 347 [gl_cv_header_stdint_width=yes])])
342 if test "$gl_cv_header_stdint_width" = yes; then 348 if test "$gl_cv_header_stdint_width" = yes; then
343 STDINT_H= 349 STDINT_H=
344 fi 350 fi
345 else 351 ;;
346 dnl Check for <sys/inttypes.h>, and for 352 *)
347 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). 353 dnl Check for <sys/inttypes.h>, and for
348 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) 354 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
349 if test $ac_cv_header_sys_inttypes_h = yes; then 355 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
350 HAVE_SYS_INTTYPES_H=1 356 if test $ac_cv_header_sys_inttypes_h = yes; then
351 fi 357 HAVE_SYS_INTTYPES_H=1
352 if test $ac_cv_header_sys_bitypes_h = yes; then 358 fi
353 HAVE_SYS_BITYPES_H=1 359 if test $ac_cv_header_sys_bitypes_h = yes; then
354 fi 360 HAVE_SYS_BITYPES_H=1
355 gl_STDINT_TYPE_PROPERTIES 361 fi
356 fi 362 gl_STDINT_TYPE_PROPERTIES
363 ;;
364 esac
357 365
358 dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. 366 dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
359 LIMITS_H=limits.h 367 LIMITS_H=limits.h