diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-03 17:10:00 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-03 17:10:00 +0000 |
commit | cdd25971bbe304b6bc3690f6b307c746e36aeb48 (patch) | |
tree | 58762dfad300d7a3f22d2d5f3e5fa65480253419 /libiberty | |
parent | 242b82fb37800b65dbb0ce6c2afa442f0ee1b856 (diff) |
Mainline merge as of 2003-02-03. Needed to make some changes to
adapt the branch to -Werror:
ChangeLog.tree-ssa
2003-02-03 Diego Novillo <dnovillo@redhat.com>
Fix warnings to allow bootstrapping with -Werror.
* Makefile.in (c-semantics.o-warn): Add -Wno-error.
(emit-rtl.o-warn): Likewise.
(profile.o-warn): Likewise.
(tree.o-warn): Likewise.
(OBJS): Remove simple-break-elim.o and simple-goto-elim.o.
* c-pretty-print.c (print_function_decl): Remove unused function.
* bitmap.c (bitmap_last_set_bit): Initialize variable 'word'.
* c-typeck.c (build_binary_op): Initialize variable 'type'.
* combine.c (combine_simplify_rtx): Initialize variable 'reversed'.
(make_compound_operation): Initialize variable 'i'.
* dwarf2out.c (dwarf2out_finish): Initialize variable 'context'.
* expr.c (store_constructor): Initialize variables 'lo', 'hi',
'startb' and 'endb'.
(expand_expr): Initialize variable 'op0'.
* fold-const.c (fold): Initialize variable 'tem'.
* profile.c (branch_prob): Initialize variable 'prev_file_name'.
* reload.c (find_equiv_reg): Initialize variables 'valtry and
'valueno'.
* rtlanal.c (get_jump_table_offset): Initialize variable 'set'.
* ssa-ccp.c (ssa_const_prop): Fix sign mismatch warning.
* varasm.c (output_constant_def): Initialize variable 'defstr'.
* gimplify.c (simplify_expr): Initialize variables
'saved_input_filename' and 'saved_lineno'.
(simplify_compound_lval): Initialize variable 'code'.
* tree-alias-ander.c (pta_bottom): De-ansify.
(andersen_cleanup): Remove unused variables.
(andersen_heap_assign): Mark argument lhs ATTRIBUTE_UNUSED.
(pta_bottom): Remove unused function.
(pta_get_ptsize): Remove unused function.
cp/ChangeLog.tree-ssa
2003-02-03 Diego Novillo <dnovillo@redhat.com>
* parser.c (cp_parser_asm_definition): Call finish_asm_stmt with
'volatile_p' directly.
* typeck.c (build_binary_op): Initialize variable 'type'.
* Make-lang.in (cp/tree.o-warn): Add -Wno-error.
java/ChangeLog.tree-ssa
2003-02-03 Diego Novillo <dnovillo@redhat.com>
* parse.y (qualify_ambiguous_name): Initialize variable 'decl'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@62325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 58 | ||||
-rw-r--r-- | libiberty/Makefile.in | 35 | ||||
-rwxr-xr-x | libiberty/configure | 269 | ||||
-rw-r--r-- | libiberty/configure.in | 13 | ||||
-rw-r--r-- | libiberty/functions.texi | 33 | ||||
-rw-r--r-- | libiberty/hashtab.c | 76 | ||||
-rw-r--r-- | libiberty/pexecute.c | 792 |
7 files changed, 325 insertions, 951 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 3b236b01b39..9945c9ceafc 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,61 @@ +2003-01-30 Christian Cornelssen <ccorn@cs.tu-berlin.de> + + * Makefile.in (libiberty_topdir): New subst. + (mkinstalldirs): Redefine in terms of the above. + * configure.in: AC_SUBST it. + * configure: Regenerate. + +2003-01-28 Christian Cornelssen <ccorn@cs.tu-berlin.de> + + * Makefile.in (all-subdir, check-subdir, installcheck-subdir) + (info-subdir, install-info-subdir, clean-info-subdir) + (dvi-subdir, install-subdir, etags-subdir, mostlyclean-subdir) + (clean-subdir, distclean-subdir, maintainer-clean-subdir): + Pass $(FLAGS_TO_PASS). + +2003-01-27 Alexandre Oliva <aoliva@redhat.com> + + * Makefile.in (install_to_tooldir): Instead of $(MULTISUBDIR), use + /`$$CC -print-multi-os-directory`. + +2003-01-26 Daniel Jacobowitz <drow@mvista.com> + + * hashtab.c (htab_create_alloc_ex): New function. + (hatab_set_functions_ex): New function. + (htab_delete, htab_expand): Support alternate allocation functions. + +2003-01-24 Christopher Faylor <cgf@redhat.com> + + * configure.in: Remove special pex-cygwin consideration. + * configure: Regenerate. + * pex-cygwin.c: Remove. + * Makefile.in: Remove pex-cygwin.[co] lines. + +2003-01-24 Zack Weinberg <zack@codesourcery.com> + + * Makefile.in (CFILES): Add pex-*.c. + (REQUIRED_OFILES): Change pexecute.o to @pexecute@ + (CONFIGURED_OFILES): Add pex-*.o. + (TEXIFILES): Add pexecute.txh. + (pexecute.o): Delete rule. + (pex-cygwin.o, pex-djgpp.o, pex-mpw.o, pex-msdos.o, pex-os2.o, + pex-unix.o, pex-win32.o): New rules. + * configure.in: Change AC_INIT argument to xmalloc.c. + Compute appropriate pexecute implementation and substitute it + as @pexecute@. + + * pexecute.c: Split up into... + * pex-cygwin.c, pex-djgpp.c, pex-mpw.c, pex-msdos.c, pex-os2.c, + pex-unix.c, pex-win32.c, pex-common.h, pexecute.txh: ... these + new files. + + * functions.texi: Regenerate. + * configure: Regenerate. + +2003-01-20 Josef Zlomek <zlomekj@suse.cz> + + * hashtab.c (htab_expand): Fix allocation of new entries. + 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de> * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 1af4c32277e..761c674c40e 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91-99, 2000, 2001, 2002 +# Copyright (C) 1990, 91-99, 2000, 2001, 2002, 2003 # Free Software Foundation # # This file is part of the libiberty library. @@ -26,6 +26,7 @@ # Makefile for libiberty directory # +libiberty_topdir = @libiberty_topdir@ srcdir = @srcdir@ VPATH = @srcdir@ @@ -50,7 +51,7 @@ MULTICLEAN = true INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs +mkinstalldirs = $(SHELL) $(libiberty_topdir)/mkinstalldirs # Some compilers can't handle cc -c blah.c -o foo/blah.o. OUTPUT_OPTION = @OUTPUT_OPTION@ @@ -140,7 +141,10 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ make-temp-file.c md5.c memchr.c memcmp.c memcpy.c memmove.c \ memset.c mkstemps.c \ objalloc.c obstack.c \ - partition.c pexecute.c putenv.c \ + partition.c \ + pex-djgpp.c pex-mpw.c pex-msdos.c pex-os2.c \ + pex-unix.c pex-win32.c \ + putenv.c \ random.c regex.c rename.c rindex.c \ safe-ctype.c setenv.c sigsetmask.c sort.c spaces.c \ splay-tree.c strcasecmp.c strchr.c strdup.c strerror.c \ @@ -164,7 +168,7 @@ REQUIRED_OFILES = regex.o cplus-dem.o cp-demangle.o md5.o \ make-relative-prefix.o \ make-temp-file.o \ objalloc.o obstack.o \ - partition.o pexecute.o \ + partition.o @pexecute@ \ safe-ctype.o sort.o spaces.o splay-tree.o strerror.o \ strsignal.o \ ternary.o \ @@ -181,7 +185,9 @@ CONFIGURED_OFILES = asprintf.o atexit.o \ getcwd.o getpagesize.o \ index.o insque.o \ memchr.o memcmp.o memcpy.o memmove.o memset.o mkstemps.o \ - putenv.o \ + pex-djgpp.o pex-mpw.o pex-msdos.o pex-os2.o \ + pex-unix.o pex-win32.o \ + putenv.o \ random.o rename.o rindex.o \ setenv.o sigsetmask.o strcasecmp.o strchr.o strdup.o \ strncasecmp.o strncmp.o strrchr.o strstr.o strtod.o strtol.o \ @@ -240,7 +246,7 @@ TEXISRC = \ # Additional files that have texi snippets that need to be collected # and sorted. Some are here because the sources are imported from # elsewhere. Others represent headers in ../include. -TEXIFILES = fnmatch.txh +TEXIFILES = fnmatch.txh pexecute.txh libiberty.info : $(srcdir)/libiberty.texi $(TEXISRC) $(MAKEINFO) -I$(srcdir) $(srcdir)/libiberty.texi @@ -279,10 +285,10 @@ install_to_libdir: all @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install install_to_tooldir: all - ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR) - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n - ( cd $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) - mv -f $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) + ${mkinstalldirs} $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n + ( cd $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory` ; $(RANLIB) $(TARGETLIB)n ) + mv -f $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB)n $(DESTDIR)$(tooldir)/lib/`$$CC -print-multi-os-directory`/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install # needed-list is used by libstdc++. NEEDED is the list of functions @@ -393,7 +399,7 @@ maintainer-clean-subdir: config.h @subdirs='$(SUBDIRS)'; \ target=`echo $@ | sed -e 's/-subdir//'`; \ for dir in $$subdirs ; do \ - cd $$dir && $(MAKE) $$target; \ + cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $$target; \ done $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir @@ -450,8 +456,13 @@ objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h obstack.o: config.h $(INCDIR)/obstack.h partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/partition.h -pexecute.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ +pex-djgpp.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-mpw.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h +pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h +pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h putenv.o: config.h $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h diff --git a/libiberty/configure b/libiberty/configure index cac9f5637a9..86037aebbe5 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -465,7 +465,7 @@ echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=pexecute.c +ac_unique_file=xmalloc.c # Find the source files, if location was not specified. if test -z "$srcdir"; then @@ -583,6 +583,7 @@ if test "${srcdir}" = "."; then else libiberty_topdir="${srcdir}/.." fi + ac_aux_dir= for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do if test -f $ac_dir/install-sh; then @@ -605,7 +606,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:609: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:610: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -630,7 +631,7 @@ fi # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:634: checking for $ac_word" >&5 +echo "configure:635: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -676,7 +677,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:680: checking for $ac_word" >&5 +echo "configure:681: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -716,7 +717,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:720: checking host system type" >&5 +echo "configure:721: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -739,7 +740,7 @@ echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:743: checking build system type" >&5 +echo "configure:744: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -765,7 +766,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:769: checking for $ac_word" >&5 +echo "configure:770: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -797,7 +798,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:801: checking for $ac_word" >&5 +echo "configure:802: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -829,7 +830,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:833: checking for $ac_word" >&5 +echo "configure:834: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -866,7 +867,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:870: checking for $ac_word" >&5 +echo "configure:871: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -896,7 +897,7 @@ 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 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:900: checking for $ac_word" >&5 +echo "configure:901: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -945,7 +946,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:949: checking whether we are using GNU C" >&5 +echo "configure:950: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -954,7 +955,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -970,7 +971,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:974: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:975: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1002,10 +1003,10 @@ fi if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1006: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1009: checking whether cc understands -c and -o together" >&5 +echo "configure:1010: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1017,16 +1018,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1062,7 +1063,7 @@ fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1066: checking for POSIXized ISC" >&5 +echo "configure:1067: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1083,12 +1084,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1087: checking for working const" >&5 +echo "configure:1088: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1092 "configure" +#line 1093 "configure" #include "confdefs.h" int main() { @@ -1137,7 +1138,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1158,21 +1159,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1162: checking for inline" >&5 +echo "configure:1163: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 1169 "configure" +#line 1170 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:1176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1215,7 +1216,7 @@ esac # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1219: checking for a BSD compatible install" >&5 +echo "configure:1220: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1276,7 +1277,7 @@ host_makefile_frag=${frag} # able to link anything, it had better be able to at least compile # something. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1280: checking how to run the C preprocessor" >&5 +echo "configure:1281: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1291,13 +1292,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1295 "configure" +#line 1296 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1302: \"$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 : @@ -1308,13 +1309,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1312 "configure" +#line 1313 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1319: \"$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 : @@ -1325,13 +1326,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1329 "configure" +#line 1330 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1336: \"$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 : @@ -1359,17 +1360,17 @@ for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1363: checking for $ac_hdr" >&5 +echo "configure:1364: checking for $ac_hdr" >&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 -#line 1368 "configure" +#line 1369 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1374: \"$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* @@ -1396,12 +1397,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1400: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1401: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1405 "configure" +#line 1406 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -1417,7 +1418,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1438,12 +1439,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1442: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1443: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1447 "configure" +#line 1448 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1452,7 +1453,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1474,19 +1475,19 @@ fi echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 -echo "configure:1478: checking whether errno must be declared" >&5 +echo "configure:1479: checking whether errno must be declared" >&5 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1483 "configure" +#line 1484 "configure" #include "confdefs.h" #include <errno.h> int main() { int x = errno; ; return 0; } EOF -if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_declare_errno=no else @@ -1508,12 +1509,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1512: checking for ANSI C header files" >&5 +echo "configure:1513: 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 <<EOF -#line 1517 "configure" +#line 1518 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1521,7 +1522,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1526: \"$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* @@ -1538,7 +1539,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 -#line 1542 "configure" +#line 1543 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1556,7 +1557,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 -#line 1560 "configure" +#line 1561 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1577,7 +1578,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1581 "configure" +#line 1582 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1588,7 +1589,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1612,12 +1613,12 @@ EOF fi echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 -echo "configure:1616: checking for uintptr_t" >&5 +echo "configure:1617: checking for uintptr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1621 "configure" +#line 1622 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1654,12 +1655,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1658: checking for pid_t" >&5 +echo "configure:1659: 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 <<EOF -#line 1663 "configure" +#line 1664 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1744,12 +1745,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1748: checking for $ac_func" >&5 +echo "configure:1749: 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 <<EOF -#line 1753 "configure" +#line 1754 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1772,7 +1773,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1777: \"$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 @@ -1799,12 +1800,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1803: checking for $ac_func" >&5 +echo "configure:1804: 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 <<EOF -#line 1808 "configure" +#line 1809 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1827,7 +1828,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1832: \"$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 @@ -1854,12 +1855,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1858: checking for $ac_func" >&5 +echo "configure:1859: 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 <<EOF -#line 1863 "configure" +#line 1864 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1882,7 +1883,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1887: \"$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 @@ -1909,12 +1910,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1913: checking for $ac_func" >&5 +echo "configure:1914: 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 <<EOF -#line 1918 "configure" +#line 1919 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1937,7 +1938,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1942: \"$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 @@ -1964,12 +1965,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1968: checking for $ac_func" >&5 +echo "configure:1969: 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 <<EOF -#line 1973 "configure" +#line 1974 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1992,7 +1993,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1997: \"$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 @@ -2019,12 +2020,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2023: checking for $ac_func" >&5 +echo "configure:2024: 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 <<EOF -#line 2028 "configure" +#line 2029 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2047,7 +2048,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2052: \"$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 @@ -2074,12 +2075,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2078: checking for $ac_func" >&5 +echo "configure:2079: 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 <<EOF -#line 2083 "configure" +#line 2084 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2102,7 +2103,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2107: \"$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 @@ -2332,7 +2333,7 @@ if test -z "${setobjs}"; then # 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:2336: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2337: 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. @@ -2343,12 +2344,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2347 "configure" +#line 2348 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2353: \"$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 @@ -2374,19 +2375,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:2378: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2379: 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:2385: checking for $ac_func" >&5 +echo "configure:2386: 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 <<EOF -#line 2390 "configure" +#line 2391 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2409,7 +2410,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2414: \"$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 @@ -2436,12 +2437,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2440: checking whether alloca needs Cray hooks" >&5 +echo "configure:2441: 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 <<EOF -#line 2445 "configure" +#line 2446 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2466,12 +2467,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&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:2470: checking for $ac_func" >&5 +echo "configure:2471: 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 <<EOF -#line 2475 "configure" +#line 2476 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2494,7 +2495,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2499: \"$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 @@ -2520,7 +2521,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2524: checking stack direction for C alloca" >&5 +echo "configure:2525: 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 @@ -2528,7 +2529,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2532 "configure" +#line 2533 "configure" #include "confdefs.h" find_stack_direction () { @@ -2547,7 +2548,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2552: \"$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 @@ -2569,17 +2570,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2573: checking for vfork.h" >&5 +echo "configure:2574: 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 -#line 2578 "configure" +#line 2579 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2584: \"$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* @@ -2604,18 +2605,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2608: checking for working vfork" >&5 +echo "configure:2609: 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:2614: checking for vfork" >&5 +echo "configure:2615: 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 <<EOF -#line 2619 "configure" +#line 2620 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2638,7 +2639,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2643: \"$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 @@ -2660,7 +2661,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2664 "configure" +#line 2665 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2755,7 +2756,7 @@ main() { } } EOF -if { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2760: \"$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 @@ -2787,12 +2788,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2791: checking for $ac_func" >&5 +echo "configure:2792: 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 <<EOF -#line 2796 "configure" +#line 2797 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2815,7 +2816,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2820: \"$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 @@ -2845,12 +2846,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2849: checking for $ac_func" >&5 +echo "configure:2850: 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 <<EOF -#line 2854 "configure" +#line 2855 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2873,7 +2874,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2878: \"$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 @@ -2901,19 +2902,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2905: checking for $v" >&5 +echo "configure:2906: 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 <<EOF -#line 2910 "configure" +#line 2911 "configure" #include "confdefs.h" int *p; int main() { extern int $v []; p = $v; ; return 0; } EOF -if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2918: \"$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 @@ -2939,12 +2940,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2943: checking for $ac_func" >&5 +echo "configure:2944: 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 <<EOF -#line 2948 "configure" +#line 2949 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2967,7 +2968,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2972: \"$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 @@ -2993,21 +2994,31 @@ done fi +# Figure out which version of pexecute to use. +case "${host}" in + *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; + *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; + *-*-msdos*) pexecute=pex-msdos.o ;; + *-*-os2-emx*) pexecute=pex-os2.o ;; + *) pexecute=pex-unix.o ;; +esac + + for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3001: checking for $ac_hdr" >&5 +echo "configure:3012: checking for $ac_hdr" >&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 -#line 3006 "configure" +#line 3017 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3022: \"$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* @@ -3036,12 +3047,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3040: checking for $ac_func" >&5 +echo "configure:3051: 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 <<EOF -#line 3045 "configure" +#line 3056 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3064,7 +3075,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3079: \"$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 @@ -3089,7 +3100,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3093: checking for working mmap" >&5 +echo "configure:3104: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3097,7 +3108,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3101 "configure" +#line 3112 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3250,7 +3261,7 @@ main() } EOF -if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3274,7 +3285,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3278: checking for working strncmp" >&5 +echo "configure:3289: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3282,7 +3293,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <<EOF -#line 3286 "configure" +#line 3297 "configure" #include "confdefs.h" /* Test by Jim Wilson and Kaveh Ghazi. @@ -3346,7 +3357,7 @@ main () } EOF -if { (eval echo configure:3350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else @@ -3510,6 +3521,7 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@libiberty_topdir@%$libiberty_topdir%g s%@MAINT@%$MAINT%g s%@NOTMAINT@%$NOTMAINT%g s%@MAKEINFO@%$MAKEINFO%g @@ -3541,6 +3553,7 @@ s%@CPP@%$CPP%g s%@CHECK@%$CHECK%g s%@target_header_dir@%$target_header_dir%g s%@LIBOBJS@%$LIBOBJS%g +s%@pexecute@%$pexecute%g s%@INSTALL_DEST@%$INSTALL_DEST%g CEOF diff --git a/libiberty/configure.in b/libiberty/configure.in index a8dc66fa83c..1329f1352d6 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script AC_PREREQ(2.13) -AC_INIT(pexecute.c) +AC_INIT(xmalloc.c) # This works around the fact that libtool configuration may change LD # for this particular configuration, but some shells, instead of @@ -35,6 +35,7 @@ if test "${srcdir}" = "."; then else libiberty_topdir="${srcdir}/.." fi +AC_SUBST(libiberty_topdir) AC_CONFIG_AUX_DIR($libiberty_topdir) dnl Very limited version of automake's enable-maintainer-mode @@ -425,6 +426,16 @@ if test -z "${setobjs}"; then AC_CHECK_FUNCS($checkfuncs) fi +# Figure out which version of pexecute to use. +case "${host}" in + *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;; + *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;; + *-*-msdos*) pexecute=pex-msdos.o ;; + *-*-os2-emx*) pexecute=pex-os2.o ;; + *) pexecute=pex-unix.o ;; +esac +AC_SUBST(pexecute) + libiberty_AC_FUNC_STRNCMP # Install a library built with a cross compiler in $(tooldir) rather diff --git a/libiberty/functions.texi b/libiberty/functions.texi index 7d9c181d219..18b2480a781 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -483,7 +483,7 @@ reading and writing. @end deftypefn -@c pexecute.c:67 +@c pexecute.txh:1 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) Executes a program. @@ -498,14 +498,15 @@ use if needed. This is currently only needed for MS-DOS ports that don't use @code{go32} (do any still exist?). Ports that don't need it can pass @code{NULL}. -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched -(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & -PEXECUTE_FIRST}) is nonzero for the first process in chain. -(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process -in chain. The first/last flags could be simplified to only mark the -last of a chain of processes but that requires the caller to always -mark the last one (and not give up early if some error occurs). -It's more robust to require the caller to mark both ends of the chain. +(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} +should be searched (??? It's not clear that GCC passes this flag +correctly). (@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the +first process in chain. (@code{@var{flags} & PEXECUTE_FIRST}) is +nonzero for the last process in chain. The first/last flags could be +simplified to only mark the last of a chain of processes but that +requires the caller to always mark the last one (and not give up +early if some error occurs). It's more robust to require the caller +to mark both ends of the chain. The result is the pid on systems like Unix where we @code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we @@ -540,21 +541,23 @@ name is unset/removed. @end deftypefn -@c pexecute.c:104 +@c pexecute.txh:39 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) Waits for a program started by @code{pexecute} to finish. @var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused (allows -future enhancement without breaking upward compatibility). Pass 0 for now. +the `status' argument to wait. @var{flags} is currently unused +(allows future enhancement without breaking upward compatibility). +Pass 0 for now. The result is the pid of the child reaped, or -1 for failure (@code{errno} says why). -On systems that don't support waiting for a particular child, @var{pid} is -ignored. On systems like MS-DOS that don't really multitask @code{pwait} -is just a mechanism to provide a consistent interface for the caller. +On systems that don't support waiting for a particular child, +@var{pid} is ignored. On systems like MS-DOS that don't really +multitask @code{pwait} is just a mechanism to provide a consistent +interface for the caller. @end deftypefn diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 6bf59ff7378..0429936e961 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -1,5 +1,5 @@ /* An expandable hash tables datatype. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). This file is part of the libiberty library. @@ -191,6 +191,63 @@ htab_create_alloc (size, hash_f, eq_f, del_f, alloc_f, free_f) return result; } +/* As above, but use the variants of alloc_f and free_f which accept + an extra argument. */ + +htab_t +htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, + free_f) + size_t size; + htab_hash hash_f; + htab_eq eq_f; + htab_del del_f; + PTR alloc_arg; + htab_alloc_with_arg alloc_f; + htab_free_with_arg free_f; +{ + htab_t result; + + size = higher_prime_number (size); + result = (htab_t) (*alloc_f) (alloc_arg, 1, sizeof (struct htab)); + if (result == NULL) + return NULL; + result->entries = (PTR *) (*alloc_f) (alloc_arg, size, sizeof (PTR)); + if (result->entries == NULL) + { + if (free_f != NULL) + (*free_f) (alloc_arg, result); + return NULL; + } + result->size = size; + result->hash_f = hash_f; + result->eq_f = eq_f; + result->del_f = del_f; + result->alloc_arg = alloc_arg; + result->alloc_with_arg_f = alloc_f; + result->free_with_arg_f = free_f; + return result; +} + +/* Update the function pointers and allocation parameter in the htab_t. */ + +void +htab_set_functions_ex (htab, hash_f, eq_f, del_f, alloc_arg, alloc_f, free_f) + htab_t htab; + htab_hash hash_f; + htab_eq eq_f; + htab_del del_f; + PTR alloc_arg; + htab_alloc_with_arg alloc_f; + htab_free_with_arg free_f; +{ + htab->hash_f = hash_f; + htab->eq_f = eq_f; + htab->del_f = del_f; + htab->alloc_arg = alloc_arg; + htab->alloc_with_arg_f = alloc_f; + htab->free_with_arg_f = free_f; +} + /* These functions exist solely for backward compatibility. */ #undef htab_create @@ -234,6 +291,11 @@ htab_delete (htab) (*htab->free_f) (htab->entries); (*htab->free_f) (htab); } + else if (htab->free_with_arg_f != NULL) + { + (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries); + (*htab->free_with_arg_f) (htab->alloc_arg, htab); + } } /* This function clears all entries in the given hash table. */ @@ -306,16 +368,22 @@ htab_expand (htab) PTR *olimit; PTR *p; PTR *nentries; + size_t nsize; oentries = htab->entries; olimit = oentries + htab->size; - htab->size = higher_prime_number (htab->size * 2); + nsize = higher_prime_number (htab->size * 2); - nentries = (PTR *) (*htab->alloc_f) (htab->size, sizeof (PTR *)); + if (htab->alloc_with_arg_f != NULL) + nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, + sizeof (PTR *)); + else + nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR *)); if (nentries == NULL) return 0; htab->entries = nentries; + htab->size = nsize; htab->n_elements -= htab->n_deleted; htab->n_deleted = 0; @@ -338,6 +406,8 @@ htab_expand (htab) if (htab->free_f != NULL) (*htab->free_f) (oentries); + else if (htab->free_with_arg_f != NULL) + (*htab->free_with_arg_f) (htab->alloc_arg, oentries); return 1; } diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c deleted file mode 100644 index 347c4db1092..00000000000 --- a/libiberty/pexecute.c +++ /dev/null @@ -1,792 +0,0 @@ -/* Utilities to execute a program in a subprocess (possibly linked by pipes - with other subprocesses), and wait for it. - Copyright (C) 1996-2000 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This file exports two functions: pexecute and pwait. */ - -/* This file lives in at least two places: libiberty and gcc. - Don't change one without the other. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <errno.h> -#ifdef NEED_DECLARATION_ERRNO -extern int errno; -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -#include "libiberty.h" -#include "safe-ctype.h" - -/* stdin file number. */ -#define STDIN_FILE_NO 0 - -/* stdout file number. */ -#define STDOUT_FILE_NO 1 - -/* value of `pipe': port index for reading. */ -#define READ_PORT 0 - -/* value of `pipe': port index for writing. */ -#define WRITE_PORT 1 - -static char *install_error_msg = "installation problem, cannot exec `%s'"; - -/* pexecute: execute a program. - -@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) - -Executes a program. - -@var{program} and @var{argv} are the arguments to -@code{execv}/@code{execvp}. - -@var{this_pname} is name of the calling program (i.e., @code{argv[0]}). - -@var{temp_base} is the path name, sans suffix, of a temporary file to -use if needed. This is currently only needed for MS-DOS ports that -don't use @code{go32} (do any still exist?). Ports that don't need it -can pass @code{NULL}. - -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched -(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & -PEXECUTE_FIRST}) is nonzero for the first process in chain. -(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process -in chain. The first/last flags could be simplified to only mark the -last of a chain of processes but that requires the caller to always -mark the last one (and not give up early if some error occurs). -It's more robust to require the caller to mark both ends of the chain. - -The result is the pid on systems like Unix where we -@code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we -use @code{spawn}. It is up to the caller to wait for the child. - -The result is the @code{WEXITSTATUS} on systems like MS-DOS where we -@code{spawn} and wait for the child here. - -Upon failure, @var{errmsg_fmt} and @var{errmsg_arg} are set to the -text of the error message with an optional argument (if not needed, -@var{errmsg_arg} is set to @code{NULL}), and @minus{}1 is returned. -@code{errno} is available to the caller to use. - -@end deftypefn - -@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) - -Waits for a program started by @code{pexecute} to finish. - -@var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused (allows -future enhancement without breaking upward compatibility). Pass 0 for now. - -The result is the pid of the child reaped, or -1 for failure -(@code{errno} says why). - -On systems that don't support waiting for a particular child, @var{pid} is -ignored. On systems like MS-DOS that don't really multitask @code{pwait} -is just a mechanism to provide a consistent interface for the caller. - -@end deftypefn - -@undocumented pfinish - - pfinish: finish generation of script - - pfinish is necessary for systems like MPW where a script is generated that - runs the requested programs. */ - -#ifdef __MSDOS__ - -/* MSDOS doesn't multitask, but for the sake of a consistent interface - the code behaves like it does. pexecute runs the program, tucks the - exit code away, and returns a "pid". pwait must be called to fetch the - exit code. */ - -#include <process.h> - -/* For communicating information from pexecute to pwait. */ -static int last_pid = 0; -static int last_status = 0; -static int last_reaped = 0; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int rc; - - last_pid++; - if (last_pid < 0) - last_pid = 1; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - -#ifdef __DJGPP__ - /* ??? What are the possible return values from spawnv? */ - rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv); -#else - char *scmd, *rf; - FILE *argfile; - int i, el = flags & PEXECUTE_SEARCH ? 4 : 0; - - if (temp_base == 0) - temp_base = choose_temp_base (); - scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el); - rf = scmd + strlen(program) + 2 + el; - sprintf (scmd, "%s%s @%s.gp", program, - (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base); - argfile = fopen (rf, "w"); - if (argfile == 0) - { - int errno_save = errno; - free (scmd); - errno = errno_save; - *errmsg_fmt = "cannot open `%s.gp'"; - *errmsg_arg = temp_base; - return -1; - } - - for (i=1; argv[i]; i++) - { - char *cp; - for (cp = argv[i]; *cp; cp++) - { - if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp)) - fputc ('\\', argfile); - fputc (*cp, argfile); - } - fputc ('\n', argfile); - } - fclose (argfile); - - rc = system (scmd); - - { - int errno_save = errno; - remove (rf); - free (scmd); - errno = errno_save; - } -#endif - - if (rc == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = (char *)program; - return -1; - } - - /* Tuck the status away for pwait, and return a "pid". */ - last_status = rc << 8; - return last_pid; -} - -/* Use ECHILD if available, otherwise use EINVAL. */ -#ifdef ECHILD -#define PWAIT_ERROR ECHILD -#else -#define PWAIT_ERROR EINVAL -#endif - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* On MSDOS each pexecute must be followed by it's associated pwait. */ - if (pid != last_pid - /* Called twice for the same child? */ - || pid == last_reaped) - { - errno = PWAIT_ERROR; - return -1; - } - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ -#ifdef __DJGPP__ - *status = (last_status >> 8); -#else - *status = last_status; -#endif - last_reaped = last_pid; - return last_pid; -} - -#endif /* MSDOS */ - -#if defined (_WIN32) && ! defined (_UWIN) - -#include <process.h> - -#ifdef __CYGWIN__ - -#define fix_argv(argvec) (argvec) - -extern int _spawnv (); -extern int _spawnvp (); - -#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. */ - -static const char * const * -fix_argv (argvec) - char **argvec; -{ - int i; - - for (i = 1; argvec[i] != 0; i++) - { - int len, j; - char *temp, *newtemp; - - temp = argvec[i]; - len = strlen (temp); - for (j = 0; j < len; j++) - { - if (temp[j] == '"') - { - newtemp = xmalloc (len + 2); - strncpy (newtemp, temp, j); - newtemp [j] = '\\'; - strncpy (&newtemp [j+1], &temp [j], len-j); - newtemp [len+1] = 0; - temp = newtemp; - len++; - j++; - } - } - - argvec[i] = temp; - } - - for (i = 0; argvec[i] != 0; i++) - { - if (strpbrk (argvec[i], " \t")) - { - int len, trailing_backslash; - char *temp; - - len = strlen (argvec[i]); - trailing_backslash = 0; - - /* There is an added complication when an arg with embedded white - space ends in a backslash (such as in the case of -iprefix arg - passed to cpp). The resulting quoted strings gets misinterpreted - by the command interpreter -- it thinks that the ending quote - is escaped by the trailing backslash and things get confused. - We handle this case by escaping the trailing backslash, provided - it was not escaped in the first place. */ - if (len > 1 - && argvec[i][len-1] == '\\' - && argvec[i][len-2] != '\\') - { - trailing_backslash = 1; - ++len; /* to escape the final backslash. */ - } - - len += 2; /* and for the enclosing quotes. */ - - temp = xmalloc (len + 1); - temp[0] = '"'; - strcpy (temp + 1, argvec[i]); - if (trailing_backslash) - temp[len-2] = '\\'; - temp[len-1] = '"'; - temp[len] = '\0'; - - argvec[i] = temp; - } - } - - return (const char * const *) argvec; -} -#endif /* __CYGWIN__ */ - -#include <io.h> -#include <fcntl.h> -#include <signal.h> - -/* mingw32 headers may not define the following. */ - -#ifndef _P_WAIT -# define _P_WAIT 0 -# define _P_NOWAIT 1 -# define _P_OVERLAY 2 -# define _P_NOWAITO 3 -# define _P_DETACH 4 - -# define WAIT_CHILD 0 -# define WAIT_GRANDCHILD 1 -#endif - -/* Win32 supports pipes */ -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - int pdes[2], org_stdin, org_stdout; - int input_desc, output_desc; - int retries, sleep_interval; - - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (_pipe (pdes, 256, O_BINARY) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - if (input_desc != STDIN_FILE_NO) - { - org_stdin = dup (STDIN_FILE_NO); - dup2 (input_desc, STDIN_FILE_NO); - close (input_desc); - } - - if (output_desc != STDOUT_FILE_NO) - { - org_stdout = dup (STDOUT_FILE_NO); - dup2 (output_desc, STDOUT_FILE_NO); - close (output_desc); - } - - pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) - (_P_NOWAIT, program, fix_argv(argv)); - - if (input_desc != STDIN_FILE_NO) - { - dup2 (org_stdin, STDIN_FILE_NO); - close (org_stdin); - } - - if (output_desc != STDOUT_FILE_NO) - { - dup2 (org_stdout, STDOUT_FILE_NO); - close (org_stdout); - } - - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - - return pid; -} - -/* MS CRTDLL doesn't return enough information in status to decide if the - child exited due to a signal or not, rather it simply returns an - integer with the exit code of the child; eg., if the child exited with - an abort() call and didn't have a handler for SIGABRT, it simply returns - with status = 3. We fix the status code to conform to the usual WIF* - macros. Note that WIFSIGNALED will never be true under CRTDLL. */ - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ -#ifdef __CYGWIN__ - return wait (status); -#else - int termstat; - - pid = _cwait (&termstat, pid, WAIT_CHILD); - - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - - /* cwait returns the child process exit code in termstat. - A value of 3 indicates that the child caught a signal, but not - which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we - report SIGABRT. */ - if (termstat == 3) - *status = SIGABRT; - else - *status = (((termstat) & 0xff) << 8); - - return pid; -#endif /* __CYGWIN__ */ -} - -#endif /* _WIN32 && ! _UWIN */ - -#ifdef OS2 - -/* ??? Does OS2 have process.h? */ -extern int spawnv (); -extern int spawnvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - /* ??? Presumably 1 == _P_NOWAIT. */ - pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv); - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - return pid; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - int pid = wait (status); - return pid; -} - -#endif /* OS2 */ - -#ifdef MPW - -/* MPW pexecute doesn't actually run anything; instead, it writes out - script commands that, when run, will do the actual executing. - - For example, in GCC's case, GCC will write out several script commands: - - cpp ... - cc1 ... - as ... - ld ... - - and then exit. None of the above programs will have run yet. The task - that called GCC will then execute the script and cause cpp,etc. to run. - The caller must invoke pfinish before calling exit. This adds - the finishing touches to the generated script. */ - -static int first_time = 1; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - char tmpprogram[255]; - char *cp, *tmpname; - int i; - - mpwify_filename (program, tmpprogram); - if (first_time) - { - printf ("Set Failed 0\n"); - first_time = 0; - } - - fputs ("If {Failed} == 0\n", stdout); - /* If being verbose, output a copy of the command. It should be - accurate enough and escaped enough to be "clickable". */ - if (flags & PEXECUTE_VERBOSE) - { - fputs ("\tEcho ", stdout); - fputc ('\'', stdout); - fputs (tmpprogram, stdout); - fputc ('\'', stdout); - fputc (' ', stdout); - for (i=1; argv[i]; i++) - { - fputc ('\'', stdout); - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - fputc ('\'', stdout); - fputc (' ', stdout); - } - fputs ("\n", stdout); - } - fputs ("\t", stdout); - fputs (tmpprogram, stdout); - fputc (' ', stdout); - - for (i=1; argv[i]; i++) - { - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - fputc (' ', stdout); - } - - fputs ("\n", stdout); - - /* Output commands that arrange to clean up and exit if a failure occurs. - We have to be careful to collect the status from the program that was - run, rather than some other script command. Also, we don't exit - immediately, since necessary cleanups are at the end of the script. */ - fputs ("\tSet TmpStatus {Status}\n", stdout); - fputs ("\tIf {TmpStatus} != 0\n", stdout); - fputs ("\t\tSet Failed {TmpStatus}\n", stdout); - fputs ("\tEnd\n", stdout); - fputs ("End\n", stdout); - - /* We're just composing a script, can't fail here. */ - return 0; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - *status = 0; - return 0; -} - -/* Write out commands that will exit with the correct error code - if something in the script failed. */ - -void -pfinish () -{ - printf ("\tExit \"{Failed}\"\n"); -} - -#endif /* MPW */ - -/* include for Unix-like environments but not for Dos-like environments */ -#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \ - && ! (defined (_WIN32) && ! defined (_UWIN)) - -extern int execv (); -extern int execvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base ATTRIBUTE_UNUSED; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); - int pid; - int pdes[2]; - int input_desc, output_desc; - int retries, sleep_interval; - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (pipe (pdes) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - /* Fork a subprocess; wait and retry if it fails. */ - sleep_interval = 1; - pid = -1; - for (retries = 0; retries < 4; retries++) - { - pid = fork (); - if (pid >= 0) - break; - sleep (sleep_interval); - sleep_interval *= 2; - } - - switch (pid) - { - case -1: - *errmsg_fmt = "fork"; - *errmsg_arg = NULL; - return -1; - - case 0: /* child */ - /* Move the input and output pipes into place, if necessary. */ - if (input_desc != STDIN_FILE_NO) - { - close (STDIN_FILE_NO); - dup (input_desc); - close (input_desc); - } - if (output_desc != STDOUT_FILE_NO) - { - close (STDOUT_FILE_NO); - dup (output_desc); - close (output_desc); - } - - /* Close the parent's descs that aren't wanted here. */ - if (last_pipe_input != STDIN_FILE_NO) - close (last_pipe_input); - - /* Exec the program. */ - (*func) (program, argv); - - fprintf (stderr, "%s: ", this_pname); - fprintf (stderr, install_error_msg, program); - fprintf (stderr, ": %s\n", xstrerror (errno)); - exit (-1); - /* NOTREACHED */ - return 0; - - default: - /* In the parent, after forking. - Close the descriptors that we made for this child. */ - if (input_desc != STDIN_FILE_NO) - close (input_desc); - if (output_desc != STDOUT_FILE_NO) - close (output_desc); - - /* Return child's process number. */ - return pid; - } -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags ATTRIBUTE_UNUSED; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ -#ifdef VMS - pid = waitpid (-1, status, 0); -#else - pid = wait (status); -#endif - return pid; -} - -#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! _UWIN) */ |