From: Ian Lance Taylor Date: Wed, 28 Jan 1998 22:48:37 +0000 (+0000) Subject: Wed Jan 28 17:45:46 1998 Ian Lance Taylor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d1a5a53ee3ab4518dec121437c71f4d26aae131;p=binutils-gdb.git Wed Jan 28 17:45:46 1998 Ian Lance Taylor * configure.in: Remove vfork check. * nlmconv.c: Never include vfork.h. * aclocal.m4, configure, Makefile.in, config.in: Rebuild. * configure.in: Check for mingw32 when deciding whether to build dlltool. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 48e903f653f..2b40419aba9 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,19 @@ +Wed Jan 28 17:45:46 1998 Ian Lance Taylor + + * configure.in: Remove vfork check. + * nlmconv.c: Never include vfork.h. + * aclocal.m4, configure, Makefile.in, config.in: Rebuild. + +Wed Jan 28 17:43:02 1998 J.J. van der Heijden + + * configure.in: Check for mingw32 when deciding whether to build + dlltool. + * dlltool.c: Never include vfork.h. + (run): Use pexecute rather than vfork. + (gen_lib_file): Check for errors from bfd_set_archive_head and + bfd_close. Close all the BFDs in the archive before deleting the + temporary files. + Thu Jan 22 16:22:55 1998 Fred Fish * objdump.c (disassemble_bytes): Add flag INSN_HAS_RELOC to tell diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 47c77025d31..b450442c986 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -5,7 +5,7 @@ # gives unlimited permission to copy, distribute and modify it. -SHELL = /bin/sh +SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -80,6 +80,7 @@ AUTOMAKE_OPTIONS = dejagnu tooldir = $(exec_prefix)/$(target_alias) CC_FOR_BUILD = @CC_FOR_BUILD@ +EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` YFLAGS = -d @@ -117,9 +118,7 @@ man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 \ PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(ADDR2LINE_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ -bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) \ - $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(ADDR2LINE_PROG) \ - @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ +bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) $(ADDR2LINE_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) @@ -345,7 +344,7 @@ OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJ default: all .SUFFIXES: -.SUFFIXES: .c .dvi .h .info .l .lo .o .ps .texi .texinfo .y +.SUFFIXES: .S .c .dvi .h .info .l .lo .o .ps .s .texi .texinfo .y $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile @@ -361,7 +360,7 @@ config.status: $(srcdir)/configure $(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -config.h: stamp-h +config.h: stamp-h ; @: stamp-h: $(srcdir)/config.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \ @@ -415,6 +414,12 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + .c.o: $(COMPILE) -c $< @@ -431,6 +436,13 @@ maintainer-clean-compile: .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) -c $< +# These are just copies of the above rule. +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + mostlyclean-libtool: rm -f *.lo @@ -888,12 +900,6 @@ stamp-under: Makefile $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c touch stamp-under -version.o: version.c Makefile - $(COMPILE) -c -DVERSION='"$(VERSION)"' $(srcdir)/version.c - -bucomm.o: bucomm.c Makefile - $(COMPILE) -c -DTARGET='"@target@"' $(srcdir)/bucomm.c - cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c @@ -915,15 +921,15 @@ cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h # -rm -f $(STRIP_PROG) # -ln $(OBJCOPY_PROG) $(STRIP_PROG) -sysroff.c: sysinfo sysroff.info - ./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c - ./sysinfo -i <$(srcdir)/sysroff.info >>sysroff.c - ./sysinfo -g <$(srcdir)/sysroff.info >>sysroff.c +sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info + ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c + ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c + ./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c -sysroff.h: sysinfo sysroff.info - ./sysinfo -d <$(srcdir)/sysroff.info >sysroff.h +sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info + ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h -sysinfo: sysinfo.o syslex.o +sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o syslex.o: syslex.c sysinfo.h diff --git a/binutils/aclocal.m4 b/binutils/aclocal.m4 index 4b24a043163..5c0b15a6bb3 100644 --- a/binutils/aclocal.m4 +++ b/binutils/aclocal.m4 @@ -102,19 +102,26 @@ AC_REQUIRE([AM_PROG_LD]) AC_REQUIRE([AC_PROG_LN_S]) # Always use our own libtool. -LIBTOOL='$(top_builddir)/libtool' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL) +dnl CYGNUS LOCAL arguments to enable-shared dnl Allow the --disable-shared flag to stop us from building shared libs. AC_ARG_ENABLE(shared, [ --enable-shared build shared libraries [default=yes]], -[if test "$enableval" = no; then - enable_shared=no -else - enable_shared=yes -fi]) +[p=${PACKAGE-bogus-package-name} + case "$enableval" in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE. + # If it didn't, it'll be `bogus-package-name', thus making this condition + # not be used. + *$p*) enable_shared=yes ;; + *) shared=no ;; +esac]) libtool_shared= test "$enable_shared" = no && libtool_shared=" --disable-shared" +dnl END CYGNUS LOCAL dnl Allow the --disable-static flag to stop us from building static libs. AC_ARG_ENABLE(static, @@ -173,10 +180,7 @@ else fi AC_CACHE_VAL(ac_cv_path_LD, [case "$LD" in - /*) - ac_cv_path_LD="$LD" # Let the user override the test with a path. - ;; - *) + "") IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. @@ -194,6 +198,9 @@ AC_CACHE_VAL(ac_cv_path_LD, done IFS="$ac_save_ifs" ;; + *) + ac_cv_path_LD="$LD" # Let the user override the test with a path. + ;; esac]) LD="$ac_cv_path_LD" if test -n "$LD"; then @@ -267,11 +274,9 @@ AC_DEFUN(AM_MAINTAINER_MODE, # Otherwise set it to "no". dnl AM_CYGWIN32() -dnl You might think we can do this by checking for a cygwin32-specific -dnl cpp define. AC_DEFUN(AM_CYGWIN32, [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, -[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }], +[AC_TRY_COMPILE(,[return __CYGWIN32__;], am_cv_cygwin32=yes, am_cv_cygwin32=no) rm -f conftest*]) CYGWIN32= @@ -286,10 +291,11 @@ dnl This knows we add .exe if we're building in the Cygwin32 dnl environment. But if we're not, then it compiles a test program dnl to see if there is a suffix for executables. AC_DEFUN(AM_EXEEXT, -dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AM_CYGWIN32]) +[AC_REQUIRE([AM_CYGWIN32]) +AC_REQUIRE([AM_MINGW32]) AC_MSG_CHECKING([for executable suffix]) -[AC_CACHE_VAL(am_cv_exeext, -[if test "$CYGWIN32" = yes; then +AC_CACHE_VAL(am_cv_exeext,[ +if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then am_cv_exeext=.exe else cat > am_c_test.c << 'EOF' @@ -298,7 +304,7 @@ int main() { } EOF ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5 -am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//` +am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//` rm -f am_c_test*]) test x"${am_cv_exeext}" = x && am_cv_exeext=no fi @@ -307,3 +313,16 @@ test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext} AC_MSG_RESULT(${am_cv_exeext}) AC_SUBST(EXEEXT)]) +# Check to see if we're running under Mingw, without using +# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes". +# Otherwise set it to "no". + +dnl AM_MINGW32() +AC_DEFUN(AM_MINGW32, +[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32, +[AC_TRY_COMPILE(,[return __MINGW32__;], +am_cv_mingw32=yes, am_cv_mingw32=no) +rm -f conftest*]) +MINGW32= +test "$am_cv_mingw32" = yes && MINGW32=yes]) + diff --git a/binutils/configure b/binutils/configure index d5224e0bdd9..fafc7ec745a 100755 --- a/binutils/configure +++ b/binutils/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.12.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -62,6 +62,7 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -345,7 +346,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.12.1" exit 0 ;; -with-* | --with-*) @@ -574,33 +575,33 @@ esac # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : 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:583: checking host system type" >&5 +echo "configure:584: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) - if host_alias=`$ac_config_guess`; then : + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac -host=`$ac_config_sub $host_alias` +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:604: checking target system type" >&5 +echo "configure:605: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -611,14 +612,14 @@ NONE) esac ;; esac -target=`$ac_config_sub $target_alias` +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:622: checking build system type" >&5 +echo "configure:623: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -629,7 +630,7 @@ NONE) esac ;; esac -build=`$ac_config_sub $build_alias` +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -648,11 +649,12 @@ test "$host_alias" != "$target_alias" && # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # 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:656: checking for a BSD compatible install" >&5 +echo "configure:658: 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 @@ -664,12 +666,13 @@ else /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -721,7 +724,7 @@ cat >> confdefs.h <&6 -echo "configure:725: checking whether build environment is sane" >&5 +echo "configure:728: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -768,7 +771,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:772: checking for working aclocal" >&5 +echo "configure:775: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -781,7 +784,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:785: checking for working autoconf" >&5 +echo "configure:788: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -794,7 +797,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:798: checking for working automake" >&5 +echo "configure:801: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -807,7 +810,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:811: checking for working autoheader" >&5 +echo "configure:814: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -820,7 +823,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:824: checking for working makeinfo" >&5 +echo "configure:827: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -833,7 +836,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:837: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:840: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -863,7 +866,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:867: checking for $ac_word" >&5 +echo "configure:870: 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 @@ -892,7 +895,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:896: checking for $ac_word" >&5 +echo "configure:899: 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 @@ -940,7 +943,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:944: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:947: 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. @@ -950,11 +953,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -974,12 +977,12 @@ 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:978: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:981: 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 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:983: checking whether we are using GNU C" >&5 +echo "configure:986: 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 @@ -988,7 +991,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:992: \"$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:995: \"$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 @@ -1003,7 +1006,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:1007: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1010: 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 @@ -1033,7 +1036,7 @@ fi # 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:1037: checking for $ac_word" >&5 +echo "configure:1040: 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 @@ -1069,19 +1072,16 @@ fi if test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1073: checking for GNU ld" >&5 +echo "configure:1076: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1076: checking for non-GNU ld" >&5 +echo "configure:1079: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$LD" in - /*) - ac_cv_path_LD="$LD" # Let the user override the test with a path. - ;; - *) + "") IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. @@ -1099,6 +1099,9 @@ else done IFS="$ac_save_ifs" ;; + *) + ac_cv_path_LD="$LD" # Let the user override the test with a path. + ;; esac fi @@ -1111,7 +1114,7 @@ fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU ld""... $ac_c" 1>&6 -echo "configure:1115: checking whether we are using GNU ld" >&5 +echo "configure:1118: checking whether we are using GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1127,7 +1130,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1131: checking whether ln -s works" >&5 +echo "configure:1134: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1154,17 +1157,22 @@ fi # Always use our own libtool. -LIBTOOL='$(top_builddir)/libtool' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" - if test "$enableval" = no; then - enable_shared=no -else - enable_shared=yes -fi + p=${PACKAGE-bogus-package-name} + case "$enableval" in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE. + # If it didn't, it'll be `bogus-package-name', thus making this condition + # not be used. + *$p*) enable_shared=yes ;; + *) shared=no ;; +esac fi libtool_shared= @@ -1251,7 +1259,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:1255: checking for $ac_word" >&5 +echo "configure:1263: 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 @@ -1280,7 +1288,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:1284: checking for $ac_word" >&5 +echo "configure:1292: 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 @@ -1328,7 +1336,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1332: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1340: 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. @@ -1338,11 +1346,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1362,12 +1370,12 @@ 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:1366: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1374: 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 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1371: checking whether we are using GNU C" >&5 +echo "configure:1379: 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 @@ -1376,7 +1384,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1380: \"$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:1388: \"$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 @@ -1391,7 +1399,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:1395: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1403: 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 @@ -1424,7 +1432,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1428: checking for $ac_word" >&5 +echo "configure:1436: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1456,7 +1464,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1460: checking for $ac_word" >&5 +echo "configure:1468: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1489,7 +1497,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1493: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1501: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1497,7 +1505,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1531,7 +1539,7 @@ fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1535: checking how to run the C preprocessor" >&5 +echo "configure:1543: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1546,13 +1554,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1563,13 +1571,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1592,7 +1600,7 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:1596: checking lex output file root" >&5 +echo "configure:1604: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1613,7 +1621,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:1617: checking whether yytext is a pointer" >&5 +echo "configure:1625: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1625,14 +1633,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -1655,7 +1663,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1659: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1667: 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" @@ -1673,19 +1681,19 @@ fi echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6 -echo "configure:1677: checking for Cygwin32 environment" >&5 +echo "configure:1685: checking for Cygwin32 environment" >&5 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_cygwin32=yes else @@ -1701,13 +1709,44 @@ fi echo "$ac_t""$am_cv_cygwin32" 1>&6 CYGWIN32= test "$am_cv_cygwin32" = yes && CYGWIN32=yes +echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6 +echo "configure:1714: checking for Mingw32 environment" >&5 +if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$am_cv_mingw32" 1>&6 +MINGW32= +test "$am_cv_mingw32" = yes && MINGW32=yes + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1707: checking for executable suffix" >&5 +echo "configure:1745: checking for executable suffix" >&5 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$CYGWIN32" = yes; then + +if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then am_cv_exeext=.exe else cat > am_c_test.c << 'EOF' @@ -1739,7 +1778,7 @@ AR=${AR-ar} # 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:1743: checking for $ac_word" >&5 +echo "configure:1782: 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 @@ -1778,22 +1817,47 @@ if test -z "$CC_FOR_BUILD"; then fi fi +# Also set EXEEXT_FOR_BUILD. +if test "x$cross_compiling" = "xno"; then + EXEEXT_FOR_BUILD='$(EXEEXT)' +else + echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 +echo "configure:1826: checking for build system executable suffix" >&5 +if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > ac_c_test.c << 'EOF' +int main() { +/* Nothing needed here */ +} +EOF + ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5 + bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//` + rm -f ac_c_test* + test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no +fi + +echo "$ac_t""$bfd_cv_build_exeext" 1>&6 + EXEEXT_FOR_BUILD="" + test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} +fi + for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1787: checking for $ac_hdr" >&5 +echo "configure:1851: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1820,12 +1884,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1824: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1888: 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 < #include @@ -1841,7 +1905,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1864,19 +1928,19 @@ fi # 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:1868: checking for working alloca.h" >&5 +echo "configure:1932: 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:1880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1897,12 +1961,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1901: checking for alloca" >&5 +echo "configure:1965: 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; then +if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1957,12 +2021,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1961: checking whether alloca needs Cray hooks" >&5 +echo "configure:2025: 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:1991: checking for $ac_func" >&5 +echo "configure:2055: 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:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2042,7 +2106,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2046: checking stack direction for C alloca" >&5 +echo "configure:2110: 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 @@ -2050,7 +2114,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2093,12 +2157,12 @@ fi for ac_func in sbrk utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2097: checking for $ac_func" >&5 +echo "configure:2161: 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:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2145,422 +2209,21 @@ else fi done -if test "x$cross_compiling" = "xno"; then - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2151: 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 -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -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 -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -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 -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2255: 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 -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_pid_t=yes -else - rm -rf conftest* - ac_cv_type_pid_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_pid_t" 1>&6 -if test $ac_cv_type_pid_t = no; then - cat >> confdefs.h <<\EOF -#define pid_t int -EOF - -fi - -ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2289: 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:2299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VFORK_H 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2324: 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:2330: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char vfork(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vfork) || defined (__stub___vfork) -choke me -#else -vfork(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_vfork=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vfork=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - -else - cat > conftest.$ac_ext < -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_VFORK_H -#include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. - The compiler is told about this with #include , - but some compilers (e.g. gcc -O) don't grok . - Test for this by using a static variable whose address - is put into a register that is clobbered by the vfork. */ -static -#ifdef __cplusplus -sparc_address_test (int arg) -#else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} -main() { - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. - This test uses lots of local variables, at least - as many local variables as main has allocated so far - including compiler temporaries. 4 locals are enough for - gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. - A buggy compiler should reuse the register of parent - for one of the local variables, since it will think that - parent can't possibly be used any more in this routine. - Assigning to the local variable will thus munge parent - in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), - vfork doesn't separate parent from child file descriptors. - If the child closes a descriptor before it execs or exits, - this munges the parent's descriptor as well. - Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - exit( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -EOF -if { (eval echo configure:2474: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_vfork_works=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 -if test $ac_cv_func_vfork_works = no; then - cat >> confdefs.h <<\EOF -#define vfork fork -EOF - -fi - -else - echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2498: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char vfork(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vfork) || defined (__stub___vfork) -choke me -#else -vfork(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_vfork=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vfork=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define vfork fork -EOF - -fi - -fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:2552: checking for time_t in time.h" >&5 +echo "configure:2215: checking for time_t in time.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:2564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -2581,19 +2244,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2585: checking for time_t in sys/types.h" >&5 +echo "configure:2248: checking for time_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t i; ; return 0; } EOF -if { (eval echo configure:2597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -2616,12 +2279,12 @@ fi # Under Next 3.2 apparently does not define struct utimbuf # by default. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:2620: checking for utime.h" >&5 +echo "configure:2283: checking for utime.h" >&5 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_TIME_H @@ -2632,7 +2295,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:2636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -2653,12 +2316,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:2657: checking whether fprintf must be declared" >&5 +echo "configure:2320: checking whether fprintf must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2679,7 +2342,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:2683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -2701,12 +2364,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:2705: checking whether strstr must be declared" >&5 +echo "configure:2368: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2727,7 +2390,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:2731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -2749,12 +2412,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:2753: checking whether sbrk must be declared" >&5 +echo "configure:2416: checking whether sbrk must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2775,7 +2438,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:2779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -2797,12 +2460,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:2801: checking whether getenv must be declared" >&5 +echo "configure:2464: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2823,7 +2486,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:2827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -2913,7 +2576,7 @@ do DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - i[3-6]86-*pe* | i[3-6]86-*-cygwin32) + i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' @@ -2934,6 +2597,11 @@ done +cat >> confdefs.h <&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set) 2>&1 | grep ac_space` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -3033,7 +2701,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.12.1" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3053,6 +2721,7 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g @@ -3115,6 +2784,7 @@ s%@EXEEXT@%$EXEEXT%g s%@HDEFINES@%$HDEFINES%g s%@AR@%$AR%g s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g +s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g s%@ALLOCA@%$ALLOCA%g s%@NLMCONV_DEFS@%$NLMCONV_DEFS%g s%@BUILD_NLMCONV@%$BUILD_NLMCONV%g diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c index 7bd45a1f7e3..e1df03313cb 100644 --- a/binutils/nlmconv.c +++ b/binutils/nlmconv.c @@ -1,5 +1,5 @@ /* nlmconv.c -- NLM conversion program - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -15,30 +15,34 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Ian Lance Taylor . This program can be used to convert any appropriate object file into a NetWare Loadable Module (an NLM). It will accept a linker specification file which is identical to that accepted by the - NetWare linker, NLMLINK, except that the INPUT command, normally - used to give a list of object files to link together, is not used. - This program will convert only a single object file. */ + NetWare linker, NLMLINK. */ + +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# ifdef _AIX + #pragma alloca +#endif +#endif + +#include "bfd.h" +#include "libiberty.h" +#include "bucomm.h" #include -#include #include #include -#include #include #include #include #include -#include "bfd.h" -#include "libiberty.h" -#include "sysdep.h" -#include "bucomm.h" + /* Internal BFD NLM header. */ #include "libnlm.h" #include "nlmconv.h" @@ -57,10 +61,6 @@ extern char *strerror (); extern struct tm *localtime (); #endif -#ifndef getenv -extern char *getenv (); -#endif - #ifndef SEEK_SET #define SEEK_SET 0 #endif @@ -76,9 +76,6 @@ extern char *getenv (); /* The name used to invoke the program. */ char *program_name; -/* The version number. */ -extern char *program_version; - /* Local variables. */ /* Whether to print out debugging information (currently just controls @@ -137,10 +134,6 @@ static void default_mangle_relocs PARAMS ((bfd *, asection *, arelent ***, long *, char *, bfd_size_type)); static char *link_inputs PARAMS ((struct string_list *, char *)); -static const char *choose_temp_base_try PARAMS ((const char *, - const char *)); -static void choose_temp_base PARAMS ((void)); -static int pexecute PARAMS ((char *, char *[])); #ifdef NLMCONV_I386 static void i386_mangle_relocs PARAMS ((bfd *, asection *, arelent ***, @@ -208,6 +201,7 @@ main (argc, argv) xmalloc_set_program_name (program_name); bfd_init (); + set_default_bfd_target (); while ((opt = getopt_long (argc, argv, "dhI:l:O:T:V", long_options, (int *) NULL)) @@ -234,8 +228,7 @@ main (argc, argv) header_file = optarg; break; case 'V': - printf ("GNU %s version %s\n", program_name, program_version); - exit (0); + print_version ("nlmconv"); /*NOTREACHED*/ case 0: break; @@ -343,7 +336,7 @@ main (argc, argv) if (output_format == NULL) output_format = select_output_format (bfd_get_arch (inbfd), bfd_get_mach (inbfd), - inbfd->xvec->byteorder_big_p); + bfd_big_endian (inbfd)); assert (output_format != NULL); @@ -1125,6 +1118,8 @@ Usage: %s [-dhV] [-I bfdname] [-O bfdname] [-T header-file] [-l linker]\n\ [--help] [--version]\n\ [in-file [out-file]]\n", program_name); + if (status == 0) + fprintf (file, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n"); exit (status); } @@ -1221,7 +1216,8 @@ setup_sections (inbfd, insec, data_ptr) bfd_section_alignment (inbfd, insec))) bfd_fatal ("set section alignment"); - if (! bfd_set_section_flags (outbfd, outsec, f)) + if (! bfd_set_section_flags (outbfd, outsec, + f | bfd_get_section_flags (outbfd, outsec))) bfd_fatal ("set section flags"); bfd_set_reloc (outbfd, outsec, (arelent **) NULL, 0); @@ -1848,28 +1844,6 @@ powerpc_build_stubs (inbfd, outbfd, symbols_ptr, symcount_ptr) * POWERPC_STUB_TOC_ENTRY_SIZE)))) bfd_fatal ("stub section sizes"); } - - /* PowerPC NetWare requires a custom header. We create it here. - The first word is the header version number, currently 1. The - second word is the timestamp of the input file. Unfortunately, - they do not conform to the emergent standard for custom headers. - We must fake the version number and timestamp in the offset and - length fields. */ - memcpy (nlm_custom_header (outbfd)->stamp, "CuStHeAd", 8); - nlm_custom_header (outbfd)->hdrLength = 0; - /* Put version number in dataOffset field. */ - nlm_custom_header (outbfd)->dataOffset = 1; - /* Put timestamp in length field. */ - { - struct stat s; - - if (stat (bfd_get_filename (inbfd), &s) < 0) - s.st_mtime = 0; - nlm_custom_header (outbfd)->dataLength = s.st_mtime; - } - /* No data stamp. */ - memset (nlm_custom_header (outbfd)->dataStamp, 0, - sizeof (nlm_custom_header (outbfd)->dataStamp)); } /* Resolve all the stubs for PowerPC NetWare. We fill in the contents @@ -1949,7 +1923,7 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, char *contents; bfd_size_type contents_size; { - const reloc_howto_type *toc_howto; + reloc_howto_type *toc_howto; long reloc_count; register arelent **relocs; register long i; @@ -1963,8 +1937,8 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, going to write out whatever we return in the contents field. */ if (strcmp (bfd_get_section_name (insec->owner, insec), ".got") == 0) memset (contents + powerpc_initial_got_size, 0, - (bfd_get_section_size_after_reloc (insec) - - powerpc_initial_got_size)); + (size_t) (bfd_get_section_size_after_reloc (insec) + - powerpc_initial_got_size)); reloc_count = *reloc_count_ptr; relocs = *relocs_ptr; @@ -1972,11 +1946,30 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, { arelent *rel; asymbol *sym; - bfd_vma symvalue; + bfd_vma sym_value; rel = *relocs++; sym = *rel->sym_ptr_ptr; + /* Convert any relocs against the .bss section into relocs + against the .data section. */ + if (strcmp (bfd_get_section_name (outbfd, bfd_get_section (sym)), + NLM_UNINITIALIZED_DATA_NAME) == 0) + { + asection *datasec; + + datasec = bfd_get_section_by_name (outbfd, + NLM_INITIALIZED_DATA_NAME); + if (datasec != NULL) + { + rel->addend += (bfd_get_section_vma (outbfd, + bfd_get_section (sym)) + + sym->value); + rel->sym_ptr_ptr = datasec->symbol_ptr_ptr; + sym = *rel->sym_ptr_ptr; + } + } + /* We must be able to resolve all PC relative relocs at this point. If we get a branch to an undefined symbol we build a stub, since NetWare will resolve undefined symbols into a @@ -2029,14 +2022,14 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, symbol value. The symbol will be start of the TOC section (which is named .got). We do want to include the addend. */ if (rel->howto == toc_howto) - symvalue = 0; + sym_value = 0; else - symvalue = sym->value; + sym_value = sym->value; /* If this is a relocation against a symbol with a value, or there is a reloc addend, we need to update the addend in the object file. */ - if (symvalue + rel->addend != 0) + if (sym_value + rel->addend != 0) { bfd_vma val; @@ -2047,7 +2040,7 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, (bfd_byte *) contents + rel->address); val = ((val &~ rel->howto->dst_mask) | (((val & rel->howto->src_mask) - + symvalue + + sym_value + rel->addend) & rel->howto->dst_mask)); if ((bfd_signed_vma) val < - 0x8000 @@ -2063,7 +2056,7 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, (bfd_byte *) contents + rel->address); val = ((val &~ rel->howto->dst_mask) | (((val & rel->howto->src_mask) - + symvalue + + sym_value + rel->addend) & rel->howto->dst_mask)); bfd_put_32 (outbfd, val, (bfd_byte *) contents + rel->address); @@ -2073,7 +2066,8 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, abort (); } - rel->sym_ptr_ptr = bfd_get_section (sym)->symbol_ptr_ptr; + if (! bfd_is_und_section (bfd_get_section (sym))) + rel->sym_ptr_ptr = bfd_get_section (sym)->symbol_ptr_ptr; rel->addend = 0; } @@ -2117,12 +2111,14 @@ link_inputs (inputs, ld) size_t i; int pid; int status; + char *errfmt; + char *errarg; c = 0; for (q = inputs; q != NULL; q = q->next) ++c; - argv = (char **) alloca (c + 5); + argv = (char **) alloca ((c + 5) * sizeof(char *)); #ifndef __MSDOS__ if (ld == NULL) @@ -2148,13 +2144,13 @@ link_inputs (inputs, ld) if (ld == NULL) ld = (char *) LD_NAME; - choose_temp_base (); + temp_filename = choose_temp_base (); unlink_on_exit = xmalloc (strlen (temp_filename) + 3); sprintf (unlink_on_exit, "%s.O", temp_filename); argv[0] = ld; - argv[1] = (char *) "-r"; + argv[1] = (char *) "-Ur"; argv[2] = (char *) "-o"; argv[3] = unlink_on_exit; i = 4; @@ -2169,180 +2165,29 @@ link_inputs (inputs, ld) fprintf (stderr, "\n"); } - pid = pexecute (ld, argv); - - if (waitpid (pid, &status, 0) < 0) + pid = pexecute (ld, argv, program_name, (char *) NULL, &errfmt, &errarg, + PEXECUTE_SEARCH | PEXECUTE_ONE); + if (pid == -1) { - perror ("waitpid"); + fprintf (stderr, "%s: execution of %s failed: ", program_name, ld); + fprintf (stderr, errfmt, errarg); unlink (unlink_on_exit); exit (1); } - if (status != 0) + if (pwait (pid, &status, 0) < 0) { - fprintf (stderr, "%s: Execution of %s failed\n", program_name, ld); + perror ("pwait"); unlink (unlink_on_exit); exit (1); } - return unlink_on_exit; -} - -/* Choose a temporary file name. Stolen from gcc.c. */ - -static const char * -choose_temp_base_try (try, base) - const char *try; - const char *base; -{ - const char *rv; - - if (base) - rv = base; - else if (try == NULL) - rv = NULL; - else if (access (try, R_OK | W_OK) != 0) - rv = NULL; - else - rv = try; - return rv; -} - -static void -choose_temp_base () -{ - const char *base = NULL; - int len; - - base = choose_temp_base_try (getenv ("TMPDIR"), base); - base = choose_temp_base_try (getenv ("TMP"), base); - base = choose_temp_base_try (getenv ("TEMP"), base); - -#ifdef P_tmpdir - base = choose_temp_base_try (P_tmpdir, base); -#endif - - base = choose_temp_base_try ("/usr/tmp", base); - base = choose_temp_base_try ("/tmp", base); - - /* If all else fails, use the current directory! */ - if (base == NULL) - base = "./"; - - len = strlen (base); - temp_filename = xmalloc (len + sizeof("/ccXXXXXX") + 1); - strcpy (temp_filename, base); - if (len > 0 && temp_filename[len-1] != '/') - temp_filename[len++] = '/'; - strcpy (temp_filename + len, "ccXXXXXX"); - - mktemp (temp_filename); - if (*temp_filename == '\0') - abort (); -} - -/* Execute a job. Stolen from gcc.c. */ - -#ifndef OS2 -#ifdef __MSDOS__ - -static int -pexecute (program, argv) - char *program; - char *argv[]; -{ - char *scmd, *rf; - FILE *argfile; - int i; - - scmd = (char *)malloc (strlen (program) + strlen (temp_filename) + 10); - rf = scmd + strlen(program) + 2 + el; - sprintf (scmd, "%s.exe @%s.gp", program, temp_filename); - argfile = fopen (rf, "w"); - if (argfile == 0) - pfatal_with_name (rf); - - 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); - - i = system (scmd); - - remove (rf); - - if (i == -1) - { - perror (program); - return MIN_FATAL_STATUS << 8; - } - - return i << 8; -} - -#else /* not __MSDOS__ */ - -static int -pexecute (program, argv) - char *program; - char *argv[]; -{ - int pid; - int retries, sleep_interval; - - /* Fork a subprocess; wait and retry if it fails. */ - sleep_interval = 1; - for (retries = 0; retries < 4; retries++) - { - pid = vfork (); - if (pid >= 0) - break; - sleep (sleep_interval); - sleep_interval *= 2; - } - - switch (pid) + if (status != 0) { - case -1: -#ifdef vfork - perror ("fork"); -#else - perror ("vfork"); -#endif - exit (1); - /* NOTREACHED */ - return 0; - - case 0: /* child */ - /* Exec the program. */ - execvp (program, argv); - perror (program); + fprintf (stderr, "%s: Execution of %s failed\n", program_name, ld); + unlink (unlink_on_exit); exit (1); - /* NOTREACHED */ - return 0; - - default: - /* Return child's process number. */ - return pid; } -} - -#endif /* not __MSDOS__ */ -#else /* not OS2 */ -static int -pexecute (program, argv) - char *program; - char *argv[]; -{ - return spawnvp (1, program, argv); + return unlink_on_exit; } -#endif /* not OS2 */