From 074583906b66f235c79df466cf9fbfe10dea7e34 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 2 Feb 2001 06:14:42 +0000 Subject: [PATCH] Added unicode string formatting git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8961 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 + Headers/gnustep/base/GSFormat.h | 43 + Source/GNUmakefile | 1 + Source/GSFormat.m | 1849 +++++++++++++++++++++++++++++++ Source/GSString.m | 46 + Source/NSString.m | 34 +- configure | 935 +++++++++------- configure.in | 15 + 8 files changed, 2519 insertions(+), 415 deletions(-) create mode 100644 Headers/gnustep/base/GSFormat.h create mode 100644 Source/GSFormat.m diff --git a/ChangeLog b/ChangeLog index d7d8ebd50..e96bc6f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-02-02 Richard Frith-Macdonald + + Integrated patch for unicode support for ([-initWithFormat:]) by + Kai Henningsen. Modified to support efficient append with format + to a unicode string. + * configure.in: Test for data type used by GSFormat + * Headers/gnustep/base/GSFormat.h: file declaring GSFormat info. + * Source/GSFormat.m: Source for format support. + * Source/NSString.m: Use GSFormat() to implement ([-initWithFormat:]) + * Source/GSString.m: use GSFormat() to implement ([-appendFormat:]) + 2001-01-31 Richard Frith-Macdonald * Source/NSDate.m: pass dates over DO bycopy unless explicitly byref. diff --git a/Headers/gnustep/base/GSFormat.h b/Headers/gnustep/base/GSFormat.h new file mode 100644 index 000000000..4e4bbe1f8 --- /dev/null +++ b/Headers/gnustep/base/GSFormat.h @@ -0,0 +1,43 @@ +/* GSFormat - printf-style formatting + + Copyright (C) 2000 Free Software Foundation, Inc. + + Written by: Kai Henningsen + Created: Jan 2001 + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef __GSFormat_H_ +#define __GSFormat_H_ + +#include + +@class NSDictionary; + +typedef struct { + unichar *buf; + size_t len; + size_t size; + NSZone *z; +} FormatBuf_t; + +void +GSFormat(FormatBuf_t *fb, const unichar *fmt, va_list ap, NSDictionary *loc); + +#endif + diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 46a7e768c..25673fb3b 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -149,6 +149,7 @@ GSArray.m \ GSAttributedString.m \ GSCountedSet.m \ GSDictionary.m \ +GSFormat.m \ GSHTTPURLHandle.m \ GSMime.m \ GSSet.m \ diff --git a/Source/GSFormat.m b/Source/GSFormat.m new file mode 100644 index 000000000..81174ad72 --- /dev/null +++ b/Source/GSFormat.m @@ -0,0 +1,1849 @@ +/* Implementation of GNUSTEP printf-style formatting + Copyright (C) 1994-2000, 2001 Free Software Foundation, Inc. + + Hacked together by Kai Henningsen + from the glibc 2.2.1 sources + _i18n_number.h + _itowa.h + itowa-digits.c + outdigits.h + outdigitswc.h + printf-parse.h + printf.h + vfprintf.c + which were contributed by Ulrich Drepper , 2000, + Date: January 2001 + FIXME: I wasn't brave enough to include floating point formatting - + glibc has CPU dependent routines and also uses gmp. So floating point + formats (AaFfGgAa) simply use sprintf. + FIXME: This needs to use length, not '\0', when dealing with format + and %@ + No register_printf_functions in this thing. + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for strstr() +#include +#include +#include +#include +#include +#ifdef HAVE_UINTMAX_T +#include +#else +typedef unsigned long long uintmax_t; +#endif + +#include + +#include + +//#define NDEBUG 1 +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +// +//#include "../locale/localeinfo.h" + + +struct printf_info +{ + int prec; /* Precision. */ + int width; /* Width. */ + unichar spec; /* Format letter. */ + unsigned int is_long_double:1;/* L flag. */ + unsigned int is_short:1; /* h flag. */ + unsigned int is_long:1; /* l flag. */ + unsigned int alt:1; /* # flag. */ + unsigned int space:1; /* Space flag. */ + unsigned int left:1; /* - flag. */ + unsigned int showsign:1; /* + flag. */ + unsigned int group:1; /* ' flag. */ + unsigned int extra:1; /* For special use. */ + unsigned int is_char:1; /* hh flag. */ + unsigned int wide:1; /* Nonzero for wide character streams. */ + unsigned int i18n:1; /* I flag. */ + unichar pad; /* Padding character. */ +}; + +/* Type of a printf specifier-handler function. + STREAM is the FormatBuf_t on which to write output. + INFO gives information about the format specification. + ARGS is a vector of pointers to the argument data; + the number of pointers will be the number returned + by the associated arginfo function for the same INFO. + + The function should return the number of characters written, + or -1 for errors. */ + + +/* Type of a printf specifier-arginfo function. + INFO gives information about the format specification. + N, ARGTYPES, and return value are as for printf_parse_format. */ + + + +/* Register FUNC to be called to format SPEC specifiers; ARGINFO must be + specified to determine how many arguments a SPEC conversion requires and + what their types are. */ + + + +/* Parse FMT, and fill in N elements of ARGTYPES with the + types needed for the conversions FMT specifies. Returns + the number of arguments required by FMT. + + The ARGINFO function registered with a user-defined format is passed a + `struct printf_info' describing the format spec being parsed. A width + or precision of INT_MIN means a `*' was used to indicate that the + width/precision will come from an arg. The function should fill in the + array it is passed with the types of the arguments it wants, and return + the number of arguments it wants. */ + + + +/* Codes returned by `parse_printf_format' for basic types. + + These values cover all the standard format specifications. + Users can add new values after PA_LAST for their own types. */ + +enum +{ /* C type: */ + PA_INT, /* int */ + PA_CHAR, /* int, cast to char */ + PA_WCHAR, /* wide char */ + PA_STRING, /* const char *, a '\0'-terminated string */ + PA_WSTRING, /* const wchar_t *, wide character string */ + PA_POINTER, /* void * */ + PA_FLOAT, /* float */ + PA_DOUBLE, /* double */ + PA_OBJECT, /* id */ + PA_LAST +}; + +/* Flag bits that can be set in a type returned by `parse_printf_format'. */ +#define PA_FLAG_MASK 0xff00 +#define PA_FLAG_LONG_LONG (1 << 8) +#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG +#define PA_FLAG_LONG (1 << 9) +#define PA_FLAG_SHORT (1 << 10) +#define PA_FLAG_PTR (1 << 11) + + + +/* Function which can be registered as `printf'-handlers. */ + +/* Print floating point value using using abbreviations for the orders + of magnitude used for numbers ('k' for kilo, 'm' for mega etc). If + the format specifier is a uppercase character powers of 1000 are + used. Otherwise powers of 1024. */ + +/* This is the appropriate argument information function for `printf_size'. */ + +/* Digits. */ + +/* Lower-case digits. */ +const char _itowa_lower_digits[36] + = "0123456789abcdefghijklmnopqrstuvwxyz"; +/* Upper-case digits. */ +const char _itowa_upper_digits[36] + = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + +/* This code is shared between the standard stdio implementation found + in GNU C library and the libio implementation originally found in + GNU libg++. + + Beside this it is also shared between the normal and wide character + implementation as defined in ISO/IEC 9899:1990/Amendment 1:1995. */ + + +# define ISDIGIT(Ch) ((unsigned int) ((Ch) - '0') < 10) + +/* Internal function for converting integers to ASCII. */ + + +/* Convert VALUE into ASCII in base BASE (2..36). + Write backwards starting the character just before BUFLIM. + Return the address of the first (left-to-right) character in the number. + Use upper case letters iff UPPER_CASE is nonzero. */ + +static unichar *_itowa (unsigned long long int value, unichar *buflim, + unsigned int base, int upper_case) +{ + const char *digits = (upper_case + ? _itowa_upper_digits : _itowa_lower_digits); + unichar *bp = buflim; + + switch (base) + { +#define SPECIAL(Base) \ + case Base: \ + do \ + *--bp = digits[value % Base]; \ + while ((value /= Base) != 0); \ + break + + SPECIAL (10); + SPECIAL (16); + SPECIAL (8); + default: + do + *--bp = digits[value % base]; + while ((value /= base) != 0); + break; + } + return bp; +} + +static inline unichar * +_itowa_word (unsigned long value, unichar *buflim, + unsigned int base, int upper_case) +{ + const char *digits = (upper_case + ? _itowa_upper_digits : _itowa_lower_digits); + unichar *bp = buflim; + + switch (base) + { +#define SPECIAL(Base) \ + case Base: \ + do \ + *--bp = digits[value % Base]; \ + while ((value /= Base) != 0); \ + break + + SPECIAL (10); + SPECIAL (16); + SPECIAL (8); + default: + do + *--bp = digits[value % base]; + while ((value /= base) != 0); + break; + } + return bp; +} + + +# define PAD(Padchar) \ + { \ + int w = width; \ + while (w > 0) outchar(Padchar); \ + } + + + + +/* Look up the value of the next multibyte character and return its numerical + value if it is one of the digits known in the locale. If *DECIDED is + -1 this means it is not yet decided which form it is and we have to + search through all available digits. Otherwise we know which script + the digits are from. */ + +static unichar * +_i18n_number_rewrite (unichar *w, unichar *rear_ptr, NSString *locale_digits) +{ + unichar *src, *s; + + /* Copy existing string so that nothing gets overwritten. */ + src = (unichar *) alloca ((rear_ptr - w) * sizeof (unichar)); + s = (unichar *) memcpy (src, w, + (rear_ptr - w) * sizeof (unichar)); + w = rear_ptr; + + /* Process all characters in the string. */ + while (--s >= src) + { + if (*s >= '0' && *s <= '9') + { + if (!locale_digits || ![locale_digits length] == 10) locale_digits = @"0123456789"; + + *--w = [locale_digits characterAtIndex: *s - '0']; + } + else + *--w = *s; + } + + return w; +} + +/* Include the shared code for parsing the format string. */ +/* Internal header for parsing printf format strings. */ + + + + +struct printf_spec + { + /* Information parsed from the format spec. */ + struct printf_info info; + + /* Pointers into the format string for the end of this format + spec and the next (or to the end of the string if no more). */ + const unichar *end_of_fmt, *next_fmt; + + /* Position of arguments for precision and width, or -1 if `info' has + the constant value. */ + int prec_arg, width_arg; + + int data_arg; /* Position of data argument. */ + int data_arg_type; /* Type of first argument. */ + /* Number of arguments consumed by this format specifier. */ + size_t ndata_args; + }; + + +/* The various kinds off arguments that can be passed to printf. */ +union printf_arg + { + unsigned char pa_char; + wchar_t pa_wchar; + short int pa_short_int; + int pa_int; + long int pa_long_int; + long long int pa_long_long_int; + unsigned short int pa_u_short_int; + unsigned int pa_u_int; + unsigned long int pa_u_long_int; + unsigned long long int pa_u_long_long_int; + float pa_float; + double pa_double; + long double pa_long_double; + const char *pa_string; + const wchar_t *pa_wstring; + id pa_object; + void *pa_pointer; + }; + + +/* Read a simple integer from a string and update the string pointer. + It is assumed that the first character is a digit. */ +static inline unsigned int +read_int (const unichar * *pstr) +{ + unsigned int retval = **pstr - '0'; + + while (ISDIGIT (*++(*pstr))) + { + retval *= 10; + retval += **pstr - '0'; + } + + return retval; +} + + + +/* Find the next spec in FORMAT, or the end of the string. Returns + a pointer into FORMAT, to a '%' or a '\0'. */ +static inline const unichar * +find_spec (const unichar *format) +{ + while (*format && *format != '%') format++; + return format; +} + + +/* These are defined in reg-printf.c. */ + + +/* FORMAT must point to a '%' at the beginning of a spec. Fills in *SPEC + with the parsed details. POSN is the number of arguments already + consumed. At most MAXTYPES - POSN types are filled in TYPES. Return + the number of args consumed by this spec; *MAX_REF_ARG is updated so it + remains the highest argument index used. */ +static inline size_t +parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec, + size_t *max_ref_arg) +{ + unsigned int n; + size_t nargs = 0; + + /* Skip the '%'. */ + ++format; + + /* Clear information structure. */ + spec->data_arg = -1; + spec->info.alt = 0; + spec->info.space = 0; + spec->info.left = 0; + spec->info.showsign = 0; + spec->info.group = 0; + spec->info.i18n = 0; + spec->info.pad = ' '; + spec->info.wide = sizeof (unichar) > 1; + + /* Test for positional argument. */ + if (ISDIGIT (*format)) + { + const unichar *begin = format; + + n = read_int (&format); + + if (n > 0 && *format == '$') + /* Is positional parameter. */ + { + ++format; /* Skip the '$'. */ + spec->data_arg = n - 1; + *max_ref_arg = MAX (*max_ref_arg, n); + } + else + /* Oops; that was actually the width and/or 0 padding flag. + Step back and read it again. */ + format = begin; + } + + /* Check for spec modifiers. */ + do + { + switch (*format) + { + case ' ': + /* Output a space in place of a sign, when there is no sign. */ + spec->info.space = 1; + continue; + case '+': + /* Always output + or - for numbers. */ + spec->info.showsign = 1; + continue; + case '-': + /* Left-justify things. */ + spec->info.left = 1; + continue; + case '#': + /* Use the "alternate form": + Hex has 0x or 0X, FP always has a decimal point. */ + spec->info.alt = 1; + continue; + case '0': + /* Pad with 0s. */ + spec->info.pad = '0'; + continue; + case '\'': + /* Show grouping in numbers if the locale information + indicates any. */ + spec->info.group = 1; + continue; + case 'I': + /* Use the internationalized form of the output. Currently + means to use the `outdigits' of the current locale. */ + spec->info.i18n = 1; + continue; + default: + break; + } + break; + } + while (*++format); + + if (spec->info.left) + spec->info.pad = ' '; + + /* Get the field width. */ + spec->width_arg = -1; + spec->info.width = 0; + if (*format == '*') + { + /* The field width is given in an argument. + A negative field width indicates left justification. */ + const unichar *begin = ++format; + + if (ISDIGIT (*format)) + { + /* The width argument might be found in a positional parameter. */ + n = read_int (&format); + + if (n > 0 && *format == '$') + { + spec->width_arg = n - 1; + *max_ref_arg = MAX (*max_ref_arg, n); + ++format; /* Skip '$'. */ + } + } + + if (spec->width_arg < 0) + { + /* Not in a positional parameter. Consume one argument. */ + spec->width_arg = posn++; + ++nargs; + format = begin; /* Step back and reread. */ + } + } + else if (ISDIGIT (*format)) + /* Constant width specification. */ + spec->info.width = read_int (&format); + + /* Get the precision. */ + spec->prec_arg = -1; + /* -1 means none given; 0 means explicit 0. */ + spec->info.prec = -1; + if (*format == '.') + { + ++format; + if (*format == '*') + { + /* The precision is given in an argument. */ + const unichar *begin = ++format; + + if (ISDIGIT (*format)) + { + n = read_int (&format); + + if (n > 0 && *format == '$') + { + spec->prec_arg = n - 1; + *max_ref_arg = MAX (*max_ref_arg, n); + ++format; + } + } + + if (spec->prec_arg < 0) + { + /* Not in a positional parameter. */ + spec->prec_arg = posn++; + ++nargs; + format = begin; + } + } + else if (ISDIGIT (*format)) + spec->info.prec = read_int (&format); + else + /* "%.?" is treated like "%.0?". */ + spec->info.prec = 0; + } + + /* Check for type modifiers. */ + spec->info.is_long_double = 0; + spec->info.is_short = 0; + spec->info.is_long = 0; + spec->info.is_char = 0; + + switch (*format++) + { + case 'h': + /* ints are short ints or chars. */ + if (*format != 'h') + spec->info.is_short = 1; + else + { + ++format; + spec->info.is_char = 1; + } + break; + case 'l': + /* ints are long ints. */ + spec->info.is_long = 1; + if (*format != 'l') + break; + ++format; + /* FALLTHROUGH */ + case 'L': + /* doubles are long doubles, and ints are long long ints. */ + case 'q': + /* 4.4 uses this for long long. */ + spec->info.is_long_double = 1; + break; + case 'z': + case 'Z': + /* ints are size_ts. */ + assert (sizeof (size_t) <= sizeof (unsigned long long int)); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = sizeof (size_t) > sizeof (unsigned long int); +#endif + spec->info.is_long = sizeof (size_t) > sizeof (unsigned int); + break; + case 't': + assert (sizeof (ptrdiff_t) <= sizeof (long long int)); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = (sizeof (ptrdiff_t) > sizeof (long int)); +#endif + spec->info.is_long = sizeof (ptrdiff_t) > sizeof (int); + break; + case 'j': + assert (sizeof (uintmax_t) <= sizeof (unsigned long long int)); +#if LONG_MAX != LONG_LONG_MAX + spec->info.is_long_double = (sizeof (uintmax_t) + > sizeof (unsigned long int)); +#endif + spec->info.is_long = sizeof (uintmax_t) > sizeof (unsigned int); + break; + default: + /* Not a recognized modifier. Backup. */ + --format; + break; + } + + /* Get the format specification. */ + spec->info.spec = (unichar) *format++; + { + /* Find the data argument types of a built-in spec. */ + spec->ndata_args = 1; + + switch (spec->info.spec) + { + case 'i': + case 'd': + case 'u': + case 'o': + case 'X': + case 'x': +#if LONG_MAX != LONG_LONG_MAX + if (spec->info.is_long_double) + spec->data_arg_type = PA_INT|PA_FLAG_LONG_LONG; + else +#endif + if (spec->info.is_long) + spec->data_arg_type = PA_INT|PA_FLAG_LONG; + else if (spec->info.is_short) + spec->data_arg_type = PA_INT|PA_FLAG_SHORT; + else if (spec->info.is_char) + spec->data_arg_type = PA_CHAR; + else + spec->data_arg_type = PA_INT; + break; + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + case 'a': + case 'A': + if (spec->info.is_long_double) + spec->data_arg_type = PA_DOUBLE|PA_FLAG_LONG_DOUBLE; + else + spec->data_arg_type = PA_DOUBLE; + break; + case 'c': + spec->data_arg_type = PA_CHAR; + break; + case 'C': + spec->data_arg_type = PA_WCHAR; + break; + case 's': + spec->data_arg_type = PA_STRING; + break; + case 'S': + spec->data_arg_type = PA_WSTRING; + break; + case '@': + spec->data_arg_type = PA_OBJECT; + break; + case 'p': + spec->data_arg_type = PA_POINTER; + break; + case 'n': + spec->data_arg_type = PA_INT|PA_FLAG_PTR; + break; + + case 'm': + default: + /* An unknown spec will consume no args. */ + spec->ndata_args = 0; + break; + } + } + + if (spec->data_arg == -1 && spec->ndata_args > 0) + { + /* There are args consumed, but no positional spec. Use the + next sequential arg position. */ + spec->data_arg = posn; + nargs += spec->ndata_args; + } + + if (spec->info.spec == '\0') + /* Format ended before this spec was complete. */ + spec->end_of_fmt = spec->next_fmt = format - 1; + else + { + /* Find the next format spec. */ + spec->end_of_fmt = format; + spec->next_fmt = find_spec (format); + } + + return nargs; +} + + +#define outchar(Ch) \ + do \ + { \ + register const wint_t outc = (Ch); \ + if (s->len+1 >= s->size) { \ + s->size += s->size / 2; \ + s->buf = NSZoneRealloc(s->z, s->buf, s->size*sizeof(s->buf[0])); \ + } \ + s->buf[s->len++] = outc; \ + ++done; \ + } \ + while (0) + +#define outstring(String, Len) \ + do \ + { \ + unsigned i; \ + \ + if (s->len+(Len) >= s->size) { \ + s->size += s->size/2 > (Len)? s->size/2: (Len); \ + s->buf = NSZoneRealloc(s->z, s->buf, s->size*sizeof(s->buf[0])); \ + } \ + for (i=0; i < (Len); i++) s->buf[s->len++] = (String)[i]; \ + done += (Len); \ + } \ + while (0) + +/* For handling long_double and longlong we use the same flag. If + `long' and `long long' are effectively the same type define it to + zero. */ +#if LONG_MAX == LONG_LONG_MAX +# define is_longlong 0 +#else +# define is_longlong is_long_double +#endif + +/* If `long' and `int' is effectively the same type we don't have to + handle `long separately. */ +#if INT_MAX == LONG_MAX +# define is_long_num 0 +#else +# define is_long_num is_long +#endif + + +/* Global variables. */ +static const unichar null[] = {'(','n','u','l','l',')','\0'}; + + +/* Handle unknown format specifier. */ +static int printf_unknown (FormatBuf_t *, const struct printf_info *, + const void *const *); + +/* Group digits of number string. */ +static unichar *group_number (unichar *, unichar *, const char *, NSString *); + + +/* The function itself. */ +void +GSFormat (FormatBuf_t *s, const unichar *format, va_list ap, +NSDictionary *locale) +{ + /* The character used as thousands separator. */ + NSString *thousands_sep = @""; + + /* The string describing the size of groups of digits. */ + const char *grouping; + + /* Place to accumulate the result. */ + int done; + + /* Current character in format string. */ + const unichar *f; + + /* End of leading constant string. */ + const unichar *lead_str_end; + + /* Points to next format specifier. */ + + /* Buffer intermediate results. */ + unichar work_buffer[1000]; + unichar *workend; + + /* State for restartable multibyte character handling functions. */ + + /* We have to save the original argument pointer. */ + va_list ap_save; + + /* Count number of specifiers we already processed. */ + int nspecs_done; + + /* For the %m format we may need the current `errno' value. */ + int save_errno = errno; + + + /* This table maps a character into a number representing a + class. In each step there is a destination label for each + class. */ + static const int jump_table[] = + { + /* ' ' */ 1, 0, 0, /* '#' */ 4, + 0, /* '%' */ 14, 0, /* '\''*/ 6, + 0, 0, /* '*' */ 7, /* '+' */ 2, + 0, /* '-' */ 3, /* '.' */ 9, 0, + /* '0' */ 5, /* '1' */ 8, /* '2' */ 8, /* '3' */ 8, + /* '4' */ 8, /* '5' */ 8, /* '6' */ 8, /* '7' */ 8, + /* '8' */ 8, /* '9' */ 8, 0, 0, + 0, 0, 0, 0, + /* '@' */ 30, /* 'A' */ 26, 0, /* 'C' */ 25, + 0, /* 'E' */ 19, /* F */ 19, /* 'G' */ 19, + 0, /* 'I' */ 29, 0, 0, + /* 'L' */ 12, 0, 0, 0, + 0, 0, 0, /* 'S' */ 21, + 0, 0, 0, 0, + /* 'X' */ 18, 0, /* 'Z' */ 13, 0, + 0, 0, 0, 0, + 0, /* 'a' */ 26, 0, /* 'c' */ 20, + /* 'd' */ 15, /* 'e' */ 19, /* 'f' */ 19, /* 'g' */ 19, + /* 'h' */ 10, /* 'i' */ 15, /* 'j' */ 28, 0, + /* 'l' */ 11, /* 'm' */ 24, /* 'n' */ 23, /* 'o' */ 17, + /* 'p' */ 22, /* 'q' */ 12, 0, /* 's' */ 21, + /* 't' */ 27, /* 'u' */ 16, 0, 0, + /* 'x' */ 18, 0, /* 'z' */ 13 + }; + +#define NOT_IN_JUMP_RANGE(Ch) ((Ch) < ' ' || (Ch) > 'z') +#define CHAR_CLASS(Ch) (jump_table[(wint_t) (Ch) - ' ']) +# define JUMP_TABLE_TYPE const void *const + + if (s->size == 0) + { + s->buf = NSZoneMalloc(s->z, 100*sizeof(unichar)); + s->size = 100; + } + + /* Initialize local variables. */ + done = 0; + grouping = (const char *) -1; +#ifdef __va_copy + /* This macro will be available soon in gcc's . We need it + since on some systems `va_list' is not an integral type. */ + __va_copy (ap_save, ap); +#else + ap_save = ap; +#endif + nspecs_done = 0; + + /* Find the first format specifier. */ + f = lead_str_end = find_spec ((const unichar *) format); + + + /* Write the literal text before the first format. */ + outstring ((const unichar *) format, + lead_str_end - (const unichar *) format); + + /* If we only have to print a simple string, return now. */ + if (*f == '\0') + goto all_done; + + /* Process whole format string. */ + + workend = &work_buffer[sizeof (work_buffer) / sizeof (unichar)]; + + /* Here starts the more complex loop to handle positional parameters. */ + { + /* Array with information about the needed arguments. This has to + be dynamically extensible. */ + size_t nspecs = 0; + size_t nspecs_max = 32; /* A more or less arbitrary start value. */ + struct printf_spec *specs + = alloca (nspecs_max * sizeof (struct printf_spec)); + + /* The number of arguments the format string requests. This will + determine the size of the array needed to store the argument + attributes. */ + size_t nargs = 0; + int *args_type; + union printf_arg *args_value = NULL; + + /* Positional parameters refer to arguments directly. This could + also determine the maximum number of arguments. Track the + maximum number. */ + size_t max_ref_arg = 0; + + /* Just a counter. */ + size_t cnt; + + + if (grouping == (const char *) -1) + { + thousands_sep = [locale objectForKey: NSThousandsSeparator]; + if (!thousands_sep) thousands_sep = @","; + + grouping = ""; // FIXME: grouping info missing in locale? + if (*grouping == '\0' || *grouping == CHAR_MAX) + grouping = NULL; + } + + for (f = lead_str_end; *f != '\0'; f = specs[nspecs++].next_fmt) + { + if (nspecs >= nspecs_max) + { + /* Extend the array of format specifiers. */ + struct printf_spec *old = specs; + + nspecs_max *= 2; + specs = alloca (nspecs_max * sizeof (struct printf_spec)); + + if (specs == &old[nspecs]) + /* Stack grows up, OLD was the last thing allocated; + extend it. */ + nspecs_max += nspecs_max / 2; + else + { + /* Copy the old array's elements to the new space. */ + memcpy (specs, old, nspecs * sizeof (struct printf_spec)); + if (old == &specs[nspecs]) + /* Stack grows down, OLD was just below the new + SPECS. We can use that space when the new space + runs out. */ + nspecs_max += nspecs_max / 2; + } + } + + /* Parse the format specifier. */ + nargs += parse_one_spec (f, nargs, &specs[nspecs], &max_ref_arg); + } + + /* Determine the number of arguments the format string consumes. */ + nargs = MAX (nargs, max_ref_arg); + + /* Allocate memory for the argument descriptions. */ + args_type = alloca (nargs * sizeof (int)); + memset (args_type, 0, nargs * sizeof (int)); + args_value = alloca (nargs * sizeof (union printf_arg)); + + /* XXX Could do sanity check here: If any element in ARGS_TYPE is + still zero after this loop, format is invalid. For now we + simply use 0 as the value. */ + + /* Fill in the types of all the arguments. */ + for (cnt = 0; cnt < nspecs; ++cnt) + { + /* If the width is determined by an argument this is an int. */ + if (specs[cnt].width_arg != -1) + args_type[specs[cnt].width_arg] = PA_INT; + + /* If the precision is determined by an argument this is an int. */ + if (specs[cnt].prec_arg != -1) + args_type[specs[cnt].prec_arg] = PA_INT; + + switch (specs[cnt].ndata_args) + { + case 0: /* No arguments. */ + break; + case 1: /* One argument; we already have the type. */ + args_type[specs[cnt].data_arg] = specs[cnt].data_arg_type; + break; + default: + /* ??? */ + break; + } + } + + /* Now we know all the types and the order. Fill in the argument + values. */ + for (cnt = 0; cnt < nargs; ++cnt) + switch (args_type[cnt]) + { +#define T(tag, mem, type) \ + case tag: \ + args_value[cnt].mem = va_arg (ap_save, type); \ + break + + T (PA_CHAR, pa_char, int); /* Promoted. */ + T (PA_WCHAR, pa_wchar, wint_t); + T (PA_INT|PA_FLAG_SHORT, pa_short_int, int); /* Promoted. */ + T (PA_INT, pa_int, int); + T (PA_INT|PA_FLAG_LONG, pa_long_int, long int); + T (PA_INT|PA_FLAG_LONG_LONG, pa_long_long_int, long long int); + T (PA_FLOAT, pa_float, double); /* Promoted. */ + T (PA_DOUBLE, pa_double, double); + T (PA_DOUBLE|PA_FLAG_LONG_DOUBLE, pa_long_double, long double); + T (PA_STRING, pa_string, const char *); + T (PA_WSTRING, pa_wstring, const wchar_t *); + T (PA_OBJECT, pa_object, id); + T (PA_POINTER, pa_pointer, void *); +#undef T + default: + if ((args_type[cnt] & PA_FLAG_PTR) != 0) + args_value[cnt].pa_pointer = va_arg (ap_save, void *); + else + args_value[cnt].pa_long_double = 0.0; + break; + } + + /* Now walk through all format specifiers and process them. */ + for (; (size_t) nspecs_done < nspecs; ++nspecs_done) + { +# define REF(Name) &&do2_##Name +#define LABEL(Name) do2_##Name + /* Step 4: processing format specifier. */ + static JUMP_TABLE_TYPE step4_jumps[31] = + { + REF (form_unknown), + REF (form_unknown), /* for ' ' */ + REF (form_unknown), /* for '+' */ + REF (form_unknown), /* for '-' */ + REF (form_unknown), /* for '' */ + REF (form_unknown), /* for '0' */ + REF (form_unknown), /* for '\'' */ + REF (form_unknown), /* for '*' */ + REF (form_unknown), /* for '1'...'9' */ + REF (form_unknown), /* for '.' */ + REF (form_unknown), /* for 'h' */ + REF (form_unknown), /* for 'l' */ + REF (form_unknown), /* for 'L', 'q' */ + REF (form_unknown), /* for 'z', 'Z' */ + REF (form_percent), /* for '%' */ + REF (form_integer), /* for 'd', 'i' */ + REF (form_unsigned), /* for 'u' */ + REF (form_octal), /* for 'o' */ + REF (form_hexa), /* for 'X', 'x' */ + REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ + REF (form_character), /* for 'c' */ + REF (form_string), /* for 's', 'S' */ + REF (form_pointer), /* for 'p' */ + REF (form_number), /* for 'n' */ + REF (form_strerror), /* for 'm' */ + REF (form_wcharacter), /* for 'C' */ + REF (form_floathex), /* for 'A', 'a' */ + REF (form_unknown), /* for 't' */ + REF (form_unknown), /* for 'j' */ + REF (form_unknown), /* for 'I' */ + REF (form_object) /* for '@' */ + }; + + int is_negative; + union + { + unsigned long long int longlong; + unsigned long int word; + } number; + int base; + unichar *string; /* Pointer to argument string. */ + + /* Fill variables from values in struct. */ + int alt = specs[nspecs_done].info.alt; + int space = specs[nspecs_done].info.space; + int left = specs[nspecs_done].info.left; + int showsign = specs[nspecs_done].info.showsign; + int group = specs[nspecs_done].info.group; + int is_long_double = specs[nspecs_done].info.is_long_double; + int is_short = specs[nspecs_done].info.is_short; + int is_char = specs[nspecs_done].info.is_char; + int is_long = specs[nspecs_done].info.is_long; + int width = specs[nspecs_done].info.width; + int prec = specs[nspecs_done].info.prec; + int use_outdigits = specs[nspecs_done].info.i18n; + char pad = specs[nspecs_done].info.pad; + unichar spec = specs[nspecs_done].info.spec; + + /* Fill in last information. */ + if (specs[nspecs_done].width_arg != -1) + { + /* Extract the field width from an argument. */ + specs[nspecs_done].info.width = + args_value[specs[nspecs_done].width_arg].pa_int; + + if (specs[nspecs_done].info.width < 0) + /* If the width value is negative left justification is + selected and the value is taken as being positive. */ + { + specs[nspecs_done].info.width *= -1; + left = specs[nspecs_done].info.left = 1; + } + width = specs[nspecs_done].info.width; + } + + if (specs[nspecs_done].prec_arg != -1) + { + /* Extract the precision from an argument. */ + specs[nspecs_done].info.prec = + args_value[specs[nspecs_done].prec_arg].pa_int; + + if (specs[nspecs_done].info.prec < 0) + /* If the precision is negative the precision is + omitted. */ + specs[nspecs_done].info.prec = -1; + + prec = specs[nspecs_done].info.prec; + } + + /* Maybe the buffer is too small. */ + if (MAX (prec, width) + 32 > sizeof (work_buffer) / sizeof (unichar)) + workend = ((unichar *) alloca ((MAX (prec, width) + 32) + * sizeof (unichar)) + + (MAX (prec, width) + 32)); + + /* Process format specifiers. */ + while (1) + { + do + { + const void *ptr; + ptr = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) + : step4_jumps[CHAR_CLASS (spec)]; + goto *ptr; + } + while (0); + + /* Start real work. We know about all flags and modifiers and + now process the wanted format specifier. */ + LABEL (form_percent): + /* Write a literal "%". */ + outchar ('%'); + break; + + LABEL (form_integer): + /* Signed decimal integer. */ + base = 10; + + if (is_longlong) + { + long long int signed_number; + + signed_number = args_value[specs[nspecs_done].data_arg].pa_long_long_int; + + is_negative = signed_number < 0; + number.longlong = is_negative ? (- signed_number) : signed_number; + + goto LABEL (longlong_number); + } + else + { + long int signed_number; + + if (is_long_num) + signed_number = args_value[specs[nspecs_done].data_arg].pa_long_int; + else + signed_number = args_value[specs[nspecs_done].data_arg].pa_int; + + is_negative = signed_number < 0; + number.word = is_negative ? (- signed_number) : signed_number; + + goto LABEL (number); + } + /* NOTREACHED */ + + LABEL (form_unsigned): + /* Unsigned decimal integer. */ + base = 10; + goto LABEL (unsigned_number); + /* NOTREACHED */ + + LABEL (form_octal): + /* Unsigned octal integer. */ + base = 8; + goto LABEL (unsigned_number); + /* NOTREACHED */ + + LABEL (form_hexa): + /* Unsigned hexadecimal integer. */ + base = 16; + + LABEL (unsigned_number): /* Unsigned number of base BASE. */ + + /* ISO specifies the `+' and ` ' flags only for signed + conversions. */ + is_negative = 0; + showsign = 0; + space = 0; + + if (is_longlong) + { + number.longlong = args_value[specs[nspecs_done].data_arg].pa_u_long_long_int; + + LABEL (longlong_number): + if (prec < 0) + /* Supply a default precision if none was given. */ + prec = 1; + else + /* We have to take care for the '0' flag. If a precision + is given it must be ignored. */ + pad = ' '; + + /* If the precision is 0 and the number is 0 nothing has to + be written for the number, except for the 'o' format in + alternate form. */ + if (prec == 0 && number.longlong == 0) + { + string = workend; + if (base == 8 && alt) + *--string = '0'; + } + else + { + /* Put the number in WORK. */ + string = _itowa (number.longlong, workend, base, + spec == 'X'); + if (group && grouping) + string = group_number (string, workend, grouping, + thousands_sep); + + if (use_outdigits && base == 10) + string = _i18n_number_rewrite (string, workend, [locale objectForKey: NSDecimalDigits]); + } + /* Simplify further test for num != 0. */ + number.word = number.longlong != 0; + } + else + { + if (is_long_num) + number.word = args_value[specs[nspecs_done].data_arg].pa_u_long_int; + else if (is_char) + number.word = (unsigned char) + args_value[specs[nspecs_done].data_arg].pa_char; + else if (!is_short) + number.word = args_value[specs[nspecs_done].data_arg].pa_u_int; + else + number.word = (unsigned short int) + args_value[specs[nspecs_done].data_arg].pa_u_short_int; + + LABEL (number): + if (prec < 0) + /* Supply a default precision if none was given. */ + prec = 1; + else + /* We have to take care for the '0' flag. If a precision + is given it must be ignored. */ + pad = ' '; + + /* If the precision is 0 and the number is 0 nothing has to + be written for the number, except for the 'o' format in + alternate form. */ + if (prec == 0 && number.word == 0) + { + string = workend; + if (base == 8 && alt) + *--string = '0'; + } + else + { + /* Put the number in WORK. */ + string = _itowa_word (number.word, workend, base, + spec == 'X'); + if (group && grouping) + string = group_number (string, workend, grouping, + thousands_sep); + + if (use_outdigits && base == 10) + string = _i18n_number_rewrite (string, workend, [locale objectForKey: NSDecimalDigits]); + } + } + + if (prec <= workend - string && number.word != 0 && alt && base == 8) + /* Add octal marker. */ + *--string = '0'; + + prec = MAX (0, prec - (workend - string)); + + if (!left) + { + width -= workend - string + prec; + + if (number.word != 0 && alt && base == 16) + /* Account for 0X hex marker. */ + width -= 2; + + if (is_negative || showsign || space) + --width; + + if (pad == ' ') + { + PAD (' '); + width = 0; + } + + if (is_negative) + outchar ('-'); + else if (showsign) + outchar ('+'); + else if (space) + outchar (' '); + + if (number.word != 0 && alt && base == 16) + { + outchar ('0'); + outchar (spec); + } + + width += prec; + PAD ('0'); + + outstring (string, workend - string); + + break; + } + else + { + if (is_negative) + { + outchar ('-'); + --width; + } + else if (showsign) + { + outchar ('+'); + --width; + } + else if (space) + { + outchar (' '); + --width; + } + + if (number.word != 0 && alt && base == 16) + { + outchar ('0'); + outchar (spec); + width -= 2; + } + + width -= workend - string + prec; + + if (prec > 0) + { + int temp = width; + width = prec; + PAD ('0');; + width = temp; + } + + outstring (string, workend - string); + + PAD (' '); + break; + } + + LABEL (form_float): + { + /* Floating-point number. This is handled by the native sprintf. */ + char buf1[32], *bp, buf2[specs[nspecs_done].info.width+specs[nspecs_done].info.prec+32]; + unichar work_buffer[MAX (specs[nspecs_done].info.width, specs[nspecs_done].info.spec) + 32]; + unichar *const workend + = &work_buffer[sizeof (work_buffer) / sizeof (unichar)]; + register unichar *w; + + bp = buf1; + + *bp++ = '%'; + + if (specs[nspecs_done].info.alt) + *bp++ = '#'; + if (specs[nspecs_done].info.group) + *bp++ = '\''; + if (specs[nspecs_done].info.showsign) + *bp++ = '+'; + else if (specs[nspecs_done].info.space) + *bp++ = ' '; + if (specs[nspecs_done].info.left) + *bp++ = '-'; + if (specs[nspecs_done].info.pad == '0') + *bp++ = '0'; + if (specs[nspecs_done].info.i18n) + *bp++ = 'I'; + + if (specs[nspecs_done].info.width != 0) + { + w = _itowa_word (specs[nspecs_done].info.width, workend, 10, 0); + while (w < workend) + *bp++ = *w++; + } + + if (specs[nspecs_done].info.prec != -1) + { + *bp++ = '.'; + w = _itowa_word (specs[nspecs_done].info.prec, workend, 10, 0); + while (w < workend) + *bp++ = *w++; + } + + if (specs[nspecs_done].info.spec != '\0') + *bp++ = specs[nspecs_done].info.spec; + + *bp++ = '\0'; + + if (specs[nspecs_done].info.is_long_double) + sprintf(buf2, buf1, args_value[specs[nspecs_done].data_arg].pa_long_double); + else + sprintf(buf2, buf1, args_value[specs[nspecs_done].data_arg].pa_double); + + bp = buf2; + while (*bp) outchar(*bp++); + } + break; + + LABEL (form_floathex): + { + /* Floating point number printed as hexadecimal number. */ + char buf1[32], *bp, buf2[specs[nspecs_done].info.width+specs[nspecs_done].info.prec+32]; + unichar work_buffer[MAX (specs[nspecs_done].info.width, specs[nspecs_done].info.spec) + 32]; + unichar *const workend + = &work_buffer[sizeof (work_buffer) / sizeof (unichar)]; + register unichar *w; + + bp = buf1; + + *bp++ = '%'; + + if (specs[nspecs_done].info.alt) + *bp++ = '#'; + if (specs[nspecs_done].info.group) + *bp++ = '\''; + if (specs[nspecs_done].info.showsign) + *bp++ = '+'; + else if (specs[nspecs_done].info.space) + *bp++ = ' '; + if (specs[nspecs_done].info.left) + *bp++ = '-'; + if (specs[nspecs_done].info.pad == '0') + *bp++ = '0'; + if (specs[nspecs_done].info.i18n) + *bp++ = 'I'; + + if (specs[nspecs_done].info.width != 0) + { + w = _itowa_word (specs[nspecs_done].info.width, workend, 10, 0); + while (w < workend) + *bp++ = *w++; + } + + if (specs[nspecs_done].info.prec != -1) + { + *bp++ = '.'; + w = _itowa_word (specs[nspecs_done].info.prec, workend, 10, 0); + while (w < workend) + *bp++ = *w++; + } + + if (specs[nspecs_done].info.spec != '\0') + *bp++ = specs[nspecs_done].info.spec; + + *bp++ = '\0'; + + if (specs[nspecs_done].info.is_long_double) + sprintf(buf2, buf1, args_value[specs[nspecs_done].data_arg].pa_long_double); + else + sprintf(buf2, buf1, args_value[specs[nspecs_done].data_arg].pa_double); + + bp = buf2; + while (*bp) outchar(*bp++); + } + break; + + LABEL (form_pointer): + /* Generic pointer. */ + { + const void *ptr; + ptr = args_value[specs[nspecs_done].data_arg].pa_pointer; + if (ptr != NULL) + { + /* If the pointer is not NULL, write it as a %#x spec. */ + base = 16; + number.word = (unsigned long int) ptr; + is_negative = 0; + alt = 1; + group = 0; + spec = 'x'; + goto LABEL (number); + } + else + { + unichar nil_name[] = {'(','n','i','l',')','\0'}; + /* Write "(nil)" for a nil pointer. */ + string = nil_name; + /* Make sure the full string "(nil)" is printed. */ + if (prec < 5) + prec = 5; + is_long = 0; /* This is no wide-char string. */ + goto LABEL (print_string); + } + } + /* NOTREACHED */ + + LABEL (form_number): + /* Answer the count of characters written. */ + if (is_longlong) + *(long long int *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + else if (is_long_num) + *(long int *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + else if (is_long_num) + *(long int *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + else if (is_char) + *(char *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + else if (!is_short) + *(int *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + else + *(short int *) args_value[specs[nspecs_done].data_arg].pa_pointer = done; + break; + + LABEL (form_strerror): + /* Print description of error ERRNO. */ + string = + (unichar *) __strerror_r (save_errno, (char *) work_buffer, + sizeof work_buffer); + is_long = 0; /* This is no wide-char string. */ + goto LABEL (print_string); + LABEL (form_character): + /* Character. */ + if (is_long) + goto LABEL (form_wcharacter); + --width; /* Account for the character itself. */ + if (!left) + PAD (' '); + outchar ( ((unsigned char) + args_value[specs[nspecs_done].data_arg].pa_char)); + if (left) + PAD (' '); + break; + + LABEL (form_wcharacter): + { + /* Wide character. */ + --width; + if (!left) + PAD (' '); + outchar (args_value[specs[nspecs_done].data_arg].pa_wchar); + if (left) + PAD (' '); + } + break; + + LABEL (form_string): + { + size_t len; + int string_malloced; + + /* The string argument could in fact be `char *' or `wchar_t *'. + But this should not make a difference here. */ + string = (unichar *) args_value[specs[nspecs_done].data_arg].pa_wstring; + + /* Entry point for printing other strings. */ + LABEL (print_string): + + string_malloced = 0; + if (string == NULL) + { + /* Write "(null)" if there's space. */ + if (prec == -1 + || prec >= (int) (sizeof (null) / sizeof (null[0])) - 1) + { + string = (unichar *) null; + len = (sizeof (null) / sizeof (null[0])) - 1; + } + else + { + string = (unichar *) {'\0'}; + len = 0; + } + } + else if (!is_long && spec != 'S') + { + /* This is complicated. We have to transform the multibyte + string into a unicode string. */ + NSString *str; + NSRange r; + + str = [NSString stringWithCString: (const char *)string]; + len = prec != -1 ? prec : [str length]; + + /* Allocate dynamically an array which definitely is long + enough for the wide character version. */ + if (len < 8192 + || ((string = (unichar *) NSZoneMalloc(s->z, len * sizeof (unichar))) + == NULL)) + string = (unichar *) alloca (len * sizeof (unichar)); + else + string_malloced = 1; + + r.location = 0; + r.length = len; + [str getCharacters: string range: r]; + } + else + { + /* This is complicated. We have to transform the wide + string into a unicode string. */ + int prc; + unichar *sp; + wchar_t *wsp; + len = 0; + prc = prec; + wsp = (wchar_t *)string; + while (prc-- && *wsp++) len++; + + wsp = (wchar_t *)string; + + /* Allocate dynamically an array which definitely is long + enough for the wide character version. */ + if (len < 8192 + || ((string = (unichar *) NSZoneMalloc(s->z, len * sizeof (unichar))) + == NULL)) + string = (unichar *) alloca (len * sizeof (unichar)); + else + string_malloced = 1; + + prc = len; + sp = string; + while (prc--) *sp = *wsp; + } + + if ((width -= len) < 0) + { + outstring (string, len); + break; + } + + if (!left) + PAD (' '); + outstring (string, len); + if (left) + PAD (' '); + if (string_malloced) + NSZoneFree(s->z, string); + } + break; + + LABEL (form_object): + { + size_t len; + int string_malloced; + id obj; + NSString *dsc; + + obj = args_value[specs[nspecs_done].data_arg].pa_object; + + if (!obj) dsc = @"(nil)"; + else if ([obj respondsToSelector: @selector(descriptionWithLocale:)]) dsc = [obj descriptionWithLocale: locale]; + else dsc = [obj description]; + + if (!dsc) dsc = @"(null)"; + + len = [dsc length]; + + string_malloced = 0; + { + /* This is complicated. We have to transform the + NSString into a unicode string. */ + NSRange r; + + len = prec != -1 ? prec : [dsc length]; + + /* Allocate dynamically an array which definitely is long + enough for the wide character version. */ + if (len < 8192 + || ((string = (unichar *) NSZoneMalloc(s->z, len * sizeof (unichar))) + == NULL)) + string = (unichar *) alloca (len * sizeof (unichar)); + else + string_malloced = 1; + + r.location = 0; + r.length = len; + [dsc getCharacters: string range: r]; + } + + if ((width -= len) < 0) + { + outstring (string, len); + break; + } + + if (!left) + PAD (' '); + outstring (string, len); + if (left) + PAD (' '); + if (string_malloced) + NSZoneFree(s->z, string); + } + break; + + LABEL (form_unknown): + { + int function_done; + unsigned int i; + const void **ptr; + + + ptr = alloca (specs[nspecs_done].ndata_args + * sizeof (const void *)); + + /* Fill in an array of pointers to the argument values. */ + for (i = 0; i < specs[nspecs_done].ndata_args; ++i) + ptr[i] = &args_value[specs[nspecs_done].data_arg + i]; + + /* Call the function. */ + function_done = printf_unknown(s, &specs[nspecs_done].info, ptr); + + /* If an error occurred we don't have information about # + of chars. */ + + done += function_done; + } + break; + } + + /* Write the following constant string. */ + outstring (specs[nspecs_done].end_of_fmt, + specs[nspecs_done].next_fmt + - specs[nspecs_done].end_of_fmt); + } + } + +all_done: + /* Unlock the stream. */ +} + +/* Handle an unknown format specifier. This prints out a canonicalized + representation of the format spec itself. */ +static int +printf_unknown (FormatBuf_t *s, const struct printf_info *info, + const void *const *args) + +{ + int done = 0; + unichar work_buffer[MAX (info->width, info->spec) + 32]; + unichar *const workend + = &work_buffer[sizeof (work_buffer) / sizeof (unichar)]; + register unichar *w; + + outchar ('%'); + + if (info->alt) + outchar ('#'); + if (info->group) + outchar ('\''); + if (info->showsign) + outchar ('+'); + else if (info->space) + outchar (' '); + if (info->left) + outchar ('-'); + if (info->pad == '0') + outchar ('0'); + if (info->i18n) + outchar ('I'); + + if (info->width != 0) + { + w = _itowa_word (info->width, workend, 10, 0); + while (w < workend) + outchar (*w++); + } + + if (info->prec != -1) + { + outchar ('.'); + w = _itowa_word (info->prec, workend, 10, 0); + while (w < workend) + outchar (*w++); + } + + if (info->spec != '\0') + outchar (info->spec); + + return done; +} + +/* Group the digits according to the grouping rules of the current locale. + The interpretation of GROUPING is as in `struct lconv' from . */ +static unichar * +group_number (unichar *w, unichar *rear_ptr, const char *grouping, + NSString *thousands_sep + ) +{ + int len; + unichar *src, *s; + + /* We treat all negative values like CHAR_MAX. */ + + if (*grouping == CHAR_MAX || *grouping <= 0) + /* No grouping should be done. */ + return w; + + len = *grouping; + + /* Copy existing string so that nothing gets overwritten. */ + src = (unichar *) alloca ((rear_ptr - w) * sizeof (unichar)); + s = (unichar *) memcpy (src, w, + (rear_ptr - w) * sizeof (unichar)); + w = rear_ptr; + + /* Process all characters in the string. */ + while (s > src) + { + *--w = *--s; + + if (--len == 0 && s > src) + { + /* A new group begins. */ + *--w = [thousands_sep characterAtIndex: 0]; + + len = *grouping++; + if (*grouping == '\0') + /* The previous grouping repeats ad infinitum. */ + --grouping; + else if (*grouping == CHAR_MAX +#if CHAR_MIN < 0 + || *grouping < 0 +#endif + ) + { + /* No further grouping to be done. + Copy the rest of the number. */ + do + *--w = *--s; + while (s > src); + break; + } + } + } + return w; +} diff --git a/Source/GSString.m b/Source/GSString.m index 332b47ed5..80d600fca 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -45,6 +45,7 @@ #include #include #include +#include #include #include /* memcpy(), strlen(), strcmp() are gcc builtin's */ @@ -2133,6 +2134,51 @@ transmute(ivars self, NSString *aString) setup(); } +- (void) appendFormat: (NSString*)format, ... +{ + va_list ap; + + va_start(ap, format); + /* + * If this is a unicode string, we can write the formatted data directly + * into its buffer. + */ + if (_flags.wide == 1) + { + FormatBuf_t f; + unichar *fmt; + size_t len; + + len = [format length]; + fmt = objc_malloc((len+1)*sizeof(unichar)); + [format getCharacters: fmt]; + fmt[len] = '\0'; + f.z = _zone; + f.buf = _contents.u; + f.len = _count; + f.size = _capacity; + GSFormat(&f, fmt, ap, nil); + _contents.u = f.buf; + _count = f.len; + _capacity = f.size; + _flags.hash = 0; + objc_free(fmt); + } + else + { + NSRange aRange; + NSString *t; + + t = (NSString*)NSAllocateObject(NSStringClass, 0, NSDefaultMallocZone()); + t = [t initWithFormat: format arguments: ap]; + aRange.location = _count; + aRange.length = 0; + [self replaceCharactersInRange: aRange withString: t]; + RELEASE(t); + } + va_end(ap); +} + - (BOOL) boolValue { if (_flags.wide == 1) diff --git a/Source/NSString.m b/Source/NSString.m index 84bb161ec..e306df1eb 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -61,6 +61,7 @@ #include #include #include +#include #include #include // for strstr() #include @@ -665,6 +666,31 @@ handle_printf_atsign (FILE *stream, return [self initWithFormat: format locale: nil arguments: arg_list]; } +- (id) initWithFormat: (NSString*)format + locale: (NSDictionary*)locale + arguments: (va_list)arg_list +{ + FormatBuf_t f; + unichar *fmt; + size_t len; + + len = [format length]; + fmt = objc_malloc((len+1)*sizeof(unichar)); + [format getCharacters: fmt]; + fmt[len] = '\0'; + f.z = NSDefaultMallocZone(); + f.buf = NSZoneMalloc(f.z, 100*sizeof(unichar)); + f.len = 0; + f.size = 100; + GSFormat(&f, fmt, arg_list, locale); + objc_free(fmt); + // don't use noCopy because f.size > f.len! + self = [self initWithCharacters: f.buf length: f.len]; + NSZoneFree(f.z, f.buf); + return self; +} + +#if 0 /* xxx Change this when we have non-CString classes */ - (id) initWithFormat: (NSString*)format locale: (NSDictionary*)locale @@ -958,6 +984,7 @@ handle_printf_atsign (FILE *stream, return self; #endif } +#endif - (id) initWithData: (NSData*)data encoding: (NSStringEncoding)encoding @@ -3189,10 +3216,11 @@ handle_printf_atsign (FILE *stream, /* Inefficient. */ - (void) appendFormat: (NSString*)format, ... { - va_list ap; - id tmp; + va_list ap; + id tmp; + va_start(ap, format); - tmp = [[NSString allocWithZone: NSDefaultMallocZone()] + tmp = [[NSStringClass allocWithZone: NSDefaultMallocZone()] initWithFormat: format arguments: ap]; va_end(ap); [self appendString: tmp]; diff --git a/configure b/configure index 47bd2b677..fab77991a 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 +# Generated automatically using autoconf version 2.13.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -355,7 +355,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" + echo "configure generated by autoconf version 2.13.1" exit 0 ;; -with-* | --with-*) @@ -515,7 +515,7 @@ done if test -r "$cache_file"; then echo "loading cache $cache_file" - . $cache_file + test -f "$cache_file" && . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -591,9 +591,130 @@ done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:601: checking host system type" >&5 +if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_host_alias=$host + case "$ac_cv_host_alias" in + NONE) + case $nonopt in + NONE) + if ac_cv_host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) ac_cv_host_alias=$nonopt ;; + esac ;; + esac + + ac_cv_host=`$ac_config_sub $ac_cv_host_alias` + ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_host" 1>&6 + +host=$ac_cv_host +host_alias=$ac_cv_host_alias +host_cpu=$ac_cv_host_cpu +host_vendor=$ac_cv_host_vendor +host_os=$ac_cv_host_os + + + + + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:642: checking target system type" >&5 +if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_target_alias=$target + case "$ac_cv_target_alias" in + NONE) + case $nonopt in + NONE) + ac_cv_target_alias=$host_alias ;; + + *) ac_cv_target_alias=$nonopt ;; + esac ;; + esac + + ac_cv_target=`$ac_config_sub $ac_cv_target_alias` + ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_target" 1>&6 + +target=$ac_cv_target +target_alias=$ac_cv_target_alias +target_cpu=$ac_cv_target_cpu +target_vendor=$ac_cv_target_vendor +target_os=$ac_cv_target_os + + + + + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:682: checking build system type" >&5 +if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then + +# Make sure we can run config.sub. + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_build_alias=$build + case "$ac_cv_build_alias" in + NONE) + case $nonopt in + NONE) + ac_cv_build_alias=$host_alias ;; + + *) ac_cv_build_alias=$nonopt ;; + esac ;; + esac + + ac_cv_build=`$ac_config_sub $ac_cv_build_alias` + ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 +fi + +echo "$ac_t""$ac_cv_build" 1>&6 + +build=$ac_cv_build +build_alias=$ac_cv_build_alias +build_cpu=$ac_cv_build_cpu +build_vendor=$ac_cv_build_vendor +build_os=$ac_cv_build_os + + + # Do some error checking and defaulting for the host and target type. @@ -616,69 +737,6 @@ NONE---*---* | *---NONE---* | *---*---NONE) ;; *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; esac - -# Make sure we can run config.sub. -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:627: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - 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=`${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:648: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -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:666: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -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/'` -echo "$ac_t""$build" 1>&6 - test "$host_alias" != "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && @@ -691,8 +749,8 @@ test "$host_alias" != "$target_alias" && # 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:695: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:753: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -721,8 +779,8 @@ 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:725: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:783: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -768,12 +826,12 @@ fi if test -z "$CC"; then case "`uname -s`" in - *win32* | *WIN32*) + *win32* | *WIN32* | *CYGWIN*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:776: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:834: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -803,8 +861,8 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:808: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:866: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -815,12 +873,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 819 "configure" +#line 877 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -845,14 +903,14 @@ echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 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:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:908: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $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:855: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then +echo "configure:913: checking whether we are using GNU C" >&5 +if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:922: \"$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 @@ -879,8 +937,8 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:883: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then +echo "configure:941: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c @@ -911,13 +969,13 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:915: checking how to run the C preprocessor" >&5 +echo "configure:973: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then +if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get @@ -926,13 +984,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:936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:994: \"$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 : @@ -943,13 +1001,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:953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1011: \"$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 : @@ -960,13 +1018,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1028: \"$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 : @@ -994,8 +1052,8 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "whoami", so it can be a program name with args. set dummy whoami; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:998: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then +echo "configure:1056: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_WHOAMI+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$WHOAMI" in @@ -1050,14 +1108,14 @@ esac # include implementations of List, HashTable etc. #-------------------------------------------------------------------- echo $ac_n "checking whether we are using NeXT's compiler""... $ac_c" 1>&6 -echo "configure:1054: checking whether we are using NeXT's compiler" >&5 +echo "configure:1112: checking whether we are using NeXT's compiler" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1119: \"$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* @@ -1077,16 +1135,16 @@ if test $NeXTCC = 0; then # Find out if nested functions work on this machine #---------------------------------------------------------------- echo $ac_n "checking whether nested functions work""... $ac_c" 1>&6 -echo "configure:1081: checking whether nested functions work" >&5 +echo "configure:1139: checking whether nested functions work" >&5 if test "$cross_compiling" = yes; then gcc_nested=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_nested=1 else @@ -1118,16 +1176,16 @@ fi # Find out if we're on a NEXTSTEP machine #---------------------------------------------------------------- echo $ac_n "checking whether we are running under NEXTSTEP""... $ac_c" 1>&6 -echo "configure:1122: checking whether we are running under NEXTSTEP" >&5 +echo "configure:1180: checking whether we are running under NEXTSTEP" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1189: \"$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* @@ -1155,16 +1213,16 @@ rm -f conftest* saved_ac_ext=$ac_ext ac_ext=m echo $ac_n "checking whether we are using GNU Objective C runtime""... $ac_c" 1>&6 -echo "configure:1159: checking whether we are using GNU Objective C runtime" >&5 +echo "configure:1217: checking whether we are using GNU Objective C runtime" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* NeXT_runtime=1 else @@ -1210,16 +1268,16 @@ else # Find out if we have NEXTSTEP 3.2 or lower #---------------------------------------------------------------- echo "checking NEXTSTEP version" 1>&6 -echo "configure:1214: checking NEXTSTEP version" >&5 +echo "configure:1272: checking NEXTSTEP version" >&5 cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1281: \"$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* @@ -1290,17 +1348,17 @@ for ac_hdr in objc/objc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1294: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:1352: checking for $ac_hdr" >&5 +if eval "test \"\${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:1304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1362: \"$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* @@ -1338,7 +1396,7 @@ fi #-------------------------------------------------------------------- # echo $ac_n "checking for objc threading flags""... $ac_c" 1>&6 -echo "configure:1342: checking for objc threading flags" >&5 +echo "configure:1400: checking for objc threading flags" >&5 # # Get them from gnustep-make which contains the real code to get them # @@ -1350,14 +1408,14 @@ echo "$ac_t""$objc_threaded" 1>&6 # Byte order information needed for foundation headers. #-------------------------------------------------------------------- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1354: checking whether byte ordering is bigendian" >&5 -if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then +echo "configure:1412: checking whether byte ordering is bigendian" >&5 +if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1368,11 +1426,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1383,7 +1441,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1403,7 +1461,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1450,15 +1508,15 @@ fi # Type size information needed for foundation headers. #-------------------------------------------------------------------- echo $ac_n "checking size of void*""... $ac_c" 1>&6 -echo "configure:1454: checking size of void*" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then +echo "configure:1512: checking size of void*" >&5 +if eval "test \"\${ac_cv_sizeof_voidp+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1469,7 +1527,7 @@ main() exit(0); } EOF -if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_voidp=`cat conftestval` else @@ -1495,15 +1553,15 @@ GS_UINT8="unsigned char" echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1499: checking size of short" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then +echo "configure:1557: checking size of short" >&5 +if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1514,7 +1572,7 @@ main() exit(0); } EOF -if { (eval echo configure:1518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -1536,15 +1594,15 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1540: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then +echo "configure:1598: checking size of int" >&5 +if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1555,7 +1613,7 @@ main() exit(0); } EOF -if { (eval echo configure:1559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1577,15 +1635,15 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1581: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then +echo "configure:1639: checking size of long" >&5 +if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1596,7 +1654,7 @@ main() exit(0); } EOF -if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1618,15 +1676,15 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1622: checking size of long long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then +echo "configure:1680: checking size of long long" >&5 +if eval "test \"\${ac_cv_sizeof_long_long+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1637,7 +1695,7 @@ main() exit(0); } EOF -if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -1659,15 +1717,15 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1663: checking size of float" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then +echo "configure:1721: checking size of float" >&5 +if eval "test \"\${ac_cv_sizeof_float+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1678,7 +1736,7 @@ main() exit(0); } EOF -if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -1700,15 +1758,15 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1704: checking size of double" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then +echo "configure:1762: checking size of double" >&5 +if eval "test \"\${ac_cv_sizeof_double+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1719,7 +1777,7 @@ main() exit(0); } EOF -if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -1923,8 +1981,8 @@ fi # Defines CON_AUTOLOAD (whether constructor functions are autoloaded) #-------------------------------------------------------------------- echo $ac_n "checking loading of constructor functions""... $ac_c" 1>&6 -echo "configure:1927: checking loading of constructor functions" >&5 -if eval "test \"`echo '$''{'objc_cv_con_autoload'+set}'`\" = set"; then +echo "configure:1985: checking loading of constructor functions" >&5 +if eval "test \"\${objc_cv_con_autoload+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.constructor.c <&6 -echo "configure:1968: checking for dlfcn.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2026: checking for dlfcn.h" >&5 +if eval "test \"\${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:1978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2036: \"$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* @@ -1998,17 +2056,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "dl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dl.h""... $ac_c" 1>&6 -echo "configure:2002: checking for dl.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2060: checking for dl.h" >&5 +if eval "test \"\${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:2012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2070: \"$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* @@ -2033,17 +2091,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "windows.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for windows.h""... $ac_c" 1>&6 -echo "configure:2037: checking for windows.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2095: checking for windows.h" >&5 +if eval "test \"\${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:2047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2105: \"$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* @@ -2068,17 +2126,17 @@ fi if test $DYNAMIC_LINKER = null; then ac_safe=`echo "dld/defs.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld/defs.h""... $ac_c" 1>&6 -echo "configure:2072: checking for dld/defs.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2130: checking for dld/defs.h" >&5 +if eval "test \"\${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:2082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2140: \"$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* @@ -2103,14 +2161,14 @@ fi if test $DYNAMIC_LINKER = simple; then cat > conftest.$ac_ext < int main() { dladdr(0,0); ; return 0; } EOF -if { (eval echo configure:2114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_DLADDR 1 @@ -2140,19 +2198,19 @@ if test x"$objc_threaded" != x""; then fi LIBS="$LIBS $extra_LIBS" echo $ac_n "checking if +load method is executed before main""... $ac_c" 1>&6 -echo "configure:2144: checking if +load method is executed before main" >&5 -if eval "test \"`echo '$''{'objc_load_method_worked'+set}'`\" = set"; then +echo "configure:2202: checking if +load method is executed before main" >&5 +if eval "test \"\${objc_load_method_worked+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then objc_load_method_worked=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_load_method_worked=yes else @@ -2187,12 +2245,12 @@ CPPFLAGS="$saved_CPPFLAGS" for ac_func in objc_condition_timedwait do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2191: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:2249: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2278: \"$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 @@ -2241,7 +2300,7 @@ done cat > conftest.$ac_ext < EOF @@ -2262,12 +2321,12 @@ LIBS="$saved_LIBS" # Generic settings needed by NSZone.m #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2266: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then +echo "configure:2325: checking for ANSI C header files" >&5 +if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2275,7 +2334,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2338: \"$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* @@ -2292,7 +2351,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2310,7 +2369,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2331,7 +2390,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2342,7 +2401,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2366,12 +2425,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2370: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then +echo "configure:2429: checking for size_t" >&5 +if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2382,38 +2441,40 @@ EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* - ac_cv_type_size_t=yes + eval "ac_cv_type_size_t=yes" else rm -rf conftest* - ac_cv_type_size_t=no + eval "ac_cv_type_size_t=no" fi rm -f conftest* fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF +if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 -echo "configure:2403: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then +echo "configure:2464: checking for inline" >&5 +if eval "test \"\${ac_cv_c_inline+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2443,12 +2504,12 @@ esac # Following header checks needed for bzero in Storage.m and other places #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2447: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then +echo "configure:2508: checking for ANSI C header files" >&5 +if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2456,7 +2517,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2521: \"$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* @@ -2473,7 +2534,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2491,7 +2552,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2512,7 +2573,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2523,7 +2584,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2550,17 +2611,17 @@ for ac_hdr in string.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2554: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2615: checking for $ac_hdr" >&5 +if eval "test \"\${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:2564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2625: \"$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* @@ -2594,17 +2655,17 @@ for ac_hdr in values.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2598: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2659: checking for $ac_hdr" >&5 +if eval "test \"\${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:2608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2669: \"$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* @@ -2638,17 +2699,17 @@ for ac_hdr in sys/stat.h sys/vfs.h sys/statfs.h sys/statvfs.h pwd.h grp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2642: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2703: checking for $ac_hdr" >&5 +if eval "test \"\${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:2652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2713: \"$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* @@ -2678,17 +2739,17 @@ for ac_hdr in sys/mount.h sys/types.h windows.h locale.h langinfo.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2682: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2743: checking for $ac_hdr" >&5 +if eval "test \"\${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:2692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2753: \"$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* @@ -2719,12 +2780,12 @@ LIBS="$LIBS -lm" for ac_func in statvfs symlink readlink geteuid rint do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2723: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:2784: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2813: \"$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 @@ -2781,17 +2843,17 @@ for ac_hdr in sys/time.h sys/rusage.h ucbinclude/sys/resource.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2785: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2847: checking for $ac_hdr" >&5 +if eval "test \"\${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:2795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2857: \"$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* @@ -2825,17 +2887,17 @@ for ac_hdr in sys/socket.h netinet/in.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2829: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2891: checking for $ac_hdr" >&5 +if eval "test \"\${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:2839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2901: \"$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* @@ -2869,17 +2931,17 @@ for ac_hdr in syslog.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2873: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2935: checking for $ac_hdr" >&5 +if eval "test \"\${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:2883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2945: \"$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* @@ -2908,12 +2970,12 @@ done for ac_func in syslog do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2912: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:2974: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3003: \"$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 @@ -2967,12 +3030,12 @@ done for ac_func in vsprintf vasprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2971: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3034: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3063: \"$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 @@ -3024,11 +3088,11 @@ if test $ac_cv_func_vsprintf = yes ; then VSPRINTF_RETURNS_LENGTH=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then VSPRINTF_RETURNS_LENGTH=1 else @@ -3050,11 +3114,11 @@ if test $ac_cv_func_vasprintf = yes ; then VASPRINTF_RETURNS_LENGTH=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then VASPRINTF_RETURNS_LENGTH=1 else @@ -3078,12 +3142,12 @@ fi for ac_func in getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3082: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3146: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3175: \"$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 @@ -3135,12 +3200,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3139: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then +echo "configure:3204: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -3148,7 +3213,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3173,15 +3238,15 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:3177: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:3242: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3214,15 +3279,15 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3218: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:3283: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3263,17 +3328,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3267: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:3332: checking for $ac_hdr" >&5 +if eval "test \"\${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:3277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3342: \"$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* @@ -3306,12 +3371,12 @@ done for ac_func in valloc do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3310: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3375: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3404: \"$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 @@ -3365,12 +3431,12 @@ done for ac_func in times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3369: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3435: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3464: \"$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 @@ -3424,12 +3491,12 @@ done for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3428: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3495: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3524: \"$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 @@ -3479,12 +3547,12 @@ done for ac_func in shmctl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3483: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3551: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3580: \"$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 @@ -3534,12 +3603,12 @@ done for ac_func in mmap do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3538: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3607: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3636: \"$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 @@ -3593,12 +3663,12 @@ done for ac_func in inet_aton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3597: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3667: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3696: \"$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 @@ -3652,12 +3723,12 @@ done for ac_func in killpg setpgrp setpgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3656: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3727: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3756: \"$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 @@ -3705,15 +3777,15 @@ fi done echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3709: checking whether setpgrp takes no argument" >&5 -if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then +echo "configure:3781: checking whether setpgrp takes no argument" >&5 +if eval "test \"\${ac_cv_func_setpgrp_void+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -3763,12 +3835,12 @@ fi for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3767: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3839: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3868: \"$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 @@ -3822,12 +3895,12 @@ done for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3826: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:3899: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3928: \"$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 @@ -3875,16 +3949,50 @@ fi done +#-------------------------------------------------------------------- +# This type needed by GSFormat +#-------------------------------------------------------------------- +echo $ac_n "checking whether stdint.h defines uintmax_t""... $ac_c" 1>&6 +echo "configure:3957: checking whether stdint.h defines uintmax_t" >&5 +cat > conftest.$ac_ext < + f() { int i = sizeof(uintmax_t); } +int main() { +uintmax_t=1 +; return 0; } +EOF +if { (eval echo configure:3967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + uintmax_t=0 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + uintmax_t=1 +fi +rm -f conftest* +if test $uintmax_t = 1; then + echo "$ac_t""found" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_UINTMAX_T 1 +EOF + +else + echo "$ac_t""not found" 1>&6 +fi + #-------------------------------------------------------------------- # This function needed by NSString for handling of %@ printf directive. #-------------------------------------------------------------------- echo $ac_n "checking for register_printf_function""... $ac_c" 1>&6 -echo "configure:3883: checking for register_printf_function" >&5 -if eval "test \"`echo '$''{'ac_cv_func_register_printf_function'+set}'`\" = set"; then +echo "configure:3991: checking for register_printf_function" >&5 +if eval "test \"\${ac_cv_func_register_printf_function+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_register_printf_function=yes" else @@ -3932,11 +4041,11 @@ if test $register_printf = 1; then working_register_printf=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then working_register_printf=1 else @@ -3962,12 +4071,12 @@ fi for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3966: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:4075: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4104: \"$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 @@ -4020,15 +4130,15 @@ done # Used in critical cases by NSProcessInfo.m #-------------------------------------------------------------------- echo $ac_n "checking program_invocation_name in C Library""... $ac_c" 1>&6 -echo "configure:4024: checking program_invocation_name in C Library" >&5 -if eval "test \"`echo '$''{'program_invocation_name_worked'+set}'`\" = set"; then +echo "configure:4134: checking program_invocation_name in C Library" >&5 +if eval "test \"\${program_invocation_name_worked+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then program_invocation_name_worked=no else cat > conftest.$ac_ext < @@ -4040,7 +4150,7 @@ main (int argc, char *argv[]) } EOF -if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then program_invocation_name_worked=yes else @@ -4069,7 +4179,7 @@ fi # Needed by NSProcessInfo.m #-------------------------------------------------------------------- echo $ac_n "checking kernel support for /proc filesystem""... $ac_c" 1>&6 -echo "configure:4073: checking kernel support for /proc filesystem" >&5 +echo "configure:4183: checking kernel support for /proc filesystem" >&5 if (grep proc /etc/fstab >/dev/null 2>/dev/null); then sys_proc_fs=yes; cat >> confdefs.h <<\EOF @@ -4092,7 +4202,7 @@ fi sys_proc_fs_exe=no; if test $sys_proc_fs = yes; then echo $ac_n "checking link to executable in /proc""... $ac_c" 1>&6 -echo "configure:4096: checking link to executable in /proc" >&5 +echo "configure:4206: checking link to executable in /proc" >&5 if test -L /proc/self/exe; then sys_proc_fs_exe=yes; echo "$ac_t""yes" 1>&6 @@ -4105,16 +4215,16 @@ fi # Check if short and int values need to be word aligned #-------------------------------------------------------------------- echo $ac_n "checking short/int needs to be word aligned""... $ac_c" 1>&6 -echo "configure:4109: checking short/int needs to be word aligned" >&5 +echo "configure:4219: checking short/int needs to be word aligned" >&5 if test "$cross_compiling" = yes; then NEED_WORD_ALIGNMENT=1 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then NEED_WORD_ALIGNMENT=0 else @@ -4142,7 +4252,7 @@ fi # doesn't work. Allow NSProcessInfo initialization method also. #-------------------------------------------------------------------- echo $ac_n "checking "use of pass-through arguments"""... $ac_c" 1>&6 -echo "configure:4146: checking "use of pass-through arguments"" >&5 +echo "configure:4256: checking "use of pass-through arguments"" >&5 # Check whether --enable-pass-arguments or --disable-pass-arguments was given. if test "${enable_pass_arguments+set}" = set; then enableval="$enable_pass_arguments" @@ -4164,7 +4274,7 @@ fi echo "$ac_t""$enable_pass_arguments" 1>&6 echo $ac_n "checking "use of fake-main definition"""... $ac_c" 1>&6 -echo "configure:4168: checking "use of fake-main definition"" >&5 +echo "configure:4278: checking "use of fake-main definition"" >&5 # Check whether --enable-fake-main or --disable-fake-main was given. if test "${enable_fake_main+set}" = set; then enableval="$enable_fake_main" @@ -4230,17 +4340,17 @@ fi ac_safe=`echo "ffi.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ffi.h""... $ac_c" 1>&6 -echo "configure:4234: checking for ffi.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:4344: checking for ffi.h" >&5 +if eval "test \"\${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:4244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4354: \"$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* @@ -4264,9 +4374,9 @@ fi echo $ac_n "checking "for forwarding callback in runtime"""... $ac_c" 1>&6 -echo "configure:4268: checking "for forwarding callback in runtime"" >&5 +echo "configure:4378: checking "for forwarding callback in runtime"" >&5 cat > conftest.$ac_ext < EOF @@ -4284,17 +4394,17 @@ for ac_hdr in callback.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4288: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:4398: checking for $ac_hdr" >&5 +if eval "test \"\${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:4298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4408: \"$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* @@ -4323,7 +4433,7 @@ done echo $ac_n "checking "FFI library usage"""... $ac_c" 1>&6 -echo "configure:4327: checking "FFI library usage"" >&5 +echo "configure:4437: checking "FFI library usage"" >&5 WITH_FFI=none if test $enable_libffi = yes; then cat >> confdefs.h <<\EOF @@ -4388,8 +4498,8 @@ fi # Extract the first word of "xml-config", so it can be a program name with args. set dummy xml-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4392: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XML_CONFIG'+set}'`\" = set"; then +echo "configure:4502: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_path_XML_CONFIG+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$XML_CONFIG" in @@ -4423,7 +4533,7 @@ fi min_xml_version=2.2.3 echo $ac_n "checking for libxml - version >= $min_xml_version""... $ac_c" 1>&6 -echo "configure:4427: checking for libxml - version >= $min_xml_version" >&5 +echo "configure:4537: checking for libxml - version >= $min_xml_version" >&5 no_xml="" if test "$XML_CONFIG" = "no" ; then no_xml=yes @@ -4446,7 +4556,7 @@ echo "configure:4427: checking for libxml - version >= $min_xml_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -4521,7 +4631,7 @@ main() } EOF -if { (eval echo configure:4525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4619,17 +4729,17 @@ for ac_hdr in openssl/ssl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4623: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:4733: checking for $ac_hdr" >&5 +if eval "test \"\${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:4633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4743: \"$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* @@ -4661,15 +4771,15 @@ if test $ac_cv_header_openssl_ssl_h = no; then echo "configure: warning: Could not find openssl headers" 1>&2 else echo $ac_n "checking for CRYPTO_malloc in -lcrypto""... $ac_c" 1>&6 -echo "configure:4665: checking for CRYPTO_malloc in -lcrypto" >&5 -ac_lib_var=`echo crypto'_'CRYPTO_malloc | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:4775: checking for CRYPTO_malloc in -lcrypto" >&5 +ac_lib_var=`echo crypto'_'CRYPTO_malloc | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4705,15 +4815,15 @@ fi base_libs="$LIBS" LIBS="$LIBS -lcrypto" echo $ac_n "checking for ssl2_clear in -lssl""... $ac_c" 1>&6 -echo "configure:4709: checking for ssl2_clear in -lssl" >&5 -ac_lib_var=`echo ssl'_'ssl2_clear | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:4819: checking for ssl2_clear in -lssl" >&5 +ac_lib_var=`echo ssl'_'ssl2_clear | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4798,17 +4908,17 @@ for ac_hdr in gmp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4802: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:4912: checking for $ac_hdr" >&5 +if eval "test \"\${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:4812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4922: \"$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* @@ -4840,15 +4950,15 @@ if test $ac_cv_header_gmp_h = no; then echo "configure: warning: Could not find gmp headers" 1>&2 else echo $ac_n "checking for mpf_abs in -lgmp""... $ac_c" 1>&6 -echo "configure:4844: checking for mpf_abs in -lgmp" >&5 -ac_lib_var=`echo gmp'_'mpf_abs | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:4954: checking for mpf_abs in -lgmp" >&5 +ac_lib_var=`echo gmp'_'mpf_abs | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4882,15 +4992,15 @@ fi if test "$gmp_ok" = no; then echo $ac_n "checking for __gmpf_abs in -lgmp""... $ac_c" 1>&6 -echo "configure:4886: checking for __gmpf_abs in -lgmp" >&5 -ac_lib_var=`echo gmp'_'__gmpf_abs | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:4996: checking for __gmpf_abs in -lgmp" >&5 +ac_lib_var=`echo gmp'_'__gmpf_abs | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4948,12 +5058,12 @@ fi for ac_func in iconv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4952: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:5062: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5091: \"$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 @@ -5017,22 +5128,22 @@ fi fi echo $ac_n "checking for main in -liconv""... $ac_c" 1>&6 -echo "configure:5021: checking for main in -liconv" >&5 -ac_lib_var=`echo iconv'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo "configure:5132: checking for main in -liconv" >&5 +ac_lib_var=`echo iconv'_'main | sed 'y%./+-:%__p__%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5182,7 +5293,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.13" + echo "$CONFIG_STATUS generated by autoconf version 2.13.1" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -5505,7 +5616,7 @@ exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 if test "$no_recursion" != yes; then @@ -5569,7 +5680,7 @@ if test "$no_recursion" != yes; then # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure; then - ac_sub_configure=$ac_sub_srcdir/configure + ac_sub_configure="$SHELL $ac_sub_srcdir/configure" elif test -f $ac_sub_srcdir/configure.in; then ac_sub_configure=$ac_configure else @@ -5587,9 +5698,9 @@ if test "$no_recursion" != yes; then ac_sub_cache_file="$ac_dots$cache_file" ;; esac - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + echo "running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + if eval $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir then : else { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } diff --git a/configure.in b/configure.in index b39b04529..48f85ca96 100644 --- a/configure.in +++ b/configure.in @@ -588,6 +588,21 @@ AC_CHECK_FUNCS(usleep) #-------------------------------------------------------------------- AC_CHECK_FUNCS(strerror) +#-------------------------------------------------------------------- +# This type needed by GSFormat +#-------------------------------------------------------------------- +AC_MSG_CHECKING([whether stdint.h defines uintmax_t]) +AC_TRY_COMPILE([#include + f() { int i = sizeof(uintmax_t); }], + uintmax_t=1, uintmax_t=0, + uintmax_t=1) +if test $uintmax_t = 1; then + AC_MSG_RESULT([found]) + AC_DEFINE(HAVE_UINTMAX_T) +else + AC_MSG_RESULT([not found]) +fi + #-------------------------------------------------------------------- # This function needed by NSString for handling of %@ printf directive. #--------------------------------------------------------------------