diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gnulib-common.m4 | 2 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 4 | ||||
-rw-r--r-- | m4/math_h.m4 | 13 | ||||
-rw-r--r-- | m4/mathfunc.m4 | 32 | ||||
-rw-r--r-- | m4/stdalign.m4 | 37 | ||||
-rw-r--r-- | m4/stdint.m4 | 10 | ||||
-rw-r--r-- | m4/stdlib_h.m4 | 9 | ||||
-rw-r--r-- | m4/unistd_h.m4 | 10 |
8 files changed, 88 insertions, 29 deletions
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 7d8329995..8621dec2e 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -18,7 +18,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) -# elif 1200 <= _MSC_VER +# elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index c1e54d3f1..1a007e6b6 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -162,6 +162,7 @@ AC_DEFUN([gl_EARLY], # Code from module ssize_t: # Code from module stat: # Code from module stat-time: + # Code from module stdalign: # Code from module stdbool: # Code from module stddef: # Code from module stdint: @@ -548,6 +549,7 @@ fi gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_STAT_TIME gl_STAT_BIRTHTIME +gl_STDALIGN_H AM_STDBOOL_H gl_STDDEF_H gl_STDINT_H @@ -872,6 +874,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/sockets.h lib/stat-time.h lib/stat.c + lib/stdalign.in.h lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h @@ -1006,6 +1009,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/ssize_t.m4 m4/stat-time.m4 m4/stat.m4 + m4/stdalign.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 diff --git a/m4/math_h.m4 b/m4/math_h.m4 index e5a289248..e58a9e908 100644 --- a/m4/math_h.m4 +++ b/m4/math_h.m4 @@ -1,4 +1,4 @@ -# math_h.m4 serial 53 +# math_h.m4 serial 56 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, @@ -41,7 +41,7 @@ AC_DEFUN([gl_MATH_H], gl_WARN_ON_USE_PREPARE([[#include <math.h>]], [acosf acosl asinf asinl atanf atanl ceilf ceill copysign copysignf copysignl cosf cosl coshf - expf expl fabsf floorf floorl fmodf frexpf frexpl + expf expl fabsf floorf floorl fma fmaf fmal fmodf frexpf frexpl ldexpf ldexpl logb logf logl log10f modff powf rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl tanf tanl tanhf trunc truncf truncl]) @@ -80,6 +80,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR]) GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) + GNULIB_FMA=0; AC_SUBST([GNULIB_FMA]) + GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF]) + GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL]) GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF]) GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF]) GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) @@ -133,6 +136,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) + HAVE_FMA=1; AC_SUBST([HAVE_FMA]) + HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) + HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) @@ -183,6 +189,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS], REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) + REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) + REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) + REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4 index b7a1239f7..c75e7b939 100644 --- a/m4/mathfunc.m4 +++ b/m4/mathfunc.m4 @@ -1,11 +1,11 @@ -# mathfunc.m4 serial 9 +# mathfunc.m4 serial 10 dnl Copyright (C) 2010-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. -# gl_MATHFUNC(FUNC, RETTYPE, PARAMTYPES [, EXTRA-CODE]) -# ----------------------------------------------------- +# gl_MATHFUNC(FUNC, RETTYPE, PARAMTYPES [, INCLUDES] [, EXTRA-CODE]) +# ------------------------------------------------------------------ # tests whether the function FUNC is available in libc or libm. # RETTYPE is the return type. PARAMTYPES is a parameter list, with parentheses. # It sets FUNC_LIBM to empty or "-lm" accordingly. @@ -38,15 +38,17 @@ AC_DEFUN([gl_MATHFUNC], [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( - [$3], - [int \*], [&i_ret])], - [float \*], [&f_ret])], - [double \*], [&d_ret])], - [long double \*], [&l_ret])], - [int], [2])], - [float], [1.618034f])], - [long double], [1.618033988749894848L])], - [double], [1.6180339887])]) + [m4_bpatsubst( + [$3], + [int \*], [&i_ret])], + [float \*], [&f_ret])], + [double \*], [&d_ret])], + [long double \*], [&l_ret])], + [int], [2])], + [float], [1.618034f])], + [long double], [1.618033988749894848L])], + [double], [1.6180339887])], + [void], [])]) FUNC[]_LIBM= AC_CACHE_CHECK([whether func() can be used without linking with libm], [gl_cv_func_]func[_no_libm], @@ -57,13 +59,14 @@ AC_DEFUN([gl_MATHFUNC], # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> + $4 $2 (*funcptr) $3 = ]func[; int i_ret; float f_ret; double d_ret; long double l_ret;]], [[$2 y = funcptr ]ARGS[ + ]func[ ]ARGS[; - $4 + $5 return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_no_libm=yes], @@ -81,13 +84,14 @@ AC_DEFUN([gl_MATHFUNC], # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> + $4 $2 (*funcptr) $3 = ]func[; int i_ret; float f_ret; double d_ret; long double l_ret;]], [[$2 y = funcptr ]ARGS[ + ]func[ ]ARGS[; - $4 + $5 return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_in_libm=yes], diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 new file mode 100644 index 000000000..2641dce51 --- /dev/null +++ b/m4/stdalign.m4 @@ -0,0 +1,37 @@ +# Check for stdalign.h that conforms to C1x. + +dnl Copyright 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. + +# Prepare for substituting <stdalign.h> if it is not supported. + +AC_DEFUN([gl_STDALIGN_H], +[ + AC_CACHE_CHECK([for working stdalign.h], + [gl_cv_header_working_stdalign_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stdalign.h> + int align_int = alignof (int) + _Alignof (double); + + /* Test _Alignas only on platforms where gnulib can help. */ + #if \ + (__GNUC__ || __IBMC__ || __IBMCPP__ \ + || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER) + int alignas (8) alignas_int = 1; + #endif + ]])], + [gl_cv_header_working_stdalign_h=yes], + [gl_cv_header_working_stdalign_h=no])]) + + if test $gl_cv_header_working_stdalign_h = yes; then + STDALIGN_H='' + else + STDALIGN_H='stdalign.h' + fi + + AC_SUBST([STDALIGN_H]) + AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) +]) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 092161c99..cfad016f9 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 41 +# stdint.m4 serial 42 dnl Copyright (C) 2001-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, @@ -69,8 +69,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#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_LIMIT_MACROS 1 /* to make it work also in C++ before C++11 */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ before C++11 */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include <stdint.h> /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ @@ -219,8 +219,8 @@ struct s { dnl This detects a bug on HP-UX 11.23/ia64. AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ -#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_LIMIT_MACROS 1 /* to make it work also in C++ before C++11 */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ before C++11 */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include <stdint.h> ] diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index fbdba980e..0a8a9e563 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 37 +# stdlib_h.m4 serial 39 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, @@ -21,8 +21,8 @@ AC_DEFUN([gl_STDLIB_H], #endif ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt - ptsname random_r realpath rpmatch setenv setstate_r srandom_r strtod - strtoll strtoull unlockpt unsetenv]) + ptsname ptsname_r random_r realpath rpmatch setenv setstate_r srandom_r + strtod strtoll strtoull unlockpt unsetenv]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -52,6 +52,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) + GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) @@ -79,6 +80,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) + HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) @@ -97,6 +99,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 57c8094e4..34bdef54a 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 61 +# unistd_h.m4 serial 62 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, @@ -43,8 +43,8 @@ AC_DEFUN([gl_UNISTD_H], fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite - readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat - usleep]) + readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r + unlink unlinkat usleep]) ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -94,11 +94,11 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) + GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) - GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) @@ -131,6 +131,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) @@ -143,6 +144,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) |