[llvm-commits] [llvm-gcc-4.2] r43913 [77/80] - in /llvm-gcc-4.2/trunk: boehm-gc/ boehm-gc/Mac_files/ boehm-gc/cord/ boehm-gc/doc/ boehm-gc/include/ boehm-gc/include/private/ boehm-gc/tests/ libffi/ libffi/include/ libffi/src/ libffi/src/alpha/ libffi/src/arm/ libffi/src/cris/ libffi/src/frv/ libffi/src/ia64/ libffi/src/m32r/ libffi/src/m68k/ libffi/src/mips/ libffi/src/pa/ libffi/src/powerpc/ libffi/src/s390/ libffi/src/sh/ libffi/src/sh64/ libffi/src/sparc/ libffi/src/x86/ libffi/testsuite/ libffi/testsuite/config/ li...
Bill Wendling
isanbard at gmail.com
Thu Nov 8 14:57:11 PST 2007
Added: llvm-gcc-4.2/trunk/libobjc/archive.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/archive.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/archive.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/archive.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,1668 @@
+ /* GNU Objective C Runtime archiving
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "tconfig.h"
+#include "objc/runtime.h"
+#include "objc/typedstream.h"
+#include "objc/encoding.h"
+#include <stdlib.h>
+
+extern int fflush (FILE *);
+
+#define ROUND(V, A) \
+ ({ typeof (V) __v = (V); typeof (A) __a = (A); \
+ __a * ((__v + __a - 1)/__a); })
+
+#define PTR2LONG(P) (((char *) (P))-(char *) 0)
+#define LONG2PTR(L) (((char *) 0) + (L))
+
+/* Declare some functions... */
+
+static int
+objc_read_class (struct objc_typed_stream *stream, Class *class);
+
+int objc_sizeof_type (const char *type);
+
+static int
+objc_write_use_common (struct objc_typed_stream *stream, unsigned long key);
+
+static int
+objc_write_register_common (struct objc_typed_stream *stream,
+ unsigned long key);
+
+static int
+objc_write_class (struct objc_typed_stream *stream,
+ struct objc_class *class);
+
+const char *objc_skip_type (const char *type);
+
+static void __objc_finish_write_root_object (struct objc_typed_stream *);
+static void __objc_finish_read_root_object (struct objc_typed_stream *);
+
+static inline int
+__objc_code_unsigned_char (unsigned char *buf, unsigned char val)
+{
+ if ((val&_B_VALUE) == val)
+ {
+ buf[0] = val|_B_SINT;
+ return 1;
+ }
+ else
+ {
+ buf[0] = _B_NINT|0x01;
+ buf[1] = val;
+ return 2;
+ }
+}
+
+int
+objc_write_unsigned_char (struct objc_typed_stream *stream,
+ unsigned char value)
+{
+ unsigned char buf[sizeof (unsigned char) + 1];
+ int len = __objc_code_unsigned_char (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_char (unsigned char *buf, signed char val)
+{
+ if (val >= 0)
+ return __objc_code_unsigned_char (buf, val);
+ else
+ {
+ buf[0] = _B_NINT|_B_SIGN|0x01;
+ buf[1] = -val;
+ return 2;
+ }
+}
+
+int
+objc_write_char (struct objc_typed_stream *stream, signed char value)
+{
+ unsigned char buf[sizeof (char) + 1];
+ int len = __objc_code_char (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_unsigned_short (unsigned char *buf, unsigned short val)
+{
+ if ((val&_B_VALUE) == val)
+ {
+ buf[0] = val|_B_SINT;
+ return 1;
+ }
+ else
+ {
+ int c, b;
+
+ buf[0] = _B_NINT;
+
+ for (c = sizeof (short); c != 0; c -= 1)
+ if (((val >> (8*(c - 1)))%0x100) != 0)
+ break;
+
+ buf[0] |= c;
+
+ for (b = 1; c != 0; c--, b++)
+ {
+ buf[b] = (val >> (8*(c - 1)))%0x100;
+ }
+
+ return b;
+ }
+}
+
+int
+objc_write_unsigned_short (struct objc_typed_stream *stream,
+ unsigned short value)
+{
+ unsigned char buf[sizeof (unsigned short) + 1];
+ int len = __objc_code_unsigned_short (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_short (unsigned char *buf, short val)
+{
+ int sign = (val < 0);
+ int size = __objc_code_unsigned_short (buf, sign ? -val : val);
+ if (sign)
+ buf[0] |= _B_SIGN;
+ return size;
+}
+
+int
+objc_write_short (struct objc_typed_stream *stream, short value)
+{
+ unsigned char buf[sizeof (short) + 1];
+ int len = __objc_code_short (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+
+static inline int
+__objc_code_unsigned_int (unsigned char *buf, unsigned int val)
+{
+ if ((val&_B_VALUE) == val)
+ {
+ buf[0] = val|_B_SINT;
+ return 1;
+ }
+ else
+ {
+ int c, b;
+
+ buf[0] = _B_NINT;
+
+ for (c = sizeof (int); c != 0; c -= 1)
+ if (((val >> (8*(c - 1)))%0x100) != 0)
+ break;
+
+ buf[0] |= c;
+
+ for (b = 1; c != 0; c--, b++)
+ {
+ buf[b] = (val >> (8*(c-1)))%0x100;
+ }
+
+ return b;
+ }
+}
+
+int
+objc_write_unsigned_int (struct objc_typed_stream *stream, unsigned int value)
+{
+ unsigned char buf[sizeof (unsigned int) + 1];
+ int len = __objc_code_unsigned_int (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_int (unsigned char *buf, int val)
+{
+ int sign = (val < 0);
+ int size = __objc_code_unsigned_int (buf, sign ? -val : val);
+ if (sign)
+ buf[0] |= _B_SIGN;
+ return size;
+}
+
+int
+objc_write_int (struct objc_typed_stream *stream, int value)
+{
+ unsigned char buf[sizeof (int) + 1];
+ int len = __objc_code_int (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_unsigned_long (unsigned char *buf, unsigned long val)
+{
+ if ((val&_B_VALUE) == val)
+ {
+ buf[0] = val|_B_SINT;
+ return 1;
+ }
+ else
+ {
+ int c, b;
+
+ buf[0] = _B_NINT;
+
+ for (c = sizeof (long); c != 0; c -= 1)
+ if (((val >> (8*(c - 1)))%0x100) != 0)
+ break;
+
+ buf[0] |= c;
+
+ for (b = 1; c != 0; c--, b++)
+ {
+ buf[b] = (val >> (8*(c - 1)))%0x100;
+ }
+
+ return b;
+ }
+}
+
+int
+objc_write_unsigned_long (struct objc_typed_stream *stream,
+ unsigned long value)
+{
+ unsigned char buf[sizeof (unsigned long) + 1];
+ int len = __objc_code_unsigned_long (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+static inline int
+__objc_code_long (unsigned char *buf, long val)
+{
+ int sign = (val < 0);
+ int size = __objc_code_unsigned_long (buf, sign ? -val : val);
+ if (sign)
+ buf[0] |= _B_SIGN;
+ return size;
+}
+
+int
+objc_write_long (struct objc_typed_stream *stream, long value)
+{
+ unsigned char buf[sizeof (long) + 1];
+ int len = __objc_code_long (buf, value);
+ return (*stream->write) (stream->physical, (char*)buf, len);
+}
+
+
+int
+objc_write_string (struct objc_typed_stream *stream,
+ const unsigned char *string, unsigned int nbytes)
+{
+ unsigned char buf[sizeof (unsigned int) + 1];
+ int len = __objc_code_unsigned_int (buf, nbytes);
+
+ if ((buf[0]&_B_CODE) == _B_SINT)
+ buf[0] = (buf[0]&_B_VALUE)|_B_SSTR;
+
+ else /* _B_NINT */
+ buf[0] = (buf[0]&_B_VALUE)|_B_NSTR;
+
+ if ((*stream->write) (stream->physical, (char*)buf, len) != 0)
+ return (*stream->write) (stream->physical, (char*)string, nbytes);
+ else
+ return 0;
+}
+
+int
+objc_write_string_atomic (struct objc_typed_stream *stream,
+ unsigned char *string, unsigned int nbytes)
+{
+ unsigned long key;
+ if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table, string))))
+ return objc_write_use_common (stream, key);
+ else
+ {
+ int length;
+ objc_hash_add (&stream->stream_table,
+ LONG2PTR(key=PTR2LONG(string)), string);
+ if ((length = objc_write_register_common (stream, key)))
+ return objc_write_string (stream, string, nbytes);
+ return length;
+ }
+}
+
+static int
+objc_write_register_common (struct objc_typed_stream *stream,
+ unsigned long key)
+{
+ unsigned char buf[sizeof (unsigned long)+2];
+ int len = __objc_code_unsigned_long (buf + 1, key);
+ if (len == 1)
+ {
+ buf[0] = _B_RCOMM|0x01;
+ buf[1] &= _B_VALUE;
+ return (*stream->write) (stream->physical, (char*)buf, len + 1);
+ }
+ else
+ {
+ buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM;
+ return (*stream->write) (stream->physical, (char*)buf + 1, len);
+ }
+}
+
+static int
+objc_write_use_common (struct objc_typed_stream *stream, unsigned long key)
+{
+ unsigned char buf[sizeof (unsigned long)+2];
+ int len = __objc_code_unsigned_long (buf + 1, key);
+ if (len == 1)
+ {
+ buf[0] = _B_UCOMM|0x01;
+ buf[1] &= _B_VALUE;
+ return (*stream->write) (stream->physical, (char*)buf, 2);
+ }
+ else
+ {
+ buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM;
+ return (*stream->write) (stream->physical, (char*)buf + 1, len);
+ }
+}
+
+static inline int
+__objc_write_extension (struct objc_typed_stream *stream, unsigned char code)
+{
+ if (code <= _B_VALUE)
+ {
+ unsigned char buf = code|_B_EXT;
+ return (*stream->write) (stream->physical, (char*)&buf, 1);
+ }
+ else
+ {
+ objc_error (nil, OBJC_ERR_BAD_OPCODE,
+ "__objc_write_extension: bad opcode %c\n", code);
+ return -1;
+ }
+}
+
+inline int
+__objc_write_object (struct objc_typed_stream *stream, id object)
+{
+ unsigned char buf = '\0';
+ SEL write_sel = sel_get_any_uid ("write:");
+ if (object)
+ {
+ __objc_write_extension (stream, _BX_OBJECT);
+ objc_write_class (stream, object->class_pointer);
+ (*objc_msg_lookup (object, write_sel)) (object, write_sel, stream);
+ return (*stream->write) (stream->physical, (char*)&buf, 1);
+ }
+ else
+ return objc_write_use_common (stream, 0);
+}
+
+int
+objc_write_object_reference (struct objc_typed_stream *stream, id object)
+{
+ unsigned long key;
+ if ((key = PTR2LONG(objc_hash_value_for_key (stream->object_table, object))))
+ return objc_write_use_common (stream, key);
+
+ __objc_write_extension (stream, _BX_OBJREF);
+ return objc_write_unsigned_long (stream, PTR2LONG (object));
+}
+
+int
+objc_write_root_object (struct objc_typed_stream *stream, id object)
+{
+ int len = 0;
+ if (stream->writing_root_p)
+ objc_error (nil, OBJC_ERR_RECURSE_ROOT,
+ "objc_write_root_object called recursively");
+ else
+ {
+ stream->writing_root_p = 1;
+ __objc_write_extension (stream, _BX_OBJROOT);
+ if ((len = objc_write_object (stream, object)))
+ __objc_finish_write_root_object (stream);
+ stream->writing_root_p = 0;
+ }
+ return len;
+}
+
+int
+objc_write_object (struct objc_typed_stream *stream, id object)
+{
+ unsigned long key;
+ if ((key = PTR2LONG(objc_hash_value_for_key (stream->object_table, object))))
+ return objc_write_use_common (stream, key);
+
+ else if (object == nil)
+ return objc_write_use_common (stream, 0);
+
+ else
+ {
+ int length;
+ objc_hash_add (&stream->object_table,
+ LONG2PTR(key=PTR2LONG(object)), object);
+ if ((length = objc_write_register_common (stream, key)))
+ return __objc_write_object (stream, object);
+ return length;
+ }
+}
+
+inline int
+__objc_write_class (struct objc_typed_stream *stream, struct objc_class *class)
+{
+ __objc_write_extension (stream, _BX_CLASS);
+ objc_write_string_atomic (stream, (unsigned char *) class->name,
+ strlen ((char *) class->name));
+ return objc_write_unsigned_long (stream, class->version);
+}
+
+
+static int
+objc_write_class (struct objc_typed_stream *stream,
+ struct objc_class *class)
+{
+ unsigned long key;
+ if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table, class))))
+ return objc_write_use_common (stream, key);
+ else
+ {
+ int length;
+ objc_hash_add (&stream->stream_table,
+ LONG2PTR(key = PTR2LONG(class)), class);
+ if ((length = objc_write_register_common (stream, key)))
+ return __objc_write_class (stream, class);
+ return length;
+ }
+}
+
+
+inline int
+__objc_write_selector (struct objc_typed_stream *stream, SEL selector)
+{
+ const char *sel_name;
+ __objc_write_extension (stream, _BX_SEL);
+ /* to handle NULL selectors */
+ if ((SEL)0 == selector)
+ return objc_write_string (stream, (unsigned char*)"", 0);
+ sel_name = sel_get_name (selector);
+ return objc_write_string (stream, (unsigned char*)sel_name, strlen ((char*)sel_name));
+}
+
+int
+objc_write_selector (struct objc_typed_stream *stream, SEL selector)
+{
+ const char *sel_name;
+ unsigned long key;
+
+ /* to handle NULL selectors */
+ if ((SEL)0 == selector)
+ return __objc_write_selector (stream, selector);
+
+ sel_name = sel_get_name (selector);
+ if ((key = PTR2LONG(objc_hash_value_for_key (stream->stream_table,
+ sel_name))))
+ return objc_write_use_common (stream, key);
+ else
+ {
+ int length;
+ objc_hash_add (&stream->stream_table,
+ LONG2PTR(key = PTR2LONG(sel_name)), (char *) sel_name);
+ if ((length = objc_write_register_common (stream, key)))
+ return __objc_write_selector (stream, selector);
+ return length;
+ }
+}
+
+
+
+/*
+** Read operations
+*/
+
+inline int
+objc_read_char (struct objc_typed_stream *stream, char *val)
+{
+ unsigned char buf;
+ int len;
+ len = (*stream->read) (stream->physical, (char*)&buf, 1);
+ if (len != 0)
+ {
+ if ((buf & _B_CODE) == _B_SINT)
+ (*val) = (buf & _B_VALUE);
+
+ else if ((buf & _B_NUMBER) == 1)
+ {
+ len = (*stream->read) (stream->physical, val, 1);
+ if (buf&_B_SIGN)
+ (*val) = -1 * (*val);
+ }
+
+ else
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected 8bit signed int, got %dbit int",
+ (int) (buf&_B_NUMBER)*8);
+ }
+ return len;
+}
+
+
+inline int
+objc_read_unsigned_char (struct objc_typed_stream *stream, unsigned char *val)
+{
+ unsigned char buf;
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)&buf, 1)))
+ {
+ if ((buf & _B_CODE) == _B_SINT)
+ (*val) = (buf & _B_VALUE);
+
+ else if ((buf & _B_NUMBER) == 1)
+ len = (*stream->read) (stream->physical, (char*)val, 1);
+
+ else
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected 8bit unsigned int, got %dbit int",
+ (int) (buf&_B_NUMBER)*8);
+ }
+ return len;
+}
+
+inline int
+objc_read_short (struct objc_typed_stream *stream, short *value)
+{
+ unsigned char buf[sizeof (short) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ {
+ int pos = 1;
+ int nbytes = buf[0] & _B_NUMBER;
+ if (nbytes > (int) sizeof (short))
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected short, got bigger (%dbits)", nbytes*8);
+ len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
+ (*value) = 0;
+ while (pos <= nbytes)
+ (*value) = ((*value)*0x100) + buf[pos++];
+ if (buf[0] & _B_SIGN)
+ (*value) = -(*value);
+ }
+ }
+ return len;
+}
+
+inline int
+objc_read_unsigned_short (struct objc_typed_stream *stream,
+ unsigned short *value)
+{
+ unsigned char buf[sizeof (unsigned short) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ {
+ int pos = 1;
+ int nbytes = buf[0] & _B_NUMBER;
+ if (nbytes > (int) sizeof (short))
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected short, got int or bigger");
+ len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
+ (*value) = 0;
+ while (pos <= nbytes)
+ (*value) = ((*value)*0x100) + buf[pos++];
+ }
+ }
+ return len;
+}
+
+
+inline int
+objc_read_int (struct objc_typed_stream *stream, int *value)
+{
+ unsigned char buf[sizeof (int) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ {
+ int pos = 1;
+ int nbytes = buf[0] & _B_NUMBER;
+ if (nbytes > (int) sizeof (int))
+ objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
+ len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
+ (*value) = 0;
+ while (pos <= nbytes)
+ (*value) = ((*value)*0x100) + buf[pos++];
+ if (buf[0] & _B_SIGN)
+ (*value) = -(*value);
+ }
+ }
+ return len;
+}
+
+inline int
+objc_read_long (struct objc_typed_stream *stream, long *value)
+{
+ unsigned char buf[sizeof (long) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ {
+ int pos = 1;
+ int nbytes = buf[0] & _B_NUMBER;
+ if (nbytes > (int) sizeof (long))
+ objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
+ len = (*stream->read) (stream->physical, (char*)buf + 1, nbytes);
+ (*value) = 0;
+ while (pos <= nbytes)
+ (*value) = ((*value)*0x100) + buf[pos++];
+ if (buf[0] & _B_SIGN)
+ (*value) = -(*value);
+ }
+ }
+ return len;
+}
+
+inline int
+__objc_read_nbyte_uint (struct objc_typed_stream *stream,
+ unsigned int nbytes, unsigned int *val)
+{
+ int len;
+ unsigned int pos = 0;
+ unsigned char buf[sizeof (unsigned int) + 1];
+
+ if (nbytes > sizeof (int))
+ objc_error (nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
+
+ len = (*stream->read) (stream->physical, (char*)buf, nbytes);
+ (*val) = 0;
+ while (pos < nbytes)
+ (*val) = ((*val)*0x100) + buf[pos++];
+ return len;
+}
+
+
+inline int
+objc_read_unsigned_int (struct objc_typed_stream *stream,
+ unsigned int *value)
+{
+ unsigned char buf[sizeof (unsigned int) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ len = __objc_read_nbyte_uint (stream, (buf[0] & _B_VALUE), value);
+
+ }
+ return len;
+}
+
+int
+__objc_read_nbyte_ulong (struct objc_typed_stream *stream,
+ unsigned int nbytes, unsigned long *val)
+{
+ int len;
+ unsigned int pos = 0;
+ unsigned char buf[sizeof (unsigned long) + 1];
+
+ if (nbytes > sizeof (long))
+ objc_error (nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
+
+ len = (*stream->read) (stream->physical, (char*)buf, nbytes);
+ (*val) = 0;
+ while (pos < nbytes)
+ (*val) = ((*val)*0x100) + buf[pos++];
+ return len;
+}
+
+
+inline int
+objc_read_unsigned_long (struct objc_typed_stream *stream,
+ unsigned long *value)
+{
+ unsigned char buf[sizeof (unsigned long) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ if ((buf[0] & _B_CODE) == _B_SINT)
+ (*value) = (buf[0] & _B_VALUE);
+
+ else
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), value);
+
+ }
+ return len;
+}
+
+inline int
+objc_read_string (struct objc_typed_stream *stream,
+ char **string)
+{
+ unsigned char buf[sizeof (unsigned int) + 1];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ unsigned long key = 0;
+
+ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
+ {
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ len = (*stream->read) (stream->physical, (char*)buf, 1);
+ }
+
+ switch (buf[0]&_B_CODE) {
+ case _B_SSTR:
+ {
+ int length = buf[0]&_B_VALUE;
+ (*string) = (char*)objc_malloc (length + 1);
+ if (key)
+ objc_hash_add (&stream->stream_table, LONG2PTR(key), *string);
+ len = (*stream->read) (stream->physical, *string, length);
+ (*string)[length] = '\0';
+ }
+ break;
+
+ case _B_UCOMM:
+ {
+ char *tmp;
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ tmp = objc_hash_value_for_key (stream->stream_table, LONG2PTR (key));
+ *string = objc_malloc (strlen (tmp) + 1);
+ strcpy (*string, tmp);
+ }
+ break;
+
+ case _B_NSTR:
+ {
+ unsigned int nbytes = buf[0]&_B_VALUE;
+ len = __objc_read_nbyte_uint (stream, nbytes, &nbytes);
+ if (len) {
+ (*string) = (char*)objc_malloc (nbytes + 1);
+ if (key)
+ objc_hash_add (&stream->stream_table, LONG2PTR(key), *string);
+ len = (*stream->read) (stream->physical, *string, nbytes);
+ (*string)[nbytes] = '\0';
+ }
+ }
+ break;
+
+ default:
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected string, got opcode %c\n", (buf[0]&_B_CODE));
+ }
+ }
+
+ return len;
+}
+
+
+int
+objc_read_object (struct objc_typed_stream *stream, id *object)
+{
+ unsigned char buf[sizeof (unsigned int)];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ SEL read_sel = sel_get_any_uid ("read:");
+ unsigned long key = 0;
+
+ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register common */
+ {
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ len = (*stream->read) (stream->physical, (char*)buf, 1);
+ }
+
+ if (buf[0] == (_B_EXT | _BX_OBJECT))
+ {
+ Class class;
+
+ /* get class */
+ len = objc_read_class (stream, &class);
+
+ /* create instance */
+ (*object) = class_create_instance (class);
+
+ /* register? */
+ if (key)
+ objc_hash_add (&stream->object_table, LONG2PTR(key), *object);
+
+ /* send -read: */
+ if (__objc_responds_to (*object, read_sel))
+ (*get_imp (class, read_sel)) (*object, read_sel, stream);
+
+ /* check null-byte */
+ len = (*stream->read) (stream->physical, (char*)buf, 1);
+ if (buf[0] != '\0')
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected null-byte, got opcode %c", buf[0]);
+ }
+
+ else if ((buf[0]&_B_CODE) == _B_UCOMM)
+ {
+ if (key)
+ objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ (*object) = objc_hash_value_for_key (stream->object_table,
+ LONG2PTR(key));
+ }
+
+ else if (buf[0] == (_B_EXT | _BX_OBJREF)) /* a forward reference */
+ {
+ struct objc_list *other;
+ len = objc_read_unsigned_long (stream, &key);
+ other
+ = (struct objc_list *) objc_hash_value_for_key (stream->object_refs,
+ LONG2PTR(key));
+ objc_hash_add (&stream->object_refs, LONG2PTR(key),
+ (void *)list_cons (object, other));
+ }
+
+ else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */
+ {
+ if (key)
+ objc_error (nil, OBJC_ERR_BAD_KEY,
+ "cannot register root object...");
+ len = objc_read_object (stream, object);
+ __objc_finish_read_root_object (stream);
+ }
+
+ else
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected object, got opcode %c", buf[0]);
+ }
+ return len;
+}
+
+static int
+objc_read_class (struct objc_typed_stream *stream, Class *class)
+{
+ unsigned char buf[sizeof (unsigned int)];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ unsigned long key = 0;
+
+ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
+ {
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ len = (*stream->read) (stream->physical, (char*)buf, 1);
+ }
+
+ if (buf[0] == (_B_EXT | _BX_CLASS))
+ {
+ char temp[1] = "";
+ char *class_name = temp;
+ unsigned long version;
+
+ /* get class */
+ len = objc_read_string (stream, &class_name);
+ (*class) = objc_get_class (class_name);
+ objc_free (class_name);
+
+ /* register */
+ if (key)
+ objc_hash_add (&stream->stream_table, LONG2PTR(key), *class);
+
+ objc_read_unsigned_long (stream, &version);
+ objc_hash_add (&stream->class_table,
+ (*class)->name, (void *)version);
+ }
+
+ else if ((buf[0]&_B_CODE) == _B_UCOMM)
+ {
+ if (key)
+ objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ *class = objc_hash_value_for_key (stream->stream_table,
+ LONG2PTR(key));
+ if (! *class)
+ objc_error (nil, OBJC_ERR_BAD_CLASS,
+ "cannot find class for key %lu", key);
+ }
+
+ else
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected class, got opcode %c", buf[0]);
+ }
+ return len;
+}
+
+int
+objc_read_selector (struct objc_typed_stream *stream, SEL* selector)
+{
+ unsigned char buf[sizeof (unsigned int)];
+ int len;
+ if ((len = (*stream->read) (stream->physical, (char*)buf, 1)))
+ {
+ unsigned long key = 0;
+
+ if ((buf[0]&_B_CODE) == _B_RCOMM) /* register following */
+ {
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ len = (*stream->read) (stream->physical, (char*)buf, 1);
+ }
+
+ if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */
+ {
+ char temp[1] = "";
+ char *selector_name = temp;
+
+ /* get selector */
+ len = objc_read_string (stream, &selector_name);
+ /* To handle NULL selectors */
+ if (0 == strlen (selector_name))
+ {
+ (*selector) = (SEL)0;
+ return 0;
+ }
+ else
+ (*selector) = sel_get_any_uid (selector_name);
+ objc_free (selector_name);
+
+ /* register */
+ if (key)
+ objc_hash_add (&stream->stream_table,
+ LONG2PTR(key), (void *) *selector);
+ }
+
+ else if ((buf[0]&_B_CODE) == _B_UCOMM)
+ {
+ if (key)
+ objc_error (nil, OBJC_ERR_BAD_KEY, "cannot register use upcode...");
+ len = __objc_read_nbyte_ulong (stream, (buf[0] & _B_VALUE), &key);
+ (*selector) = objc_hash_value_for_key (stream->stream_table,
+ LONG2PTR(key));
+ }
+
+ else
+ objc_error (nil, OBJC_ERR_BAD_DATA,
+ "expected selector, got opcode %c", buf[0]);
+ }
+ return len;
+}
+
+/*
+** USER LEVEL FUNCTIONS
+*/
+
+/*
+** Write one object, encoded in TYPE and pointed to by DATA to the
+** typed stream STREAM.
+*/
+
+int
+objc_write_type (TypedStream *stream, const char *type, const void *data)
+{
+ switch (*type) {
+ case _C_ID:
+ return objc_write_object (stream, *(id *) data);
+ break;
+
+ case _C_CLASS:
+ return objc_write_class (stream, *(Class *) data);
+ break;
+
+ case _C_SEL:
+ return objc_write_selector (stream, *(SEL *) data);
+ break;
+
+ case _C_CHR:
+ return objc_write_char (stream, *(signed char *) data);
+ break;
+
+ case _C_UCHR:
+ return objc_write_unsigned_char (stream, *(unsigned char *) data);
+ break;
+
+ case _C_SHT:
+ return objc_write_short (stream, *(short *) data);
+ break;
+
+ case _C_USHT:
+ return objc_write_unsigned_short (stream, *(unsigned short *) data);
+ break;
+
+ case _C_INT:
+ return objc_write_int (stream, *(int *) data);
+ break;
+
+ case _C_UINT:
+ return objc_write_unsigned_int (stream, *(unsigned int *) data);
+ break;
+
+ case _C_LNG:
+ return objc_write_long (stream, *(long *) data);
+ break;
+
+ case _C_ULNG:
+ return objc_write_unsigned_long (stream, *(unsigned long *) data);
+ break;
+
+ case _C_CHARPTR:
+ return objc_write_string (stream,
+ *(unsigned char **) data, strlen (*(char **) data));
+ break;
+
+ case _C_ATOM:
+ return objc_write_string_atomic (stream, *(unsigned char **) data,
+ strlen (*(char **) data));
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (type + 1);
+ while (isdigit ((unsigned char) *++type))
+ ;
+ return objc_write_array (stream, type, len, data);
+ }
+ break;
+
+ case _C_STRUCT_B:
+ {
+ int acc_size = 0;
+ int align;
+ while (*type != _C_STRUCT_E && *type++ != '=')
+ ; /* skip "<name>=" */
+ while (*type != _C_STRUCT_E)
+ {
+ align = objc_alignof_type (type); /* padd to alignment */
+ acc_size = ROUND (acc_size, align);
+ objc_write_type (stream, type, ((char *) data) + acc_size);
+ acc_size += objc_sizeof_type (type); /* add component size */
+ type = objc_skip_typespec (type); /* skip component */
+ }
+ return 1;
+ }
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE,
+ "objc_write_type: cannot parse typespec: %s\n", type);
+ return 0;
+ }
+ }
+}
+
+/*
+** Read one object, encoded in TYPE and pointed to by DATA to the
+** typed stream STREAM. DATA specifies the address of the types to
+** read. Expected type is checked against the type actually present
+** on the stream.
+*/
+
+int
+objc_read_type(TypedStream *stream, const char *type, void *data)
+{
+ char c;
+ switch (c = *type) {
+ case _C_ID:
+ return objc_read_object (stream, (id*)data);
+ break;
+
+ case _C_CLASS:
+ return objc_read_class (stream, (Class*)data);
+ break;
+
+ case _C_SEL:
+ return objc_read_selector (stream, (SEL*)data);
+ break;
+
+ case _C_CHR:
+ return objc_read_char (stream, (char*)data);
+ break;
+
+ case _C_UCHR:
+ return objc_read_unsigned_char (stream, (unsigned char*)data);
+ break;
+
+ case _C_SHT:
+ return objc_read_short (stream, (short*)data);
+ break;
+
+ case _C_USHT:
+ return objc_read_unsigned_short (stream, (unsigned short*)data);
+ break;
+
+ case _C_INT:
+ return objc_read_int (stream, (int*)data);
+ break;
+
+ case _C_UINT:
+ return objc_read_unsigned_int (stream, (unsigned int*)data);
+ break;
+
+ case _C_LNG:
+ return objc_read_long (stream, (long*)data);
+ break;
+
+ case _C_ULNG:
+ return objc_read_unsigned_long (stream, (unsigned long*)data);
+ break;
+
+ case _C_CHARPTR:
+ case _C_ATOM:
+ return objc_read_string (stream, (char**)data);
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (type + 1);
+ while (isdigit ((unsigned char) *++type))
+ ;
+ return objc_read_array (stream, type, len, data);
+ }
+ break;
+
+ case _C_STRUCT_B:
+ {
+ int acc_size = 0;
+ int align;
+ while (*type != _C_STRUCT_E && *type++ != '=')
+ ; /* skip "<name>=" */
+ while (*type != _C_STRUCT_E)
+ {
+ align = objc_alignof_type (type); /* padd to alignment */
+ acc_size = ROUND (acc_size, align);
+ objc_read_type (stream, type, ((char*)data)+acc_size);
+ acc_size += objc_sizeof_type (type); /* add component size */
+ type = objc_skip_typespec (type); /* skip component */
+ }
+ return 1;
+ }
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE,
+ "objc_read_type: cannot parse typespec: %s\n", type);
+ return 0;
+ }
+ }
+}
+
+/*
+** Write the object specified by the template TYPE to STREAM. Last
+** arguments specify addresses of values to be written. It might
+** seem surprising to specify values by address, but this is extremely
+** convenient for copy-paste with objc_read_types calls. A more
+** down-to-the-earth cause for this passing of addresses is that values
+** of arbitrary size is not well supported in ANSI C for functions with
+** variable number of arguments.
+*/
+
+int
+objc_write_types (TypedStream *stream, const char *type, ...)
+{
+ va_list args;
+ const char *c;
+ int res = 0;
+
+ va_start(args, type);
+
+ for (c = type; *c; c = objc_skip_typespec (c))
+ {
+ switch (*c) {
+ case _C_ID:
+ res = objc_write_object (stream, *va_arg (args, id*));
+ break;
+
+ case _C_CLASS:
+ res = objc_write_class (stream, *va_arg (args, Class*));
+ break;
+
+ case _C_SEL:
+ res = objc_write_selector (stream, *va_arg (args, SEL*));
+ break;
+
+ case _C_CHR:
+ res = objc_write_char (stream, *va_arg (args, char*));
+ break;
+
+ case _C_UCHR:
+ res = objc_write_unsigned_char (stream,
+ *va_arg (args, unsigned char*));
+ break;
+
+ case _C_SHT:
+ res = objc_write_short (stream, *va_arg (args, short*));
+ break;
+
+ case _C_USHT:
+ res = objc_write_unsigned_short (stream,
+ *va_arg (args, unsigned short*));
+ break;
+
+ case _C_INT:
+ res = objc_write_int(stream, *va_arg (args, int*));
+ break;
+
+ case _C_UINT:
+ res = objc_write_unsigned_int(stream, *va_arg (args, unsigned int*));
+ break;
+
+ case _C_LNG:
+ res = objc_write_long(stream, *va_arg (args, long*));
+ break;
+
+ case _C_ULNG:
+ res = objc_write_unsigned_long(stream, *va_arg (args, unsigned long*));
+ break;
+
+ case _C_CHARPTR:
+ {
+ unsigned char **str = va_arg (args, unsigned char **);
+ res = objc_write_string (stream, *str, strlen ((char*)*str));
+ }
+ break;
+
+ case _C_ATOM:
+ {
+ unsigned char **str = va_arg (args, unsigned char **);
+ res = objc_write_string_atomic (stream, *str, strlen ((char*)*str));
+ }
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (c + 1);
+ const char *t = c;
+ while (isdigit ((unsigned char) *++t))
+ ;
+ res = objc_write_array (stream, t, len, va_arg (args, void *));
+ t = objc_skip_typespec (t);
+ if (*t != _C_ARY_E)
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
+ }
+ break;
+
+ default:
+ objc_error (nil, OBJC_ERR_BAD_TYPE,
+ "objc_write_types: cannot parse typespec: %s\n", type);
+ }
+ }
+ va_end(args);
+ return res;
+}
+
+
+/*
+** Last arguments specify addresses of values to be read. Expected
+** type is checked against the type actually present on the stream.
+*/
+
+int
+objc_read_types(TypedStream *stream, const char *type, ...)
+{
+ va_list args;
+ const char *c;
+ int res = 0;
+
+ va_start (args, type);
+
+ for (c = type; *c; c = objc_skip_typespec(c))
+ {
+ switch (*c) {
+ case _C_ID:
+ res = objc_read_object(stream, va_arg (args, id*));
+ break;
+
+ case _C_CLASS:
+ res = objc_read_class(stream, va_arg (args, Class*));
+ break;
+
+ case _C_SEL:
+ res = objc_read_selector(stream, va_arg (args, SEL*));
+ break;
+
+ case _C_CHR:
+ res = objc_read_char(stream, va_arg (args, char*));
+ break;
+
+ case _C_UCHR:
+ res = objc_read_unsigned_char(stream, va_arg (args, unsigned char*));
+ break;
+
+ case _C_SHT:
+ res = objc_read_short(stream, va_arg (args, short*));
+ break;
+
+ case _C_USHT:
+ res = objc_read_unsigned_short(stream, va_arg (args, unsigned short*));
+ break;
+
+ case _C_INT:
+ res = objc_read_int(stream, va_arg (args, int*));
+ break;
+
+ case _C_UINT:
+ res = objc_read_unsigned_int(stream, va_arg (args, unsigned int*));
+ break;
+
+ case _C_LNG:
+ res = objc_read_long(stream, va_arg (args, long*));
+ break;
+
+ case _C_ULNG:
+ res = objc_read_unsigned_long(stream, va_arg (args, unsigned long*));
+ break;
+
+ case _C_CHARPTR:
+ case _C_ATOM:
+ {
+ char **str = va_arg (args, char **);
+ res = objc_read_string (stream, str);
+ }
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (c + 1);
+ const char *t = c;
+ while (isdigit ((unsigned char) *++t))
+ ;
+ res = objc_read_array (stream, t, len, va_arg (args, void *));
+ t = objc_skip_typespec (t);
+ if (*t != _C_ARY_E)
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "expected `]', got: %s", t);
+ }
+ break;
+
+ default:
+ objc_error (nil, OBJC_ERR_BAD_TYPE,
+ "objc_read_types: cannot parse typespec: %s\n", type);
+ }
+ }
+ va_end (args);
+ return res;
+}
+
+/*
+** Write an array of COUNT elements of TYPE from the memory address DATA.
+** This is equivalent of objc_write_type (stream, "[N<type>]", data)
+*/
+
+int
+objc_write_array (TypedStream *stream, const char *type,
+ int count, const void *data)
+{
+ int off = objc_sizeof_type(type);
+ const char *where = data;
+
+ while (count-- > 0)
+ {
+ objc_write_type(stream, type, where);
+ where += off;
+ }
+ return 1;
+}
+
+/*
+** Read an array of COUNT elements of TYPE into the memory address
+** DATA. The memory pointed to by data is supposed to be allocated
+** by the callee. This is equivalent of
+** objc_read_type (stream, "[N<type>]", data)
+*/
+
+int
+objc_read_array (TypedStream *stream, const char *type,
+ int count, void *data)
+{
+ int off = objc_sizeof_type(type);
+ char *where = (char*)data;
+
+ while (count-- > 0)
+ {
+ objc_read_type(stream, type, where);
+ where += off;
+ }
+ return 1;
+}
+
+static int
+__objc_fread (FILE *file, char *data, int len)
+{
+ return fread(data, len, 1, file);
+}
+
+static int
+__objc_fwrite (FILE *file, char *data, int len)
+{
+ return fwrite(data, len, 1, file);
+}
+
+static int
+__objc_feof (FILE *file)
+{
+ return feof(file);
+}
+
+static int
+__objc_no_write (FILE *file __attribute__ ((__unused__)),
+ const char *data __attribute__ ((__unused__)),
+ int len __attribute__ ((__unused__)))
+{
+ objc_error (nil, OBJC_ERR_NO_WRITE, "TypedStream not open for writing");
+ return 0;
+}
+
+static int
+__objc_no_read (FILE *file __attribute__ ((__unused__)),
+ const char *data __attribute__ ((__unused__)),
+ int len __attribute__ ((__unused__)))
+{
+ objc_error (nil, OBJC_ERR_NO_READ, "TypedStream not open for reading");
+ return 0;
+}
+
+static int
+__objc_read_typed_stream_signature (TypedStream *stream)
+{
+ char buffer[80];
+ int pos = 0;
+ do
+ (*stream->read) (stream->physical, buffer+pos, 1);
+ while (buffer[pos++] != '\0')
+ ;
+ sscanf (buffer, "GNU TypedStream %d", &stream->version);
+ if (stream->version != OBJC_TYPED_STREAM_VERSION)
+ objc_error (nil, OBJC_ERR_STREAM_VERSION,
+ "cannot handle TypedStream version %d", stream->version);
+ return 1;
+}
+
+static int
+__objc_write_typed_stream_signature (TypedStream *stream)
+{
+ char buffer[80];
+ sprintf(buffer, "GNU TypedStream %d", OBJC_TYPED_STREAM_VERSION);
+ stream->version = OBJC_TYPED_STREAM_VERSION;
+ (*stream->write) (stream->physical, buffer, strlen (buffer) + 1);
+ return 1;
+}
+
+static void __objc_finish_write_root_object(struct objc_typed_stream *stream)
+{
+ objc_hash_delete (stream->object_table);
+ stream->object_table = objc_hash_new (64,
+ (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+}
+
+static void __objc_finish_read_root_object(struct objc_typed_stream *stream)
+{
+ node_ptr node;
+ SEL awake_sel = sel_get_any_uid ("awake");
+ cache_ptr free_list = objc_hash_new (64,
+ (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+
+ /* resolve object forward references */
+ for (node = objc_hash_next (stream->object_refs, NULL); node;
+ node = objc_hash_next (stream->object_refs, node))
+ {
+ struct objc_list *reflist = node->value;
+ const void *key = node->key;
+ id object = objc_hash_value_for_key (stream->object_table, key);
+ while (reflist)
+ {
+ *((id*) reflist->head) = object;
+ if (objc_hash_value_for_key (free_list,reflist) == NULL)
+ objc_hash_add (&free_list,reflist,reflist);
+
+ reflist = reflist->tail;
+ }
+ }
+
+ /* apply __objc_free to all objects stored in free_list */
+ for (node = objc_hash_next (free_list, NULL); node;
+ node = objc_hash_next (free_list, node))
+ objc_free ((void *) node->key);
+
+ objc_hash_delete (free_list);
+
+ /* empty object reference table */
+ objc_hash_delete (stream->object_refs);
+ stream->object_refs = objc_hash_new (8, (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+
+ /* call -awake for all objects read */
+ if (awake_sel)
+ {
+ for (node = objc_hash_next (stream->object_table, NULL); node;
+ node = objc_hash_next (stream->object_table, node))
+ {
+ id object = node->value;
+ if (__objc_responds_to (object, awake_sel))
+ (*objc_msg_lookup (object, awake_sel)) (object, awake_sel);
+ }
+ }
+
+ /* empty object table */
+ objc_hash_delete (stream->object_table);
+ stream->object_table = objc_hash_new(64,
+ (hash_func_type)objc_hash_ptr,
+ (compare_func_type)objc_compare_ptrs);
+}
+
+/*
+** Open the stream PHYSICAL in MODE
+*/
+
+TypedStream *
+objc_open_typed_stream (FILE *physical, int mode)
+{
+ TypedStream *s = (TypedStream *) objc_malloc (sizeof (TypedStream));
+
+ s->mode = mode;
+ s->physical = physical;
+ s->stream_table = objc_hash_new (64,
+ (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+ s->object_table = objc_hash_new (64,
+ (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+ s->eof = (objc_typed_eof_func) __objc_feof;
+ s->flush = (objc_typed_flush_func) fflush;
+ s->writing_root_p = 0;
+ if (mode == OBJC_READONLY)
+ {
+ s->class_table
+ = objc_hash_new (8, (hash_func_type) objc_hash_string,
+ (compare_func_type) objc_compare_strings);
+ s->object_refs = objc_hash_new (8, (hash_func_type) objc_hash_ptr,
+ (compare_func_type) objc_compare_ptrs);
+ s->read = (objc_typed_read_func) __objc_fread;
+ s->write = (objc_typed_write_func) __objc_no_write;
+ __objc_read_typed_stream_signature (s);
+ }
+ else if (mode == OBJC_WRITEONLY)
+ {
+ s->class_table = 0;
+ s->object_refs = 0;
+ s->read = (objc_typed_read_func) __objc_no_read;
+ s->write = (objc_typed_write_func) __objc_fwrite;
+ __objc_write_typed_stream_signature (s);
+ }
+ else
+ {
+ objc_close_typed_stream (s);
+ return NULL;
+ }
+ s->type = OBJC_FILE_STREAM;
+ return s;
+}
+
+/*
+** Open the file named by FILE_NAME in MODE
+*/
+
+TypedStream*
+objc_open_typed_stream_for_file (const char *file_name, int mode)
+{
+ FILE *file = NULL;
+ TypedStream *s;
+
+ if (mode == OBJC_READONLY)
+ file = fopen (file_name, "r");
+ else
+ file = fopen (file_name, "w");
+
+ if (file)
+ {
+ s = objc_open_typed_stream (file, mode);
+ if (s)
+ s->type |= OBJC_MANAGED_STREAM;
+ return s;
+ }
+ else
+ return NULL;
+}
+
+/*
+** Close STREAM freeing the structure it self. If it was opened with
+** objc_open_typed_stream_for_file, the file will also be closed.
+*/
+
+void
+objc_close_typed_stream (TypedStream *stream)
+{
+ if (stream->mode == OBJC_READONLY)
+ {
+ __objc_finish_read_root_object (stream); /* Just in case... */
+ objc_hash_delete (stream->class_table);
+ objc_hash_delete (stream->object_refs);
+ }
+
+ objc_hash_delete (stream->stream_table);
+ objc_hash_delete (stream->object_table);
+
+ if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
+ fclose ((FILE *)stream->physical);
+
+ objc_free(stream);
+}
+
+BOOL
+objc_end_of_typed_stream (TypedStream *stream)
+{
+ return (*stream->eof) (stream->physical);
+}
+
+void
+objc_flush_typed_stream (TypedStream *stream)
+{
+ (*stream->flush) (stream->physical);
+}
+
+long
+objc_get_stream_class_version (TypedStream *stream, Class class)
+{
+ if (stream->class_table)
+ return PTR2LONG(objc_hash_value_for_key (stream->class_table,
+ class->name));
+ else
+ return class_get_version (class);
+}
+
Added: llvm-gcc-4.2/trunk/libobjc/class.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/class.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/class.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/class.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,703 @@
+/* GNU Objective C Runtime class related functions
+ Copyright (C) 1993, 1995, 1996, 1997, 2001, 2002
+ Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup and Dennis Glatting.
+
+ Lock-free class table code designed and written from scratch by
+ Nicola Pero, 2001.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+/*
+ The code in this file critically affects class method invocation
+ speed. This long preamble comment explains why, and the issues
+ involved.
+
+
+ One of the traditional weaknesses of the GNU Objective-C runtime is
+ that class method invocations are slow. The reason is that when you
+ write
+
+ array = [NSArray new];
+
+ this gets basically compiled into the equivalent of
+
+ array = [(objc_get_class ("NSArray")) new];
+
+ objc_get_class returns the class pointer corresponding to the string
+ `NSArray'; and because of the lookup, the operation is more
+ complicated and slow than a simple instance method invocation.
+
+ Most high performance Objective-C code (using the GNU Objc runtime)
+ I had the opportunity to read (or write) work around this problem by
+ caching the class pointer:
+
+ Class arrayClass = [NSArray class];
+
+ ... later on ...
+
+ array = [arrayClass new];
+ array = [arrayClass new];
+ array = [arrayClass new];
+
+ In this case, you always perform a class lookup (the first one), but
+ then all the [arrayClass new] methods run exactly as fast as an
+ instance method invocation. It helps if you have many class method
+ invocations to the same class.
+
+ The long-term solution to this problem would be to modify the
+ compiler to output tables of class pointers corresponding to all the
+ class method invocations, and to add code to the runtime to update
+ these tables - that should in the end allow class method invocations
+ to perform precisely as fast as instance method invocations, because
+ no class lookup would be involved. I think the Apple Objective-C
+ runtime uses this technique. Doing this involves synchronized
+ modifications in the runtime and in the compiler.
+
+ As a first medicine to the problem, I [NP] have redesigned and
+ rewritten the way the runtime is performing class lookup. This
+ doesn't give as much speed as the other (definitive) approach, but
+ at least a class method invocation now takes approximately 4.5 times
+ an instance method invocation on my machine (it would take approx 12
+ times before the rewriting), which is a lot better.
+
+ One of the main reason the new class lookup is so faster is because
+ I implemented it in a way that can safely run multithreaded without
+ using locks - a so-called `lock-free' data structure. The atomic
+ operation is pointer assignment. The reason why in this problem
+ lock-free data structures work so well is that you never remove
+ classes from the table - and the difficult thing with lock-free data
+ structures is freeing data when is removed from the structures. */
+
+#include "objc/runtime.h" /* the kitchen sink */
+#include "objc/sarray.h"
+
+#include "objc/objc.h"
+#include "objc/objc-api.h"
+#include "objc/thr.h"
+
+/* We use a table which maps a class name to the corresponding class
+ * pointer. The first part of this file defines this table, and
+ * functions to do basic operations on the table. The second part of
+ * the file implements some higher level Objective-C functionality for
+ * classes by using the functions provided in the first part to manage
+ * the table. */
+
+/**
+ ** Class Table Internals
+ **/
+
+/* A node holding a class */
+typedef struct class_node
+{
+ struct class_node *next; /* Pointer to next entry on the list.
+ NULL indicates end of list. */
+
+ const char *name; /* The class name string */
+ int length; /* The class name string length */
+ Class pointer; /* The Class pointer */
+
+} *class_node_ptr;
+
+/* A table containing classes is a class_node_ptr (pointing to the
+ first entry in the table - if it is NULL, then the table is
+ empty). */
+
+/* We have 1024 tables. Each table contains all class names which
+ have the same hash (which is a number between 0 and 1023). To look
+ up a class_name, we compute its hash, and get the corresponding
+ table. Once we have the table, we simply compare strings directly
+ till we find the one which we want (using the length first). The
+ number of tables is quite big on purpose (a normal big application
+ has less than 1000 classes), so that you shouldn't normally get any
+ collisions, and get away with a single comparison (which we can't
+ avoid since we need to know that you have got the right thing). */
+#define CLASS_TABLE_SIZE 1024
+#define CLASS_TABLE_MASK 1023
+
+static class_node_ptr class_table_array[CLASS_TABLE_SIZE];
+
+/* The table writing mutex - we lock on writing to avoid conflicts
+ between different writers, but we read without locks. That is
+ possible because we assume pointer assignment to be an atomic
+ operation. */
+static objc_mutex_t __class_table_lock = NULL;
+
+/* CLASS_TABLE_HASH is how we compute the hash of a class name. It is
+ a macro - *not* a function - arguments *are* modified directly.
+
+ INDEX should be a variable holding an int;
+ HASH should be a variable holding an int;
+ CLASS_NAME should be a variable holding a (char *) to the class_name.
+
+ After the macro is executed, INDEX contains the length of the
+ string, and HASH the computed hash of the string; CLASS_NAME is
+ untouched. */
+
+#define CLASS_TABLE_HASH(INDEX, HASH, CLASS_NAME) \
+ HASH = 0; \
+ for (INDEX = 0; CLASS_NAME[INDEX] != '\0'; INDEX++) \
+ { \
+ HASH = (HASH << 4) ^ (HASH >> 28) ^ CLASS_NAME[INDEX]; \
+ } \
+ \
+ HASH = (HASH ^ (HASH >> 10) ^ (HASH >> 20)) & CLASS_TABLE_MASK;
+
+/* Setup the table. */
+static void
+class_table_setup (void)
+{
+ /* Start - nothing in the table. */
+ memset (class_table_array, 0, sizeof (class_node_ptr) * CLASS_TABLE_SIZE);
+
+ /* The table writing mutex. */
+ __class_table_lock = objc_mutex_allocate ();
+}
+
+
+/* Insert a class in the table (used when a new class is registered). */
+static void
+class_table_insert (const char *class_name, Class class_pointer)
+{
+ int hash, length;
+ class_node_ptr new_node;
+
+ /* Find out the class name's hash and length. */
+ CLASS_TABLE_HASH (length, hash, class_name);
+
+ /* Prepare the new node holding the class. */
+ new_node = objc_malloc (sizeof (struct class_node));
+ new_node->name = class_name;
+ new_node->length = length;
+ new_node->pointer = class_pointer;
+
+ /* Lock the table for modifications. */
+ objc_mutex_lock (__class_table_lock);
+
+ /* Insert the new node in the table at the beginning of the table at
+ class_table_array[hash]. */
+ new_node->next = class_table_array[hash];
+ class_table_array[hash] = new_node;
+
+ objc_mutex_unlock (__class_table_lock);
+}
+
+/* Replace a class in the table (used only by poseAs:). */
+static void
+class_table_replace (Class old_class_pointer, Class new_class_pointer)
+{
+ int hash;
+ class_node_ptr node;
+
+ objc_mutex_lock (__class_table_lock);
+
+ hash = 0;
+ node = class_table_array[hash];
+
+ while (hash < CLASS_TABLE_SIZE)
+ {
+ if (node == NULL)
+ {
+ hash++;
+ if (hash < CLASS_TABLE_SIZE)
+ {
+ node = class_table_array[hash];
+ }
+ }
+ else
+ {
+ Class class1 = node->pointer;
+
+ if (class1 == old_class_pointer)
+ {
+ node->pointer = new_class_pointer;
+ }
+ node = node->next;
+ }
+ }
+
+ objc_mutex_unlock (__class_table_lock);
+}
+
+
+/* Get a class from the table. This does not need mutex protection.
+ Currently, this function is called each time you call a static
+ method, this is why it must be very fast. */
+static inline Class
+class_table_get_safe (const char *class_name)
+{
+ class_node_ptr node;
+ int length, hash;
+
+ /* Compute length and hash. */
+ CLASS_TABLE_HASH (length, hash, class_name);
+
+ node = class_table_array[hash];
+
+ if (node != NULL)
+ {
+ do
+ {
+ if (node->length == length)
+ {
+ /* Compare the class names. */
+ int i;
+
+ for (i = 0; i < length; i++)
+ {
+ if ((node->name)[i] != class_name[i])
+ {
+ break;
+ }
+ }
+
+ if (i == length)
+ {
+ /* They are equal! */
+ return node->pointer;
+ }
+ }
+ }
+ while ((node = node->next) != NULL);
+ }
+
+ return Nil;
+}
+
+/* Enumerate over the class table. */
+struct class_table_enumerator
+{
+ int hash;
+ class_node_ptr node;
+};
+
+
+static Class
+class_table_next (struct class_table_enumerator **e)
+{
+ struct class_table_enumerator *enumerator = *e;
+ class_node_ptr next;
+
+ if (enumerator == NULL)
+ {
+ *e = objc_malloc (sizeof (struct class_table_enumerator));
+ enumerator = *e;
+ enumerator->hash = 0;
+ enumerator->node = NULL;
+
+ next = class_table_array[enumerator->hash];
+ }
+ else
+ {
+ next = enumerator->node->next;
+ }
+
+ if (next != NULL)
+ {
+ enumerator->node = next;
+ return enumerator->node->pointer;
+ }
+ else
+ {
+ enumerator->hash++;
+
+ while (enumerator->hash < CLASS_TABLE_SIZE)
+ {
+ next = class_table_array[enumerator->hash];
+ if (next != NULL)
+ {
+ enumerator->node = next;
+ return enumerator->node->pointer;
+ }
+ enumerator->hash++;
+ }
+
+ /* Ok - table finished - done. */
+ objc_free (enumerator);
+ return Nil;
+ }
+}
+
+#if 0 /* DEBUGGING FUNCTIONS */
+/* Debugging function - print the class table. */
+void
+class_table_print (void)
+{
+ int i;
+
+ for (i = 0; i < CLASS_TABLE_SIZE; i++)
+ {
+ class_node_ptr node;
+
+ printf ("%d:\n", i);
+ node = class_table_array[i];
+
+ while (node != NULL)
+ {
+ printf ("\t%s\n", node->name);
+ node = node->next;
+ }
+ }
+}
+
+/* Debugging function - print an histogram of number of classes in
+ function of hash key values. Useful to evaluate the hash function
+ in real cases. */
+void
+class_table_print_histogram (void)
+{
+ int i, j;
+ int counter = 0;
+
+ for (i = 0; i < CLASS_TABLE_SIZE; i++)
+ {
+ class_node_ptr node;
+
+ node = class_table_array[i];
+
+ while (node != NULL)
+ {
+ counter++;
+ node = node->next;
+ }
+ if (((i + 1) % 50) == 0)
+ {
+ printf ("%4d:", i + 1);
+ for (j = 0; j < counter; j++)
+ {
+ printf ("X");
+ }
+ printf ("\n");
+ counter = 0;
+ }
+ }
+ printf ("%4d:", i + 1);
+ for (j = 0; j < counter; j++)
+ {
+ printf ("X");
+ }
+ printf ("\n");
+}
+#endif /* DEBUGGING FUNCTIONS */
+
+/**
+ ** Objective-C runtime functions
+ **/
+
+/* From now on, the only access to the class table data structure
+ should be via the class_table_* functions. */
+
+/* This is a hook which is called by objc_get_class and
+ objc_lookup_class if the runtime is not able to find the class.
+ This may e.g. try to load in the class using dynamic loading. */
+Class (*_objc_lookup_class) (const char *name) = 0; /* !T:SAFE */
+
+
+/* True when class links has been resolved. */
+BOOL __objc_class_links_resolved = NO; /* !T:UNUSED */
+
+
+void
+__objc_init_class_tables (void)
+{
+ /* Allocate the class hash table. */
+
+ if (__class_table_lock)
+ return;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ class_table_setup ();
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* This function adds a class to the class hash table, and assigns the
+ class a number, unless it's already known. */
+void
+__objc_add_class_to_hash (Class class)
+{
+ Class h_class;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* Make sure the table is there. */
+ assert (__class_table_lock);
+
+ /* Make sure it's not a meta class. */
+ assert (CLS_ISCLASS (class));
+
+ /* Check to see if the class is already in the hash table. */
+ h_class = class_table_get_safe (class->name);
+ if (! h_class)
+ {
+ /* The class isn't in the hash table. Add the class and assign a class
+ number. */
+ static unsigned int class_number = 1;
+
+ CLS_SETNUMBER (class, class_number);
+ CLS_SETNUMBER (class->class_pointer, class_number);
+
+ ++class_number;
+ class_table_insert (class->name, class);
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* Get the class object for the class named NAME. If NAME does not
+ identify a known class, the hook _objc_lookup_class is called. If
+ this fails, nil is returned. */
+Class
+objc_lookup_class (const char *name)
+{
+ Class class;
+
+ class = class_table_get_safe (name);
+
+ if (class)
+ return class;
+
+ if (_objc_lookup_class)
+ return (*_objc_lookup_class) (name);
+ else
+ return 0;
+}
+
+/* Get the class object for the class named NAME. If NAME does not
+ identify a known class, the hook _objc_lookup_class is called. If
+ this fails, an error message is issued and the system aborts. */
+Class
+objc_get_class (const char *name)
+{
+ Class class;
+
+ class = class_table_get_safe (name);
+
+ if (class)
+ return class;
+
+ if (_objc_lookup_class)
+ class = (*_objc_lookup_class) (name);
+
+ if (class)
+ return class;
+
+ objc_error (nil, OBJC_ERR_BAD_CLASS,
+ "objc runtime: cannot find class %s\n", name);
+ return 0;
+}
+
+MetaClass
+objc_get_meta_class (const char *name)
+{
+ return objc_get_class (name)->class_pointer;
+}
+
+/* This function provides a way to enumerate all the classes in the
+ executable. Pass *ENUM_STATE == NULL to start the enumeration. The
+ function will return 0 when there are no more classes.
+ For example:
+ id class;
+ void *es = NULL;
+ while ((class = objc_next_class (&es)))
+ ... do something with class;
+*/
+Class
+objc_next_class (void **enum_state)
+{
+ Class class;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* Make sure the table is there. */
+ assert (__class_table_lock);
+
+ class = class_table_next ((struct class_table_enumerator **) enum_state);
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ return class;
+}
+
+/* Resolve super/subclass links for all classes. The only thing we
+ can be sure of is that the class_pointer for class objects point to
+ the right meta class objects. */
+void
+__objc_resolve_class_links (void)
+{
+ struct class_table_enumerator *es = NULL;
+ Class object_class = objc_get_class ("Object");
+ Class class1;
+
+ assert (object_class);
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* Assign subclass links. */
+ while ((class1 = class_table_next (&es)))
+ {
+ /* Make sure we have what we think we have. */
+ assert (CLS_ISCLASS (class1));
+ assert (CLS_ISMETA (class1->class_pointer));
+
+ /* The class_pointer of all meta classes point to Object's meta
+ class. */
+ class1->class_pointer->class_pointer = object_class->class_pointer;
+
+ if (! CLS_ISRESOLV (class1))
+ {
+ CLS_SETRESOLV (class1);
+ CLS_SETRESOLV (class1->class_pointer);
+
+ if (class1->super_class)
+ {
+ Class a_super_class
+ = objc_get_class ((char *) class1->super_class);
+
+ assert (a_super_class);
+
+ DEBUG_PRINTF ("making class connections for: %s\n",
+ class1->name);
+
+ /* Assign subclass links for superclass. */
+ class1->sibling_class = a_super_class->subclass_list;
+ a_super_class->subclass_list = class1;
+
+ /* Assign subclass links for meta class of superclass. */
+ if (a_super_class->class_pointer)
+ {
+ class1->class_pointer->sibling_class
+ = a_super_class->class_pointer->subclass_list;
+ a_super_class->class_pointer->subclass_list
+ = class1->class_pointer;
+ }
+ }
+ else /* A root class, make its meta object be a subclass of
+ Object. */
+ {
+ class1->class_pointer->sibling_class
+ = object_class->subclass_list;
+ object_class->subclass_list = class1->class_pointer;
+ }
+ }
+ }
+
+ /* Assign superclass links. */
+ es = NULL;
+ while ((class1 = class_table_next (&es)))
+ {
+ Class sub_class;
+ for (sub_class = class1->subclass_list; sub_class;
+ sub_class = sub_class->sibling_class)
+ {
+ sub_class->super_class = class1;
+ if (CLS_ISCLASS (sub_class))
+ sub_class->class_pointer->super_class = class1->class_pointer;
+ }
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+
+
+#define CLASSOF(c) ((c)->class_pointer)
+
+Class
+class_pose_as (Class impostor, Class super_class)
+{
+ if (! CLS_ISRESOLV (impostor))
+ __objc_resolve_class_links ();
+
+ /* Preconditions */
+ assert (impostor);
+ assert (super_class);
+ assert (impostor->super_class == super_class);
+ assert (CLS_ISCLASS (impostor));
+ assert (CLS_ISCLASS (super_class));
+ assert (impostor->instance_size == super_class->instance_size);
+
+ {
+ Class *subclass = &(super_class->subclass_list);
+
+ /* Move subclasses of super_class to impostor. */
+ while (*subclass)
+ {
+ Class nextSub = (*subclass)->sibling_class;
+
+ if (*subclass != impostor)
+ {
+ Class sub = *subclass;
+
+ /* Classes */
+ sub->sibling_class = impostor->subclass_list;
+ sub->super_class = impostor;
+ impostor->subclass_list = sub;
+
+ /* It will happen that SUB is not a class object if it is
+ the top of the meta class hierarchy chain (root
+ meta-class objects inherit their class object). If
+ that is the case... don't mess with the meta-meta
+ class. */
+ if (CLS_ISCLASS (sub))
+ {
+ /* Meta classes */
+ CLASSOF (sub)->sibling_class =
+ CLASSOF (impostor)->subclass_list;
+ CLASSOF (sub)->super_class = CLASSOF (impostor);
+ CLASSOF (impostor)->subclass_list = CLASSOF (sub);
+ }
+ }
+
+ *subclass = nextSub;
+ }
+
+ /* Set subclasses of superclass to be impostor only. */
+ super_class->subclass_list = impostor;
+ CLASSOF (super_class)->subclass_list = CLASSOF (impostor);
+
+ /* Set impostor to have no sibling classes. */
+ impostor->sibling_class = 0;
+ CLASSOF (impostor)->sibling_class = 0;
+ }
+
+ /* Check relationship of impostor and super_class is kept. */
+ assert (impostor->super_class == super_class);
+ assert (CLASSOF (impostor)->super_class == CLASSOF (super_class));
+
+ /* This is how to update the lookup table. Regardless of what the
+ keys of the hashtable is, change all values that are superclass
+ into impostor. */
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ class_table_replace (super_class, impostor);
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ /* Next, we update the dispatch tables... */
+ __objc_update_dispatch_table_for_class (CLASSOF (impostor));
+ __objc_update_dispatch_table_for_class (impostor);
+
+ return impostor;
+}
Added: llvm-gcc-4.2/trunk/libobjc/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/config.h.in?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/config.h.in (added)
+++ llvm-gcc-4.2/trunk/libobjc/config.h.in Thu Nov 8 16:56:19 2007
@@ -0,0 +1,58 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if the compiler has a thread header that is non single. */
+#undef HAVE_GTHR_DEFAULT
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <sched.h> header file. */
+#undef HAVE_SCHED_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+#undef SJLJ_EXCEPTIONS
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
Added: llvm-gcc-4.2/trunk/libobjc/configure
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/configure?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/configure (added)
+++ llvm-gcc-4.2/trunk/libobjc/configure Thu Nov 8 16:56:19 2007
@@ -0,0 +1,6595 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for package-unused version-unused.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='package-unused'
+PACKAGE_TARNAME='libobjc'
+PACKAGE_VERSION='version-unused'
+PACKAGE_STRING='package-unused version-unused'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="objc/objc.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_libsubdir build_subdir host_subdir target_subdir VERSION OBJC_BOEHM_GC OBJC_BOEHM_GC_INCLUDES multi_basedir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical glibcpp_srcdir toolexecdir toolexeclibdir includedirname libext CC ac_ct_CC EXEEXT OBJEXT extra_ldflags_libobjc CFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S STRIP ac_ct_STRIP LIBTOOL SET_MAKE CPP CPPFLAGS EGREP LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures package-unused version-unused to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of package-unused version-unused:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory
+ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime.
+ --enable-multilib build many library versions (default)
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-shared=PKGS build shared libraries default=yes
+ --enable-static=PKGS build static libraries default=yes
+ --enable-fast-install=PKGS optimize for fast installation default=yes
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-sjlj-exceptions
+ force use of builtin_setjmp for exceptions
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-build-libsubdir=DIR Directory where to find libraries for build system
+ --with-target-subdir=SUBDIR
+ configuring in a subdirectory
+ --with-cross-host=HOST configuring with a cross compiler
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-pic try to use only PIC/non-PIC objects default=use both
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+package-unused configure version-unused
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by package-unused $as_me version-unused, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+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.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+ case ${build_alias} in
+ "") build_noncanonical=${build} ;;
+ *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+ "") host_noncanonical=${build_noncanonical} ;;
+ *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+ "") target_noncanonical=${host_noncanonical} ;;
+ *) target_noncanonical=${target_alias} ;;
+esac
+
+
+# post-stage1 host modules use a different CC_FOR_BUILD so, in order to
+# have matching libraries, they should use host libraries: Makefile.tpl
+# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
+# However, they still use the build modules, because the corresponding
+# host modules (e.g. bison) are only built for the host when bootstrap
+# finishes. So:
+# - build_subdir is where we find build modules, and never changes.
+# - build_libsubdir is where we find build libraries, and can be overridden.
+
+# Prefix 'build-' so this never conflicts with target_subdir.
+build_subdir="build-${build_noncanonical}"
+
+# Check whether --with-build-libsubdir or --without-build-libsubdir was given.
+if test "${with_build_libsubdir+set}" = set; then
+ withval="$with_build_libsubdir"
+ build_libsubdir="$withval"
+else
+ build_libsubdir="$build_subdir"
+fi;
+# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
+if ( test $srcdir = . && test -d gcc ) \
+ || test -d $srcdir/../host-${host_noncanonical}; then
+ host_subdir="host-${host_noncanonical}"
+else
+ host_subdir=.
+fi
+# No prefix.
+target_subdir=${target_noncanonical}
+
+
+# We need the following definitions because AC_PROG_LIBTOOL relies on them
+PACKAGE=libobjc
+# Version is pulled out to make it a bit easier to change using sed.
+VERSION=2:0:0
+
+
+# This works around the fact that libtool configuration may change LD
+# for this particular configuration, but some shells, instead of
+# keeping the changes in LD private, export them just because LD is
+# exported.
+ORIGINAL_LD_FOR_MULTILIBS=$LD
+
+# -------
+# Options
+# -------
+
+# We use these options to decide which functions to include.
+
+# Check whether --with-target-subdir or --without-target-subdir was given.
+if test "${with_target_subdir+set}" = set; then
+ withval="$with_target_subdir"
+
+fi;
+
+# Check whether --with-cross-host or --without-cross-host was given.
+if test "${with_cross_host+set}" = set; then
+ withval="$with_cross_host"
+
+fi;
+
+echo "$as_me:$LINENO: checking for --enable-version-specific-runtime-libs" >&5
+echo $ECHO_N "checking for --enable-version-specific-runtime-libs... $ECHO_C" >&6
+# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
+if test "${enable_version_specific_runtime_libs+set}" = set; then
+ enableval="$enable_version_specific_runtime_libs"
+ case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable version-specific libs" >&5
+echo "$as_me: error: Unknown argument to enable/disable version-specific libs" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+else
+ version_specific_libs=no
+fi;
+echo "$as_me:$LINENO: result: $version_specific_libs" >&5
+echo "${ECHO_T}$version_specific_libs" >&6
+
+# Check whether --enable-objc-gc or --disable-objc-gc was given.
+if test "${enable_objc_gc+set}" = set; then
+ enableval="$enable_objc_gc"
+ case $enable_objc_gc in
+ no)
+ OBJC_BOEHM_GC=''
+ OBJC_BOEHM_GC_INCLUDES=''
+ ;;
+ *)
+ OBJC_BOEHM_GC=libobjc_gc.la
+ OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
+ ;;
+esac
+else
+ OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''
+fi;
+
+
+
+# -----------
+# Directories
+# -----------
+
+# Find the rest of the source tree framework.
+# Default to --enable-multilib
+# Check whether --enable-multilib or --disable-multilib was given.
+if test "${enable_multilib+set}" = set; then
+ enableval="$enable_multilib"
+ case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for multilib option" >&5
+echo "$as_me: error: bad value $enableval for multilib option" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+else
+ multilib=yes
+fi;
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ ac_config_commands="$ac_config_commands default-1"
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+
+# Export source directory.
+# These need to be absolute paths, yet at the same time need to
+# canonicalize only relative paths, because then amd will not unmount
+# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+case $srcdir in
+ \\/$* | ?:\\/*) glibcpp_srcdir=${srcdir} ;;
+ *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+esac
+
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+esac
+
+
+
+# Figure out if we want to name the include directory and the
+# library name changes differently.
+includedirname=include
+libext=
+case "${host}" in
+ *-darwin*)
+ # Darwin is the only target so far that needs a different include directory.
+ includedirname=include-gnu-runtime
+ libext=-gnu
+ ;;
+esac
+
+
+
+ ac_config_headers="$ac_config_headers config.h"
+
+
+# --------
+# Programs
+# --------
+
+
+
+# We must force CC to /not/ be a precious variable; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# FIXME: Cleanup?
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+fi
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# extra LD Flags which are required for targets
+case "${host}" in
+ *-darwin*)
+ # Darwin needs -single_module when linking libobjc
+ extra_ldflags_libobjc=-Wl,-single_module
+ ;;
+esac
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ echo "$as_me:$LINENO: result: $AS" >&5
+echo "${ECHO_T}$AS" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AS="as"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
+echo "${ECHO_T}$ac_ct_AS" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AS=$ac_ct_AS
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Enable Win32 DLL on MS Windows - FIXME
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi;
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi;
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi;
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
+echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw* |pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*|hpux11*)
+ case $host_cpu in
+ hppa*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ esac
+ ;;
+
+irix5* | irix6*)
+ case $host_os in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+ fi
+ ;;
+
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len" ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 3774 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5
+echo "$as_me: error: libtool configure failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+
+
+
+
+if test "x$CC" != xcc; then
+ echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
+fi
+set dummy $CC; ac_cc=`echo $2 |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+ if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# -------
+# Headers
+# -------
+
+# Sanity check for the cross-compilation case:
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "${ac_cv_header_stdio_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for stdio.h" >&5
+echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdio_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdio_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking stdio.h usability" >&5
+echo $ECHO_N "checking stdio.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <stdio.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking stdio.h presence" >&5
+echo $ECHO_N "checking stdio.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: stdio.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: stdio.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: stdio.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: stdio.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: stdio.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: stdio.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: stdio.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: stdio.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for stdio.h" >&5
+echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6
+if test "${ac_cv_header_stdio_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_stdio_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdio_h" >&6
+
+fi
+if test $ac_cv_header_stdio_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: Can't find stdio.h.
+You must have a usable C system for the target already installed, at least
+including headers and, preferably, the library, before you can configure
+the Objective C runtime system. If necessary, install gcc now with
+\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'." >&5
+echo "$as_me: error: Can't find stdio.h.
+You must have a usable C system for the target already installed, at least
+including headers and, preferably, the library, before you can configure
+the Objective C runtime system. If necessary, install gcc now with
+\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+
+for ac_header in sched.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# -----------
+# Miscellanea
+# -----------
+
+echo "$as_me:$LINENO: checking for thread model used by GCC" >&5
+echo $ECHO_N "checking for thread model used by GCC... $ECHO_C" >&6
+target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+echo "$as_me:$LINENO: result: $target_thread_file" >&5
+echo "${ECHO_T}$target_thread_file" >&6
+
+if test $target_thread_file != single; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GTHR_DEFAULT 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for exception model to use" >&5
+echo $ECHO_N "checking for exception model to use... $ECHO_C" >&6
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
+if test "${enable_sjlj_exceptions+set}" = set; then
+ enableval="$enable_sjlj_exceptions"
+ :
+else
+ cat > conftest.$ac_ext << EOF
+#line 5202 "configure"
+ at interface Frob
+ at end
+ at implementation Frob
+ at end
+int proc();
+int foo()
+{
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ return 0;
+ }
+}
+EOF
+old_CFLAGS="$CFLAGS"
+CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S"
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+fi
+CFLAGS="$old_CFLAGS"
+rm -f conftest*
+fi;
+if test x$enable_sjlj_exceptions = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SJLJ_EXCEPTIONS 1
+_ACEOF
+
+ ac_exception_model_name=sjlj
+elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+else
+ { { echo "$as_me:$LINENO: error: unable to detect exception model" >&5
+echo "$as_me: error: unable to detect exception model" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: result: $ac_exception_model_name" >&5
+echo "${ECHO_T}$ac_exception_model_name" >&6
+
+# ------
+# Output
+# ------
+
+ ac_config_files="$ac_config_files Makefile"
+
+
+ ac_config_commands="$ac_config_commands default"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by package-unused $as_me version-unused, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+package-unused config.status version-unused
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+multi_basedir=${multi_basedir}
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
+
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at build_libsubdir@,$build_libsubdir,;t t
+s, at build_subdir@,$build_subdir,;t t
+s, at host_subdir@,$host_subdir,;t t
+s, at target_subdir@,$target_subdir,;t t
+s, at VERSION@,$VERSION,;t t
+s, at OBJC_BOEHM_GC@,$OBJC_BOEHM_GC,;t t
+s, at OBJC_BOEHM_GC_INCLUDES@,$OBJC_BOEHM_GC_INCLUDES,;t t
+s, at multi_basedir@,$multi_basedir,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at target@,$target,;t t
+s, at target_cpu@,$target_cpu,;t t
+s, at target_vendor@,$target_vendor,;t t
+s, at target_os@,$target_os,;t t
+s, at target_noncanonical@,$target_noncanonical,;t t
+s, at glibcpp_srcdir@,$glibcpp_srcdir,;t t
+s, at toolexecdir@,$toolexecdir,;t t
+s, at toolexeclibdir@,$toolexeclibdir,;t t
+s, at includedirname@,$includedirname,;t t
+s, at libext@,$libext,;t t
+s, at CC@,$CC,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at extra_ldflags_libobjc@,$extra_ldflags_libobjc,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at AS@,$AS,;t t
+s, at ac_ct_AS@,$ac_ct_AS,;t t
+s, at AR@,$AR,;t t
+s, at ac_ct_AR@,$ac_ct_AR,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s, at MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s, at MAINT@,$MAINT,;t t
+s, at LN_S@,$LN_S,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at LIBTOOL@,$LIBTOOL,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at CPP@,$CPP,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at EGREP@,$EGREP,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ default-1 )
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
+ default ) if test -n "$CONFIG_FILES"; then
+ if test -n "${with_target_subdir}"; then
+ # FIXME: We shouldn't need to set ac_file
+ ac_file=Makefile
+ LD="${ORIGINAL_LD_FOR_MULTILIBS}"
+ . ${multi_basedir}/config-ml.in
+ fi
+fi ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
Propchange: llvm-gcc-4.2/trunk/libobjc/configure
------------------------------------------------------------------------------
svn:executable = *
Added: llvm-gcc-4.2/trunk/libobjc/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/configure.ac?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/configure.ac (added)
+++ llvm-gcc-4.2/trunk/libobjc/configure.ac Thu Nov 8 16:56:19 2007
@@ -0,0 +1,296 @@
+# Process this file with autoconf to produce a configure script.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+# 2005, 2006 Free Software Foundation, Inc.
+# Originally contributed by Dave Love (d.love at dl.ac.uk).
+#
+#This file is part of GCC.
+#
+#GCC is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2, or (at your option)
+#any later version.
+#
+#GCC is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING. If not, write to
+#the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+#02110-1301, USA.
+
+AC_PREREQ(2.59)
+AC_INIT(package-unused, version-unused,, libobjc)
+AC_CONFIG_SRCDIR([objc/objc.h])
+GCC_TOPLEV_SUBDIRS
+
+# We need the following definitions because AC_PROG_LIBTOOL relies on them
+PACKAGE=libobjc
+# Version is pulled out to make it a bit easier to change using sed.
+VERSION=2:0:0
+AC_SUBST(VERSION)
+
+# This works around the fact that libtool configuration may change LD
+# for this particular configuration, but some shells, instead of
+# keeping the changes in LD private, export them just because LD is
+# exported.
+ORIGINAL_LD_FOR_MULTILIBS=$LD
+
+# -------
+# Options
+# -------
+
+# We use these options to decide which functions to include.
+AC_ARG_WITH(target-subdir,
+[ --with-target-subdir=SUBDIR
+ configuring in a subdirectory])
+AC_ARG_WITH(cross-host,
+[ --with-cross-host=HOST configuring with a cross compiler])
+
+AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+AC_ARG_ENABLE(version-specific-runtime-libs,
+[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+[version_specific_libs=no])
+AC_MSG_RESULT($version_specific_libs)
+
+AC_ARG_ENABLE(objc-gc,
+[ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime.],
+[case $enable_objc_gc in
+ no)
+ OBJC_BOEHM_GC=''
+ OBJC_BOEHM_GC_INCLUDES=''
+ ;;
+ *)
+ OBJC_BOEHM_GC=libobjc_gc.la
+ OBJC_BOEHM_GC_INCLUDES='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include'
+ ;;
+esac],
+[OBJC_BOEHM_GC=''; OBJC_BOEHM_GC_INCLUDES=''])
+AC_SUBST(OBJC_BOEHM_GC)
+AC_SUBST(OBJC_BOEHM_GC_INCLUDES)
+
+# -----------
+# Directories
+# -----------
+
+# Find the rest of the source tree framework.
+AM_ENABLE_MULTILIB(, ..)
+
+AC_CANONICAL_SYSTEM
+ACX_NONCANONICAL_TARGET
+
+# Export source directory.
+# These need to be absolute paths, yet at the same time need to
+# canonicalize only relative paths, because then amd will not unmount
+# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+case $srcdir in
+ [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
+ *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+esac
+AC_SUBST(glibcpp_srcdir)
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+# Figure out if we want to name the include directory and the
+# library name changes differently.
+includedirname=include
+libext=
+case "${host}" in
+ *-darwin*)
+ # Darwin is the only target so far that needs a different include directory.
+ includedirname=include-gnu-runtime
+ libext=-gnu
+ ;;
+esac
+AC_SUBST(includedirname)
+AC_SUBST(libext)
+
+AC_CONFIG_HEADERS(config.h)
+
+# --------
+# Programs
+# --------
+
+GCC_NO_EXECUTABLES
+
+# We must force CC to /not/ be a precious variable; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+# extra LD Flags which are required for targets
+case "${host}" in
+ *-darwin*)
+ # Darwin needs -single_module when linking libobjc
+ extra_ldflags_libobjc=-Wl,-single_module
+ ;;
+esac
+AC_SUBST(extra_ldflags_libobjc)
+
+AC_SUBST(CFLAGS)
+
+AC_CHECK_TOOL(AS, as)
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_PROG_INSTALL
+
+AM_MAINTAINER_MODE
+
+# Enable Win32 DLL on MS Windows - FIXME
+AC_LIBTOOL_WIN32_DLL
+
+AC_PROG_LIBTOOL
+
+AM_PROG_CC_C_O
+
+AC_PROG_MAKE_SET
+
+# -------
+# Headers
+# -------
+
+# Sanity check for the cross-compilation case:
+AC_CHECK_HEADER(stdio.h,:,
+ [AC_MSG_ERROR([Can't find stdio.h.
+You must have a usable C system for the target already installed, at least
+including headers and, preferably, the library, before you can configure
+the Objective C runtime system. If necessary, install gcc now with
+\`LANGUAGES=c', then the target library, then build with \`LANGUAGES=objc'.])])
+
+AC_HEADER_STDC
+
+AC_CHECK_HEADERS(sched.h)
+
+# -----------
+# Miscellanea
+# -----------
+
+AC_MSG_CHECKING([for thread model used by GCC])
+target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+AC_MSG_RESULT([$target_thread_file])
+
+if test $target_thread_file != single; then
+ AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
+ [Define if the compiler has a thread header that is non single.])
+fi
+
+
+AC_MSG_CHECKING([for exception model to use])
+AC_LANG_PUSH(C)
+AC_ARG_ENABLE(sjlj-exceptions,
+ AS_HELP_STRING([--enable-sjlj-exceptions],
+ [force use of builtin_setjmp for exceptions]),
+[:],
+[dnl Botheration. Now we've got to detect the exception model.
+dnl Link tests against libgcc.a are problematic since -- at least
+dnl as of this writing -- we've not been given proper -L bits for
+dnl single-tree newlib and libgloss.
+dnl
+dnl This is what AC_TRY_COMPILE would do if it didn't delete the
+dnl conftest files before we got a change to grep them first.
+cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+ at interface Frob
+ at end
+ at implementation Frob
+ at end
+int proc();
+int foo()
+{
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ return 0;
+ }
+}
+EOF
+old_CFLAGS="$CFLAGS"
+dnl work around that we don't have Objective-C support in autoconf
+CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S"
+if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+fi
+CFLAGS="$old_CFLAGS"
+rm -f conftest*])
+if test x$enable_sjlj_exceptions = xyes; then
+ AC_DEFINE(SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+else
+ AC_MSG_ERROR([unable to detect exception model])
+fi
+AC_LANG_POP(C)
+AC_MSG_RESULT($ac_exception_model_name)
+
+# ------
+# Output
+# ------
+
+AC_CONFIG_FILES([Makefile])
+
+AC_CONFIG_COMMANDS([default],
+[[if test -n "$CONFIG_FILES"; then
+ if test -n "${with_target_subdir}"; then
+ # FIXME: We shouldn't need to set ac_file
+ ac_file=Makefile
+ LD="${ORIGINAL_LD_FOR_MULTILIBS}"
+ . ${multi_basedir}/config-ml.in
+ fi
+fi]],
+[[srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+multi_basedir=${multi_basedir}
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
+]])
+
+AC_OUTPUT
Added: llvm-gcc-4.2/trunk/libobjc/encoding.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/encoding.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/encoding.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/encoding.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,1104 @@
+/* Encoding of types for Objective C.
+ Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2002, 2004
+ Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+ Bitfield support by Ovidiu Predescu
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+/* FIXME: This file has no business including tm.h. */
+
+#include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "objc/objc-api.h"
+#include "objc/encoding.h"
+#include <stdlib.h>
+
+#undef MAX
+#define MAX(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x > __y ? __x : __y); })
+
+#undef MIN
+#define MIN(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x < __y ? __x : __y); })
+
+#undef ROUND
+#define ROUND(V, A) \
+ ({ typeof (V) __v = (V); typeof (A) __a = (A); \
+ __a * ((__v+__a - 1)/__a); })
+
+
+/* Various hacks for objc_layout_record. These are used by the target
+ macros. */
+
+#define TREE_CODE(TYPE) *(TYPE)
+#define TREE_TYPE(TREE) (TREE)
+
+#define RECORD_TYPE _C_STRUCT_B
+#define UNION_TYPE _C_UNION_B
+#define QUAL_UNION_TYPE _C_UNION_B
+#define ARRAY_TYPE _C_ARY_B
+
+#define REAL_TYPE _C_DBL
+
+#define VECTOR_TYPE _C_VECTOR
+
+#define TYPE_FIELDS(TYPE) ({const char *_field = (TYPE)+1; \
+ while (*_field != _C_STRUCT_E && *_field != _C_STRUCT_B \
+ && *_field != _C_UNION_B && *_field++ != '=') \
+ /* do nothing */; \
+ _field;})
+
+#define DECL_MODE(TYPE) *(TYPE)
+#define TYPE_MODE(TYPE) *(TYPE)
+
+#define DFmode _C_DBL
+
+#define get_inner_array_type(TYPE) ({const char *_field = (TYPE); \
+ while (*_field == _C_ARY_B)\
+ {\
+ while (isdigit ((unsigned char)*++_field))\
+ ;\
+ }\
+ _field;})
+
+/* Some ports (eg ARM) allow the structure size boundary to be
+ selected at compile-time. We override the normal definition with
+ one that has a constant value for this compilation. */
+#ifndef BITS_PER_UNIT
+#define BITS_PER_UNIT 8
+#endif
+#undef STRUCTURE_SIZE_BOUNDARY
+#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (struct{char a;}))
+
+/* Some ROUND_TYPE_ALIGN macros use TARGET_foo, and consequently
+ target_flags. Define a dummy entry here to so we don't die.
+ We have to rename it because target_flags may already have been
+ declared extern. */
+#define target_flags not_target_flags
+static int __attribute__ ((__unused__)) not_target_flags = 0;
+
+/* Some ROUND_TYPE_ALIGN use ALTIVEC_VECTOR_MODE (rs6000 darwin).
+ Define a dummy ALTIVEC_VECTOR_MODE so it will not die. */
+#undef ALTIVEC_VECTOR_MODE
+#define ALTIVEC_VECTOR_MODE(MODE) (0)
+
+
+/* FIXME: while this file has no business including tm.h, this
+ definitely has no business defining this macro but it
+ is only way around without really rewritting this file,
+ should look after the branch of 3.4 to fix this. */
+#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED) \
+ ({ const char *_fields = TYPE_FIELDS (STRUCT); \
+ ((_fields != 0 \
+ && TYPE_MODE (TREE_CODE (TREE_TYPE (_fields)) == ARRAY_TYPE \
+ ? get_inner_array_type (_fields) \
+ : TREE_TYPE (_fields)) == DFmode) \
+ ? MAX (MAX (COMPUTED, SPECIFIED), 64) \
+ : MAX (COMPUTED, SPECIFIED));})
+
+/*
+ return the size of an object specified by type
+*/
+
+int
+objc_sizeof_type (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ switch (*type) {
+ case _C_BOOL:
+ return sizeof (_Bool);
+ break;
+
+ case _C_ID:
+ return sizeof (id);
+ break;
+
+ case _C_CLASS:
+ return sizeof (Class);
+ break;
+
+ case _C_SEL:
+ return sizeof (SEL);
+ break;
+
+ case _C_CHR:
+ return sizeof (char);
+ break;
+
+ case _C_UCHR:
+ return sizeof (unsigned char);
+ break;
+
+ case _C_SHT:
+ return sizeof (short);
+ break;
+
+ case _C_USHT:
+ return sizeof (unsigned short);
+ break;
+
+ case _C_INT:
+ return sizeof (int);
+ break;
+
+ case _C_UINT:
+ return sizeof (unsigned int);
+ break;
+
+ case _C_LNG:
+ return sizeof (long);
+ break;
+
+ case _C_ULNG:
+ return sizeof (unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return sizeof (long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return sizeof (unsigned long long);
+ break;
+
+ case _C_FLT:
+ return sizeof (float);
+ break;
+
+ case _C_DBL:
+ return sizeof (double);
+ break;
+
+ case _C_VOID:
+ return sizeof (void);
+ break;
+
+ case _C_PTR:
+ case _C_ATOM:
+ case _C_CHARPTR:
+ return sizeof (char *);
+ break;
+
+ case _C_ARY_B:
+ {
+ int len = atoi (type + 1);
+ while (isdigit ((unsigned char)*++type))
+ ;
+ return len * objc_aligned_size (type);
+ }
+ break;
+
+ case _C_BFLD:
+ {
+ /* The new encoding of bitfields is: b 'position' 'type' 'size' */
+ int position, size;
+ int startByte, endByte;
+
+ position = atoi (type + 1);
+ while (isdigit ((unsigned char)*++type))
+ ;
+ size = atoi (type + 1);
+
+ startByte = position / BITS_PER_UNIT;
+ endByte = (position + size) / BITS_PER_UNIT;
+ return endByte - startByte;
+ }
+
+ case _C_UNION_B:
+ case _C_STRUCT_B:
+ {
+ struct objc_struct_layout layout;
+ unsigned int size;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ /* do nothing */ ;
+ objc_layout_finish_structure (&layout, &size, NULL);
+
+ return size;
+ }
+
+ case _C_COMPLEX:
+ {
+ type++; /* Skip after the 'j'. */
+ switch (*type)
+ {
+ case _C_CHR:
+ return sizeof (_Complex char);
+ break;
+
+ case _C_UCHR:
+ return sizeof (_Complex unsigned char);
+ break;
+
+ case _C_SHT:
+ return sizeof (_Complex short);
+ break;
+
+ case _C_USHT:
+ return sizeof (_Complex unsigned short);
+ break;
+
+ case _C_INT:
+ return sizeof (_Complex int);
+ break;
+
+ case _C_UINT:
+ return sizeof (_Complex unsigned int);
+ break;
+
+ case _C_LNG:
+ return sizeof (_Complex long);
+ break;
+
+ case _C_ULNG:
+ return sizeof (_Complex unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return sizeof (_Complex long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return sizeof (_Complex unsigned long long);
+ break;
+
+ case _C_FLT:
+ return sizeof (_Complex float);
+ break;
+
+ case _C_DBL:
+ return sizeof (_Complex double);
+ break;
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown complex type %s\n",
+ type);
+ return 0;
+ }
+ }
+ }
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ return 0;
+ }
+ }
+}
+
+
+/*
+ Return the alignment of an object specified by type
+*/
+
+int
+objc_alignof_type (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+ switch (*type) {
+ case _C_BOOL:
+ return __alignof__ (_Bool);
+ break;
+
+ case _C_ID:
+ return __alignof__ (id);
+ break;
+
+ case _C_CLASS:
+ return __alignof__ (Class);
+ break;
+
+ case _C_SEL:
+ return __alignof__ (SEL);
+ break;
+
+ case _C_CHR:
+ return __alignof__ (char);
+ break;
+
+ case _C_UCHR:
+ return __alignof__ (unsigned char);
+ break;
+
+ case _C_SHT:
+ return __alignof__ (short);
+ break;
+
+ case _C_USHT:
+ return __alignof__ (unsigned short);
+ break;
+
+ case _C_INT:
+ return __alignof__ (int);
+ break;
+
+ case _C_UINT:
+ return __alignof__ (unsigned int);
+ break;
+
+ case _C_LNG:
+ return __alignof__ (long);
+ break;
+
+ case _C_ULNG:
+ return __alignof__ (unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return __alignof__ (long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return __alignof__ (unsigned long long);
+ break;
+
+ case _C_FLT:
+ return __alignof__ (float);
+ break;
+
+ case _C_DBL:
+ return __alignof__ (double);
+ break;
+
+ case _C_PTR:
+ case _C_ATOM:
+ case _C_CHARPTR:
+ return __alignof__ (char *);
+ break;
+
+ case _C_ARY_B:
+ while (isdigit ((unsigned char)*++type))
+ /* do nothing */;
+ return objc_alignof_type (type);
+
+ case _C_STRUCT_B:
+ case _C_UNION_B:
+ {
+ struct objc_struct_layout layout;
+ unsigned int align;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ /* do nothing */;
+ objc_layout_finish_structure (&layout, NULL, &align);
+
+ return align;
+ }
+
+
+ case _C_COMPLEX:
+ {
+ type++; /* Skip after the 'j'. */
+ switch (*type)
+ {
+ case _C_CHR:
+ return __alignof__ (_Complex char);
+ break;
+
+ case _C_UCHR:
+ return __alignof__ (_Complex unsigned char);
+ break;
+
+ case _C_SHT:
+ return __alignof__ (_Complex short);
+ break;
+
+ case _C_USHT:
+ return __alignof__ (_Complex unsigned short);
+ break;
+
+ case _C_INT:
+ return __alignof__ (_Complex int);
+ break;
+
+ case _C_UINT:
+ return __alignof__ (_Complex unsigned int);
+ break;
+
+ case _C_LNG:
+ return __alignof__ (_Complex long);
+ break;
+
+ case _C_ULNG:
+ return __alignof__ (_Complex unsigned long);
+ break;
+
+ case _C_LNG_LNG:
+ return __alignof__ (_Complex long long);
+ break;
+
+ case _C_ULNG_LNG:
+ return __alignof__ (_Complex unsigned long long);
+ break;
+
+ case _C_FLT:
+ return __alignof__ (_Complex float);
+ break;
+
+ case _C_DBL:
+ return __alignof__ (_Complex double);
+ break;
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown complex type %s\n",
+ type);
+ return 0;
+ }
+ }
+ }
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ return 0;
+ }
+ }
+}
+
+/*
+ The aligned size if the size rounded up to the nearest alignment.
+*/
+
+int
+objc_aligned_size (const char *type)
+{
+ int size, align;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ size = objc_sizeof_type (type);
+ align = objc_alignof_type (type);
+
+ return ROUND (size, align);
+}
+
+/*
+ The size rounded up to the nearest integral of the wordsize, taken
+ to be the size of a void *.
+*/
+
+int
+objc_promoted_size (const char *type)
+{
+ int size, wordsize;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ size = objc_sizeof_type (type);
+ wordsize = sizeof (void *);
+
+ return ROUND (size, wordsize);
+}
+
+/*
+ Skip type qualifiers. These may eventually precede typespecs
+ occurring in method prototype encodings.
+*/
+
+inline const char *
+objc_skip_type_qualifiers (const char *type)
+{
+ while (*type == _C_CONST
+ || *type == _C_IN
+ || *type == _C_INOUT
+ || *type == _C_OUT
+ || *type == _C_BYCOPY
+ || *type == _C_BYREF
+ || *type == _C_ONEWAY
+ || *type == _C_GCINVISIBLE)
+ {
+ type += 1;
+ }
+ return type;
+}
+
+
+/*
+ Skip one typespec element. If the typespec is prepended by type
+ qualifiers, these are skipped as well.
+*/
+
+const char *
+objc_skip_typespec (const char *type)
+{
+ /* Skip the variable name if any */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ type = objc_skip_type_qualifiers (type);
+
+ switch (*type) {
+
+ case _C_ID:
+ /* An id may be annotated by the actual type if it is known
+ with the @"ClassName" syntax */
+
+ if (*++type != '"')
+ return type;
+ else
+ {
+ while (*++type != '"')
+ /* do nothing */;
+ return type + 1;
+ }
+
+ /* The following are one character type codes */
+ case _C_CLASS:
+ case _C_SEL:
+ case _C_CHR:
+ case _C_UCHR:
+ case _C_CHARPTR:
+ case _C_ATOM:
+ case _C_SHT:
+ case _C_USHT:
+ case _C_INT:
+ case _C_UINT:
+ case _C_LNG:
+ case _C_BOOL:
+ case _C_ULNG:
+ case _C_LNG_LNG:
+ case _C_ULNG_LNG:
+ case _C_FLT:
+ case _C_DBL:
+ case _C_VOID:
+ case _C_UNDEF:
+ return ++type;
+ break;
+
+ case _C_COMPLEX:
+ return type + 2;
+ break;
+
+ case _C_ARY_B:
+ /* skip digits, typespec and closing ']' */
+
+ while (isdigit ((unsigned char)*++type))
+ ;
+ type = objc_skip_typespec (type);
+ if (*type == _C_ARY_E)
+ return ++type;
+ else
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "bad array type %s\n", type);
+ return 0;
+ }
+
+ case _C_BFLD:
+ /* The new encoding of bitfields is: b 'position' 'type' 'size' */
+ while (isdigit ((unsigned char)*++type))
+ ; /* skip position */
+ while (isdigit ((unsigned char)*++type))
+ ; /* skip type and size */
+ return type;
+
+ case _C_STRUCT_B:
+ /* skip name, and elements until closing '}' */
+
+ while (*type != _C_STRUCT_E && *type++ != '=')
+ ;
+ while (*type != _C_STRUCT_E)
+ {
+ type = objc_skip_typespec (type);
+ }
+ return ++type;
+
+ case _C_UNION_B:
+ /* skip name, and elements until closing ')' */
+
+ while (*type != _C_UNION_E && *type++ != '=')
+ ;
+ while (*type != _C_UNION_E)
+ {
+ type = objc_skip_typespec (type);
+ }
+ return ++type;
+
+ case _C_PTR:
+ /* Just skip the following typespec */
+
+ return objc_skip_typespec (++type);
+
+ default:
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE, "unknown type %s\n", type);
+ return 0;
+ }
+ }
+}
+
+/*
+ Skip an offset as part of a method encoding. This is prepended by a
+ '+' if the argument is passed in registers.
+*/
+inline const char *
+objc_skip_offset (const char *type)
+{
+ if (*type == '+')
+ type++;
+ while (isdigit ((unsigned char) *++type))
+ ;
+ return type;
+}
+
+/*
+ Skip an argument specification of a method encoding.
+*/
+const char *
+objc_skip_argspec (const char *type)
+{
+ type = objc_skip_typespec (type);
+ type = objc_skip_offset (type);
+ return type;
+}
+
+/*
+ Return the number of arguments that the method MTH expects.
+ Note that all methods need two implicit arguments `self' and
+ `_cmd'.
+*/
+int
+method_get_number_of_arguments (struct objc_method *mth)
+{
+ int i = 0;
+ const char *type = mth->method_types;
+ while (*type)
+ {
+ type = objc_skip_argspec (type);
+ i += 1;
+ }
+ return i - 1;
+}
+
+/*
+ Return the size of the argument block needed on the stack to invoke
+ the method MTH. This may be zero, if all arguments are passed in
+ registers.
+*/
+
+int
+method_get_sizeof_arguments (struct objc_method *mth)
+{
+ const char *type = objc_skip_typespec (mth->method_types);
+ return atoi (type);
+}
+
+/*
+ Return a pointer to the next argument of ARGFRAME. type points to
+ the last argument. Typical use of this look like:
+
+ {
+ char *datum, *type;
+ for (datum = method_get_first_argument (method, argframe, &type);
+ datum; datum = method_get_next_argument (argframe, &type))
+ {
+ unsigned flags = objc_get_type_qualifiers (type);
+ type = objc_skip_type_qualifiers (type);
+ if (*type != _C_PTR)
+ [portal encodeData: datum ofType: type];
+ else
+ {
+ if ((flags & _F_IN) == _F_IN)
+ [portal encodeData: *(char **) datum ofType: ++type];
+ }
+ }
+ }
+*/
+
+char *
+method_get_next_argument (arglist_t argframe, const char **type)
+{
+ const char *t = objc_skip_argspec (*type);
+
+ if (*t == '\0')
+ return 0;
+
+ *type = t;
+ t = objc_skip_typespec (t);
+
+ if (*t == '+')
+ return argframe->arg_regs + atoi (++t);
+ else
+ return argframe->arg_ptr + atoi (t);
+}
+
+/*
+ Return a pointer to the value of the first argument of the method
+ described in M with the given argumentframe ARGFRAME. The type
+ is returned in TYPE. type must be passed to successive calls of
+ method_get_next_argument.
+*/
+char *
+method_get_first_argument (struct objc_method *m,
+ arglist_t argframe,
+ const char **type)
+{
+ *type = m->method_types;
+ return method_get_next_argument (argframe, type);
+}
+
+/*
+ Return a pointer to the ARGth argument of the method
+ M from the frame ARGFRAME. The type of the argument
+ is returned in the value-result argument TYPE
+*/
+
+char *
+method_get_nth_argument (struct objc_method *m,
+ arglist_t argframe, int arg,
+ const char **type)
+{
+ const char *t = objc_skip_argspec (m->method_types);
+
+ if (arg > method_get_number_of_arguments (m))
+ return 0;
+
+ while (arg--)
+ t = objc_skip_argspec (t);
+
+ *type = t;
+ t = objc_skip_typespec (t);
+
+ if (*t == '+')
+ return argframe->arg_regs + atoi (++t);
+ else
+ return argframe->arg_ptr + atoi (t);
+}
+
+unsigned
+objc_get_type_qualifiers (const char *type)
+{
+ unsigned res = 0;
+ BOOL flag = YES;
+
+ while (flag)
+ switch (*type++)
+ {
+ case _C_CONST: res |= _F_CONST; break;
+ case _C_IN: res |= _F_IN; break;
+ case _C_INOUT: res |= _F_INOUT; break;
+ case _C_OUT: res |= _F_OUT; break;
+ case _C_BYCOPY: res |= _F_BYCOPY; break;
+ case _C_BYREF: res |= _F_BYREF; break;
+ case _C_ONEWAY: res |= _F_ONEWAY; break;
+ case _C_GCINVISIBLE: res |= _F_GCINVISIBLE; break;
+ default: flag = NO;
+ }
+
+ return res;
+}
+
+
+/* The following three functions can be used to determine how a
+ structure is laid out by the compiler. For example:
+
+ struct objc_struct_layout layout;
+ int i;
+
+ objc_layout_structure (type, &layout);
+ while (objc_layout_structure_next_member (&layout))
+ {
+ int position, align;
+ const char *type;
+
+ objc_layout_structure_get_info (&layout, &position, &align, &type);
+ printf ("element %d has offset %d, alignment %d\n",
+ i++, position, align);
+ }
+
+ These functions are used by objc_sizeof_type and objc_alignof_type
+ functions to compute the size and alignment of structures. The
+ previous method of computing the size and alignment of a structure
+ was not working on some architectures, particulary on AIX, and in
+ the presence of bitfields inside the structure. */
+void
+objc_layout_structure (const char *type,
+ struct objc_struct_layout *layout)
+{
+ const char *ntype;
+
+ if (*type != _C_UNION_B && *type != _C_STRUCT_B)
+ {
+ objc_error (nil, OBJC_ERR_BAD_TYPE,
+ "record (or union) type expected in objc_layout_structure, got %s\n",
+ type);
+ }
+
+ type ++;
+ layout->original_type = type;
+
+ /* Skip "<name>=" if any. Avoid embedded structures and unions. */
+ ntype = type;
+ while (*ntype != _C_STRUCT_E && *ntype != _C_STRUCT_B && *ntype != _C_UNION_B
+ && *ntype++ != '=')
+ /* do nothing */;
+
+ /* If there's a "<name>=", ntype - 1 points to '='; skip the the name */
+ if (*(ntype - 1) == '=')
+ type = ntype;
+
+ layout->type = type;
+ layout->prev_type = NULL;
+ layout->record_size = 0;
+ layout->record_align = BITS_PER_UNIT;
+
+ layout->record_align = MAX (layout->record_align, STRUCTURE_SIZE_BOUNDARY);
+}
+
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+#ifdef RS6000_PIC_OFFSET_TABLE_REGNUM
+/* Ick, darwin.h doesn't work anymore... Fix this please. */
+#undef ROUND_TYPE_ALIGN
+#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
+ ((TREE_CODE (STRUCT) == RECORD_TYPE \
+ || TREE_CODE (STRUCT) == UNION_TYPE \
+ || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ && TARGET_ALIGN_NATURAL == 0 \
+ ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
+ : (TREE_CODE (STRUCT) == VECTOR_TYPE \
+ && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \
+ ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
+ : MAX ((COMPUTED), (SPECIFIED)))
+#define OPTION_ALIGN_MAC68K 0
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
+
+BOOL
+objc_layout_structure_next_member (struct objc_struct_layout *layout)
+{
+ register int desired_align = 0;
+
+ /* The following are used only if the field is a bitfield */
+ register const char *bfld_type = 0;
+ register int bfld_type_size, bfld_type_align = 0, bfld_field_size = 0;
+
+ /* The current type without the type qualifiers */
+ const char *type;
+ BOOL unionp = layout->original_type[-1] == _C_UNION_B;
+
+ /* Add the size of the previous field to the size of the record. */
+ if (layout->prev_type)
+ {
+ type = objc_skip_type_qualifiers (layout->prev_type);
+ if (unionp)
+ layout->record_size = MAX (layout->record_size,
+ objc_sizeof_type (type) * BITS_PER_UNIT);
+
+ else if (*type != _C_BFLD)
+ layout->record_size += objc_sizeof_type (type) * BITS_PER_UNIT;
+ else {
+ /* Get the bitfield's type */
+ for (bfld_type = type + 1;
+ isdigit ((unsigned char)*bfld_type);
+ bfld_type++)
+ /* do nothing */;
+
+ bfld_type_size = objc_sizeof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_field_size = atoi (objc_skip_typespec (bfld_type));
+ layout->record_size += bfld_field_size;
+ }
+ }
+
+ if ((unionp && *layout->type == _C_UNION_E)
+ || (!unionp && *layout->type == _C_STRUCT_E))
+ return NO;
+
+ /* Skip the variable name if any */
+ if (*layout->type == '"')
+ {
+ for (layout->type++; *layout->type++ != '"';)
+ /* do nothing */;
+ }
+
+ type = objc_skip_type_qualifiers (layout->type);
+
+ if (*type != _C_BFLD)
+ desired_align = objc_alignof_type (type) * BITS_PER_UNIT;
+ else
+ {
+ desired_align = 1;
+ /* Skip the bitfield's offset */
+ for (bfld_type = type + 1;
+ isdigit ((unsigned char) *bfld_type);
+ bfld_type++)
+ /* do nothing */;
+
+ bfld_type_size = objc_sizeof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_type_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+ bfld_field_size = atoi (objc_skip_typespec (bfld_type));
+ }
+
+#ifdef BIGGEST_FIELD_ALIGNMENT
+ desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT);
+#endif
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+#ifdef ADJUST_FIELD_ALIGN
+ desired_align = ADJUST_FIELD_ALIGN (type, desired_align, layout->prev_type == 0);
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
+
+ /* Record must have at least as much alignment as any field.
+ Otherwise, the alignment of the field within the record
+ is meaningless. */
+#ifndef PCC_BITFIELD_TYPE_MATTERS
+ layout->record_align = MAX (layout->record_align, desired_align);
+#else /* PCC_BITFIELD_TYPE_MATTERS */
+ if (*type == _C_BFLD)
+ {
+ /* For these machines, a zero-length field does not
+ affect the alignment of the structure as a whole.
+ It does, however, affect the alignment of the next field
+ within the structure. */
+ if (bfld_field_size)
+ layout->record_align = MAX (layout->record_align, desired_align);
+ else
+ desired_align = objc_alignof_type (bfld_type) * BITS_PER_UNIT;
+
+ /* A named bit field of declared type `int'
+ forces the entire structure to have `int' alignment.
+ Q1: How is encoded this thing and how to check for it?
+ Q2: How to determine maximum_field_alignment at runtime? */
+
+/* if (DECL_NAME (field) != 0) */
+ {
+ int type_align = bfld_type_align;
+#if 0
+ if (maximum_field_alignment != 0)
+ type_align = MIN (type_align, maximum_field_alignment);
+ else if (DECL_PACKED (field))
+ type_align = MIN (type_align, BITS_PER_UNIT);
+#endif
+
+ layout->record_align = MAX (layout->record_align, type_align);
+ }
+ }
+ else
+ layout->record_align = MAX (layout->record_align, desired_align);
+#endif /* PCC_BITFIELD_TYPE_MATTERS */
+
+ /* Does this field automatically have alignment it needs
+ by virtue of the fields that precede it and the record's
+ own alignment? */
+
+ if (*type == _C_BFLD)
+ layout->record_size = atoi (type + 1);
+ else if (layout->record_size % desired_align != 0)
+ {
+ /* No, we need to skip space before this field.
+ Bump the cumulative size to multiple of field alignment. */
+ layout->record_size = ROUND (layout->record_size, desired_align);
+ }
+
+ /* Jump to the next field in record. */
+
+ layout->prev_type = layout->type;
+ layout->type = objc_skip_typespec (layout->type); /* skip component */
+
+ return YES;
+}
+
+
+void objc_layout_finish_structure (struct objc_struct_layout *layout,
+ unsigned int *size,
+ unsigned int *align)
+{
+ BOOL unionp = layout->original_type[-1] == _C_UNION_B;
+ if (layout->type
+ && ((!unionp && *layout->type == _C_STRUCT_E)
+ || (unionp && *layout->type == _C_UNION_E)))
+ {
+ /* Work out the alignment of the record as one expression and store
+ in the record type. Round it up to a multiple of the record's
+ alignment. */
+#if defined (ROUND_TYPE_ALIGN) && ! defined (__sparc__)
+/* APPLE LOCAL libobjc MAC68K */
+#define OPTION_ALIGN_MAC68K 0
+ layout->record_align = ROUND_TYPE_ALIGN (layout->original_type-1,
+ 1,
+ layout->record_align);
+#else
+ layout->record_align = MAX (1, layout->record_align);
+#endif
+
+#ifdef ROUND_TYPE_SIZE
+ layout->record_size = ROUND_TYPE_SIZE (layout->original_type,
+ layout->record_size,
+ layout->record_align);
+#else
+ /* Round the size up to be a multiple of the required alignment */
+ layout->record_size = ROUND (layout->record_size, layout->record_align);
+#endif
+
+ layout->type = NULL;
+ }
+ if (size)
+ *size = layout->record_size / BITS_PER_UNIT;
+ if (align)
+ *align = layout->record_align / BITS_PER_UNIT;
+}
+
+
+void objc_layout_structure_get_info (struct objc_struct_layout *layout,
+ unsigned int *offset,
+ unsigned int *align,
+ const char **type)
+{
+ if (offset)
+ *offset = layout->record_size / BITS_PER_UNIT;
+ if (align)
+ *align = layout->record_align / BITS_PER_UNIT;
+ if (type)
+ *type = layout->prev_type;
+}
Added: llvm-gcc-4.2/trunk/libobjc/exception.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/exception.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/exception.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/exception.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,376 @@
+/* The implementation of exception handling primitives for Objective-C.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#include <stdlib.h>
+#include "config.h"
+#include "objc/objc-api.h"
+#include "unwind.h"
+#include "unwind-pe.h"
+
+
+/* This is the exception class we report -- "GNUCOBJC". */
+#define __objc_exception_class \
+ ((((((((_Unwind_Exception_Class) 'G' \
+ << 8 | (_Unwind_Exception_Class) 'N') \
+ << 8 | (_Unwind_Exception_Class) 'U') \
+ << 8 | (_Unwind_Exception_Class) 'C') \
+ << 8 | (_Unwind_Exception_Class) 'O') \
+ << 8 | (_Unwind_Exception_Class) 'B') \
+ << 8 | (_Unwind_Exception_Class) 'J') \
+ << 8 | (_Unwind_Exception_Class) 'C')
+
+/* This is the object that is passed around by the Objective C runtime
+ to represent the exception in flight. */
+
+struct ObjcException
+{
+ /* This bit is needed in order to interact with the unwind runtime. */
+ struct _Unwind_Exception base;
+
+ /* The actual object we want to throw. */
+ id value;
+
+ /* Cache some internal unwind data between phase 1 and phase 2. */
+ _Unwind_Ptr landingPad;
+ int handlerSwitchValue;
+};
+
+
+
+struct lsda_header_info
+{
+ _Unwind_Ptr Start;
+ _Unwind_Ptr LPStart;
+ _Unwind_Ptr ttype_base;
+ const unsigned char *TType;
+ const unsigned char *action_table;
+ unsigned char ttype_encoding;
+ unsigned char call_site_encoding;
+};
+
+static const unsigned char *
+parse_lsda_header (struct _Unwind_Context *context, const unsigned char *p,
+ struct lsda_header_info *info)
+{
+ _Unwind_Word tmp;
+ unsigned char lpstart_encoding;
+
+ info->Start = (context ? _Unwind_GetRegionStart (context) : 0);
+
+ /* Find @LPStart, the base to which landing pad offsets are relative. */
+ lpstart_encoding = *p++;
+ if (lpstart_encoding != DW_EH_PE_omit)
+ p = read_encoded_value (context, lpstart_encoding, p, &info->LPStart);
+ else
+ info->LPStart = info->Start;
+
+ /* Find @TType, the base of the handler and exception spec type data. */
+ info->ttype_encoding = *p++;
+ if (info->ttype_encoding != DW_EH_PE_omit)
+ {
+ p = read_uleb128 (p, &tmp);
+ info->TType = p + tmp;
+ }
+ else
+ info->TType = 0;
+
+ /* The encoding and length of the call-site table; the action table
+ immediately follows. */
+ info->call_site_encoding = *p++;
+ p = read_uleb128 (p, &tmp);
+ info->action_table = p + tmp;
+
+ return p;
+}
+
+static Class
+get_ttype_entry (struct lsda_header_info *info, _Unwind_Word i)
+{
+ _Unwind_Ptr ptr;
+
+ i *= size_of_encoded_value (info->ttype_encoding);
+ read_encoded_value_with_base (info->ttype_encoding, info->ttype_base,
+ info->TType - i, &ptr);
+
+ /* NULL ptr means catch-all. */
+ if (ptr)
+ return objc_get_class ((const char *) ptr);
+ else
+ return 0;
+}
+
+/* Like unto the method of the same name on Object, but takes an id. */
+/* ??? Does this bork the meta-type system? Can/should we look up an
+ isKindOf method on the id? */
+
+static int
+isKindOf (id value, Class target)
+{
+ Class c;
+
+ /* NULL target is catch-all. */
+ if (target == 0)
+ return 1;
+
+ for (c = value->class_pointer; c; c = class_get_super_class (c))
+ if (c == target)
+ return 1;
+ return 0;
+}
+
+/* Using a different personality function name causes link failures
+ when trying to mix code using different exception handling models. */
+#ifdef SJLJ_EXCEPTIONS
+#define PERSONALITY_FUNCTION __gnu_objc_personality_sj0
+#define __builtin_eh_return_data_regno(x) x
+#else
+#define PERSONALITY_FUNCTION __gnu_objc_personality_v0
+#endif
+
+_Unwind_Reason_Code
+PERSONALITY_FUNCTION (int version,
+ _Unwind_Action actions,
+ _Unwind_Exception_Class exception_class,
+ struct _Unwind_Exception *ue_header,
+ struct _Unwind_Context *context)
+{
+ struct ObjcException *xh = (struct ObjcException *) ue_header;
+
+ struct lsda_header_info info;
+ const unsigned char *language_specific_data;
+ const unsigned char *action_record;
+ const unsigned char *p;
+ _Unwind_Ptr landing_pad, ip;
+ int handler_switch_value;
+ int saw_cleanup = 0, saw_handler;
+ void *return_object;
+
+ /* Interface version check. */
+ if (version != 1)
+ return _URC_FATAL_PHASE1_ERROR;
+
+ /* Shortcut for phase 2 found handler for domestic exception. */
+ if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME)
+ && exception_class == __objc_exception_class)
+ {
+ handler_switch_value = xh->handlerSwitchValue;
+ landing_pad = xh->landingPad;
+ goto install_context;
+ }
+
+ language_specific_data = (const unsigned char *)
+ _Unwind_GetLanguageSpecificData (context);
+
+ /* If no LSDA, then there are no handlers or cleanups. */
+ if (! language_specific_data)
+ return _URC_CONTINUE_UNWIND;
+
+ /* Parse the LSDA header. */
+ p = parse_lsda_header (context, language_specific_data, &info);
+ info.ttype_base = base_of_encoded_value (info.ttype_encoding, context);
+ ip = _Unwind_GetIP (context) - 1;
+ landing_pad = 0;
+ action_record = 0;
+ handler_switch_value = 0;
+
+#ifdef SJLJ_EXCEPTIONS
+ /* The given "IP" is an index into the call-site table, with two
+ exceptions -- -1 means no-action, and 0 means terminate. But
+ since we're using uleb128 values, we've not got random access
+ to the array. */
+ if ((int) ip < 0)
+ return _URC_CONTINUE_UNWIND;
+ else
+ {
+ _Unwind_Word cs_lp, cs_action;
+ do
+ {
+ p = read_uleb128 (p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+ }
+ while (--ip);
+
+ /* Can never have null landing pad for sjlj -- that would have
+ been indicated by a -1 call site index. */
+ landing_pad = cs_lp + 1;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
+#else
+ /* Search the call-site table for the action associated with this IP. */
+ while (p < info.action_table)
+ {
+ _Unwind_Ptr cs_start, cs_len, cs_lp;
+ _Unwind_Word cs_action;
+
+ /* Note that all call-site encodings are "absolute" displacements. */
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_start);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_len);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+
+ /* The table is sorted, so if we've passed the ip, stop. */
+ if (ip < info.Start + cs_start)
+ p = info.action_table;
+ else if (ip < info.Start + cs_start + cs_len)
+ {
+ if (cs_lp)
+ landing_pad = info.LPStart + cs_lp;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
+ }
+#endif /* SJLJ_EXCEPTIONS */
+
+ /* If ip is not present in the table, C++ would call terminate. */
+ /* ??? As with Java, it's perhaps better to tweek the LSDA to
+ that no-action is mapped to no-entry. */
+ return _URC_CONTINUE_UNWIND;
+
+ found_something:
+ saw_cleanup = 0;
+ saw_handler = 0;
+
+ if (landing_pad == 0)
+ {
+ /* If ip is present, and has a null landing pad, there are
+ no cleanups or handlers to be run. */
+ }
+ else if (action_record == 0)
+ {
+ /* If ip is present, has a non-null landing pad, and a null
+ action table offset, then there are only cleanups present.
+ Cleanups use a zero switch value, as set above. */
+ saw_cleanup = 1;
+ }
+ else
+ {
+ /* Otherwise we have a catch handler. */
+ _Unwind_Sword ar_filter, ar_disp;
+
+ while (1)
+ {
+ p = action_record;
+ p = read_sleb128 (p, &ar_filter);
+ read_sleb128 (p, &ar_disp);
+
+ if (ar_filter == 0)
+ {
+ /* Zero filter values are cleanups. */
+ saw_cleanup = 1;
+ }
+
+ /* During forced unwinding, we only run cleanups. With a
+ foreign exception class, we have no class info to match. */
+ else if ((actions & _UA_FORCE_UNWIND)
+ || exception_class != __objc_exception_class)
+ ;
+
+ else if (ar_filter > 0)
+ {
+ /* Positive filter values are handlers. */
+
+ Class catch_type = get_ttype_entry (&info, ar_filter);
+
+ if (isKindOf (xh->value, catch_type))
+ {
+ handler_switch_value = ar_filter;
+ saw_handler = 1;
+ break;
+ }
+ }
+ else
+ {
+ /* Negative filter values are exception specifications,
+ which Objective-C does not use. */
+ abort ();
+ }
+
+ if (ar_disp == 0)
+ break;
+ action_record = p + ar_disp;
+ }
+ }
+
+ if (! saw_handler && ! saw_cleanup)
+ return _URC_CONTINUE_UNWIND;
+
+ if (actions & _UA_SEARCH_PHASE)
+ {
+ if (!saw_handler)
+ return _URC_CONTINUE_UNWIND;
+
+ /* For domestic exceptions, we cache data from phase 1 for phase 2. */
+ if (exception_class == __objc_exception_class)
+ {
+ xh->handlerSwitchValue = handler_switch_value;
+ xh->landingPad = landing_pad;
+ }
+ return _URC_HANDLER_FOUND;
+ }
+
+ install_context:
+ if (saw_cleanup == 0)
+ {
+ return_object = xh->value;
+ if (!(actions & _UA_SEARCH_PHASE))
+ _Unwind_DeleteException(&xh->base);
+ }
+
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
+ __builtin_extend_pointer (saw_cleanup ? xh : return_object));
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
+ handler_switch_value);
+ _Unwind_SetIP (context, landing_pad);
+ return _URC_INSTALL_CONTEXT;
+}
+
+static void
+__objc_exception_cleanup (_Unwind_Reason_Code code __attribute__((unused)),
+ struct _Unwind_Exception *exc)
+{
+ free (exc);
+}
+
+void
+objc_exception_throw (id value)
+{
+ struct ObjcException *header = calloc (1, sizeof (*header));
+ header->base.exception_class = __objc_exception_class;
+ header->base.exception_cleanup = __objc_exception_cleanup;
+ header->value = value;
+
+#ifdef SJLJ_EXCEPTIONS
+ _Unwind_SjLj_RaiseException (&header->base);
+#else
+ _Unwind_RaiseException (&header->base);
+#endif
+
+ /* Some sort of unwinding error. */
+ abort ();
+}
Added: llvm-gcc-4.2/trunk/libobjc/gc.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/gc.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/gc.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/gc.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,454 @@
+/* Basic data types for Objective C.
+ Copyright (C) 1998, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Contributed by Ovidiu Predescu.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#include "tconfig.h"
+#include "objc/objc.h"
+#include "objc/encoding.h"
+
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if OBJC_WITH_GC
+
+#include <gc.h>
+#include <limits.h>
+
+/* gc_typed.h uses the following but doesn't declare them */
+typedef GC_word word;
+typedef GC_signed_word signed_word;
+#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
+
+#include <gc_typed.h>
+
+/* The following functions set up in `mask` the corresponding pointers.
+ The offset is incremented with the size of the type. */
+
+#define ROUND(V, A) \
+ ({ typeof (V) __v = (V); typeof (A) __a = (A); \
+ __a * ((__v+__a - 1)/__a); })
+
+#define SET_BIT_FOR_OFFSET(mask, offset) \
+ GC_set_bit (mask, offset / sizeof (void *))
+
+/* Some prototypes */
+static void
+__objc_gc_setup_struct (GC_bitmap mask, const char *type, int offset);
+static void
+__objc_gc_setup_union (GC_bitmap mask, const char *type, int offset);
+
+
+static void
+__objc_gc_setup_array (GC_bitmap mask, const char *type, int offset)
+{
+ int i, len = atoi (type + 1);
+
+ while (isdigit (*++type))
+ /* do nothing */; /* skip the size of the array */
+
+ switch (*type) {
+ case _C_ARY_B:
+ for (i = 0; i < len; i++)
+ __objc_gc_setup_array (mask, type, offset);
+ break;
+
+ case _C_STRUCT_B:
+ for (i = 0; i < len; i++)
+ __objc_gc_setup_struct (mask, type, offset);
+ break;
+
+ case _C_UNION_B:
+ for (i = 0; i < len; i++)
+ __objc_gc_setup_union (mask, type, offset);
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void
+__objc_gc_setup_struct (GC_bitmap mask, const char *type, int offset)
+{
+ struct objc_struct_layout layout;
+ unsigned int position;
+ const char *mtype;
+
+ objc_layout_structure (type, &layout);
+
+ while (objc_layout_structure_next_member (&layout))
+ {
+ BOOL gc_invisible = NO;
+
+ objc_layout_structure_get_info (&layout, &position, NULL, &mtype);
+
+ /* Skip the variable name */
+ if (*mtype == '"')
+ {
+ for (mtype++; *mtype++ != '"';)
+ /* do nothing */;
+ }
+
+ if (*mtype == _C_GCINVISIBLE)
+ {
+ gc_invisible = YES;
+ mtype++;
+ }
+
+ /* Add to position the offset of this structure */
+ position += offset;
+
+ switch (*mtype) {
+ case _C_ID:
+ case _C_CLASS:
+ case _C_SEL:
+ case _C_PTR:
+ case _C_CHARPTR:
+ case _C_ATOM:
+ if (! gc_invisible)
+ SET_BIT_FOR_OFFSET (mask, position);
+ break;
+
+ case _C_ARY_B:
+ __objc_gc_setup_array (mask, mtype, position);
+ break;
+
+ case _C_STRUCT_B:
+ __objc_gc_setup_struct (mask, mtype, position);
+ break;
+
+ case _C_UNION_B:
+ __objc_gc_setup_union (mask, mtype, position);
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+static void
+__objc_gc_setup_union (GC_bitmap mask, const char *type, int offset)
+{
+ /* Sub-optimal, quick implementation: assume the union is made of
+ pointers, set up the mask accordingly. */
+
+ int i, size, align;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ size = objc_sizeof_type (type);
+ align = objc_alignof_type (type);
+
+ offset = ROUND (offset, align);
+ for (i = 0; i < size; i += sizeof (void *))
+ {
+ SET_BIT_FOR_OFFSET (mask, offset);
+ offset += sizeof (void *);
+ }
+}
+
+
+/* Iterates over the types in the structure that represents the class
+ encoding and sets the bits in mask according to each ivar type. */
+static void
+__objc_gc_type_description_from_type (GC_bitmap mask, const char *type)
+{
+ struct objc_struct_layout layout;
+ unsigned int offset, align;
+ const char *ivar_type;
+
+ objc_layout_structure (type, &layout);
+
+ while (objc_layout_structure_next_member (&layout))
+ {
+ BOOL gc_invisible = NO;
+
+ objc_layout_structure_get_info (&layout, &offset, &align, &ivar_type);
+
+ /* Skip the variable name */
+ if (*ivar_type == '"')
+ {
+ for (ivar_type++; *ivar_type++ != '"';)
+ /* do nothing */;
+ }
+
+ if (*ivar_type == _C_GCINVISIBLE)
+ {
+ gc_invisible = YES;
+ ivar_type++;
+ }
+
+ switch (*ivar_type) {
+ case _C_ID:
+ case _C_CLASS:
+ case _C_SEL:
+ case _C_PTR:
+ case _C_CHARPTR:
+ if (! gc_invisible)
+ SET_BIT_FOR_OFFSET (mask, offset);
+ break;
+
+ case _C_ARY_B:
+ __objc_gc_setup_array (mask, ivar_type, offset);
+ break;
+
+ case _C_STRUCT_B:
+ __objc_gc_setup_struct (mask, ivar_type, offset);
+ break;
+
+ case _C_UNION_B:
+ __objc_gc_setup_union (mask, ivar_type, offset);
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+/* Computes in *type the full type encoding of this class including
+ its super classes. '*size' gives the total number of bytes allocated
+ into *type, '*current' the number of bytes used so far by the
+ encoding. */
+static void
+__objc_class_structure_encoding (Class class, char **type, int *size,
+ int *current)
+{
+ int i, ivar_count;
+ struct objc_ivar_list *ivars;
+
+ if (! class)
+ {
+ strcat (*type, "{");
+ (*current)++;
+ return;
+ }
+
+ /* Add the type encodings of the super classes */
+ __objc_class_structure_encoding (class->super_class, type, size, current);
+
+ ivars = class->ivars;
+ if (! ivars)
+ return;
+
+ ivar_count = ivars->ivar_count;
+
+ for (i = 0; i < ivar_count; i++)
+ {
+ struct objc_ivar *ivar = &(ivars->ivar_list[i]);
+ const char *ivar_type = ivar->ivar_type;
+ int len = strlen (ivar_type);
+
+ if (*current + len + 1 >= *size)
+ {
+ /* Increase the size of the encoding string so that it
+ contains this ivar's type. */
+ *size = ROUND (*current + len + 1, 10);
+ *type = objc_realloc (*type, *size);
+ }
+ strcat (*type + *current, ivar_type);
+ *current += len;
+ }
+}
+
+
+/* Allocates the memory that will hold the type description for class
+ and calls the __objc_class_structure_encoding that generates this
+ value. */
+void
+__objc_generate_gc_type_description (Class class)
+{
+ GC_bitmap mask;
+ int bits_no, size;
+ int type_size = 10, current;
+ char *class_structure_type;
+
+ if (! CLS_ISCLASS (class))
+ return;
+
+ /* We have to create a mask in which each bit counts for a pointer member.
+ We take into consideration all the non-pointer instance variables and we
+ round them up to the alignment. */
+
+ /* The number of bits in the mask is the size of an instance in bytes divided
+ by the size of a pointer. */
+ bits_no = (ROUND (class_get_instance_size (class), sizeof (void *))
+ / sizeof (void *));
+ size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD;
+ mask = objc_atomic_malloc (size * sizeof (int));
+ memset (mask, 0, size * sizeof (int));
+
+ class_structure_type = objc_atomic_malloc (type_size);
+ *class_structure_type = current = 0;
+ __objc_class_structure_encoding (class, &class_structure_type,
+ &type_size, ¤t);
+ if (current + 1 == type_size)
+ class_structure_type = objc_realloc (class_structure_type, ++type_size);
+ strcat (class_structure_type + current, "}");
+#ifdef DEBUG
+ printf ("type description for '%s' is %s\n", class->name, class_structure_type);
+#endif
+
+ __objc_gc_type_description_from_type (mask, class_structure_type);
+ objc_free (class_structure_type);
+
+#ifdef DEBUG
+ printf (" mask for '%s', type '%s' (bits %d, mask size %d) is:",
+ class_structure_type, class->name, bits_no, size);
+ {
+ int i;
+ for (i = 0; i < size; i++)
+ printf (" %lx", mask[i]);
+ }
+ puts ("");
+#endif
+
+ class->gc_object_type = (void *) GC_make_descriptor (mask, bits_no);
+}
+
+
+/* Returns YES if type denotes a pointer type, NO otherwise */
+static inline BOOL
+__objc_ivar_pointer (const char *type)
+{
+ type = objc_skip_type_qualifiers (type);
+
+ return (*type == _C_ID
+ || *type == _C_CLASS
+ || *type == _C_SEL
+ || *type == _C_PTR
+ || *type == _C_CHARPTR
+ || *type == _C_ATOM);
+}
+
+
+/* Mark the instance variable whose name is given by ivarname as a
+ weak pointer (a pointer hidden to the garbage collector) if
+ gc_invisible is true. If gc_invisible is false it unmarks the
+ instance variable and makes it a normal pointer, visible to the
+ garbage collector.
+
+ This operation only makes sense on instance variables that are
+ pointers. */
+void
+class_ivar_set_gcinvisible (Class class, const char *ivarname,
+ BOOL gc_invisible)
+{
+ int i, ivar_count;
+ struct objc_ivar_list *ivars;
+
+ if (! class || ! ivarname)
+ return;
+
+ ivars = class->ivars;
+ if (! ivars)
+ return;
+
+ ivar_count = ivars->ivar_count;
+
+ for (i = 0; i < ivar_count; i++)
+ {
+ struct objc_ivar *ivar = &(ivars->ivar_list[i]);
+ const char *type;
+
+ if (! ivar->ivar_name || strcmp (ivar->ivar_name, ivarname))
+ continue;
+
+ assert (ivar->ivar_type);
+ type = ivar->ivar_type;
+
+ /* Skip the variable name */
+ if (*type == '"')
+ {
+ for (type++; *type++ != '"';)
+ /* do nothing */;
+ }
+
+ if (*type == _C_GCINVISIBLE)
+ {
+ char *new_type;
+ size_t len;
+
+ if (gc_invisible || ! __objc_ivar_pointer (type))
+ return; /* The type of the variable already matches the
+ requested gc_invisible type */
+
+ /* The variable is gc_invisible so we make it gc visible. */
+ new_type = objc_atomic_malloc (strlen(ivar->ivar_type));
+ len = (type - ivar->ivar_type);
+ memcpy (new_type, ivar->ivar_type, len);
+ new_type[len] = 0;
+ strcat (new_type, type + 1);
+ ivar->ivar_type = new_type;
+ }
+ else
+ {
+ char *new_type;
+ size_t len;
+
+ if (! gc_invisible || ! __objc_ivar_pointer (type))
+ return; /* The type of the variable already matches the
+ requested gc_invisible type */
+
+ /* The variable is gc visible so we make it gc_invisible. */
+ new_type = objc_malloc (strlen(ivar->ivar_type) + 2);
+ len = (type - ivar->ivar_type);
+ memcpy (new_type, ivar->ivar_type, len);
+ new_type[len] = 0;
+ strcat (new_type, "!");
+ strcat (new_type, type);
+ ivar->ivar_type = new_type;
+ }
+
+ __objc_generate_gc_type_description (class);
+ return;
+ }
+
+ /* Search the instance variable in the superclasses */
+ class_ivar_set_gcinvisible (class->super_class, ivarname, gc_invisible);
+}
+
+#else /* !OBJC_WITH_GC */
+
+void
+__objc_generate_gc_type_description (Class class __attribute__ ((__unused__)))
+{
+}
+
+void class_ivar_set_gcinvisible (Class class __attribute__ ((__unused__)),
+ const char *ivarname __attribute__ ((__unused__)),
+ BOOL gc_invisible __attribute__ ((__unused__)))
+{
+}
+
+#endif /* OBJC_WITH_GC */
Added: llvm-gcc-4.2/trunk/libobjc/hash.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/hash.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/hash.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/hash.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,283 @@
+/* Hash tables for Objective C internal structures
+ Copyright (C) 1993, 1996, 1997, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#include "assert.h"
+
+#include "objc/hash.h"
+
+#include "objc/runtime.h" /* for DEBUG_PRINTF */
+
+/* These two macros determine when a hash table is full and
+ by how much it should be expanded respectively.
+
+ These equations are percentages. */
+#define FULLNESS(cache) \
+ ((((cache)->size * 75) / 100) <= (cache)->used)
+#define EXPANSION(cache) \
+ ((cache)->size * 2)
+
+cache_ptr
+objc_hash_new (unsigned int size, hash_func_type hash_func,
+ compare_func_type compare_func)
+{
+ cache_ptr cache;
+
+ /* Pass me a value greater than 0 and a power of 2. */
+ assert (size);
+ assert (! (size & (size - 1)));
+
+ /* Allocate the cache structure. calloc insures
+ its initialization for default values. */
+ cache = (cache_ptr) objc_calloc (1, sizeof (struct cache));
+ assert (cache);
+
+ /* Allocate the array of buckets for the cache.
+ calloc initializes all of the pointers to NULL. */
+ cache->node_table
+ = (node_ptr *) objc_calloc (size, sizeof (node_ptr));
+ assert (cache->node_table);
+
+ cache->size = size;
+
+ /* This should work for all processor architectures? */
+ cache->mask = (size - 1);
+
+ /* Store the hashing function so that codes can be computed. */
+ cache->hash_func = hash_func;
+
+ /* Store the function that compares hash keys to
+ determine if they are equal. */
+ cache->compare_func = compare_func;
+
+ return cache;
+}
+
+
+void
+objc_hash_delete (cache_ptr cache)
+{
+ node_ptr node;
+ node_ptr next_node;
+ unsigned int i;
+
+ /* Purge all key/value pairs from the table. */
+ /* Step through the nodes one by one and remove every node WITHOUT
+ using objc_hash_next. this makes objc_hash_delete much more efficient. */
+ for (i = 0;i < cache->size;i++) {
+ if ((node = cache->node_table[i])) {
+ /* an entry in the hash table has been found, now step through the
+ nodes next in the list and free them. */
+ while ((next_node = node->next)) {
+ objc_hash_remove (cache,node->key);
+ node = next_node;
+ }
+
+ objc_hash_remove (cache,node->key);
+ }
+ }
+
+ /* Release the array of nodes and the cache itself. */
+ objc_free(cache->node_table);
+ objc_free(cache);
+}
+
+
+void
+objc_hash_add (cache_ptr *cachep, const void *key, void *value)
+{
+ size_t indx = (*(*cachep)->hash_func)(*cachep, key);
+ node_ptr node = (node_ptr) objc_calloc (1, sizeof (struct cache_node));
+
+
+ assert (node);
+
+ /* Initialize the new node. */
+ node->key = key;
+ node->value = value;
+ node->next = (*cachep)->node_table[indx];
+
+ /* Debugging.
+ Check the list for another key. */
+#ifdef DEBUG
+ { node_ptr node1 = (*cachep)->node_table[indx];
+
+ while (node1) {
+
+ assert (node1->key != key);
+ node1 = node1->next;
+ }
+ }
+#endif
+
+ /* Install the node as the first element on the list. */
+ (*cachep)->node_table[indx] = node;
+
+ /* Bump the number of entries in the cache. */
+ ++(*cachep)->used;
+
+ /* Check the hash table's fullness. We're going
+ to expand if it is above the fullness level. */
+ if (FULLNESS (*cachep)) {
+
+ /* The hash table has reached its fullness level. Time to
+ expand it.
+
+ I'm using a slow method here but is built on other
+ primitive functions thereby increasing its
+ correctness. */
+ node_ptr node1 = NULL;
+ cache_ptr new = objc_hash_new (EXPANSION (*cachep),
+ (*cachep)->hash_func,
+ (*cachep)->compare_func);
+
+ DEBUG_PRINTF ("Expanding cache %#x from %d to %d\n",
+ (int) *cachep, (*cachep)->size, new->size);
+
+ /* Copy the nodes from the first hash table to the new one. */
+ while ((node1 = objc_hash_next (*cachep, node1)))
+ objc_hash_add (&new, node1->key, node1->value);
+
+ /* Trash the old cache. */
+ objc_hash_delete (*cachep);
+
+ /* Return a pointer to the new hash table. */
+ *cachep = new;
+ }
+}
+
+
+void
+objc_hash_remove (cache_ptr cache, const void *key)
+{
+ size_t indx = (*cache->hash_func)(cache, key);
+ node_ptr node = cache->node_table[indx];
+
+
+ /* We assume there is an entry in the table. Error if it is not. */
+ assert (node);
+
+ /* Special case. First element is the key/value pair to be removed. */
+ if ((*cache->compare_func)(node->key, key)) {
+ cache->node_table[indx] = node->next;
+ objc_free(node);
+ } else {
+
+ /* Otherwise, find the hash entry. */
+ node_ptr prev = node;
+ BOOL removed = NO;
+
+ do {
+
+ if ((*cache->compare_func)(node->key, key)) {
+ prev->next = node->next, removed = YES;
+ objc_free(node);
+ } else
+ prev = node, node = node->next;
+ } while (! removed && node);
+ assert (removed);
+ }
+
+ /* Decrement the number of entries in the hash table. */
+ --cache->used;
+}
+
+
+node_ptr
+objc_hash_next (cache_ptr cache, node_ptr node)
+{
+ /* If the scan is being started then reset the last node
+ visitied pointer and bucket index. */
+ if (! node)
+ cache->last_bucket = 0;
+
+ /* If there is a node visited last then check for another
+ entry in the same bucket; Otherwise step to the next bucket. */
+ if (node) {
+ if (node->next)
+ /* There is a node which follows the last node
+ returned. Step to that node and retun it. */
+ return node->next;
+ else
+ ++cache->last_bucket;
+ }
+
+ /* If the list isn't exhausted then search the buckets for
+ other nodes. */
+ if (cache->last_bucket < cache->size) {
+ /* Scan the remainder of the buckets looking for an entry
+ at the head of the list. Return the first item found. */
+ while (cache->last_bucket < cache->size)
+ if (cache->node_table[cache->last_bucket])
+ return cache->node_table[cache->last_bucket];
+ else
+ ++cache->last_bucket;
+
+ /* No further nodes were found in the hash table. */
+ return NULL;
+ } else
+ return NULL;
+}
+
+
+/* Given KEY, return corresponding value for it in CACHE.
+ Return NULL if the KEY is not recorded. */
+
+void *
+objc_hash_value_for_key (cache_ptr cache, const void *key)
+{
+ node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
+ void *retval = NULL;
+
+ if (node)
+ do {
+ if ((*cache->compare_func)(node->key, key)) {
+ retval = node->value;
+ break;
+ } else
+ node = node->next;
+ } while (! retval && node);
+
+ return retval;
+}
+
+/* Given KEY, return YES if it exists in the CACHE.
+ Return NO if it does not */
+
+BOOL
+objc_hash_is_key_in_hash (cache_ptr cache, const void *key)
+{
+ node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];
+
+ if (node)
+ do {
+ if ((*cache->compare_func)(node->key, key))
+ return YES;
+ else
+ node = node->next;
+ } while (node);
+
+ return NO;
+}
Added: llvm-gcc-4.2/trunk/libobjc/init.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/init.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/init.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/init.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,894 @@
+/* GNU Objective C Runtime initialization
+ Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+ +load support contributed by Ovidiu Predescu <ovidiu at net-community.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/runtime.h"
+
+/* The version number of this runtime. This must match the number
+ defined in gcc (objc-act.c). */
+#define OBJC_VERSION 8
+#define PROTOCOL_VERSION 2
+
+/* This list contains all modules currently loaded into the runtime. */
+static struct objc_list *__objc_module_list = 0; /* !T:MUTEX */
+
+/* This list contains all proto_list's not yet assigned class links. */
+static struct objc_list *unclaimed_proto_list = 0; /* !T:MUTEX */
+
+/* List of unresolved static instances. */
+static struct objc_list *uninitialized_statics = 0; /* !T:MUTEX */
+
+/* Global runtime "write" mutex. */
+objc_mutex_t __objc_runtime_mutex = 0;
+
+/* Number of threads that are alive. */
+int __objc_runtime_threads_alive = 1; /* !T:MUTEX */
+
+/* Check compiler vs runtime version. */
+static void init_check_module_version (Module_t);
+
+/* Assign isa links to protos. */
+static void __objc_init_protocols (struct objc_protocol_list *protos);
+
+/* Add protocol to class. */
+static void __objc_class_add_protocols (Class, struct objc_protocol_list *);
+
+/* This is a hook which is called by __objc_exec_class every time a
+ class or a category is loaded into the runtime. This may e.g. help
+ a dynamic loader determine the classes that have been loaded when
+ an object file is dynamically linked in. */
+void (*_objc_load_callback) (Class class, Category *category); /* !T:SAFE */
+
+/* Is all categories/classes resolved? */
+BOOL __objc_dangling_categories = NO; /* !T:UNUSED */
+
+extern SEL
+__sel_register_typed_name (const char *name, const char *types,
+ struct objc_selector *orig, BOOL is_const);
+
+/* Sends +load to all classes and categories in certain situations. */
+static void objc_send_load (void);
+
+/* Inserts all the classes defined in module in a tree of classes that
+ resembles the class hierarchy. This tree is traversed in preorder
+ and the classes in its nodes receive the +load message if these
+ methods were not executed before. The algorithm ensures that when
+ the +load method of a class is executed all the superclasses have
+ been already received the +load message. */
+static void __objc_create_classes_tree (Module_t module);
+
+static void __objc_call_callback (Module_t module);
+
+/* A special version that works only before the classes are completely
+ installed in the runtime. */
+static BOOL class_is_subclass_of_class (Class class, Class superclass);
+
+typedef struct objc_class_tree {
+ Class class;
+ struct objc_list *subclasses; /* `head' is pointer to an objc_class_tree */
+} objc_class_tree;
+
+/* This is a linked list of objc_class_tree trees. The head of these
+ trees are root classes (their super class is Nil). These different
+ trees represent different class hierarchies. */
+static struct objc_list *__objc_class_tree_list = NULL;
+
+/* Keeps the +load methods who have been already executed. This hash
+ should not be destroyed during the execution of the program. */
+static cache_ptr __objc_load_methods = NULL;
+
+/* This function is used when building the class tree used to send
+ ordinately the +load message to all classes needing it. The tree
+ is really needed so that superclasses will get the message before
+ subclasses.
+
+ This tree will contain classes which are being loaded (or have just
+ being loaded), and whose super_class pointers have not yet been
+ resolved. This implies that their super_class pointers point to a
+ string with the name of the superclass; when the first message is
+ sent to the class (/an object of that class) the class links will
+ be resolved, which will replace the super_class pointers with
+ pointers to the actual superclasses.
+
+ Unfortunately, the tree might also contain classes which had been
+ loaded previously, and whose class links have already been
+ resolved.
+
+ This function returns the superclass of a class in both cases, and
+ can be used to build the determine the class relationships while
+ building the tree.
+*/
+static Class class_superclass_of_class (Class class)
+{
+ char *super_class_name;
+
+ /* If the class links have been resolved, use the resolved
+ * links. */
+ if (CLS_ISRESOLV (class))
+ return class->super_class;
+
+ /* Else, 'class' has not yet been resolved. This means that its
+ * super_class pointer is really the name of the super class (rather
+ * than a pointer to the actual superclass). */
+ super_class_name = (char *)class->super_class;
+
+ /* Return Nil for a root class. */
+ if (super_class_name == NULL)
+ return Nil;
+
+ /* Lookup the superclass of non-root classes. */
+ return objc_lookup_class (super_class_name);
+}
+
+
+/* Creates a tree of classes whose topmost class is directly inherited
+ from `upper' and the bottom class in this tree is
+ `bottom_class'. The classes in this tree are super classes of
+ `bottom_class'. `subclasses' member of each tree node point to the
+ next subclass tree node. */
+
+static objc_class_tree *
+create_tree_of_subclasses_inherited_from (Class bottom_class, Class upper)
+{
+ Class superclass = bottom_class->super_class ?
+ objc_lookup_class ((char *) bottom_class->super_class)
+ : Nil;
+
+ objc_class_tree *tree, *prev;
+
+ DEBUG_PRINTF ("create_tree_of_subclasses_inherited_from:");
+ DEBUG_PRINTF ("bottom_class = %s, upper = %s\n",
+ (bottom_class ? bottom_class->name : NULL),
+ (upper ? upper->name : NULL));
+
+ tree = prev = objc_calloc (1, sizeof (objc_class_tree));
+ prev->class = bottom_class;
+
+ while (superclass != upper)
+ {
+ tree = objc_calloc (1, sizeof (objc_class_tree));
+ tree->class = superclass;
+ tree->subclasses = list_cons (prev, tree->subclasses);
+ superclass = class_superclass_of_class (superclass);
+ prev = tree;
+ }
+
+ return tree;
+}
+
+/* Insert the `class' into the proper place in the `tree' class
+ hierarchy. This function returns a new tree if the class has been
+ successfully inserted into the tree or NULL if the class is not
+ part of the classes hierarchy described by `tree'. This function is
+ private to objc_tree_insert_class (), you should not call it
+ directly. */
+
+static objc_class_tree *
+__objc_tree_insert_class (objc_class_tree *tree, Class class)
+{
+ DEBUG_PRINTF ("__objc_tree_insert_class: tree = %x, class = %s\n",
+ tree, class->name);
+
+ if (tree == NULL)
+ return create_tree_of_subclasses_inherited_from (class, NULL);
+ else if (class == tree->class)
+ {
+ /* `class' has been already inserted */
+ DEBUG_PRINTF ("1. class %s was previously inserted\n", class->name);
+ return tree;
+ }
+ else if (class_superclass_of_class (class) == tree->class)
+ {
+ /* If class is a direct subclass of tree->class then add class to the
+ list of subclasses. First check to see if it wasn't already
+ inserted. */
+ struct objc_list *list = tree->subclasses;
+ objc_class_tree *node;
+
+ while (list)
+ {
+ /* Class has been already inserted; do nothing just return
+ the tree. */
+ if (((objc_class_tree *) list->head)->class == class)
+ {
+ DEBUG_PRINTF ("2. class %s was previously inserted\n",
+ class->name);
+ return tree;
+ }
+ list = list->tail;
+ }
+
+ /* Create a new node class and insert it into the list of subclasses */
+ node = objc_calloc (1, sizeof (objc_class_tree));
+ node->class = class;
+ tree->subclasses = list_cons (node, tree->subclasses);
+ DEBUG_PRINTF ("3. class %s inserted\n", class->name);
+ return tree;
+ }
+ else
+ {
+ /* The class is not a direct subclass of tree->class. Search for
+ class's superclasses in the list of subclasses. */
+ struct objc_list *subclasses = tree->subclasses;
+
+ /* Precondition: the class must be a subclass of tree->class;
+ otherwise return NULL to indicate our caller that it must
+ take the next tree. */
+ if (! class_is_subclass_of_class (class, tree->class))
+ return NULL;
+
+ for (; subclasses != NULL; subclasses = subclasses->tail)
+ {
+ Class aClass = ((objc_class_tree *) (subclasses->head))->class;
+
+ if (class_is_subclass_of_class (class, aClass))
+ {
+ /* If we found one of class's superclasses we insert the
+ class into its subtree and return the original tree
+ since nothing has been changed. */
+ subclasses->head
+ = __objc_tree_insert_class (subclasses->head, class);
+ DEBUG_PRINTF ("4. class %s inserted\n", class->name);
+ return tree;
+ }
+ }
+
+ /* We haven't found a subclass of `class' in the `subclasses'
+ list. Create a new tree of classes whose topmost class is a
+ direct subclass of tree->class. */
+ {
+ objc_class_tree *new_tree
+ = create_tree_of_subclasses_inherited_from (class, tree->class);
+ tree->subclasses = list_cons (new_tree, tree->subclasses);
+ DEBUG_PRINTF ("5. class %s inserted\n", class->name);
+ return tree;
+ }
+ }
+}
+
+/* This function inserts `class' in the right tree hierarchy classes. */
+
+static void
+objc_tree_insert_class (Class class)
+{
+ struct objc_list *list_node;
+ objc_class_tree *tree;
+
+ list_node = __objc_class_tree_list;
+ while (list_node)
+ {
+ tree = __objc_tree_insert_class (list_node->head, class);
+ if (tree)
+ {
+ list_node->head = tree;
+ break;
+ }
+ else
+ list_node = list_node->tail;
+ }
+
+ /* If the list was finished but the class hasn't been inserted,
+ insert it here. */
+ if (! list_node)
+ {
+ __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
+ __objc_class_tree_list->head = __objc_tree_insert_class (NULL, class);
+ }
+}
+
+/* Traverse tree in preorder. Used to send +load. */
+
+static void
+objc_preorder_traverse (objc_class_tree *tree,
+ int level,
+ void (*function) (objc_class_tree *, int))
+{
+ struct objc_list *node;
+
+ (*function) (tree, level);
+ for (node = tree->subclasses; node; node = node->tail)
+ objc_preorder_traverse (node->head, level + 1, function);
+}
+
+/* Traverse tree in postorder. Used to destroy a tree. */
+
+static void
+objc_postorder_traverse (objc_class_tree *tree,
+ int level,
+ void (*function) (objc_class_tree *, int))
+{
+ struct objc_list *node;
+
+ for (node = tree->subclasses; node; node = node->tail)
+ objc_postorder_traverse (node->head, level + 1, function);
+ (*function) (tree, level);
+}
+
+/* Used to print a tree class hierarchy. */
+
+#ifdef DEBUG
+static void
+__objc_tree_print (objc_class_tree *tree, int level)
+{
+ int i;
+
+ for (i = 0; i < level; i++)
+ printf (" ");
+ printf ("%s\n", tree->class->name);
+}
+#endif
+
+/* Walks on a linked list of methods in the reverse order and executes
+ all the methods corresponding to `op' selector. Walking in the
+ reverse order assures the +load of class is executed first and then
+ +load of categories because of the way in which categories are
+ added to the class methods. */
+
+static void
+__objc_send_message_in_list (MethodList_t method_list, Class class, SEL op)
+{
+ int i;
+
+ if (! method_list)
+ return;
+
+ /* First execute the `op' message in the following method lists */
+ __objc_send_message_in_list (method_list->method_next, class, op);
+
+ /* Search the method list. */
+ for (i = 0; i < method_list->method_count; i++)
+ {
+ Method_t mth = &method_list->method_list[i];
+
+ if (mth->method_name && sel_eq (mth->method_name, op)
+ && ! objc_hash_is_key_in_hash (__objc_load_methods, mth->method_imp))
+ {
+ /* Add this method into the +load hash table */
+ objc_hash_add (&__objc_load_methods,
+ mth->method_imp,
+ mth->method_imp);
+
+ DEBUG_PRINTF ("sending +load in class: %s\n", class->name);
+
+ /* The method was found and wasn't previously executed. */
+ (*mth->method_imp) ((id)class, mth->method_name);
+
+ break;
+ }
+ }
+}
+
+static void
+__objc_send_load (objc_class_tree *tree,
+ int level __attribute__ ((__unused__)))
+{
+ static SEL load_sel = 0;
+ Class class = tree->class;
+ MethodList_t method_list = class->class_pointer->methods;
+
+ if (! load_sel)
+ load_sel = sel_register_name ("load");
+
+ __objc_send_message_in_list (method_list, class, load_sel);
+}
+
+static void
+__objc_destroy_class_tree_node (objc_class_tree *tree,
+ int level __attribute__ ((__unused__)))
+{
+ objc_free (tree);
+}
+
+/* This is used to check if the relationship between two classes
+ before the runtime completely installs the classes. */
+
+static BOOL
+class_is_subclass_of_class (Class class, Class superclass)
+{
+ for (; class != Nil;)
+ {
+ if (class == superclass)
+ return YES;
+ class = class_superclass_of_class (class);
+ }
+
+ return NO;
+}
+
+/* This list contains all the classes in the runtime system for whom
+ their superclasses are not yet known to the runtime. */
+static struct objc_list *unresolved_classes = 0;
+
+/* Extern function used to reference the Object and NXConstantString
+ classes. */
+
+extern void __objc_force_linking (void);
+
+void
+__objc_force_linking (void)
+{
+ extern void __objc_linking (void);
+ __objc_linking ();
+}
+
+/* Run through the statics list, removing modules as soon as all its
+ statics have been initialized. */
+
+static void
+objc_init_statics (void)
+{
+ struct objc_list **cell = &uninitialized_statics;
+ struct objc_static_instances **statics_in_module;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ while (*cell)
+ {
+ int module_initialized = 1;
+
+ for (statics_in_module = (*cell)->head;
+ *statics_in_module; statics_in_module++)
+ {
+ struct objc_static_instances *statics = *statics_in_module;
+ Class class = objc_lookup_class (statics->class_name);
+
+ if (! class)
+ module_initialized = 0;
+ /* Actually, the static's class_pointer will be NULL when we
+ haven't been here before. However, the comparison is to be
+ reminded of taking into account class posing and to think about
+ possible semantics... */
+ else if (class != statics->instances[0]->class_pointer)
+ {
+ id *inst;
+
+ for (inst = &statics->instances[0]; *inst; inst++)
+ {
+ (*inst)->class_pointer = class;
+
+ /* ??? Make sure the object will not be freed. With
+ refcounting, invoke `-retain'. Without refcounting, do
+ nothing and hope that `-free' will never be invoked. */
+
+ /* ??? Send the object an `-initStatic' or something to
+ that effect now or later on? What are the semantics of
+ statically allocated instances, besides the trivial
+ NXConstantString, anyway? */
+ }
+ }
+ }
+ if (module_initialized)
+ {
+ /* Remove this module from the uninitialized list. */
+ struct objc_list *this = *cell;
+ *cell = this->tail;
+ objc_free (this);
+ }
+ else
+ cell = &(*cell)->tail;
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+} /* objc_init_statics */
+
+/* This function is called by constructor functions generated for each
+ module compiled. (_GLOBAL_$I$...) The purpose of this function is
+ to gather the module pointers so that they may be processed by the
+ initialization routines as soon as possible. */
+
+void
+__objc_exec_class (Module_t module)
+{
+ /* Have we processed any constructors previously? This flag is used to
+ indicate that some global data structures need to be built. */
+ static BOOL previous_constructors = 0;
+
+ static struct objc_list *unclaimed_categories = 0;
+
+ /* The symbol table (defined in objc-api.h) generated by gcc */
+ Symtab_t symtab = module->symtab;
+
+ /* The statics in this module */
+ struct objc_static_instances **statics
+ = symtab->defs[symtab->cls_def_cnt + symtab->cat_def_cnt];
+
+ /* Entry used to traverse hash lists */
+ struct objc_list **cell;
+
+ /* The table of selector references for this module */
+ SEL selectors = symtab->refs;
+
+ /* dummy counter */
+ int i;
+
+ DEBUG_PRINTF ("received module: %s\n", module->name);
+
+ /* check gcc version */
+ init_check_module_version (module);
+
+ /* On the first call of this routine, initialize some data structures. */
+ if (! previous_constructors)
+ {
+ /* Initialize thread-safe system */
+ __objc_init_thread_system ();
+ __objc_runtime_threads_alive = 1;
+ __objc_runtime_mutex = objc_mutex_allocate ();
+
+ __objc_init_selector_tables ();
+ __objc_init_class_tables ();
+ __objc_init_dispatch_tables ();
+ __objc_class_tree_list = list_cons (NULL, __objc_class_tree_list);
+ __objc_load_methods = objc_hash_new (128,
+ (hash_func_type)objc_hash_ptr,
+ objc_compare_ptrs);
+ previous_constructors = 1;
+ }
+
+ /* Save the module pointer for later processing. (not currently used) */
+ objc_mutex_lock (__objc_runtime_mutex);
+ __objc_module_list = list_cons (module, __objc_module_list);
+
+ /* Replace referenced selectors from names to SEL's. */
+ if (selectors)
+ {
+ for (i = 0; selectors[i].sel_id; ++i)
+ {
+ const char *name, *type;
+ name = (char *) selectors[i].sel_id;
+ type = (char *) selectors[i].sel_types;
+ /* Constructors are constant static data so we can safely store
+ pointers to them in the runtime structures. is_const == YES */
+ __sel_register_typed_name (name, type,
+ (struct objc_selector *) &(selectors[i]),
+ YES);
+ }
+ }
+
+ /* Parse the classes in the load module and gather selector information. */
+ DEBUG_PRINTF ("gathering selectors from module: %s\n", module->name);
+ for (i = 0; i < symtab->cls_def_cnt; ++i)
+ {
+ Class class = (Class) symtab->defs[i];
+ const char *superclass = (char *) class->super_class;
+
+ /* Make sure we have what we think. */
+ assert (CLS_ISCLASS (class));
+ assert (CLS_ISMETA (class->class_pointer));
+ DEBUG_PRINTF ("phase 1, processing class: %s\n", class->name);
+
+ /* Initialize the subclass list to be NULL.
+ In some cases it isn't and this crashes the program. */
+ class->subclass_list = NULL;
+
+ /* Store the class in the class table and assign class numbers. */
+ __objc_add_class_to_hash (class);
+
+ /* Register all of the selectors in the class and meta class. */
+ __objc_register_selectors_from_class (class);
+ __objc_register_selectors_from_class ((Class) class->class_pointer);
+
+ /* Install the fake dispatch tables */
+ __objc_install_premature_dtable (class);
+ __objc_install_premature_dtable (class->class_pointer);
+
+ /* Register the instance methods as class methods, this is
+ only done for root classes. */
+ __objc_register_instance_methods_to_class (class);
+
+ if (class->protocols)
+ __objc_init_protocols (class->protocols);
+
+ /* Check to see if the superclass is known in this point. If it's not
+ add the class to the unresolved_classes list. */
+ if (superclass && ! objc_lookup_class (superclass))
+ unresolved_classes = list_cons (class, unresolved_classes);
+ }
+
+ /* Process category information from the module. */
+ for (i = 0; i < symtab->cat_def_cnt; ++i)
+ {
+ Category_t category = symtab->defs[i + symtab->cls_def_cnt];
+ Class class = objc_lookup_class (category->class_name);
+
+ /* If the class for the category exists then append its methods. */
+ if (class)
+ {
+
+ DEBUG_PRINTF ("processing categories from (module,object): %s, %s\n",
+ module->name,
+ class->name);
+
+ /* Do instance methods. */
+ if (category->instance_methods)
+ class_add_method_list (class, category->instance_methods);
+
+ /* Do class methods. */
+ if (category->class_methods)
+ class_add_method_list ((Class) class->class_pointer,
+ category->class_methods);
+
+ if (category->protocols)
+ {
+ __objc_init_protocols (category->protocols);
+ __objc_class_add_protocols (class, category->protocols);
+ }
+
+ /* Register the instance methods as class methods, this is
+ only done for root classes. */
+ __objc_register_instance_methods_to_class (class);
+ }
+ else
+ {
+ /* The object to which the category methods belong can't be found.
+ Save the information. */
+ unclaimed_categories = list_cons (category, unclaimed_categories);
+ }
+ }
+
+ if (statics)
+ uninitialized_statics = list_cons (statics, uninitialized_statics);
+ if (uninitialized_statics)
+ objc_init_statics ();
+
+ /* Scan the unclaimed category hash. Attempt to attach any unclaimed
+ categories to objects. */
+ for (cell = &unclaimed_categories; *cell; )
+ {
+ Category_t category = (*cell)->head;
+ Class class = objc_lookup_class (category->class_name);
+
+ if (class)
+ {
+ DEBUG_PRINTF ("attaching stored categories to object: %s\n",
+ class->name);
+
+ list_remove_head (cell);
+
+ if (category->instance_methods)
+ class_add_method_list (class, category->instance_methods);
+
+ if (category->class_methods)
+ class_add_method_list ((Class) class->class_pointer,
+ category->class_methods);
+
+ if (category->protocols)
+ {
+ __objc_init_protocols (category->protocols);
+ __objc_class_add_protocols (class, category->protocols);
+ }
+
+ /* Register the instance methods as class methods, this is
+ only done for root classes. */
+ __objc_register_instance_methods_to_class (class);
+ }
+ else
+ cell = &(*cell)->tail;
+ }
+
+ if (unclaimed_proto_list && objc_lookup_class ("Protocol"))
+ {
+ list_mapcar (unclaimed_proto_list,
+ (void (*) (void *))__objc_init_protocols);
+ list_free (unclaimed_proto_list);
+ unclaimed_proto_list = 0;
+ }
+
+ objc_send_load ();
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+static void
+objc_send_load (void)
+{
+ if (! __objc_module_list)
+ return;
+
+ /* Try to find out if all the classes loaded so far also have their
+ superclasses known to the runtime. We suppose that the objects
+ that are allocated in the +load method are in general of a class
+ declared in the same module. */
+ if (unresolved_classes)
+ {
+ Class class = unresolved_classes->head;
+
+ while (objc_lookup_class ((char *) class->super_class))
+ {
+ list_remove_head (&unresolved_classes);
+ if (unresolved_classes)
+ class = unresolved_classes->head;
+ else
+ break;
+ }
+
+ /* If we still have classes for whom we don't have yet their
+ super classes known to the runtime we don't send the +load
+ messages. */
+ if (unresolved_classes)
+ return;
+ }
+
+ /* Special check to allow creating and sending messages to constant
+ strings in +load methods. If these classes are not yet known,
+ even if all the other classes are known, delay sending of +load. */
+ if (! objc_lookup_class ("NXConstantString") ||
+ ! objc_lookup_class ("Object"))
+ return;
+
+ /* Iterate over all modules in the __objc_module_list and call on
+ them the __objc_create_classes_tree function. This function
+ creates a tree of classes that resembles the class hierarchy. */
+ list_mapcar (__objc_module_list,
+ (void (*) (void *)) __objc_create_classes_tree);
+
+ while (__objc_class_tree_list)
+ {
+#ifdef DEBUG
+ objc_preorder_traverse (__objc_class_tree_list->head,
+ 0, __objc_tree_print);
+#endif
+ objc_preorder_traverse (__objc_class_tree_list->head,
+ 0, __objc_send_load);
+ objc_postorder_traverse (__objc_class_tree_list->head,
+ 0, __objc_destroy_class_tree_node);
+ list_remove_head (&__objc_class_tree_list);
+ }
+
+ list_mapcar (__objc_module_list, (void (*) (void *)) __objc_call_callback);
+ list_free (__objc_module_list);
+ __objc_module_list = NULL;
+}
+
+static void
+__objc_create_classes_tree (Module_t module)
+{
+ /* The runtime mutex is locked in this point */
+
+ Symtab_t symtab = module->symtab;
+ int i;
+
+ /* Iterate thru classes defined in this module and insert them in
+ the classes tree hierarchy. */
+ for (i = 0; i < symtab->cls_def_cnt; i++)
+ {
+ Class class = (Class) symtab->defs[i];
+
+ objc_tree_insert_class (class);
+ }
+}
+
+static void
+__objc_call_callback (Module_t module)
+{
+ /* The runtime mutex is locked in this point. */
+
+ Symtab_t symtab = module->symtab;
+ int i;
+
+ /* Iterate thru classes defined in this module and call the callback
+ for each one. */
+ for (i = 0; i < symtab->cls_def_cnt; i++)
+ {
+ Class class = (Class) symtab->defs[i];
+
+ /* Call the _objc_load_callback for this class. */
+ if (_objc_load_callback)
+ _objc_load_callback (class, 0);
+ }
+
+ /* Call the _objc_load_callback for categories. Don't register the
+ instance methods as class methods for categories to root classes
+ since they were already added in the class. */
+ for (i = 0; i < symtab->cat_def_cnt; i++)
+ {
+ Category_t category = symtab->defs[i + symtab->cls_def_cnt];
+ Class class = objc_lookup_class (category->class_name);
+
+ if (_objc_load_callback)
+ _objc_load_callback (class, category);
+ }
+}
+
+/* Sanity check the version of gcc used to compile `module'. */
+
+static void
+init_check_module_version (Module_t module)
+{
+ if ((module->version != OBJC_VERSION) || (module->size != sizeof (Module)))
+ {
+ int code;
+
+ if (module->version > OBJC_VERSION)
+ code = OBJC_ERR_OBJC_VERSION;
+ else if (module->version < OBJC_VERSION)
+ code = OBJC_ERR_GCC_VERSION;
+ else
+ code = OBJC_ERR_MODULE_SIZE;
+
+ objc_error (nil, code, "Module %s version %d doesn't match runtime %d\n",
+ module->name, (int)module->version, OBJC_VERSION);
+ }
+}
+
+static void
+__objc_init_protocols (struct objc_protocol_list *protos)
+{
+ size_t i;
+ static Class proto_class = 0;
+
+ if (! protos)
+ return;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ if (! proto_class)
+ proto_class = objc_lookup_class ("Protocol");
+
+ if (! proto_class)
+ {
+ unclaimed_proto_list = list_cons (protos, unclaimed_proto_list);
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return;
+ }
+
+#if 0
+ assert (protos->next == 0); /* only single ones allowed */
+#endif
+
+ for (i = 0; i < protos->count; i++)
+ {
+ struct objc_protocol *aProto = protos->list[i];
+ if (((size_t)aProto->class_pointer) == PROTOCOL_VERSION)
+ {
+ /* assign class pointer */
+ aProto->class_pointer = proto_class;
+
+ /* init super protocols */
+ __objc_init_protocols (aProto->protocol_list);
+ }
+ else if (protos->list[i]->class_pointer != proto_class)
+ {
+ objc_error (nil, OBJC_ERR_PROTOCOL_VERSION,
+ "Version %d doesn't match runtime protocol version %d\n",
+ (int) ((char *) protos->list[i]->class_pointer
+ - (char *) 0),
+ PROTOCOL_VERSION);
+ }
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+static void
+__objc_class_add_protocols (Class class, struct objc_protocol_list *protos)
+{
+ /* Well... */
+ if (! protos)
+ return;
+
+ /* Add it... */
+ protos->next = class->protocols;
+ class->protocols = protos;
+}
Added: llvm-gcc-4.2/trunk/libobjc/libobjc.def
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/libobjc.def?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/libobjc.def (added)
+++ llvm-gcc-4.2/trunk/libobjc/libobjc.def Thu Nov 8 16:56:19 2007
@@ -0,0 +1,170 @@
+; GNU Objective C Runtime DLL Export Definitions
+; Copyright (C) 1997 Free Software Foundation, Inc.
+; Contributed by Scott Christley <scottc at net-community.com>
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under the
+; terms of the GNU General Public License as published by the Free Software
+; Foundation; either version 2, or (at your option) any later version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+; details.
+;
+; You should have received a copy of the GNU General Public License along with
+; GCC; see the file COPYING. If not, write to the Free Software
+; Foundation, 51 Franklin Street, Fifth Floor,
+; Boston, MA 02110-1301, USA.
+
+LIBRARY libobjc
+EXPORTS
+search_for_method_in_list
+objc_get_uninstalled_dtable
+objc_hash_is_key_in_hash
+hash_is_key_in_hash
+objc_verror
+_objc_load_callback
+objc_malloc
+objc_atomic_malloc
+objc_valloc
+objc_realloc
+objc_calloc
+objc_free
+__objc_init_thread_system
+objc_mutex_allocate
+objc_mutex_deallocate
+objc_mutex_lock
+objc_mutex_trylock
+objc_mutex_unlock
+objc_thread_detach
+objc_thread_exit
+objc_thread_get_data
+objc_thread_get_priority
+objc_thread_id
+objc_thread_set_data
+objc_thread_set_priority
+objc_thread_yield
+objc_thread_add
+objc_thread_remove
+__objc_class_name_Object
+__objc_class_name_Protocol
+__objc_class_name_NXConstantString
+objc_error
+__objc_object_alloc
+__objc_object_copy
+__objc_object_dispose
+class_create_instance
+object_copy
+object_dispose
+__objc_init_selector_tables
+__objc_register_selectors_from_class
+__sel_register_typed_name
+sel_get_any_typed_uid
+sel_get_any_uid
+sel_get_name
+sel_get_type
+sel_get_typed_uid
+sel_get_uid
+sel_is_mapped
+sel_register_name
+sel_register_typed_name
+sel_types_match
+method_get_first_argument
+method_get_next_argument
+method_get_nth_argument
+method_get_number_of_arguments
+method_get_sizeof_arguments
+objc_aligned_size
+objc_alignof_type
+objc_get_type_qualifiers
+objc_promoted_size
+objc_sizeof_type
+objc_skip_argspec
+objc_skip_offset
+objc_skip_type_qualifiers
+objc_skip_typespec
+__objc_read_nbyte_uint
+__objc_read_nbyte_ulong
+__objc_write_class
+__objc_write_object
+__objc_write_selector
+objc_close_typed_stream
+objc_end_of_typed_stream
+objc_flush_typed_stream
+objc_get_stream_class_version
+objc_open_typed_stream
+objc_open_typed_stream_for_file
+objc_read_array
+objc_read_char
+objc_read_int
+objc_read_long
+objc_read_object
+objc_read_selector
+objc_read_short
+objc_read_string
+objc_read_type
+objc_read_types
+objc_read_unsigned_char
+objc_read_unsigned_int
+objc_read_unsigned_long
+objc_read_unsigned_short
+objc_write_array
+objc_write_char
+objc_write_int
+objc_write_long
+objc_write_object
+objc_write_object_reference
+objc_write_root_object
+objc_write_selector
+objc_write_short
+objc_write_string
+objc_write_string_atomic
+objc_write_type
+objc_write_types
+objc_write_unsigned_char
+objc_write_unsigned_int
+objc_write_unsigned_long
+objc_write_unsigned_short
+__objc_exec_class
+__objc_init_dispatch_tables
+__objc_install_premature_dtable
+__objc_print_dtable_stats
+__objc_responds_to
+__objc_update_dispatch_table_for_class
+class_add_method_list
+class_get_class_method
+class_get_instance_method
+get_imp
+nil_method
+objc_msg_lookup
+objc_msg_lookup_super
+objc_msg_sendv
+__objc_add_class_to_hash
+__objc_init_class_tables
+__objc_resolve_class_links
+class_pose_as
+objc_get_class
+objc_get_meta_class
+objc_lookup_class
+objc_next_class
+sarray_at_put
+sarray_at_put_safe
+sarray_free
+sarray_lazy_copy
+sarray_new
+sarray_realloc
+sarray_remove_garbage
+objc_hash_add
+hash_add
+objc_hash_delete
+hash_delete
+objc_hash_new
+hash_new
+objc_hash_next
+hash_next
+objc_hash_remove
+hash_remove
+objc_hash_value_for_key
+hash_value_for_key
Added: llvm-gcc-4.2/trunk/libobjc/libobjc_entry.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/libobjc_entry.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/libobjc_entry.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/libobjc_entry.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,55 @@
+/* GNU Objective C Runtime DLL Entry
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Contributed by Scott Christley <scottc at net-community.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <windows.h>
+
+/*
+ DLL entry function for Objective-C Runtime library
+ This function gets called everytime a process/thread attaches to DLL
+ */
+WINBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call,
+ LPVOID lpReserved)
+{
+ switch(ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+/*
+ This section terminates the list of imports under GCC. If you do not
+ include this then you will have problems when linking with DLLs.
+ */
+asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
Added: llvm-gcc-4.2/trunk/libobjc/linking.m
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/linking.m?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/linking.m (added)
+++ llvm-gcc-4.2/trunk/libobjc/linking.m Thu Nov 8 16:56:19 2007
@@ -0,0 +1,40 @@
+/* Force linking of classes required by Objective C runtime.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ Contributed by Ovidiu Predescu (ovidiu at net-community.com).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <objc/Object.h>
+#include <objc/NXConstStr.h>
+
+/* Generate references to Object and NXConstanstString classes since they are
+ needed by the runtime system to run correctly. */
+
+
+void __objc_linking (void)
+{
+ [Object name];
+ [NXConstantString name];
+}
+
Added: llvm-gcc-4.2/trunk/libobjc/makefile.dos
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/makefile.dos?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/makefile.dos (added)
+++ llvm-gcc-4.2/trunk/libobjc/makefile.dos Thu Nov 8 16:56:19 2007
@@ -0,0 +1,56 @@
+# GNU Objective C Runtime Makefile for compiling with djgpp
+# Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+#
+# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GCC; see the file COPYING. If not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# This Makefile is configured for GnuMAKE
+
+GCC_FOR_TARGET=gcc
+
+.SUFFIXES: .o .m
+
+OPTIMIZE = -O2
+
+# Always search these dirs when compiling.
+SUBDIR_INCLUDES = -I. -I.. -I../config
+
+.c.o:
+ $(GCC_FOR_TARGET) $(OPTIMIZE) \
+ -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
+
+.m.o:
+ $(GCC_FOR_TARGET) $(OPTIMIZE) -fgnu-runtime \
+ -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $<
+
+OBJC_O = hash.o sarray.o class.o sendmsg.o init.o archive.o \
+ selector.o objects.o misc.o object.o protocol.o encoding.o thread.o
+
+libobjc.a: $(OBJC_O)
+ -rm -f libobjc.a
+ ar rc libobjc.a $(OBJC_O)
+ ranlib libobjc.a
+
+OBJC_H = hash.h objc-list.h sarray.h objc.h \
+ objc-api.h \
+ object.h protocol.h mutex.h \
+ typedstream.h thread.h
+
+mostlyclean:
+ -rm -f *.o libobjc.a xforward fflags
+clean: mostlyclean
+distclean: mostlyclean
+extraclean: mostlyclean
Added: llvm-gcc-4.2/trunk/libobjc/misc.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/misc.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/misc.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/misc.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,185 @@
+/* GNU Objective C Runtime Miscellaneous
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 2002
+ Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#define __USE_FIXED_PROTOTYPES__
+#include <stdlib.h>
+#include "objc/runtime.h"
+
+/*
+** Error handler function
+** NULL so that default is to just print to stderr
+*/
+static objc_error_handler _objc_error_handler = NULL;
+
+/* Trigger an objc error */
+void
+objc_error (id object, int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start (ap, fmt);
+ objc_verror (object, code, fmt, ap);
+ va_end (ap);
+}
+
+/* Trigger an objc error */
+void
+objc_verror (id object, int code, const char *fmt, va_list ap)
+{
+ BOOL result = NO;
+
+ /* Call the error handler if its there
+ Otherwise print to stderr */
+ if (_objc_error_handler)
+ result = (*_objc_error_handler) (object, code, fmt, ap);
+ else
+ vfprintf (stderr, fmt, ap);
+
+ /* Continue if the error handler says its ok
+ Otherwise abort the program */
+ if (result)
+ return;
+ else
+ abort ();
+}
+
+/* Set the error handler */
+objc_error_handler
+objc_set_error_handler (objc_error_handler func)
+{
+ objc_error_handler temp = _objc_error_handler;
+ _objc_error_handler = func;
+ return temp;
+}
+
+/*
+** Standard functions for memory allocation and disposal.
+** Users should use these functions in their ObjC programs so
+** that they work properly with garbage collectors as well as
+** can take advantage of the exception/error handling available.
+*/
+
+void *
+objc_malloc (size_t size)
+{
+ void *res = (void *) (*_objc_malloc) (size);
+ if (! res)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
+ return res;
+}
+
+void *
+objc_atomic_malloc (size_t size)
+{
+ void *res = (void *) (*_objc_atomic_malloc) (size);
+ if (! res)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
+ return res;
+}
+
+void *
+objc_valloc (size_t size)
+{
+ void *res = (void *) (*_objc_valloc) (size);
+ if (! res)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
+ return res;
+}
+
+void *
+objc_realloc (void *mem, size_t size)
+{
+ void *res = (void *) (*_objc_realloc) (mem, size);
+ if (! res)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
+ return res;
+}
+
+void *
+objc_calloc (size_t nelem, size_t size)
+{
+ void *res = (void *) (*_objc_calloc) (nelem, size);
+ if (! res)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted\n");
+ return res;
+}
+
+void
+objc_free (void *mem)
+{
+ (*_objc_free) (mem);
+}
+
+/*
+** Hook functions for memory allocation and disposal.
+** This makes it easy to substitute garbage collection systems
+** such as Boehm's GC by assigning these function pointers
+** to the GC's allocation routines. By default these point
+** to the ANSI standard malloc, realloc, free, etc.
+**
+** Users should call the normal objc routines above for
+** memory allocation and disposal within their programs.
+*/
+
+#if OBJC_WITH_GC
+#include <gc.h>
+
+static void *
+GC_calloc (size_t nelem, size_t size)
+{
+ void *p = GC_malloc (nelem * size);
+ if (! p)
+ objc_error (nil, OBJC_ERR_MEMORY, "Virtual memory exhausted!\n");
+
+ memset (p, 0, nelem * size);
+ return p;
+}
+
+static void
+noFree (void *p)
+{
+}
+
+void *(*_objc_malloc) (size_t) = GC_malloc;
+void *(*_objc_atomic_malloc) (size_t) = GC_malloc_atomic;
+void *(*_objc_valloc) (size_t) = GC_malloc;
+void *(*_objc_realloc) (void *, size_t) = GC_realloc;
+void *(*_objc_calloc) (size_t, size_t) = GC_calloc;
+void (*_objc_free) (void *) = noFree;
+
+#else /* !OBJC_WITH_GC */
+
+void *(*_objc_malloc) (size_t) = malloc;
+void *(*_objc_atomic_malloc) (size_t) = malloc;
+void *(*_objc_valloc) (size_t) = malloc;
+void *(*_objc_realloc) (void *, size_t) = realloc;
+void *(*_objc_calloc) (size_t, size_t) = calloc;
+void (*_objc_free) (void *) = free;
+
+
+#endif /* !OBJC_WITH_GC */
Added: llvm-gcc-4.2/trunk/libobjc/nil_method.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/nil_method.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/nil_method.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/nil_method.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,55 @@
+/* GNU Objective C Runtime nil receiver function
+ Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+/* This is the nil method, the function that is called when the receiver
+ of a method is nil */
+
+#include "objc/runtime.h"
+
+/* When the receiver of a method invocation is nil, the runtime
+ returns nil_method() as the method implementation. This function
+ will be casted to whatever function was supposed to be executed to
+ execute that method (that function will take an id, followed by a
+ SEL, followed by who knows what arguments, depends on the method),
+ and executed.
+
+ For this reason, nil_method() should be a function which can be
+ called in place of any function taking an 'id' argument followed by
+ a 'SEL' argument, followed by zero, or one, or any number of
+ arguments (both a fixed number, or a variable number !).
+
+ There is no "proper" implementation of such a nil_method function
+ in C, however in all existing implementations it does not matter
+ when extra arguments are present, so we can simply create a function
+ taking a receiver and a selector, and all other arguments will be
+ ignored. :-)
+*/
+
+id
+nil_method (id receiver, SEL op __attribute__ ((__unused__)))
+{
+ return receiver;
+}
Added: llvm-gcc-4.2/trunk/libobjc/objc/NXConstStr.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/NXConstStr.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/NXConstStr.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/NXConstStr.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,52 @@
+/* Interface for the NXConstantString class for Objective-C.
+ Copyright (C) 1995, 2004 Free Software Foundation, Inc.
+ Contributed by Pieter J. Schoenmakers <tiggr at es.ele.tue.nl>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __nxconstantstring_INCLUDE_GNU
+#define __nxconstantstring_INCLUDE_GNU
+
+#include "Object.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ at interface NXConstantString: Object
+{
+ char *c_string;
+ unsigned int len;
+}
+
+-(const char *) cString;
+-(unsigned int) length;
+
+ at end
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Added: llvm-gcc-4.2/trunk/libobjc/objc/Object.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/Object.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/Object.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/Object.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,132 @@
+/* Interface for the Object class for Objective-C.
+ Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#ifndef __object_INCLUDE_GNU
+#define __object_INCLUDE_GNU
+
+#include "objc.h"
+#include "typedstream.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * All classes are derived from Object. As such,
+ * this is the overhead tacked onto those objects.
+ */
+ at interface Object
+{
+ Class isa; /* A pointer to the instance's class structure */
+}
+
+ /* Initializing classes and instances */
++ initialize;
+- init;
+
+ /* Creating, freeing, and copying instances */
++ new;
++ alloc;
+- free;
+- copy;
+- shallowCopy;
+- deepen;
+- deepCopy;
+
+ /* Identifying classes */
+- (Class)class;
+- (Class)superClass;
+- (MetaClass)metaClass;
+- (const char *)name;
+
+ /* Identifying and comparing objects */
+- self;
+- (unsigned int)hash;
+- (BOOL)isEqual:anObject;
+- (int)compare:anotherObject;
+
+ /* Testing object type */
+- (BOOL)isMetaClass;
+- (BOOL)isClass;
+- (BOOL)isInstance;
+
+ /* Testing inheritance relationships */
+- (BOOL)isKindOf:(Class)aClassObject;
+- (BOOL)isMemberOf:(Class)aClassObject;
+- (BOOL)isKindOfClassNamed:(const char *)aClassName;
+- (BOOL)isMemberOfClassNamed:(const char *)aClassName;
+
+ /* Testing class functionality */
++ (BOOL)instancesRespondTo:(SEL)aSel;
+- (BOOL)respondsTo:(SEL)aSel;
+
+ /* Testing protocol conformance */
+- (BOOL)conformsTo:(Protocol*)aProtocol;
+
+ /* Introspection */
++ (IMP)instanceMethodFor:(SEL)aSel;
+- (IMP)methodFor:(SEL)aSel;
++ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
+- (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
+
+ /* Sending messages determined at run time */
+- perform:(SEL)aSel;
+- perform:(SEL)aSel with:anObject;
+- perform:(SEL)aSel with:anObject1 with:anObject2;
+
+ /* Forwarding */
+- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
+- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
+
+ /* Posing */
++ poseAs:(Class)aClassObject;
+- (Class)transmuteClassTo:(Class)aClassObject;
+
+ /* Enforcing intentions */
+- subclassResponsibility:(SEL)aSel;
+- notImplemented:(SEL)aSel;
+- shouldNotImplement:(SEL)aSel;
+
+ /* Error handling */
+- doesNotRecognize:(SEL)aSel;
+- error:(const char *)aString, ...;
+
+ /* Archiving */
++ (int)version;
++ setVersion:(int)aVersion;
++ (int)streamVersion: (TypedStream*)aStream;
+
+- read: (TypedStream*)aStream;
+- write: (TypedStream*)aStream;
+- awake;
+
+ at end
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Added: llvm-gcc-4.2/trunk/libobjc/objc/Protocol.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/Protocol.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/Protocol.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/Protocol.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,63 @@
+/* Declare the class Protocol for Objective C programs.
+ Copyright (C) 1993, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __Protocol_INCLUDE_GNU
+#define __Protocol_INCLUDE_GNU
+
+#include "Object.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ at interface Protocol : Object
+{
+ at private
+ char *protocol_name;
+ struct objc_protocol_list *protocol_list;
+ struct objc_method_description_list *instance_methods, *class_methods;
+}
+
+/* Obtaining attributes intrinsic to the protocol */
+
+- (const char *)name;
+
+/* Testing protocol conformance */
+
+- (BOOL) conformsTo: (Protocol *)aProtocolObject;
+
+/* Looking up information specific to a protocol */
+
+- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
+- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
+
+ at end
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not __Protocol_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/encoding.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/encoding.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/encoding.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/encoding.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,107 @@
+/* Encoding of types for Objective C.
+ Copyright (C) 1993, 1997, 2002, 2004 Free Software Foundation, Inc.
+
+Author: Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __encoding_INCLUDE_GNU
+#define __encoding_INCLUDE_GNU
+
+#include "objc-api.h"
+#include <ctype.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define _C_CONST 'r'
+#define _C_IN 'n'
+#define _C_INOUT 'N'
+#define _C_OUT 'o'
+#define _C_BYCOPY 'O'
+#define _C_BYREF 'R'
+#define _C_ONEWAY 'V'
+#define _C_GCINVISIBLE '!'
+
+#define _F_CONST 0x01
+#define _F_IN 0x01
+#define _F_OUT 0x02
+#define _F_INOUT 0x03
+#define _F_BYCOPY 0x04
+#define _F_BYREF 0x08
+#define _F_ONEWAY 0x10
+#define _F_GCINVISIBLE 0x20
+
+int objc_aligned_size (const char *type);
+int objc_sizeof_type (const char *type);
+int objc_alignof_type (const char *type);
+int objc_aligned_size (const char *type);
+int objc_promoted_size (const char *type);
+
+const char *objc_skip_type_qualifiers (const char *type);
+const char *objc_skip_typespec (const char *type);
+const char *objc_skip_offset (const char *type);
+const char *objc_skip_argspec (const char *type);
+int method_get_number_of_arguments (struct objc_method *);
+int method_get_sizeof_arguments (struct objc_method *);
+
+char *method_get_first_argument (struct objc_method *,
+ arglist_t argframe,
+ const char **type);
+char *method_get_next_argument (arglist_t argframe,
+ const char **type);
+char *method_get_nth_argument (struct objc_method *m,
+ arglist_t argframe,
+ int arg,
+ const char **type);
+
+unsigned objc_get_type_qualifiers (const char *type);
+
+
+struct objc_struct_layout
+{
+ const char *original_type;
+ const char *type;
+ const char *prev_type;
+ unsigned int record_size;
+ unsigned int record_align;
+};
+
+void objc_layout_structure (const char *type,
+ struct objc_struct_layout *layout);
+BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
+void objc_layout_finish_structure (struct objc_struct_layout *layout,
+ unsigned int *size,
+ unsigned int *align);
+void objc_layout_structure_get_info (struct objc_struct_layout *layout,
+ unsigned int *offset,
+ unsigned int *align,
+ const char **type);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __encoding_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/hash.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/hash.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/hash.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/hash.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,216 @@
+/* Hash tables for Objective C method dispatch.
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+
+#ifndef __hash_INCLUDE_GNU
+#define __hash_INCLUDE_GNU
+
+#include <stddef.h>
+#include <string.h>
+#include "objc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * This data structure is used to hold items
+ * stored in a hash table. Each node holds
+ * a key/value pair.
+ *
+ * Items in the cache are really of type void *.
+ */
+typedef struct cache_node
+{
+ struct cache_node *next; /* Pointer to next entry on the list.
+ NULL indicates end of list. */
+ const void *key; /* Key used to locate the value. Used
+ to locate value when more than one
+ key computes the same hash
+ value. */
+ void *value; /* Value stored for the key. */
+} *node_ptr;
+
+
+/*
+ * This data type is the function that computes a hash code given a key.
+ * Therefore, the key can be a pointer to anything and the function specific
+ * to the key type.
+ *
+ * Unfortunately there is a mutual data structure reference problem with this
+ * typedef. Therefore, to remove compiler warnings the functions passed to
+ * objc_hash_new will have to be casted to this type.
+ */
+typedef unsigned int (*hash_func_type) (void *, const void *);
+
+/*
+ * This data type is the function that compares two hash keys and returns an
+ * integer greater than, equal to, or less than 0, according as the first
+ * parameter is lexicographically greater than, equal to, or less than the
+ * second.
+ */
+
+typedef int (*compare_func_type) (const void *, const void *);
+
+
+/*
+ * This data structure is the cache.
+ *
+ * It must be passed to all of the hashing routines
+ * (except for new).
+ */
+typedef struct cache
+{
+ /* Variables used to implement the hash itself. */
+ node_ptr *node_table; /* Pointer to an array of hash nodes. */
+ /* Variables used to track the size of the hash table so to determine
+ when to resize it. */
+ unsigned int size; /* Number of buckets allocated for the hash table
+ (number of array entries allocated for
+ "node_table"). Must be a power of two. */
+ unsigned int used; /* Current number of entries in the hash table. */
+ unsigned int mask; /* Precomputed mask. */
+
+ /* Variables used to implement indexing through the hash table. */
+
+ unsigned int last_bucket; /* Tracks which entry in the array where
+ the last value was returned. */
+ /* Function used to compute a hash code given a key.
+ This function is specified when the hash table is created. */
+ hash_func_type hash_func;
+ /* Function used to compare two hash keys to see if they are equal. */
+ compare_func_type compare_func;
+} *cache_ptr;
+
+
+/* Two important hash tables. */
+extern cache_ptr module_hash_table, class_hash_table;
+
+/* Allocate and initialize a hash table. */
+
+cache_ptr objc_hash_new (unsigned int size,
+ hash_func_type hash_func,
+ compare_func_type compare_func);
+
+/* Deallocate all of the hash nodes and the cache itself. */
+
+void objc_hash_delete (cache_ptr cache);
+
+/* Add the key/value pair to the hash table. If the
+ hash table reaches a level of fullness then it will be resized.
+
+ assert if the key is already in the hash. */
+
+void objc_hash_add (cache_ptr *cachep, const void *key, void *value);
+
+/* Remove the key/value pair from the hash table.
+ assert if the key isn't in the table. */
+
+void objc_hash_remove (cache_ptr cache, const void *key);
+
+/* Used to index through the hash table. Start with NULL
+ to get the first entry.
+
+ Successive calls pass the value returned previously.
+ ** Don't modify the hash during this operation ***
+
+ Cache nodes are returned such that key or value can
+ be extracted. */
+
+node_ptr objc_hash_next (cache_ptr cache, node_ptr node);
+
+/* Used to return a value from a hash table using a given key. */
+
+void *objc_hash_value_for_key (cache_ptr cache, const void *key);
+
+/* Used to determine if the given key exists in the hash table */
+
+BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);
+
+/************************************************
+
+ Useful hashing functions.
+
+ Declared inline for your pleasure.
+
+************************************************/
+
+/* Calculate a hash code by performing some
+ manipulation of the key pointer. (Use the lowest bits
+ except for those likely to be 0 due to alignment.) */
+
+static inline unsigned int
+objc_hash_ptr (cache_ptr cache, const void *key)
+{
+ return ((size_t)key / sizeof (void *)) & cache->mask;
+}
+
+
+/* Calculate a hash code by iterating over a NULL
+ terminate string. */
+static inline unsigned int
+objc_hash_string (cache_ptr cache, const void *key)
+{
+ unsigned int ret = 0;
+ unsigned int ctr = 0;
+ const char *ckey = (const char *) key;
+
+ while (*ckey) {
+ ret ^= *ckey++ << ctr;
+ ctr = (ctr + 1) % sizeof (void *);
+ }
+
+ return ret & cache->mask;
+}
+
+
+/* Compare two pointers for equality. */
+static inline int
+objc_compare_ptrs (const void *k1, const void *k2)
+{
+ return (k1 == k2);
+}
+
+
+/* Compare two strings. */
+static inline int
+objc_compare_strings (const void *k1, const void *k2)
+{
+ if (k1 == k2)
+ return 1;
+ else if (k1 == 0 || k2 == 0)
+ return 0;
+ else
+ return ! strcmp ((const char *) k1, (const char *) k2);
+}
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* not __hash_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/objc-api.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/objc-api.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/objc-api.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/objc-api.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,626 @@
+/* GNU Objective-C Runtime API.
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#ifndef __objc_api_INCLUDE_GNU
+#define __objc_api_INCLUDE_GNU
+
+#include "objc.h"
+#include "hash.h"
+#include "thr.h"
+#include "objc-decls.h"
+#include <stdio.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* For functions which return Method_t */
+#define METHOD_NULL (Method_t)0
+ /* Boolean typedefs */
+/*
+** Method descriptor returned by introspective Object methods.
+** This is really just the first part of the more complete objc_method
+** structure defined below and used internally by the runtime.
+*/
+struct objc_method_description
+{
+ SEL name; /* this is a selector, not a string */
+ char *types; /* type encoding */
+};
+
+/* Filer types used to describe Ivars and Methods. */
+#define _C_ID '@'
+#define _C_CLASS '#'
+#define _C_SEL ':'
+#define _C_CHR 'c'
+#define _C_UCHR 'C'
+#define _C_SHT 's'
+#define _C_USHT 'S'
+#define _C_INT 'i'
+#define _C_UINT 'I'
+#define _C_LNG 'l'
+#define _C_ULNG 'L'
+#define _C_LNG_LNG 'q'
+#define _C_ULNG_LNG 'Q'
+#define _C_FLT 'f'
+#define _C_DBL 'd'
+#define _C_BFLD 'b'
+#define _C_BOOL 'B'
+#define _C_VOID 'v'
+#define _C_UNDEF '?'
+#define _C_PTR '^'
+#define _C_CHARPTR '*'
+#define _C_ATOM '%'
+#define _C_ARY_B '['
+#define _C_ARY_E ']'
+#define _C_UNION_B '('
+#define _C_UNION_E ')'
+#define _C_STRUCT_B '{'
+#define _C_STRUCT_E '}'
+#define _C_VECTOR '!'
+#define _C_COMPLEX 'j'
+
+
+/*
+** Error handling
+**
+** Call objc_error() or objc_verror() to record an error; this error
+** routine will generally exit the program but not necessarily if the
+** user has installed his own error handler.
+**
+** Call objc_set_error_handler to assign your own function for
+** handling errors. The function should return YES if it is ok
+** to continue execution, or return NO or just abort if the
+** program should be stopped. The default error handler is just to
+** print a message on stderr.
+**
+** The error handler function should be of type objc_error_handler
+** The first parameter is an object instance of relevance.
+** The second parameter is an error code.
+** The third parameter is a format string in the printf style.
+** The fourth parameter is a variable list of arguments.
+*/
+extern void objc_error(id object, int code, const char* fmt, ...);
+extern void objc_verror(id object, int code, const char* fmt, va_list ap);
+typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);
+extern objc_error_handler objc_set_error_handler(objc_error_handler func);
+
+/*
+** Error codes
+** These are used by the runtime library, and your
+** error handling may use them to determine if the error is
+** hard or soft thus whether execution can continue or abort.
+*/
+#define OBJC_ERR_UNKNOWN 0 /* Generic error */
+
+#define OBJC_ERR_OBJC_VERSION 1 /* Incorrect runtime version */
+#define OBJC_ERR_GCC_VERSION 2 /* Incorrect compiler version */
+#define OBJC_ERR_MODULE_SIZE 3 /* Bad module size */
+#define OBJC_ERR_PROTOCOL_VERSION 4 /* Incorrect protocol version */
+
+#define OBJC_ERR_MEMORY 10 /* Out of memory */
+
+#define OBJC_ERR_RECURSE_ROOT 20 /* Attempt to archive the root
+ object more than once. */
+#define OBJC_ERR_BAD_DATA 21 /* Didn't read expected data */
+#define OBJC_ERR_BAD_KEY 22 /* Bad key for object */
+#define OBJC_ERR_BAD_CLASS 23 /* Unknown class */
+#define OBJC_ERR_BAD_TYPE 24 /* Bad type specification */
+#define OBJC_ERR_NO_READ 25 /* Cannot read stream */
+#define OBJC_ERR_NO_WRITE 26 /* Cannot write stream */
+#define OBJC_ERR_STREAM_VERSION 27 /* Incorrect stream version */
+#define OBJC_ERR_BAD_OPCODE 28 /* Bad opcode */
+
+#define OBJC_ERR_UNIMPLEMENTED 30 /* Method is not implemented */
+
+#define OBJC_ERR_BAD_STATE 40 /* Bad thread state */
+
+/*
+** Set this variable nonzero to print a line describing each
+** message that is sent. (this is currently disabled)
+*/
+extern BOOL objc_trace;
+
+
+/* For every class which happens to have statically allocated instances in
+ this module, one OBJC_STATIC_INSTANCES is allocated by the compiler.
+ INSTANCES is NULL terminated and points to all statically allocated
+ instances of this class. */
+struct objc_static_instances
+{
+ char *class_name;
+#ifdef __cplusplus
+ id instances[1];
+#else
+ id instances[0];
+#endif
+};
+
+/*
+** Whereas a Module (defined further down) is the root (typically) of a file,
+** a Symtab is the root of the class and category definitions within the
+** module.
+**
+** A Symtab contains a variable length array of pointers to classes and
+** categories defined in the module.
+*/
+typedef struct objc_symtab {
+ unsigned long sel_ref_cnt; /* Unknown. */
+ SEL refs; /* Unknown. */
+ unsigned short cls_def_cnt; /* Number of classes compiled
+ (defined) in the module. */
+ unsigned short cat_def_cnt; /* Number of categories
+ compiled (defined) in the
+ module. */
+
+ void *defs[1]; /* Variable array of pointers.
+ cls_def_cnt of type Class
+ followed by cat_def_cnt of
+ type Category_t, followed
+ by a NULL terminated array
+ of objc_static_instances. */
+} Symtab, *Symtab_t;
+
+
+/*
+** The compiler generates one of these structures for each module that
+** composes the executable (eg main.m).
+**
+** This data structure is the root of the definition tree for the module.
+**
+** A collect program runs between ld stages and creates a ObjC ctor array.
+** That array holds a pointer to each module structure of the executable.
+*/
+typedef struct objc_module {
+ unsigned long version; /* Compiler revision. */
+ unsigned long size; /* sizeof(Module). */
+ const char* name; /* Name of the file where the
+ module was generated. The
+ name includes the path. */
+
+ Symtab_t symtab; /* Pointer to the Symtab of
+ the module. The Symtab
+ holds an array of
+ pointers to
+ the classes and categories
+ defined in the module. */
+} Module, *Module_t;
+
+
+/*
+** The compiler generates one of these structures for a class that has
+** instance variables defined in its specification.
+*/
+typedef struct objc_ivar {
+ const char* ivar_name; /* Name of the instance
+ variable as entered in the
+ class definition. */
+ const char* ivar_type; /* Description of the Ivar's
+ type. Useful for
+ debuggers. */
+ int ivar_offset; /* Byte offset from the base
+ address of the instance
+ structure to the variable. */
+} *Ivar_t;
+
+typedef struct objc_ivar_list {
+ int ivar_count; /* Number of structures (Ivar)
+ contained in the list. One
+ structure per instance
+ variable defined in the
+ class. */
+ struct objc_ivar ivar_list[1]; /* Variable length
+ structure. */
+} IvarList, *IvarList_t;
+
+
+/*
+** The compiler generates one (or more) of these structures for a class that
+** has methods defined in its specification.
+**
+** The implementation of a class can be broken into separate pieces in a file
+** and categories can break them across modules. To handle this problem is a
+** singly linked list of methods.
+*/
+typedef struct objc_method {
+ SEL method_name; /* This variable is the method's
+ name. It is a char*.
+ The unique integer passed to
+ objc_msg_send is a char* too.
+ It is compared against
+ method_name using strcmp. */
+ const char* method_types; /* Description of the method's
+ parameter list. Useful for
+ debuggers. */
+ IMP method_imp; /* Address of the method in the
+ executable. */
+} Method, *Method_t;
+
+typedef struct objc_method_list {
+ struct objc_method_list* method_next; /* This variable is used to link
+ a method list to another. It
+ is a singly linked list. */
+ int method_count; /* Number of methods defined in
+ this structure. */
+ Method method_list[1]; /* Variable length
+ structure. */
+} MethodList, *MethodList_t;
+
+struct objc_protocol_list {
+ struct objc_protocol_list *next;
+ size_t count;
+ Protocol *list[1];
+};
+
+/*
+** This is used to assure consistent access to the info field of
+** classes
+*/
+#ifndef HOST_BITS_PER_LONG
+#define HOST_BITS_PER_LONG (sizeof(long)*8)
+#endif
+
+#define __CLS_INFO(cls) ((cls)->info)
+#define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask)
+#define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask)
+
+/* The structure is of type MetaClass */
+#define _CLS_META 0x2L
+#define CLS_ISMETA(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_META))
+
+
+/* The structure is of type Class */
+#define _CLS_CLASS 0x1L
+#define CLS_ISCLASS(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_CLASS))
+
+/*
+** The class is initialized within the runtime. This means that
+** it has had correct super and sublinks assigned
+*/
+#define _CLS_RESOLV 0x8L
+#define CLS_ISRESOLV(cls) __CLS_ISINFO(cls, _CLS_RESOLV)
+#define CLS_SETRESOLV(cls) __CLS_SETINFO(cls, _CLS_RESOLV)
+
+/*
+** The class has been send a +initialize message or a such is not
+** defined for this class
+*/
+#define _CLS_INITIALIZED 0x04L
+#define CLS_ISINITIALIZED(cls) __CLS_ISINFO(cls, _CLS_INITIALIZED)
+#define CLS_SETINITIALIZED(cls) __CLS_SETINFO(cls, _CLS_INITIALIZED)
+
+/*
+** The class number of this class. This must be the same for both the
+** class and its meta class object
+*/
+#define CLS_GETNUMBER(cls) (__CLS_INFO(cls) >> (HOST_BITS_PER_LONG/2))
+#define CLS_SETNUMBER(cls, num) \
+ ({ (cls)->info <<= (HOST_BITS_PER_LONG/2); \
+ (cls)->info >>= (HOST_BITS_PER_LONG/2); \
+ __CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
+
+/*
+** The compiler generates one of these structures for each category. A class
+** may have many categories and contain both instance and factory methods.
+*/
+typedef struct objc_category {
+ const char* category_name; /* Name of the category. Name
+ contained in the () of the
+ category definition. */
+ const char* class_name; /* Name of the class to which
+ the category belongs. */
+ MethodList_t instance_methods; /* Linked list of instance
+ methods defined in the
+ category. NULL indicates no
+ instance methods defined. */
+ MethodList_t class_methods; /* Linked list of factory
+ methods defined in the
+ category. NULL indicates no
+ class methods defined. */
+ struct objc_protocol_list *protocols; /* List of Protocols
+ conformed to */
+} Category, *Category_t;
+
+/*
+** Structure used when a message is send to a class's super class. The
+** compiler generates one of these structures and passes it to
+** objc_msg_super.
+*/
+typedef struct objc_super {
+ id self; /* Id of the object sending
+ the message. */
+#ifdef __cplusplus
+ Class super_class;
+#else
+ Class class; /* Object's super class. */
+#endif
+} Super, *Super_t;
+
+IMP objc_msg_lookup_super(Super_t super, SEL sel);
+
+retval_t objc_msg_sendv(id, SEL, arglist_t);
+
+
+
+/*
+** This is a hook which is called by objc_lookup_class and
+** objc_get_class if the runtime is not able to find the class.
+** This may e.g. try to load in the class using dynamic loading.
+** The function is guaranteed to be passed a non-NULL name string.
+*/
+objc_EXPORT Class (*_objc_lookup_class)(const char *name);
+
+/*
+** This is a hook which is called by __objc_exec_class every time a class
+** or a category is loaded into the runtime. This may e.g. help a
+** dynamic loader determine the classes that have been loaded when
+** an object file is dynamically linked in.
+*/
+objc_EXPORT void (*_objc_load_callback)(Class _class, Category* category);
+
+/*
+** Hook functions for allocating, copying and disposing of instances
+*/
+objc_EXPORT id (*_objc_object_alloc)(Class _class);
+objc_EXPORT id (*_objc_object_copy)(id object);
+objc_EXPORT id (*_objc_object_dispose)(id object);
+
+/*
+** Standard functions for memory allocation and disposal.
+** Users should use these functions in their ObjC programs so
+** that they work properly with garbage collectors as well as
+** can take advantage of the exception/error handling available.
+*/
+void *
+objc_malloc(size_t size);
+
+void *
+objc_atomic_malloc(size_t size);
+
+void *
+objc_valloc(size_t size);
+
+void *
+objc_realloc(void *mem, size_t size);
+
+void *
+objc_calloc(size_t nelem, size_t size);
+
+void
+objc_free(void *mem);
+
+/*
+** Hook functions for memory allocation and disposal.
+** This makes it easy to substitute garbage collection systems
+** such as Boehm's GC by assigning these function pointers
+** to the GC's allocation routines. By default these point
+** to the ANSI standard malloc, realloc, free, etc.
+**
+** Users should call the normal objc routines above for
+** memory allocation and disposal within their programs.
+*/
+objc_EXPORT void *(*_objc_malloc)(size_t);
+objc_EXPORT void *(*_objc_atomic_malloc)(size_t);
+objc_EXPORT void *(*_objc_valloc)(size_t);
+objc_EXPORT void *(*_objc_realloc)(void *, size_t);
+objc_EXPORT void *(*_objc_calloc)(size_t, size_t);
+objc_EXPORT void (*_objc_free)(void *);
+
+/*
+** Hook for method forwarding. This makes it easy to substitute a
+** library, such as ffcall, that implements closures, thereby avoiding
+** gcc's __builtin_apply problems.
+*/
+objc_EXPORT IMP (*__objc_msg_forward)(SEL);
+
+Method_t class_get_class_method(MetaClass _class, SEL aSel);
+
+Method_t class_get_instance_method(Class _class, SEL aSel);
+
+Class class_pose_as(Class impostor, Class superclass);
+
+Class objc_get_class(const char *name);
+
+Class objc_lookup_class(const char *name);
+
+Class objc_next_class(void **enum_state);
+
+const char *sel_get_name(SEL selector);
+
+const char *sel_get_type(SEL selector);
+
+SEL sel_get_uid(const char *name);
+
+SEL sel_get_any_uid(const char *name);
+
+SEL sel_get_any_typed_uid(const char *name);
+
+SEL sel_get_typed_uid(const char *name, const char*);
+
+SEL sel_register_name(const char *name);
+
+SEL sel_register_typed_name(const char *name, const char*type);
+
+
+BOOL sel_is_mapped (SEL aSel);
+
+extern id class_create_instance(Class _class);
+
+static inline const char *
+class_get_class_name(Class _class)
+{
+ return CLS_ISCLASS(_class)?_class->name:((_class==Nil)?"Nil":0);
+}
+
+static inline long
+class_get_instance_size(Class _class)
+{
+ return CLS_ISCLASS(_class)?_class->instance_size:0;
+}
+
+static inline MetaClass
+class_get_meta_class(Class _class)
+{
+ return CLS_ISCLASS(_class)?_class->class_pointer:Nil;
+}
+
+static inline Class
+class_get_super_class(Class _class)
+{
+ return CLS_ISCLASS(_class)?_class->super_class:Nil;
+}
+
+static inline int
+class_get_version(Class _class)
+{
+ return CLS_ISCLASS(_class)?_class->version:-1;
+}
+
+static inline BOOL
+class_is_class(Class _class)
+{
+ return CLS_ISCLASS(_class);
+}
+
+static inline BOOL
+class_is_meta_class(Class _class)
+{
+ return CLS_ISMETA(_class);
+}
+
+
+static inline void
+class_set_version(Class _class, long version)
+{
+ if (CLS_ISCLASS(_class))
+ _class->version = version;
+}
+
+static inline void *
+class_get_gc_object_type (Class _class)
+{
+ return CLS_ISCLASS(_class) ? _class->gc_object_type : NULL;
+}
+
+/* Mark the instance variable as innaccessible to the garbage collector */
+extern void class_ivar_set_gcinvisible (Class _class,
+ const char* ivarname,
+ BOOL gcInvisible);
+
+static inline IMP
+method_get_imp(Method_t method)
+{
+ return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
+}
+
+IMP get_imp (Class _class, SEL sel);
+
+/* Redefine on NeXTSTEP so as not to conflict with system function */
+#ifdef __NeXT__
+#define object_copy gnu_object_copy
+#define object_dispose gnu_object_dispose
+#endif
+
+id object_copy(id object);
+
+id object_dispose(id object);
+
+static inline Class
+object_get_class(id object)
+{
+ return ((object!=nil)
+ ? (CLS_ISCLASS(object->class_pointer)
+ ? object->class_pointer
+ : (CLS_ISMETA(object->class_pointer)
+ ? (Class)object
+ : Nil))
+ : Nil);
+}
+
+static inline const char *
+object_get_class_name(id object)
+{
+ return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
+ ?object->class_pointer->name
+ :((Class)object)->name)
+ :"Nil");
+}
+
+static inline MetaClass
+object_get_meta_class(id object)
+{
+ return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
+ ?object->class_pointer->class_pointer
+ :(CLS_ISMETA(object->class_pointer)
+ ?object->class_pointer
+ :Nil))
+ :Nil);
+}
+
+static inline Class
+object_get_super_class
+(id object)
+{
+ return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
+ ?object->class_pointer->super_class
+ :(CLS_ISMETA(object->class_pointer)
+ ?((Class)object)->super_class
+ :Nil))
+ :Nil);
+}
+
+static inline BOOL
+object_is_class (id object)
+{
+ return ((object != nil) && CLS_ISMETA (object->class_pointer));
+}
+
+static inline BOOL
+object_is_instance (id object)
+{
+ return ((object != nil) && CLS_ISCLASS (object->class_pointer));
+}
+
+static inline BOOL
+object_is_meta_class (id object)
+{
+ return ((object != nil)
+ && !object_is_instance (object)
+ && !object_is_class (object));
+}
+
+struct sarray*
+objc_get_uninstalled_dtable(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __objc_api_INCLUDE_GNU */
+
+
+
Added: llvm-gcc-4.2/trunk/libobjc/objc/objc-decls.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/objc-decls.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/objc-decls.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/objc-decls.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,47 @@
+/* GNU Objective-C Extern helpers for Win32.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#ifndef __objc_decls_INCLUDE_GNU
+#define __objc_decls_INCLUDE_GNU
+
+#if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
+
+# ifdef DLL_EXPORT /* defined by libtool (if required) */
+# define objc_EXPORT __declspec(dllexport)
+# define objc_DECLARE __declspec(dllexport)
+#else
+# define objc_EXPORT extern __declspec(dllimport)
+# define objc_DECLARE extern __declspec(dllimport)
+#endif
+
+#else
+
+# define objc_EXPORT extern
+# define objc_DECLARE
+
+#endif
+
+#endif /* __objc_decls_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/objc-list.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/objc-list.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/objc-list.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/objc-list.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,156 @@
+/* Generic single linked list to keep various information
+ Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef __GNU_OBJC_LIST_H
+#define __GNU_OBJC_LIST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct objc_list {
+ void *head;
+ struct objc_list *tail;
+};
+
+/* Return a cons cell produced from (head . tail) */
+
+static inline struct objc_list*
+list_cons(void* head, struct objc_list* tail)
+{
+ struct objc_list* cell;
+
+ cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
+ cell->head = head;
+ cell->tail = tail;
+ return cell;
+}
+
+/* Return the length of a list, list_length(NULL) returns zero */
+
+static inline int
+list_length(struct objc_list* list)
+{
+ int i = 0;
+ while(list)
+ {
+ i += 1;
+ list = list->tail;
+ }
+ return i;
+}
+
+/* Return the Nth element of LIST, where N count from zero. If N
+ larger than the list length, NULL is returned */
+
+static inline void*
+list_nth(int indx, struct objc_list* list)
+{
+ while(indx-- != 0)
+ {
+ if(list->tail)
+ list = list->tail;
+ else
+ return 0;
+ }
+ return list->head;
+}
+
+/* Remove the element at the head by replacing it by its successor */
+
+static inline void
+list_remove_head(struct objc_list** list)
+{
+ if ((*list)->tail)
+ {
+ struct objc_list* tail = (*list)->tail; /* fetch next */
+ *(*list) = *tail; /* copy next to list head */
+ objc_free(tail); /* free next */
+ }
+ else /* only one element in list */
+ {
+ objc_free(*list);
+ (*list) = 0;
+ }
+}
+
+
+/* Remove the element with `car' set to ELEMENT */
+
+static inline void
+list_remove_elem(struct objc_list** list, void* elem)
+{
+ while (*list) {
+ if ((*list)->head == elem)
+ list_remove_head(list);
+ list = &((*list)->tail);
+ }
+}
+
+/* Map FUNCTION over all elements in LIST */
+
+static inline void
+list_mapcar(struct objc_list* list, void(*function)(void*))
+{
+ while(list)
+ {
+ (*function)(list->head);
+ list = list->tail;
+ }
+}
+
+/* Return element that has ELEM as car */
+
+static inline struct objc_list**
+list_find(struct objc_list** list, void* elem)
+{
+ while(*list)
+ {
+ if ((*list)->head == elem)
+ return list;
+ list = &((*list)->tail);
+ }
+ return NULL;
+}
+
+/* Free list (backwards recursive) */
+
+static void
+list_free(struct objc_list* list)
+{
+ if(list)
+ {
+ list_free(list->tail);
+ objc_free(list);
+ }
+}
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __GNU_OBJC_LIST_H */
Added: llvm-gcc-4.2/trunk/libobjc/objc/objc.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/objc.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/objc.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/objc.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,165 @@
+/* Basic data types for Objective C.
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __objc_INCLUDE_GNU
+#define __objc_INCLUDE_GNU
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+
+/*
+** Definition of the boolean type.
+*/
+#ifdef __vxworks
+typedef int BOOL;
+#else
+typedef unsigned char BOOL;
+#endif
+#define YES (BOOL)1
+#define NO (BOOL)0
+
+/*
+** Definition of a selector. Selectors themselves are not unique, but
+** the sel_id is a unique identifier.
+*/
+typedef const struct objc_selector
+{
+ void *sel_id;
+ const char *sel_types;
+} *SEL;
+
+inline static BOOL
+sel_eq (SEL s1, SEL s2)
+{
+ if (s1 == 0 || s2 == 0)
+ return s1 == s2;
+ else
+ return s1->sel_id == s2->sel_id;
+}
+
+
+/*
+** ObjC uses this typedef for untyped instances.
+*/
+typedef struct objc_object {
+ struct objc_class* class_pointer;
+} *id;
+
+/*
+** Definition of method type. When retrieving the implementation of a
+** method, this is type of the pointer returned. The idea of the
+** definition of IMP is to represent a 'pointer to a general function
+** taking an id, a SEL, followed by other unspecified arguments'. You
+** must always cast an IMP to a pointer to a function taking the
+** appropriate, specific types for that function, before calling it -
+** to make sure the appropriate arguments are passed to it. The code
+** generated by the compiler to perform method calls automatically
+** does this cast inside method calls.
+*/
+typedef id (*IMP)(id, SEL, ...);
+
+/*
+** More simple types...
+*/
+#define nil (id)0 /* id of Nil instance */
+#define Nil (Class)0 /* id of Nil class */
+typedef char *STR; /* String alias */
+
+/*
+** The compiler generates one of these structures for each class.
+**
+** This structure is the definition for classes.
+**
+** This structure is generated by the compiler in the executable and used by
+** the run-time during normal messaging operations. Therefore some members
+** change type. The compiler generates "char* const" and places a string in
+** the following member variables: super_class.
+*/
+typedef struct objc_class *MetaClass;
+typedef struct objc_class *Class;
+struct objc_class {
+ MetaClass class_pointer; /* Pointer to the class's
+ meta class. */
+ struct objc_class* super_class; /* Pointer to the super
+ class. NULL for class
+ Object. */
+ const char* name; /* Name of the class. */
+ long version; /* Unknown. */
+ unsigned long info; /* Bit mask. See class masks
+ defined above. */
+ long instance_size; /* Size in bytes of the class.
+ The sum of the class
+ definition and all super
+ class definitions. */
+ struct objc_ivar_list* ivars; /* Pointer to a structure that
+ describes the instance
+ variables in the class
+ definition. NULL indicates
+ no instance variables. Does
+ not include super class
+ variables. */
+ struct objc_method_list* methods; /* Linked list of instance
+ methods defined for the
+ class. */
+ struct sarray * dtable; /* Pointer to instance
+ method dispatch table. */
+ struct objc_class* subclass_list; /* Subclasses */
+ struct objc_class* sibling_class;
+
+ struct objc_protocol_list *protocols; /* Protocols conformed to */
+ void* gc_object_type;
+};
+
+#ifndef __OBJC__
+typedef struct objc_protocol {
+ struct objc_class* class_pointer;
+ char *protocol_name;
+ struct objc_protocol_list *protocol_list;
+ struct objc_method_description_list *instance_methods, *class_methods;
+} Protocol;
+
+#else /* __OBJC__ */
+ at class Protocol;
+#endif
+
+typedef void* retval_t; /* return value */
+typedef void(*apply_t)(void); /* function pointer */
+typedef union arglist {
+ char *arg_ptr;
+ char arg_regs[sizeof (char*)];
+} *arglist_t; /* argument frame */
+
+
+IMP objc_msg_lookup(id receiver, SEL op);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not __objc_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/runtime.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/runtime.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/runtime.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/runtime.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,96 @@
+/* GNU Objective C Runtime internal declarations
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef __objc_runtime_INCLUDE_GNU
+#define __objc_runtime_INCLUDE_GNU
+
+#include <stdarg.h> /* for varargs and va_list's */
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include <stddef.h> /* so noone else will get system versions */
+#include <assert.h>
+
+#include "objc.h" /* core data types */
+#include "objc-api.h" /* runtime api functions */
+
+#include "thr.h" /* thread and mutex support */
+
+#include "hash.h" /* hash structures */
+#include "objc-list.h" /* linear lists */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */
+extern void __objc_init_selector_tables(void); /* (objc-sel.c) */
+extern void __objc_init_class_tables(void); /* (objc-class.c) */
+extern void __objc_init_dispatch_tables(void); /* (objc-dispatch.c) */
+extern void __objc_install_premature_dtable(Class); /* (objc-dispatch.c) */
+extern void __objc_resolve_class_links(void); /* (objc-class.c) */
+extern void __objc_register_selectors_from_class(Class); /* (objc-sel.c) */
+extern void __objc_register_selectors_from_list (MethodList_t); /* (selector.c) */
+extern void __objc_update_dispatch_table_for_class (Class);/* (objc-msg.c) */
+
+extern int __objc_init_thread_system(void); /* thread.c */
+extern int __objc_fini_thread_system(void); /* thread.c */
+extern void __objc_print_dtable_stats(void); /* sendmsg.c */
+
+extern void class_add_method_list(Class, MethodList_t);
+
+/* Registering instance methods as class methods for root classes */
+extern void __objc_register_instance_methods_to_class(Class);
+extern Method_t search_for_method_in_list(MethodList_t list, SEL op);
+
+/* True when class links has been resolved */
+extern BOOL __objc_class_links_resolved;
+
+/* Number of selectors stored in each of the selector tables */
+extern unsigned int __objc_selector_max_index;
+
+/* Mutex locking __objc_selector_max_index and its arrays. */
+extern objc_mutex_t __objc_runtime_mutex;
+
+/* Number of threads which are alive. */
+extern int __objc_runtime_threads_alive;
+
+#ifdef DEBUG
+#define DEBUG_PRINTF(format, args...) printf (format, ## args)
+#else
+#define DEBUG_PRINTF(format, args...)
+#endif
+
+BOOL __objc_responds_to (id object, SEL sel); /* for internal use only! */
+SEL __sel_register_typed_name (const char*, const char*,
+ struct objc_selector*, BOOL is_const);
+extern void __objc_generate_gc_type_description (Class);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __objc_runtime_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/sarray.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/sarray.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/sarray.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/sarray.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,244 @@
+/* Sparse Arrays for Objective C dispatch tables
+ Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#ifndef __sarray_INCLUDE_GNU
+#define __sarray_INCLUDE_GNU
+
+#include "thr.h"
+
+#define OBJC_SPARSE2 /* 2-level sparse array */
+/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
+
+#ifdef OBJC_SPARSE2
+extern const char* __objc_sparse2_id;
+#endif
+
+#ifdef OBJC_SPARSE3
+extern const char* __objc_sparse3_id;
+#endif
+
+#include <stddef.h>
+#include <assert.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+extern int nbuckets; /* for stats */
+extern int nindices;
+extern int narrays;
+extern int idxsize;
+
+/* An unsigned integer of same size as a pointer */
+#define SIZET_BITS (sizeof(size_t)*8)
+
+#if defined(__sparc__) || defined(OBJC_SPARSE2)
+#define PRECOMPUTE_SELECTORS
+#endif
+
+#ifdef OBJC_SPARSE3
+
+/* Buckets are 8 words each */
+#define BUCKET_BITS 3
+#define BUCKET_SIZE (1<<BUCKET_BITS)
+#define BUCKET_MASK (BUCKET_SIZE-1)
+
+/* Indices are 16 words each */
+#define INDEX_BITS 4
+#define INDEX_SIZE (1<<INDEX_BITS)
+#define INDEX_MASK (INDEX_SIZE-1)
+
+#define INDEX_CAPACITY (BUCKET_SIZE*INDEX_SIZE)
+
+#else /* OBJC_SPARSE2 */
+
+/* Buckets are 32 words each */
+#define BUCKET_BITS 5
+#define BUCKET_SIZE (1<<BUCKET_BITS)
+#define BUCKET_MASK (BUCKET_SIZE-1)
+
+#endif /* OBJC_SPARSE2 */
+
+typedef size_t sidx;
+
+#ifdef PRECOMPUTE_SELECTORS
+
+struct soffset {
+#ifdef OBJC_SPARSE3
+ unsigned int unused : SIZET_BITS/4;
+ unsigned int eoffset : SIZET_BITS/4;
+ unsigned int boffset : SIZET_BITS/4;
+ unsigned int ioffset : SIZET_BITS/4;
+#else /* OBJC_SPARSE2 */
+#ifdef __sparc__
+ unsigned long boffset : (SIZET_BITS - 2) - BUCKET_BITS;
+ unsigned int eoffset : BUCKET_BITS;
+ unsigned int unused : 2;
+#else
+ unsigned int boffset : SIZET_BITS/2;
+ unsigned int eoffset : SIZET_BITS/2;
+#endif
+#endif /* OBJC_SPARSE2 */
+};
+
+union sofftype {
+ struct soffset off;
+ sidx idx;
+};
+
+#endif /* not PRECOMPUTE_SELECTORS */
+
+union sversion {
+ int version;
+ void *next_free;
+};
+
+struct sbucket {
+ void* elems[BUCKET_SIZE]; /* elements stored in array */
+ union sversion version; /* used for copy-on-write */
+};
+
+#ifdef OBJC_SPARSE3
+
+struct sindex {
+ struct sbucket* buckets[INDEX_SIZE];
+ union sversion version; /* used for copy-on-write */
+};
+
+#endif /* OBJC_SPARSE3 */
+
+struct sarray {
+#ifdef OBJC_SPARSE3
+ struct sindex** indices;
+ struct sindex* empty_index;
+#else /* OBJC_SPARSE2 */
+ struct sbucket** buckets;
+#endif /* OBJC_SPARSE2 */
+ struct sbucket* empty_bucket;
+ union sversion version; /* used for copy-on-write */
+ short ref_count;
+ struct sarray* is_copy_of;
+ size_t capacity;
+};
+
+struct sarray* sarray_new(int, void* default_element);
+void sarray_free(struct sarray*);
+struct sarray* sarray_lazy_copy(struct sarray*);
+void sarray_realloc(struct sarray*, int new_size);
+void sarray_at_put(struct sarray*, sidx indx, void* elem);
+void sarray_at_put_safe(struct sarray*, sidx indx, void* elem);
+
+struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
+void sarray_remove_garbage(void);
+
+
+#ifdef PRECOMPUTE_SELECTORS
+/* Transform soffset values to ints and vica verca */
+static inline unsigned int
+soffset_decode(sidx indx)
+{
+ union sofftype x;
+ x.idx = indx;
+#ifdef OBJC_SPARSE3
+ return x.off.eoffset
+ + (x.off.boffset*BUCKET_SIZE)
+ + (x.off.ioffset*INDEX_CAPACITY);
+#else /* OBJC_SPARSE2 */
+ return x.off.eoffset + (x.off.boffset*BUCKET_SIZE);
+#endif /* OBJC_SPARSE2 */
+}
+
+static inline sidx
+soffset_encode(size_t offset)
+{
+ union sofftype x;
+ x.off.eoffset = offset%BUCKET_SIZE;
+#ifdef OBJC_SPARSE3
+ x.off.boffset = (offset/BUCKET_SIZE)%INDEX_SIZE;
+ x.off.ioffset = offset/INDEX_CAPACITY;
+#else /* OBJC_SPARSE2 */
+ x.off.boffset = offset/BUCKET_SIZE;
+#endif
+ return (sidx)x.idx;
+}
+
+#else /* not PRECOMPUTE_SELECTORS */
+
+static inline size_t
+soffset_decode(sidx indx)
+{
+ return indx;
+}
+
+static inline sidx
+soffset_encode(size_t offset)
+{
+ return offset;
+}
+#endif /* not PRECOMPUTE_SELECTORS */
+
+/* Get element from the Sparse array `array' at offset `indx' */
+
+static inline void* sarray_get(struct sarray* array, sidx indx)
+{
+#ifdef PRECOMPUTE_SELECTORS
+ union sofftype x;
+ x.idx = indx;
+#ifdef OBJC_SPARSE3
+ return
+ array->
+ indices[x.off.ioffset]->
+ buckets[x.off.boffset]->
+ elems[x.off.eoffset];
+#else /* OBJC_SPARSE2 */
+ return array->buckets[x.off.boffset]->elems[x.off.eoffset];
+#endif /* OBJC_SPARSE2 */
+#else /* not PRECOMPUTE_SELECTORS */
+#ifdef OBJC_SPARSE3
+ return array->
+ indices[indx/INDEX_CAPACITY]->
+ buckets[(indx/BUCKET_SIZE)%INDEX_SIZE]->
+ elems[indx%BUCKET_SIZE];
+#else /* OBJC_SPARSE2 */
+ return array->buckets[indx/BUCKET_SIZE]->elems[indx%BUCKET_SIZE];
+#endif /* not OBJC_SPARSE3 */
+#endif /* not PRECOMPUTE_SELECTORS */
+}
+
+static inline void* sarray_get_safe(struct sarray* array, sidx indx)
+{
+ if(soffset_decode(indx) < array->capacity)
+ return sarray_get(array, indx);
+ else
+ return (array->empty_bucket->elems[0]);
+}
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __sarray_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/thr.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/thr.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/thr.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/thr.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,153 @@
+/* Thread and mutex controls for Objective C.
+ Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+
+#ifndef __thread_INCLUDE_GNU
+#define __thread_INCLUDE_GNU
+
+#include "objc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*************************************************************************
+ * Universal static variables:
+ */
+extern int __objc_thread_exit_status; /* Global exit status. */
+
+/********
+ * Thread safe implementation types and functions.
+ */
+
+/* Thread priorities */
+#define OBJC_THREAD_INTERACTIVE_PRIORITY 2
+#define OBJC_THREAD_BACKGROUND_PRIORITY 1
+#define OBJC_THREAD_LOW_PRIORITY 0
+
+/* A thread */
+typedef void * objc_thread_t;
+
+/* This structure represents a single mutual exclusion lock. */
+struct objc_mutex
+{
+ volatile objc_thread_t owner; /* Id of thread that owns. */
+ volatile int depth; /* # of acquires. */
+ void * backend; /* Specific to backend */
+};
+typedef struct objc_mutex *objc_mutex_t;
+
+/* This structure represents a single condition mutex */
+struct objc_condition
+{
+ void * backend; /* Specific to backend */
+};
+typedef struct objc_condition *objc_condition_t;
+
+/* Frontend mutex functions */
+objc_mutex_t objc_mutex_allocate (void);
+int objc_mutex_deallocate (objc_mutex_t mutex);
+int objc_mutex_lock (objc_mutex_t mutex);
+int objc_mutex_unlock (objc_mutex_t mutex);
+int objc_mutex_trylock (objc_mutex_t mutex);
+
+/* Frontend condition mutex functions */
+objc_condition_t objc_condition_allocate (void);
+int objc_condition_deallocate (objc_condition_t condition);
+int objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex);
+int objc_condition_signal (objc_condition_t condition);
+int objc_condition_broadcast (objc_condition_t condition);
+
+/* Frontend thread functions */
+objc_thread_t objc_thread_detach (SEL selector, id object, id argument);
+void objc_thread_yield (void);
+int objc_thread_exit (void);
+int objc_thread_set_priority (int priority);
+int objc_thread_get_priority (void);
+void * objc_thread_get_data (void);
+int objc_thread_set_data (void *value);
+objc_thread_t objc_thread_id (void);
+void objc_thread_add (void);
+void objc_thread_remove (void);
+
+/*
+ Use this to set the hook function that will be called when the
+ runtime initially becomes multi threaded.
+ The hook function is only called once, meaning only when the
+ 2nd thread is spawned, not for each and every thread.
+
+ It returns the previous hook function or NULL if there is none.
+
+ A program outside of the runtime could set this to some function so
+ it can be informed; for example, the GNUstep Base Library sets it
+ so it can implement the NSBecomingMultiThreaded notification.
+ */
+typedef void (*objc_thread_callback) (void);
+objc_thread_callback objc_set_thread_callback (objc_thread_callback func);
+
+/* Backend initialization functions */
+int __objc_init_thread_system (void);
+int __objc_fini_thread_system (void);
+
+/* Backend mutex functions */
+int __objc_mutex_allocate (objc_mutex_t mutex);
+int __objc_mutex_deallocate (objc_mutex_t mutex);
+int __objc_mutex_lock (objc_mutex_t mutex);
+int __objc_mutex_trylock (objc_mutex_t mutex);
+int __objc_mutex_unlock (objc_mutex_t mutex);
+
+/* Backend condition mutex functions */
+int __objc_condition_allocate (objc_condition_t condition);
+int __objc_condition_deallocate (objc_condition_t condition);
+int __objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex);
+int __objc_condition_broadcast (objc_condition_t condition);
+int __objc_condition_signal (objc_condition_t condition);
+
+/* Backend thread functions */
+objc_thread_t __objc_thread_detach (void (*func) (void *arg), void *arg);
+int __objc_thread_set_priority (int priority);
+int __objc_thread_get_priority (void);
+void __objc_thread_yield (void);
+int __objc_thread_exit (void);
+objc_thread_t __objc_thread_id (void);
+int __objc_thread_set_data (void *value);
+void * __objc_thread_get_data (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __thread_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objc/typedstream.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objc/typedstream.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objc/typedstream.h (added)
+++ llvm-gcc-4.2/trunk/libobjc/objc/typedstream.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,141 @@
+/* GNU Objective-C Typed Streams interface.
+ Copyright (C) 1993, 1995, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled
+ with GCC to produce an executable, this does not cause the resulting
+ executable to be covered by the GNU General Public License. This
+ exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU General Public License. */
+
+#ifndef __typedstream_INCLUDE_GNU
+#define __typedstream_INCLUDE_GNU
+
+#include "objc.h"
+#include "hash.h"
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef int (*objc_typed_read_func)(void*, char*, int);
+typedef int (*objc_typed_write_func)(void*, const char*, int);
+typedef int (*objc_typed_flush_func)(void*);
+typedef int (*objc_typed_eof_func)(void*);
+
+#define OBJC_READONLY 0x01
+#define OBJC_WRITEONLY 0x02
+
+#define OBJC_MANAGED_STREAM 0x01
+#define OBJC_FILE_STREAM 0x02
+#define OBJC_MEMORY_STREAM 0x04
+
+#define OBJC_TYPED_STREAM_VERSION 0x01
+
+typedef struct objc_typed_stream {
+ void* physical;
+ cache_ptr object_table; /* read/written objects */
+ cache_ptr stream_table; /* other read/written but shared things.. */
+ cache_ptr class_table; /* class version mapping */
+ cache_ptr object_refs; /* forward references */
+ int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
+ int type; /* MANAGED, FILE, MEMORY etc bit string */
+ int version; /* version used when writing */
+ int writing_root_p;
+ objc_typed_read_func read;
+ objc_typed_write_func write;
+ objc_typed_eof_func eof;
+ objc_typed_flush_func flush;
+} TypedStream;
+
+/* opcode masks */
+#define _B_VALUE 0x1fU
+#define _B_CODE 0xe0U
+#define _B_SIGN 0x10U
+#define _B_NUMBER 0x0fU
+
+/* standard opcodes */
+#define _B_INVALID 0x00U
+#define _B_SINT 0x20U
+#define _B_NINT 0x40U
+#define _B_SSTR 0x60U
+#define _B_NSTR 0x80U
+#define _B_RCOMM 0xa0U
+#define _B_UCOMM 0xc0U
+#define _B_EXT 0xe0U
+
+/* eXtension opcodes */
+#define _BX_OBJECT 0x00U
+#define _BX_CLASS 0x01U
+#define _BX_SEL 0x02U
+#define _BX_OBJREF 0x03U
+#define _BX_OBJROOT 0x04U
+#define _BX_EXT 0x1fU
+
+/*
+** Read and write objects as specified by TYPE. All the `last'
+** arguments are pointers to the objects to read/write.
+*/
+
+int objc_write_type (TypedStream* stream, const char* type, const void* data);
+int objc_read_type (TypedStream* stream, const char* type, void* data);
+
+int objc_write_types (TypedStream* stream, const char* type, ...);
+int objc_read_types (TypedStream* stream, const char* type, ...);
+
+int objc_write_object_reference (TypedStream* stream, id object);
+int objc_write_root_object (TypedStream* stream, id object);
+
+long objc_get_stream_class_version (TypedStream* stream, Class class_type);
+
+
+/*
+** Convenience functions
+*/
+
+int objc_write_array (TypedStream* stream, const char* type,
+ int count, const void* data);
+int objc_read_array (TypedStream* stream, const char* type,
+ int count, void* data);
+
+int objc_write_object (TypedStream* stream, id object);
+int objc_read_object (TypedStream* stream, id* object);
+
+
+
+/*
+** Open a typed stream for reading or writing. MODE may be either of
+** OBJC_READONLY or OBJC_WRITEONLY.
+*/
+
+TypedStream* objc_open_typed_stream (FILE* physical, int mode);
+TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode);
+
+void objc_close_typed_stream (TypedStream* stream);
+
+BOOL objc_end_of_typed_stream (TypedStream* stream);
+void objc_flush_typed_stream (TypedStream* stream);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* not __typedstream_INCLUDE_GNU */
Added: llvm-gcc-4.2/trunk/libobjc/objects.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/objects.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/objects.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/objects.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,103 @@
+/* GNU Objective C Runtime class related functions
+ Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "tconfig.h" /* include defs of bzero for target */
+#include "objc/objc.h"
+#include "objc/runtime.h" /* the kitchen sink */
+
+#if OBJC_WITH_GC
+# include <gc.h>
+#endif
+
+id __objc_object_alloc (Class);
+id __objc_object_dispose (id);
+id __objc_object_copy (id);
+
+id (*_objc_object_alloc) (Class) = __objc_object_alloc; /* !T:SINGLE */
+id (*_objc_object_dispose) (id) = __objc_object_dispose; /* !T:SINGLE */
+id (*_objc_object_copy) (id) = __objc_object_copy; /* !T:SINGLE */
+
+id
+class_create_instance (Class class)
+{
+ id new = nil;
+
+#if OBJC_WITH_GC
+ if (CLS_ISCLASS (class))
+ new = (id) GC_malloc_explicitly_typed (class->instance_size,
+ class->gc_object_type);
+#else
+ if (CLS_ISCLASS (class))
+ new = (*_objc_object_alloc) (class);
+#endif
+
+ if (new != nil)
+ {
+ memset (new, 0, class->instance_size);
+ new->class_pointer = class;
+ }
+ return new;
+}
+
+id
+object_copy (id object)
+{
+ if ((object != nil) && CLS_ISCLASS (object->class_pointer))
+ return (*_objc_object_copy) (object);
+ else
+ return nil;
+}
+
+id
+object_dispose (id object)
+{
+ if ((object != nil) && CLS_ISCLASS (object->class_pointer))
+ {
+ if (_objc_object_dispose)
+ (*_objc_object_dispose) (object);
+ else
+ objc_free (object);
+ }
+ return nil;
+}
+
+id __objc_object_alloc (Class class)
+{
+ return (id) objc_malloc (class->instance_size);
+}
+
+id __objc_object_dispose (id object)
+{
+ objc_free (object);
+ return 0;
+}
+
+id __objc_object_copy (id object)
+{
+ id copy = class_create_instance (object->class_pointer);
+ memcpy (copy, object, object->class_pointer->instance_size);
+ return copy;
+}
Added: llvm-gcc-4.2/trunk/libobjc/sarray.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/sarray.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/sarray.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/sarray.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,518 @@
+/* Sparse Arrays for Objective C dispatch tables
+ Copyright (C) 1993, 1995, 1996, 2002, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files
+ compiled with GCC to produce an executable, this does not cause
+ the resulting executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why
+ the executable file might be covered by the GNU General Public License. */
+
+#include "objc/sarray.h"
+#include "objc/runtime.h"
+#include <stdio.h>
+#include "assert.h"
+
+int nbuckets = 0; /* !T:MUTEX */
+int nindices = 0; /* !T:MUTEX */
+int narrays = 0; /* !T:MUTEX */
+int idxsize = 0; /* !T:MUTEX */
+
+static void *first_free_data = NULL; /* !T:MUTEX */
+
+#ifdef OBJC_SPARSE2
+const char *__objc_sparse2_id = "2 level sparse indices";
+#endif
+
+#ifdef OBJC_SPARSE3
+const char *__objc_sparse3_id = "3 level sparse indices";
+#endif
+
+/* This function removes any structures left over from free operations
+ that were not safe in a multi-threaded environment. */
+void
+sarray_remove_garbage (void)
+{
+ void **vp;
+ void *np;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ vp = first_free_data;
+ first_free_data = NULL;
+
+ while (vp) {
+ np = *vp;
+ objc_free (vp);
+ vp = np;
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* Free a block of dynamically allocated memory. If we are in multi-threaded
+ mode, it is ok to free it. If not, we add it to the garbage heap to be
+ freed later. */
+
+static void
+sarray_free_garbage (void *vp)
+{
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ if (__objc_runtime_threads_alive == 1) {
+ objc_free (vp);
+ if (first_free_data)
+ sarray_remove_garbage ();
+ }
+ else {
+ *(void **)vp = first_free_data;
+ first_free_data = vp;
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* sarray_at_put : copies data in such a way as to be thread reader safe. */
+void
+sarray_at_put (struct sarray *array, sidx index, void *element)
+{
+#ifdef OBJC_SPARSE3
+ struct sindex **the_index;
+ struct sindex *new_index;
+#endif
+ struct sbucket **the_bucket;
+ struct sbucket *new_bucket;
+#ifdef OBJC_SPARSE3
+ size_t ioffset;
+#endif
+ size_t boffset;
+ size_t eoffset;
+#ifdef PRECOMPUTE_SELECTORS
+ union sofftype xx;
+ xx.idx = index;
+#ifdef OBJC_SPARSE3
+ ioffset = xx.off.ioffset;
+#endif
+ boffset = xx.off.boffset;
+ eoffset = xx.off.eoffset;
+#else /* not PRECOMPUTE_SELECTORS */
+#ifdef OBJC_SPARSE3
+ ioffset = index/INDEX_CAPACITY;
+ boffset = (index/BUCKET_SIZE)%INDEX_SIZE;
+ eoffset = index%BUCKET_SIZE;
+#else
+ boffset = index/BUCKET_SIZE;
+ eoffset = index%BUCKET_SIZE;
+#endif
+#endif /* not PRECOMPUTE_SELECTORS */
+
+ assert (soffset_decode (index) < array->capacity); /* Range check */
+
+#ifdef OBJC_SPARSE3
+ the_index = &(array->indices[ioffset]);
+ the_bucket = &((*the_index)->buckets[boffset]);
+#else
+ the_bucket = &(array->buckets[boffset]);
+#endif
+
+ if ((*the_bucket)->elems[eoffset] == element)
+ return; /* great! we just avoided a lazy copy */
+
+#ifdef OBJC_SPARSE3
+
+ /* First, perform lazy copy/allocation of index if needed */
+
+ if ((*the_index) == array->empty_index) {
+
+ /* The index was previously empty, allocate a new */
+ new_index = (struct sindex *) objc_malloc (sizeof (struct sindex));
+ memcpy (new_index, array->empty_index, sizeof (struct sindex));
+ new_index->version.version = array->version.version;
+ *the_index = new_index; /* Prepared for install. */
+ the_bucket = &((*the_index)->buckets[boffset]);
+
+ nindices += 1;
+ } else if ((*the_index)->version.version != array->version.version) {
+
+ /* This index must be lazy copied */
+ struct sindex *old_index = *the_index;
+ new_index = (struct sindex *) objc_malloc (sizeof (struct sindex));
+ memcpy (new_index, old_index, sizeof (struct sindex));
+ new_index->version.version = array->version.version;
+ *the_index = new_index; /* Prepared for install. */
+ the_bucket = &((*the_index)->buckets[boffset]);
+
+ nindices += 1;
+ }
+
+#endif /* OBJC_SPARSE3 */
+
+ /* next, perform lazy allocation/copy of the bucket if needed */
+
+ if ((*the_bucket) == array->empty_bucket) {
+
+ /* The bucket was previously empty (or something like that), */
+ /* allocate a new. This is the effect of `lazy' allocation */
+ new_bucket = (struct sbucket *) objc_malloc (sizeof (struct sbucket));
+ memcpy ((void *) new_bucket, (const void *) array->empty_bucket,
+ sizeof (struct sbucket));
+ new_bucket->version.version = array->version.version;
+ *the_bucket = new_bucket; /* Prepared for install. */
+
+ nbuckets += 1;
+
+ } else if ((*the_bucket)->version.version != array->version.version) {
+
+ /* Perform lazy copy. */
+ struct sbucket *old_bucket = *the_bucket;
+ new_bucket = (struct sbucket *) objc_malloc (sizeof (struct sbucket));
+ memcpy (new_bucket, old_bucket, sizeof (struct sbucket));
+ new_bucket->version.version = array->version.version;
+ *the_bucket = new_bucket; /* Prepared for install. */
+
+ nbuckets += 1;
+
+ }
+ (*the_bucket)->elems[eoffset] = element;
+}
+
+void
+sarray_at_put_safe (struct sarray *array, sidx index, void *element)
+{
+ if (soffset_decode (index) >= array->capacity)
+ sarray_realloc (array, soffset_decode (index) + 1);
+ sarray_at_put (array, index, element);
+}
+
+struct sarray *
+sarray_new (int size, void *default_element)
+{
+ struct sarray *arr;
+#ifdef OBJC_SPARSE3
+ size_t num_indices = ((size - 1)/(INDEX_CAPACITY)) + 1;
+ struct sindex **new_indices;
+#else /* OBJC_SPARSE2 */
+ size_t num_indices = ((size - 1)/BUCKET_SIZE) + 1;
+ struct sbucket **new_buckets;
+#endif
+ size_t counter;
+
+ assert (size > 0);
+
+ /* Allocate core array */
+ arr = (struct sarray *) objc_malloc (sizeof (struct sarray));
+ arr->version.version = 0;
+
+ /* Initialize members */
+#ifdef OBJC_SPARSE3
+ arr->capacity = num_indices*INDEX_CAPACITY;
+ new_indices = (struct sindex **)
+ objc_malloc (sizeof (struct sindex *) * num_indices);
+
+ arr->empty_index = (struct sindex *) objc_malloc (sizeof (struct sindex));
+ arr->empty_index->version.version = 0;
+
+ narrays += 1;
+ idxsize += num_indices;
+ nindices += 1;
+
+#else /* OBJC_SPARSE2 */
+ arr->capacity = num_indices*BUCKET_SIZE;
+ new_buckets = (struct sbucket **)
+ objc_malloc (sizeof (struct sbucket *) * num_indices);
+
+ narrays += 1;
+ idxsize += num_indices;
+
+#endif
+
+ arr->empty_bucket = (struct sbucket *) objc_malloc (sizeof (struct sbucket));
+ arr->empty_bucket->version.version = 0;
+
+ nbuckets += 1;
+
+ arr->ref_count = 1;
+ arr->is_copy_of = (struct sarray *) 0;
+
+ for (counter = 0; counter < BUCKET_SIZE; counter++)
+ arr->empty_bucket->elems[counter] = default_element;
+
+#ifdef OBJC_SPARSE3
+ for (counter = 0; counter < INDEX_SIZE; counter++)
+ arr->empty_index->buckets[counter] = arr->empty_bucket;
+
+ for (counter = 0; counter < num_indices; counter++)
+ new_indices[counter] = arr->empty_index;
+
+#else /* OBJC_SPARSE2 */
+
+ for (counter = 0; counter < num_indices; counter++)
+ new_buckets[counter] = arr->empty_bucket;
+
+#endif
+
+#ifdef OBJC_SPARSE3
+ arr->indices = new_indices;
+#else /* OBJC_SPARSE2 */
+ arr->buckets = new_buckets;
+#endif
+
+ return arr;
+}
+
+
+/* Reallocate the sparse array to hold `newsize' entries
+ Note: We really allocate and then free. We have to do this to ensure that
+ any concurrent readers notice the update. */
+
+void
+sarray_realloc (struct sarray *array, int newsize)
+{
+#ifdef OBJC_SPARSE3
+ size_t old_max_index = (array->capacity - 1)/INDEX_CAPACITY;
+ size_t new_max_index = ((newsize - 1)/INDEX_CAPACITY);
+ size_t rounded_size = (new_max_index + 1) * INDEX_CAPACITY;
+
+ struct sindex **new_indices;
+ struct sindex **old_indices;
+
+#else /* OBJC_SPARSE2 */
+ size_t old_max_index = (array->capacity - 1)/BUCKET_SIZE;
+ size_t new_max_index = ((newsize - 1)/BUCKET_SIZE);
+ size_t rounded_size = (new_max_index + 1) * BUCKET_SIZE;
+
+ struct sbucket **new_buckets;
+ struct sbucket **old_buckets;
+
+#endif
+
+ size_t counter;
+
+ assert (newsize > 0);
+
+ /* The size is the same, just ignore the request */
+ if (rounded_size <= array->capacity)
+ return;
+
+ assert (array->ref_count == 1); /* stop if lazy copied... */
+
+ /* We are asked to extend the array -- allocate new bucket table, */
+ /* and insert empty_bucket in newly allocated places. */
+ if (rounded_size > array->capacity)
+ {
+
+#ifdef OBJC_SPARSE3
+ new_max_index += 4;
+ rounded_size = (new_max_index + 1) * INDEX_CAPACITY;
+
+#else /* OBJC_SPARSE2 */
+ new_max_index += 4;
+ rounded_size = (new_max_index + 1) * BUCKET_SIZE;
+#endif
+
+ /* update capacity */
+ array->capacity = rounded_size;
+
+#ifdef OBJC_SPARSE3
+ /* alloc to force re-read by any concurrent readers. */
+ old_indices = array->indices;
+ new_indices = (struct sindex **)
+ objc_malloc ((new_max_index + 1) * sizeof (struct sindex *));
+#else /* OBJC_SPARSE2 */
+ old_buckets = array->buckets;
+ new_buckets = (struct sbucket **)
+ objc_malloc ((new_max_index + 1) * sizeof (struct sbucket *));
+#endif
+
+ /* copy buckets below old_max_index (they are still valid) */
+ for (counter = 0; counter <= old_max_index; counter++ ) {
+#ifdef OBJC_SPARSE3
+ new_indices[counter] = old_indices[counter];
+#else /* OBJC_SPARSE2 */
+ new_buckets[counter] = old_buckets[counter];
+#endif
+ }
+
+#ifdef OBJC_SPARSE3
+ /* reset entries above old_max_index to empty_bucket */
+ for (counter = old_max_index + 1; counter <= new_max_index; counter++)
+ new_indices[counter] = array->empty_index;
+#else /* OBJC_SPARSE2 */
+ /* reset entries above old_max_index to empty_bucket */
+ for (counter = old_max_index + 1; counter <= new_max_index; counter++)
+ new_buckets[counter] = array->empty_bucket;
+#endif
+
+#ifdef OBJC_SPARSE3
+ /* install the new indices */
+ array->indices = new_indices;
+#else /* OBJC_SPARSE2 */
+ array->buckets = new_buckets;
+#endif
+
+#ifdef OBJC_SPARSE3
+ /* free the old indices */
+ sarray_free_garbage (old_indices);
+#else /* OBJC_SPARSE2 */
+ sarray_free_garbage (old_buckets);
+#endif
+
+ idxsize += (new_max_index-old_max_index);
+ return;
+ }
+}
+
+
+/* Free a sparse array allocated with sarray_new */
+
+void
+sarray_free (struct sarray *array) {
+#ifdef OBJC_SPARSE3
+ size_t old_max_index = (array->capacity - 1)/INDEX_CAPACITY;
+ struct sindex **old_indices;
+#else
+ size_t old_max_index = (array->capacity - 1)/BUCKET_SIZE;
+ struct sbucket **old_buckets;
+#endif
+ size_t counter = 0;
+
+ assert (array->ref_count != 0); /* Freed multiple times!!! */
+
+ if (--(array->ref_count) != 0) /* There exists copies of me */
+ return;
+
+#ifdef OBJC_SPARSE3
+ old_indices = array->indices;
+#else
+ old_buckets = array->buckets;
+#endif
+
+ /* Free all entries that do not point to empty_bucket */
+ for (counter = 0; counter <= old_max_index; counter++ ) {
+#ifdef OBJC_SPARSE3
+ struct sindex *idx = old_indices[counter];
+ if ((idx != array->empty_index) &&
+ (idx->version.version == array->version.version)) {
+ int c2;
+ for (c2 = 0; c2 < INDEX_SIZE; c2++) {
+ struct sbucket *bkt = idx->buckets[c2];
+ if ((bkt != array->empty_bucket) &&
+ (bkt->version.version == array->version.version))
+ {
+ sarray_free_garbage (bkt);
+ nbuckets -= 1;
+ }
+ }
+ sarray_free_garbage (idx);
+ nindices -= 1;
+ }
+#else /* OBJC_SPARSE2 */
+ struct sbucket *bkt = array->buckets[counter];
+ if ((bkt != array->empty_bucket) &&
+ (bkt->version.version == array->version.version))
+ {
+ sarray_free_garbage (bkt);
+ nbuckets -= 1;
+ }
+#endif
+ }
+
+#ifdef OBJC_SPARSE3
+ /* free empty_index */
+ if (array->empty_index->version.version == array->version.version) {
+ sarray_free_garbage (array->empty_index);
+ nindices -= 1;
+ }
+#endif
+
+ /* free empty_bucket */
+ if (array->empty_bucket->version.version == array->version.version) {
+ sarray_free_garbage (array->empty_bucket);
+ nbuckets -= 1;
+ }
+ idxsize -= (old_max_index + 1);
+ narrays -= 1;
+
+#ifdef OBJC_SPARSE3
+ /* free bucket table */
+ sarray_free_garbage (array->indices);
+
+#else
+ /* free bucket table */
+ sarray_free_garbage (array->buckets);
+
+#endif
+
+ /* If this is a copy of another array, we free it (which might just
+ * decrement its reference count so it will be freed when no longer in use).
+ */
+ if (array->is_copy_of)
+ sarray_free (array->is_copy_of);
+
+ /* free array */
+ sarray_free_garbage (array);
+}
+
+/* This is a lazy copy. Only the core of the structure is actually */
+/* copied. */
+
+struct sarray *
+sarray_lazy_copy (struct sarray *oarr)
+{
+ struct sarray *arr;
+
+#ifdef OBJC_SPARSE3
+ size_t num_indices = ((oarr->capacity - 1)/INDEX_CAPACITY) + 1;
+ struct sindex **new_indices;
+#else /* OBJC_SPARSE2 */
+ size_t num_indices = ((oarr->capacity - 1)/BUCKET_SIZE) + 1;
+ struct sbucket **new_buckets;
+#endif
+
+ /* Allocate core array */
+ arr = (struct sarray *) objc_malloc (sizeof (struct sarray)); /* !!! */
+ arr->version.version = oarr->version.version + 1;
+#ifdef OBJC_SPARSE3
+ arr->empty_index = oarr->empty_index;
+#endif
+ arr->empty_bucket = oarr->empty_bucket;
+ arr->ref_count = 1;
+ oarr->ref_count += 1;
+ arr->is_copy_of = oarr;
+ arr->capacity = oarr->capacity;
+
+#ifdef OBJC_SPARSE3
+ /* Copy bucket table */
+ new_indices = (struct sindex **)
+ objc_malloc (sizeof (struct sindex *) * num_indices);
+ memcpy (new_indices, oarr->indices, sizeof (struct sindex *) * num_indices);
+ arr->indices = new_indices;
+#else
+ /* Copy bucket table */
+ new_buckets = (struct sbucket **)
+ objc_malloc (sizeof (struct sbucket *) * num_indices);
+ memcpy (new_buckets, oarr->buckets, sizeof (struct sbucket *) * num_indices);
+ arr->buckets = new_buckets;
+#endif
+
+ idxsize += num_indices;
+ narrays += 1;
+
+ return arr;
+}
Added: llvm-gcc-4.2/trunk/libobjc/selector.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/selector.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/selector.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/selector.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,490 @@
+/* GNU Objective C Runtime selector related functions
+ Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/runtime.h"
+#include "objc/sarray.h"
+#include "objc/encoding.h"
+
+/* Initial selector hash table size. Value doesn't matter much */
+#define SELECTOR_HASH_SIZE 128
+
+/* Tables mapping selector names to uid and opposite */
+static struct sarray *__objc_selector_array = 0; /* uid -> sel !T:MUTEX */
+static struct sarray *__objc_selector_names = 0; /* uid -> name !T:MUTEX */
+static cache_ptr __objc_selector_hash = 0; /* name -> uid !T:MUTEX */
+
+/* Number of selectors stored in each of the above tables */
+unsigned int __objc_selector_max_index = 0; /* !T:MUTEX */
+
+void __objc_init_selector_tables (void)
+{
+ __objc_selector_array = sarray_new (SELECTOR_HASH_SIZE, 0);
+ __objc_selector_names = sarray_new (SELECTOR_HASH_SIZE, 0);
+ __objc_selector_hash
+ = objc_hash_new (SELECTOR_HASH_SIZE,
+ (hash_func_type) objc_hash_string,
+ (compare_func_type) objc_compare_strings);
+}
+
+/* This routine is given a class and records all of the methods in its class
+ structure in the record table. */
+void
+__objc_register_selectors_from_class (Class class)
+{
+ MethodList_t method_list;
+
+ method_list = class->methods;
+ while (method_list)
+ {
+ __objc_register_selectors_from_list (method_list);
+ method_list = method_list->method_next;
+ }
+}
+
+
+/* This routine is given a list of methods and records each of the methods in
+ the record table. This is the routine that does the actual recording
+ work.
+
+ The name and type pointers in the method list must be permanent and
+ immutable.
+ */
+void
+__objc_register_selectors_from_list (MethodList_t method_list)
+{
+ int i = 0;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+ while (i < method_list->method_count)
+ {
+ Method_t method = &method_list->method_list[i];
+ if (method->method_name)
+ {
+ method->method_name
+ = __sel_register_typed_name ((const char *) method->method_name,
+ method->method_types, 0, YES);
+ }
+ i += 1;
+ }
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+
+/* Register instance methods as class methods for root classes */
+void __objc_register_instance_methods_to_class (Class class)
+{
+ MethodList_t method_list;
+ MethodList_t class_method_list;
+ int max_methods_no = 16;
+ MethodList_t new_list;
+ Method_t curr_method;
+
+ /* Only if a root class. */
+ if (class->super_class)
+ return;
+
+ /* Allocate a method list to hold the new class methods */
+ new_list = objc_calloc (sizeof (struct objc_method_list)
+ + sizeof (struct objc_method[max_methods_no]), 1);
+ method_list = class->methods;
+ class_method_list = class->class_pointer->methods;
+ curr_method = &new_list->method_list[0];
+
+ /* Iterate through the method lists for the class */
+ while (method_list)
+ {
+ int i;
+
+ /* Iterate through the methods from this method list */
+ for (i = 0; i < method_list->method_count; i++)
+ {
+ Method_t mth = &method_list->method_list[i];
+ if (mth->method_name
+ && ! search_for_method_in_list (class_method_list,
+ mth->method_name))
+ {
+ /* This instance method isn't a class method.
+ Add it into the new_list. */
+ *curr_method = *mth;
+
+ /* Reallocate the method list if necessary */
+ if (++new_list->method_count == max_methods_no)
+ new_list =
+ objc_realloc (new_list, sizeof (struct objc_method_list)
+ + sizeof (struct
+ objc_method[max_methods_no += 16]));
+ curr_method = &new_list->method_list[new_list->method_count];
+ }
+ }
+
+ method_list = method_list->method_next;
+ }
+
+ /* If we created any new class methods
+ then attach the method list to the class */
+ if (new_list->method_count)
+ {
+ new_list =
+ objc_realloc (new_list, sizeof (struct objc_method_list)
+ + sizeof (struct objc_method[new_list->method_count]));
+ new_list->method_next = class->class_pointer->methods;
+ class->class_pointer->methods = new_list;
+ }
+ else
+ objc_free(new_list);
+
+ __objc_update_dispatch_table_for_class (class->class_pointer);
+}
+
+
+/* Returns YES iff t1 and t2 have same method types, but we ignore
+ the argframe layout */
+BOOL
+sel_types_match (const char *t1, const char *t2)
+{
+ if (! t1 || ! t2)
+ return NO;
+ while (*t1 && *t2)
+ {
+ if (*t1 == '+') t1++;
+ if (*t2 == '+') t2++;
+ while (isdigit ((unsigned char) *t1)) t1++;
+ while (isdigit ((unsigned char) *t2)) t2++;
+ /* xxx Remove these next two lines when qualifiers are put in
+ all selectors, not just Protocol selectors. */
+ t1 = objc_skip_type_qualifiers (t1);
+ t2 = objc_skip_type_qualifiers (t2);
+ if (! *t1 && ! *t2)
+ return YES;
+ if (*t1 != *t2)
+ return NO;
+ t1++;
+ t2++;
+ }
+ return NO;
+}
+
+/* return selector representing name */
+SEL
+sel_get_typed_uid (const char *name, const char *types)
+{
+ struct objc_list *l;
+ sidx i;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
+ if (i == 0)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return 0;
+ }
+
+ for (l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
+ l; l = l->tail)
+ {
+ SEL s = (SEL) l->head;
+ if (types == 0 || s->sel_types == 0)
+ {
+ if (s->sel_types == types)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return s;
+ }
+ }
+ else if (sel_types_match (s->sel_types, types))
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return s;
+ }
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return 0;
+}
+
+/* Return selector representing name; prefer a selector with non-NULL type */
+SEL
+sel_get_any_typed_uid (const char *name)
+{
+ struct objc_list *l;
+ sidx i;
+ SEL s = NULL;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
+ if (i == 0)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return 0;
+ }
+
+ for (l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
+ l; l = l->tail)
+ {
+ s = (SEL) l->head;
+ if (s->sel_types)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return s;
+ }
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return s;
+}
+
+/* return selector representing name */
+SEL
+sel_get_any_uid (const char *name)
+{
+ struct objc_list *l;
+ sidx i;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
+ if (soffset_decode (i) == 0)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return 0;
+ }
+
+ l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ if (l == 0)
+ return 0;
+
+ return (SEL) l->head;
+}
+
+/* return selector representing name */
+SEL
+sel_get_uid (const char *name)
+{
+ return sel_register_typed_name (name, 0);
+}
+
+/* Get name of selector. If selector is unknown, the empty string ""
+ is returned */
+const char *sel_get_name (SEL selector)
+{
+ const char *ret;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+ if ((soffset_decode ((sidx)selector->sel_id) > 0)
+ && (soffset_decode ((sidx)selector->sel_id) <= __objc_selector_max_index))
+ ret = sarray_get_safe (__objc_selector_names, (sidx) selector->sel_id);
+ else
+ ret = 0;
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return ret;
+}
+
+BOOL
+sel_is_mapped (SEL selector)
+{
+ unsigned int idx = soffset_decode ((sidx)selector->sel_id);
+ return ((idx > 0) && (idx <= __objc_selector_max_index));
+}
+
+
+const char *sel_get_type (SEL selector)
+{
+ if (selector)
+ return selector->sel_types;
+ else
+ return 0;
+}
+
+/* The uninstalled dispatch table */
+extern struct sarray *__objc_uninstalled_dtable;
+
+/* __sel_register_typed_name allocates lots of struct objc_selector:s
+ of 8 (16, if pointers are 64 bits) bytes at startup. To reduce the number
+ of malloc calls and memory lost to malloc overhead, we allocate
+ objc_selector:s in blocks here. This is only called from
+ __sel_register_typed_name, and __sel_register_typed_name may only be
+ called when __objc_runtime_mutex is locked.
+
+ Note that the objc_selector:s allocated from __sel_register_typed_name
+ are never freed.
+
+ 62 because 62 * sizeof (struct objc_selector) = 496 (992). This should
+ let malloc add some overhead and use a nice, round 512 (1024) byte chunk.
+ */
+#define SELECTOR_POOL_SIZE 62
+static struct objc_selector *selector_pool;
+static int selector_pool_left;
+
+static struct objc_selector *
+pool_alloc_selector(void)
+{
+ if (!selector_pool_left)
+ {
+ selector_pool = objc_malloc (sizeof (struct objc_selector)
+ * SELECTOR_POOL_SIZE);
+ selector_pool_left = SELECTOR_POOL_SIZE;
+ }
+ return &selector_pool[--selector_pool_left];
+}
+
+/* Store the passed selector name in the selector record and return its
+ selector value (value returned by sel_get_uid).
+ Assumes that the calling function has locked down __objc_runtime_mutex. */
+/* is_const parameter tells us if the name and types parameters
+ are really constant or not. If YES then they are constant and
+ we can just store the pointers. If NO then we need to copy
+ name and types because the pointers may disappear later on. */
+SEL
+__sel_register_typed_name (const char *name, const char *types,
+ struct objc_selector *orig, BOOL is_const)
+{
+ struct objc_selector *j;
+ sidx i;
+ struct objc_list *l;
+
+ i = (sidx) objc_hash_value_for_key (__objc_selector_hash, name);
+ if (soffset_decode (i) != 0)
+ {
+ for (l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
+ l; l = l->tail)
+ {
+ SEL s = (SEL) l->head;
+ if (types == 0 || s->sel_types == 0)
+ {
+ if (s->sel_types == types)
+ {
+ if (orig)
+ {
+ orig->sel_id = (void *) i;
+ return orig;
+ }
+ else
+ return s;
+ }
+ }
+ else if (! strcmp (s->sel_types, types))
+ {
+ if (orig)
+ {
+ orig->sel_id = (void *) i;
+ return orig;
+ }
+ else
+ return s;
+ }
+ }
+ if (orig)
+ j = orig;
+ else
+ j = pool_alloc_selector ();
+
+ j->sel_id = (void *) i;
+ /* Can we use the pointer or must copy types? Don't copy if NULL */
+ if ((is_const) || (types == 0))
+ j->sel_types = (const char *) types;
+ else {
+ j->sel_types = (char *) objc_malloc (strlen (types) + 1);
+ strcpy ((char *) j->sel_types, types);
+ }
+ l = (struct objc_list *) sarray_get_safe (__objc_selector_array, i);
+ }
+ else
+ {
+ __objc_selector_max_index += 1;
+ i = soffset_encode (__objc_selector_max_index);
+ if (orig)
+ j = orig;
+ else
+ j = pool_alloc_selector ();
+
+ j->sel_id = (void *) i;
+ /* Can we use the pointer or must copy types? Don't copy if NULL */
+ if ((is_const) || (types == 0))
+ j->sel_types = (const char *) types;
+ else {
+ j->sel_types = (char *) objc_malloc (strlen (types) + 1);
+ strcpy ((char *) j->sel_types, types);
+ }
+ l = 0;
+ }
+
+ DEBUG_PRINTF ("Record selector %s[%s] as: %ld\n", name, types,
+ (long) soffset_decode (i));
+
+ {
+ int is_new = (l == 0);
+ const char *new_name;
+
+ /* Can we use the pointer or must copy name? Don't copy if NULL */
+ if ((is_const) || (name == 0))
+ new_name = name;
+ else {
+ new_name = (char *) objc_malloc (strlen (name) + 1);
+ strcpy ((char *) new_name, name);
+ }
+
+ l = list_cons ((void *) j, l);
+ sarray_at_put_safe (__objc_selector_names, i, (void *) new_name);
+ sarray_at_put_safe (__objc_selector_array, i, (void *) l);
+ if (is_new)
+ objc_hash_add (&__objc_selector_hash, (void *) new_name, (void *) i);
+ }
+
+ sarray_realloc (__objc_uninstalled_dtable, __objc_selector_max_index + 1);
+
+ return (SEL) j;
+}
+
+SEL
+sel_register_name (const char *name)
+{
+ SEL ret;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+ /* Assume that name is not constant static memory and needs to be
+ copied before put into a runtime structure. is_const == NO */
+ ret = __sel_register_typed_name (name, 0, 0, NO);
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ return ret;
+}
+
+SEL
+sel_register_typed_name (const char *name, const char *type)
+{
+ SEL ret;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+ /* Assume that name and type are not constant static memory and need to
+ be copied before put into a runtime structure. is_const == NO */
+ ret = __sel_register_typed_name (name, type, 0, NO);
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ return ret;
+}
Added: llvm-gcc-4.2/trunk/libobjc/sendmsg.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/sendmsg.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/sendmsg.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/sendmsg.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,701 @@
+/* GNU Objective C Runtime message lookup
+ Copyright (C) 1993, 1995, 1996, 1997, 1998,
+ 2001, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Kresten Krab Thorup
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+/* FIXME: This file has no business including tm.h. */
+/* FIXME: This should be using libffi instead of __builtin_apply
+ and friends. */
+
+#include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "objc/runtime.h"
+#include "objc/sarray.h"
+#include "objc/encoding.h"
+#include "runtime-info.h"
+
+/* This is how we hack STRUCT_VALUE to be 1 or 0. */
+#define gen_rtx(args...) 1
+#define gen_rtx_MEM(args...) 1
+#define gen_rtx_REG(args...) 1
+#define rtx int
+
+#if ! defined (STRUCT_VALUE) || STRUCT_VALUE == 0
+#define INVISIBLE_STRUCT_RETURN 1
+#else
+#define INVISIBLE_STRUCT_RETURN 0
+#endif
+
+/* The uninstalled dispatch table */
+struct sarray *__objc_uninstalled_dtable = 0; /* !T:MUTEX */
+
+/* Hook for method forwarding. If it is set, is invoked to return a
+ function that performs the real forwarding. Otherwise the libgcc
+ based functions (__builtin_apply and friends) are used. */
+IMP (*__objc_msg_forward) (SEL) = NULL;
+
+/* Send +initialize to class */
+static void __objc_send_initialize (Class);
+
+static void __objc_install_dispatch_table_for_class (Class);
+
+/* Forward declare some functions */
+static void __objc_init_install_dtable (id, SEL);
+
+/* Various forwarding functions that are used based upon the
+ return type for the selector.
+ __objc_block_forward for structures.
+ __objc_double_forward for floats/doubles.
+ __objc_word_forward for pointers or types that fit in registers.
+ */
+static double __objc_double_forward (id, SEL, ...);
+static id __objc_word_forward (id, SEL, ...);
+typedef struct { id many[8]; } __big;
+#if INVISIBLE_STRUCT_RETURN
+static __big
+#else
+static id
+#endif
+__objc_block_forward (id, SEL, ...);
+static Method_t search_for_method_in_hierarchy (Class class, SEL sel);
+Method_t search_for_method_in_list (MethodList_t list, SEL op);
+id nil_method (id, SEL);
+
+/* Given a selector, return the proper forwarding implementation. */
+inline
+IMP
+__objc_get_forward_imp (SEL sel)
+{
+ /* If a custom forwarding hook was registered, try getting a forwarding
+ * function from it. */
+ if (__objc_msg_forward)
+ {
+ IMP result;
+ if ((result = __objc_msg_forward (sel)) != NULL)
+ return result;
+ }
+
+ /* In all other cases, use the default forwarding functions built using
+ * __builtin_apply and friends. */
+ {
+ const char *t = sel->sel_types;
+
+ if (t && (*t == '[' || *t == '(' || *t == '{')
+#ifdef OBJC_MAX_STRUCT_BY_VALUE
+ && objc_sizeof_type (t) > OBJC_MAX_STRUCT_BY_VALUE
+#endif
+ )
+ return (IMP)__objc_block_forward;
+ else if (t && (*t == 'f' || *t == 'd'))
+ return (IMP)__objc_double_forward;
+ else
+ return (IMP)__objc_word_forward;
+ }
+}
+
+/* Given a class and selector, return the selector's implementation. */
+inline
+IMP
+get_imp (Class class, SEL sel)
+{
+ /* In a vanilla implementation we would first check if the dispatch
+ table is installed. Here instead, to get more speed in the
+ standard case (that the dispatch table is installed) we first try
+ to get the imp using brute force. Only if that fails, we do what
+ we should have been doing from the very beginning, that is, check
+ if the dispatch table needs to be installed, install it if it's
+ not installed, and retrieve the imp from the table if it's
+ installed. */
+ void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
+ if (res == 0)
+ {
+ /* Not a valid method */
+ if (class->dtable == __objc_uninstalled_dtable)
+ {
+ /* The dispatch table needs to be installed. */
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* Double-checked locking pattern: Check
+ __objc_uninstalled_dtable again in case another thread
+ installed the dtable while we were waiting for the lock
+ to be released. */
+ if (class->dtable == __objc_uninstalled_dtable)
+ {
+ __objc_install_dispatch_table_for_class (class);
+ }
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+ /* Call ourselves with the installed dispatch table
+ and get the real method */
+ res = get_imp (class, sel);
+ }
+ else
+ {
+ /* The dispatch table has been installed. */
+
+ /* Get the method from the dispatch table (we try to get it
+ again in case another thread has installed the dtable just
+ after we invoked sarray_get_safe, but before we checked
+ class->dtable == __objc_uninstalled_dtable).
+ */
+ res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
+ if (res == 0)
+ {
+ /* The dispatch table has been installed, and the method
+ is not in the dispatch table. So the method just
+ doesn't exist for the class. Return the forwarding
+ implementation. */
+ res = __objc_get_forward_imp (sel);
+ }
+ }
+ }
+ return res;
+}
+
+/* Query if an object can respond to a selector, returns YES if the
+object implements the selector otherwise NO. Does not check if the
+method can be forwarded. */
+inline
+BOOL
+__objc_responds_to (id object, SEL sel)
+{
+ void *res;
+
+ /* Install dispatch table if need be */
+ if (object->class_pointer->dtable == __objc_uninstalled_dtable)
+ {
+ objc_mutex_lock (__objc_runtime_mutex);
+ if (object->class_pointer->dtable == __objc_uninstalled_dtable)
+ {
+ __objc_install_dispatch_table_for_class (object->class_pointer);
+ }
+ objc_mutex_unlock (__objc_runtime_mutex);
+ }
+
+ /* Get the method from the dispatch table */
+ res = sarray_get_safe (object->class_pointer->dtable, (size_t) sel->sel_id);
+ return (res != 0);
+}
+
+/* This is the lookup function. All entries in the table are either a
+ valid method *or* zero. If zero then either the dispatch table
+ needs to be installed or it doesn't exist and forwarding is attempted. */
+inline
+IMP
+objc_msg_lookup (id receiver, SEL op)
+{
+ IMP result;
+ if (receiver)
+ {
+ result = sarray_get_safe (receiver->class_pointer->dtable,
+ (sidx)op->sel_id);
+ if (result == 0)
+ {
+ /* Not a valid method */
+ if (receiver->class_pointer->dtable == __objc_uninstalled_dtable)
+ {
+ /* The dispatch table needs to be installed.
+ This happens on the very first method call to the class. */
+ __objc_init_install_dtable (receiver, op);
+
+ /* Get real method for this in newly installed dtable */
+ result = get_imp (receiver->class_pointer, op);
+ }
+ else
+ {
+ /* The dispatch table has been installed. Check again
+ if the method exists (just in case the dispatch table
+ has been installed by another thread after we did the
+ previous check that the method exists).
+ */
+ result = sarray_get_safe (receiver->class_pointer->dtable,
+ (sidx)op->sel_id);
+ if (result == 0)
+ {
+ /* If the method still just doesn't exist for the
+ class, attempt to forward the method. */
+ result = __objc_get_forward_imp (op);
+ }
+ }
+ }
+ return result;
+ }
+ else
+ return (IMP)nil_method;
+}
+
+IMP
+objc_msg_lookup_super (Super_t super, SEL sel)
+{
+ if (super->self)
+ return get_imp (super->class, sel);
+ else
+ return (IMP)nil_method;
+}
+
+int method_get_sizeof_arguments (Method *);
+
+retval_t
+objc_msg_sendv (id object, SEL op, arglist_t arg_frame)
+{
+ Method *m = class_get_instance_method (object->class_pointer, op);
+ const char *type;
+ *((id *) method_get_first_argument (m, arg_frame, &type)) = object;
+ *((SEL *) method_get_next_argument (arg_frame, &type)) = op;
+ return __builtin_apply ((apply_t) m->method_imp,
+ arg_frame,
+ method_get_sizeof_arguments (m));
+}
+
+void
+__objc_init_dispatch_tables ()
+{
+ __objc_uninstalled_dtable = sarray_new (200, 0);
+}
+
+/* This function is called by objc_msg_lookup when the
+ dispatch table needs to be installed; thus it is called once
+ for each class, namely when the very first message is sent to it. */
+static void
+__objc_init_install_dtable (id receiver, SEL op __attribute__ ((__unused__)))
+{
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* This may happen, if the programmer has taken the address of a
+ method before the dtable was initialized... too bad for him! */
+ if (receiver->class_pointer->dtable != __objc_uninstalled_dtable)
+ {
+ objc_mutex_unlock (__objc_runtime_mutex);
+ return;
+ }
+
+ if (CLS_ISCLASS (receiver->class_pointer))
+ {
+ /* receiver is an ordinary object */
+ assert (CLS_ISCLASS (receiver->class_pointer));
+
+ /* install instance methods table */
+ __objc_install_dispatch_table_for_class (receiver->class_pointer);
+
+ /* call +initialize -- this will in turn install the factory
+ dispatch table if not already done :-) */
+ __objc_send_initialize (receiver->class_pointer);
+ }
+ else
+ {
+ /* receiver is a class object */
+ assert (CLS_ISCLASS ((Class)receiver));
+ assert (CLS_ISMETA (receiver->class_pointer));
+
+ /* Install real dtable for factory methods */
+ __objc_install_dispatch_table_for_class (receiver->class_pointer);
+
+ __objc_send_initialize ((Class)receiver);
+ }
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* Install dummy table for class which causes the first message to
+ that class (or instances hereof) to be initialized properly */
+void
+__objc_install_premature_dtable (Class class)
+{
+ assert (__objc_uninstalled_dtable);
+ class->dtable = __objc_uninstalled_dtable;
+}
+
+/* Send +initialize to class if not already done */
+static void
+__objc_send_initialize (Class class)
+{
+ /* This *must* be a class object */
+ assert (CLS_ISCLASS (class));
+ assert (! CLS_ISMETA (class));
+
+ if (! CLS_ISINITIALIZED (class))
+ {
+ CLS_SETINITIALIZED (class);
+ CLS_SETINITIALIZED (class->class_pointer);
+
+ /* Create the garbage collector type memory description */
+ __objc_generate_gc_type_description (class);
+
+ if (class->super_class)
+ __objc_send_initialize (class->super_class);
+
+ {
+ SEL op = sel_register_name ("initialize");
+ IMP imp = 0;
+ MethodList_t method_list = class->class_pointer->methods;
+
+ while (method_list) {
+ int i;
+ Method_t method;
+
+ for (i = 0; i < method_list->method_count; i++) {
+ method = &(method_list->method_list[i]);
+ if (method->method_name
+ && method->method_name->sel_id == op->sel_id) {
+ imp = method->method_imp;
+ break;
+ }
+ }
+
+ if (imp)
+ break;
+
+ method_list = method_list->method_next;
+
+ }
+ if (imp)
+ (*imp) ((id) class, op);
+
+ }
+ }
+}
+
+/* Walk on the methods list of class and install the methods in the reverse
+ order of the lists. Since methods added by categories are before the methods
+ of class in the methods list, this allows categories to substitute methods
+ declared in class. However if more than one category replaces the same
+ method nothing is guaranteed about what method will be used.
+ Assumes that __objc_runtime_mutex is locked down. */
+static void
+__objc_install_methods_in_dtable (Class class, MethodList_t method_list)
+{
+ int i;
+
+ if (! method_list)
+ return;
+
+ if (method_list->method_next)
+ __objc_install_methods_in_dtable (class, method_list->method_next);
+
+ for (i = 0; i < method_list->method_count; i++)
+ {
+ Method_t method = &(method_list->method_list[i]);
+ sarray_at_put_safe (class->dtable,
+ (sidx) method->method_name->sel_id,
+ method->method_imp);
+ }
+}
+
+/* Assumes that __objc_runtime_mutex is locked down. */
+static void
+__objc_install_dispatch_table_for_class (Class class)
+{
+ Class super;
+
+ /* If the class has not yet had its class links resolved, we must
+ re-compute all class links */
+ if (! CLS_ISRESOLV (class))
+ __objc_resolve_class_links ();
+
+ super = class->super_class;
+
+ if (super != 0 && (super->dtable == __objc_uninstalled_dtable))
+ __objc_install_dispatch_table_for_class (super);
+
+ /* Allocate dtable if necessary */
+ if (super == 0)
+ {
+ objc_mutex_lock (__objc_runtime_mutex);
+ class->dtable = sarray_new (__objc_selector_max_index, 0);
+ objc_mutex_unlock (__objc_runtime_mutex);
+ }
+ else
+ class->dtable = sarray_lazy_copy (super->dtable);
+
+ __objc_install_methods_in_dtable (class, class->methods);
+}
+
+void
+__objc_update_dispatch_table_for_class (Class class)
+{
+ Class next;
+ struct sarray *arr;
+
+ /* not yet installed -- skip it */
+ if (class->dtable == __objc_uninstalled_dtable)
+ return;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ arr = class->dtable;
+ __objc_install_premature_dtable (class); /* someone might require it... */
+ sarray_free (arr); /* release memory */
+
+ /* could have been lazy... */
+ __objc_install_dispatch_table_for_class (class);
+
+ if (class->subclass_list) /* Traverse subclasses */
+ for (next = class->subclass_list; next; next = next->sibling_class)
+ __objc_update_dispatch_table_for_class (next);
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+
+/* This function adds a method list to a class. This function is
+ typically called by another function specific to the run-time. As
+ such this function does not worry about thread safe issues.
+
+ This one is only called for categories. Class objects have their
+ methods installed right away, and their selectors are made into
+ SEL's by the function __objc_register_selectors_from_class. */
+void
+class_add_method_list (Class class, MethodList_t list)
+{
+ /* Passing of a linked list is not allowed. Do multiple calls. */
+ assert (! list->method_next);
+
+ __objc_register_selectors_from_list(list);
+
+ /* Add the methods to the class's method list. */
+ list->method_next = class->methods;
+ class->methods = list;
+
+ /* Update the dispatch table of class */
+ __objc_update_dispatch_table_for_class (class);
+}
+
+Method_t
+class_get_instance_method (Class class, SEL op)
+{
+ return search_for_method_in_hierarchy (class, op);
+}
+
+Method_t
+class_get_class_method (MetaClass class, SEL op)
+{
+ return search_for_method_in_hierarchy (class, op);
+}
+
+
+/* Search for a method starting from the current class up its hierarchy.
+ Return a pointer to the method's method structure if found. NULL
+ otherwise. */
+
+static Method_t
+search_for_method_in_hierarchy (Class cls, SEL sel)
+{
+ Method_t method = NULL;
+ Class class;
+
+ if (! sel_is_mapped (sel))
+ return NULL;
+
+ /* Scan the method list of the class. If the method isn't found in the
+ list then step to its super class. */
+ for (class = cls; ((! method) && class); class = class->super_class)
+ method = search_for_method_in_list (class->methods, sel);
+
+ return method;
+}
+
+
+
+/* Given a linked list of method and a method's name. Search for the named
+ method's method structure. Return a pointer to the method's method
+ structure if found. NULL otherwise. */
+Method_t
+search_for_method_in_list (MethodList_t list, SEL op)
+{
+ MethodList_t method_list = list;
+
+ if (! sel_is_mapped (op))
+ return NULL;
+
+ /* If not found then we'll search the list. */
+ while (method_list)
+ {
+ int i;
+
+ /* Search the method list. */
+ for (i = 0; i < method_list->method_count; ++i)
+ {
+ Method_t method = &method_list->method_list[i];
+
+ if (method->method_name)
+ if (method->method_name->sel_id == op->sel_id)
+ return method;
+ }
+
+ /* The method wasn't found. Follow the link to the next list of
+ methods. */
+ method_list = method_list->method_next;
+ }
+
+ return NULL;
+}
+
+static retval_t __objc_forward (id object, SEL sel, arglist_t args);
+
+/* Forwarding pointers/integers through the normal registers */
+static id
+__objc_word_forward (id rcv, SEL op, ...)
+{
+ void *args, *res;
+
+ args = __builtin_apply_args ();
+ res = __objc_forward (rcv, op, args);
+ if (res)
+ __builtin_return (res);
+ else
+ return res;
+}
+
+/* Specific routine for forwarding floats/double because of
+ architectural differences on some processors. i386s for
+ example which uses a floating point stack versus general
+ registers for floating point numbers. This forward routine
+ makes sure that GCC restores the proper return values */
+static double
+__objc_double_forward (id rcv, SEL op, ...)
+{
+ void *args, *res;
+
+ args = __builtin_apply_args ();
+ res = __objc_forward (rcv, op, args);
+ __builtin_return (res);
+}
+
+#if INVISIBLE_STRUCT_RETURN
+static __big
+#else
+static id
+#endif
+__objc_block_forward (id rcv, SEL op, ...)
+{
+ void *args, *res;
+
+ args = __builtin_apply_args ();
+ res = __objc_forward (rcv, op, args);
+ if (res)
+ __builtin_return (res);
+ else
+#if INVISIBLE_STRUCT_RETURN
+ return (__big) {{0, 0, 0, 0, 0, 0, 0, 0}};
+#else
+ return nil;
+#endif
+}
+
+
+/* This function is installed in the dispatch table for all methods which are
+ not implemented. Thus, it is called when a selector is not recognized. */
+static retval_t
+__objc_forward (id object, SEL sel, arglist_t args)
+{
+ IMP imp;
+ static SEL frwd_sel = 0; /* !T:SAFE2 */
+ SEL err_sel;
+
+ /* first try if the object understands forward:: */
+ if (! frwd_sel)
+ frwd_sel = sel_get_any_uid ("forward::");
+
+ if (__objc_responds_to (object, frwd_sel))
+ {
+ imp = get_imp (object->class_pointer, frwd_sel);
+ return (*imp) (object, frwd_sel, sel, args);
+ }
+
+ /* If the object recognizes the doesNotRecognize: method then we're going
+ to send it. */
+ err_sel = sel_get_any_uid ("doesNotRecognize:");
+ if (__objc_responds_to (object, err_sel))
+ {
+ imp = get_imp (object->class_pointer, err_sel);
+ return (*imp) (object, err_sel, sel);
+ }
+
+ /* The object doesn't recognize the method. Check for responding to
+ error:. If it does then sent it. */
+ {
+ char msg[256 + strlen ((const char *) sel_get_name (sel))
+ + strlen ((const char *) object->class_pointer->name)];
+
+ sprintf (msg, "(%s) %s does not recognize %s",
+ (CLS_ISMETA (object->class_pointer)
+ ? "class"
+ : "instance" ),
+ object->class_pointer->name, sel_get_name (sel));
+
+ err_sel = sel_get_any_uid ("error:");
+ if (__objc_responds_to (object, err_sel))
+ {
+ imp = get_imp (object->class_pointer, err_sel);
+ return (*imp) (object, sel_get_any_uid ("error:"), msg);
+ }
+
+ /* The object doesn't respond to doesNotRecognize: or error:; Therefore,
+ a default action is taken. */
+ objc_error (object, OBJC_ERR_UNIMPLEMENTED, "%s\n", msg);
+
+ return 0;
+ }
+}
+
+void
+__objc_print_dtable_stats ()
+{
+ int total = 0;
+
+ objc_mutex_lock (__objc_runtime_mutex);
+
+#ifdef OBJC_SPARSE2
+ printf ("memory usage: (%s)\n", "2-level sparse arrays");
+#else
+ printf ("memory usage: (%s)\n", "3-level sparse arrays");
+#endif
+
+ printf ("arrays: %d = %ld bytes\n", narrays,
+ (long) narrays * sizeof (struct sarray));
+ total += narrays * sizeof (struct sarray);
+ printf ("buckets: %d = %ld bytes\n", nbuckets,
+ (long) nbuckets * sizeof (struct sbucket));
+ total += nbuckets * sizeof (struct sbucket);
+
+ printf ("idxtables: %d = %ld bytes\n",
+ idxsize, (long) idxsize * sizeof (void *));
+ total += idxsize * sizeof (void *);
+ printf ("-----------------------------------\n");
+ printf ("total: %d bytes\n", total);
+ printf ("===================================\n");
+
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* Returns the uninstalled dispatch table indicator.
+ If a class' dispatch table points to __objc_uninstalled_dtable
+ then that means it needs its dispatch table to be installed. */
+inline
+struct sarray *
+objc_get_uninstalled_dtable ()
+{
+ return __objc_uninstalled_dtable;
+}
Added: llvm-gcc-4.2/trunk/libobjc/thr-dce.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-dce.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-dce.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-dce.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,281 @@
+/* GNU Objective C Runtime Thread Interface
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <pthread.h>
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ return pthread_keycreate(&_objc_thread_storage, NULL);
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* Destroy the thread storage key */
+ /* Not implemented yet */
+ /* return pthread_key_delete(&_objc_thread_storage); */
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (pthread_create(&new_thread_handle, pthread_attr_default,
+ (void *)func, arg) == 0)
+ {
+ /* ??? May not work! (64bit) */
+ thread_id = *(objc_thread_t *)&new_thread_handle;
+ pthread_detach(&new_thread_handle); /* Fully detach thread. */
+ }
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ int sys_priority = 0;
+
+ switch (priority)
+ {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
+ break;
+ default:
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
+ break;
+ }
+
+ /* Change the priority. */
+ if (pthread_setprio(pthread_self(), sys_priority) >= 0)
+ return 0;
+ else
+ /* Failed */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ int sys_priority;
+
+ if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
+ if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+ if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
+ return OBJC_THREAD_BACKGROUND_PRIORITY;
+ return OBJC_THREAD_LOW_PRIORITY;
+ }
+
+ /* Failed */
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ pthread_yield();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ pthread_exit(&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ pthread_t self = pthread_self();
+
+ return (objc_thread_t) pthread_getunique_np (&self);
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ return pthread_setspecific(_objc_thread_storage, value);
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ void *value = NULL;
+
+ if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
+ return value;
+
+ return NULL;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
+ pthread_mutexattr_default))
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
+ return -1;
+ else
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
+ return -1;
+ else
+ return 0;
+ */
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
+ (pthread_mutex_t *)(&(mutex->backend)));
+ */
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-decosf1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-decosf1.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-decosf1.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-decosf1.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,281 @@
+/* GNU Objective C Runtime Thread Interface
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <pthread.h>
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ return pthread_keycreate(&_objc_thread_storage, NULL);
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* Destroy the thread storage key */
+ /* Not implemented yet */
+ /* return pthread_key_delete(&_objc_thread_storage); */
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (pthread_create(&new_thread_handle, pthread_attr_default,
+ (void *)func, arg) == 0)
+ {
+ /* ??? May not work! (64bit) */
+ thread_id = *(objc_thread_t *)&new_thread_handle;
+ pthread_detach(&new_thread_handle); /* Fully detach thread. */
+ }
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ int sys_priority = 0;
+
+ switch (priority)
+ {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
+ break;
+ default:
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
+ break;
+ }
+
+ /* Change the priority. */
+ if (pthread_setprio(pthread_self(), sys_priority) >= 0)
+ return 0;
+ else
+ /* Failed */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ int sys_priority;
+
+ if ((sys_priority = pthread_getprio(pthread_self())) >= 0) {
+ if (sys_priority >= PRI_FG_MIN_NP && sys_priority <= PRI_FG_MAX_NP)
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+ if (sys_priority >= PRI_BG_MIN_NP && sys_priority <= PRI_BG_MAX_NP)
+ return OBJC_THREAD_BACKGROUND_PRIORITY;
+ return OBJC_THREAD_LOW_PRIORITY;
+ }
+
+ /* Failed */
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ pthread_yield();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ pthread_exit(&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ pthread_t self = pthread_self();
+
+ return (objc_thread_t) pthread_getunique_np (&self);
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ return pthread_setspecific(_objc_thread_storage, value);
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ void *value = NULL;
+
+ if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
+ return value;
+
+ return NULL;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)),
+ pthread_mutexattr_default))
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
+ return -1;
+ else
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend))) != 1)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
+ return -1;
+ else
+ return 0;
+ */
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
+ (pthread_mutex_t *)(&(mutex->backend)));
+ */
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+
+ /*
+ return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
+ */
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-irix.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-irix.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-irix.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-irix.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,235 @@
+/* GNU Objective C Runtime Thread Interface - SGI IRIX Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/sysmp.h>
+#include <sys/prctl.h>
+#include <ulocks.h>
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Key structure for maintaining thread specific storage */
+static void * __objc_shared_arena_handle = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Name of IRIX arena. */
+ char arena_name[64];
+
+ DEBUG_PRINTF("__objc_init_thread_system\n");
+
+ /* Construct a temporary name for arena. */
+ sprintf(arena_name, "/usr/tmp/objc_%05u", (unsigned)getpid());
+
+ /* Up to 256 threads. Arena only for threads. */
+ usconfig(CONF_INITUSERS, 256);
+ usconfig(CONF_ARENATYPE, US_SHAREDONLY);
+
+ /* Initialize the arena */
+ if (!(__objc_shared_arena_handle = usinit(arena_name)))
+ /* Failed */
+ return -1;
+
+ return 0;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ int sys_id;
+
+ if ((sys_id = sproc((void *)func, PR_SALL, arg)) >= 0)
+ thread_id = (objc_thread_t)sys_id;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ /* Not implemented yet */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ /* Not implemented yet */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ sginap(0);
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* IRIX only has exit. */
+ exit(__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ /* Threads are processes. */
+ return (objc_thread_t)get_pid();
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ *((void **)&PRDA->usr_prda) = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return *((void **)&PRDA->usr_prda);
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (!( (ulock_t)(mutex->backend) = usnewlock(__objc_shared_arena_handle) ))
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ usfreelock((ulock_t)(mutex->backend), __objc_shared_arena_handle);
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ if (ussetlock((ulock_t)(mutex->backend)) == 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (ustestlock((ulock_t)(mutex->backend)) == 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ usunsetlock((ulock_t)(mutex->backend));
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-mach.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-mach.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-mach.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-mach.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,313 @@
+/* GNU Objective C Runtime Thread Implementation
+ Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+ Modified for Mach threads by Bill Bumgarner <bbum at friday.com>
+ Condition functions added by Mircea Oancea <mircea at first.elcom.pub.ro>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <mach/mach.h>
+#include <mach/cthreads.h>
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/*
+ Obtain the maximum thread priority that can set for t. Under the
+ mach threading model, it is possible for the developer to adjust the
+ maximum priority downward only-- cannot be raised without superuser
+ privileges. Once lowered, it cannot be raised.
+ */
+static int
+__mach_get_max_thread_priority (cthread_t t, int *base)
+{
+ thread_t threadP;
+ kern_return_t error;
+ struct thread_sched_info info;
+ unsigned int info_count=THREAD_SCHED_INFO_COUNT;
+
+ if (t == NULL)
+ return -1;
+
+ threadP = cthread_thread (t); /* get thread underlying */
+
+ error = thread_info (threadP, THREAD_SCHED_INFO,
+ (thread_info_t) &info, &info_count);
+
+ if (error != KERN_SUCCESS)
+ return -1;
+
+ if (base != NULL)
+ *base = info.base_priority;
+
+ return info.max_priority;
+}
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system (void)
+{
+ return 0;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system (void)
+{
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach (void (*func) (void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ cthread_t new_thread_handle;
+
+ /* create thread */
+ new_thread_handle = cthread_fork ((cthread_fn_t) func, arg);
+
+ if (new_thread_handle)
+ {
+ /* this is not terribly portable */
+ thread_id = *(objc_thread_t *) &new_thread_handle;
+ cthread_detach (new_thread_handle);
+ }
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority (int priority)
+{
+ objc_thread_t *t = objc_thread_id ();
+ cthread_t cT = (cthread_t) t;
+ int maxPriority = __mach_get_max_thread_priority (cT, NULL);
+ int sys_priority = 0;
+
+ if (maxPriority == -1)
+ return -1;
+
+ switch (priority)
+ {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_priority = maxPriority;
+ break;
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_priority = (maxPriority * 2) / 3;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_priority = maxPriority / 3;
+ break;
+ default:
+ return -1;
+ }
+
+ if (sys_priority == 0)
+ return -1;
+
+ /* Change the priority */
+ if (cthread_priority (cT, sys_priority, 0) == KERN_SUCCESS)
+ return 0;
+ else
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority (void)
+{
+ objc_thread_t *t = objc_thread_id ();
+ cthread_t cT = (cthread_t) t; /* see objc_thread_id () */
+ int basePriority;
+ int maxPriority;
+ int sys_priority = 0;
+
+ int interactiveT, backgroundT, lowT; /* thresholds */
+
+ maxPriority = __mach_get_max_thread_priority (cT, &basePriority);
+
+ if (maxPriority == -1)
+ return -1;
+
+ if (basePriority > ( (maxPriority * 2) / 3))
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+
+ if (basePriority > ( maxPriority / 3))
+ return OBJC_THREAD_BACKGROUND_PRIORITY;
+
+ return OBJC_THREAD_LOW_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield (void)
+{
+ cthread_yield ();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit (void)
+{
+ /* exit the thread */
+ cthread_exit (&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id (void)
+{
+ cthread_t self = cthread_self ();
+
+ return *(objc_thread_t *) &self;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data (void *value)
+{
+ cthread_set_data (cthread_self (), (any_t) value);
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data (void)
+{
+ return (void *) cthread_data (cthread_self ());
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate (objc_mutex_t mutex)
+{
+ int err = 0;
+ mutex->backend = objc_malloc (sizeof (struct mutex));
+
+ err = mutex_init ((mutex_t) (mutex->backend));
+
+ if (err != 0)
+ {
+ objc_free (mutex->backend);
+ return -1;
+ }
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ mutex_clear ((mutex_t) (mutex->backend));
+
+ objc_free (mutex->backend);
+ mutex->backend = NULL;
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock (objc_mutex_t mutex)
+{
+ mutex_lock ((mutex_t) (mutex->backend));
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock (objc_mutex_t mutex)
+{
+ if (mutex_try_lock ((mutex_t) (mutex->backend)) == 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock (objc_mutex_t mutex)
+{
+ mutex_unlock ((mutex_t) (mutex->backend));
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate (objc_condition_t condition)
+{
+ condition->backend = objc_malloc (sizeof (struct condition));
+ condition_init ((condition_t) (condition->backend));
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate (objc_condition_t condition)
+{
+ condition_clear ((condition_t) (condition->backend));
+ objc_free (condition->backend);
+ condition->backend = NULL;
+ return 0;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ condition_wait ((condition_t) (condition->backend),
+ (mutex_t) (mutex->backend));
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast (objc_condition_t condition)
+{
+ condition_broadcast ((condition_t) (condition->backend));
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal (objc_condition_t condition)
+{
+ condition_signal ((condition_t) (condition->backend));
+ return 0;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-objc.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-objc.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-objc.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-objc.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,192 @@
+/* GNU Objective C Runtime Thread Interface.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#define _LIBOBJC
+/* The line below is needed for declarations of functions such as
+ pthread_mutexattr_settype, without which gthr-posix.h may fail to
+ compile within libobjc. Unfortunately, this breaks compilation on
+ Tru64 UNIX V4.0F, so disable it there. */
+#ifndef __osf__
+#define _XOPEN_SOURCE 500
+#endif
+#include "config.h"
+#include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "defaults.h"
+#include "objc/thr.h"
+#include "objc/runtime.h"
+#include <gthr.h>
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ return __gthread_objc_init_thread_system ();
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ return __gthread_objc_close_thread_system ();
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *), void *arg)
+{
+ return __gthread_objc_thread_detach (func, arg);
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ return __gthread_objc_thread_set_priority (priority);
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ return __gthread_objc_thread_get_priority ();
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ __gthread_objc_thread_yield ();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ return __gthread_objc_thread_exit ();
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ return __gthread_objc_thread_id ();
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ return __gthread_objc_thread_set_data (value);
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return __gthread_objc_thread_get_data ();
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ return __gthread_objc_mutex_allocate (mutex);
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ return __gthread_objc_mutex_deallocate (mutex);
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ return __gthread_objc_mutex_lock (mutex);
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ return __gthread_objc_mutex_trylock (mutex);
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return __gthread_objc_mutex_unlock (mutex);
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ return __gthread_objc_condition_allocate (condition);
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return __gthread_objc_condition_deallocate (condition);
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return __gthread_objc_condition_wait (condition, mutex);
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return __gthread_objc_condition_broadcast (condition);
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return __gthread_objc_condition_signal (condition);
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-os2.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-os2.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-os2.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-os2.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,267 @@
+/* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Thomas Baier (baier at ci.tuwien.ac.at)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+#define INCL_DOSSEMAPHORES
+#define INCL_DOSPROCESS
+
+/*
+ * conflicts with objc.h: SEL, BOOL, id
+ * solution: prefixing those with _OS2_ before including <os2.h>
+ */
+#define SEL _OS2_SEL
+#define BOOL _OS2_BOOL
+#define id _OS2_id
+#include <os2.h>
+#undef id
+#undef SEL
+#undef BOOL
+
+#include <stdlib.h>
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ return 0;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ int thread_id = 0;
+
+ if ((thread_id = _beginthread (func,NULL,32768,arg)) < 0)
+ thread_id = 0;
+
+ return (objc_thread_t)thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ ULONG sys_class = 0;
+ ULONG sys_priority = 0;
+
+ /* OBJC_THREAD_INTERACTIVE_PRIORITY -> PRTYC_FOREGROUNDSERVER
+ * OBJC_THREAD_BACKGROUND_PRIORITY -> PRTYC_REGULAR
+ * OBJC_THREAD_LOW_PRIORITY -> PRTYC_IDLETIME */
+
+ switch (priority) {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_class = PRTYC_REGULAR;
+ sys_priority = 10;
+ break;
+ default:
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_class = PRTYC_IDLETIME;
+ sys_priority = 25;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_class = PRTYC_IDLETIME;
+ sys_priority = 0;
+ break;
+ }
+
+ /* Change priority */
+ if (!DosSetPriority (PRTYS_THREAD,sys_class,sys_priority,*_threadid))
+ return 0;
+ else
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ PTIB ptib;
+ PPIB ppib;
+
+ /* get information about current thread */
+ DosGetInfoBlocks (&ptib,&ppib);
+
+ switch (ptib->tib_ptib2->tib2_ulpri)
+ {
+ case PRTYC_IDLETIME:
+ case PRTYC_REGULAR:
+ case PRTYC_TIMECRITICAL:
+ case PRTYC_FOREGROUNDSERVER:
+ default:
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+ }
+
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ DosSleep (0);
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* terminate the thread, NEVER use DosExit () */
+ _endthread ();
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ return (objc_thread_t) *_threadid;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ *_threadstore () = value;
+
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return *_threadstore ();
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (DosCreateMutexSem (NULL, (HMTX)(&(mutex->backend)),0L,0) > 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ DosCloseMutexSem ((HMTX)(mutex->backend));
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ if (DosRequestMutexSem ((HMTX)(mutex->backend),-1L) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (DosRequestMutexSem ((HMTX)(mutex->backend),0L) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ if (DosReleaseMutexSem((HMTX)(mutex->backend)) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-posix.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-posix.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-posix.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-posix.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,318 @@
+/* GNU Objective C Runtime Thread Interface for POSIX compliant threads
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+ Modified for Linux/Pthreads by Kai-Uwe Sattler (kus at iti.cs.uni-magdeburg.de)
+ Modified for posix compliance by Chris Ball (cball at fmco.com)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+#include <pthread.h>
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ if (pthread_key_create(&_objc_thread_storage, NULL) == 0)
+ {
+ /*
+ * The normal default detach state for threads is PTHREAD_CREATE_JOINABLE
+ * which causes threads to not die when you think they should.
+ */
+ if (pthread_attr_init(&_objc_thread_attribs) == 0)
+ {
+ if (pthread_attr_setdetachstate(&_objc_thread_attribs,
+ PTHREAD_CREATE_DETACHED) == 0)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ if (pthread_key_delete(_objc_thread_storage) == 0)
+ {
+ if (pthread_attr_destroy(&_objc_thread_attribs) == 0)
+ return 0;
+ }
+
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if (!(pthread_create(&new_thread_handle, &_objc_thread_attribs,
+ (void *)func, arg)))
+ thread_id = *(objc_thread_t *)&new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority.
+ *
+ * Be aware that the default schedpolicy often disallows thread priorities.
+ */
+int
+__objc_thread_set_priority(int priority)
+{
+ pthread_t thread_id = pthread_self();
+ int policy;
+ struct sched_param params;
+ int priority_min, priority_max;
+
+ if (pthread_getschedparam(thread_id, &policy, ¶ms) == 0)
+ {
+ if ((priority_max = sched_get_priority_max(policy)) != 0)
+ return -1;
+
+ if ((priority_min = sched_get_priority_min(policy)) != 0)
+ return -1;
+
+ if (priority > priority_max)
+ priority = priority_max;
+ else if (priority < priority_min)
+ priority = priority_min;
+ params.sched_priority = priority;
+
+ /*
+ * The solaris 7 and several other man pages incorrectly state that
+ * this should be a pointer to policy but pthread.h is universally
+ * at odds with this.
+ */
+ if (pthread_setschedparam(thread_id, policy, ¶ms) == 0)
+ return 0;
+ }
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ int policy;
+ struct sched_param params;
+
+ if (pthread_getschedparam(pthread_self(), &policy, ¶ms) == 0)
+ return params.sched_priority;
+ else
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ sched_yield();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ pthread_exit(&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ pthread_t self = pthread_self();
+
+ return *(objc_thread_t *)&self;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ if (pthread_setspecific(_objc_thread_storage, value) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return pthread_getspecific(_objc_thread_storage);
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ mutex->backend = objc_malloc(sizeof(pthread_mutex_t));
+
+ if (pthread_mutex_init((pthread_mutex_t *)mutex->backend, NULL))
+ {
+ objc_free(mutex->backend);
+ mutex->backend = NULL;
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ int count = 1;
+
+ /*
+ * Posix Threads specifically require that the thread be unlocked for
+ * pthread_mutex_destroy to work.
+ */
+
+ while (count)
+ {
+ if ((count = pthread_mutex_unlock((pthread_mutex_t*)mutex->backend)) < 0)
+ return -1;
+ }
+
+ if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
+ return -1;
+
+ objc_free(mutex->backend);
+ mutex->backend = NULL;
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ if (pthread_mutex_lock((pthread_mutex_t *)mutex->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (pthread_mutex_trylock((pthread_mutex_t *)mutex->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ if (pthread_mutex_unlock((pthread_mutex_t *)mutex->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ condition->backend = objc_malloc(sizeof(pthread_cond_t));
+
+ if (pthread_cond_init((pthread_cond_t *)condition->backend, NULL))
+ {
+ objc_free(condition->backend);
+ condition->backend = NULL;
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ if (pthread_cond_destroy((pthread_cond_t *)condition->backend))
+ return -1;
+
+ objc_free(condition->backend);
+ condition->backend = NULL;
+ return 0;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ if (pthread_cond_wait((pthread_cond_t *)condition->backend,
+ (pthread_mutex_t *)mutex->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ if (pthread_cond_broadcast((pthread_cond_t *)condition->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ if (pthread_cond_signal((pthread_cond_t *)condition->backend) == 0)
+ return 0;
+ else
+ return -1;
+}
Added: llvm-gcc-4.2/trunk/libobjc/thr-pthreads.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-pthreads.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-pthreads.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-pthreads.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,218 @@
+/* GNU Objective C Runtime Thread Implementation for PCThreads under GNU/Linux.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Scott Christley <scottc at net-community.com>
+ Condition functions added by: Mircea Oancea <mircea at first.elcom.pub.ro>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <pcthread.h>
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ return pthread_key_create(&_objc_thread_storage, NULL);
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* Destroy the thread storage key */
+ /* Not implemented yet */
+ /* return pthread_key_delete(&_objc_thread_storage); */
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ pthread_t new_thread_handle;
+
+ if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
+ thread_id = *(objc_thread_t *)&new_thread_handle;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ /* Not implemented yet */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ /* Not implemented yet */
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ pthread_yield(NULL);
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ pthread_exit(&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ pthread_t self = pthread_self();
+
+ return *(objc_thread_t *)&self;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ return pthread_setspecific(_objc_thread_storage, value);
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ void *value = NULL;
+
+ if ( !(pthread_getspecific(_objc_thread_storage, &value)) )
+ return value;
+
+ return NULL;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_init((pthread_mutex_t *)(&(mutex->backend)), NULL))
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ if (pthread_mutex_destroy((pthread_mutex_t *)(&(mutex->backend))))
+ return -1;
+ else
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ return pthread_mutex_lock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ return pthread_mutex_trylock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return pthread_mutex_unlock((pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ if (pthread_cond_init((pthread_cond_t *)(&(condition->backend)), NULL))
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return pthread_cond_destroy((pthread_cond_t *)(&(condition->backend)));
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return pthread_cond_wait((pthread_cond_t *)(&(condition->backend)),
+ (pthread_mutex_t *)(&(mutex->backend)));
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return pthread_cond_broadcast((pthread_cond_t *)(&(condition->backend)));
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return pthread_cond_signal((pthread_cond_t *)(&(condition->backend)));
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-rtems.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-rtems.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-rtems.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-rtems.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,194 @@
+/* GNU Objective C Runtime Thread Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+ Renamed from thr-vxworks.c to thr-rtems.c by
+ Ralf Corsepius (corsepiu at faw.uni-ulm.de)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ /* No thread support available */
+ return NULL;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ return;
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* No thread support available */
+ /* Should we really exit the program */
+ /* exit(&__objc_thread_exit_status); */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ /* No thread support, use 1. */
+ return (objc_thread_t)1;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ thread_local_storage = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-single.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-single.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-single.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-single.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,192 @@
+/* GNU Objective C Runtime Thread Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ /* No thread support available */
+ return NULL;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ return;
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* No thread support available */
+ /* Should we really exit the program */
+ /* exit(&__objc_thread_exit_status); */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ /* No thread support, use 1. */
+ return (objc_thread_t)1;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ thread_local_storage = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-solaris.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-solaris.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-solaris.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-solaris.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,259 @@
+/* GNU Objective C Runtime Thread Interface
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+ Conditions added by Mircea Oancea (mircea at first.elcom.pub.ro)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+#include <thread.h>
+#include <synch.h>
+#include <errno.h>
+
+/* Key structure for maintaining thread specific storage */
+static thread_key_t __objc_thread_data_key;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ if (thr_keycreate(&__objc_thread_data_key, NULL) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ objc_thread_t thread_id;
+ thread_t new_thread_id = 0;
+
+ if (thr_create(NULL, 0, (void *)func, arg,
+ THR_DETACHED | THR_NEW_LWP,
+ &new_thread_id) == 0)
+ thread_id = *(objc_thread_t *)&new_thread_id;
+ else
+ thread_id = NULL;
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ int sys_priority = 0;
+
+ switch (priority)
+ {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_priority = 300;
+ break;
+ default:
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_priority = 200;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_priority = 1000;
+ break;
+ }
+
+ /* Change priority */
+ if (thr_setprio(thr_self(), sys_priority) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ int sys_priority;
+
+ if (thr_getprio(thr_self(), &sys_priority) == 0)
+ {
+ if (sys_priority >= 250)
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+ else if (sys_priority >= 150)
+ return OBJC_THREAD_BACKGROUND_PRIORITY;
+ return OBJC_THREAD_LOW_PRIORITY;
+ }
+
+ /* Couldn't get priority. */
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ thr_yield();
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ thr_exit(&__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ return (objc_thread_t)thr_self();
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ if (thr_setspecific(__objc_thread_data_key, value) == 0)
+ return 0;
+ else
+ return -1;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ void *value = NULL;
+
+ if (thr_getspecific(__objc_thread_data_key, &value) == 0)
+ return value;
+
+ return NULL;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if (mutex_init( (mutex_t *)(&(mutex->backend)), USYNC_THREAD, 0))
+ return -1;
+ else
+ return 0;
+}
+
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ mutex_destroy((mutex_t *)(&(mutex->backend)));
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ if (mutex_lock((mutex_t *)(&(mutex->backend))) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ if (mutex_trylock((mutex_t *)(&(mutex->backend))) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ if (mutex_unlock((mutex_t *)(&(mutex->backend))) != 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ return cond_init((cond_t *)(&(condition->backend)), USYNC_THREAD, NULL);
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return cond_destroy((cond_t *)(&(condition->backend)));
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return cond_wait((cond_t *)(&(condition->backend)),
+ (mutex_t *)(&(mutex->backend)));
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return cond_broadcast((cond_t *)(&(condition->backend)));
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return cond_signal((cond_t *)(&(condition->backend)));
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-vxworks.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-vxworks.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-vxworks.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-vxworks.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,192 @@
+/* GNU Objective C Runtime Thread Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+/* Thread local storage for a single thread */
+static void *thread_local_storage = NULL;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ /* No thread support available */
+ return NULL;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ /* No thread support available */
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ return;
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* No thread support available */
+ /* Should we really exit the program */
+ /* exit(&__objc_thread_exit_status); */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ /* No thread support, use 1. */
+ return (objc_thread_t)1;
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ thread_local_storage = value;
+ return 0;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return thread_local_storage;
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ /* There can only be one thread, so we always get the lock */
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ return 0;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ return 0;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr-win32.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr-win32.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr-win32.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr-win32.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,272 @@
+/* GNU Objective C Runtime Thread Interface - Win32 Implementation
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "objc/thr.h"
+#include "objc/runtime.h"
+
+#ifndef __OBJC__
+#define __OBJC__
+#endif
+#include <windows.h>
+
+/* Key structure for maintaining thread specific storage */
+static DWORD __objc_data_tls = (DWORD)-1;
+
+/* Backend initialization functions */
+
+/* Initialize the threads subsystem. */
+int
+__objc_init_thread_system(void)
+{
+ /* Initialize the thread storage key */
+ if ((__objc_data_tls = TlsAlloc()) != (DWORD)-1)
+ return 0;
+ else
+ return -1;
+}
+
+/* Close the threads subsystem. */
+int
+__objc_close_thread_system(void)
+{
+ if (__objc_data_tls != (DWORD)-1)
+ TlsFree(__objc_data_tls);
+ return 0;
+}
+
+/* Backend thread functions */
+
+/* Create a new thread of execution. */
+objc_thread_t
+__objc_thread_detach(void (*func)(void *arg), void *arg)
+{
+ DWORD thread_id = 0;
+ HANDLE win32_handle;
+
+ if (!(win32_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func,
+ arg, 0, &thread_id)))
+ thread_id = 0;
+
+ return (objc_thread_t)thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+__objc_thread_set_priority(int priority)
+{
+ int sys_priority = 0;
+
+ switch (priority)
+ {
+ case OBJC_THREAD_INTERACTIVE_PRIORITY:
+ sys_priority = THREAD_PRIORITY_NORMAL;
+ break;
+ default:
+ case OBJC_THREAD_BACKGROUND_PRIORITY:
+ sys_priority = THREAD_PRIORITY_BELOW_NORMAL;
+ break;
+ case OBJC_THREAD_LOW_PRIORITY:
+ sys_priority = THREAD_PRIORITY_LOWEST;
+ break;
+ }
+
+ /* Change priority */
+ if (SetThreadPriority(GetCurrentThread(), sys_priority))
+ return 0;
+ else
+ return -1;
+}
+
+/* Return the current thread's priority. */
+int
+__objc_thread_get_priority(void)
+{
+ int sys_priority;
+
+ sys_priority = GetThreadPriority(GetCurrentThread());
+
+ switch (sys_priority)
+ {
+ case THREAD_PRIORITY_HIGHEST:
+ case THREAD_PRIORITY_TIME_CRITICAL:
+ case THREAD_PRIORITY_ABOVE_NORMAL:
+ case THREAD_PRIORITY_NORMAL:
+ return OBJC_THREAD_INTERACTIVE_PRIORITY;
+
+ default:
+ case THREAD_PRIORITY_BELOW_NORMAL:
+ return OBJC_THREAD_BACKGROUND_PRIORITY;
+
+ case THREAD_PRIORITY_IDLE:
+ case THREAD_PRIORITY_LOWEST:
+ return OBJC_THREAD_LOW_PRIORITY;
+ }
+
+ /* Couldn't get priority. */
+ return -1;
+}
+
+/* Yield our process time to another thread. */
+void
+__objc_thread_yield(void)
+{
+ Sleep(0);
+}
+
+/* Terminate the current thread. */
+int
+__objc_thread_exit(void)
+{
+ /* exit the thread */
+ ExitThread(__objc_thread_exit_status);
+
+ /* Failed if we reached here */
+ return -1;
+}
+
+/* Returns an integer value which uniquely describes a thread. */
+objc_thread_t
+__objc_thread_id(void)
+{
+ return (objc_thread_t)GetCurrentThreadId();
+}
+
+/* Sets the thread's local storage pointer. */
+int
+__objc_thread_set_data(void *value)
+{
+ if (TlsSetValue(__objc_data_tls, value))
+ return 0;
+ else
+ return -1;
+}
+
+/* Returns the thread's local storage pointer. */
+void *
+__objc_thread_get_data(void)
+{
+ return TlsGetValue(__objc_data_tls); /* Return thread data. */
+}
+
+/* Backend mutex functions */
+
+/* Allocate a mutex. */
+int
+__objc_mutex_allocate(objc_mutex_t mutex)
+{
+ if ((mutex->backend = (void *)CreateMutex(NULL, 0, NULL)) == NULL)
+ return -1;
+ else
+ return 0;
+}
+
+/* Deallocate a mutex. */
+int
+__objc_mutex_deallocate(objc_mutex_t mutex)
+{
+ CloseHandle((HANDLE)(mutex->backend));
+ return 0;
+}
+
+/* Grab a lock on a mutex. */
+int
+__objc_mutex_lock(objc_mutex_t mutex)
+{
+ int status;
+
+ status = WaitForSingleObject((HANDLE)(mutex->backend), INFINITE);
+ if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
+ return -1;
+ else
+ return 0;
+}
+
+/* Try to grab a lock on a mutex. */
+int
+__objc_mutex_trylock(objc_mutex_t mutex)
+{
+ int status;
+
+ status = WaitForSingleObject((HANDLE)(mutex->backend), 0);
+ if (status != WAIT_OBJECT_0 && status != WAIT_ABANDONED)
+ return -1;
+ else
+ return 0;
+}
+
+/* Unlock the mutex */
+int
+__objc_mutex_unlock(objc_mutex_t mutex)
+{
+ if (ReleaseMutex((HANDLE)(mutex->backend)) == 0)
+ return -1;
+ else
+ return 0;
+}
+
+/* Backend condition mutex functions */
+
+/* Allocate a condition. */
+int
+__objc_condition_allocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Deallocate a condition. */
+int
+__objc_condition_deallocate(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wait on the condition */
+int
+__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up all threads waiting on this condition. */
+int
+__objc_condition_broadcast(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* Wake up one thread waiting on this condition. */
+int
+__objc_condition_signal(objc_condition_t condition)
+{
+ /* Unimplemented. */
+ return -1;
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libobjc/thr.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libobjc/thr.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libobjc/thr.c (added)
+++ llvm-gcc-4.2/trunk/libobjc/thr.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,563 @@
+/* GNU Objective C Runtime Thread Interface
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Galen C. Hunt (gchunt at cs.rochester.edu)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2, or (at your option) any later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+You should have received a copy of the GNU General Public License along with
+GCC; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include <stdlib.h>
+#include "objc/runtime.h"
+
+/* Global exit status. */
+int __objc_thread_exit_status = 0;
+
+/* Flag which lets us know if we ever became multi threaded */
+int __objc_is_multi_threaded = 0;
+
+/* The hook function called when the runtime becomes multi threaded */
+objc_thread_callback _objc_became_multi_threaded = NULL;
+
+/*
+ Use this to set the hook function that will be called when the
+ runtime initially becomes multi threaded.
+ The hook function is only called once, meaning only when the
+ 2nd thread is spawned, not for each and every thread.
+
+ It returns the previous hook function or NULL if there is none.
+
+ A program outside of the runtime could set this to some function so
+ it can be informed; for example, the GNUstep Base Library sets it
+ so it can implement the NSBecomingMultiThreaded notification.
+ */
+objc_thread_callback objc_set_thread_callback (objc_thread_callback func)
+{
+ objc_thread_callback temp = _objc_became_multi_threaded;
+ _objc_became_multi_threaded = func;
+ return temp;
+}
+
+/*
+ Private functions
+
+ These functions are utilized by the frontend, but they are not
+ considered part of the public interface.
+ */
+
+/*
+ First function called in a thread, starts everything else.
+
+ This function is passed to the backend by objc_thread_detach
+ as the starting function for a new thread.
+ */
+struct __objc_thread_start_state
+{
+ SEL selector;
+ id object;
+ id argument;
+};
+
+static void __attribute__((noreturn))
+__objc_thread_detach_function (struct __objc_thread_start_state *istate)
+{
+ /* Valid state? */
+ if (istate) {
+ id (*imp) (id, SEL, id);
+ SEL selector = istate->selector;
+ id object = istate->object;
+ id argument = istate->argument;
+
+ /* Don't need anymore so free it */
+ objc_free (istate);
+
+ /* Clear out the thread local storage */
+ objc_thread_set_data (NULL);
+
+ /* Check to see if we just became multi threaded */
+ if (! __objc_is_multi_threaded)
+ {
+ __objc_is_multi_threaded = 1;
+
+ /* Call the hook function */
+ if (_objc_became_multi_threaded != NULL)
+ (*_objc_became_multi_threaded) ();
+ }
+
+ /* Call the method */
+ if ((imp = (id (*) (id, SEL, id))objc_msg_lookup (object, selector)))
+ (*imp) (object, selector, argument);
+ else
+ objc_error (object, OBJC_ERR_UNIMPLEMENTED,
+ "objc_thread_detach called with bad selector.\n");
+ }
+ else
+ objc_error (nil, OBJC_ERR_BAD_STATE,
+ "objc_thread_detach called with NULL state.\n");
+
+ /* Exit the thread */
+ objc_thread_exit ();
+}
+
+/*
+ Frontend functions
+
+ These functions constitute the public interface to the Objective-C thread
+ and mutex functionality.
+ */
+
+/* Frontend thread functions */
+
+/*
+ Detach a new thread of execution and return its id. Returns NULL if fails.
+ Thread is started by sending message with selector to object. Message
+ takes a single argument.
+ */
+objc_thread_t
+objc_thread_detach (SEL selector, id object, id argument)
+{
+ struct __objc_thread_start_state *istate;
+ objc_thread_t thread_id = NULL;
+
+ /* Allocate the state structure */
+ if (! (istate = (struct __objc_thread_start_state *)
+ objc_malloc (sizeof (*istate))))
+ return NULL;
+
+ /* Initialize the state structure */
+ istate->selector = selector;
+ istate->object = object;
+ istate->argument = argument;
+
+ /* lock access */
+ objc_mutex_lock (__objc_runtime_mutex);
+
+ /* Call the backend to spawn the thread */
+ if ((thread_id = __objc_thread_detach ((void *)__objc_thread_detach_function,
+ istate)) == NULL)
+ {
+ /* failed! */
+ objc_mutex_unlock (__objc_runtime_mutex);
+ objc_free (istate);
+ return NULL;
+ }
+
+ /* Increment our thread counter */
+ __objc_runtime_threads_alive++;
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ return thread_id;
+}
+
+/* Set the current thread's priority. */
+int
+objc_thread_set_priority (int priority)
+{
+ /* Call the backend */
+ return __objc_thread_set_priority (priority);
+}
+
+/* Return the current thread's priority. */
+int
+objc_thread_get_priority (void)
+{
+ /* Call the backend */
+ return __objc_thread_get_priority ();
+}
+
+/*
+ Yield our process time to another thread. Any BUSY waiting that is done
+ by a thread should use this function to make sure that other threads can
+ make progress even on a lazy uniprocessor system.
+ */
+void
+objc_thread_yield (void)
+{
+ /* Call the backend */
+ __objc_thread_yield ();
+}
+
+/*
+ Terminate the current tread. Doesn't return.
+ Actually, if it failed returns -1.
+ */
+int
+objc_thread_exit (void)
+{
+ /* Decrement our counter of the number of threads alive */
+ objc_mutex_lock (__objc_runtime_mutex);
+ __objc_runtime_threads_alive--;
+ objc_mutex_unlock (__objc_runtime_mutex);
+
+ /* Call the backend to terminate the thread */
+ return __objc_thread_exit ();
+}
+
+/*
+ Returns an integer value which uniquely describes a thread. Must not be
+ NULL which is reserved as a marker for "no thread".
+ */
+objc_thread_t
+objc_thread_id (void)
+{
+ /* Call the backend */
+ return __objc_thread_id ();
+}
+
+/*
+ Sets the thread's local storage pointer.
+ Returns 0 if successful or -1 if failed.
+ */
+int
+objc_thread_set_data (void *value)
+{
+ /* Call the backend */
+ return __objc_thread_set_data (value);
+}
+
+/*
+ Returns the thread's local storage pointer. Returns NULL on failure.
+ */
+void *
+objc_thread_get_data (void)
+{
+ /* Call the backend */
+ return __objc_thread_get_data ();
+}
+
+/* Frontend mutex functions */
+
+/*
+ Allocate a mutex. Return the mutex pointer if successful or NULL if the
+ allocation failed for any reason.
+ */
+objc_mutex_t
+objc_mutex_allocate (void)
+{
+ objc_mutex_t mutex;
+
+ /* Allocate the mutex structure */
+ if (! (mutex = (objc_mutex_t)objc_malloc (sizeof (struct objc_mutex))))
+ return NULL;
+
+ /* Call backend to create the mutex */
+ if (__objc_mutex_allocate (mutex))
+ {
+ /* failed! */
+ objc_free (mutex);
+ return NULL;
+ }
+
+ /* Initialize mutex */
+ mutex->owner = NULL;
+ mutex->depth = 0;
+ return mutex;
+}
+
+/*
+ Deallocate a mutex. Note that this includes an implicit mutex_lock to
+ insure that no one else is using the lock. It is legal to deallocate
+ a lock if we have a lock on it, but illegal to deallocate a lock held
+ by anyone else.
+ Returns the number of locks on the thread. (1 for deallocate).
+ */
+int
+objc_mutex_deallocate (objc_mutex_t mutex)
+{
+ int depth;
+
+ /* Valid mutex? */
+ if (! mutex)
+ return -1;
+
+ /* Acquire lock on mutex */
+ depth = objc_mutex_lock (mutex);
+
+ /* Call backend to destroy mutex */
+ if (__objc_mutex_deallocate (mutex))
+ return -1;
+
+ /* Free the mutex structure */
+ objc_free (mutex);
+
+ /* Return last depth */
+ return depth;
+}
+
+/*
+ Grab a lock on a mutex. If this thread already has a lock on this mutex
+ then we increment the lock count. If another thread has a lock on the
+ mutex we block and wait for the thread to release the lock.
+ Returns the lock count on the mutex held by this thread.
+ */
+int
+objc_mutex_lock (objc_mutex_t mutex)
+{
+ objc_thread_t thread_id;
+ int status;
+
+ /* Valid mutex? */
+ if (! mutex)
+ return -1;
+
+ /* If we already own the lock then increment depth */
+ thread_id = __objc_thread_id ();
+ if (mutex->owner == thread_id)
+ return ++mutex->depth;
+
+ /* Call the backend to lock the mutex */
+ status = __objc_mutex_lock (mutex);
+
+ /* Failed? */
+ if (status)
+ return status;
+
+ /* Successfully locked the thread */
+ mutex->owner = thread_id;
+ return mutex->depth = 1;
+}
+
+/*
+ Try to grab a lock on a mutex. If this thread already has a lock on
+ this mutex then we increment the lock count and return it. If another
+ thread has a lock on the mutex returns -1.
+ */
+int
+objc_mutex_trylock (objc_mutex_t mutex)
+{
+ objc_thread_t thread_id;
+ int status;
+
+ /* Valid mutex? */
+ if (! mutex)
+ return -1;
+
+ /* If we already own the lock then increment depth */
+ thread_id = __objc_thread_id ();
+ if (mutex->owner == thread_id)
+ return ++mutex->depth;
+
+ /* Call the backend to try to lock the mutex */
+ status = __objc_mutex_trylock (mutex);
+
+ /* Failed? */
+ if (status)
+ return status;
+
+ /* Successfully locked the thread */
+ mutex->owner = thread_id;
+ return mutex->depth = 1;
+}
+
+/*
+ Unlocks the mutex by one level.
+ Decrements the lock count on this mutex by one.
+ If the lock count reaches zero, release the lock on the mutex.
+ Returns the lock count on the mutex.
+ It is an error to attempt to unlock a mutex which this thread
+ doesn't hold in which case return -1 and the mutex is unaffected.
+ */
+int
+objc_mutex_unlock (objc_mutex_t mutex)
+{
+ objc_thread_t thread_id;
+ int status;
+
+ /* Valid mutex? */
+ if (! mutex)
+ return -1;
+
+ /* If another thread owns the lock then abort */
+ thread_id = __objc_thread_id ();
+ if (mutex->owner != thread_id)
+ return -1;
+
+ /* Decrement depth and return */
+ if (mutex->depth > 1)
+ return --mutex->depth;
+
+ /* Depth down to zero so we are no longer the owner */
+ mutex->depth = 0;
+ mutex->owner = NULL;
+
+ /* Have the backend unlock the mutex */
+ status = __objc_mutex_unlock (mutex);
+
+ /* Failed? */
+ if (status)
+ return status;
+
+ return 0;
+}
+
+/* Frontend condition mutex functions */
+
+/*
+ Allocate a condition. Return the condition pointer if successful or NULL
+ if the allocation failed for any reason.
+ */
+objc_condition_t
+objc_condition_allocate (void)
+{
+ objc_condition_t condition;
+
+ /* Allocate the condition mutex structure */
+ if (! (condition =
+ (objc_condition_t) objc_malloc (sizeof (struct objc_condition))))
+ return NULL;
+
+ /* Call the backend to create the condition mutex */
+ if (__objc_condition_allocate (condition))
+ {
+ /* failed! */
+ objc_free (condition);
+ return NULL;
+ }
+
+ /* Success! */
+ return condition;
+}
+
+/*
+ Deallocate a condition. Note that this includes an implicit
+ condition_broadcast to insure that waiting threads have the opportunity
+ to wake. It is legal to dealloc a condition only if no other
+ thread is/will be using it. Here we do NOT check for other threads
+ waiting but just wake them up.
+ */
+int
+objc_condition_deallocate (objc_condition_t condition)
+{
+ /* Broadcast the condition */
+ if (objc_condition_broadcast (condition))
+ return -1;
+
+ /* Call the backend to destroy */
+ if (__objc_condition_deallocate (condition))
+ return -1;
+
+ /* Free the condition mutex structure */
+ objc_free (condition);
+
+ return 0;
+}
+
+/*
+ Wait on the condition unlocking the mutex until objc_condition_signal ()
+ or objc_condition_broadcast () are called for the same condition. The
+ given mutex *must* have the depth set to 1 so that it can be unlocked
+ here, so that someone else can lock it and signal/broadcast the condition.
+ The mutex is used to lock access to the shared data that make up the
+ "condition" predicate.
+ */
+int
+objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex)
+{
+ objc_thread_t thread_id;
+
+ /* Valid arguments? */
+ if (! mutex || ! condition)
+ return -1;
+
+ /* Make sure we are owner of mutex */
+ thread_id = __objc_thread_id ();
+ if (mutex->owner != thread_id)
+ return -1;
+
+ /* Cannot be locked more than once */
+ if (mutex->depth > 1)
+ return -1;
+
+ /* Virtually unlock the mutex */
+ mutex->depth = 0;
+ mutex->owner = (objc_thread_t)NULL;
+
+ /* Call the backend to wait */
+ __objc_condition_wait (condition, mutex);
+
+ /* Make ourselves owner of the mutex */
+ mutex->owner = thread_id;
+ mutex->depth = 1;
+
+ return 0;
+}
+
+/*
+ Wake up all threads waiting on this condition. It is recommended that
+ the called would lock the same mutex as the threads in objc_condition_wait
+ before changing the "condition predicate" and make this call and unlock it
+ right away after this call.
+ */
+int
+objc_condition_broadcast (objc_condition_t condition)
+{
+ /* Valid condition mutex? */
+ if (! condition)
+ return -1;
+
+ return __objc_condition_broadcast (condition);
+}
+
+/*
+ Wake up one thread waiting on this condition. It is recommended that
+ the called would lock the same mutex as the threads in objc_condition_wait
+ before changing the "condition predicate" and make this call and unlock it
+ right away after this call.
+ */
+int
+objc_condition_signal (objc_condition_t condition)
+{
+ /* Valid condition mutex? */
+ if (! condition)
+ return -1;
+
+ return __objc_condition_signal (condition);
+}
+
+/* Make the objc thread system aware that a thread which is managed
+ (started, stopped) by external code could access objc facilities
+ from now on. This is used when you are interfacing with some
+ external non-objc-based environment/system - you must call
+ objc_thread_add () before an alien thread makes any calls to
+ Objective-C. Do not cause the _objc_became_multi_threaded hook to
+ be executed. */
+void
+objc_thread_add (void)
+{
+ objc_mutex_lock (__objc_runtime_mutex);
+ __objc_is_multi_threaded = 1;
+ __objc_runtime_threads_alive++;
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* Make the objc thread system aware that a thread managed (started,
+ stopped) by some external code will no longer access objc and thus
+ can be forgotten by the objc thread system. Call
+ objc_thread_remove () when your alien thread is done with making
+ calls to Objective-C. */
+void
+objc_thread_remove (void)
+{
+ objc_mutex_lock (__objc_runtime_mutex);
+ __objc_runtime_threads_alive--;
+ objc_mutex_unlock (__objc_runtime_mutex);
+}
+
+/* End of File */
Added: llvm-gcc-4.2/trunk/libssp/ChangeLog
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ChangeLog?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ChangeLog (added)
+++ llvm-gcc-4.2/trunk/libssp/ChangeLog Thu Nov 8 16:56:19 2007
@@ -0,0 +1,47 @@
+2007-05-13 Release Manager
+
+ * GCC 4.2.0 released.
+
+2006-10-14 Geoffrey Keating <geoffk at apple.com>
+
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2006-09-29 Joseph S. Myers <joseph at codesourcery.com>
+
+ PR other/25035
+ * configure.ac (AC_EXEEXT): Remove.
+ (GCC_NO_EXECUTABLES): Call.
+ (ssp_use_symver): Default to no if unable to link.
+ (AC_CHECK_FUNCS): Hardwire results if unable to link.
+ * aclocal.m4, configure, Makefile.in: Regenerate.
+
+2006-05-23 Carlos O'Donell <carlos at codesourcery.com>
+
+ * Makefile.am: Add install-html target. Add install-html to .PHONY
+ * Makefile.in: Regenerate.
+
+2006-02-27 Mark Mitchell <mark at codesourcery.com>
+
+ PR 26473
+ * configure.ac (ACX_NONCANONICAL_TARGET): Use it.
+ * Makefile.am (target_noncanonical): Define.
+ (libsubincludedir): New variable.
+ (nobase_libsubinclude_HEADERS): Likewise.
+ (nobase_include_HEADERS): Remove.
+ * configure: Regenerated.
+ * Makefile.in: Likewise.
+ * aclocal.m4: Regenerated.
+
+2006-01-20 Richard Guenther <rguenther at suse.de>
+
+ * configure.ac: Use -fPIC for symbol versioning test.
+ * configure: Regenerate.
+
+2005-08-17 Kelley Cook <kcook at gcc.gnu.org>
+
+ * ALL: Update FSF address.
+
+2005-07-02 Jakub Jelinek <jakub at redhat.com>
+
+ * ALL: First release as more than just a single file.
Added: llvm-gcc-4.2/trunk/libssp/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/Makefile.am?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/Makefile.am (added)
+++ llvm-gcc-4.2/trunk/libssp/Makefile.am Thu Nov 8 16:56:19 2007
@@ -0,0 +1,98 @@
+## Makefile for the toplevel directory of the libssp library.
+##
+## Copyright (C) 2005
+## Free Software Foundation, Inc.
+##
+
+AUTOMAKE_OPTIONS = 1.9.5 foreign
+ACLOCAL_AMFLAGS = -I .. -I ../config
+MAINT_CHARSET = latin1
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+
+if LIBSSP_USE_SYMVER
+version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+version_dep = $(srcdir)/ssp.map
+else
+version_arg =
+version_dep =
+endif
+
+AM_CFLAGS = -Wall
+
+toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
+
+target_noncanonical = @target_noncanonical@
+libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
+
+libssp_la_SOURCES = \
+ ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
+ memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
+ strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \
+ vsnprintf-chk.c vsprintf-chk.c
+libssp_la_LIBADD =
+libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
+libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(version_arg)
+
+libssp_nonshared_la_SOURCES = \
+ ssp-local.c
+libssp_nonshared_la_CFLAGS = -prefer-pic
+libssp_nonshared_la_LIBADD =
+libssp_nonshared_la_DEPENDENCIES = $(libssp_nonshared_la_LIBADD)
+libssp_nonshared_la_LDFLAGS = -static
+
+
+# XXX hack alert
+# From libffi/Makefile.am
+
+# Work around what appears to be a GNU make bug handling MAKEFLAGS
+# values defined in terms of make variables, as is the case for CC and
+# friends when we are called from the top level Makefile.
+AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "JC1FLAGS=$(JC1FLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
+ "includedir=$(includedir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "DESTDIR=$(DESTDIR)"
+
+MAKEOVERRIDES=
+
+.PHONY: install-html
+
+install-html:
+
+## ################################################################
+
Added: llvm-gcc-4.2/trunk/libssp/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/Makefile.in?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/Makefile.in (added)
+++ llvm-gcc-4.2/trunk/libssp/Makefile.in Thu Nov 8 16:56:19 2007
@@ -0,0 +1,763 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+DIST_COMMON = $(am__configure_deps) $(nobase_libsubinclude_HEADERS) \
+ $(srcdir)/../compile $(srcdir)/../config.guess \
+ $(srcdir)/../config.sub $(srcdir)/../depcomp \
+ $(srcdir)/../install-sh $(srcdir)/../ltmain.sh \
+ $(srcdir)/../missing $(srcdir)/../mkinstalldirs \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(top_srcdir)/configure \
+ $(top_srcdir)/ssp/ssp.h.in ChangeLog
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
+ $(top_srcdir)/../config/depstand.m4 \
+ $(top_srcdir)/../config/lead-dot.m4 \
+ $(top_srcdir)/../config/no-executables.m4 \
+ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = ssp/ssp.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
+ "$(DESTDIR)$(libsubincludedir)"
+toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+am_libssp_la_OBJECTS = ssp.lo gets-chk.lo memcpy-chk.lo memmove-chk.lo \
+ mempcpy-chk.lo memset-chk.lo snprintf-chk.lo sprintf-chk.lo \
+ stpcpy-chk.lo strcat-chk.lo strcpy-chk.lo strncat-chk.lo \
+ strncpy-chk.lo vsnprintf-chk.lo vsprintf-chk.lo
+libssp_la_OBJECTS = $(am_libssp_la_OBJECTS)
+am_libssp_nonshared_la_OBJECTS = libssp_nonshared_la-ssp-local.lo
+libssp_nonshared_la_OBJECTS = $(am_libssp_nonshared_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp = $(SHELL) $(top_srcdir)/../depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
+DIST_SOURCES = $(libssp_la_SOURCES) $(libssp_nonshared_la_SOURCES)
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+nobase_libsubincludeHEADERS_INSTALL = $(install_sh_DATA)
+HEADERS = $(nobase_libsubinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSSP_USE_SYMVER_FALSE = @LIBSSP_USE_SYMVER_FALSE@
+LIBSSP_USE_SYMVER_TRUE = @LIBSSP_USE_SYMVER_TRUE@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+multi_basedir = @multi_basedir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+ssp_have_usable_vsnprintf = @ssp_have_usable_vsnprintf@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_noncanonical = @target_noncanonical@
+target_os = @target_os@
+target_vendor = @target_vendor@
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
+AUTOMAKE_OPTIONS = 1.9.5 foreign
+ACLOCAL_AMFLAGS = -I .. -I ../config
+MAINT_CHARSET = latin1
+
+# May be used by various substitution variables.
+gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+ at LIBSSP_USE_SYMVER_FALSE@version_arg =
+ at LIBSSP_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/ssp.map
+ at LIBSSP_USE_SYMVER_FALSE@version_dep =
+ at LIBSSP_USE_SYMVER_TRUE@version_dep = $(srcdir)/ssp.map
+AM_CFLAGS = -Wall
+toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
+libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
+libssp_la_SOURCES = \
+ ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
+ memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
+ strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \
+ vsnprintf-chk.c vsprintf-chk.c
+
+libssp_la_LIBADD =
+libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
+libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(version_arg)
+
+libssp_nonshared_la_SOURCES = \
+ ssp-local.c
+
+libssp_nonshared_la_CFLAGS = -prefer-pic
+libssp_nonshared_la_LIBADD =
+libssp_nonshared_la_DEPENDENCIES = $(libssp_nonshared_la_LIBADD)
+libssp_nonshared_la_LDFLAGS = -static
+
+# XXX hack alert
+# From libffi/Makefile.am
+
+# Work around what appears to be a GNU make bug handling MAKEFLAGS
+# values defined in terms of make variables, as is the case for CC and
+# friends when we are called from the top level Makefile.
+AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "JC1FLAGS=$(JC1FLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
+ "includedir=$(includedir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "DESTDIR=$(DESTDIR)"
+
+MAKEOVERRIDES =
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+ssp/ssp.h: $(top_builddir)/config.status $(top_srcdir)/ssp/ssp.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(toolexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(toolexeclibdir)"
+ @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(toolexeclibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(toolexeclibdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-toolexeclibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$p"; \
+ done
+
+clean-toolexeclibLTLIBRARIES:
+ -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
+ @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES)
+ $(LINK) -rpath $(toolexeclibdir) $(libssp_la_LDFLAGS) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS)
+libssp_nonshared.la: $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_DEPENDENCIES)
+ $(LINK) -rpath $(toolexeclibdir) $(libssp_nonshared_la_LDFLAGS) $(libssp_nonshared_la_OBJECTS) $(libssp_nonshared_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gets-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libssp_nonshared_la-ssp-local.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/memcpy-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/memmove-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mempcpy-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/memset-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/snprintf-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sprintf-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ssp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stpcpy-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strcat-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strcpy-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strncat-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/strncpy-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vsnprintf-chk.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vsprintf-chk.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libssp_nonshared_la-ssp-local.lo: ssp-local.c
+ at am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libssp_nonshared_la_CFLAGS) $(CFLAGS) -MT libssp_nonshared_la-ssp-local.lo -MD -MP -MF "$(DEPDIR)/libssp_nonshared_la-ssp-local.Tpo" -c -o libssp_nonshared_la-ssp-local.lo `test -f 'ssp-local.c' || echo '$(srcdir)/'`ssp-local.c; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libssp_nonshared_la-ssp-local.Tpo" "$(DEPDIR)/libssp_nonshared_la-ssp-local.Plo"; else rm -f "$(DEPDIR)/libssp_nonshared_la-ssp-local.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ssp-local.c' object='libssp_nonshared_la-ssp-local.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libssp_nonshared_la_CFLAGS) $(CFLAGS) -c -o libssp_nonshared_la-ssp-local.lo `test -f 'ssp-local.c' || echo '$(srcdir)/'`ssp-local.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+
+# GNU Make needs to see an explicit $(MAKE) variable in the command it
+# runs to enable its job server during parallel builds. Hence the
+# comments below.
+all-multi:
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+install-multi:
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
+
+mostlyclean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
+clean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
+distclean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
+maintainer-clean-multi:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
+uninstall-info-am:
+install-nobase_libsubincludeHEADERS: $(nobase_libsubinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libsubincludedir)" || $(mkdir_p) "$(DESTDIR)$(libsubincludedir)"
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_libsubinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ $(am__vpath_adj) \
+ echo " $(nobase_libsubincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libsubincludedir)/$$f'"; \
+ $(nobase_libsubincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libsubincludedir)/$$f"; \
+ done
+
+uninstall-nobase_libsubincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @$(am__vpath_adj_setup) \
+ list='$(nobase_libsubinclude_HEADERS)'; for p in $$list; do \
+ $(am__vpath_adj) \
+ echo " rm -f '$(DESTDIR)$(libsubincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(libsubincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/ssp
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS) config.h
+installdirs:
+ for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(libsubincludedir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am clean-multi
+
+clean-am: clean-generic clean-libtool clean-toolexeclibLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am distclean-multi
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nobase_libsubincludeHEADERS
+
+install-exec-am: install-multi install-toolexeclibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am maintainer-clean-multi
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am mostlyclean-multi
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-nobase_libsubincludeHEADERS \
+ uninstall-toolexeclibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am all-multi am--refresh check check-am \
+ clean clean-generic clean-libtool clean-multi \
+ clean-toolexeclibLTLIBRARIES ctags dist dist-all dist-bzip2 \
+ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-multi distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-multi \
+ install-nobase_libsubincludeHEADERS install-strip \
+ install-toolexeclibLTLIBRARIES installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ maintainer-clean-multi mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-multi pdf \
+ pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am \
+ uninstall-nobase_libsubincludeHEADERS \
+ uninstall-toolexeclibLTLIBRARIES
+
+
+.PHONY: install-html
+
+install-html:
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Added: llvm-gcc-4.2/trunk/libssp/aclocal.m4
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/aclocal.m4?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/aclocal.m4 (added)
+++ llvm-gcc-4.2/trunk/libssp/aclocal.m4 Thu Nov 8 16:56:19 2007
@@ -0,0 +1,864 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../config/acx.m4])
+m4_include([../config/depstand.m4])
+m4_include([../config/lead-dot.m4])
+m4_include([../config/multi.m4])
+m4_include([../config/no-executables.m4])
+m4_include([../libtool.m4])
Added: llvm-gcc-4.2/trunk/libssp/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/config.h.in?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/config.h.in (added)
+++ llvm-gcc-4.2/trunk/libssp/config.h.in Thu Nov 8 16:56:19 2007
@@ -0,0 +1,85 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <alloca.h> header file. */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* __attribute__((visibility ("hidden"))) supported */
+#undef HAVE_HIDDEN_VISIBILITY
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
+/* Define to 1 if you have the <paths.h> header file. */
+#undef HAVE_PATHS_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strncat' function. */
+#undef HAVE_STRNCAT
+
+/* Define to 1 if you have the `strncpy' function. */
+#undef HAVE_STRNCPY
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* vsnprintf is present and works */
+#undef HAVE_USABLE_VSNPRINTF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
Added: llvm-gcc-4.2/trunk/libssp/configure
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/configure?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/configure (added)
+++ llvm-gcc-4.2/trunk/libssp/configure Thu Nov 8 16:56:19 2007
@@ -0,0 +1,6728 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for libssp 1.0.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='libssp'
+PACKAGE_TARNAME='libssp'
+PACKAGE_VERSION='1.0'
+PACKAGE_STRING='libssp 1.0'
+PACKAGE_BUGREPORT=''
+
+ac_unique_file="ssp.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT multi_basedir CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CFLAGS CPP CPPFLAGS LIBSSP_USE_SYMVER_TRUE LIBSSP_USE_SYMVER_FALSE EGREP ssp_!
have_usable_vsnprintf LN_S RANLIB ac_ct_RANLIB LIBTOOL enable_shared enable_static toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures libssp 1.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of libssp 1.0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-multilib build many library versions (default)
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-shared=PKGS build shared libraries default=yes
+ --enable-static=PKGS build static libraries default=yes
+ --enable-fast-install=PKGS optimize for fast installation default=yes
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-pic try to use only PIC/non-PIC objects default=use both
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+libssp configure 1.0
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by libssp $as_me 1.0, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+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.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+ case ${build_alias} in
+ "") build_noncanonical=${build} ;;
+ *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+ "") host_noncanonical=${build_noncanonical} ;;
+ *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+ "") target_noncanonical=${host_noncanonical} ;;
+ *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+
+am__api_version="1.9"
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libssp'
+ VERSION='1.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for --enable-version-specific-runtime-libs" >&5
+echo $ECHO_N "checking for --enable-version-specific-runtime-libs... $ECHO_C" >&6
+# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
+if test "${enable_version_specific_runtime_libs+set}" = set; then
+ enableval="$enable_version_specific_runtime_libs"
+ case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable version-specific libs" >&5
+echo "$as_me: error: Unknown argument to enable/disable version-specific libs" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+else
+ version_specific_libs=no
+fi;
+echo "$as_me:$LINENO: result: $version_specific_libs" >&5
+echo "${ECHO_T}$version_specific_libs" >&6
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+
+
+# Default to --enable-multilib
+# Check whether --enable-multilib or --disable-multilib was given.
+if test "${enable_multilib+set}" = set; then
+ enableval="$enable_multilib"
+ case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) { { echo "$as_me:$LINENO: error: bad value $enableval for multilib option" >&5
+echo "$as_me: error: bad value $enableval for multilib option" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+else
+ multilib=yes
+fi;
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ ac_config_commands="$ac_config_commands default-1"
+
+
+target_alias=${target_alias-$host_alias}
+
+
+ ac_config_headers="$ac_config_headers config.h"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# FIXME: Cleanup?
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+fi
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+
+
+
+if test "x$GCC" != "xyes"; then
+ { { echo "$as_me:$LINENO: error: libssp must be built with GCC" >&5
+echo "$as_me: error: libssp must be built with GCC" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking whether -fstack-protector works" >&5
+echo $ECHO_N "checking whether -fstack-protector works... $ECHO_C" >&6
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fstack-protector -Werror"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+void __attribute__((noinline)) bar (char *x)
+{
+ __builtin_memset (x, 0, 64);
+}
+int
+main ()
+{
+char buf[64]; bar (buf);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_CFLAGS"
+
+echo "$as_me:$LINENO: checking whether hidden visibility is supported" >&5
+echo $ECHO_N "checking whether hidden visibility is supported... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+void __attribute__((visibility ("hidden"))) bar (void) {}
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ssp_hidden=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ssp_hidden=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ssp_hidden" >&5
+echo "${ECHO_T}$ssp_hidden" >&6
+if test x$ssp_hidden = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_HIDDEN_VISIBILITY 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether symbol versioning is supported" >&5
+echo $ECHO_N "checking whether symbol versioning is supported... $ECHO_C" >&6
+cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+if test x$gcc_no_link = xyes; then
+ # If we cannot link, we cannot build shared libraries, so do not use
+ # symbol versioning.
+ ssp_use_symver=no
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ssp_use_symver=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ssp_use_symver=no
+fi
+# APPLE LOCAL ld64 bug found by libssp 4453468
+ssp_use_symver=no
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+LDFLAGS="$save_LDFLAGS"
+echo "$as_me:$LINENO: result: $ssp_use_symver" >&5
+echo "${ECHO_T}$ssp_use_symver" >&6
+
+
+if test "x$ssp_use_symver" = xyes; then
+ LIBSSP_USE_SYMVER_TRUE=
+ LIBSSP_USE_SYMVER_FALSE='#'
+else
+ LIBSSP_USE_SYMVER_TRUE='#'
+ LIBSSP_USE_SYMVER_FALSE=
+fi
+
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+for ac_header in alloca.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## --------------------------------- ##
+## Report this to the libssp lists. ##
+## --------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test x$gcc_no_link = xyes; then
+ # Presume the ISO C functions are available; add target-specific
+ # configuration here if required.
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRNCPY 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRNCAT 1
+_ACEOF
+
+else
+
+
+
+for ac_func in mempcpy strncpy strncat
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+fi
+
+echo "$as_me:$LINENO: checking whether vsnprintf is usable" >&5
+echo $ECHO_N "checking whether vsnprintf is usable... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+ ssp_have_usable_vsnprintf=undef
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
+int foo (char *buf, size_t n, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+ va_start (ap, fmt);
+ ret = vsnprintf (buf, n, fmt, ap);
+ va_end (ap);
+ return ret;
+}
+int
+main ()
+{
+char buf[8]; memset (buf, 'A', sizeof (buf));
+ if (foo (buf, 4, ".%s.", "CDEFG") != 7)
+ return 1;
+ return memcmp (buf, ".CD\0AAAA", sizeof (buf)) != 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ssp_have_usable_vsnprintf=define
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ssp_have_usable_vsnprintf=undef
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+if test "x$ssp_have_usable_vsnprintf" = xdefine; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_USABLE_VSNPRINTF 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi;
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi;
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi;
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
+echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw* |pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*|hpux11*)
+ case $host_cpu in
+ hppa*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ esac
+ ;;
+
+irix5* | irix6*)
+ case $host_os in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+ fi
+ ;;
+
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len" ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 4939 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5
+echo "$as_me: error: libtool configure failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+
+
+
+
+
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+esac
+
+
+
+if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+else
+ multilib_arg=
+fi
+
+ ac_config_files="$ac_config_files Makefile ssp/ssp.h"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${LIBSSP_USE_SYMVER_TRUE}" && test -z "${LIBSSP_USE_SYMVER_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"LIBSSP_USE_SYMVER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"LIBSSP_USE_SYMVER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by libssp $as_me 1.0, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+libssp config.status 1.0
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "ssp/ssp.h" ) CONFIG_FILES="$CONFIG_FILES ssp/ssp.h" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at target@,$target,;t t
+s, at target_cpu@,$target_cpu,;t t
+s, at target_vendor@,$target_vendor,;t t
+s, at target_os@,$target_os,;t t
+s, at target_noncanonical@,$target_noncanonical,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at CYGPATH_W@,$CYGPATH_W,;t t
+s, at PACKAGE@,$PACKAGE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at ACLOCAL@,$ACLOCAL,;t t
+s, at AUTOCONF@,$AUTOCONF,;t t
+s, at AUTOMAKE@,$AUTOMAKE,;t t
+s, at AUTOHEADER@,$AUTOHEADER,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at mkdir_p@,$mkdir_p,;t t
+s, at AWK@,$AWK,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at am__leading_dot@,$am__leading_dot,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at am__tar@,$am__tar,;t t
+s, at am__untar@,$am__untar,;t t
+s, at MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s, at MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s, at MAINT@,$MAINT,;t t
+s, at multi_basedir@,$multi_basedir,;t t
+s, at CC@,$CC,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at CPP@,$CPP,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at LIBSSP_USE_SYMVER_TRUE@,$LIBSSP_USE_SYMVER_TRUE,;t t
+s, at LIBSSP_USE_SYMVER_FALSE@,$LIBSSP_USE_SYMVER_FALSE,;t t
+s, at EGREP@,$EGREP,;t t
+s, at ssp_have_usable_vsnprintf@,$ssp_have_usable_vsnprintf,;t t
+s, at LN_S@,$LN_S,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at LIBTOOL@,$LIBTOOL,;t t
+s, at enable_shared@,$enable_shared,;t t
+s, at enable_static@,$enable_static,;t t
+s, at toolexecdir@,$toolexecdir,;t t
+s, at toolexeclibdir@,$toolexeclibdir,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ default-1 )
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
Propchange: llvm-gcc-4.2/trunk/libssp/configure
------------------------------------------------------------------------------
svn:executable = *
Added: llvm-gcc-4.2/trunk/libssp/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/configure.ac?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/configure.ac (added)
+++ llvm-gcc-4.2/trunk/libssp/configure.ac Thu Nov 8 16:56:19 2007
@@ -0,0 +1,176 @@
+# Process this file with autoconf to produce a configure script, like so:
+#
+# aclocal -I .. -I ../config && autoconf && autoheader && automake
+
+AC_PREREQ(2.59)
+AC_INIT(libssp, 1.0)
+AC_CONFIG_SRCDIR(ssp.c)
+AC_CANONICAL_SYSTEM
+ACX_NONCANONICAL_TARGET
+
+AM_INIT_AUTOMAKE
+
+AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+AC_ARG_ENABLE(version-specific-runtime-libs,
+[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+[version_specific_libs=no])
+AC_MSG_RESULT($version_specific_libs)
+
+AM_MAINTAINER_MODE
+
+GCC_NO_EXECUTABLES
+
+AM_ENABLE_MULTILIB(, ..)
+
+target_alias=${target_alias-$host_alias}
+AC_SUBST(target_alias)
+
+AC_CONFIG_HEADERS(config.h)
+
+AC_LANG_C
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+if test "x$GCC" != "xyes"; then
+ AC_MSG_ERROR([libssp must be built with GCC])
+fi
+AC_PROG_CPP
+
+AC_MSG_CHECKING([whether -fstack-protector works])
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fstack-protector -Werror"
+AC_TRY_COMPILE([
+void __attribute__((noinline)) bar (char *x)
+{
+ __builtin_memset (x, 0, 64);
+}],[char buf[64]; bar (buf);],
+[AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)])
+CFLAGS="$save_CFLAGS"
+
+AC_MSG_CHECKING([whether hidden visibility is supported])
+AC_TRY_COMPILE([
+void __attribute__((visibility ("hidden"))) bar (void) {}],,
+[ssp_hidden=yes],[ssp_hidden=no])
+AC_MSG_RESULT($ssp_hidden)
+if test x$ssp_hidden = xyes; then
+ AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported])
+fi
+
+AC_MSG_CHECKING([whether symbol versioning is supported])
+cat > conftest.map <<EOF
+FOO_1.0 {
+ global: *foo*; bar; local: *;
+};
+EOF
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
+if test x$gcc_no_link = xyes; then
+ # If we cannot link, we cannot build shared libraries, so do not use
+ # symbol versioning.
+ ssp_use_symver=no
+else
+ AC_TRY_LINK([int foo;],[],[ssp_use_symver=yes],[ssp_use_symver=no])
+fi
+LDFLAGS="$save_LDFLAGS"
+# APPLE LOCAL ld64 bug found by libssp 4453468
+ssp_use_symver=no
+AC_MSG_RESULT($ssp_use_symver)
+AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" = xyes])
+
+AC_CHECK_HEADERS(alloca.h paths.h syslog.h string.h unistd.h fcntl.h stdio.h limits.h)
+
+if test x$gcc_no_link = xyes; then
+ # Presume the ISO C functions are available; add target-specific
+ # configuration here if required.
+ AC_DEFINE(HAVE_STRNCPY)
+ AC_DEFINE(HAVE_STRNCAT)
+else
+ AC_CHECK_FUNCS(mempcpy strncpy strncat)
+fi
+
+AC_MSG_CHECKING([whether vsnprintf is usable])
+AC_RUN_IFELSE(AC_LANG_PROGRAM([
+#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
+int foo (char *buf, size_t n, const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+ va_start (ap, fmt);
+ ret = vsnprintf (buf, n, fmt, ap);
+ va_end (ap);
+ return ret;
+}],
+[char buf@<:@8@:>@; memset (buf, 'A', sizeof (buf));
+ if (foo (buf, 4, ".%s.", "CDEFG") != 7)
+ return 1;
+ return memcmp (buf, ".CD\0AAAA", sizeof (buf)) != 0;]),
+[ssp_have_usable_vsnprintf=define],
+[ssp_have_usable_vsnprintf=undef],
+[ssp_have_usable_vsnprintf=undef])
+if test "x$ssp_have_usable_vsnprintf" = xdefine; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_USABLE_VSNPRINTF],[1],[vsnprintf is present and works])
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST(ssp_have_usable_vsnprintf)
+
+AM_PROG_LIBTOOL
+AC_SUBST(enable_shared)
+AC_SUBST(enable_static)
+
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${version_specific_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+
+if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+else
+ multilib_arg=
+fi
+
+AC_CONFIG_FILES([Makefile ssp/ssp.h])
+AC_OUTPUT
Added: llvm-gcc-4.2/trunk/libssp/gets-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/gets-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/gets-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/gets-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,88 @@
+/* Checking gets.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#include <stdarg.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+char *
+__gets_chk (char *s, size_t slen)
+{
+ char *ret, *buf;
+
+ if (slen >= (size_t) INT_MAX)
+ return gets (s);
+
+ if (slen <= 8192)
+ buf = alloca (slen + 1);
+ else
+ buf = malloc (slen + 1);
+ if (buf == NULL)
+ return gets (s);
+
+ ret = fgets (buf, (int) (slen + 1), stdin);
+ if (ret != NULL)
+ {
+ size_t len = strlen (buf);
+ if (len > 0 && buf[len - 1] == '\n')
+ --len;
+ if (len == slen)
+ __chk_fail ();
+ memcpy (s, buf, len);
+ s[len] = '\0';
+ ret = s;
+ }
+
+ if (slen > 8192)
+ free (buf);
+ return ret;
+}
Added: llvm-gcc-4.2/trunk/libssp/libtool-version
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/libtool-version?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/libtool-version (added)
+++ llvm-gcc-4.2/trunk/libssp/libtool-version Thu Nov 8 16:56:19 2007
@@ -0,0 +1,6 @@
+# This file is used to maintain libtool version info for libssp. See
+# the libtool manual to understand the meaning of the fields. This is
+# a separate file so that version updates don't involve re-running
+# automake.
+# CURRENT:REVISION:AGE
+0:0:0
Added: llvm-gcc-4.2/trunk/libssp/memcpy-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/memcpy-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/memcpy-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/memcpy-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,51 @@
+/* Checking memcpy.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+void *
+__memcpy_chk (void *__restrict__ dest, const void *__restrict__ src,
+ size_t len, size_t slen)
+{
+ if (len > slen)
+ __chk_fail ();
+ return memcpy (dest, src, len);
+}
Added: llvm-gcc-4.2/trunk/libssp/memmove-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/memmove-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/memmove-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/memmove-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,52 @@
+/* Checking memmove.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_MEMPCPY
+void *
+__memmove_chk (void *dest, const void *src, size_t len, size_t slen)
+{
+ if (len > slen)
+ __chk_fail ();
+ return memmove (dest, src, len);
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/mempcpy-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/mempcpy-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/mempcpy-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/mempcpy-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,53 @@
+/* Checking mempcpy.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_MEMPCPY
+void *
+__mempcpy_chk (void *__restrict__ dest, const void *__restrict__ src,
+ size_t len, size_t slen)
+{
+ if (len > slen)
+ __chk_fail ();
+ return memcpy (dest, src, len) + len;
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/memset-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/memset-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/memset-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/memset-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,50 @@
+/* Checking memset.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+void *
+__memset_chk (void *dest, int val, size_t len, size_t slen)
+{
+ if (len > slen)
+ __chk_fail ();
+ return memset (dest, val, len);
+}
Added: llvm-gcc-4.2/trunk/libssp/snprintf-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/snprintf-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/snprintf-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/snprintf-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,62 @@
+/* Checking snprintf.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#include <stdarg.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_USABLE_VSNPRINTF
+int
+__snprintf_chk (char *s, size_t n, int flags __attribute__((unused)),
+ size_t slen, const char *format, ...)
+{
+ va_list arg;
+ int done;
+
+ if (n > slen)
+ __chk_fail ();
+
+ va_start (arg, format);
+ done = vsnprintf (s, n, format, arg);
+ va_end (arg);
+
+ return done;
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/sprintf-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/sprintf-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/sprintf-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/sprintf-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,68 @@
+/* Checking sprintf.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#include <stdarg.h>
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_USABLE_VSNPRINTF
+int
+__sprintf_chk (char *s, int flags __attribute__((unused)),
+ size_t slen, const char *format, ...)
+{
+ va_list arg;
+ int done;
+
+ va_start (arg, format);
+ if (slen > (size_t) INT_MAX)
+ done = vsprintf (s, format, arg);
+ else
+ {
+ done = vsnprintf (s, slen, format, arg);
+ if (done >= 0 && (size_t) done >= slen)
+ __chk_fail ();
+ }
+ va_end (arg);
+ return done;
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/ssp-local.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp-local.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp-local.c (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp-local.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,51 @@
+/* Stack protector support.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+
+extern void __stack_chk_fail (void);
+
+/* Some targets can avoid loading a GP for calls to hidden functions.
+ Using this entry point may avoid the load of a GP entirely for the
+ function, making the overall code smaller. */
+
+#ifdef HAVE_HIDDEN_VISIBILITY
+void
+__attribute__((visibility ("hidden")))
+__stack_chk_fail_local (void)
+{
+ __stack_chk_fail ();
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/ssp.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp.c (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,178 @@
+/* Stack protector support.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+#endif
+#ifndef _PATH_TTY
+# define _PATH_TTY "/dev/tty"
+#endif
+#ifdef HAVE_SYSLOG_H
+# include <syslog.h>
+#endif
+
+void *__stack_chk_guard = 0;
+
+static void __attribute__ ((constructor))
+__guard_setup (void)
+{
+ unsigned char *p;
+ int fd;
+
+ if (__stack_chk_guard != 0)
+ return;
+
+ fd = open ("/dev/urandom", O_RDONLY);
+ if (fd != -1)
+ {
+ ssize_t size = read (fd, &__stack_chk_guard,
+ sizeof (__stack_chk_guard));
+ close (fd);
+ if (size == sizeof(__stack_chk_guard) && __stack_chk_guard != 0)
+ return;
+ }
+
+ /* If a random generator can't be used, the protector switches the guard
+ to the "terminator canary". */
+ p = (unsigned char *) &__stack_chk_guard;
+ p[sizeof(__stack_chk_guard)-1] = 255;
+ p[sizeof(__stack_chk_guard)-2] = '\n';
+ p[0] = 0;
+}
+
+static void
+fail (const char *msg1, size_t msg1len, const char *msg3)
+{
+#ifdef __GNU_LIBRARY__
+ extern char * __progname;
+#else
+ static const char __progname[] = "";
+#endif
+ int fd;
+
+ /* Print error message directly to the tty. This avoids Bad Things
+ happening if stderr is redirected. */
+ fd = open (_PATH_TTY, O_WRONLY);
+ if (fd != -1)
+ {
+ static const char msg2[] = " terminated\n";
+ size_t progname_len, len;
+ char *buf, *p;
+
+ progname_len = strlen (__progname);
+ len = msg1len + progname_len + sizeof(msg2)-1 + 1;
+ p = buf = alloca (len);
+
+ memcpy (p, msg1, msg1len);
+ p += msg1len;
+ memcpy (p, __progname, progname_len);
+ p += progname_len;
+ memcpy (p, msg2, sizeof(msg2));
+
+ while (len > 0)
+ {
+ ssize_t wrote = write (fd, buf, len);
+ if (wrote < 0)
+ break;
+ buf += wrote;
+ len -= wrote;
+ }
+ close (fd);
+ }
+
+#ifdef HAVE_SYSLOG_H
+ /* Only send the error to syslog if there was no tty available. */
+ else
+ syslog (LOG_CRIT, msg3);
+#endif /* HAVE_SYSLOG_H */
+
+ /* Try very hard to exit. Note that signals may be blocked preventing
+ the first two options from working. The use of volatile is here to
+ prevent optimizers from "knowing" that __builtin_trap is called first,
+ and that it doesn't return, and so "obviously" the rest of the code
+ is dead. */
+ {
+ volatile int state;
+ for (state = 0; ; state++)
+ switch (state)
+ {
+ case 0:
+ __builtin_trap ();
+ break;
+ case 1:
+ *(volatile int *)-1L = 0;
+ break;
+ case 2:
+ _exit (127);
+ break;
+ }
+ }
+}
+
+void
+__stack_chk_fail (void)
+{
+ const char *msg = "*** stack smashing detected ***: ";
+ fail (msg, strlen (msg), "stack smashing detected: terminated");
+}
+
+void
+__chk_fail (void)
+{
+ const char *msg = "*** buffer overflow detected ***: ";
+ fail (msg, strlen (msg), "buffer overflow detected: terminated");
+}
+
+#ifdef HAVE_HIDDEN_VISIBILITY
+void
+__attribute__((visibility ("hidden")))
+__stack_chk_fail_local (void)
+{
+ __stack_chk_fail ();
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/ssp.map
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp.map?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp.map (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp.map Thu Nov 8 16:56:19 2007
@@ -0,0 +1,9 @@
+LIBSSP_1.0 {
+ global:
+ __stack_chk_fail; __stack_chk_guard; __chk_fail;
+ __gets_chk; __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk;
+ __snprintf_chk; __sprintf_chk; __stpcpy_chk; __strcat_chk; __strcpy_chk;
+ __strncat_chk; __strncpy_chk; __vsnprintf_chk; __vsprintf_chk;
+ local:
+ *;
+};
Added: llvm-gcc-4.2/trunk/libssp/ssp/ssp.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp/ssp.h.in?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp/ssp.h.in (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp/ssp.h.in Thu Nov 8 16:56:19 2007
@@ -0,0 +1,66 @@
+/* Object size checking support macros.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef _SSP_H
+#define _SSP_H 1
+
+#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \
+ && defined __GNUC__ \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
+ && !defined __cplusplus
+# if _FORTIFY_SOURCE == 1
+# define __SSP_FORTIFY_LEVEL 1
+# elif _FORTIFY_SOURCE > 1
+# define __SSP_FORTIFY_LEVEL 2
+# endif
+#endif
+
+#if __SSP_FORTIFY_LEVEL > 0
+# include <stddef.h>
+# define __ssp_bos(ptr) __builtin_object_size (ptr, __SSP_FORTIFY_LEVEL > 1)
+# define __ssp_bos0(ptr) __builtin_object_size (ptr, 0)
+
+# define __SSP_REDIRECT(name, proto, alias) \
+ name proto __asm__ (__SSP_ASMNAME (#alias))
+# define __SSP_ASMNAME(cname) __SSP_ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __SSP_ASMNAME2(prefix, cname) __SSP_ASMNAME3 (prefix) cname
+# define __SSP_ASMNAME3(prefix) #prefix
+
+# @ssp_have_usable_vsnprintf@ __SSP_HAVE_VSNPRINTF
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+#endif
+
+#endif /* _SSP_H */
Added: llvm-gcc-4.2/trunk/libssp/ssp/stdio.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp/stdio.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp/stdio.h (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp/stdio.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,101 @@
+/* Checking macros for stdio functions.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef _SSP_STDIO_H
+#define _SSP_STDIO_H 1
+
+#include <ssp.h>
+#include_next <stdio.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#include <stdarg.h>
+
+#undef sprintf
+#undef vsprintf
+#undef snprintf
+#undef vsnprintf
+#undef gets
+#undef fgets
+
+extern int __sprintf_chk (char *__restrict__ __s, int __flag, size_t __slen,
+ __const char *__restrict__ __format, ...);
+extern int __vsprintf_chk (char *__restrict__ __s, int __flag, size_t __slen,
+ __const char *__restrict__ __format,
+ va_list __ap);
+
+#define sprintf(str, ...) \
+ __builtin___sprintf_chk (str, 0, __ssp_bos (str), \
+ __VA_ARGS__)
+#define vsprintf(str, fmt, ap) \
+ __builtin___vsprintf_chk (str, 0, __ssp_bos (str), fmt, ap)
+
+extern int __snprintf_chk (char *__restrict__ __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict__ __format,
+ ...);
+extern int __vsnprintf_chk (char *__restrict__ __s, size_t __n, int __flag,
+ size_t __slen, __const char *__restrict__ __format,
+ va_list __ap);
+
+#define snprintf(str, len, ...) \
+ __builtin___snprintf_chk (str, len, 0, __ssp_bos (str), __VA_ARGS__)
+#define vsnprintf(str, len, fmt, ap) \
+ __builtin___vsnprintf_chk (str, len, 0, __ssp_bos (str), fmt, ap)
+
+extern char *__gets_chk (char *__str, size_t);
+extern char *__SSP_REDIRECT (__gets_alias, (char *__str), gets);
+
+extern inline __attribute__((__always_inline__)) char *
+gets (char *__str)
+{
+ if (__ssp_bos (__str) != (size_t) -1)
+ return __gets_chk (__str, __ssp_bos (__str));
+ return __gets_alias (__str);
+}
+
+extern char *__SSP_REDIRECT (__fgets_alias,
+ (char *__restrict__ __s, int __n,
+ FILE *__restrict__ __stream), fgets);
+
+extern inline __attribute__((__always_inline__)) char *
+fgets (char *__restrict__ __s, int __n, FILE *__restrict__ __stream)
+{
+ if (__ssp_bos (__s) != (size_t) -1 && (size_t) __n > __ssp_bos (__s))
+ __chk_fail ();
+ return __fgets_alias (__s, __n, __stream);
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STDIO_H */
Added: llvm-gcc-4.2/trunk/libssp/ssp/string.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp/string.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp/string.h (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp/string.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,168 @@
+/* Checking macros for string functions.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef _SSP_STRING_H
+#define _SSP_STRING_H 1
+
+#include <ssp.h>
+#include_next <string.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#undef memcpy
+#undef memmove
+#undef memset
+#undef strcat
+#undef strcpy
+#undef strncat
+#undef strncpy
+#undef mempcpy
+#undef stpcpy
+#undef bcopy
+#undef bzero
+
+#define memcpy(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memcpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__memcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define memmove(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memmove_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__memmove_ichk (void *__dest, const void *__src, size_t __len)
+{
+ return __builtin___memmove_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define mempcpy(dest, src, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___mempcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __mempcpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) void *
+__mempcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___mempcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
+}
+
+
+#define memset(dest, ch, len) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memset_chk (dest, ch, len, __ssp_bos0 (dest)) \
+ : __memset_ichk (dest, ch, len))
+static inline __attribute__((__always_inline__)) void *
+__memset_ichk (void *__dest, int __ch, size_t __len)
+{
+ return __builtin___memset_chk (__dest, __ch, __len, __ssp_bos0 (__dest));
+}
+
+#define bcopy(src, dest, len) ((void) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memmove_chk (dest, src, len, __ssp_bos0 (dest)) \
+ : __memmove_ichk (dest, src, len)))
+#define bzero(dest, len) ((void) \
+ ((__ssp_bos0 (dest) != (size_t) -1) \
+ ? __builtin___memset_chk (dest, '\0', len, __ssp_bos0 (dest)) \
+ : __memset_ichk (dest, '\0', len)))
+
+
+#define strcpy(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strcpy_chk (dest, src, __ssp_bos (dest)) \
+ : __strcpy_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__strcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define stpcpy(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___stpcpy_chk (dest, src, __ssp_bos (dest)) \
+ : __stpcpy_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__stpcpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___stpcpy_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define strncpy(dest, src, len) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strncpy_chk (dest, src, len, __ssp_bos (dest)) \
+ : __strncpy_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) char *
+__strncpy_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___strncpy_chk (__dest, __src, __len, __ssp_bos (__dest));
+}
+
+
+#define strcat(dest, src) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strcat_chk (dest, src, __ssp_bos (dest)) \
+ : __strcat_ichk (dest, src))
+static inline __attribute__((__always_inline__)) char *
+__strcat_ichk (char *__restrict__ __dest, const char *__restrict__ __src)
+{
+ return __builtin___strcat_chk (__dest, __src, __ssp_bos (__dest));
+}
+
+
+#define strncat(dest, src, len) \
+ ((__ssp_bos (dest) != (size_t) -1) \
+ ? __builtin___strncat_chk (dest, src, len, __ssp_bos (dest)) \
+ : __strncat_ichk (dest, src, len))
+static inline __attribute__((__always_inline__)) char *
+__strncat_ichk (char *__restrict__ __dest, const char *__restrict__ __src,
+ size_t __len)
+{
+ return __builtin___strncat_chk (__dest, __src, __len, __ssp_bos (__dest));
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_STRING_H */
Added: llvm-gcc-4.2/trunk/libssp/ssp/unistd.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/ssp/unistd.h?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/ssp/unistd.h (added)
+++ llvm-gcc-4.2/trunk/libssp/ssp/unistd.h Thu Nov 8 16:56:19 2007
@@ -0,0 +1,85 @@
+/* Checking macros for unistd functions.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#ifndef _SSP_UNISTD_H
+#define _SSP_UNISTD_H 1
+
+#include <ssp.h>
+#include_next <unistd.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+
+#undef read
+#undef readlink
+#undef getcwd
+
+extern ssize_t __SSP_REDIRECT (__read_alias, (int __fd, void *__buf,
+ size_t __nbytes), read);
+
+extern inline __attribute__((__always_inline__)) ssize_t
+read (int __fd, void *__buf, size_t __nbytes)
+{
+ if (__ssp_bos0 (__buf) != (size_t) -1 && __nbytes > __ssp_bos0 (__buf))
+ __chk_fail ();
+ return __read_alias (__fd, __buf, __nbytes);
+}
+
+extern int __SSP_REDIRECT (__readlink_alias,
+ (const char *__restrict__ __path,
+ char *__restrict__ __buf, size_t __len),
+ readlink);
+
+extern inline __attribute__((__always_inline__)) int
+readlink (const char *__restrict__ __path, char *__restrict__ __buf,
+ size_t __len)
+{
+ if (__ssp_bos (__buf) != (size_t) -1 && __len > __ssp_bos (__buf))
+ __chk_fail ();
+ return __readlink_alias (__path, __buf, __len);
+}
+
+extern char *__SSP_REDIRECT (__getcwd_alias,
+ (char *__buf, size_t __size), getcwd);
+
+extern inline __attribute__((__always_inline__)) char *
+getcwd (char *__buf, size_t __size)
+{
+ if (__ssp_bos (__buf) != (size_t) -1 && __size > __ssp_bos (__buf))
+ __chk_fail ();
+ return __getcwd_alias (__buf, __size);
+}
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_UNISTD_H */
Added: llvm-gcc-4.2/trunk/libssp/stpcpy-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/stpcpy-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/stpcpy-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/stpcpy-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,52 @@
+/* Checking stpcpy.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+char *
+__stpcpy_chk (char *__restrict__ dest, const char *__restrict__ src,
+ size_t slen)
+{
+ size_t len = strlen (src);
+ if (len >= slen)
+ __chk_fail ();
+ return memcpy (dest, src, len + 1) + len;
+}
Added: llvm-gcc-4.2/trunk/libssp/strcat-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/strcat-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/strcat-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/strcat-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,73 @@
+/* Checking strcat.
+ Copyright (C) 1991, 1997, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+char *
+__strcat_chk (char *__restrict__ dest, const char *__restrict__ src,
+ size_t slen)
+{
+ char *s1 = dest;
+ const char *s2 = src;
+ char c;
+
+ do
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *s1++;
+ }
+ while (c != '\0');
+
+ ++slen;
+ s1 -= 2;
+
+ do
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *s2++;
+ *++s1 = c;
+ }
+ while (c != '\0');
+
+ return dest;
+}
Added: llvm-gcc-4.2/trunk/libssp/strcpy-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/strcpy-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/strcpy-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/strcpy-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,52 @@
+/* Checking strcpy.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+char *
+__strcpy_chk (char *__restrict__ dest, const char *__restrict__ src,
+ size_t slen)
+{
+ size_t len = strlen (src);
+ if (len >= slen)
+ __chk_fail ();
+ return memcpy (dest, src, len + 1);
+}
Added: llvm-gcc-4.2/trunk/libssp/strncat-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/strncat-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/strncat-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/strncat-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,120 @@
+/* Checking strncat.
+ Copyright (C) 1991, 1997, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+char *
+__strncat_chk (char *__restrict__ dest, const char *__restrict__ src,
+ size_t n, size_t slen)
+{
+ char c;
+ char *s = dest;
+
+ do
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *dest++;
+ }
+ while (c != '\0');
+
+ ++slen;
+ dest -= 2;
+
+ if (n >= 4)
+ {
+ size_t n4 = n >> 2;
+ do
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ } while (--n4 > 0);
+ n &= 3;
+ }
+
+ while (n > 0)
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ c = *src++;
+ *++dest = c;
+ if (c == '\0')
+ return s;
+ n--;
+ }
+
+ if (c != '\0')
+ {
+ if (slen-- == 0)
+ __chk_fail ();
+ *++dest = '\0';
+ }
+
+ return s;
+}
Added: llvm-gcc-4.2/trunk/libssp/strncpy-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/strncpy-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/strncpy-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/strncpy-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,53 @@
+/* Checking strncpy.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_STRNCPY
+char *
+__strncpy_chk (char *__restrict__ dest, const char *__restrict__ src,
+ size_t len, size_t slen)
+{
+ if (len > slen)
+ __chk_fail ();
+ return strncpy (dest, src, len);
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/vsnprintf-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/vsnprintf-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/vsnprintf-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/vsnprintf-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,55 @@
+/* Checking vsnprintf.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#include <stdarg.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_USABLE_VSNPRINTF
+int
+__vsnprintf_chk (char *s, size_t n, int flags __attribute__((unused)),
+ size_t slen, const char *format, va_list arg)
+{
+ if (n > slen)
+ __chk_fail ();
+
+ return vsnprintf (s, n, format, arg);
+}
+#endif
Added: llvm-gcc-4.2/trunk/libssp/vsprintf-chk.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libssp/vsprintf-chk.c?rev=43913&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/libssp/vsprintf-chk.c (added)
+++ llvm-gcc-4.2/trunk/libssp/vsprintf-chk.c Thu Nov 8 16:56:19 2007
@@ -0,0 +1,65 @@
+/* Checking vsprintf.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. This exception does not
+ however invalidate any other reasons why the executable file might be
+ covered by the GNU General Public License. */
+
+#include "config.h"
+#include <ssp/ssp.h>
+#include <stdarg.h>
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+extern void __chk_fail (void) __attribute__((__noreturn__));
+
+#ifdef HAVE_USABLE_VSNPRINTF
+int
+__vsprintf_chk (char *s, int flags __attribute__((unused)),
+ size_t slen, const char *format, va_list arg)
+{
+ int done;
+
+ if (slen > (size_t) INT_MAX)
+ done = vsprintf (s, format, arg);
+ else
+ {
+ done = vsnprintf (s, slen, format, arg);
+ if (done >= 0 && (size_t) done >= slen)
+ __chk_fail ();
+ }
+ return done;
+}
+#endif
More information about the llvm-commits
mailing list