diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 68c3b0660ef..f3234ea4789 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,18 @@ +Thu Mar 11 01:22:58 1999 Mumit Khan + + * pexecute.c (__CYGWIN32__): Rename to + (__CYGWIN__): this. + * xmalloc.c: Likewise. + + Changes to support i386-pc-uwin. + * configure.in (*-*-uwin*): Workaround for vfork bug. + * configure: Regenerate. + * pexecute.c (pexecute): Be like standard Unix. + (pwait): Likewise. + * xmalloc.c (first_break): Define. + (xmalloc_set_program_name): Use. + (xmalloc): Use. + Thu Mar 11 01:07:55 1999 Franz Sirl * config.table: Cleanup and add mh-*pic handling for alpha, arm, powerpc diff --git a/libiberty/configure b/libiberty/configure index f2a3a9ed6de..98407e7946c 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1656,12 +1656,19 @@ EOF ;; + *-*-uwin*) + # Under some versions of uwin, vfork is notoriously buggy and the test + # can hang configure; on other versions, vfork exists just as a stub. + # FIXME: This should be removed once vfork in uwin's runtime is fixed. + ac_cv_func_vfork_works=no + ;; + esac # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1665: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1672: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1672,12 +1679,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1676 "configure" +#line 1683 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1703,19 +1710,19 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1707: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1714: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1714: checking for $ac_func" >&5 +echo "configure:1721: 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${ac_exeext}; then +if { (eval echo configure:1749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1767,19 +1774,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1771: checking for working alloca.h" >&5 +echo "configure:1778: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1800,12 +1807,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1804: checking for alloca" >&5 +echo "configure:1811: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+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${ac_exeext}; then +if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1865,12 +1872,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1869: checking whether alloca needs Cray hooks" >&5 +echo "configure:1876: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1899: checking for $ac_func" >&5 +echo "configure:1906: 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${ac_exeext}; then +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1950,7 +1957,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1954: checking stack direction for C alloca" >&5 +echo "configure:1961: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1958,7 +1965,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1999,12 +2006,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2003: checking for ANSI C header files" >&5 +echo "configure:2010: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2012,7 +2019,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2029,7 +2036,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2047,7 +2054,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2068,7 +2075,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2079,7 +2086,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2103,12 +2110,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2107: checking for pid_t" >&5 +echo "configure:2114: 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 @@ -2137,17 +2144,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2141: checking for vfork.h" >&5 +echo "configure:2148: 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:2151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2172,18 +2179,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2176: checking for working vfork" >&5 +echo "configure:2183: 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:2182: checking for vfork" >&5 +echo "configure:2189: 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${ac_exeext}; then +if { (eval echo configure:2217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2228,7 +2235,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2323,7 +2330,7 @@ main() { } } EOF -if { (eval echo configure:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2350,19 +2357,19 @@ fi fi for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2354: checking for $v" >&5 +echo "configure:2361: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+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${ac_exeext}; then +if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2388,12 +2395,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2392: checking for $ac_func" >&5 +echo "configure:2399: 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${ac_exeext}; then +if { (eval echo configure:2427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/libiberty/configure.in b/libiberty/configure.in index 9cc651c43fa..f02f03561e5 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -276,6 +276,13 @@ if test -z "${setobjs}"; then AC_DEFINE(HAVE_SYS_ERRLIST) ;; + *-*-uwin*) + # Under some versions of uwin, vfork is notoriously buggy and the test + # can hang configure; on other versions, vfork exists just as a stub. + # FIXME: This should be removed once vfork in uwin's runtime is fixed. + ac_cv_func_vfork_works=no + ;; + esac # We haven't set the list of objects yet. Use the standard autoconf diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c index 0ead5669acd..49d04a88407 100644 --- a/libiberty/pexecute.c +++ b/libiberty/pexecute.c @@ -230,18 +230,18 @@ pwait (pid, status, flags) #endif /* MSDOS */ -#if defined (_WIN32) +#if defined (_WIN32) && ! defined (__UWIN__) #include -#ifdef __CYGWIN32__ +#ifdef __CYGWIN__ #define fix_argv(argvec) (argvec) extern int _spawnv (); extern int _spawnvp (); -#else /* ! __CYGWIN32__ */ +#else /* ! __CYGWIN__ */ /* This is a kludge to get around the Microsoft C spawn functions' propensity to remove the outermost set of double quotes from all arguments. */ @@ -279,7 +279,7 @@ fix_argv (argvec) return (const char * const *) argvec; } -#endif /* __CYGWIN32__ */ +#endif /* __CYGWIN__ */ #include #include @@ -396,7 +396,7 @@ pwait (pid, status, flags) int *status; int flags; { -#ifdef __CYGWIN32__ +#ifdef __CYGWIN__ return wait (status); #else int termstat; @@ -416,10 +416,10 @@ pwait (pid, status, flags) *status = (((termstat) & 0xff) << 8); return pid; -#endif /* __CYGWIN32__ */ +#endif /* __CYGWIN__ */ } -#endif /* _WIN32 */ +#endif /* _WIN32 && ! __UWIN__ */ #ifdef OS2 @@ -602,7 +602,7 @@ pfinish () /* include for Unix-like environments but not for Dos-like environments */ #if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \ - && ! defined (_WIN32) + && ! (defined (_WIN32) && ! defined (__UWIN__)) extern int execv (); extern int execvp (); @@ -731,4 +731,4 @@ pwait (pid, status, flags) return pid; } -#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! _WIN32 */ +#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! __UWIN__) */ diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c index 4f39014622e..1a12511cf9f 100644 --- a/libiberty/xmalloc.c +++ b/libiberty/xmalloc.c @@ -43,22 +43,22 @@ PTR sbrk PARAMS ((ptrdiff_t)); /* The program name if set. */ static const char *name = ""; -#if ! defined (_WIN32) || defined (__CYGWIN32__) +#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (__UWIN__) /* The initial sbrk, set when the program name is set. Not used for win32 ports other than cygwin32. */ static char *first_break = NULL; -#endif +#endif /* ! _WIN32 || __CYGWIN __ || __UWIN__ */ void xmalloc_set_program_name (s) const char *s; { name = s; -#if ! defined (_WIN32) || defined (__CYGWIN32__) +#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (__UWIN__) /* Win32 ports other than cygwin32 don't have brk() */ if (first_break == NULL) first_break = (char *) sbrk (0); -#endif /* ! _WIN32 || __CYGWIN32 __ */ +#endif /* ! _WIN32 || __CYGWIN __ || __UWIN__ */ } PTR @@ -72,7 +72,7 @@ xmalloc (size) newmem = malloc (size); if (!newmem) { -#if ! defined (_WIN32) || defined (__CYGWIN32__) +#if ! defined (_WIN32) || defined (__CYGWIN__) || defined (__UWIN__) extern char **environ; size_t allocated; @@ -89,7 +89,7 @@ xmalloc (size) "\n%s%sCan not allocate %lu bytes\n", name, *name ? ": " : "", (unsigned long) size); -#endif /* ! _WIN32 || __CYGWIN32 __ */ +#endif /* ! _WIN32 || __CYGWIN __ || __UWIN__ */ xexit (1); } return (newmem); @@ -107,7 +107,7 @@ xcalloc (nelem, elsize) newmem = calloc (nelem, elsize); if (!newmem) { -#if ! defined (_WIN32) || defined (__CYGWIN32__) +#if ! defined (_WIN32) || defined (__CYGWIN__) extern char **environ; size_t allocated; @@ -124,7 +124,7 @@ xcalloc (nelem, elsize) "\n%s%sCan not allocate %lu bytes\n", name, *name ? ": " : "", (unsigned long) (nelem * elsize)); -#endif /* ! _WIN32 || __CYGWIN32 __ */ +#endif /* ! _WIN32 || __CYGWIN __ */ xexit (1); } return (newmem);