aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-28 01:37:24 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-28 01:37:24 +0000
commit319727714e2aa18749dd90cfb9490730dd9524cd (patch)
treee1dc68a1dd3eda602d655c2a861ed8f415a0163c
parent1f1d05cfc68dce3b30b100077b6db491e90aafd3 (diff)
top level:
2001-11-27 DJ Delorie <dj@redhat.com> Zack Weinberg <zack@codesourcery.com> When build != host, create libiberty for the build machine. * Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace CONFIG_ARGUMENTS. (ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR): New variables. (ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables and rules. (all.normal): Depend on ALL_BUILD_MODULES. (CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS. (all-build-libiberty): Depend on configure-build-libiberty. * configure: Calculate and substitute proper value for ALL_BUILD_MODULES. * configure.in: Create the build subdirectory. Calculate and substitute TARGET_CONFIGARGS (formerly CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new). libiberty: 2001-11-27 Zack Weinberg <zack@codesourcery.com> * _doprnt.c: Moved here from gcc/doprint.c. Adjust to build in libiberty context. Fix typo in leading comment. * configure.in: Fix various AC_DEFINEs so autoheader works. If any of vprintf, vsprintf, vfprintf is missing from libc, then AC_REPLACE_FUNCS(_doprnt). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47393 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog171
-rw-r--r--Makefile.in132
-rwxr-xr-xconfigure9
-rw-r--r--configure.in28
-rw-r--r--libiberty/ChangeLog10
-rw-r--r--libiberty/_doprnt.c296
-rw-r--r--libiberty/config.in18
-rwxr-xr-xlibiberty/configure122
-rw-r--r--libiberty/configure.in15
9 files changed, 671 insertions, 130 deletions
diff --git a/ChangeLog b/ChangeLog
index 84004770e42..67811f26ae3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2001-11-27 DJ Delorie <dj@redhat.com>
+ Zack Weinberg <zack@codesourcery.com>
+
+ When build != host, create libiberty for the build machine.
+
+ * Makefile.in (TARGET_CONFIGARGS, BUILD_CONFIGARGS): Replace
+ CONFIG_ARGUMENTS.
+ (ALL_BUILD_MODULES_LIST, BUILD_CONFIGDIRS, BUILD_SUBDIR):
+ New variables.
+ (ALL_BUILD_MODULES, CONFIGURE_BUILD_MODULES): New variables
+ and rules.
+ (all.normal): Depend on ALL_BUILD_MODULES.
+ (CONFIGURE_TARGET_MODULES rule): Use TARGET_CONFIGARGS.
+ (all-build-libiberty): Depend on configure-build-libiberty.
+
+ * configure: Calculate and substitute proper value for
+ ALL_BUILD_MODULES.
+ * configure.in: Create the build subdirectory.
+ Calculate and substitute TARGET_CONFIGARGS (formerly
+ CONFIG_ARGUMENTS); also BUILD_SUBDIR and BUILD_CONFIGARGS (new).
+
2001-11-26 Ziemowit Laski <zlaski@apple.com>
* MAINTAINERS (write-after-approval): Add self.
@@ -83,7 +104,7 @@ Thu Oct 11 21:50:15 2001 J"orn Rennecke <amylaar@onetel.net.uk>
2001-10-10 Geert Bosch <bosch@gnat.com>
- * MAINTAINERS (Various maintainers: Ada front end):
+ * MAINTAINERS (Various maintainers: Ada front end):
Added Robert Dewar.
2001-10-03 David Billinghurst <David.Billinghurst@riotinto.com>
@@ -106,7 +127,7 @@ Thu Oct 11 21:50:15 2001 J"orn Rennecke <amylaar@onetel.net.uk>
* configure.in (*-*-linux*): Disable configuration of target-newlib
and target-libgloss.
-
+
2001-09-26 Alexandre Oliva <aoliva@redhat.com>
* Makefile.in (EXTRA_TARGET_FLAGS): Pass RANLIB_FOR_TARGET for
@@ -173,7 +194,7 @@ Mon Jul 30 19:24:13 CEST 2001 Jan Hubicka <jh@suse.cz>
2001-07-25 Andrew Haley <aph@cambridge.redhat.com>
- * configure.in (sh-*-linux*): New.
+ * configure.in (sh-*-linux*): New.
2001-07-27 Richard Henderson <rth@redhat.com>
@@ -185,7 +206,7 @@ Mon Jul 30 19:24:13 CEST 2001 Jan Hubicka <jh@suse.cz>
2001-07-16 Aldy Hernandez <aldyh@redhat.com>
- * config.sub: Fix mips64vr5000el typo in CPU-COMPANY.
+ * config.sub: Fix mips64vr5000el typo in CPU-COMPANY.
Fri Jul 13 14:31:57 2001 Nicola Pero <nicola@brainstorm.co.uk>
@@ -381,8 +402,8 @@ Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
2001-04-05 Alexandre Oliva <aoliva@redhat.com>
- * config.sub: Make sure to match an already-canonicalized
- machine name (eg. mn10300-unknown-elf).
+ * config.sub: Make sure to match an already-canonicalized
+ machine name (eg. mn10300-unknown-elf).
2001-04-01 Alexandre Oliva <aoliva@redhat.com>
@@ -472,7 +493,7 @@ Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
EXTRA_GCC_FLAGS, $(DO_X) targets only when the RANLIB is set.
2001-02-28 Benjamin Kosnik <bkoz@redhat.com>
- Alexandre Oliva <aoliva@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
* Makefile.in (check-c++): Use tabs, not spaces.
@@ -482,7 +503,7 @@ Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
2001-02-19 Benjamin Kosnik <bkoz@redhat.com>
- * Makefile.in (check-c++): New rule.
+ * Makefile.in (check-c++): New rule.
* configure.in (target_libs): Remove libg++.
(noconfigdirs): Remove libg++.
@@ -531,7 +552,7 @@ Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
2001-02-08 Chandrakala Chavva <cchavva@redhat.com>
* configure.in: for *-chorusos, don't config target-newlib and
- target-libgloss.
+ target-libgloss.
2001-02-06 Ben Elliston <bje@redhat.com>
@@ -761,11 +782,11 @@ Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
2000-11-22 Loren J. Rittle <ljrittle@acm.org>
- * ltcf-cxx.sh: Support creation of C++ shared libraries on
- recent versions of FreeBSD (release 3 or later).
- * ltconfig: On FreeBSD, -lc must not be provided when building
- a shared library or else the standard -pthread gcc option is
- rendered worthless to later users of the built library.
+ * ltcf-cxx.sh: Support creation of C++ shared libraries on
+ recent versions of FreeBSD (release 3 or later).
+ * ltconfig: On FreeBSD, -lc must not be provided when building
+ a shared library or else the standard -pthread gcc option is
+ rendered worthless to later users of the built library.
2000-11-16 Fred Fish <fnf@be.com>
@@ -900,8 +921,8 @@ Sun Sep 17 16:55:59 CEST 2000 Marc Espie <espie@cvs.openbsd.org>
Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com)
- * configure.in: Do not build byacc for hppa64. Provide paths to the
- X11 libraries for hppa64.
+ * configure.in: Do not build byacc for hppa64. Provide paths to the
+ X11 libraries for hppa64.
2000-09-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
@@ -1127,7 +1148,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com)
2000-07-01 Koundinya K <kk@ddeorg.soft.net>
- * ltconfig: Add support for mips-dde-sysv4.2MP
+ * ltconfig: Add support for mips-dde-sysv4.2MP
2000-06-29 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
@@ -1159,12 +1180,12 @@ Mon May 29 21:15:00 MET 2000 Philipp Thomas <pthomas@suse.de>
20000-05-21 H.J. Lu (hjl@gnu.org)
- * Makefile.in (CC_FOR_TARGET): Make sure as/ld in the gcc
- directory are used if they exist. Make sure
- $(build_tooldir)/include is searched for header files,
- $(build_tooldir)/lib/ for library files.
+ * Makefile.in (CC_FOR_TARGET): Make sure as/ld in the gcc
+ directory are used if they exist. Make sure
+ $(build_tooldir)/include is searched for header files,
+ $(build_tooldir)/lib/ for library files.
(GCC_FOR_TARGET): Likewise.
- (CXX_FOR_TARGET): Likewise.
+ (CXX_FOR_TARGET): Likewise.
Thu May 18 10:58:13 2000 Jeffrey A Law (law@cygnus.com)
@@ -1216,7 +1237,7 @@ Wed May 10 21:26:51 2000 Jim Wilson <wilson@cygnus.com>
2000-05-08 Eli Zaretskii <eliz@is.elta.co.il>
* djunpack.bat: Change the Sed script to replace @V@ in fnchange.lst
- with the version name.
+ with the version name.
Sat May 6 21:12:55 CDT 2000 Jason Eckhardt <jle@cygnus.com>
@@ -1239,8 +1260,8 @@ Wed Apr 19 12:46:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-04-16 Dave Pitts <dpitts@cozx.com>
- * config.sub (case $basic_machine): Change default for "ibm-*"
- to "openedition".
+ * config.sub (case $basic_machine): Change default for "ibm-*"
+ to "openedition".
2000-04-13 Andreas Jaeger <aj@suse.de>
@@ -1269,13 +1290,13 @@ Thu Apr 6 16:15:14 2000 Philippe De Muyter <phdm@macqel.be>
* MAINTAINERS: Added myself.
2000-04-05 Benjamin Kosnik <bkoz@cygnus.com>
- Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
+ Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
- * configure.in (enable_libstdcxx_v3): Add.
- (target_libs): Add bits here to switch between libstdc++-v2 and
- libstdc++-v3.
- * config.if: And this file too.
- * Makefile.in: Add libstdc++-v3 targets.
+ * configure.in (enable_libstdcxx_v3): Add.
+ (target_libs): Add bits here to switch between libstdc++-v2 and
+ libstdc++-v3.
+ * config.if: And this file too.
+ * Makefile.in: Add libstdc++-v3 targets.
2000-04-05 Michael Meissner <meissner@redhat.com>
@@ -1497,15 +1518,15 @@ Tue Jun 22 23:45:18 1999 Tom Tromey <tromey@cygnus.com>
(configure-target-boehm-gc): New target.
(configure-target-qthreads): New target.
- * configure.in (target_libs): Added target-qthreads.
- * Makefile.in (ALL_TARGET_MODULES): Added qthreads.
- (CONFIGURE_TARGET_MODULES): Likewise.
- (CHECK_TARGET_MODULES): Likewise.
- (INSTALL_TARGET_MODULES): Likewise.
- (CLEAN_TARGET_MODULES): Likewise.
- (all-target-qthreads): New target.
- (configure-target-libjava): Depend on configure-target-qthreads.
- (all-target-libjava): Depend on all-target-qthreads.
+ * configure.in (target_libs): Added target-qthreads.
+ * Makefile.in (ALL_TARGET_MODULES): Added qthreads.
+ (CONFIGURE_TARGET_MODULES): Likewise.
+ (CHECK_TARGET_MODULES): Likewise.
+ (INSTALL_TARGET_MODULES): Likewise.
+ (CLEAN_TARGET_MODULES): Likewise.
+ (all-target-qthreads): New target.
+ (configure-target-libjava): Depend on configure-target-qthreads.
+ (all-target-libjava): Depend on all-target-qthreads.
* Makefile.in (ALL_TARGET_MODULES): Added libjava, boehm-gc.
(CONFIGURE_TARGET_MODULES): Likewise.
@@ -1593,7 +1614,7 @@ Thu May 20 10:00:42 1999 Stephen L Moshier <moshier@world.std.com>
Bad merge removed these two changes.
Tue Apr 13 22:50:54 1999 Donn Terry (donn@interix.com)
- Martin Heller (Ing.-Buero_Heller@t-online.de)
+ Martin Heller (Ing.-Buero_Heller@t-online.de)
* config.guess (interix Alpha): Add.
@@ -1650,7 +1671,7 @@ Fri Apr 2 15:11:32 1999 H.J. Lu (hjl@gnu.org)
1999-03-21 Ben Elliston <bje@cygnus.com>
- * config.guess: Correct typo for detecting ELF on FreeBSD.
+ * config.guess: Correct typo for detecting ELF on FreeBSD.
Thu Mar 18 00:17:50 1999 Mark Elbrecht <snowball3@usa.net>
@@ -1760,8 +1781,8 @@ Tue Feb 2 19:46:40 1999 Jim Wilson <wilson@cygnus.com>
Tue Feb 2 20:05:05 1999 Catherine Moore <clm@cygnus.com>
- * config.sub (oabi): Recognize.
- * configure.in (arm-*-oabi): Handle.
+ * config.sub (oabi): Recognize.
+ * configure.in (arm-*-oabi): Handle.
Sat Jan 30 06:09:00 1999 Robert Lipe (robertlipe@usa.net)
@@ -1849,8 +1870,8 @@ Wed Nov 18 20:13:29 1998 Christopher Faylor <cgf@cygnus.com>
Tue Nov 17 16:57:51 1998 Geoffrey Noer <noer@cygnus.com>
- * Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that
- they include winsup/include when it's a cygwin target.
+ * Makefile.in: modify CC_FOR_TARGET and CXX_FOR_TARGET so that
+ they include winsup/include when it's a cygwin target.
1998-11-12 Tom Tromey <tromey@cygnus.com>
@@ -1876,7 +1897,7 @@ Wed Nov 4 18:49:43 1998 Dave Brolley <brolley@cygnus.com>
Mon Nov 2 15:19:33 1998 Geoffrey Noer <noer@cygnus.com>
- * configure.in: drop "32" from config/mh-cygwin32. Check
+ * configure.in: drop "32" from config/mh-cygwin32. Check
cygwin* instead of cygwin32*.
* config.sub: Check cygwin* instead of cygwin32*.
@@ -2482,7 +2503,7 @@ Fri Mar 6 00:14:55 1998 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
Mon Feb 23 15:09:18 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de
- * config.sub (sco5): Fix typo.
+ * config.sub (sco5): Fix typo.
Mon Feb 23 14:46:06 1998 Ian Lance Taylor <ian@cygnus.com>
@@ -2794,10 +2815,10 @@ Sat Nov 8 14:42:59 1997 Michael Meissner <meissner@cygnus.com>
Fri Nov 7 10:34:09 1997 Rob Savoye <rob@darkstar.cygnus.com>
- * include/libiberty.h: Add extern "C" { so it can be used with C++
- progrms.
- * include/remote-sim.h: Add extern "C" { so it can be used with C++
- programs.
+ * include/libiberty.h: Add extern "C" { so it can be used with C++
+ progrms.
+ * include/remote-sim.h: Add extern "C" { so it can be used with C++
+ programs.
Thu Oct 30 11:09:29 1997 Michael Meissner <meissner@cygnus.com>
@@ -2921,7 +2942,7 @@ Sun Sep 7 15:55:28 1997 Gavin Koch <gavin@cygnus.com>
Fri Sep 5 16:11:28 1997 Joel Sherrill (joel@OARcorp.com)
- * configure.in (*-*-rtems*): Do not build libgloss for rtems.
+ * configure.in (*-*-rtems*): Do not build libgloss for rtems.
Fri Sep 5 12:27:17 1997 Jeffrey A Law (law@cygnus.com)
@@ -2989,7 +3010,7 @@ Thu Aug 14 14:42:17 1997 Ian Lance Taylor <ian@cygnus.com>
* configure: When handling a Canadian Cross, handle YACC as well as
BISON. Just set BISON to bison. When setting YACC, prefer bison.
- * Makefile.in (all-bison): Depend upon all-texinfo.
+ * Makefile.in (all-bison): Depend upon all-texinfo.
Tue Aug 12 20:09:48 1997 Jason Merrill <jason@yorick.cygnus.com>
@@ -3322,7 +3343,7 @@ Tue Apr 1 16:28:50 1997 Klaus Kaempf <kkaempf@progis.de>
Mon Mar 31 16:26:55 1997 Joel Sherrill <joel@oarcorp.com>
- * configure.in (hppa1.1-*-rtems*): New target, like hppa-*-*elf*.
+ * configure.in (hppa1.1-*-rtems*): New target, like hppa-*-*elf*.
Sun Mar 30 12:38:27 1997 Fred Fish <fnf@cygnus.com>
@@ -3674,11 +3695,11 @@ Wed Oct 9 17:24:59 1996 Per Bothner <bothner@deneb.cygnus.com>
* config.guess: Merge from FSF.
1996-09-12 Richard Stallman <rms@ethanol.gnu.ai.mit.edu>
- * config.guess: Use pc instead of unknown, for pc clone systems.
- Change linux to linux-gnu.
+ * config.guess: Use pc instead of unknown, for pc clone systems.
+ Change linux to linux-gnu.
Mon Jul 15 23:51:11 1996 Karl Heuer <kwzh@gnu.ai.mit.edu>
- * config.guess: Avoid non-portable tr syntax.
+ * config.guess: Avoid non-portable tr syntax.
Wed Oct 9 06:06:46 1996 Jeffrey A Law (law@cygnus.com)
@@ -3952,9 +3973,9 @@ Mon Jun 24 15:01:12 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
Sun Jun 23 22:41:54 1996 Geoffrey Noer <noer@cygnus.com>
- * configure.in: enable dosrel for cygwin32-hosted builds,
- remove diff from the list of things not buildable
- via Canadian Cross
+ * configure.in: enable dosrel for cygwin32-hosted builds,
+ remove diff from the list of things not buildable
+ via Canadian Cross
Sat Jun 22 11:39:01 1996 Jason Merrill <jason@yorick.cygnus.com>
@@ -4156,8 +4177,8 @@ Thu Mar 28 14:11:11 1996 Tom Tromey <tromey@creche.cygnus.com>
Tue Mar 26 21:18:50 1996 Andrew Cagney <cagney@kremvax.highland.com.au>
- * configure (--enable-*): Handle quoted option lists such as
- --enable-sim-cflags='-g0 -O' better.
+ * configure (--enable-*): Handle quoted option lists such as
+ --enable-sim-cflags='-g0 -O' better.
Thu Mar 21 11:53:08 1996 Michael Meissner <meissner@tiktok.cygnus.com>
@@ -5158,7 +5179,7 @@ Fri Apr 14 15:21:17 1995 Doug Evans <dje@chestnut.cygnus.com>
Wed Apr 12 16:06:01 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* test-build.mk: Enable building of shared libraries on IRIX 5 and
- OSF/1. Fix compiler flags.
+ OSF/1. Fix compiler flags.
* build-all.mk: Support Linux and OSF/1 3.0. Fix compiler flags.
Tue Apr 11 18:55:40 1995 Doug Evans <dje@canuck.cygnus.com>
@@ -5592,21 +5613,21 @@ Fri Aug 26 13:05:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
Thu Aug 25 20:28:51 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* config.guess (Pyramid*:OSx*:*:*): New case.
- (PATH): Add /.attbin at end for finding uname.
- (dummy.c): Handle i860-alliant-bsd. Follow whitespace conventions.
+ (PATH): Add /.attbin at end for finding uname.
+ (dummy.c): Handle i860-alliant-bsd. Follow whitespace conventions.
Wed Aug 17 18:21:02 1994 Tor Egge (tegge@pvv.unit.no)
- * config.guess (M88*:DolphinOS:*:*): New case.
+ * config.guess (M88*:DolphinOS:*:*): New case.
Thu Aug 11 17:00:13 1994 Stan Cox (coxs@dg-rtp.dg.com)
- * config.guess (AViiON:dgux:*:*): Use TARGET_BINARY_INTERFACE
- to select whether to use ELF or COFF.
+ * config.guess (AViiON:dgux:*:*): Use TARGET_BINARY_INTERFACE
+ to select whether to use ELF or COFF.
Sun Jul 24 16:20:53 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu>
- * config.guess: Recognize i860-stardent-sysv and i860-unknown-sysv.
+ * config.guess: Recognize i860-stardent-sysv and i860-unknown-sysv.
Sun May 1 10:23:10 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -5945,7 +5966,7 @@ Thu Apr 14 23:33:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Wed Apr 13 15:14:52 1994 Bill Cox (bill@cygnus.com)
* configure: Make file links cleanly even if Lynx fails on
- an NFS symlink (at least fail cleanly).
+ an NFS symlink (at least fail cleanly).
Mon Apr 11 10:58:56 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
@@ -6098,7 +6119,7 @@ Sat Feb 5 01:00:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Wed Feb 2 13:57:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
- * Makefile.in: Avoid bug in losing hpux sed.
+ * Makefile.in: Avoid bug in losing hpux sed.
Wed Feb 2 14:53:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
@@ -7533,8 +7554,8 @@ Thu Oct 29 00:12:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
ranlib.
* configure: also define $(host_canonical) and
- $(target_canonical), which are the full, canonical names for the
- given host and target
+ $(target_canonical), which are the full, canonical names for the
+ given host and target
Sun Nov 1 16:38:17 1992 Per Bothner (bothner@cygnus.com)
@@ -7682,7 +7703,7 @@ Mon Aug 24 14:05:14 1992 Ian Lance Taylor (ian@cygnus.com)
Tue Aug 11 23:13:17 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
- * COPYING: new file, GPL v2
+ * COPYING: new file, GPL v2
Tue Aug 4 01:12:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
diff --git a/Makefile.in b/Makefile.in
index 6d6c159b687..702550a08d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -178,8 +178,16 @@ TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib librx winsup opcod
# Changed by configure to $(target_alias) if cross.
TARGET_SUBDIR = .
-# This is set by the configure script to the arguments passed to configure.
-CONFIG_ARGUMENTS =
+BUILD_CONFIGDIRS = libiberty
+BUILD_SUBDIR = .
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the target.
+TARGET_CONFIGARGS =
+
+# This is set by the configure script to the arguments to use when configuring
+# directories built for the build system.
+BUILD_CONFIGARGS =
# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
# was used.
@@ -493,6 +501,18 @@ EXTRA_GCC_FLAGS = \
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
# This is a list of the targets for all of the modules which are compiled
+# using the build machine's native compiler. Configure edits the second
+# macro for build!=host builds.
+ALL_BUILD_MODULES_LIST = \
+ all-build-libiberty
+ALL_BUILD_MODULES =
+
+# This is a list of the configure targets for all of the modules which
+# are compiled using the native tools.
+CONFIGURE_BUILD_MODULES = \
+ configure-build-libiberty
+
+# This is a list of the targets for all of the modules which are compiled
# using $(FLAGS_TO_PASS).
ALL_MODULES = \
all-apache \
@@ -947,6 +967,7 @@ CLEAN_X11_MODULES = \
# The target built for a native build.
.PHONY: all.normal
all.normal: \
+ $(ALL_BUILD_MODULES) \
$(ALL_MODULES) \
$(ALL_X11_MODULES) \
$(ALL_TARGET_MODULES) \
@@ -1193,6 +1214,106 @@ gcc-no-fixedincludes:
mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi
+# This rule is used to build the modules which are built with the
+# build machine's native compiler.
+.PHONY: $(ALL_BUILD_MODULES)
+$(ALL_BUILD_MODULES):
+ dir=`echo $@ | sed -e 's/all-build-//'`; \
+ if [ -f ./$${dir}/Makefile ] ; then \
+ r=`pwd`; export r; \
+ s=`cd $(srcdir); pwd`; export s; \
+ (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
+ else \
+ true; \
+ fi
+
+# This rule is used to configure the modules which are built with the
+# native tools.
+.PHONY: $(CONFIGURE_BUILD_MODULES)
+$(CONFIGURE_BUILD_MODULES):
+ @dir=`echo $@ | sed -e 's/configure-build-//'`; \
+ if [ ! -d $(BUILD_SUBDIR) ]; then \
+ true; \
+ elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
+ true; \
+ elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
+ if [ -d $(srcdir)/$${dir} ]; then \
+ [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
+ r=`pwd`; export r; \
+ s=`cd $(srcdir); pwd`; export s; \
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+ DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+ LD="$(LD_FOR_BUILD)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+ NM="$(NM_FOR_BUILD)"; export NM; \
+ RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+ echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
+ cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
+ case $(srcdir) in \
+ /* | [A-Za-z]:[\\/]*) \
+ topdir=$(srcdir) ;; \
+ *) \
+ case "$(BUILD_SUBDIR)" in \
+ .) topdir="../$(srcdir)" ;; \
+ *) topdir="../../$(srcdir)" ;; \
+ esac ;; \
+ esac; \
+ if [ "$(srcdir)" = "." ] ; then \
+ if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
+ if [ -f Makefile ]; then \
+ if $(MAKE) distclean; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ else \
+ exit 1; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ srcdiroption="--srcdir=."; \
+ libsrcdir="."; \
+ else \
+ srcdiroption="--srcdir=$${topdir}/$${dir}"; \
+ libsrcdir="$$s/$${dir}"; \
+ fi; \
+ if [ -f $${libsrcdir}/configure ] ; then \
+ rm -f no-such-file skip-this-dir; \
+ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+ $(BUILD_CONFIGARGS) $${srcdiroption} \
+ --with-build-subdir="$(BUILD_SUBDIR)"; \
+ else \
+ rm -f no-such-file skip-this-dir; \
+ CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
+ $(BUILD_CONFIGARGS) $${srcdiroption} \
+ --with-build-subdir="$(BUILD_SUBDIR)"; \
+ fi || exit 1; \
+ if [ -f skip-this-dir ] ; then \
+ sh skip-this-dir; \
+ rm -f skip-this-dir; \
+ cd ..; rmdir $${dir} || true; \
+ else \
+ true; \
+ fi; \
+ else \
+ true; \
+ fi; \
+ else \
+ true; \
+ fi
+
# This rule is used to build the modules which use FLAGS_TO_PASS. To
# build a target all-X means to cd to X and make all.
#
@@ -1338,12 +1459,12 @@ $(CONFIGURE_TARGET_MODULES):
if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
- $(CONFIG_ARGUMENTS) $${srcdiroption} \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
else \
rm -f no-such-file skip-this-dir; \
CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
- $(CONFIG_ARGUMENTS) $${srcdiroption} \
+ $(TARGET_CONFIGARGS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
fi || exit 1; \
if [ -f skip-this-dir ] ; then \
@@ -1641,6 +1762,9 @@ configure-target-libgloss: $(ALL_GCC)
all-target-libgloss: configure-target-libgloss configure-target-newlib
all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
all-libiberty:
+
+all-build-libiberty: configure-build-libiberty
+
configure-target-libffi: $(ALL_GCC_C)
all-target-libffi: configure-target-libffi
configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
diff --git a/configure b/configure
index 2a47cec91fb..afc5bec7a73 100755
--- a/configure
+++ b/configure
@@ -89,7 +89,7 @@ subdirs=
target_alias=NOTARGET
target_makefile_frag=
undefs=NOUNDEFS
-version="$Revision: 1.37 $"
+version="$Revision: 1.38 $"
x11=default
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
@@ -1088,6 +1088,12 @@ else
GDB_TK=""
fi
+all_build_modules=
+if test x"${build_alias}" != x"${host_alias}"
+then
+ all_build_modules='$(ALL_BUILD_MODULES_LIST)'
+fi
+
for subdir in . ${subdirs} ; do
# ${subdir} is relative path from . to the directory we're currently
@@ -1384,6 +1390,7 @@ EOF
-e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \
-e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \
-e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \
+ -e "s|^ALL_BUILD_MODULES =.*|ALL_BUILD_MODULES =${all_build_modules}|" \
-e "/^CC[ ]*=/{
:loop1
/\\\\$/ N
diff --git a/configure.in b/configure.in
index 321215898dc..7df47b3a69d 100644
--- a/configure.in
+++ b/configure.in
@@ -445,6 +445,18 @@ if [ ! -d ${target_subdir} ] ; then
fi
fi
+build_subdir=${build_alias}
+
+if [ x"${build_alias}" != x"${host}" ] ; then
+ if [ ! -d ${build_subdir} ] ; then
+ if mkdir ${build_subdir} ; then true
+ else
+ echo "'*** could not make ${PWD=`pwd`}/${build_subdir}" 1>&2
+ exit 1
+ fi
+ fi
+fi
+
copy_dirs=
# Handle --with-headers=XXX. The contents of the named directory are
@@ -1349,7 +1361,8 @@ if [ "${shared}" = "yes" ]; then
esac
fi
-# Record target_configdirs and the configure arguments in Makefile.
+# Record target_configdirs and the configure arguments for target and
+# build configuration in Makefile.
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
targargs=`echo "${arguments}" | \
sed -e 's/--no[^ ]*//' \
@@ -1358,6 +1371,11 @@ targargs=`echo "${arguments}" | \
-e 's/--bu[a-z-]*=[^ ]*//' \
-e 's/--ta[a-z-]*=[^ ]*//'`
+# For the build-side libraries, we just need to pretend we're native,
+# and not use the same cache file. Multilibs are neither needed nor
+# desired.
+buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${targargs}"
+
# Passing a --with-cross-host argument lets the target libraries know
# whether they are being built with a cross-compiler or being built
# native. However, it would be better to use other mechanisms to make the
@@ -1378,6 +1396,9 @@ if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib "
targargs="--with-newlib ${targargs}"
fi
+# Pass the appropriate --host, --build, and --cache-file arguments.
+targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
+
# provide a proper gxx_include_dir.
# Note, if you change the default, make sure to fix both here and in
# the gcc and libstdc++-v3 subdirectories.
@@ -1533,9 +1554,8 @@ qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
# macros.
qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
-targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
- -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
+ -e "s%^TARGET_CONFIGARGS[ ]*=.*$%TARGET_CONFIGARGS = ${targargs}%" \
-e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
-e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
-e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
@@ -1543,6 +1563,8 @@ sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:"
-e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
-e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \
-e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
+ -e "s%^BUILD_SUBDIR[ ]*=.*$%BUILD_SUBDIR = ${build_subdir}%" \
+ -e "s%^BUILD_CONFIGARGS[ ]*=.*$%BUILD_CONFIGARGS = ${buildargs}%" \
-e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
Makefile > Makefile.tem
rm -f Makefile
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 4758fc6317b..cad39224ca9 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,13 @@
+2001-11-27 Zack Weinberg <zack@codesourcery.com>
+
+ * _doprnt.c: Moved here from gcc/doprint.c. Adjust to build
+ in libiberty context. Fix typo in leading comment.
+ * configure.in: Fix various AC_DEFINEs so autoheader works.
+ If any of vprintf, vsprintf, vfprintf is missing from libc,
+ then AC_REPLACE_FUNCS(_doprnt).
+
2001-11-26 DJ Delorie <dj@redhat.com>
- Daniel Jacobowitz <drow@mvista.com>
+ Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (stamp-h): Depend on Makefile for proper
serialization.
diff --git a/libiberty/_doprnt.c b/libiberty/_doprnt.c
new file mode 100644
index 00000000000..a91e27f4127
--- /dev/null
+++ b/libiberty/_doprnt.c
@@ -0,0 +1,296 @@
+/* Provide a version of _doprnt in terms of fprintf.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program 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 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "config.h"
+#include "ansidecl.h"
+#include "safe-ctype.h"
+
+#include <stdio.h>
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#undef _doprnt
+
+#ifdef TEST /* Make sure to use the internal one. */
+#define _doprnt my_doprnt
+#endif
+
+#define COPY_VA_INT \
+ do { \
+ const int value = abs (va_arg (ap, int)); \
+ char buf[32]; \
+ ptr++; /* Go past the asterisk. */ \
+ *sptr = '\0'; /* NULL terminate sptr. */ \
+ sprintf(buf, "%d", value); \
+ strcat(sptr, buf); \
+ while (*sptr) sptr++; \
+ } while (0)
+
+#define PRINT_CHAR(CHAR) \
+ do { \
+ putc(CHAR, stream); \
+ ptr++; \
+ total_printed++; \
+ continue; \
+ } while (0)
+
+#define PRINT_TYPE(TYPE) \
+ do { \
+ int result; \
+ TYPE value = va_arg (ap, TYPE); \
+ *sptr++ = *ptr++; /* Copy the type specifier. */ \
+ *sptr = '\0'; /* NULL terminate sptr. */ \
+ result = fprintf(stream, specifier, value); \
+ if (result == -1) \
+ return -1; \
+ else \
+ { \
+ total_printed += result; \
+ continue; \
+ } \
+ } while (0)
+
+int
+_doprnt (format, ap, stream)
+ const char * format;
+ va_list ap;
+ FILE * stream;
+{
+ const char * ptr = format;
+ char specifier[128];
+ int total_printed = 0;
+
+ while (*ptr != '\0')
+ {
+ if (*ptr != '%') /* While we have regular characters, print them. */
+ PRINT_CHAR(*ptr);
+ else /* We got a format specifier! */
+ {
+ char * sptr = specifier;
+ int wide_width = 0, short_width = 0;
+
+ *sptr++ = *ptr++; /* Copy the % and move forward. */
+
+ while (strchr ("-+ #0", *ptr)) /* Move past flags. */
+ *sptr++ = *ptr++;
+
+ if (*ptr == '*')
+ COPY_VA_INT;
+ else
+ while (ISDIGIT(*ptr)) /* Handle explicit numeric value. */
+ *sptr++ = *ptr++;
+
+ if (*ptr == '.')
+ {
+ *sptr++ = *ptr++; /* Copy and go past the period. */
+ if (*ptr == '*')
+ COPY_VA_INT;
+ else
+ while (ISDIGIT(*ptr)) /* Handle explicit numeric value. */
+ *sptr++ = *ptr++;
+ }
+ while (strchr ("hlL", *ptr))
+ {
+ switch (*ptr)
+ {
+ case 'h':
+ short_width = 1;
+ break;
+ case 'l':
+ wide_width++;
+ break;
+ case 'L':
+ wide_width = 2;
+ break;
+ default:
+ abort();
+ }
+ *sptr++ = *ptr++;
+ }
+
+ switch (*ptr)
+ {
+ case 'd':
+ case 'i':
+ case 'o':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'c':
+ {
+ /* Short values are promoted to int, so just copy it
+ as an int and trust the C library printf to cast it
+ to the right width. */
+ if (short_width)
+ PRINT_TYPE(int);
+ else
+ {
+ switch (wide_width)
+ {
+ case 0:
+ PRINT_TYPE(int);
+ break;
+ case 1:
+ PRINT_TYPE(long);
+ break;
+ case 2:
+ default:
+#if defined(__GNUC__) || defined(HAVE_LONG_LONG)
+ PRINT_TYPE(long long);
+#else
+ PRINT_TYPE(long); /* Fake it and hope for the best. */
+#endif
+ break;
+ } /* End of switch (wide_width) */
+ } /* End of else statement */
+ } /* End of integer case */
+ break;
+ case 'f':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ {
+ if (wide_width == 0)
+ PRINT_TYPE(double);
+ else
+ {
+#if defined(__GNUC__) || defined(HAVE_LONG_DOUBLE)
+ PRINT_TYPE(long double);
+#else
+ PRINT_TYPE(double); /* Fake it and hope for the best. */
+#endif
+ }
+ }
+ break;
+ case 's':
+ PRINT_TYPE(char *);
+ break;
+ case 'p':
+ PRINT_TYPE(void *);
+ break;
+ case '%':
+ PRINT_CHAR('%');
+ break;
+ default:
+ abort();
+ } /* End of switch (*ptr) */
+ } /* End of else statement */
+ }
+
+ return total_printed;
+}
+
+#ifdef TEST
+
+#include <math.h>
+#ifndef M_PI
+#define M_PI (3.1415926535897932385)
+#endif
+
+#define RESULT(x) do \
+{ \
+ int i = (x); \
+ printf ("printed %d characters\n", i); \
+ fflush(stdin); \
+} while (0)
+
+static int checkit PARAMS ((const char * format, ...)) ATTRIBUTE_PRINTF_1;
+
+static int
+checkit VPARAMS ((const char* format, ...))
+{
+ int result;
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, char *, format);
+
+ result = _doprnt (format, args, stdout);
+ VA_CLOSE (args);
+
+ return result;
+}
+
+int
+main ()
+{
+ RESULT(checkit ("<%d>\n", 0x12345678));
+ RESULT(printf ("<%d>\n", 0x12345678));
+
+ RESULT(checkit ("<%200d>\n", 5));
+ RESULT(printf ("<%200d>\n", 5));
+
+ RESULT(checkit ("<%.300d>\n", 6));
+ RESULT(printf ("<%.300d>\n", 6));
+
+ RESULT(checkit ("<%100.150d>\n", 7));
+ RESULT(printf ("<%100.150d>\n", 7));
+
+ RESULT(checkit ("<%s>\n",
+ "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
+777777777777777777333333333333366666666666622222222222777777777777733333"));
+ RESULT(printf ("<%s>\n",
+ "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
+777777777777777777333333333333366666666666622222222222777777777777733333"));
+
+ RESULT(checkit ("<%f><%0+#f>%s%d%s>\n",
+ 1.0, 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"));
+ RESULT(printf ("<%f><%0+#f>%s%d%s>\n",
+ 1.0, 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"));
+
+ RESULT(checkit ("<%4f><%.4f><%%><%4.4f>\n", M_PI, M_PI, M_PI));
+ RESULT(printf ("<%4f><%.4f><%%><%4.4f>\n", M_PI, M_PI, M_PI));
+
+ RESULT(checkit ("<%*f><%.*f><%%><%*.*f>\n", 3, M_PI, 3, M_PI, 3, 3, M_PI));
+ RESULT(printf ("<%*f><%.*f><%%><%*.*f>\n", 3, M_PI, 3, M_PI, 3, 3, M_PI));
+
+ RESULT(checkit ("<%d><%i><%o><%u><%x><%X><%c>\n",
+ 75, 75, 75, 75, 75, 75, 75));
+ RESULT(printf ("<%d><%i><%o><%u><%x><%X><%c>\n",
+ 75, 75, 75, 75, 75, 75, 75));
+
+ RESULT(checkit ("<%d><%i><%o><%u><%x><%X><%c>\n",
+ 75, 75, 75, 75, 75, 75, 75));
+ RESULT(printf ("<%d><%i><%o><%u><%x><%X><%c>\n",
+ 75, 75, 75, 75, 75, 75, 75));
+
+ RESULT(checkit ("Testing (hd) short: <%d><%ld><%hd><%hd><%d>\n", 123, (long)234, 345, 123456789, 456));
+ RESULT(printf ("Testing (hd) short: <%d><%ld><%hd><%hd><%d>\n", 123, (long)234, 345, 123456789, 456));
+
+#if defined(__GNUC__) || defined (HAVE_LONG_LONG)
+ RESULT(checkit ("Testing (lld) long long: <%d><%lld><%d>\n", 123, 234234234234234234LL, 345));
+ RESULT(printf ("Testing (lld) long long: <%d><%lld><%d>\n", 123, 234234234234234234LL, 345));
+ RESULT(checkit ("Testing (Ld) long long: <%d><%Ld><%d>\n", 123, 234234234234234234LL, 345));
+ RESULT(printf ("Testing (Ld) long long: <%d><%Ld><%d>\n", 123, 234234234234234234LL, 345));
+#endif
+
+#if defined(__GNUC__) || defined (HAVE_LONG_DOUBLE)
+ RESULT(checkit ("Testing (Lf) long double: <%.20f><%.20Lf><%0+#.20f>\n",
+ 1.23456, 1.234567890123456789L, 1.23456));
+ RESULT(printf ("Testing (Lf) long double: <%.20f><%.20Lf><%0+#.20f>\n",
+ 1.23456, 1.234567890123456789L, 1.23456));
+#endif
+
+ return 0;
+}
+#endif /* TEST */
diff --git a/libiberty/config.in b/libiberty/config.in
index c1434f1c1dd..e06bbce857d 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define to empty if the keyword does not work. */
#undef const
@@ -30,8 +30,8 @@
/* Define vfork as fork if vfork does not work. */
#undef vfork
-/* Define if the system defines a uintptr_t type. */
-#undef HAVE_UINTPTR_T
+/* Define if you have the _doprnt function. */
+#undef HAVE__DOPRNT
/* Define if you have the asprintf function. */
#undef HAVE_ASPRINTF
@@ -60,6 +60,9 @@
/* Define if you have the clock function. */
#undef HAVE_CLOCK
+/* Define if you have the ffs function. */
+#undef HAVE_FFS
+
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
@@ -180,12 +183,12 @@
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
/* Define if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
@@ -225,6 +228,9 @@
/* Define if errno must be declared even when <errno.h> is included. */
#undef NEED_DECLARATION_ERRNO
+/* Define if you have the `uintptr_t' type. */
+#undef HAVE_UINTPTR_T
+
/* Define if you have the sys_errlist variable. */
#undef HAVE_SYS_ERRLIST
diff --git a/libiberty/configure b/libiberty/configure
index 8800349cd66..72f253876bb 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1965,7 +1965,7 @@ fi
case "${host}" in
- *-*-cygwin*)
+ *-*-cygwin*)
cat >> confdefs.h <<\EOF
#define HAVE_SYS_ERRLIST 1
EOF
@@ -2653,21 +2653,84 @@ fi
if test $ac_cv_func_vfork_works = no; then
LIBOBJS="$LIBOBJS vfork.o"
fi
+ # We only need _doprnt if we might use it to implement v*printf.
+ if test $ac_cv_func_vprintf != yes \
+ || test $ac_cv_func_vfprintf != yes \
+ || test $ac_cv_func_vsprintf != yes; then
+ for ac_func in _doprnt
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2664: 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 2669 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* 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 $ac_func();
+
+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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2692: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+fi
+done
+
+
+ fi
+
for v in $vars; do
echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2659: checking for $v" >&5
+echo "configure:2722: 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 2664 "configure"
+#line 2727 "configure"
#include "confdefs.h"
int *p;
int main() {
extern int $v; p = &$v;
; return 0; }
EOF
-if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2734: \"$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
@@ -2693,12 +2756,12 @@ EOF
for ac_func in $checkfuncs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2697: checking for $ac_func" >&5
+echo "configure:2760: 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 2702 "configure"
+#line 2765 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2721,7 +2784,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2788: \"$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
@@ -2747,21 +2810,21 @@ done
fi
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2755: checking for $ac_hdr" >&5
+echo "configure:2818: 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 2760 "configure"
+#line 2823 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2828: \"$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*
@@ -2790,12 +2853,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2794: checking for $ac_func" >&5
+echo "configure:2857: 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 2799 "configure"
+#line 2862 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2818,7 +2881,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2885: \"$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
@@ -2843,7 +2906,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2847: checking for working mmap" >&5
+echo "configure:2910: 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
@@ -2851,7 +2914,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2855 "configure"
+#line 2918 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2879,24 +2942,11 @@ else
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -3004,7 +3054,7 @@ main()
}
EOF
-if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3058: \"$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
@@ -3028,7 +3078,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3032: checking for working strncmp" >&5
+echo "configure:3082: 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
@@ -3036,7 +3086,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3040 "configure"
+#line 3090 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3097,7 +3147,7 @@ main ()
}
EOF
-if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3151: \"$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
diff --git a/libiberty/configure.in b/libiberty/configure.in
index d34f8369bf4..8b67396b731 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -132,7 +132,7 @@ AC_EGREP_HEADER(uintptr_t, sys/types.h,
if test $libiberty_cv_uintptr_t = yes
then
- AC_DEFINE(HAVE_UINTPTR_T)
+ AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if you have the \`uintptr_t' type.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -254,9 +254,9 @@ fi
AC_SUBST(CHECK)
case "${host}" in
- *-*-cygwin*)
- AC_DEFINE(HAVE_SYS_ERRLIST)
- AC_DEFINE(HAVE_SYS_NERR)
+ *-*-cygwin*)
+ AC_DEFINE_NOAUTOHEADER(HAVE_SYS_ERRLIST)
+ AC_DEFINE_NOAUTOHEADER(HAVE_SYS_NERR)
;;
esac
@@ -351,6 +351,13 @@ if test -z "${setobjs}"; then
if test $ac_cv_func_vfork_works = no; then
LIBOBJS="$LIBOBJS vfork.o"
fi
+ # We only need _doprnt if we might use it to implement v*printf.
+ if test $ac_cv_func_vprintf != yes \
+ || test $ac_cv_func_vfprintf != yes \
+ || test $ac_cv_func_vsprintf != yes; then
+ AC_REPLACE_FUNCS(_doprnt)
+ fi
+
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,