From 54953b66c5540d7671efaa66764bcc20722bab8a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 7 Dec 1998 23:40:19 +0000 Subject: [PATCH] configure.in: Test for availability of putc_unlocked, fputc_unlocked, and fputs_unlocked. * configure.in: Test for availability of putc_unlocked, fputc_unlocked, and fputs_unlocked. * configure: Rebuilt. * system.h: If the *_unlocked functions are available use them instead of the locked counterparts by defining macros. * config.in: Regenerated. From-SVN: r24175 --- gcc/ChangeLog | 9 +++++ gcc/config.in | 9 +++++ gcc/configure | 86 +++++++++++++++++++++++++----------------------- gcc/configure.in | 3 +- gcc/system.h | 15 +++++++++ 5 files changed, 80 insertions(+), 42 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a871069a8788..6d57da9b17c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +1998-12-08 Ulrich Drepper + + * configure.in: Test for availability of putc_unlocked, fputc_unlocked, + and fputs_unlocked. + * configure: Rebuilt. + * system.h: If the *_unlocked functions are available use them + instead of the locked counterparts by defining macros. + * config.in: Regenerated. + Tue Dec 8 00:34:05 1998 Mike Stump * i386/bsd.h (ASM_FILE_START): Don't use dump_base_name, it is diff --git a/gcc/config.in b/gcc/config.in index bacead5ebd0e..13f077216aa6 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -140,6 +140,12 @@ /* Define if you have the bzero function. */ #undef HAVE_BZERO +/* Define if you have the fputc_unlocked function. */ +#undef HAVE_FPUTC_UNLOCKED + +/* Define if you have the fputs_unlocked function. */ +#undef HAVE_FPUTS_UNLOCKED + /* Define if you have the getrlimit function. */ #undef HAVE_GETRLIMIT @@ -158,6 +164,9 @@ /* Define if you have the popen function. */ #undef HAVE_POPEN +/* Define if you have the putc_unlocked function. */ +#undef HAVE_PUTC_UNLOCKED + /* Define if you have the putenv function. */ #undef HAVE_PUTENV diff --git a/gcc/configure b/gcc/configure index d2a998cf01f7..1208d59c96cd 100755 --- a/gcc/configure +++ b/gcc/configure @@ -2045,15 +2045,16 @@ fi for ac_func in strtoul bsearch strerror putenv popen bcopy bzero bcmp \ index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \ - sysconf isascii gettimeofday strsignal + sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \ + fputs_unlocked do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2052: checking for $ac_func" >&5 +echo "configure:2053: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2105,12 +2106,12 @@ done #AC_CHECK_TYPE(wchar_t, unsigned int) echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2109: checking for vprintf" >&5 +echo "configure:2110: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2157,12 +2158,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2161: checking for _doprnt" >&5 +echo "configure:2162: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2221,7 +2222,7 @@ fi echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6 -echo "configure:2225: checking whether the printf functions support %p" >&5 +echo "configure:2226: checking whether the printf functions support %p" >&5 if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2229,7 +2230,7 @@ else gcc_cv_func_printf_ptr=no else cat > conftest.$ac_ext < @@ -2242,7 +2243,7 @@ main() exit (p != q); } EOF -if { (eval echo configure:2246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gcc_cv_func_printf_ptr=yes else @@ -2266,12 +2267,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2270: checking for pid_t" >&5 +echo "configure:2271: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2300,17 +2301,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2304: checking for vfork.h" >&5 +echo "configure:2305: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2335,18 +2336,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2339: checking for working vfork" >&5 +echo "configure:2340: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2345: checking for vfork" >&5 +echo "configure:2346: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2391,7 +2392,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2486,7 +2487,7 @@ main() { } } EOF -if { (eval echo configure:2490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2514,12 +2515,12 @@ for ac_func in malloc realloc calloc free bcopy bzero bcmp \ strsignal do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 -echo "configure:2518: checking whether $ac_func must be declared" >&5 +echo "configure:2519: checking whether $ac_func must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2552,7 +2553,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -2581,12 +2582,12 @@ done for ac_func in getrlimit setrlimit do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 -echo "configure:2585: checking whether $ac_func must be declared" >&5 +echo "configure:2586: checking whether $ac_func must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2623,7 +2624,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:2627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -2650,12 +2651,12 @@ done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2654: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:2655: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2667,7 +2668,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3002,9 +3003,9 @@ for machine in $build $host $target; do tmake_file=arm/t-bare ;; arm*-*-ecos-elf) - tm_file=arm/ecos-elf.h - tmake_file=arm/t-elf - ;; + tm_file=arm/ecos-elf.h + tmake_file=arm/t-elf + ;; arm*-*-elf) tm_file=arm/unknown-elf.h tmake_file=arm/t-arm-elf @@ -4476,10 +4477,13 @@ for machine in $build $host $target; do fixincludes=fixinc.wrap tmake_file=t-netbsd ;; - mipsel-*-linux*) # Little endian Linux MIPS + mips*-*-linux*) # Linux MIPS, either endian. xmake_file=x-linux xm_file="xm-siglist.h ${xm_file}" - tm_file="mips/elfl.h mips/linux.h" + case $machine in + mipsel-*) tm_file="mips/elfl.h mips/linux.h" ;; + *) tm_file="mips/elf.h mips/linux.h" ;; + esac extra_parts="crtbegin.o crtend.o" gnu_ld=yes gas=yes @@ -5908,7 +5912,7 @@ fi # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:5908: checking assembler alignment features" >&5 +echo "configure:5916: checking assembler alignment features" >&5 gcc_cv_as= gcc_cv_as_alignment_features= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas @@ -5981,7 +5985,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:5981: checking assembler subsection support" >&5 +echo "configure:5989: checking assembler subsection support" >&5 gcc_cv_as_subsections= if test x$gcc_cv_as != x; then # Check if we have .subsection @@ -6253,7 +6257,7 @@ fi # Warn if using init_priority. echo $ac_n "checking whether to enable init_priority by default""... $ac_c" 1>&6 -echo "configure:6253: checking whether to enable init_priority by default" >&5 +echo "configure:6261: checking whether to enable init_priority by default" >&5 if test x$enable_init_priority != xyes; then enable_init_priority=no fi diff --git a/gcc/configure.in b/gcc/configure.in index b05578f36004..d8ec9f1b040d 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -371,7 +371,8 @@ fi AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \ index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \ - sysconf isascii gettimeofday strsignal) + sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \ + fputs_unlocked) # Make sure wchar_t is available #AC_CHECK_TYPE(wchar_t, unsigned int) diff --git a/gcc/system.h b/gcc/system.h index 47a3b407d7b1..daa47eb1bbd7 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -21,6 +21,21 @@ #define NULL 0 #endif +/* The compiler is not a multi-threaded application and therefore we + do not have to use the locking functions. */ +#ifdef HAVE_PUTC_UNLOCKED +# undef putc +# define putc(C, Stream) putc_unlocked (C, Stream) +#endif +#ifdef HAVE_FPUTC_UNLOCKED +# undef fputc +# define fputc(C, Stream) fputc_unlocked (C, Stream) +#endif +#ifdef HAVE_FPUTS_UNLOCKED +# undef fputs +# define fputs(String, Stream) fputs_unlocked (String, Stream) +#endif + #include /* Jim Meyering writes: