diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/grp.h | 1 | ||||
-rw-r--r-- | newlib/libc/include/machine/_default_types.h | 36 | ||||
-rw-r--r-- | newlib/libc/include/pwd.h | 1 | ||||
-rw-r--r-- | newlib/libc/include/stdlib.h | 4 | ||||
-rw-r--r-- | newlib/libc/include/time.h | 6 | ||||
-rw-r--r-- | newlib/libc/machine/nds32/Makefile.am | 4 | ||||
-rw-r--r-- | newlib/libc/machine/nds32/Makefile.in | 20 | ||||
-rwxr-xr-x | newlib/libc/machine/nds32/configure | 1066 | ||||
-rw-r--r-- | newlib/libc/machine/nds32/configure.in | 12 | ||||
-rw-r--r-- | newlib/libc/machine/nds32/setjmp.S | 33 | ||||
-rw-r--r-- | newlib/libc/stdio/open_memstream.c | 1 | ||||
-rw-r--r-- | newlib/libc/stdlib/gd_qnan.h | 20 | ||||
-rw-r--r-- | newlib/libc/stdlib/ldtoa.c | 41 | ||||
-rw-r--r-- | newlib/libc/stdlib/strtold.c | 10 | ||||
-rw-r--r-- | newlib/libc/sys/arm/syscalls.c | 6 |
15 files changed, 1230 insertions, 31 deletions
diff --git a/newlib/libc/include/grp.h b/newlib/libc/include/grp.h index 1273e3959..c3a5a676c 100644 --- a/newlib/libc/include/grp.h +++ b/newlib/libc/include/grp.h @@ -43,6 +43,7 @@ #ifndef _GRP_H_ #define _GRP_H_ +#include <sys/cdefs.h> #include <sys/types.h> #ifdef __CYGWIN__ #include <cygwin/grp.h> diff --git a/newlib/libc/include/machine/_default_types.h b/newlib/libc/include/machine/_default_types.h index 2bd5f64a0..ffc646d9e 100644 --- a/newlib/libc/include/machine/_default_types.h +++ b/newlib/libc/include/machine/_default_types.h @@ -25,7 +25,11 @@ extern "C" { #ifdef __INT8_TYPE__ typedef __INT8_TYPE__ __int8_t; +#ifdef __UINT8_TYPE__ typedef __UINT8_TYPE__ __uint8_t; +#else +typedef unsigned __INT8_TYPE__ __uint8_t; +#endif #define ___int8_t_defined 1 #elif __EXP(SCHAR_MAX) == 0x7f typedef signed char __int8_t ; @@ -35,7 +39,11 @@ typedef unsigned char __uint8_t ; #ifdef __INT16_TYPE__ typedef __INT16_TYPE__ __int16_t; +#ifdef __UINT16_TYPE__ typedef __UINT16_TYPE__ __uint16_t; +#else +typedef unsigned __INT16_TYPE__ __uint16_t; +#endif #define ___int16_t_defined 1 #elif __EXP(INT_MAX) == 0x7fff typedef signed int __int16_t; @@ -53,7 +61,11 @@ typedef unsigned char __uint16_t; #ifdef __INT32_TYPE__ typedef __INT32_TYPE__ __int32_t; +#ifdef __UINT32_TYPE__ typedef __UINT32_TYPE__ __uint32_t; +#else +typedef unsigned __INT32_TYPE__ __uint32_t; +#endif #define ___int32_t_defined 1 #elif __EXP(INT_MAX) == 0x7fffffffL typedef signed int __int32_t; @@ -75,7 +87,11 @@ typedef unsigned char __uint32_t; #ifdef __INT64_TYPE__ typedef __INT64_TYPE__ __int64_t; +#ifdef __UINT64_TYPE__ typedef __UINT64_TYPE__ __uint64_t; +#else +typedef unsigned __INT64_TYPE__ __uint64_t; +#endif #define ___int64_t_defined 1 #elif __EXP(LONG_MAX) > 0x7fffffff typedef signed long __int64_t; @@ -102,7 +118,11 @@ typedef unsigned int __uint64_t; #ifdef __INT_LEAST8_TYPE__ typedef __INT_LEAST8_TYPE__ __int_least8_t; +#ifdef __UINT_LEAST8_TYPE__ typedef __UINT_LEAST8_TYPE__ __uint_least8_t; +#else +typedef unsigned __INT_LEAST8_TYPE__ __uint_least8_t; +#endif #define ___int_least8_t_defined 1 #elif defined(___int8_t_defined) typedef __int8_t __int_least8_t; @@ -124,7 +144,11 @@ typedef __uint64_t __uint_least8_t; #ifdef __INT_LEAST16_TYPE__ typedef __INT_LEAST16_TYPE__ __int_least16_t; +#ifdef __UINT_LEAST16_TYPE__ typedef __UINT_LEAST16_TYPE__ __uint_least16_t; +#else +typedef unsigned __INT_LEAST16_TYPE__ __uint_least16_t; +#endif #define ___int_least16_t_defined 1 #elif defined(___int16_t_defined) typedef __int16_t __int_least16_t; @@ -142,7 +166,11 @@ typedef __uint64_t __uint_least16_t; #ifdef __INT_LEAST32_TYPE__ typedef __INT_LEAST32_TYPE__ __int_least32_t; +#ifdef __UINT_LEAST32_TYPE__ typedef __UINT_LEAST32_TYPE__ __uint_least32_t; +#else +typedef unsigned __INT_LEAST32_TYPE__ __uint_least32_t; +#endif #define ___int_least32_t_defined 1 #elif defined(___int32_t_defined) typedef __int32_t __int_least32_t; @@ -156,7 +184,11 @@ typedef __uint64_t __uint_least32_t; #ifdef __INT_LEAST64_TYPE__ typedef __INT_LEAST64_TYPE__ __int_least64_t; +#ifdef __UINT_LEAST64_TYPE__ typedef __UINT_LEAST64_TYPE__ __uint_least64_t; +#else +typedef unsigned __INT_LEAST64_TYPE__ __uint_least64_t; +#endif #define ___int_least64_t_defined 1 #elif defined(___int64_t_defined) typedef __int64_t __int_least64_t; @@ -166,7 +198,11 @@ typedef __uint64_t __uint_least64_t; #ifdef __INTPTR_TYPE__ typedef __INTPTR_TYPE__ __intptr_t; +#ifdef __UINTPTR_TYPE__ typedef __UINTPTR_TYPE__ __uintptr_t; +#else +typedef unsigned __INTPTR_TYPE__ __uintptr_t; +#endif #elif defined(__PTRDIFF_TYPE__) typedef __PTRDIFF_TYPE__ __intptr_t; typedef unsigned __PTRDIFF_TYPE__ __uintptr_t; diff --git a/newlib/libc/include/pwd.h b/newlib/libc/include/pwd.h index d849f5fe4..3dea4ee2d 100644 --- a/newlib/libc/include/pwd.h +++ b/newlib/libc/include/pwd.h @@ -39,6 +39,7 @@ extern "C" { #endif #define _PWD_H_ +#include <sys/cdefs.h> #include <sys/types.h> #if __BSD_VISIBLE diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index ef218663b..905cf5d59 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -231,11 +231,11 @@ int _EXFUN(_system_r,(struct _reent *, const char *)); _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); /* On platforms where long double equals double. */ -#ifdef _LDBL_EQ_DBL +#ifdef _HAVE_LONG_DOUBLE #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L) extern long double strtold (const char *__restrict, char **__restrict); #endif -#endif /* _LDBL_EQ_DBL */ +#endif /* _HAVE_LONG_DOUBLE */ _END_STD_C diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index b91b03920..d7b6612db 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -39,6 +39,12 @@ struct tm int tm_wday; int tm_yday; int tm_isdst; +#ifdef __TM_GMTOFF + long __TM_GMTOFF; +#endif +#ifdef __TM_ZONE + const char *__TM_ZONE; +#endif }; clock_t _EXFUN(clock, (void)); diff --git a/newlib/libc/machine/nds32/Makefile.am b/newlib/libc/machine/nds32/Makefile.am index fa96ccd07..8abd7306b 100644 --- a/newlib/libc/machine/nds32/Makefile.am +++ b/newlib/libc/machine/nds32/Makefile.am @@ -8,7 +8,11 @@ AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a +if IS_NDS32_ISA_V3M +lib_a_SOURCES = abort.c setjmp.S strcmp.S strcpy.S +else lib_a_SOURCES = abort.c memcpy.S memset.S setjmp.S strcmp.S strcpy.S +endif lib_a_CCASFLAGS=$(AM_CCASFLAGS) lib_a_CFLAGS = $(AM_CFLAGS) diff --git a/newlib/libc/machine/nds32/Makefile.in b/newlib/libc/machine/nds32/Makefile.in index a70705caa..276d1d350 100644 --- a/newlib/libc/machine/nds32/Makefile.in +++ b/newlib/libc/machine/nds32/Makefile.in @@ -69,9 +69,16 @@ LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru lib_a_AR = $(AR) $(ARFLAGS) lib_a_LIBADD = -am_lib_a_OBJECTS = lib_a-abort.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \ - lib_a-memset.$(OBJEXT) lib_a-setjmp.$(OBJEXT) \ - lib_a-strcmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) +@IS_NDS32_ISA_V3M_FALSE@am_lib_a_OBJECTS = lib_a-abort.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_FALSE@ lib_a-memcpy.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_FALSE@ lib_a-memset.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_FALSE@ lib_a-setjmp.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_FALSE@ lib_a-strcmp.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_FALSE@ lib_a-strcpy.$(OBJEXT) +@IS_NDS32_ISA_V3M_TRUE@am_lib_a_OBJECTS = lib_a-abort.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_TRUE@ lib_a-setjmp.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_TRUE@ lib_a-strcmp.$(OBJEXT) \ +@IS_NDS32_ISA_V3M_TRUE@ lib_a-strcpy.$(OBJEXT) lib_a_OBJECTS = $(am_lib_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = @@ -102,12 +109,15 @@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -141,6 +151,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ aext = @aext@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -197,7 +208,8 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a -lib_a_SOURCES = abort.c memcpy.S memset.S setjmp.S strcmp.S strcpy.S +@IS_NDS32_ISA_V3M_FALSE@lib_a_SOURCES = abort.c memcpy.S memset.S setjmp.S strcmp.S strcpy.S +@IS_NDS32_ISA_V3M_TRUE@lib_a_SOURCES = abort.c setjmp.S strcmp.S strcpy.S lib_a_CCASFLAGS = $(AM_CCASFLAGS) lib_a_CFLAGS = $(AM_CFLAGS) ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. diff --git a/newlib/libc/machine/nds32/configure b/newlib/libc/machine/nds32/configure index ba0df833e..2ee67f235 100755 --- a/newlib/libc/machine/nds32/configure +++ b/newlib/libc/machine/nds32/configure @@ -562,8 +562,17 @@ PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="setjmp.S" -ac_subst_vars='LTLIBOBJS +ac_no_link=no +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS LIBOBJS +IS_NDS32_ISA_V3M_FALSE +IS_NDS32_ISA_V3M_TRUE +EXEEXT +ac_ct_CC +CPPFLAGS +CFLAGS sys_dir machine_dir libm_machine_dir @@ -696,7 +705,12 @@ enable_maintainer_mode host_alias target_alias CCAS -CCASFLAGS' +CCASFLAGS +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS' # Initialize some variables set by options. @@ -1333,6 +1347,13 @@ Optional Features: Some influential environment variables: CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -3410,6 +3431,1032 @@ OBJEXT=${oext} + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + ac_no_link=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save + +else + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.o conftest.obj conftest.dSYM + ac_no_link=yes + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally + # correct if we can't link. + cross_compiling=yes + EXEEXT= + # Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __NDS32_ISA_V3M__ +warning: This is nds32_isa_v3m. +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + is_nds32_isa_v3m="no" +else + is_nds32_isa_v3m="yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$is_nds32_isa_v3m" = "yes"; then + IS_NDS32_ISA_V3M_TRUE= + IS_NDS32_ISA_V3M_FALSE='#' +else + IS_NDS32_ISA_V3M_TRUE='#' + IS_NDS32_ISA_V3M_FALSE= +fi + + + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF @@ -3561,6 +4608,13 @@ if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. @@ -3598,6 +4652,14 @@ if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${IS_NDS32_ISA_V3M_TRUE}" && test -z "${IS_NDS32_ISA_V3M_FALSE}"; then + as_fn_error $? "conditional \"IS_NDS32_ISA_V3M\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 diff --git a/newlib/libc/machine/nds32/configure.in b/newlib/libc/machine/nds32/configure.in index 781e93936..7b1a073ec 100644 --- a/newlib/libc/machine/nds32/configure.in +++ b/newlib/libc/machine/nds32/configure.in @@ -10,5 +10,17 @@ AC_CONFIG_AUX_DIR(../../../..) NEWLIB_CONFIGURE(../../..) +dnl Use builtin macro to detect if this is for "AndeStar ISA V3m". +AC_NO_EXECUTABLES +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#ifdef __NDS32_ISA_V3M__ +warning: This is nds32_isa_v3m. +#endif +]])], + [is_nds32_isa_v3m="no"], + [is_nds32_isa_v3m="yes"]) +AM_CONDITIONAL(IS_NDS32_ISA_V3M, test "$is_nds32_isa_v3m" = "yes") + + AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/newlib/libc/machine/nds32/setjmp.S b/newlib/libc/machine/nds32/setjmp.S index 90b162ef8..e5d8531bc 100644 --- a/newlib/libc/machine/nds32/setjmp.S +++ b/newlib/libc/machine/nds32/setjmp.S @@ -40,7 +40,9 @@ The usage of thirty-two 32-bit General Purpose Registers (GPR): reserved for assembler : $r15 reserved for other use : $r24, $r25, $r26, $r27 -Save all callee-save registers and $fp, $gp, $lp and $sp. +Save all callee-save registers and $fp, $gp, $lp and $sp is enough in theory. +For debugging issue, the layout of jum_buf in here should be in sync with GDB. +The $r16 ~ $r19 are used to store D0/D1, keep them for backward-compatible. */ /* int setjmp(jmp_buf env); */ @@ -50,13 +52,12 @@ Save all callee-save registers and $fp, $gp, $lp and $sp. .type setjmp, @function setjmp: #ifdef __NDS32_REDUCED_REGS__ - /* This case, save 10 words. */ - smw.bim $r6, [$r0], $r10, 0x0 - smw.bim $r31, [$r0], $r31, 0xf + smw.bim $r6, [$r0], $r10, #0b0000 + addi $r0, $r0, #32 /* Leave room to keep jum_buf all the same. */ + smw.bim $r31, [$r0], $r31, #0b1111 #else - /* This case, save 17 words. */ - smw.bim $r6, [$r0], $r14, 0x0 - smw.bim $r16, [$r0], $r19, 0xf + smw.bim $r6, [$r0], $r14, #0b0000 + smw.bim $r16, [$r0], $r19, #0b1111 #endif /* Set return value to zero. */ @@ -72,16 +73,16 @@ setjmp: .type longjmp, @function longjmp: #ifdef __NDS32_REDUCED_REGS__ - lmw.bim $r6, [$r0], $r10, 0x0 - lmw.bim $r31, [$r0], $r31, 0xf + lmw.bim $r6, [$r0], $r10, #0b0000 + addi $r0, $r0, #32 + lmw.bim $r31, [$r0], $r31, #0b1111 #else - lmw.bim $r6, [$r0], $r14, 0x0 - lmw.bim $r16, [$r0], $r19, 0xf + lmw.bim $r6, [$r0], $r14, #0b0000 + lmw.bim $r16, [$r0], $r19, #0b1111 #endif - /* If the value val is 0, 1 will be returned instead. */ - bnez $r1, 1f - movi $r1, 1 -1: - move $r0, $r1 + /* Set val as return value. If the value val is 0, 1 will be returned + instead. */ + movi $r0, 1 + cmovn $r0, $r1, $r1 /* r0=(r1!=0)? r1: r0 */ ret .size longjmp, .-longjmp diff --git a/newlib/libc/stdio/open_memstream.c b/newlib/libc/stdio/open_memstream.c index e33063b7c..5de99474d 100644 --- a/newlib/libc/stdio/open_memstream.c +++ b/newlib/libc/stdio/open_memstream.c @@ -355,6 +355,7 @@ _DEFUN(internal_open_memstream_r, (ptr, buf, size, wide), c->storage = c; c->pbuf = buf; c->psize = size; + c->pos = 0; c->eof = 0; c->saved.w = L'\0'; c->wide = (int8_t) wide; diff --git a/newlib/libc/stdlib/gd_qnan.h b/newlib/libc/stdlib/gd_qnan.h index 68f16cd12..b775f82d4 100644 --- a/newlib/libc/stdlib/gd_qnan.h +++ b/newlib/libc/stdlib/gd_qnan.h @@ -1,5 +1,6 @@ #ifdef __IEEE_BIG_ENDIAN +#if !defined(__mips) #define f_QNAN 0x7fc00000 #define d_QNAN0 0x7ff80000 #define d_QNAN1 0x0 @@ -12,9 +13,19 @@ #define ldus_QNAN2 0x0 #define ldus_QNAN3 0x0 #define ldus_QNAN4 0x0 +#elif defined(__mips_nan2008) +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x7ff80000 +#define d_QNAN1 0x0 +#else +#define f_QNAN 0x7fbfffff +#define d_QNAN0 0x7ff7ffff +#define d_QNAN1 0xffffffff +#endif #elif defined(__IEEE_LITTLE_ENDIAN) +#if !defined(__mips) #define f_QNAN 0xffc00000 #define d_QNAN0 0x0 #define d_QNAN1 0xfff80000 @@ -27,6 +38,15 @@ #define ldus_QNAN2 0x0 #define ldus_QNAN3 0xc000 #define ldus_QNAN4 0xffff +#elif defined(__mips_nan2008) +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x0 +#define d_QNAN1 0x7ff80000 +#else +#define f_QNAN 0x7fbfffff +#define d_QNAN0 0xffffffff +#define d_QNAN1 0x7ff7ffff +#endif #else #error IEEE endian not defined diff --git a/newlib/libc/stdlib/ldtoa.c b/newlib/libc/stdlib/ldtoa.c index b13ac69be..76b4638ff 100644 --- a/newlib/libc/stdlib/ldtoa.c +++ b/newlib/libc/stdlib/ldtoa.c @@ -3679,16 +3679,40 @@ emdnorm( num, 0, 0, ln, 0, ldp ); /* NaN bit patterns */ #ifdef MIEEE +#if !defined(__mips) static _CONST unsigned short nan113[8] = { 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; -static _CONST unsigned short nan64[6] = {0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; +static _CONST unsigned short nan64[6] = { + 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; static _CONST unsigned short nan53[4] = {0x7fff, 0xffff, 0xffff, 0xffff}; static _CONST unsigned short nan24[2] = {0x7fff, 0xffff}; +#elif defined(__mips_nan2008) /* __mips */ +static _CONST unsigned short nan113[8] = {0x7fff, 0x8000, 0, 0, 0, 0, 0, 0}; +static _CONST unsigned short nan64[6] = {0x7fff, 0xc000, 0, 0, 0, 0}; +static _CONST unsigned short nan53[4] = {0x7ff8, 0, 0, 0}; +static _CONST unsigned short nan24[2] = {0x7fc0, 0}; +#else /* __mips && !__mips_nan2008 */ +static _CONST unsigned short nan113[8] = { + 0x7fff, 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; +static _CONST unsigned short nan64[6] = { + 0x7fff, 0xbfff, 0xffff, 0xffff, 0xffff, 0xffff}; +static _CONST unsigned short nan53[4] = {0x7ff7, 0xffff, 0xffff, 0xffff}; +static _CONST unsigned short nan24[2] = {0x7fbf, 0xffff}; +#endif /* __mips && !__mips_nan2008 */ #else /* !MIEEE */ +#if !defined(__mips) || defined(__mips_nan2008) static _CONST unsigned short nan113[8] = {0, 0, 0, 0, 0, 0, 0x8000, 0x7fff}; static _CONST unsigned short nan64[6] = {0, 0, 0, 0, 0xc000, 0x7fff}; static _CONST unsigned short nan53[4] = {0, 0, 0, 0x7ff8}; static _CONST unsigned short nan24[2] = {0, 0x7fc0}; +#else /* __mips && !__mips_nan2008 */ +static _CONST unsigned short nan113[8] = { + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x7fff, 0x7fff}; +static _CONST unsigned short nan64[6] = { + 0xffff, 0xffff, 0xffff, 0xffff, 0xbfff, 0x7fff}; +static _CONST unsigned short nan53[4] = {0xffff, 0xffff, 0xffff, 0x7ff7}; +static _CONST unsigned short nan24[2] = {0xffff, 0x7fbf}; +#endif /* __mips && !__mips_nan2008 */ #endif /* !MIEEE */ @@ -3721,9 +3745,15 @@ switch( size ) break; case NBITS: +#if !defined(__mips) || defined(__mips_nan2008) for( i=0; i<NE-2; i++ ) *nan++ = 0; *nan++ = 0xc000; +#else /* __mips && !__mips_nan2008 */ + for( i=0; i<NE-2; i++ ) + *nan++ = 0xffff; + *nan++ = 0xbfff; +#endif /* __mips && !__mips_nan2008 */ *nan++ = 0x7fff; return; @@ -3731,9 +3761,16 @@ switch( size ) *nan++ = 0; *nan++ = 0x7fff; *nan++ = 0; +#if !defined(__mips) || defined(__mips_nan2008) *nan++ = 0xc000; - for( i=4; i<NI; i++ ) + for( i=4; i<NI-1; i++ ) *nan++ = 0; +#else /* __mips && !__mips_nan2008 */ + *nan++ = 0xbfff; + for( i=4; i<NI-1; i++ ) + *nan++ = 0xffff; +#endif /* __mips && !__mips_nan2008 */ + *nan++ = 0; return; #endif default: diff --git a/newlib/libc/stdlib/strtold.c b/newlib/libc/stdlib/strtold.c index 390ec735b..a620251ee 100644 --- a/newlib/libc/stdlib/strtold.c +++ b/newlib/libc/stdlib/strtold.c @@ -31,12 +31,18 @@ POSSIBILITY OF SUCH DAMAGE. #include <stdlib.h> #include "local.h" +#ifdef _HAVE_LONG_DOUBLE +extern long double _strtold (const char *, char **); + /* On platforms where long double is as wide as double. */ -#ifdef _LDBL_EQ_DBL long double strtold (const char *__restrict s00, char **__restrict se) { +#ifdef _LDBL_EQ_DBL return strtod(s00, se); +#else + return _strtold (s00, se); +#endif } -#endif /* _LDBL_EQ_DBL */ +#endif /* _HAVE_LONG_DOUBLE */ diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c index c5df5bb8a..04dde4558 100644 --- a/newlib/libc/sys/arm/syscalls.c +++ b/newlib/libc/sys/arm/syscalls.c @@ -202,7 +202,7 @@ _swiread (int file, #endif } -int +int __attribute__((weak)) _read (int file, char * ptr, int len) @@ -307,7 +307,7 @@ _swiwrite ( #endif } -int +int __attribute__((weak)) _write (int file, char * ptr, int len) @@ -451,7 +451,7 @@ _getpid (int n) n = n; } -caddr_t +caddr_t __attribute__((weak)) _sbrk (int incr) { extern char end asm ("end"); /* Defined by the linker. */ |