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).

From-SVN: r47393
This commit is contained in:
Zack Weinberg 2001-11-28 01:37:24 +00:00
parent 215e11524b
commit e490616e33
9 changed files with 671 additions and 130 deletions

View File

@ -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.

View File

@ -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.
@ -492,6 +500,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 = \
@ -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

9
configure vendored
View File

@ -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

View File

@ -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

View File

@ -1,3 +1,11 @@
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>

296
libiberty/_doprnt.c Normal file
View File

@ -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 */

View File

@ -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

120
libiberty/configure vendored
View File

@ -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

View File

@ -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)
@ -255,8 +255,8 @@ AC_SUBST(CHECK)
case "${host}" in
*-*-cygwin*)
AC_DEFINE(HAVE_SYS_ERRLIST)
AC_DEFINE(HAVE_SYS_NERR)
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,