diff options
author | 2019-04-03 04:52:26 +0000 | |
---|---|---|
committer | 2019-04-03 04:52:26 +0000 | |
commit | 1cbfedc589454d1648a14b53fbd0e0645f3d28c4 (patch) | |
tree | 1718ad6b604084034792b04e48f690c074331fc4 | |
parent | Default to port 853 if DoT is used; pointed out by tedu (diff) | |
download | wireguard-openbsd-1cbfedc589454d1648a14b53fbd0e0645f3d28c4.tar.xz wireguard-openbsd-1cbfedc589454d1648a14b53fbd0e0645f3d28c4.zip |
mortimer unlinked libobjc from the build, but didn't know how to cvs rm.
I don't know much about compilers, but what I do have are a very particular
set of skills. Skills I have acquired over a very long career.
127 files changed, 0 insertions, 57800 deletions
diff --git a/gnu/gcc/libobjc/ChangeLog b/gnu/gcc/libobjc/ChangeLog deleted file mode 100644 index 839aa4f95bd..00000000000 --- a/gnu/gcc/libobjc/ChangeLog +++ /dev/null @@ -1,1272 +0,0 @@ -2007-07-19 Release Manager - - * GCC 4.2.1 released. - -2007-05-13 Release Manager - - * GCC 4.2.0 released. - -2006-10-14 Geoffrey Keating <geoffk@apple.com> - - * Makefile.in: Use multi_basedir instead of toplevel_srcdir. - * configure.ac: Use multi.m4 from aclocal rather than custom - code. Use multi_basedir instead of toplevel_srcdir. - * aclocal.m4: Regenerate. - * configure: Regenerate. - -2006-10-10 Brooks Moses <bmoses@stanford.edu> - - * Makefile.in: Added empty "pdf" target. - -2006-07-18 Paolo Bonzini <bonzini@gnu.org> - - * configure: Regenerate. - -2006-05-23 Carlos O'Donell <carlos@codesourcery.com> - - * Makefile.in: Add install-html target. Add install-html to .PHONY - -2006-02-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - PR libobjc/26309 - * thr-objc.c (_XOPEN_SOURCE): Don't define on Tru64 UNIX. - -2006-01-24 David Ayers <d.ayers@inode.at> - - PR libobjc/9751 - * gc.c (class_ivar_set_gcinvisible): Replace strncpy with memcpy - and insure the new strings are '\0' termintated. - -2006-01-24 David Ayers <d.ayers@inode.at> - - PR libobjc/13946 - * configure.ac: Add include directives for --enable-objc-gc. - * Makefile.in: Ditto. - * configure: Regenerate. - - * gc.c (__objc_class_structure_encoding): Increment the used bytes - instead of the local pointer to them. - -2005-12-14 Andrew Pinski <pinskia@physics.uc.edu> - - PR objc/25360 - * objc/objc-api.c (_C_COMPLEX): New define. - * encoding.c (objc_sizeof_type): Handle _C_Complex. - (objc_alignof_type): Likewise. - (objc_skip_typespec): Likewise. - -2005-12-15 David Ayers <d.ayers@inode.at> - - PR libobjc/14382 - * README (+load,+initialize): Fix documentation to reflect - intended and implemented semantics for +load and +initialize. - -2005-12-12 Andrew Pinski <pinskia@physics.uc.edu> - - * encoding.c (TYPE_FIELDS): Fix to skip over just _C_STRUCT_B and - the name. - (get_inner_array_type): Fix to skip over _C_ARY_B and size. - (rs6000_special_round_type_align): Update for the ABI fix. - (objc_layout_finish_structure): Correct the encoding which is passed to - ROUND_TYPE_ALIGN. - -2005-12-11 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/25347 - * encoding.c (objc_sizeof_type): Don't handle _C_UNION_B special - but use the struct layout functions. - (objc_alignof_type): Likewise. - (objc_layout_structure): Handle _C_UNION_B also. - (objc_layout_structure_next_member): Likewise. - (objc_layout_finish_structure): Likewise. - -2005-12-11 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/25346 - * objc/objc-api.h (_C_BOOL): New define. - * encoding.c (objc_sizeof_type): Handle _C_BOOL. - (objc_alignof_type): Likewise. - (objc_skip_typespec): Likewise. - -2005-11-20 David Ayers <d.ayers@inode.at> - - PR libobjc/19024 - * objc/hash.h: Remove deprecated hash API. - * hash_compat.c: Remove. - * Makefile.in: Remove reference to hash_compat.c. - - * configure.ac (VERSION): Bump library version to 2:0:0. - * configure: Regenerate. - -2005-11-09 Alexandre Oliva <aoliva@redhat.com> - - PR other/4372 - * thr-objc.c (_XOPEN_SOURCE): Define. - -2005-10-07 Ulrich Weigand <uweigand@de.ibm.com> - - PR libobjc/23612 - * objc/objc-api.h (struct objc_ivar): Move definition to - global scope. - -2005-09-04 Andrew Pinski <pinskia@physics.uc.edu> - Rasmus Hahn <rassahah@neofonie.de> - - PR libobjc/23108 - * archive.c (objc_write_type): Correct the element offset. - (objc_read_type): Likewise. - -2005-08-17 Kelley Cook <kcook@gcc.gnu.org> - - * All files: Update FSF address. - -2005-08-13 Marcin Koziej <creep@desk.pl> - Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/22492 - * exception.c (PERSONALITY_FUNCTION): Fix the PC with finally. - -2005-08-13 Andrew Pinski <pinskia@physics.uc.edu> - - * Makefile.in (extra_ldflags_libobjc): New. - (libobjc$(libext).la): Add extra_ldflags_libobjc to the link line. - (libobjc_gc$(libext).la): Likewise. - * configure.ac (extra_ldflags_libgfortran): Set for *-darwin* to - "-Wl,-single_module". - * configure: Regenerate. - * linking.m (_objcInit): Remove. - -2005-07-26 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/22606 - * Makefile.in (ALL_CFLAGS): Add -fexceptions. - -2005-06-08 David Ayers <d.ayers@inode.at> - - * objc/NXConstStr.h, objc/Object.h, objc/Protocol.h, - objc/encoding.h, objc/hash.h, objc/objc-api.h, - objc/runtime.h, objc/sarray.h, objc/thr.h, - objc/typedstream.h: Do not include Objective-C headers as - system headers. - -2005-06-07 David Ayers <d.ayers@inode.at> - - * archive.c, init.c, selector.c: Include hash.h. - * archive.c, class.c, encoding.c, gc.c, hash.c, hash_compat.c, - init.c, misc.c, nil_method.c, objects.c, sarray.c, selector.c, - sendmsg.c, thr-dce.c, thr-decosf1.c, thr-irix.c, thr-mach.c, - thr-objc.c, thr-os2.c, thr-posix.c, thr-pthreads.c, thr-rtems.c, - thr-single.c, thr-solaris.c, thr-vxworks.c, thr-win32.c, thr.c: - Include Objective-C headers with quotes and objc/ directory - prefix. - -2005-05-19 Richard Henderson <rth@redhat.com> - - * exception.c: Revert last change. - -2005-05-19 David Ayers <d.ayers@inode.at> - - * exception.c: Include tsystem.h for unwind.h. - -2005-05-09 Mike Stump <mrs@apple.com> - - * configure: Regenerate. - -2005-04-12 Mike Stump <mrs@apple.com> - - * configure: Regenerate. - -2005-03-21 Zack Weinberg <zack@codesourcery.com> - - * Makefile.in: Set gcc_version here. - * configure.ac: Do not invoke TL_AC_GCC_VERSION. Adjust quoting - in definition of toolexeclibdir so that $(gcc_version) is expanded - by the Makefile. - * aclocal.m4, configure: Regenerate. - -2005-03-03 David Ayers <d.ayers@inode.at> - - * objc/hash.h (OBJC_IGNORE_DEPRECATED_API): Update deprecated - version reference. Correct typo. - -2005-03-02 David Ayers <d.ayers@inode.at> - - PR libobjc/19024 - * Makefile.in (OBJS): Add hash_compat.lo. - (OBJS_GC): Add hash_compat_gc.lo. - (hash_compat_gc.lo): New target and rule. - * objc/hash.h (hash_new, hash_delete, hash_add, hash_remove) - (hash_next, hash_value_for_key, hash_is_key_in_hash) - (hash_ptr, hash_string, compare_ptrs, compare_strings): Prefix - with objc_. Add deprecated non prefixed inlined versions. - (OBJC_IGNORE_DEPRECATED_API): New macro to hide deprecated - declarations. - * hash.c (hash_new, hash_delete, hash_add, hash_remove, hash_next) - (hash_value_for_key, hash_is_key_in_hash): Prefix with objc_ and - update callers. - * hash_compat.c: New file. - * archive.c: Update callers. - * init.c: Likewise. - * selector.c: Likewise. - * libobjc.def: Add objc_ versions of hash functions. - -2005-02-28 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/20252 - * Makefile.in (GTHREAD_FLAGS): Remove. - (ALL_CFLAGS): Remove usage of GTHREAD_FLAGS. - * thr-objc.c: Include config.h. - * configure.ac: Instead of looking at GCC's makefile, figure out if - GTHREAD_FLAGS should be defined by looking at the `thread model' - of the current gcc. - * configure: Regenerate. - * config.h.in: Regenerate. - -2005-02-28 Paolo Bonzini <bonzini@gnu.org> - - PR bootstrap/17383 - * configure.ac: Call GCC_TOPLEV_SUBDIRS. - (Determine CFLAGS for gthread): Use $host_subdir. - * configure: Regenerate. - * Makefile.in (host_subdir): New. - (INCLUDES): Use it. - -2004-12-20 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/12035 - * gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ since - they are not used. - Include limits.h and stdlib.h. - Define BITS_PER_WORD. - -2004-12-12 Alexander Malmberg <alexander@malmberg.org> - - * selector.c (__objc_init_selector_tables): Add missing void to - definition. - -2004-12-02 Richard Sandiford <rsandifo@redhat.com> - - * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. - * configure, aclocal.m4: Regenerate. - -2004-11-29 Kelley Cook <kcook@gcc.gnu.org> - - * configure: Regenerate for libtool change. - -2004-11-25 Kelley Cook <kcook@gcc.gnu.org> - - * configure: Regenerate for libtool reversion. - -2004-11-24 Kelley Cook <kcook@gcc.gnu.org> - - * configure: Regenerate for libtool change. - -2004-11-24 Kelley Cook <kcook@gcc.gnu.org> - - * aclocal.m4, config.h.in: Regenerate. - -2004-10-08 Mike Stump <mrs@apple.com> - Andrew Pinski <pinskia@physics.uc.edu> - - * aclocal.m4: Rename to ... - * acinclude.m4: here and also use m4_include instead of sinclude. - * aclocal.m4: Regenerate. - * configure: Regenerate. - * configure.ac: Add AM_MAINTAINER_MODE and AM_PROG_CC_C_O. - * Makefile.in (configure): Add @MAINT@ infront of configure.ac - -2004-10-08 Andrew Pinski <pinskia@physics.uc.edu> - - * archive.c: Fix all the warnings about passing unsigned char* - to char* and the other way too. - -2004-09-16 Andrew Pinski <pinskia@physics.uc.edu> - - PR libobjc/16448 - * exception.c: Include config.h - (objc_exception_throw): Change _GLIBCXX_SJLJ_EXCEPTIONS to - SJLJ_EXCEPTIONS. - * configure.ac: Find out what exception handling code we use. - * configure: Regenerate. - * config.h.in: New file, regenerate. - -2004-09-16 Andrew Pinski <apinski@apple.com> - - * encoding.c (ALTIVEC_VECTOR_MODE): Define a bogus macro. - -2004-08-28 Nathanael Nerode <neroden@gcc.gnu.org> - - * configure.ac: Switch from _GCC_TOPLEV_NONCANONICAL_TARGET to - ACX_NONCANONICAL_TARGET. - * configure: Regenerate. - -2004-08-13 Ziemowit Laski <zlaski@apple.com> - - * objc/sarray.h: Hoist include of assert.h near the top of file, - and mark the remainder of the file 'extern "C"'. - -2004-08-13 Andrew Pinski <pinskia@physics.uc.edu> - - * objc/Object.h: Move includes out of extern "C" blocks. - * objc/encoding.h: Likewise. - * objc/hash.h: Likewise. - * objc/objc-api.h: Likewise. - * objc/runtime.h: Likewise. - * objc/sarray.h: Likewise. - * objc/typedstream.h: Likewise. - -2004-08-12 Ziemowit Laski <zlaski@apple.com> - - * objc/NXConstStr.h: Update copyright date; bracket with - 'extern "C"' for C++ use; make include syntax consistent - by using <...> instead of "..."; hoist <objc/...> includes - above the 'extern "C"' block. - * objc/Object.h: Likewise. - * objc/Protocol.h: Likewise. - * objc/encoding.h: Likewise. - * objc/hash.h: Likewise. - * objc/runtime.h: Likewise. - * objc/sarray.h: Likewise. - * objc/thr.h: Likewise. - * objc/typedstream.h: Likewise. - * objc/objc-api.h: Add 'extern "C"' block for C++ use. - (objc_static_instances): For C++ case, do away with - zero-sized array. - (objc_method): Hoist definition to file scope. - (_objc_load_callback, _objc_object_alloc, class_get_class_method, - class_get_instance_method, class_create_instance, - class_get_class_name, class_get_instance_size, - class_get_meta_class, class_get_super_class, class_get_version, - class_is_class, class_is_meta_class, class_set_version, - class_get_gc_object_type, class_ivar_set_gcinvisible, - get_imp): Rename 'class' parameter to '_class'. - * objc/objc-list.h: Add 'extern "C"' block for C++ use. - * objc/objc.h: Update copyright date. - (arglist_t): Provide a union tag. - -2004-07-22 Andrew Pinski <pinskia@physics.uc.edu> - - * thr.c (__objc_thread_detach_function): Do not mark as volatile - but instead use the attribute noreturn. - -2004-06-28 Zack Weinberg <zack@codesourcery.com> - - * encoding.c: Rename target_flags with a #define to avoid - conflict with a prior declaration. - -2004-06-24 Andrew Pinski <apinski@apple.com> - - * objc/encoding.h: Wrap the functions with extern "C" for C++ - mode. - * objc/hash.h: Likewise. - * objc/objc-api.h: Likewise. - * objc/objc-list.h: Likewise. - * objc/runtime.h: Likewise. - * objc/sarray.h: Likewise. - * objc/thr.h: Likewise. - * objc/typedstream.h: Likewise. - - -2004-06-21 Nick Clifton <nickc@redhat.com> - - * encoding.c (BITS_PER_UNIT): Define if a definition is not - provided. - -2004-06-20 Alexander Malmberg <alexander@malmberg.org> - - * Makefile.in (exception.lo): Remove $(OBJC_GCFLAGS). - (exception_gc.lo): New. - (OBJS_GC): Add exception_gc.lo. - -2004-06-17 Richard Henderson <rth@redhat.com> - - * exception.c: New file. - * Makefile.in (exception.lo): New. - (OBJS): Add it. - -2004-06-14 Andrew Pinski <pinskia@physics.uc.edu> - - * linking.m (_objcInit): New empty function - for Darwin only. - -2004-06-11 Andrew Pinski <pinskia@physics.uc.edu> - - * configure.ac: Support --enable-shared=libobjc. - * configure: Regenerate. - - PR libobjc/15901 - * configure.ac: Do not disable shared by default. - * configure: Regenerate. - -2004-06-03 Nicola Pero <n.pero@mi.flashnet.it> - - * Protocol.m ([-isEqual:]): Small optimizations returning - immediately if the argument is equal to self, and accessing - the argument's name directly if it's a protocol. - -2004-06-03 David Ayers <d.ayers@inode.at> - - * Protocol.m ([-isEqual:]): Test the class of the argument. - -2004-05-25 Andrew Pinski <pinskia@physics.uc.edu> - - * configure.ac (includedir): Rename to ... - (includedirname). - * Makefile.in: s/includedir/includedirname/. - - PR target/11572 - * configure.ac (includedir): Set to "include" - except for Darwin. - (libext) Set to empty except for Darwin. - * configure: Regenerate - * Makefile.in: s/libobjc.la/libobjc$(libext).la/g. - s/include/$(includedir)/g. - -2004-05-25 Daniel Jacobowitz <drow@false.org> - - * Makefile.in: Add .NOEXPORT. - -2004-05-25 Andrew Pinski <pinskia@physics.uc.edu> - - Merge from the libobjc-branch - 2004-02-09 Andrew Pinski <pinskia@physics.uc.edu> - - * Makefile.in (OBJC_H): Change objc-deps.h to objc-decls.h. - - 2004-02-03 Andrew Pinski <pinskia@physics.uc.edu> - - * Makefile.in (OBJC_H): Add objc-deps.h. - - 2004-01-27 Nicola Pero <n.pero@mi.flashnet.it> - - * Protocol.m ([-conformsTo:]): If the argument is nil, return NO. - ([-hash], [-isEqual:]): New methods. - - 2004-01-27 Richard Frith-Macdonald <rfm@gnu.org> - - * sarray.c (sarray_free): Add a better comment. - - 2004-01-27 Adam Fedor <fedor@gnu.org> - - * hash.c (hash_add): Cast cachep to int. - * selector.c (__sel_register_typed_name): Cast - soffset_decode to int. - - 2004-01-27 Alexander Malmberg <alexander@malmberg.org> - - * selector.c: Rename register_selectors_from_list to - __objc_register_selectors_from_list. Update caller. - (__objc_register_selectors_from_list): Lock __objc_runtime_mutex - while registering selectors. Use __sel_register_typed_name instead - of sel_register_typed_name. Check for NULL method_name:s. - (pool_alloc_selector): New function. - (__sel_register_typed_name): Use pool_alloc_selector to allocate - selector structures. - * sendmsg.c (class_add_method_list): Use - __objc_register_selectors_from_list. - * objc/runtime.h: Add __objc_register_selectors_from_list. - - 2004-01-25 Adam Fedor <fedor@gnu.org> - Nicola Pero <n.pero@mi.flashnet.it> - Andrew Pinski <pinskia@physics.uc.edu> - - * objc/objc-decls.h: New file. - * objc/objc-api.h (_objc_lookup_class): Mark as export. - (_objc_load_callback): Likewise. - (_objc_object_alloc): Likewise. - (_objc_object_copy): Likewise. - (_objc_object_dispose): Likewise. - - 2004-01-25 Andrew Pinski <pinskia@physics.uc.edu> - - * archive.c: s/__inline__/inline - * sendmsg.c: Likewise. - - * encoding.c: Remove FIXME about the warning - about unused variable. - * sendmsg.c: Add a FIXME comment saying that - this should be using libffi. - - * Makefile.in (LIBTOOL): Use @LIBTOOL@ now as it works. - - -2004-05-13 Andrew Pinski <pinskia@physics.uc.edu> - - * archive.c (objc_read_class): Initialize class_name. - (objc_read_selector): Initialize selector_name. - -2004-05-09 Richard Sandiford <rsandifo@redhat.com> - - * Makefile.in (toolexecdir): Remove trailing space. - -2004-04-15 Nathanael Nerode <neroden@gcc.gnu.org> - - PR libobjc/14948 - * configure.ac: De-precious CC so multilibs work. - * configure: Regenerate. - -2004-04-14 Nathanael Nerode <neroden@gcc.gnu.org> - - * configure.ac: Restore toolexecdir. - * Makefile.in: Restore toolexecdir. - * configure: Regenerate. - -2004-04-09 Nathanael Nerode <neroden@gcc.gnu.org> - - * configure.ac: Remove (unused) glibcpp_prefixdir. - * configure: Regenerate. - - * configure.in: Rename to configure.ac. - * Makefile.in: Update to match. - - * Makefile.in: Remove toolexecdir, glibcpp_toolexecdir (unused). - Replace glibcpp_toolexeclibdir with toolexeclibdir. - * configure.in: Remove glibcpp_toolexecdir (unused). - Replace glibcpp_toolexeclibdir with toolexeclibdir. Don't generate - config.h or stamp-h (unused). Move one comment to the right place. - * configure: Regenerate. - * config.h.in: Remove (unused). - - * config.h.in: Regenerate with autoheader. - - * Makefile.in: Remove (unused) gcc_version_trigger. - * configure.in: Remove (unused) glibcpp_builddir. Don't AC_SUBST - gcc_version_trigger. - * configure: Regenerate. - - * configure.in: Switch to modern style for AC_INIT, AC_OUTPUT. - Sort file into sections. Remove dnl where appropriate. Fix - other style issues. - * configure: Regenerate. - - * configure.in: Replace old AC_PROG_CC hack with new one. - Define toplevel_srcdir in terms of srcdir, not top_srcdir (there - are no subdirectory output files, so this is fine). Change prereq - to autoconf 2.59. - * aclocal.m4: Include ../config/no-executables.m4. - * configure: Regenerate with autoconf 2.59. - - * configure.in: Improve comments on gthread_cflags. Improve m4 - quotation, and replace 'if test' with 'case', for --enable-objc-gc. - * configure: Regenerate. - - * configure.in: Move PACKAGE and VERSION settings up top. Remove - unused call to AC_PROG_LN_S. Default RANLIB to ':'. Remove - redundant checks for values of RANLIB, AR, INSTALL. - * configure: Regenerate. - - * configure.in: Clean up handling of - --enable-version-specific-runtime-libs and related variables; - replace 'if test' with 'case' where reasonable. Fix comments. - Remove useless libstdcxx_interface. - * configure: Regenerate. - - * configure.in: Use _GCC_TOPLEV_NONCANONICAL_TARGET. - Replace uses of target_alias with target_noncanonical. - * aclocal.m4: Include ../config/acx.m4. - * configure: Regenerate. - * Makefile.in: Replace uses of target_alias with target_noncanonical. - Fix copyright statement. - - * configure.in: Hand-inline bulky, confusing macros from - aclocal.m4. Replace references to "GNU Objective C" with "GCC". - Update copyright notice. Remove stuff for automake, which isn't - used in this directory. Remove emacs local variables. - * aclocal.m4: Remove hand-inlined macros. Update copyright notice. - * configure: Regenerate. - -2004-03-16 Manfred Hollstein <mh@suse.com> - - * Makefile.in, configure.in, configure: Update copyright years. - -2004-03-15 Manfred Hollstein <mh@suse.com> - - * Makefile.in (LIBOBJC_VERSION, LIBOBJC_GC_VERSION): Use - definition from configure.in. - * configure.in (PACKAGE): Add definition. - (VERSION): Add definition; substitute it in output files. - * configure: Re-generate. - -2004-03-05 Ziemowit Laski <zlaski@apple.com> - - * objc/hash.h (hash_string, compare_strings): - Add type-casts to make Objective-C++ happy. - * objc/typedstream.h (objc_get_stream_class_version): - Rename parameter from 'class' to 'class_name' to make - Objective-C++ happy. - -2004-03-01 Michael Matz <matz@suse.de> - - * Makefile.in (ALL_CFLAGS): Add -fno-strict-aliasing. - -2004-02-06 Ziemowit Laski <zlaski@apple.com> - - * objc/objc-api.h (objc_super): The 'class' field shall - be named 'super_class' #ifdef __cplusplus. - -2004-01-17 Andrew Pinski <pinskia@physics.uc.edu> - - PR target/10781 - * encoding.c (rs6000_special_round_type_align): Define. - -2004-01-14 Adam Fedor <fedor@gnu.org> - - PR libobjc/12155 - * selector.c (__objc_register_instance_methods_to_class): Free - new_list if not used. - -2004-01-09 Andrew Ruder <aeruder@ksu.edu> - - PR libobjc/11904 - * sarray.c (sarray_free): Free array->is_copy_of latter. - -2003-12-01 Zack Weinberg <zack@codesourcery.com> - - PR 11433 - * Protocol.m (descriptionForInstanceMethod): Don't dereference - instance_methods if it's NULL. - (descriptionForClassMethod): Likewise for class_methods. - -2003-10-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * Makefile.in (runtime-info.h): Remove -Wp. - -2003-10-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * Makefile.in (CC1OBJ): Remove. - (runtime-info.h): Invoke $(CC) so all MULTIFLAGS are handled - correctly. - Use .m extension for temporary file. - Remove assembler temp file. - -2003-10-20 Joseph S. Myers <jsm@polyomino.org.uk> - - * objc/hash.h (hash_string): Don't use a cast as an lvalue. - -2003-10-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * Makefile.in (runtime-info.h): Use MULTIFLAGS. - -2003-09-09 Alan Modra <amodra@bigpond.net.au> - - * configure: Regenerate. - -2003-08-27 Alexander Malmberg <alexander@malmberg.org> - - * Makefile.in, aclocal.m4: Update to $(libdir)/gcc/ instead of - (libdir)/gcc-lib/ when installing. - * configure: Regenerate. - -Thu Jul 10 10:27:43 2003 Nicola Pero <n.pero@mi.flashnet.it> - - libobjc/9969 - * sendmsg.c (get_imp): Fixed rare threading problem. - (__objc_responds_to): Similar fixes. - (objc_msg_lookup): Similar fixes. - (__objc_init_install_dtable): Lock the runtime before checking if the - table is installed. - -2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org> - - * hash.c, init.c, libobjc.def, libobjc_entry.c, linking.m, - makefile.dos, misc.c, nil_method.c, objects.c, sarray.c, - selector.c, sendmsg.c, thr-dce.c, thr-decosf1.c, thr-irix.c, - thr-mach.c, thr-objc.c, thr-os2.c, thr-posix.c, thr-pthreads.c, - thr-rtems.c, thr-single.c, thr-solaris.c, thr-vxworks.c, - thr-win32.c, thr.c: Replace "GNU CC" with "GCC". - * Makefile.in, NXConstStr.m, Object.m, Protocol.m, archive.c, - class.c, encoding.c, gc.c, objc/NXConstStr.h, objc/Object.h, - objc/Protocol.h, objc/encoding.h, objc/hash.h, objc/objc-api.h, - objc/objc-list.h, objc/objc.h, ocjc/runtime.h, objc/sarray.h, - objc/thr.h, objc/typedstream.h: Replace "GNU CC" with "GCC". - -Tue May 13 14:56:03 2003 Richard Frith-Macdonald <rfm@gnu.org> - Nicola Pero <n.pero@mi.flashnet.it> - - libobjc/10742 - * init.c (class_superclass_of_class): New function. - (create_tree_of_subclasses_inherited_from): Use it. - (__objc_tree_insert_class): Likewise. - (class_is_subclass_of_class): Likewise. - -2003-04-11 David Chad <davidc@freebsd.org> - Loren J. Rittle <ljrittle@acm.org> - - libobjc/8562 - * objc/hash.h (hash_string): Constify correctly. - (compare_ptrs): Use direct compare. - * objc/objc-list.h (list_nth): Rename index to indx to avoid shadow. - * objc/sarray.h: Global rename index to indx to avoid shadow. - -2003-03-12 Andreas Schwab <schwab@suse.de> - - * aclocal.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Avoid trailing /. in - glibcpp_toolexeclibdir. - * configure: Rebuilt. - -2003-02-20 Alexandre Oliva <aoliva@redhat.com> - - * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to - config.status. - * configure: Rebuilt. - -2003-01-27 Alexandre Oliva <aoliva@redhat.com> - - * aclocal.m4 (glibcpp_toolexeclibdir): Instead of - $(MULTISUBDIR), use `$CC -print-multi-os-directory`, unless - version_specific_libs is enabled. - * configure: Rebuilt. - -2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de> - - * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. - (install-libs, install-headers): Prepend $(DESTDIR) to - destination paths in all (un)installation commands. - -2002-12-02 Zack Weinberg <zack@codesourcery.com> - - * thr-objc.c: Include coretypes.h and tm.h. - -2002-12-01 Zack Weinberg <zack@codesourcery.com> - - * encoding.c, sendmsg.c: Include coretypes.h and tm.h. - -2002-11-26 Nathanael Nerode <neroden@gcc.gnu.org> - - * configure.in: Remove skip-this-dir support. - * configure: Regenerate. - -2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (all): Fix multilib parallel build. - -Thu Sep 12 12:44:37 2002 Nicola Pero <n.pero@mi.flashnet.it> - - * sendmsg.c (nil_method): Declare not to take a variable number of - args. - (objc_msg_lookup): Cast nil_method to IMP before returning it. - (objc_msg_lookup_super): The same. - -2002-09-10 Jan Hubicka <jh@suse.cz> - - * nil_method.c (nil_method): No longer defined with variable - arguments. - -2002-07-02 Rodney Brown <rbrown64@csc.com.au> - - * objc/encoding.h: Fix formatting. - * objc/hash.h: Likewise. - * objc/objc-api.h: Likewise. - * objc/runtime.h: Likewise. - * objc/thr.h: Likewise. - * archive.c: Likewise. - * class.c: Likewise. - * encoding.c: Likewise. - * gc.c: Likewise. - * hash.c: Likewise. - * init.c: Likewise. - * misc.c: Likewise. - * nil_method.c: Likewise. - * objects.c: Likewise. - * sarray.c: Likewise. - * selector.c: Likewise. - * sendmsg.c: Likewise. - * thr-mach.c: Likewise. - * thr.c: Likewise. - -2002-06-25 DJ Delorie <dj@redhat.com> - - * aclocal.m4 (GLIBCPP_CONFIGURE): Split out - GLIBCPP_TOPREL_CONFIGURE. - * configure.in: Call it before AC_CANONICAL_SYSTEM. - * configure: Regenerate. - -2002-06-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Object.m (forward, read, write): Fix unused parameter warnings. - * encoding.c: Include <stdlib.h>. - (target_flags): Mark with attribute unused. - (atoi): Delete. - * runtime.h (__objc_selector_max_index): Change to unsigned int. - (__objc_generate_gc_type_description): Prototype. - * selector.c (__objc_selector_max_index): Change to unsigned int. - -Mon Jun 17 18:37:42 2002 Nicola Pero <n.pero@mi.flashnet.it> - - * sendmsg.c (__objc_get_forward_imp): Fix warning by making sure - we always have a return value: if __objc_msg_forward does not - supply a forwarding implementation, return the default - __builtin_apply based one. - -2002-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Object.m: Fix signed/unsigned warning. - * Protocol.m: Likewise. - * archive.c: Always include stdlib.h. - (objc_read_short, objc_read_unsigned_short, objc_read_int, - objc_read_long, __objc_read_nbyte_uint, __objc_read_nbyte_ulong): - Fix signed/unsigned warning. - (objc_write_type, objc_read_type, objc_write_types, - objc_read_types): Ensure ctype 8-bit safety. - (__objc_no_write, __objc_no_read): Mark unused parameters. - * class.c (class_table_setup): Specify void arg. - * encoding.c (atoi, objc_sizeof_type, objc_alignof_type, - objc_skip_typespec, objc_skip_offset, - objc_layout_structure_next_member): Ensure ctype 8-bit safety. - (objc_layout_structure_next_member): Ensure variables are - initialized. - * gc.c (__objc_generate_gc_type_description, - class_ivar_set_gcinvisible): Mark unused parameters. - * init.c (__objc_send_load, __objc_destroy_class_tree_node): Mark - unused parameters. - (__objc_init_protocols) Fix signed/unsigned warning. - * nil_method.c (nil_method): Mark unused parameters. - * thr.h (objc_thread_callback): Specify void arg. - * sarray.c (sarray_new, sarray_realloc, sarray_free): Fix - signed/unsigned warning. - (sarray_free): Fix formatting. - * selector.c (sel_types_match): Ensure ctype 8-bit safety. - * sendmsg.c (__objc_init_install_dtable) Mark unused parameters. - -2002-06-09 Andreas Jaeger <aj@suse.de> - - * encoding.c (objc_layout_structure_next_member): Remove unused - variable. - -2002-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (SHELL): Set to @SHELL@. - (WARN_CFLAGS): New. - (ALL_CFLAGS): Add $(WARN_CFLAGS). - -2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * aclocal.m4: Allow for PWDCMD to override hardcoded pwd. - * configure: Regenerate. - -2002-05-08 Alexandre Oliva <aoliva@redhat.com> - - * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at - script entry, and set LD to it when configuring multilibs. - * configure: Rebuilt. - -2002-04-19 David O'Brien <obrien@FreeBSD.org> - - * encoding.c (MAX, MIN, ROUNDING): #undef before defining. - -2002-04-09 Hans-Peter Nilsson <hp@bitrange.com> - - PR objc/6107 - * objc/objc-api.h (struct objc_protocol_list): Change type of - member count from int to size_t. - -2002-02-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> - - PR libobjc/4039 - * aclocal.m4: Replace with version copied from libstdc++-v3. - * configure.in: Update for changes to aclocal and Makefile. - * configure: Regenerate. - * Makefile.in: Correct install of multilibs and shared libs, use - INSTALL_DATA for include files. - -Mon Dec 17 17:02:12 2001 Nicola Pero <nicola@brainstorm.co.uk> - - * init.c (__objc_exec_class): Fixed bug in the loop on unclaimed - categories - when an unclaimed category was found, the loop was - doing two steps forward instead of one, so that in certain cases - it was failing to properly load all the categories. (Reported - with fix by Alexander Malmberg <alexander@malmberg.org>). - -2001-11-14 Aldy Hernandez <aldyh@redhat.com> - - * encoding.c: Add target_flags. - -2001-11-07 Aldy Hernandez <aldyh@redhat.com> - - * objc/objc-api.h (_C_VECTOR): New. - - * encoding.c (VECTOR_TYPE): New. - -Mon Oct 29 21:29:21 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * class.c: Rewritten the class table to use optimized, lock-free - lookup. This more than doubles the speed of class method - invocations. (class_table_setup), (class_table_insert), - (class_table_replace), (class_table_get_safe), - (class_table_next), (class_table_print), - (class_table_print_histogram): New functions. - (__objc_init_class_tables): Use class_table_setup. - (__objc_add_class_to_hash): Use class_table_get_safe and - class_table_insert. (objc_lookup_class), (objc_get_class): Do not - assert the existence of the table; do not lock the runtime; use - class_table_get_safe. (objc_next_class): Use class_table_next. - (__objc_resolve_class_links): Use class_table_next. - (class_pose_as): Use class_table_replace. - -2001-09-10 Ovidiu Predescu <ovidiu@cup.hp.com> - - * gc.c: Removed the DEBUG declaration. - -Wed Jul 18 12:48:56 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * thr.c (objc_mutex_lock): Invoke __objc_thread_id directly, - rather than through objc_thread_id, to save a function call. - (objc_mutex_trylock, objc_mutex_unlock, objc_condition_wait): - Ditto. - -Mon Jul 16 12:15:00 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * objc/objc-api.h (object_is_class): Fixed - buggy code was trying - to cast an id to a Class, which can not be done. Make the check - by using CLS_ISMETA on the class pointer instead. - (object_is_meta_class): Similar fix. - -2001-06-09 Alexandre Oliva <aoliva@redhat.com>, Stephen L Moshier <moshier@mediaone.net> - - * configure.in (AC_EXEEXT): Work around in case it expands to - nothing, as in autoconf 2.50. - * acinclude.m4: Likewise. - * configure: Rebuilt. - -2001-06-08 Nicola Pero <n.pero@mi.flashnet.it> - - * THREADS: Explain that when we compile libobjc inside GCC, we - always use thr-objc.c as a backend, which uses GCC's thread code. - -2001-06-06 Richard Frith-Macdonald <rrfm@gnu.org> - - * init.c (__objc_send_message_in_list): When setting a new entry - in __objc_load_methods use the method IMP as key, but check to see - if the method is in the hashtable by looking at the IMP also. - Also ... call the method after adding it to the hashtable rather - than before ... thus preventing an obscure possibility of infinite - recursion if a +load method itself loads a subclass. - -2001-05-25 Ovidiu Predescu <ovidiu@cup.hp.com> - - * init.c (__objc_send_message_in_list): When setting a new entry - in __objc_load_methods use the method name as key, not the method - IMP (reported by Richard Frith-Macdonald <richard@brainstorm.co.uk>). - -2001-05-09 Joseph S. Myers <jsm28@cam.ac.uk> - - * objc-features.texi: Move to ../gcc/objc.texi. - * fdl.texi: Remove. - * Makefile.in: Don't generate documentation from - objc-features.texi. - -2001-05-01 Mark Mitchell <mark@codesourcery.com> - - * fdl.texi: New file. - * objc-features.texi: Simplify. - * Makefile.in: Adjust accordingly. - -2001-04-30 Mark Mitchell <mark@codesourcery.com> - - * objc-features.texi: Use the GFDL. - -Wed Mar 21 04:44:58 EST 2001 John Wehle (john@feith.com) - - * encoding.c (REAL_TYPE): Define. - -2001-03-19 David Edelsohn <edelsohn@gnu.org> - - * encoding.c (TYPE_MODE): Define. - -2001-03-14 Nicola Pero <n.pero@mi.flashnet.it> - - * thr.c (objc_thread_add): New function. - (objc_thread_remove): Ditto. - * objc/thr.h: Declare them. - * libobjc.def: Mention them. - -2001-02-28 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Document the @compatibility_alias compiler - directive (description from Nicola Pero <n.pero@mi.flashnet.it>). - -Fri Feb 23 18:12:00 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * sendmsg.c (__objc_forward): Delete strlen() declaration. - -2001-02-08 Geoffrey Keating <geoffk@redhat.com> - - * configure.in: Don't run AC_PROG_CC_WORKS or AC_EXEEXT, because - we're not interested in the result and they might fail. - * configure: Regenerated. - -2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk> - - * objc-features.texi: Use @email. - -2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk> - - * sendmsg.c (__objc_print_dtable_stats): Don't use #ifdef inside - printf. - -2000-01-11 Richard Earnshaw <rearnsha@arm.com> - - * encoding.c (STRUCTURE_SIZE_BOUNDARY): Redefine in a way that - determines the value dynamically. - -Wed Jan 3 00:49:10 2001 Ovidiu Predescu <ovidiu@cup.hp.com> - - * sendmsg.c: Added __objc_msg_forward, a hook that allows external - libraries to provide a function that returns the real forwarding - function. This can alleviate problems __builtin_apply() and - friends have on various platforms. (Solution suggested by Helge - Hess.) - - * objc/objc-api.h: Define __objc_msg_forward. - - * sendmsg.c: Define gen_rtx_REG. - -2000-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de> - - * thr-rtems.c: New file. Stub to compile. - -2000-09-06 Alexandre Oliva <aoliva@redhat.com> - - * configure: Rebuilt with new libtool.m4. - -Tue Aug 15 00:38:56 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * configure.in: Create a config.h file. Check for <sched.h>. - * configure: Regenerate. - - * config.h.in: Check for <sched.h>. - -2000-08-14 Zack Weinberg <zack@wolery.cumb.org> - - * configure: Regenerate after change to ../libtool.m4. - -2000-08-14 Andreas Schwab <schwab@suse.de> - - * objc-features.texi (Top): Move @menu at end of node. - -2000-08-11 Manfred Hollstein <manfredh@redhat.com> - - * objc-features.texi: Move @node Top before @menu. - -Sun Aug 6 23:27:49 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Documented the new -fconstant-string-class - option. - -Sun Aug 6 22:51:16 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * thr-posix.c: Integrated Chris Ball's <cball@fmco.com> changes to - improve the Posix thread support for Objective-C. - -2000-08-04 Zack Weinberg <zack@wolery.cumb.org> - - * aclocal.m4: Replace copy of ../libtool.m4 with - sinclude(../libtool.m4). - -Fri Jul 28 08:58:02 2000 Nicola Pero <nicola@brainstorm.co.uk> - - * configure.in: Added libtool support; build shared libraries - if --enable-shared was passed on command line. - * Makefile.in: Modified most compilation commands to use libtool. - * aclocal.m4: New symbolic link to the ../libtool.m4, from the - libtool distribution. - -Sat Jul 29 00:10:21 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * sarray.c, Object.m: Removed the explicit prototypes for strlen - and memcpy on 64-bit platforms (Suggested by Rodney Brown - <rdb@cup.hp.com>). - -2000-05-12 H.J. Lu (hjl@gnu.org) - - * Makefile.in (GTHREAD_FLAGS): New. - (ALL_CFLAGS): Add $(GTHREAD_FLAGS). - (OBJC_THREAD_FILE): Changed to thr-objc. - - * configure.in (GTHREAD_FLAGS): New, check and replace it for - Makefile. - (OBJC_THREAD_FILE): Removed. - - * thr-objc.c: New. - -2000-07-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * objc/hash.h: Include string.h. - -2000-04-15 David Edelsohn <edelsohn@gnu.org> - - * Object.m (strlen): 64-bit PowerPC is a 64bit platform as well. - -2000-04-12 Jakub Jelinek <jakub@redhat.com> - - * Object.m (strlen): Provide prototype on all 64bit platforms, - not only alpha. - * sarray.c (memcpy): Likewise. - * encoding.c (objc_layout_finish_structure): Don't use - ROUND_TYPE_ALIGN on sparc. - - * encoding.c (objc_layout_structure_next_member): Do the whole - procedure even for the first member, so that we get correct - alignment. - -2000-03-29 Zack Weinberg <zack@wolery.cumb.org> - - * objc/Protocol.h, objc/objc-list.h: Change #endif labels to - comments. - -2000-02-23 Zack Weinberg <zack@wolery.cumb.org> - - * Makefile.in: Add -DIN_TARGET_LIBS to ALL_CFLAGS. - -Thu Sep 23 07:19:12 1999 Chris Ball <cball@fmco.com> - - * thr-posix.c (__objc_mutex_deallocate): made deallocate work. - -Tue Sep 21 07:47:10 1999 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (gc.o, gc_gc.o): Do not pass -fgnu-runtime to - the compiler when building C code. - -Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org> - - * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix, - libdir, libsubdir and tooldir. - -Mon Jun 21 05:40:15 1999 John David Anglin <dave@hiauly1> - - * init.c (__objc_force_linking): Make global. - -Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com) - - * configure.in (AC_EXEEXT): Remove call. - (compiler_name): Explicitly check with no extension and .exe - extension. - * configure: Regenerate. - -Sun Apr 25 01:15:34 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in (CC1OBJ): Define in terms of CC. - (runtime-info.h): Use. - -Fri April 8 08:21:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Updated the URL to Boehm's GC page. - -Fri Mar 26 23:41:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com> - - * archive.c (__objc_code_char, __objc_write_char): Explicitly specify - the char as being signed (patch from Daniel Jacobowitz - <drow@false.org>). - -Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (AC_PREREQ): Update to 2.13. - (AC_EXEEXT): Call to find possible file extension. - (compiler_name): Use. - * configure: Regenerate. - -Wed Jan 27 02:31:01 1999 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (ALL_CFLAGS): Add -DIN_GCC. - -Tue Jan 5 01:38:53 1999 Jeffrey A Law (law@cygnus.com) - - * configure.in (thread_file): Correct and simplify code to find - the thread file. - * configure: Rebuilt. - -1998-11-26 Manfred Hollstein <manfred@s-direktnet.de> - - * configure.in (compiler_name): Add check to detect if this - language's compiler has been built. - * configure: Regenerate. - -Mon Nov 23 16:50:28 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Use AC_PREREQ(2.12.1). - -Thu Nov 19 20:33:37 1998 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (runtime-info.h): Avoid GNU make extensions. - -Sun Nov 8 17:46:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (INCLUDES): Add -I$(srcdir)/$(MULTISRCTOP)../include. - -Thu Oct 22 14:34:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Use AC_CONFIG_AUX_DIR($topsrcdir). - -Sat Oct 17 05:21:31 1998 Ovidiu Predescu <ovidiu@slip.net> - - * objc-features.texi (Top): Changed the email address. - * objc-features.texi (Garbage Collection): Use @uref instead of @url. - -Mon Oct 11 21:25:27 1998 Ovidiu Predescu <ovidiu@slip.net> - - * encoding.c: Redefine get_inner_array_type to get the first entry - in the structure. - -Thu Oct 8 12:21:14 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk> - - * encoding.c (objc_skip_type_qualifiers): Handle _C_BYREF. - (objc_get_type_qualifiers): Similarly. - * objc/encoding.h (_C_BYREF): Define. - (_F_BYREF): Define. - -1998-10-07 David S. Miller <davem@pierdol.cobaltmicro.com> - - * objc/sarray.h: Make boffset be an unsigned long when sparc so it - works out on 64-bit systems. - -Tue Oct 6 20:32:06 1998 Alexandre Oliva <oliva@dcc.unicamp.br> - - * Makefile.in (INCLUDES): Make it multilib-friendly. - -Fri Oct 2 07:12:14 1998 H.J. Lu (hjl@gnu.org) - - * Makefile.in (INCLUDES): Add -I$(srcdir)/../gcc. - -Thu Oct 1 22:33:03 1998 Robert Lipe <robertl@dgii.com> - Jeffrey A Law (law@cygnus.com) - - * Makefile.in (INCLUDES): Reference gcc via $MULTIBUILDTOP. - (FLAGS_TO_PASS): Added. - (runtime-info.h): Reference cc1ibj via $MULTIBUILDTOP. - - * archive.c: Change config.h to tconfig.h. - - * configure.in: Find gcc's object directory even for multilibs. - -Wed Sep 30 18:17:17 1998 Robert Lipe <robertl@dgii.com> - - * configure.in: Escape ^ in grep string. - * configure: Rebuilt. - -Wed Sep 30 09:14:52 1998 Jeffrey A Law (law@cygnus.com) - - * All .h files pushed down into the objc/ subdirectory. - * Makefile.in (copy_headers): Corresponding changes. - * configure.in (AC_INIT): Corresponding changes. - * configure: Rebuilt. - -1998-09-30 Ben Elliston <bje@cygnus.com> - Jeff Law <law@cygnus.com> - - * Makefile.in: Rewrite. - - * configure.in: Likewise. - - * configure: Regenerate. - - * All .c files. Remove "objc" prefix when including objc header - files. Include tconfig.h, not ../tconfig.h. - -Mon Sep 21 23:27:10 1998 Ovidiu Predescu <ovidiu@slip.net> - - * encoding.c (TREE_TYPE, ARRAY_TYPE): Define. - (get_inner_array_type): Define. - -1998-09-21 Ben Elliston <bje@cygnus.com> - - * New directory. Moved files from ../gcc/objc. diff --git a/gnu/gcc/libobjc/Makefile.in b/gnu/gcc/libobjc/Makefile.in deleted file mode 100644 index 203629f4f10..00000000000 --- a/gnu/gcc/libobjc/Makefile.in +++ /dev/null @@ -1,376 +0,0 @@ -# Makefile for GNU Objective C runtime library. -# Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, -# 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. */ - -#This was cribbed from the libchill, libiberty and libstdc++ -#Makefile.in files. Some of this stuff may be unnecessary and -#worthless. - -SHELL = @SHELL@ -MAKEOVERRIDES= - -#### Start of system configuration section. #### - -srcdir = @glibcpp_srcdir@ -VPATH = @glibcpp_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -target_noncanonical = @target_noncanonical@ -gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER) -host_subdir = @host_subdir@ -top_srcdir = @top_srcdir@ -multi_basedir = @multi_basedir@ -toolexecdir = @toolexecdir@ -# Toolexecdir is used only by toolexeclibdir -toolexeclibdir = @toolexeclibdir@ - -includedirname = @includedirname@ -libext = @libext@ - -extra_ldflags_libobjc = @extra_ldflags_libobjc@ - -top_builddir = . - -libdir = $(exec_prefix)/lib -libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version) - -# Multilib support variables. -MULTISRCTOP = -MULTIBUILDTOP = -MULTIDIRS = -MULTISUBDIR = -MULTIDO = true -MULTICLEAN = true - -# Not configured per top-level version, since that doesn't get passed -# down at configure time, but overrridden by the top-level install -# target. -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -AR = @AR@ -AR_FLAGS = rc - -RANLIB = @RANLIB@ - -CC = @CC@ -CFLAGS = @CFLAGS@ -WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes -ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \ - -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing -fexceptions - -# Libtool -# The following strings describe the version of the obj-C library -# begin compiled and compatibility issues. -# Please refer to Libtool documentation about how to manage these -# numbers. -LIBOBJC_VERSION = @VERSION@ -LIBOBJC_GC_VERSION = @VERSION@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile -LIBTOOL_LINK = $(LIBTOOL) --mode=link -LIBTOOL_INSTALL = $(LIBTOOL) --mode=install -LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean -#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall - -OBJC_GCFLAGS=-DOBJC_WITH_GC=1 -OBJC_THREAD_FILE=thr-objc -OBJC_BOEHM_GC=@OBJC_BOEHM_GC@ -OBJC_BOEHM_GC_INCLUDES=@OBJC_BOEHM_GC_INCLUDES@ - -INCLUDES = -I$(srcdir)/objc -I$(srcdir)/$(MULTISRCTOP)../gcc \ - -I$(srcdir)/$(MULTISRCTOP)../gcc/config \ - -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \ - -I$(srcdir)/$(MULTISRCTOP)../include \ - $(OBJC_BOEHM_GC_INCLUDES) - - -.SUFFIXES: -.SUFFIXES: .c .m .lo - -.c.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< - -.m.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< - -# Flags to pass to a recursive make. -FLAGS_TO_PASS = \ - "AR=$(AR)" \ - "AR_FLAGS=$(AR_FLAGS)" \ - "CC=$(CC)" \ - "CFLAGS=$(CFLAGS)" \ - "DESTDIR=$(DESTDIR)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "EXTRA_OFILES=$(EXTRA_OFILES)" \ - "HDEFINES=$(HDEFINES)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "LDFLAGS=$(LDFLAGS)" \ - "LIBTOOL=$(LIBTOOL)" \ - "LOADLIBES=$(LOADLIBES)" \ - "PICFLAG=$(PICFLAG)" \ - "RANLIB=$(RANLIB)" \ - "SHELL=$(SHELL)" \ - "prefix=$(prefix)" \ - "exec_prefix=$(exec_prefix)" \ - "libdir=$(libdir)" \ - "libsubdir=$(libsubdir)" \ - "tooldir=$(tooldir)" - -all: libobjc$(libext).la $(OBJC_BOEHM_GC) - : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all - -# User-visible header files. - -OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \ - NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \ - thr.h objc-decls.h - -# Modules that comprise the runtime library. - -OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \ - misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \ - Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \ - $(OBJC_THREAD_FILE).lo exception.lo - -OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \ - init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \ - NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \ - sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \ - $(OBJC_THREAD_FILE)_gc.lo exception_gc.lo - -runtime-info.h: - echo "" > tmp-runtime.m - echo "/* This file is automatically generated */" > $@ - $(CC) $(MULTIFLAGS) -print-objc-runtime-info -S tmp-runtime.m >> $@ - rm -f tmp-runtime.m tmp-runtime.s - -archive_gc.lo: archive.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -class_gc.lo: class.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -encoding_gc.lo: encoding.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -gc.lo: gc.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $< - -gc_gc.lo: gc.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -hash_gc.lo: hash.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -init_gc.lo: init.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -linking.lo: linking.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -linking_gc.lo: linking.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -misc_gc.lo: misc.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -nil_method_gc.lo: nil_method.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -NXConstStr.lo: NXConstStr.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -NXConstStr_gc.lo: NXConstStr.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -Object.lo: Object.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -Object_gc.lo: Object.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -objects_gc.lo: objects.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -Protocol.lo: Protocol.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -Protocol_gc.lo: Protocol.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -sarray_gc.lo: sarray.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -selector_gc.lo: selector.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -sendmsg.lo: sendmsg.c runtime-info.h - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $< - -sendmsg_gc.lo: sendmsg.c runtime-info.h - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -thr_gc.lo: thr.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -$(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -exception.lo: exception.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) \ - -fexceptions $(INCLUDES) $< - -exception_gc.lo: exception.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - -fexceptions $(INCLUDES) $< - -doc: info dvi pdf html - -# No install-html support -.PHONY: install-html -install-html: - -libobjc$(libext).la: $(OBJS) - $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \ - -rpath $(toolexeclibdir) \ - -version-info $(LIBOBJC_VERSION) $(extra_ldflags_libobjc) - -libobjc_gc$(libext).la: $(OBJS_GC) - $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \ - -rpath $(toolexeclibdir) \ - -version-info $(LIBOBJC_GC_VERSION) $(extra_ldflags_libobjc) - -# -# FIXME -- The following part does not fit in the libtool context. -# Libtool is supposed to [going to] be able to create a win 32 DLL -# without extra code but since I don't have a win machine to test -# if it already works, I leave the old code here. -# -libobjc_s.a: libobjc.la - mv libobjc.a libobjc_s.a - -# Create a relocatable DLL -libobjc.dll: libobjc_s.a libobjc_entry.o - $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --base-file libobjc.base --output-exp libobjc.exp - $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --base-file libobjc.base --output-exp libobjc.exp - $(GCC_FOR_TARGET) libobjc.exp -mdll \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --output-lib libobjc.a -# -# -# -# -# - -info: -dvi: -pdf: -html: - -Makefile: Makefile.in config.status - $(SHELL) config.status - -config.status: configure - rm -f config.cache - CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ - CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck - -${srcdir}/configure: @MAINT@ configure.ac - rm -f config.cache - cd ${srcdir} && autoconf - -install: install-libs install-headers - -install-libs: installdirs - $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir) - $(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir); - if [ "$(OBJC_BOEHM_GC)" ]; then \ - $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \ - $(DESTDIR)$(toolexeclibdir);\ - fi - $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" - @-$(LIBTOOL) --mode=finish $(DESTDIR)$(toolexeclibdir) - -# Copy Objective C headers to installation include directory. -install-headers: - $(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc - for file in $(OBJC_H); do \ - realfile=$(srcdir)/objc/$${file}; \ - $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \ - done - -check uninstall install-strip dist installcheck installdirs: - -mostlyclean: - -$(LIBTOOL_CLEAN) rm -f libobjc$(libext).la libobjc_gc$(libext).la *.lo - -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \ - fflags *.aux *.cp *.dvi *.pdf *.fn *.info *.ky *.log *.pg \ - *.toc *.tp *.vr *.html libobj.exp - @$(MULTICLEAN) multi-clean DO=mostlyclean - -clean: mostlyclean - rm -f config.log - @$(MULTICLEAN) multi-clean DO=clean - -distclean: clean - @$(MULTICLEAN) multi-clean DO=distclean - rm -f config.cache config.status Makefile configure - -maintainer-clean realclean: distclean - -.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \ - install-strip dist installcheck installdirs - -# Don't export variables to the environment, in order to not confuse -# configure. -.NOEXPORT: diff --git a/gnu/gcc/libobjc/NXConstStr.m b/gnu/gcc/libobjc/NXConstStr.m deleted file mode 100644 index 9afe30ae58a..00000000000 --- a/gnu/gcc/libobjc/NXConstStr.m +++ /dev/null @@ -1,42 +0,0 @@ -/* Implementation of the NXConstantString class for Objective-C. - Copyright (C) 1995 Free Software Foundation, Inc. - Contributed by Pieter J. Schoenmakers <tiggr@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. */ - -#include "objc/NXConstStr.h" - -@implementation NXConstantString - --(const char *) cString -{ - return (c_string); -} /* -cString */ - --(unsigned int) length -{ - return (len); -} /* -length */ - -@end diff --git a/gnu/gcc/libobjc/Object.m b/gnu/gcc/libobjc/Object.m deleted file mode 100644 index 3d7d2084b32..00000000000 --- a/gnu/gcc/libobjc/Object.m +++ /dev/null @@ -1,386 +0,0 @@ -/* The implementation of class Object for Objective-C. - Copyright (C) 1993, 1994, 1995, 1997, 2002 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 <stdarg.h> -#include "objc/Object.h" -#include "objc/Protocol.h" -#include "objc/objc-api.h" - -extern int errno; - -#define MAX_CLASS_NAME_LEN 256 - -@implementation Object - -+ initialize -{ - return self; -} - -- init -{ - return self; -} - -+ new -{ - return [[self alloc] init]; -} - -+ alloc -{ - return class_create_instance(self); -} - -- free -{ - return object_dispose(self); -} - -- copy -{ - return [[self shallowCopy] deepen]; -} - -- shallowCopy -{ - return object_copy(self); -} - -- deepen -{ - return self; -} - -- deepCopy -{ - return [self copy]; -} - -- (Class)class -{ - return object_get_class(self); -} - -- (Class)superClass -{ - return object_get_super_class(self); -} - -- (MetaClass)metaClass -{ - return object_get_meta_class(self); -} - -- (const char *)name -{ - return object_get_class_name(self); -} - -- self -{ - return self; -} - -- (unsigned int)hash -{ - return (size_t)self; -} - -- (BOOL)isEqual:anObject -{ - return self==anObject; -} - -- (int)compare:anotherObject; -{ - if ([self isEqual:anotherObject]) - return 0; - // Ordering objects by their address is pretty useless, - // so subclasses should override this is some useful way. - else if (self > anotherObject) - return 1; - else - return -1; -} - -- (BOOL)isMetaClass -{ - return NO; -} - -- (BOOL)isClass -{ - return object_is_class(self); -} - -- (BOOL)isInstance -{ - return object_is_instance(self); -} - -- (BOOL)isKindOf:(Class)aClassObject -{ - Class class; - - for (class = self->isa; class!=Nil; class = class_get_super_class(class)) - if (class==aClassObject) - return YES; - return NO; -} - -- (BOOL)isMemberOf:(Class)aClassObject -{ - return self->isa==aClassObject; -} - -- (BOOL)isKindOfClassNamed:(const char *)aClassName -{ - Class class; - - if (aClassName!=NULL) - for (class = self->isa; class!=Nil; class = class_get_super_class(class)) - if (!strcmp(class_get_class_name(class), aClassName)) - return YES; - return NO; -} - -- (BOOL)isMemberOfClassNamed:(const char *)aClassName -{ - return ((aClassName!=NULL) - &&!strcmp(class_get_class_name(self->isa), aClassName)); -} - -+ (BOOL)instancesRespondTo:(SEL)aSel -{ - return class_get_instance_method(self, aSel)!=METHOD_NULL; -} - -- (BOOL)respondsTo:(SEL)aSel -{ - return ((object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))!=METHOD_NULL); -} - -+ (IMP)instanceMethodFor:(SEL)aSel -{ - return method_get_imp(class_get_instance_method(self, aSel)); -} - -// Indicates if the receiving class or instance conforms to the given protocol -// not usually overridden by subclasses -// -// Modified 9/5/94 to always search the class object's protocol list, rather -// than the meta class. - -+ (BOOL) conformsTo: (Protocol*)aProtocol -{ - size_t i; - struct objc_protocol_list* proto_list; - id parent; - - for (proto_list = ((Class)self)->protocols; - proto_list; proto_list = proto_list->next) - { - for (i=0; i < proto_list->count; i++) - { - if ([proto_list->list[i] conformsTo: aProtocol]) - return YES; - } - } - - if ((parent = [self superClass])) - return [parent conformsTo: aProtocol]; - else - return NO; -} - -- (BOOL) conformsTo: (Protocol*)aProtocol -{ - return [[self class] conformsTo:aProtocol]; -} - -- (IMP)methodFor:(SEL)aSel -{ - return (method_get_imp(object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))); -} - -+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel -{ - return ((struct objc_method_description *) - class_get_instance_method(self, aSel)); -} - -- (struct objc_method_description *)descriptionForMethod:(SEL)aSel -{ - return ((struct objc_method_description *) - (object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))); -} - -- perform:(SEL)aSel -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel); -} - -- perform:(SEL)aSel with:anObject -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel, anObject); -} - -- perform:(SEL)aSel with:anObject1 with:anObject2 -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel, anObject1, anObject2); -} - -- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame -{ - (void) argFrame; /* UNUSED */ - return (retval_t)[self doesNotRecognize: aSel]; -} - -- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame -{ - return objc_msg_sendv(self, aSel, argFrame); -} - -+ poseAs:(Class)aClassObject -{ - return class_pose_as(self, aClassObject); -} - -- (Class)transmuteClassTo:(Class)aClassObject -{ - if (object_is_instance(self)) - if (class_is_class(aClassObject)) - if (class_get_instance_size(aClassObject)==class_get_instance_size(isa)) - if ([self isKindOf:aClassObject]) - { - Class old_isa = isa; - isa = aClassObject; - return old_isa; - } - return nil; -} - -- subclassResponsibility:(SEL)aSel -{ - return [self error:"subclass should override %s", sel_get_name(aSel)]; -} - -- notImplemented:(SEL)aSel -{ - return [self error:"method %s not implemented", sel_get_name(aSel)]; -} - -- shouldNotImplement:(SEL)aSel -{ - return [self error:"%s should not implement %s", - object_get_class_name(self), sel_get_name(aSel)]; -} - -- doesNotRecognize:(SEL)aSel -{ - return [self error:"%s does not recognize %s", - object_get_class_name(self), sel_get_name(aSel)]; -} - -- error:(const char *)aString, ... -{ -#define FMT "error: %s (%s)\n%s\n" - char fmt[(strlen((char*)FMT)+strlen((char*)object_get_class_name(self)) - +((aString!=NULL)?strlen((char*)aString):0)+8)]; - va_list ap; - - sprintf(fmt, FMT, object_get_class_name(self), - object_is_instance(self)?"instance":"class", - (aString!=NULL)?aString:""); - va_start(ap, aString); - objc_verror(self, OBJC_ERR_UNKNOWN, fmt, ap); - va_end(ap); - return nil; -#undef FMT -} - -+ (int)version -{ - return class_get_version(self); -} - -+ setVersion:(int)aVersion -{ - class_set_version(self, aVersion); - return self; -} - -+ (int)streamVersion: (TypedStream*)aStream -{ - if (aStream->mode == OBJC_READONLY) - return objc_get_stream_class_version (aStream, self); - else - return class_get_version (self); -} - -// These are used to write or read the instance variables -// declared in this particular part of the object. Subclasses -// should extend these, by calling [super read/write: aStream] -// before doing their own archiving. These methods are private, in -// the sense that they should only be called from subclasses. - -- read: (TypedStream*)aStream -{ - (void) aStream; /* UNUSED */ - // [super read: aStream]; - return self; -} - -- write: (TypedStream*)aStream -{ - (void) aStream; /* UNUSED */ - // [super write: aStream]; - return self; -} - -- awake -{ - // [super awake]; - return self; -} - -@end diff --git a/gnu/gcc/libobjc/Protocol.m b/gnu/gcc/libobjc/Protocol.m deleted file mode 100644 index 645e99114c5..00000000000 --- a/gnu/gcc/libobjc/Protocol.m +++ /dev/null @@ -1,182 +0,0 @@ -/* This file contains the implementation of class Protocol. - 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. */ - -#include "objc/Protocol.h" -#include "objc/objc-api.h" - -/* Method description list */ -struct objc_method_description_list { - int count; - struct objc_method_description list[1]; -}; - - -@implementation Protocol -{ -@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 -{ - return protocol_name; -} - -/* Testing protocol conformance */ - -- (BOOL) conformsTo: (Protocol *)aProtocolObject -{ - size_t i; - struct objc_protocol_list* proto_list; - - if (aProtocolObject == nil) - return NO; - - if (!strcmp(aProtocolObject->protocol_name, self->protocol_name)) - return YES; - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - for (i=0; i < proto_list->count; i++) - { - if ([proto_list->list[i] conformsTo: aProtocolObject]) - return YES; - } - } - - return NO; -} - -/* Looking up information specific to a protocol */ - -- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel -{ - int i; - struct objc_protocol_list* proto_list; - const char* name = sel_get_name (aSel); - struct objc_method_description *result; - - if (instance_methods) - for (i = 0; i < instance_methods->count; i++) - { - if (!strcmp ((char*)instance_methods->list[i].name, name)) - return &(instance_methods->list[i]); - } - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - size_t j; - for (j=0; j < proto_list->count; j++) - { - if ((result = [proto_list->list[j] - descriptionForInstanceMethod: aSel])) - return result; - } - } - - return NULL; -} - -- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel; -{ - int i; - struct objc_protocol_list* proto_list; - const char* name = sel_get_name (aSel); - struct objc_method_description *result; - - if (class_methods) - for (i = 0; i < class_methods->count; i++) - { - if (!strcmp ((char*)class_methods->list[i].name, name)) - return &(class_methods->list[i]); - } - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - size_t j; - for (j=0; j < proto_list->count; j++) - { - if ((result = [proto_list->list[j] - descriptionForClassMethod: aSel])) - return result; - } - } - - return NULL; -} - -- (unsigned) hash -{ - /* Compute a hash of the protocol_name; use the same hash algorithm - * that we use for class names; protocol names and class names are - * somewhat similar types of string spaces. - */ - int hash = 0, index; - - for (index = 0; protocol_name[index] != '\0'; index++) - { - hash = (hash << 4) ^ (hash >> 28) ^ protocol_name[index]; - } - - hash = (hash ^ (hash >> 10) ^ (hash >> 20)); - - return hash; -} - -/* - * Equality between formal protocols is only formal (nothing to do - * with actually checking the list of methods they have!). Two formal - * Protocols are equal if and only if they have the same name. - * - * Please note (for comparisons with other implementations) that - * checking the names is equivalent to checking that Protocol A - * conforms to Protocol B and Protocol B conforms to Protocol A, - * because this happens iff they have the same name. If they have - * different names, A conforms to B if and only if A includes B, but - * the situation where A includes B and B includes A is a circular - * dependency between Protocols which is forbidden by the compiler, so - * A conforms to B and B conforms to A with A and B having different - * names is an impossible case. - */ -- (BOOL) isEqual: (id)obj -{ - if (obj == self) - return YES; - - if ([obj isKindOf: [Protocol class]]) - { - if (strcmp (protocol_name, ((Protocol *)obj)->protocol_name) == 0) - return YES; - } - - return NO; -} -@end - diff --git a/gnu/gcc/libobjc/README b/gnu/gcc/libobjc/README deleted file mode 100644 index 093116fd594..00000000000 --- a/gnu/gcc/libobjc/README +++ /dev/null @@ -1,104 +0,0 @@ - -GNU Objective C notes -********************* - -This document is to explain what has been done, and a little about how -specific features differ from other implementations. The runtime has -been completely rewritten in gcc 2.4. The earlier runtime had several -severe bugs and was rather incomplete. The compiler has had several -new features added as well. - -This is not documentation for Objective C, it is usable to someone -who knows Objective C from somewhere else. - - -Runtime API functions -===================== - -The runtime is modeled after the NeXT Objective C runtime. That is, -most functions have semantics as it is known from the NeXT. The -names, however, have changed. All runtime API functions have names -of lowercase letters and underscores as opposed to the -`traditional' mixed case names. - The runtime api functions are not documented as of now. -Someone offered to write it, and did it, but we were not allowed to -use it by his university (Very sad story). We have started writing -the documentation over again. This will be announced in appropriate -places when it becomes available. - - -Protocols -========= - -Protocols are now fully supported. The semantics is exactly as on the -NeXT. There is a flag to specify how protocols should be typechecked -when adopted to classes. The normal typechecker requires that all -methods in a given protocol must be implemented in the class that -adopts it -- it is not enough to inherit them. The flag -`-Wno-protocol' causes it to allow inherited methods, while -`-Wprotocols' is the default which requires them defined. - - -+load -=========== -This method, if defined, is called for each class and category -implementation when the class is loaded into the runtime. This method -is not inherited, and is thus not called for a subclass that doesn't -define it itself. Thus, each +load method is called exactly once by -the runtime. The runtime invocation of this method is thread safe. - - -+initialize -=========== - -This method, if defined, is called before any other instance or class -methods of that particular class. For the GNU runtime, this method is -not inherited, and is thus not called as initializer for a subclass that -doesn't define it itself. Thus, each +initialize method is called exactly -once by the runtime (or never if no methods of that particular class is -never called). It is wise to guard against multiple invocations anyway -to remain portable with the NeXT runtime. The runtime invocation of -this method is thread safe. - - -Passivation/Activation/Typedstreams -=================================== - -This is supported in the style of NeXT TypedStream's. Consult the -headerfile Typedstreams.h for api functions. I (Kresten) have -rewritten it in Objective C, but this implementation is not part of -2.4, it is available from the GNU Objective C prerelease archive. - There is one difference worth noting concerning objects stored with -objc_write_object_reference (aka NXWriteObjectReference). When these -are read back in, their object is not guaranteed to be available until -the `-awake' method is called in the object that requests that object. -To objc_read_object you must pass a pointer to an id, which is valid -after exit from the function calling it (like e.g. an instance -variable). In general, you should not use objects read in until the --awake method is called. - - -Acknowledgements -================ - -The GNU Objective C team: Geoffrey Knauth <gsk@marble.com> (manager), -Tom Wood <wood@next.com> (compiler) and Kresten Krab Thorup -<krab@iesd.auc.dk> (runtime) would like to thank a some people for -participating in the development of the present GNU Objective C. - -Paul Burchard <burchard@geom.umn.edu> and Andrew McCallum -<mccallum@cs.rochester.edu> has been very helpful debugging the -runtime. Eric Herring <herring@iesd.auc.dk> has been very helpful -cleaning up after the documentation-copyright disaster and is now -helping with the new documentation. - -Steve Naroff <snaroff@next.com> and Richard Stallman -<rms@gnu.ai.mit.edu> has been very helpful with implementation details -in the compiler. - - -Bug Reports -=========== - -Please read the section `Submitting Bugreports' of the gcc manual -before you submit any bugs. diff --git a/gnu/gcc/libobjc/README.threads b/gnu/gcc/libobjc/README.threads deleted file mode 100644 index 5f15bd9cb45..00000000000 --- a/gnu/gcc/libobjc/README.threads +++ /dev/null @@ -1,50 +0,0 @@ -============================================================================== -README.threads - Wed Nov 29 15:16:24 EST 1995 ------------------------------------------------------------------------------- - -Limited documentation is available in the THREADS file. - -This version has been tested on Sun Solaris, SGI Irix, and Windows NT. -It should also work on any single threaded system. - -Thanks go to the following people for help test and debug the library: - - Scott Christley, scottc@ocbi.com - Andrew McCallum, mccallum@cs.rochester.edu - -galen -gchunt@cs.rochester.edu - -Any questions, bug reports, etc should be directed to: - -Scott Christley, scottc@ocbi.com - -Please do not bug Galen with email as he no longer supports the code. - -============================================================================== -Changes from prior releases (in revered chronological order): ------------------------------------------------------------------------------- - -* Fixed bug in copy part of sarray_realloc. I had an < which should - have been <=. (Bug report from Scott). - ------------------------------------------------------------------------------- - -* Support for DEC OSF/1 is definitely broken. My programs always - seg-fault when I link with libpthreads.a. - -* Thread id's are no longer int's, but are instead of type - _objc_thread_t which is typedef'ed from a void *. An invalid thread - id is denoted by NULL and not -1 as before. - ------------------------------------------------------------------------------- - -* Renamed thread-winnt.c to thread-win32.c to better reflect support - for the API on both Windows NT and Windows 95 platforms. - (Who knows, maybe even Win32s :-). - -* Fixed bugs in Win32 support as per report from Scott Christley. - -* Fixed bug in sarray_get as per report from Scott Christley. - - diff --git a/gnu/gcc/libobjc/THREADS b/gnu/gcc/libobjc/THREADS deleted file mode 100644 index 8a436832f6c..00000000000 --- a/gnu/gcc/libobjc/THREADS +++ /dev/null @@ -1,377 +0,0 @@ -This file describes in little detail the modifications to the -Objective-C runtime needed to make it thread safe. - -First off, kudos to Galen Hunt who is the author of this great work. - -If you have an comments or just want to know where to -send me money to express your undying gratitude for threading the -Objective-C runtime you can reach Galen at: - - gchunt@cs.rochester.edu - -Any questions, comments, bug reports, etc. should send email either to the -GCC bug account or to: - - Scott Christley <scottc@net-community.com> - -* Sarray Threading: - -The most critical component of the Objective-C runtime is the sparse array -structure (sarray). Sarrays store object selectors and implementations. -Following in the tradition of the Objective-C runtime, my threading -support assumes that fast message dispatching is far more important -than *ANY* and *ALL* other operations. The message dispatching thus -uses *NO* locks on any kind. In fact, if you look in sarray.h, you -will notice that the message dispatching has not been modified. -Instead, I have modified the sarray management functions so that all -updates to the sarray data structure can be made in parallel will -message dispatching. - -To support concurrent message dispatching, no dynamically allocated -sarray data structures are freed while more than one thread is -operational. Sarray data structures that are no longer in use are -kept in a linked list of garbage and are released whenever the program -is operating with a single thread. The programmer can also flush the -garbage list by calling sarray_remove_garbage when the programmer can -ensure that no message dispatching is taking place concurrently. The -amount of un-reclaimed sarray garbage should normally be extremely -small in a real program as sarray structures are freed only when using -the "poseAs" functionality and early in program initialization, which -normally occurs while the program is single threaded. - -****************************************************************************** -* Static Variables: - -The following variables are either statically or globally defined. This list -does not include variables which are internal to implementation dependent -versions of thread-*.c. - -The following threading designations are used: - SAFE : Implicitly thread safe. - SINGLE : Must only be used in single thread mode. - MUTEX : Protected by single global mutex objc_runtime_mutex. - UNUSED : Not used in the runtime. - -Variable Name: Usage: Defined: Also used in: -=========================== ====== ============ ===================== -__objc_class_hash MUTEX class.c -__objc_class_links_resolved UNUSED class.c runtime.h -__objc_class_number MUTEX class.c -__objc_dangling_categories UNUSED init.c -__objc_module_list MUTEX init.c -__objc_selector_array MUTEX selector.c -__objc_selector_hash MUTEX selector.c -__objc_selector_max_index MUTEX selector.c sendmsg.c runtime.h -__objc_selector_names MUTEX selector.c -__objc_thread_exit_status SAFE thread.c -__objc_uninstalled_dtable MUTEX sendmsg.c selector.c -_objc_load_callback SAFE init.c objc-api.h -_objc_lookup_class SAFE class.c objc-api.h -_objc_object_alloc SINGLE objects.c objc-api.h -_objc_object_copy SINGLE objects.c objc-api.h -_objc_object_dispose SINGLE objects.c objc-api.h -frwd_sel SAFE2 sendmsg.c -idxsize MUTEX sarray.c sendmsg.c sarray.h -initialize_sel SAFE2 sendmsg.c -narrays MUTEX sarray.c sendmsg.c sarray.h -nbuckets MUTEX sarray.c sendmsg.c sarray.h -nindices MUTEX sarray.c sarray.h -previous_constructors SAFE1 init.c -proto_class SAFE1 init.c -unclaimed_categories MUTEX init.c -unclaimed_proto_list MUTEX init.c -uninitialized_statics MUTEX init.c - -Notes: -1) Initialized once in unithread mode. -2) Initialized value will always be same, guaranteed by lock on selector - hash table. - - -****************************************************************************** -* Frontend/Backend design: - -The design of the Objective-C runtime thread and mutex functions utilizes a -frontend/backend implementation. - -The frontend, as characterized by the files thr.h and thr.c, is a set -of platform independent structures and functions which represent the -user interface. Objective-C programs should use these structures and -functions for their thread and mutex work if they wish to maintain a -high degree of portability across platforms. - -The backend is composed of a file with the necessary code to map the ObjC -thread and mutex to a platform specific implementation. For example, the -file thr-solaris.c contains the implementation for Solaris. - -If you are compiling libobjc as part of GCC, the thr-objc.c backend is -always used; this backend uses GCC's gthread code. The thread system -is automatically configured when GCC is configured. Important: make -sure you configure GCC using `--enable-threads' if you want threads ! - -If you want to compile libobjc standalone, then you would need to -modify the configure.in and makefiles for it; and you need to pick an -appropriate backend file for the target platform; you make this choice -by assigning the OBJC_THREAD_FILE make variable to the basename of the -backend file. For example, OBJC_THREAD_FILE=thr-posix would indicate -that the generic posix backend file, thr-posix.c, should be compiled -with the ObjC runtime library. If your platform does not support -threads then you should specify the OBJC_THREAD_FILE=thr-single -backend file to compile the ObjC runtime library without thread or -mutex support; note that programs which rely upon the ObjC thread and -mutex functions will compile and link correctly but attempting to -create a thread or mutex will result in an error. - -It is questionable whether it is really necessary to have both a -frontend and backend function for all available functionality. On the -one hand, it provides a clear, consistent differentiation between what -is public and what is private with the downside of having the overhead -of multiple functions calls. For example, the function to have a -thread yield the processor is objc_thread_yield; in the current -implementation this produces a function call set: - -objc_thread_yield() -> __objc_thread_yield() -> system yield function - -This has two extra function calls over calling the platform specific function -explicitly, but the issue is whether only the overhead of a single function -is necessary. - -objc_thread_yield() -> system yield function - -This breaks the public/private dichotomy between the frontend/backend -for the sake of efficiency. It is possible to just use a preprocessor -define so as to eliminate the extra function call: - -#define objc_thread_yield() __objc_thread_yield() - -This has the undesirable effect that if objc_thread_yield is actually -turned into a function based upon future need; then ObjC programs which -access the thread functions would need to be recompiled versus just -being relinked. - -****************************************************************************** -* Threads: - -The thread system attempts to create multiple threads using whatever -operating system or library thread support is available. It does -assume that all system functions are thread safe. Notably this means -that the system implementation of malloc and free must be thread safe. -If a system has multiple processors, the threads are configured for -full parallel processing. - -* Backend initialization functions - -__objc_init_thread_system(void), int - Initialize the thread subsystem. Called once by __objc_exec_class. - Return -1 if error otherwise return 0. - -__objc_close_thread_system(void), int - Closes the thread subsystem, not currently guaranteed to be called. - Return -1 if error otherwise return 0. - -***** -* Frontend thread functions -* User programs should use these functions. - -objc_thread_detach(SEL selector, id object, id argument), objc_thread_t - Creates and detaches a new thread. The new thread starts by - sending the given selector with a single argument to the - given object. - -objc_thread_set_priority(int priority), int - Sets a thread's relative priority within the program. Valid - options are: - - OBJC_THREAD_INTERACTIVE_PRIORITY - OBJC_THREAD_BACKGROUND_PRIORITY - OBJC_THREAD_LOW_PRIORITY - -objc_thread_get_priority(void), int - Query a thread's priority. - -objc_thread_yield(void), void - Yields processor to another thread with equal or higher - priority. It is up to the system scheduler to determine if - the processor is taken or not. - -objc_thread_exit(void), int - Terminates a thread. If this is the last thread executing - then the program will terminate. - -objc_thread_id(void), int - Returns the current thread's id. - -objc_thread_set_data(void *value), int - Set a pointer to the thread's local storage. Local storage is - thread specific. - -objc_thread_get_data(void), void * - Returns the pointer to the thread's local storage. - -***** -* Backend thread functions -* User programs should *NOT* directly call these functions. - -__objc_thread_detach(void (*func)(void *arg), void *arg), objc_thread_t - Spawns a new thread executing func, called by objc_thread_detach. - Return NULL if error otherwise return thread id. - -__objc_thread_set_priority(int priority), int - Set the thread's priority, called by objc_thread_set_priority. - Return -1 if error otherwise return 0. - -__objc_thread_get_priority(void), int - Query a thread's priority, called by objc_thread_get_priority. - Return -1 if error otherwise return the priority. - -__objc_thread_yield(void), void - Yields the processor, called by objc_thread_yield. - -__objc_thread_exit(void), int - Terminates the thread, called by objc_thread_exit. - Return -1 if error otherwise function does not return. - -__objc_thread_id(void), objc_thread_t - Returns the current thread's id, called by objc_thread_id. - Return -1 if error otherwise return thread id. - -__objc_thread_set_data(void *value), int - Set pointer for thread local storage, called by objc_thread_set_data. - Returns -1 if error otherwise return 0. - -__objc_thread_get_data(void), void * - Returns the pointer to the thread's local storage. - Returns NULL if error, called by objc_thread_get_data. - - -****************************************************************************** -* Mutexes: - -Mutexes can be locked recursively. Each locked mutex remembers -its owner (by thread id) and how many times it has been locked. The -last unlock on a mutex removes the system lock and allows other -threads to access the mutex. - -***** -* Frontend mutex functions -* User programs should use these functions. - -objc_mutex_allocate(void), objc_mutex_t - Allocates a new mutex. Mutex is initially unlocked. - Return NULL if error otherwise return mutex pointer. - -objc_mutex_deallocate(objc_mutex_t mutex), int - Free a mutex. Before freeing the mutex, makes sure that no - one else is using it. - Return -1 if error otherwise return 0. - -objc_mutex_lock(objc_mutex_t mutex), int - Locks a mutex. As mentioned earlier, the same thread may call - this routine repeatedly. - Return -1 if error otherwise return 0. - -objc_mutex_trylock(objc_mutex_t mutex), int - Attempts to lock a mutex. If lock on mutex can be acquired - then function operates exactly as objc_mutex_lock. - Return -1 if failed to acquire lock otherwise return 0. - -objc_mutex_unlock(objc_mutex_t mutex), int - Unlocks the mutex by one level. Other threads may not acquire - the mutex until this thread has released all locks on it. - Return -1 if error otherwise return 0. - -***** -* Backend mutex functions -* User programs should *NOT* directly call these functions. - -__objc_mutex_allocate(objc_mutex_t mutex), int - Allocates a new mutex, called by objc_mutex_allocate. - Return -1 if error otherwise return 0. - -__objc_mutex_deallocate(objc_mutex_t mutex), int - Free a mutex, called by objc_mutex_deallocate. - Return -1 if error otherwise return 0. - -__objc_mutex_lock(objc_mutex_t mutex), int - Locks a mutex, called by objc_mutex_lock. - Return -1 if error otherwise return 0. - -__objc_mutex_trylock(objc_mutex_t mutex), int - Attempts to lock a mutex, called by objc_mutex_trylock. - Return -1 if failed to acquire lock or error otherwise return 0. - -__objc_mutex_unlock(objc_mutex_t mutex), int - Unlocks the mutex, called by objc_mutex_unlock. - Return -1 if error otherwise return 0. - -****************************************************************************** -* Condition Mutexes: - -Mutexes can be locked recursively. Each locked mutex remembers -its owner (by thread id) and how many times it has been locked. The -last unlock on a mutex removes the system lock and allows other -threads to access the mutex. - -* -* Frontend condition mutex functions -* User programs should use these functions. -* - -objc_condition_allocate(void), objc_condition_t - Allocate a condition mutex. - Return NULL if error otherwise return condition pointer. - -objc_condition_deallocate(objc_condition_t condition), int - 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. Does NOT check for - other threads waiting but just wakes them up. - Return -1 if error otherwise return 0. - -objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int - 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 1 so that it can be unlocked - here, for 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. - Return -1 if error otherwise return 0. - -objc_condition_broadcast(objc_condition_t condition), int - 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. - Return -1 if error otherwise return 0. - -objc_condition_signal(objc_condition_t condition), int - Wake up one thread waiting on this condition. - Return -1 if error otherwise return 0. - -* -* Backend condition mutex functions -* User programs should *NOT* directly call these functions. -* - -__objc_condition_allocate(objc_condition_t condition), int - Allocate a condition mutex, called by objc_condition_allocate. - Return -1 if error otherwise return 0. - -__objc_condition_deallocate(objc_condition_t condition), int - Deallocate a condition, called by objc_condition_deallocate. - Return -1 if error otherwise return 0. - -__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int - Wait on the condition, called by objc_condition_wait. - Return -1 if error otherwise return 0 when condition is met. - -__objc_condition_broadcast(objc_condition_t condition), int - Wake up all threads waiting on this condition. - Called by objc_condition_broadcast. - Return -1 if error otherwise return 0. - -__objc_condition_signal(objc_condition_t condition), int - Wake up one thread waiting on this condition. - Called by objc_condition_signal. - Return -1 if error otherwise return 0. diff --git a/gnu/gcc/libobjc/THREADS.MACH b/gnu/gcc/libobjc/THREADS.MACH deleted file mode 100644 index 55de6637866..00000000000 --- a/gnu/gcc/libobjc/THREADS.MACH +++ /dev/null @@ -1,23 +0,0 @@ -This readme refers to the file thr-mach.c. - -Under mach, thread priorities are kinda strange-- any given thread has -a MAXIMUM priority and a BASE priority. The BASE priority is the -current priority of the thread and the MAXIMUM is the maximum possible -priority the thread can assume. The developer can lower, but never -raise the maximum priority. - -The gcc concept of thread priorities is that they run at one of three -levels; interactive, background, and low. - -Under mach, this is translated to: - -interactive -- set priority to maximum -background -- set priority to 2/3 of maximum -low -- set priority to 1/3 of maximum - -This means that it is possible for a thread with the priority of -interactive to actually run at a lower priority than another thread -with a background, or even low, priority if the developer has modified -the maximum priority. - - diff --git a/gnu/gcc/libobjc/acinclude.m4 b/gnu/gcc/libobjc/acinclude.m4 deleted file mode 100644 index 6a0bbc4b8c9..00000000000 --- a/gnu/gcc/libobjc/acinclude.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004 -dnl Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -m4_include(../config/acx.m4) -m4_include(../config/no-executables.m4) - -m4_include(../libtool.m4) -dnl The lines below arrange for aclocal not to bring an installed -dnl libtool.m4 into aclocal.m4, while still arranging for automake to -dnl add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AC_LIBTOOL_DLOPEN],) -AC_DEFUN([AC_LIBLTDL_CONVENIENCE],) -AC_SUBST(LIBTOOL) -]) diff --git a/gnu/gcc/libobjc/aclocal.m4 b/gnu/gcc/libobjc/aclocal.m4 deleted file mode 100644 index 380a9c399d5..00000000000 --- a/gnu/gcc/libobjc/aclocal.m4 +++ /dev/null @@ -1,158 +0,0 @@ -# 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. - -# 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])]) - -# 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]) - -# Copyright (C) 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 3 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -# 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 -]) - -m4_include([../config/multi.m4]) -m4_include([acinclude.m4]) diff --git a/gnu/gcc/libobjc/archive.c b/gnu/gcc/libobjc/archive.c deleted file mode 100644 index 992a69600d4..00000000000 --- a/gnu/gcc/libobjc/archive.c +++ /dev/null @@ -1,1668 +0,0 @@ - /* 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); -} - diff --git a/gnu/gcc/libobjc/class.c b/gnu/gcc/libobjc/class.c deleted file mode 100644 index 4374852989c..00000000000 --- a/gnu/gcc/libobjc/class.c +++ /dev/null @@ -1,703 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/config.h.in b/gnu/gcc/libobjc/config.h.in deleted file mode 100644 index 51811a576b7..00000000000 --- a/gnu/gcc/libobjc/config.h.in +++ /dev/null @@ -1,58 +0,0 @@ -/* 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 diff --git a/gnu/gcc/libobjc/configure b/gnu/gcc/libobjc/configure deleted file mode 100755 index 59d55653716..00000000000 --- a/gnu/gcc/libobjc/configure +++ /dev/null @@ -1,6595 +0,0 @@ -#! /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@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@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" -@interface Frob -@end -@implementation Frob -@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@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,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@build_libsubdir@,$build_libsubdir,;t t -s,@build_subdir@,$build_subdir,;t t -s,@host_subdir@,$host_subdir,;t t -s,@target_subdir@,$target_subdir,;t t -s,@VERSION@,$VERSION,;t t -s,@OBJC_BOEHM_GC@,$OBJC_BOEHM_GC,;t t -s,@OBJC_BOEHM_GC_INCLUDES@,$OBJC_BOEHM_GC_INCLUDES,;t t -s,@multi_basedir@,$multi_basedir,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@target_noncanonical@,$target_noncanonical,;t t -s,@glibcpp_srcdir@,$glibcpp_srcdir,;t t -s,@toolexecdir@,$toolexecdir,;t t -s,@toolexeclibdir@,$toolexeclibdir,;t t -s,@includedirname@,$includedirname,;t t -s,@libext@,$libext,;t t -s,@CC@,$CC,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@extra_ldflags_libobjc@,$extra_ldflags_libobjc,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@AS@,$AS,;t t -s,@ac_ct_AS@,$ac_ct_AS,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t -s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t -s,@MAINT@,$MAINT,;t t -s,@LN_S@,$LN_S,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@CPP@,$CPP,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@EGREP@,$EGREP,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@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,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@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 - diff --git a/gnu/gcc/libobjc/configure.ac b/gnu/gcc/libobjc/configure.ac deleted file mode 100644 index fca4418bb5d..00000000000 --- a/gnu/gcc/libobjc/configure.ac +++ /dev/null @@ -1,296 +0,0 @@ -# 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@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" -@interface Frob -@end -@implementation Frob -@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 diff --git a/gnu/gcc/libobjc/encoding.c b/gnu/gcc/libobjc/encoding.c deleted file mode 100644 index 21a785814dc..00000000000 --- a/gnu/gcc/libobjc/encoding.c +++ /dev/null @@ -1,1083 +0,0 @@ -/* 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); -} - - -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 -#ifdef ADJUST_FIELD_ALIGN - desired_align = ADJUST_FIELD_ALIGN (type, desired_align); -#endif - - /* 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__) - 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; -} diff --git a/gnu/gcc/libobjc/exception.c b/gnu/gcc/libobjc/exception.c deleted file mode 100644 index 2d28dcb8600..00000000000 --- a/gnu/gcc/libobjc/exception.c +++ /dev/null @@ -1,492 +0,0 @@ -/* 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" - -#ifdef __ARM_EABI_UNWINDER__ -#define NO_SIZE_OF_ENCODED_VALUE -#endif - -#include "unwind-pe.h" - - -#ifdef __ARM_EABI_UNWINDER__ - -static inline void -__OBJC_INIT_EXCEPTION_CLASS(_Unwind_Exception_Class c) -{ - c[0] = 'G'; - c[1] = 'N'; - c[2] = 'U'; - c[3] = 'C'; - c[4] = 'C'; - c[5] = '+'; - c[6] = '+'; - c[7] = '\0'; -} - -#define CONTINUE_UNWINDING \ - do \ - { \ - if (__gnu_unwind_frame(ue_header, context) != _URC_OK) \ - return _URC_FAILURE; \ - return _URC_CONTINUE_UNWIND; \ - } \ - while (0) - -#else /* !__ARM_EABI_UNWINDER__ */ - -/* 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') - -#define __OBJC_INIT_EXCEPTION_CLASS(c) c = __objc_exception_class - -#define CONTINUE_UNWINDING return _URC_CONTINUE_UNWIND - -#endif /* !__ARM_EABI_UNWINDER__ */ - -/* 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; -} - -#ifdef __ARM_EABI_UNWINDER__ - -static Class -get_ttype_entry (struct lsda_header_info *info, _Unwind_Word i) -{ - _Unwind_Ptr ptr; - - ptr = (_Unwind_Ptr) (info->TType - (i * 4)); - ptr = _Unwind_decode_target2(ptr); - - /* NULL ptr means catch-all. */ - if (ptr) - return objc_get_class ((const char *) ptr); - else - return 0; -} - -#else - -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; -} - -#endif - -/* 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 -#ifdef __ARM_EABI_UNWINDER__ -PERSONALITY_FUNCTION (_Unwind_State state, - struct _Unwind_Exception *ue_header, - struct _Unwind_Context *context) -#else -PERSONALITY_FUNCTION (int version, - _Unwind_Action actions, - _Unwind_Exception_Class exception_class, - struct _Unwind_Exception *ue_header, - struct _Unwind_Context *context) -#endif -{ - 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; - int foreign_exception; - int ip_before_insn = 0; - -#ifdef __ARM_EABI_UNWINDER__ - _Unwind_Action actions; - - switch (state & _US_ACTION_MASK) - { - case _US_VIRTUAL_UNWIND_FRAME: - actions = _UA_SEARCH_PHASE; - break; - - case _US_UNWIND_FRAME_STARTING: - actions = _UA_CLEANUP_PHASE; - if (!(state & _US_FORCE_UNWIND) - && ue_header->barrier_cache.sp == _Unwind_GetGR(context, 13)) - actions |= _UA_HANDLER_FRAME; - break; - - case _US_UNWIND_FRAME_RESUME: - CONTINUE_UNWINDING; - break; - - default: - abort(); - } - actions |= state & _US_FORCE_UNWIND; - - foreign_exception = 0; - - ip = (_Unwind_Ptr) ue_header; - _Unwind_SetGR(context, 12, ip); -#else - /* Interface version check. */ - if (version != 1) - return _URC_FATAL_PHASE1_ERROR; - foreign_exception = !(exception_class == __objc_exception_class); -#endif - - /* Shortcut for phase 2 found handler for domestic exception. */ - if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) - && !foreign_exception) - { -#ifdef __ARM_EABI_UNWINDER__ - handler_switch_value = (int) ue_header->barrier_cache.bitpattern[1]; - landing_pad = (_Unwind_Ptr) ue_header->barrier_cache.bitpattern[3]; -#else - handler_switch_value = xh->handlerSwitchValue; - landing_pad = xh->landingPad; -#endif - 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) - CONTINUE_UNWINDING; - - /* Parse the LSDA header. */ - p = parse_lsda_header (context, language_specific_data, &info); - info.ttype_base = base_of_encoded_value (info.ttype_encoding, context); -#ifdef HAVE_GETIPINFO - ip = _Unwind_GetIPInfo (context, &ip_before_insn); -#else - ip = _Unwind_GetIP (context); -#endif - if (! ip_before_insn) - --ip; - 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) - || foreign_exception) - ; - - 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) - CONTINUE_UNWINDING; - - if (actions & _UA_SEARCH_PHASE) - { - if (!saw_handler) - CONTINUE_UNWINDING; - - /* For domestic exceptions, we cache data from phase 1 for phase 2. */ - if (!foreign_exception) - { -#ifdef __ARM_EABI_UNWIDER__ - ue_header->barrier_cache.sp = _Unwind_GetGR(context, 13); - ue_header->barrier_cache.bitpattern[1] - = (_uw) handler_switch_value; - ue_header->barrier_cache.bitpattern[3] = (_uw) landing_pad; -#else - xh->handlerSwitchValue = handler_switch_value; - xh->landingPad = landing_pad; -#endif - } - 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)); - __OBJC_INIT_EXCEPTION_CLASS(header->base.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 (); -} diff --git a/gnu/gcc/libobjc/gc.c b/gnu/gcc/libobjc/gc.c deleted file mode 100644 index 51019993f3d..00000000000 --- a/gnu/gcc/libobjc/gc.c +++ /dev/null @@ -1,454 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/hash.c b/gnu/gcc/libobjc/hash.c deleted file mode 100644 index 969bd458566..00000000000 --- a/gnu/gcc/libobjc/hash.c +++ /dev/null @@ -1,283 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/init.c b/gnu/gcc/libobjc/init.c deleted file mode 100644 index fc3d7ff3c0c..00000000000 --- a/gnu/gcc/libobjc/init.c +++ /dev/null @@ -1,894 +0,0 @@ -/* 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@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; -} diff --git a/gnu/gcc/libobjc/libobjc.def b/gnu/gcc/libobjc/libobjc.def deleted file mode 100644 index a80fb615589..00000000000 --- a/gnu/gcc/libobjc/libobjc.def +++ /dev/null @@ -1,170 +0,0 @@ -; GNU Objective C Runtime DLL Export Definitions -; Copyright (C) 1997 Free Software Foundation, Inc. -; Contributed by Scott Christley <scottc@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 diff --git a/gnu/gcc/libobjc/libobjc_entry.c b/gnu/gcc/libobjc/libobjc_entry.c deleted file mode 100644 index 205b0eda3b0..00000000000 --- a/gnu/gcc/libobjc/libobjc_entry.c +++ /dev/null @@ -1,55 +0,0 @@ -/* GNU Objective C Runtime DLL Entry - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Scott Christley <scottc@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"); diff --git a/gnu/gcc/libobjc/linking.m b/gnu/gcc/libobjc/linking.m deleted file mode 100644 index 8c8a0a968b7..00000000000 --- a/gnu/gcc/libobjc/linking.m +++ /dev/null @@ -1,40 +0,0 @@ -/* Force linking of classes required by Objective C runtime. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Ovidiu Predescu (ovidiu@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]; -} - diff --git a/gnu/gcc/libobjc/makefile.dos b/gnu/gcc/libobjc/makefile.dos deleted file mode 100644 index c7544a16476..00000000000 --- a/gnu/gcc/libobjc/makefile.dos +++ /dev/null @@ -1,56 +0,0 @@ -# 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 diff --git a/gnu/gcc/libobjc/misc.c b/gnu/gcc/libobjc/misc.c deleted file mode 100644 index 972cff15290..00000000000 --- a/gnu/gcc/libobjc/misc.c +++ /dev/null @@ -1,185 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/nil_method.c b/gnu/gcc/libobjc/nil_method.c deleted file mode 100644 index 268f0e330da..00000000000 --- a/gnu/gcc/libobjc/nil_method.c +++ /dev/null @@ -1,55 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/objc/NXConstStr.h b/gnu/gcc/libobjc/objc/NXConstStr.h deleted file mode 100644 index 3f408d3a207..00000000000 --- a/gnu/gcc/libobjc/objc/NXConstStr.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Interface for the NXConstantString class for Objective-C. - Copyright (C) 1995, 2004 Free Software Foundation, Inc. - Contributed by Pieter J. Schoenmakers <tiggr@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 - -@interface NXConstantString: Object -{ - char *c_string; - unsigned int len; -} - --(const char *) cString; --(unsigned int) length; - -@end - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/gnu/gcc/libobjc/objc/Object.h b/gnu/gcc/libobjc/objc/Object.h deleted file mode 100644 index 7b67f46615c..00000000000 --- a/gnu/gcc/libobjc/objc/Object.h +++ /dev/null @@ -1,132 +0,0 @@ -/* 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. - */ -@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; - -@end - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/gnu/gcc/libobjc/objc/Protocol.h b/gnu/gcc/libobjc/objc/Protocol.h deleted file mode 100644 index fe0f28a8eb4..00000000000 --- a/gnu/gcc/libobjc/objc/Protocol.h +++ /dev/null @@ -1,63 +0,0 @@ -/* 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 - -@interface Protocol : Object -{ -@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; - -@end - -#ifdef __cplusplus -} -#endif - -#endif /* not __Protocol_INCLUDE_GNU */ diff --git a/gnu/gcc/libobjc/objc/encoding.h b/gnu/gcc/libobjc/objc/encoding.h deleted file mode 100644 index c432ee93bd3..00000000000 --- a/gnu/gcc/libobjc/objc/encoding.h +++ /dev/null @@ -1,107 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/hash.h b/gnu/gcc/libobjc/objc/hash.h deleted file mode 100644 index b1cdd0c4fbf..00000000000 --- a/gnu/gcc/libobjc/objc/hash.h +++ /dev/null @@ -1,216 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/objc-api.h b/gnu/gcc/libobjc/objc/objc-api.h deleted file mode 100644 index e0e49e21fdf..00000000000 --- a/gnu/gcc/libobjc/objc/objc-api.h +++ /dev/null @@ -1,626 +0,0 @@ -/* 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 */ - - - diff --git a/gnu/gcc/libobjc/objc/objc-decls.h b/gnu/gcc/libobjc/objc/objc-decls.h deleted file mode 100644 index 52938a2381c..00000000000 --- a/gnu/gcc/libobjc/objc/objc-decls.h +++ /dev/null @@ -1,47 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/objc-list.h b/gnu/gcc/libobjc/objc/objc-list.h deleted file mode 100644 index 051e1c2c132..00000000000 --- a/gnu/gcc/libobjc/objc/objc-list.h +++ /dev/null @@ -1,156 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/objc.h b/gnu/gcc/libobjc/objc/objc.h deleted file mode 100644 index ee7612c9754..00000000000 --- a/gnu/gcc/libobjc/objc/objc.h +++ /dev/null @@ -1,165 +0,0 @@ -/* 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__ */ -@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 */ diff --git a/gnu/gcc/libobjc/objc/runtime.h b/gnu/gcc/libobjc/objc/runtime.h deleted file mode 100644 index 3582d1d91c0..00000000000 --- a/gnu/gcc/libobjc/objc/runtime.h +++ /dev/null @@ -1,96 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/sarray.h b/gnu/gcc/libobjc/objc/sarray.h deleted file mode 100644 index fe66b2e9a73..00000000000 --- a/gnu/gcc/libobjc/objc/sarray.h +++ /dev/null @@ -1,244 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objc/thr.h b/gnu/gcc/libobjc/objc/thr.h deleted file mode 100644 index c1399268890..00000000000 --- a/gnu/gcc/libobjc/objc/thr.h +++ /dev/null @@ -1,153 +0,0 @@ -/* Thread and mutex controls for Objective C. - Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/objc/typedstream.h b/gnu/gcc/libobjc/objc/typedstream.h deleted file mode 100644 index 3a5e0b3b80c..00000000000 --- a/gnu/gcc/libobjc/objc/typedstream.h +++ /dev/null @@ -1,141 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/objects.c b/gnu/gcc/libobjc/objects.c deleted file mode 100644 index 7cc99bfcad5..00000000000 --- a/gnu/gcc/libobjc/objects.c +++ /dev/null @@ -1,103 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/sarray.c b/gnu/gcc/libobjc/sarray.c deleted file mode 100644 index b35772b3f53..00000000000 --- a/gnu/gcc/libobjc/sarray.c +++ /dev/null @@ -1,518 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/selector.c b/gnu/gcc/libobjc/selector.c deleted file mode 100644 index 223c7100efa..00000000000 --- a/gnu/gcc/libobjc/selector.c +++ /dev/null @@ -1,490 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/sendmsg.c b/gnu/gcc/libobjc/sendmsg.c deleted file mode 100644 index 9453ef3dd46..00000000000 --- a/gnu/gcc/libobjc/sendmsg.c +++ /dev/null @@ -1,701 +0,0 @@ -/* 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; -} diff --git a/gnu/gcc/libobjc/thr-dce.c b/gnu/gcc/libobjc/thr-dce.c deleted file mode 100644 index b20eacf8c95..00000000000 --- a/gnu/gcc/libobjc/thr-dce.c +++ /dev/null @@ -1,281 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr-decosf1.c b/gnu/gcc/libobjc/thr-decosf1.c deleted file mode 100644 index b20eacf8c95..00000000000 --- a/gnu/gcc/libobjc/thr-decosf1.c +++ /dev/null @@ -1,281 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr-irix.c b/gnu/gcc/libobjc/thr-irix.c deleted file mode 100644 index ca68e08a491..00000000000 --- a/gnu/gcc/libobjc/thr-irix.c +++ /dev/null @@ -1,235 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - SGI IRIX Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr-mach.c b/gnu/gcc/libobjc/thr-mach.c deleted file mode 100644 index 76167b42af2..00000000000 --- a/gnu/gcc/libobjc/thr-mach.c +++ /dev/null @@ -1,313 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Modified for Mach threads by Bill Bumgarner <bbum@friday.com> - Condition functions added by Mircea Oancea <mircea@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 */ diff --git a/gnu/gcc/libobjc/thr-objc.c b/gnu/gcc/libobjc/thr-objc.c deleted file mode 100644 index 7d6375aaa55..00000000000 --- a/gnu/gcc/libobjc/thr-objc.c +++ /dev/null @@ -1,192 +0,0 @@ -/* 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 */ diff --git a/gnu/gcc/libobjc/thr-os2.c b/gnu/gcc/libobjc/thr-os2.c deleted file mode 100644 index 787c9494bfb..00000000000 --- a/gnu/gcc/libobjc/thr-os2.c +++ /dev/null @@ -1,267 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Thomas Baier (baier@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 */ diff --git a/gnu/gcc/libobjc/thr-posix.c b/gnu/gcc/libobjc/thr-posix.c deleted file mode 100644 index f7010833df8..00000000000 --- a/gnu/gcc/libobjc/thr-posix.c +++ /dev/null @@ -1,318 +0,0 @@ -/* GNU Objective C Runtime Thread Interface for POSIX compliant threads - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Modified for Linux/Pthreads by Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de) - Modified for posix compliance by Chris Ball (cball@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; -} diff --git a/gnu/gcc/libobjc/thr-pthreads.c b/gnu/gcc/libobjc/thr-pthreads.c deleted file mode 100644 index d73db47ad2e..00000000000 --- a/gnu/gcc/libobjc/thr-pthreads.c +++ /dev/null @@ -1,218 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation for PCThreads under GNU/Linux. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Scott Christley <scottc@net-community.com> - Condition functions added by: Mircea Oancea <mircea@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 */ diff --git a/gnu/gcc/libobjc/thr-rtems.c b/gnu/gcc/libobjc/thr-rtems.c deleted file mode 100644 index 4e4f1e493ad..00000000000 --- a/gnu/gcc/libobjc/thr-rtems.c +++ /dev/null @@ -1,194 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Renamed from thr-vxworks.c to thr-rtems.c by - Ralf Corsepius (corsepiu@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 */ diff --git a/gnu/gcc/libobjc/thr-single.c b/gnu/gcc/libobjc/thr-single.c deleted file mode 100644 index 0407dcf17cf..00000000000 --- a/gnu/gcc/libobjc/thr-single.c +++ /dev/null @@ -1,192 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr-solaris.c b/gnu/gcc/libobjc/thr-solaris.c deleted file mode 100644 index 0cc35226724..00000000000 --- a/gnu/gcc/libobjc/thr-solaris.c +++ /dev/null @@ -1,259 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Conditions added by Mircea Oancea (mircea@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 */ diff --git a/gnu/gcc/libobjc/thr-vxworks.c b/gnu/gcc/libobjc/thr-vxworks.c deleted file mode 100644 index 0407dcf17cf..00000000000 --- a/gnu/gcc/libobjc/thr-vxworks.c +++ /dev/null @@ -1,192 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr-win32.c b/gnu/gcc/libobjc/thr-win32.c deleted file mode 100644 index cc4bb746e13..00000000000 --- a/gnu/gcc/libobjc/thr-win32.c +++ /dev/null @@ -1,272 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Win32 Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/gcc/libobjc/thr.c b/gnu/gcc/libobjc/thr.c deleted file mode 100644 index 17f6f7e2920..00000000000 --- a/gnu/gcc/libobjc/thr.c +++ /dev/null @@ -1,563 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@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 */ diff --git a/gnu/lib/libobjc/.cvsignore b/gnu/lib/libobjc/.cvsignore deleted file mode 100644 index e2952dc9ac3..00000000000 --- a/gnu/lib/libobjc/.cvsignore +++ /dev/null @@ -1,32 +0,0 @@ -*-all -*-co -*-dirs -*-done -*-install-info -*-src -*-stamp-* -*-tagged -blockit -cfg-paper.info -config.status -configure.aux -configure.cp -configure.cps -configure.dvi -configure.fn -configure.fns -configure.ky -configure.kys -configure.log -configure.pg -configure.pgs -configure.toc -configure.tp -configure.tps -configure.vr -configure.vrs -dir.info -Makefile -lost+found -update.out -LAST_UPDATED diff --git a/gnu/lib/libobjc/Makefile.bsd-wrapper b/gnu/lib/libobjc/Makefile.bsd-wrapper deleted file mode 100644 index 7f203140914..00000000000 --- a/gnu/lib/libobjc/Makefile.bsd-wrapper +++ /dev/null @@ -1,145 +0,0 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.12 2017/07/19 12:50:32 espie Exp $ - -LIB= objc - - -LIBIBERTY_INCLUDES=${.CURDIR}/../libiberty/include -.include <bsd.own.mk> -.if make(obj) -.else -. if ${COMPILER_VERSION:L} == "gcc3" -GCCDIR= $(.CURDIR)/../../usr.bin/gcc -GCCSRCDIR=${GCCDIR}/gcc -. else -error wrong compiler -. endif -.endif - -.if defined(MAKEOBJDIR) -OBJDIR= ${MAKEOBJDIR} -.elif defined(OBJMACHINE) -OBJDIR= obj.${MACHINE} -.else -OBJDIR= obj -.endif -GCCOBJDIR!= if [ -d $(GCCDIR)/$(OBJDIR) ]; then \ - echo $(GCCDIR)/$(OBJDIR); \ - else \ - echo $(GCCDIR); \ - fi - -GNUCFLAGS= ${CFLAGS} ${COPTS} -DOPENBSD_NATIVE - - -MAKE_FLAGS= CFLAGS="${GNUCFLAGS}" \ - CC="${CC}" LDFLAGS="${LDSTATIC}" \ - LIBIBERTY_INCLUDES=${LIBIBERTY_INCLUDES} \ - CPPFLAGS=${CPPFLAGS} \ - GCCSRCDIR=${GCCSRCDIR} \ - GCCOBJDIR=${GCCOBJDIR} - -CPPFLAGS+= -I. -I${.CURDIR}/libobjc -I$(.CURDIR)/libobjc/objc -I$(GCCSRCDIR) \ --I$(GCCSRCDIR)/config -I$(GCCOBJDIR) -I$(LIBIBERTY_INCLUDES) \ --DIN_GCC -DIN_TARGET_LIBS - -SRCS=archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ -nil_method.c NXConstStr.m Object.m objects.c Protocol.m sarray.c \ -selector.c sendmsg.c thr.c - -SRCS+=thr-posix.c - -includes: - install -d -m 755 -o $(BINOWN) -g $(BINGRP) \ - $(DESTDIR)/usr/include/objc - @-cd $(.CURDIR)/libobjc/objc; for i in *.h; do \ - [ $$i = "runtime.h" ] || install -C -o $(BINOWN) -g $(BINGRP) -m $(NONBINMODE) \ - $$i $(DESTDIR)/usr/include/objc/$$i; \ - done - -BUILDFIRST = ${GCCOBJDIR}/config.status - -${GCCOBJDIR}/config.status: - cd ${GCCDIR} && exec ${MAKE} -f Makefile.bsd-wrapper config.status target_path tconfig.h - -sendmsg.o sendmsg.po sendmsg.so: runtime-info.h - -runtime-info.h: - echo "" > tmp-runtime - echo "/* This file is automatically generated */" > $@ - `$(CC) -print-prog-name=cc1obj` -print-objc-runtime-info tmp-runtime >> $@ - rm -f tmp-runtime - -.ifdef GLOBAL_AUTOCONF_CACHE -CF= --cache-file=${GLOBAL_AUTOCONF_CACHE} -.else -CF= -.endif - -config.status: libobjc/Makefile.in libobjc/configure - PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ - INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ - GCCDIR=${GCCDIR} \ - /bin/sh ${.CURDIR}/libobjc/configure --with-gnu-as --with-gnu-ld \ - --prefix=/usr --mandir='$$(prefix)/share/man' \ - --enable-shared \ - --with-local-prefix=/usr ${CF} \ - && touch config.status - -.ifdef NOMAN -maninstall: - @echo NOMAN is set -.endif - -depend: - -tags: - # Nothing here so far... - -.include <bsd.obj.mk> -.ifndef NOMAN -.include <bsd.man.mk> -.endif -.include <bsd.lib.mk> - -.SUFFIXES: .m - -.PATH: ${.CURDIR}/libobjc - -COMPILE.m=${COMPILE.c} -fgnu-runtime - -gc.o: gc.c - @echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - -gc.po: gc.c - @echo "${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} -p ${.IMPSRC} -o ${.TARGET}.o - @${LD} -X -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - -gc.so: gc.c - @echo "${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - -.m.o: - @echo "${COMPILE.m} ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - -.m.po: - @echo "${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}.o - @${LD} -X -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - -.m.so: - @echo "${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}" - @${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} - @rm -f ${.TARGET}.o - diff --git a/gnu/lib/libobjc/config.guess b/gnu/lib/libobjc/config.guess deleted file mode 100755 index c989465abca..00000000000 --- a/gnu/lib/libobjc/config.guess +++ /dev/null @@ -1,1356 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-01-30' - -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:MicroBSD:*:*) - echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:3*) - echo i586-pc-interix3 - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - ftp://ftp.gnu.org/pub/gnu/config/ - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -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` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/gnu/lib/libobjc/config.sub b/gnu/lib/libobjc/config.sub deleted file mode 100755 index 53f9660a58a..00000000000 --- a/gnu/lib/libobjc/config.sub +++ /dev/null @@ -1,1482 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-01-28' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i686-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic4x | c4x*) - basic_machine=tic4x-unknown - os=-coff - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -microbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/gnu/lib/libobjc/install-sh b/gnu/lib/libobjc/install-sh deleted file mode 100755 index 59bcde425aa..00000000000 --- a/gnu/lib/libobjc/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/_inst.$$_ - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/gnu/lib/libobjc/libobjc/ChangeLog b/gnu/lib/libobjc/libobjc/ChangeLog deleted file mode 100644 index dcd68585f9e..00000000000 --- a/gnu/lib/libobjc/libobjc/ChangeLog +++ /dev/null @@ -1,607 +0,0 @@ -2004-09-30 Release Manager - - * GCC 3.3.5 Released. - -2004-05-31 Release Manager - - * GCC 3.3.4 Released. - -2004-03-02 Gabriel Dos Reis <gdr@integrable-solutions.net> - - PR bootstrap/14348 - Backport - 2003-10-20 Joseph S. Myers <jsm@polyomino.org.uk> - * objc/hash.h (hash_string): Don't use a cast as an lvalue. - -2004-02-14 Release Manager - - * GCC 3.3.3 Released. - -2003-12-01 Zack Weinberg <zack@codesourcery.com> - - PR 11433 - * Protocol.m (descriptionForInstanceMethod): Don't dereference - instance_methods if it's NULL. - (descriptionForClassMethod): Likewise for class_methods. - -2003-10-16 Release Manager - - * GCC 3.3.2 Released. - -2003-09-09 Alan Modra <amodra@bigpond.net.au> - - * configure: Regenerate. - -2003-08-04 Release Manager - - * GCC 3.3.1 Released. - -2003-08-04 Release Manager - - * GCC 3.3.1 Released. - -2003-05-13 Release Manager - - * GCC 3.3 Released. - -2003-05-13 Release Manager - - * GCC 3.3 Released. - -2003-05-13 Release Manager - - * GCC 3.3 Released. - -2003-02-20 Alexandre Oliva <aoliva@redhat.com> - - * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to - config.status. - * configure: Rebuilt. - -2003-01-27 Alexandre Oliva <aoliva@redhat.com> - - * aclocal.m4 (glibcpp_toolexeclibdir): Instead of - $(MULTISUBDIR), use `$CC -print-multi-os-directory`, unless - version_specific_libs is enabled. - * configure: Rebuilt. - -2003-01-26 Christian Cornelssen <ccorn@cs.tu-berlin.de> - - * Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR. - (install-libs, install-headers): Prepend $(DESTDIR) to - destination paths in all (un)installation commands. - -2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (all): Fix multilib parallel build. - -Thu Sep 12 12:44:37 2002 Nicola Pero <n.pero@mi.flashnet.it> - - * sendmsg.c (nil_method): Declare not to take a variable number of - args. - (objc_msg_lookup): Cast nil_method to IMP before returning it. - (objc_msg_lookup_super): The same. - -2002-09-10 Jan Hubicka <jh@suse.cz> - - * nil_method.c (nil_method): No longer defined with variable - arguments. - -2002-07-02 Rodney Brown <rbrown64@csc.com.au> - - * objc/encoding.h: Fix formatting. - * objc/hash.h: Likewise. - * objc/objc-api.h: Likewise. - * objc/runtime.h: Likewise. - * objc/thr.h: Likewise. - * archive.c: Likewise. - * class.c: Likewise. - * encoding.c: Likewise. - * gc.c: Likewise. - * hash.c: Likewise. - * init.c: Likewise. - * misc.c: Likewise. - * nil_method.c: Likewise. - * objects.c: Likewise. - * sarray.c: Likewise. - * selector.c: Likewise. - * sendmsg.c: Likewise. - * thr-mach.c: Likewise. - * thr.c: Likewise. - -2002-06-25 DJ Delorie <dj@redhat.com> - - * aclocal.m4 (GLIBCPP_CONFIGURE): Split out - GLIBCPP_TOPREL_CONFIGURE. - * configure.in: Call it before AC_CANONICAL_SYSTEM. - * configure: Regenerate. - -2002-06-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Object.m (forward, read, write): Fix unused parameter warnings. - * encoding.c: Include <stdlib.h>. - (target_flags): Mark with attribute unused. - (atoi): Delete. - * runtime.h (__objc_selector_max_index): Change to unsigned int. - (__objc_generate_gc_type_description): Prototype. - * selector.c (__objc_selector_max_index): Change to unsigned int. - -Mon Jun 17 18:37:42 2002 Nicola Pero <n.pero@mi.flashnet.it> - - * sendmsg.c (__objc_get_forward_imp): Fix warning by making sure - we always have a return value: if __objc_msg_forward does not - supply a forwarding implementation, return the default - __builtin_apply based one. - -2002-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Object.m: Fix signed/unsigned warning. - * Protocol.m: Likewise. - * archive.c: Always include stdlib.h. - (objc_read_short, objc_read_unsigned_short, objc_read_int, - objc_read_long, __objc_read_nbyte_uint, __objc_read_nbyte_ulong): - Fix signed/unsigned warning. - (objc_write_type, objc_read_type, objc_write_types, - objc_read_types): Ensure ctype 8-bit safety. - (__objc_no_write, __objc_no_read): Mark unused parameters. - * class.c (class_table_setup): Specify void arg. - * encoding.c (atoi, objc_sizeof_type, objc_alignof_type, - objc_skip_typespec, objc_skip_offset, - objc_layout_structure_next_member): Ensure ctype 8-bit safety. - (objc_layout_structure_next_member): Ensure variables are - initialized. - * gc.c (__objc_generate_gc_type_description, - class_ivar_set_gcinvisible): Mark unused parameters. - * init.c (__objc_send_load, __objc_destroy_class_tree_node): Mark - unused parameters. - (__objc_init_protocols) Fix signed/unsigned warning. - * nil_method.c (nil_method): Mark unused parameters. - * thr.h (objc_thread_callback): Specify void arg. - * sarray.c (sarray_new, sarray_realloc, sarray_free): Fix - signed/unsigned warning. - (sarray_free): Fix formatting. - * selector.c (sel_types_match): Ensure ctype 8-bit safety. - * sendmsg.c (__objc_init_install_dtable) Mark unused parameters. - -2002-06-09 Andreas Jaeger <aj@suse.de> - - * encoding.c (objc_layout_structure_next_member): Remove unused - variable. - -2002-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (SHELL): Set to @SHELL@. - (WARN_CFLAGS): New. - (ALL_CFLAGS): Add $(WARN_CFLAGS). - -2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * aclocal.m4: Allow for PWDCMD to override hardcoded pwd. - * configure: Regenerate. - -2002-05-08 Alexandre Oliva <aoliva@redhat.com> - - * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at - script entry, and set LD to it when configuring multilibs. - * configure: Rebuilt. - -2002-04-19 David O'Brien <obrien@FreeBSD.org> - - * encoding.c (MAX, MIN, ROUNDING): #undef before defining. - -2002-04-09 Hans-Peter Nilsson <hp@bitrange.com> - - PR objc/6107 - * objc/objc-api.h (struct objc_protocol_list): Change type of - member count from int to size_t. - -2002-02-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> - - PR libobjc/4039 - * aclocal.m4: Replace with version copied from libstdc++-v3. - * configure.in: Update for changes to aclocal and Makefile. - * configure: Regenerate. - * Makefile.in: Correct install of multilibs and shared libs, use - INSTALL_DATA for include files. - -Mon Dec 17 17:02:12 2001 Nicola Pero <nicola@brainstorm.co.uk> - - * init.c (__objc_exec_class): Fixed bug in the loop on unclaimed - categories - when an unclaimed category was found, the loop was - doing two steps forward instead of one, so that in certain cases - it was failing to properly load all the categories. (Reported - with fix by Alexander Malmberg <alexander@malmberg.org>). - -2001-11-14 Aldy Hernandez <aldyh@redhat.com> - - * encoding.c: Add target_flags. - -2001-11-07 Aldy Hernandez <aldyh@redhat.com> - - * objc/objc-api.h (_C_VECTOR): New. - - * encoding.c (VECTOR_TYPE): New. - -Mon Oct 29 21:29:21 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * class.c: Rewritten the class table to use optimized, lock-free - lookup. This more than doubles the speed of class method - invocations. (class_table_setup), (class_table_insert), - (class_table_replace), (class_table_get_safe), - (class_table_next), (class_table_print), - (class_table_print_histogram): New functions. - (__objc_init_class_tables): Use class_table_setup. - (__objc_add_class_to_hash): Use class_table_get_safe and - class_table_insert. (objc_lookup_class), (objc_get_class): Do not - assert the existence of the table; do not lock the runtime; use - class_table_get_safe. (objc_next_class): Use class_table_next. - (__objc_resolve_class_links): Use class_table_next. - (class_pose_as): Use class_table_replace. - -2001-09-10 Ovidiu Predescu <ovidiu@cup.hp.com> - - * gc.c: Removed the DEBUG declaration. - -Wed Jul 18 12:48:56 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * thr.c (objc_mutex_lock): Invoke __objc_thread_id directly, - rather than through objc_thread_id, to save a function call. - (objc_mutex_trylock, objc_mutex_unlock, objc_condition_wait): - Ditto. - -Mon Jul 16 12:15:00 2001 Nicola Pero <n.pero@mi.flashnet.it> - - * objc/objc-api.h (object_is_class): Fixed - buggy code was trying - to cast an id to a Class, which can not be done. Make the check - by using CLS_ISMETA on the class pointer instead. - (object_is_meta_class): Similar fix. - -2001-06-09 Alexandre Oliva <aoliva@redhat.com>, Stephen L Moshier <moshier@mediaone.net> - - * configure.in (AC_EXEEXT): Work around in case it expands to - nothing, as in autoconf 2.50. - * acinclude.m4: Likewise. - * configure: Rebuilt. - -2001-06-08 Nicola Pero <n.pero@mi.flashnet.it> - - * THREADS: Explain that when we compile libobjc inside GCC, we - always use thr-objc.c as a backend, which uses GCC's thread code. - -2001-06-06 Richard Frith-Macdonald <rrfm@gnu.org> - - * init.c (__objc_send_message_in_list): When setting a new entry - in __objc_load_methods use the method IMP as key, but check to see - if the method is in the hashtable by looking at the IMP also. - Also ... call the method after adding it to the hashtable rather - than before ... thus preventing an obscure possibility of infinite - recursion if a +load method itself loads a subclass. - -2001-05-25 Ovidiu Predescu <ovidiu@cup.hp.com> - - * init.c (__objc_send_message_in_list): When setting a new entry - in __objc_load_methods use the method name as key, not the method - IMP (reported by Richard Frith-Macdonald <richard@brainstorm.co.uk>). - -2001-05-09 Joseph S. Myers <jsm28@cam.ac.uk> - - * objc-features.texi: Move to ../gcc/objc.texi. - * fdl.texi: Remove. - * Makefile.in: Don't generate documentation from - objc-features.texi. - -2001-05-01 Mark Mitchell <mark@codesourcery.com> - - * fdl.texi: New file. - * objc-features.texi: Simplify. - * Makefile.in: Adjust accordingly. - -2001-04-30 Mark Mitchell <mark@codesourcery.com> - - * objc-features.texi: Use the GFDL. - -Wed Mar 21 04:44:58 EST 2001 John Wehle (john@feith.com) - - * encoding.c (REAL_TYPE): Define. - -2001-03-19 David Edelsohn <edelsohn@gnu.org> - - * encoding.c (TYPE_MODE): Define. - -2001-03-14 Nicola Pero <n.pero@mi.flashnet.it> - - * thr.c (objc_thread_add): New function. - (objc_thread_remove): Ditto. - * objc/thr.h: Declare them. - * libobjc.def: Mention them. - -2001-02-28 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Document the @compatibility_alias compiler - directive (description from Nicola Pero <n.pero@mi.flashnet.it>). - -Fri Feb 23 18:12:00 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> - - * sendmsg.c (__objc_forward): Delete strlen() declaration. - -2001-02-08 Geoffrey Keating <geoffk@redhat.com> - - * configure.in: Don't run AC_PROG_CC_WORKS or AC_EXEEXT, because - we're not interested in the result and they might fail. - * configure: Regenerated. - -2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk> - - * objc-features.texi: Use @email. - -2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk> - - * sendmsg.c (__objc_print_dtable_stats): Don't use #ifdef inside - printf. - -2000-01-11 Richard Earnshaw <rearnsha@arm.com> - - * encoding.c (STRUCTURE_SIZE_BOUNDARY): Redefine in a way that - determines the value dynamically. - -Wed Jan 3 00:49:10 2001 Ovidiu Predescu <ovidiu@cup.hp.com> - - * sendmsg.c: Added __objc_msg_forward, a hook that allows external - libraries to provide a function that returns the real forwarding - function. This can alleviate problems __builtin_apply() and - friends have on various platforms. (Solution suggested by Helge - Hess.) - - * objc/objc-api.h: Define __objc_msg_forward. - - * sendmsg.c: Define gen_rtx_REG. - -2000-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de> - - * thr-rtems.c: New file. Stub to compile. - -2000-09-06 Alexandre Oliva <aoliva@redhat.com> - - * configure: Rebuilt with new libtool.m4. - -Tue Aug 15 00:38:56 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * configure.in: Create a config.h file. Check for <sched.h>. - * configure: Regenerate. - - * config.h.in: Check for <sched.h>. - -2000-08-14 Zack Weinberg <zack@wolery.cumb.org> - - * configure: Regenerate after change to ../libtool.m4. - -2000-08-14 Andreas Schwab <schwab@suse.de> - - * objc-features.texi (Top): Move @menu at end of node. - -2000-08-11 Manfred Hollstein <manfredh@redhat.com> - - * objc-features.texi: Move @node Top before @menu. - -Sun Aug 6 23:27:49 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Documented the new -fconstant-string-class - option. - -Sun Aug 6 22:51:16 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * thr-posix.c: Integrated Chris Ball's <cball@fmco.com> changes to - improve the Posix thread support for Objective-C. - -2000-08-04 Zack Weinberg <zack@wolery.cumb.org> - - * aclocal.m4: Replace copy of ../libtool.m4 with - sinclude(../libtool.m4). - -Fri Jul 28 08:58:02 2000 Nicola Pero <nicola@brainstorm.co.uk> - - * configure.in: Added libtool support; build shared libraries - if --enable-shared was passed on command line. - * Makefile.in: Modified most compilation commands to use libtool. - * aclocal.m4: New symbolic link to the ../libtool.m4, from the - libtool distribution. - -Sat Jul 29 00:10:21 2000 Ovidiu Predescu <ovidiu@cup.hp.com> - - * sarray.c, Object.m: Removed the explicit prototypes for strlen - and memcpy on 64-bit platforms (Suggested by Rodney Brown - <rdb@cup.hp.com>). - -2000-05-12 H.J. Lu (hjl@gnu.org) - - * Makefile.in (GTHREAD_FLAGS): New. - (ALL_CFLAGS): Add $(GTHREAD_FLAGS). - (OBJC_THREAD_FILE): Changed to thr-objc. - - * configure.in (GTHREAD_FLAGS): New, check and replace it for - Makefile. - (OBJC_THREAD_FILE): Removed. - - * thr-objc.c: New. - -2000-07-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * objc/hash.h: Include string.h. - -2000-04-15 David Edelsohn <edelsohn@gnu.org> - - * Object.m (strlen): 64-bit PowerPC is a 64bit platform as well. - -2000-04-12 Jakub Jelinek <jakub@redhat.com> - - * Object.m (strlen): Provide prototype on all 64bit platforms, - not only alpha. - * sarray.c (memcpy): Likewise. - * encoding.c (objc_layout_finish_structure): Don't use - ROUND_TYPE_ALIGN on sparc. - - * encoding.c (objc_layout_structure_next_member): Do the whole - procedure even for the first member, so that we get correct - alignment. - -2000-03-29 Zack Weinberg <zack@wolery.cumb.org> - - * objc/Protocol.h, objc/objc-list.h: Change #endif labels to - comments. - -2000-02-23 Zack Weinberg <zack@wolery.cumb.org> - - * Makefile.in: Add -DIN_TARGET_LIBS to ALL_CFLAGS. - -Thu Sep 23 07:19:12 1999 Chris Ball <cball@fmco.com> - - * thr-posix.c (__objc_mutex_deallocate): made deallocate work. - -Tue Sep 21 07:47:10 1999 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (gc.o, gc_gc.o): Do not pass -fgnu-runtime to - the compiler when building C code. - -Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org> - - * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix, - libdir, libsubdir and tooldir. - -Mon Jun 21 05:40:15 1999 John David Anglin <dave@hiauly1> - - * init.c (__objc_force_linking): Make global. - -Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com) - - * configure.in (AC_EXEEXT): Remove call. - (compiler_name): Explicitly check with no extension and .exe - extension. - * configure: Regenerate. - -Sun Apr 25 01:15:34 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in (CC1OBJ): Define in terms of CC. - (runtime-info.h): Use. - -Fri April 8 08:21:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com> - - * objc-features.texi: Updated the URL to Boehm's GC page. - -Fri Mar 26 23:41:07 1999 Ovidiu Predescu <ovidiu@cup.hp.com> - - * archive.c (__objc_code_char, __objc_write_char): Explicitly specify - the char as being signed (patch from Daniel Jacobowitz - <drow@false.org>). - -Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (AC_PREREQ): Update to 2.13. - (AC_EXEEXT): Call to find possible file extension. - (compiler_name): Use. - * configure: Regenerate. - -Wed Jan 27 02:31:01 1999 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (ALL_CFLAGS): Add -DIN_GCC. - -Tue Jan 5 01:38:53 1999 Jeffrey A Law (law@cygnus.com) - - * configure.in (thread_file): Correct and simplify code to find - the thread file. - * configure: Rebuilt. - -1998-11-26 Manfred Hollstein <manfred@s-direktnet.de> - - * configure.in (compiler_name): Add check to detect if this - language's compiler has been built. - * configure: Regenerate. - -Mon Nov 23 16:50:28 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Use AC_PREREQ(2.12.1). - -Thu Nov 19 20:33:37 1998 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (runtime-info.h): Avoid GNU make extensions. - -Sun Nov 8 17:46:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (INCLUDES): Add -I$(srcdir)/$(MULTISRCTOP)../include. - -Thu Oct 22 14:34:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Use AC_CONFIG_AUX_DIR($topsrcdir). - -Sat Oct 17 05:21:31 1998 Ovidiu Predescu <ovidiu@slip.net> - - * objc-features.texi (Top): Changed the email address. - * objc-features.texi (Garbage Collection): Use @uref instead of @url. - -Mon Oct 11 21:25:27 1998 Ovidiu Predescu <ovidiu@slip.net> - - * encoding.c: Redefine get_inner_array_type to get the first entry - in the structure. - -Thu Oct 8 12:21:14 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk> - - * encoding.c (objc_skip_type_qualifiers): Handle _C_BYREF. - (objc_get_type_qualifiers): Similarly. - * objc/encoding.h (_C_BYREF): Define. - (_F_BYREF): Define. - -1998-10-07 David S. Miller <davem@pierdol.cobaltmicro.com> - - * objc/sarray.h: Make boffset be an unsigned long when sparc so it - works out on 64-bit systems. - -Tue Oct 6 20:32:06 1998 Alexandre Oliva <oliva@dcc.unicamp.br> - - * Makefile.in (INCLUDES): Make it multilib-friendly. - -Fri Oct 2 07:12:14 1998 H.J. Lu (hjl@gnu.org) - - * Makefile.in (INCLUDES): Add -I$(srcdir)/../gcc. - -Thu Oct 1 22:33:03 1998 Robert Lipe <robertl@dgii.com> - Jeffrey A Law (law@cygnus.com) - - * Makefile.in (INCLUDES): Reference gcc via $MULTIBUILDTOP. - (FLAGS_TO_PASS): Added. - (runtime-info.h): Reference cc1ibj via $MULTIBUILDTOP. - - * archive.c: Change config.h to tconfig.h. - - * configure.in: Find gcc's object directory even for multilibs. - -Wed Sep 30 18:17:17 1998 Robert Lipe <robertl@dgii.com> - - * configure.in: Escape ^ in grep string. - * configure: Rebuilt. - -Wed Sep 30 09:14:52 1998 Jeffrey A Law (law@cygnus.com) - - * All .h files pushed down into the objc/ subdirectory. - * Makefile.in (copy_headers): Corresponding changes. - * configure.in (AC_INIT): Corresponding changes. - * configure: Rebuilt. - -1998-09-30 Ben Elliston <bje@cygnus.com> - Jeff Law <law@cygnus.com> - - * Makefile.in: Rewrite. - - * configure.in: Likewise. - - * configure: Regenerate. - - * All .c files. Remove "objc" prefix when including objc header - files. Include tconfig.h, not ../tconfig.h. - -Mon Sep 21 23:27:10 1998 Ovidiu Predescu <ovidiu@slip.net> - - * encoding.c (TREE_TYPE, ARRAY_TYPE): Define. - (get_inner_array_type): Define. - -1998-09-21 Ben Elliston <bje@cygnus.com> - - * New directory. Moved files from ../gcc/objc. diff --git a/gnu/lib/libobjc/libobjc/Makefile.in b/gnu/lib/libobjc/libobjc/Makefile.in deleted file mode 100644 index 4b4409474cb..00000000000 --- a/gnu/lib/libobjc/libobjc/Makefile.in +++ /dev/null @@ -1,363 +0,0 @@ -#Makefile for GNU Objective C runtime library. -#Copyright (C) 1993, 95-98, 1999, 2001 Free Software Foundation, Inc. - -#This file is part of GNU CC. - -#GNU CC 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. - -#GNU CC 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 GNU CC; see the file COPYING. If not, write to -#the Free Software Foundation, 59 Temple Place - Suite 330, -#Boston, MA 02111-1307, USA. */ - -#This was cribbed from the libchill, libiberty and libstdc++ -#Makefile.in files. Some of this stuff may be unnecessary and -#worthless. - -SHELL = @SHELL@ -MAKEOVERRIDES= - -#### Start of system configuration section. #### - -srcdir = @glibcpp_srcdir@ -VPATH = @glibcpp_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -target_alias = @target_alias@ -gcc_version = @gcc_version@ -gcc_version_trigger = @gcc_version_trigger@ -top_srcdir = @top_srcdir@ -toplevel_srcdir = @toplevel_srcdir@ -toolexecdir = @glibcpp_toolexecdir@ -glibcpp_toolexecdir = @glibcpp_toolexecdir@ -glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@ - -top_builddir = . - -libdir = $(exec_prefix)/lib -libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) - -# Multilib support variables. -MULTISRCTOP = -MULTIBUILDTOP = -MULTIDIRS = -MULTISUBDIR = -MULTIDO = true -MULTICLEAN = true - -# Not configured per top-level version, since that doesn't get passed -# down at configure time, but overrridden by the top-level install -# target. -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -AR = @AR@ -AR_FLAGS = rc - -RANLIB = @RANLIB@ - -CC = @CC@ -CFLAGS = @CFLAGS@ -WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes -GTHREAD_FLAGS=@GTHREAD_FLAGS@ -ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \ - $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS - -# Libtool -# The following strings describe the version of the obj-C library -# begin compiled and compatibility issues. -# Please refer to Libtool documentation about how to manage these -# numbers. -LIBOBJC_VERSION = 1:0:0 -LIBOBJC_GC_VERSION = 1:0:0 -# @LIBTOOL@ does not get it right, so we hack it in - FIXME -LIBTOOL = ./libtool -LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile -LIBTOOL_LINK = $(LIBTOOL) --mode=link -LIBTOOL_INSTALL = $(LIBTOOL) --mode=install -LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean -#LIBTOOL_UNINSTALL = $(LIBTOOL) --mode=uninstall - -# -# Define the cc1obj in terms of the CC that is passed on from higher -# level make. This is needed to make sure we can create runtime-info.h -# when doing canadian cross builds where running ../../gcc/cc1obj -# does not make any sense. -# -CC1OBJ = `$(CC) -print-prog-name=cc1obj` - -GCCSRCDIR=$(srcdir)/$(MULTISRCTOP)../gcc -GCCOBJDIR=$(MULTIBUILDTOP)/../../gcc -LIBIBERTY_INCLUDES=$(srcdir)/$(MULTISRCTOP)../include - -INCLUDES = -I$(srcdir)/objc -I$(GCCSRCDIR) \ - -I$(GCCSRCDIR)/config -I$(GCCOBJDIR) \ - -I$(LIBIBERTY_INCLUDES) - -OBJC_GCFLAGS=-DOBJC_WITH_GC=1 -OBJC_THREAD_FILE=thr-objc -OBJC_BOEHM_GC=@OBJC_BOEHM_GC@ - -.SUFFIXES: -.SUFFIXES: .c .m .lo - -.c.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< - -.m.lo: - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $< - -# Flags to pass to a recursive make. -FLAGS_TO_PASS = \ - "AR=$(AR)" \ - "AR_FLAGS=$(AR_FLAGS)" \ - "CC=$(CC)" \ - "CFLAGS=$(CFLAGS)" \ - "DESTDIR=$(DESTDIR)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "EXTRA_OFILES=$(EXTRA_OFILES)" \ - "HDEFINES=$(HDEFINES)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "LDFLAGS=$(LDFLAGS)" \ - "LIBTOOL=$(LIBTOOL)" \ - "LOADLIBES=$(LOADLIBES)" \ - "PICFLAG=$(PICFLAG)" \ - "RANLIB=$(RANLIB)" \ - "SHELL=$(SHELL)" \ - "prefix=$(prefix)" \ - "exec_prefix=$(exec_prefix)" \ - "libdir=$(libdir)" \ - "libsubdir=$(libsubdir)" \ - "tooldir=$(tooldir)" - -all: libobjc.la $(OBJC_BOEHM_GC) - : $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all - -# User-visible header files. - -OBJC_H = hash.h objc-list.h sarray.h objc.h objc-api.h \ - NXConstStr.h Object.h Protocol.h encoding.h typedstream.h \ - thr.h - -# Modules that comprise the runtime library. - -OBJS = archive.lo class.lo encoding.lo gc.lo hash.lo init.lo linking.lo \ - misc.lo nil_method.lo NXConstStr.lo Object.lo objects.lo \ - Protocol.lo sarray.lo selector.lo sendmsg.lo thr.lo \ - $(OBJC_THREAD_FILE).lo - -OBJS_GC = archive_gc.lo class_gc.lo encoding_gc.lo gc_gc.lo hash_gc.lo \ - init_gc.lo linking_gc.lo misc_gc.lo nil_method_gc.lo \ - NXConstStr_gc.lo Object_gc.lo objects_gc.lo Protocol_gc.lo \ - sarray_gc.lo selector_gc.lo sendmsg_gc.lo thr_gc.lo \ - $(OBJC_THREAD_FILE)_gc.lo - -runtime-info.h: - echo "" > tmp-runtime - echo "/* This file is automatically generated */" > $@ - $(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@ - rm -f tmp-runtime - -archive_gc.lo: archive.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -class_gc.lo: class.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -encoding_gc.lo: encoding.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -gc.lo: gc.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $< - -gc_gc.lo: gc.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -hash_gc.lo: hash.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -init_gc.lo: init.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -linking.lo: linking.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -linking_gc.lo: linking.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -misc_gc.lo: misc.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -nil_method_gc.lo: nil_method.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -NXConstStr.lo: NXConstStr.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -NXConstStr_gc.lo: NXConstStr.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -Object.lo: Object.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -Object_gc.lo: Object.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -objects_gc.lo: objects.c - $(LIBTOOL_COMPILE) $(CC) -c $(ALL_CFLAGS) -o $@ $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -Protocol.lo: Protocol.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(INCLUDES) $< - -Protocol_gc.lo: Protocol.m - $(LIBTOOL_COMPILE) $(CC) -fgnu-runtime -c -o $@ $(ALL_CFLAGS) \ - $(OBJC_GCFLAGS) $(INCLUDES) $< - -sarray_gc.lo: sarray.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -selector_gc.lo: selector.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -sendmsg.lo: sendmsg.c runtime-info.h - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(INCLUDES) $< - -sendmsg_gc.lo: sendmsg.c runtime-info.h - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -thr_gc.lo: thr.c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -$(OBJC_THREAD_FILE)_gc.lo: $(OBJC_THREAD_FILE).c - $(LIBTOOL_COMPILE) $(CC) -c -o $@ $(ALL_CFLAGS) $(OBJC_GCFLAGS) \ - $(INCLUDES) $< - -doc: info dvi html - -libobjc.la: $(OBJS) - $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \ - -rpath $(glibcpp_toolexeclibdir) \ - -version-info $(LIBOBJC_VERSION) - -libobjc_gc.la: $(OBJS_GC) - $(LIBTOOL_LINK) $(CC) -o $@ $(OBJS_GC) \ - -rpath $(glibcpp_toolexeclibdir) \ - -version-info $(LIBOBJC_GC_VERSION) - -# -# FIXME -- The following part does not fit in the libtool context. -# Libtool is supposed to [going to] be able to create a win 32 DLL -# without extra code but since I don't have a win machine to test -# if it already works, I leave the old code here. -# -libobjc_s.a: libobjc.la - mv libobjc.a libobjc_s.a - -# Create a relocatable DLL -libobjc.dll: libobjc_s.a libobjc_entry.o - $(CC) -mdll -Wl,--base-file -Wl,libobjc.base \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --base-file libobjc.base --output-exp libobjc.exp - $(GCC_FOR_TARGET) -mdll -Wl,--base-file libobjc.base libobjc.exp \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --base-file libobjc.base --output-exp libobjc.exp - $(GCC_FOR_TARGET) libobjc.exp -mdll \ - -o libobjc.dll libobjc_s.a libobjc_entry.o -lkernel32 - $(DLLTOOL) --dllname libobjc.dll --def $(srcdir)/libobjc.def \ - --output-lib libobjc.a -# -# -# -# -# - -info: -dvi: -html: - -Makefile: Makefile.in config.status - $(SHELL) config.status - -config.status: configure - rm -f config.cache - CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \ - CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck - -${srcdir}/configure: configure.in - rm -f config.cache - cd ${srcdir} && autoconf - -install: install-libs install-headers - -install-libs: installdirs - $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(glibcpp_toolexeclibdir) - $(LIBTOOL_INSTALL) $(INSTALL) libobjc.la $(DESTDIR)$(glibcpp_toolexeclibdir); - if [ "$(OBJC_BOEHM_GC)" ]; then \ - $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc.la \ - $(DESTDIR)$(glibcpp_toolexeclibdir);\ - fi - $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@" - @-$(LIBTOOL) --mode=finish $(DESTDIR)$(glibcpp_toolexeclibdir) - -# Copy Objective C headers to installation include directory. -install-headers: - $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/include/objc - for file in $(OBJC_H); do \ - realfile=$(srcdir)/objc/$${file}; \ - $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/include/objc; \ - done - -check uninstall install-strip dist installcheck installdirs: - -mostlyclean: - -$(LIBTOOL_CLEAN) rm -f libobjc.la libobjc_gc.la *.lo - -rm -f runtime-info.h tmp-runtime.s *.o *.lo libobjc* xforward \ - fflags *.aux *.cp *.dvi *.fn *.info *.ky *.log *.pg \ - *.toc *.tp *.vr *.html libobj.exp - @$(MULTICLEAN) multi-clean DO=mostlyclean - -clean: mostlyclean - rm -f config.log - @$(MULTICLEAN) multi-clean DO=clean - -distclean: clean - @$(MULTICLEAN) multi-clean DO=distclean - rm -f config.cache config.status Makefile configure - -maintainer-clean realclean: distclean - -.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \ - install-strip dist installcheck installdirs diff --git a/gnu/lib/libobjc/libobjc/NXConstStr.m b/gnu/lib/libobjc/libobjc/NXConstStr.m deleted file mode 100644 index 4d2f3e1d7fc..00000000000 --- a/gnu/lib/libobjc/libobjc/NXConstStr.m +++ /dev/null @@ -1,42 +0,0 @@ -/* Implementation of the NXConstantString class for Objective-C. - Copyright (C) 1995 Free Software Foundation, Inc. - Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/NXConstStr.h" - -@implementation NXConstantString - --(const char *) cString -{ - return (c_string); -} /* -cString */ - --(unsigned int) length -{ - return (len); -} /* -length */ - -@end diff --git a/gnu/lib/libobjc/libobjc/Object.m b/gnu/lib/libobjc/libobjc/Object.m deleted file mode 100644 index 1882754d605..00000000000 --- a/gnu/lib/libobjc/libobjc/Object.m +++ /dev/null @@ -1,386 +0,0 @@ -/* The implementation of class Object for Objective-C. - Copyright (C) 1993, 1994, 1995, 1997, 2002 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 <stdarg.h> -#include "objc/Object.h" -#include "objc/Protocol.h" -#include "objc/objc-api.h" - -extern int errno; - -#define MAX_CLASS_NAME_LEN 256 - -@implementation Object - -+ initialize -{ - return self; -} - -- init -{ - return self; -} - -+ new -{ - return [[self alloc] init]; -} - -+ alloc -{ - return class_create_instance(self); -} - -- free -{ - return object_dispose(self); -} - -- copy -{ - return [[self shallowCopy] deepen]; -} - -- shallowCopy -{ - return object_copy(self); -} - -- deepen -{ - return self; -} - -- deepCopy -{ - return [self copy]; -} - -- (Class)class -{ - return object_get_class(self); -} - -- (Class)superClass -{ - return object_get_super_class(self); -} - -- (MetaClass)metaClass -{ - return object_get_meta_class(self); -} - -- (const char *)name -{ - return object_get_class_name(self); -} - -- self -{ - return self; -} - -- (unsigned int)hash -{ - return (size_t)self; -} - -- (BOOL)isEqual:anObject -{ - return self==anObject; -} - -- (int)compare:anotherObject; -{ - if ([self isEqual:anotherObject]) - return 0; - // Ordering objects by their address is pretty useless, - // so subclasses should override this is some useful way. - else if (self > anotherObject) - return 1; - else - return -1; -} - -- (BOOL)isMetaClass -{ - return NO; -} - -- (BOOL)isClass -{ - return object_is_class(self); -} - -- (BOOL)isInstance -{ - return object_is_instance(self); -} - -- (BOOL)isKindOf:(Class)aClassObject -{ - Class class; - - for (class = self->isa; class!=Nil; class = class_get_super_class(class)) - if (class==aClassObject) - return YES; - return NO; -} - -- (BOOL)isMemberOf:(Class)aClassObject -{ - return self->isa==aClassObject; -} - -- (BOOL)isKindOfClassNamed:(const char *)aClassName -{ - Class class; - - if (aClassName!=NULL) - for (class = self->isa; class!=Nil; class = class_get_super_class(class)) - if (!strcmp(class_get_class_name(class), aClassName)) - return YES; - return NO; -} - -- (BOOL)isMemberOfClassNamed:(const char *)aClassName -{ - return ((aClassName!=NULL) - &&!strcmp(class_get_class_name(self->isa), aClassName)); -} - -+ (BOOL)instancesRespondTo:(SEL)aSel -{ - return class_get_instance_method(self, aSel)!=METHOD_NULL; -} - -- (BOOL)respondsTo:(SEL)aSel -{ - return ((object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))!=METHOD_NULL); -} - -+ (IMP)instanceMethodFor:(SEL)aSel -{ - return method_get_imp(class_get_instance_method(self, aSel)); -} - -// Indicates if the receiving class or instance conforms to the given protocol -// not usually overridden by subclasses -// -// Modified 9/5/94 to always search the class object's protocol list, rather -// than the meta class. - -+ (BOOL) conformsTo: (Protocol*)aProtocol -{ - size_t i; - struct objc_protocol_list* proto_list; - id parent; - - for (proto_list = ((Class)self)->protocols; - proto_list; proto_list = proto_list->next) - { - for (i=0; i < proto_list->count; i++) - { - if ([proto_list->list[i] conformsTo: aProtocol]) - return YES; - } - } - - if ((parent = [self superClass])) - return [parent conformsTo: aProtocol]; - else - return NO; -} - -- (BOOL) conformsTo: (Protocol*)aProtocol -{ - return [[self class] conformsTo:aProtocol]; -} - -- (IMP)methodFor:(SEL)aSel -{ - return (method_get_imp(object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))); -} - -+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel -{ - return ((struct objc_method_description *) - class_get_instance_method(self, aSel)); -} - -- (struct objc_method_description *)descriptionForMethod:(SEL)aSel -{ - return ((struct objc_method_description *) - (object_is_instance(self) - ?class_get_instance_method(self->isa, aSel) - :class_get_class_method(self->isa, aSel))); -} - -- perform:(SEL)aSel -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel); -} - -- perform:(SEL)aSel with:anObject -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel, anObject); -} - -- perform:(SEL)aSel with:anObject1 with:anObject2 -{ - IMP msg = objc_msg_lookup(self, aSel); - if (!msg) - return [self error:"invalid selector passed to %s", sel_get_name(_cmd)]; - return (*msg)(self, aSel, anObject1, anObject2); -} - -- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame -{ - (void) argFrame; /* UNUSED */ - return (retval_t)[self doesNotRecognize: aSel]; -} - -- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame -{ - return objc_msg_sendv(self, aSel, argFrame); -} - -+ poseAs:(Class)aClassObject -{ - return class_pose_as(self, aClassObject); -} - -- (Class)transmuteClassTo:(Class)aClassObject -{ - if (object_is_instance(self)) - if (class_is_class(aClassObject)) - if (class_get_instance_size(aClassObject)==class_get_instance_size(isa)) - if ([self isKindOf:aClassObject]) - { - Class old_isa = isa; - isa = aClassObject; - return old_isa; - } - return nil; -} - -- subclassResponsibility:(SEL)aSel -{ - return [self error:"subclass should override %s", sel_get_name(aSel)]; -} - -- notImplemented:(SEL)aSel -{ - return [self error:"method %s not implemented", sel_get_name(aSel)]; -} - -- shouldNotImplement:(SEL)aSel -{ - return [self error:"%s should not implement %s", - object_get_class_name(self), sel_get_name(aSel)]; -} - -- doesNotRecognize:(SEL)aSel -{ - return [self error:"%s does not recognize %s", - object_get_class_name(self), sel_get_name(aSel)]; -} - -- error:(const char *)aString, ... -{ -#define FMT "error: %s (%s)\n%s\n" - char fmt[(strlen((char*)FMT)+strlen((char*)object_get_class_name(self)) - +((aString!=NULL)?strlen((char*)aString):0)+8)]; - va_list ap; - - sprintf(fmt, FMT, object_get_class_name(self), - object_is_instance(self)?"instance":"class", - (aString!=NULL)?aString:""); - va_start(ap, aString); - objc_verror(self, OBJC_ERR_UNKNOWN, fmt, ap); - va_end(ap); - return nil; -#undef FMT -} - -+ (int)version -{ - return class_get_version(self); -} - -+ setVersion:(int)aVersion -{ - class_set_version(self, aVersion); - return self; -} - -+ (int)streamVersion: (TypedStream*)aStream -{ - if (aStream->mode == OBJC_READONLY) - return objc_get_stream_class_version (aStream, self); - else - return class_get_version (self); -} - -// These are used to write or read the instance variables -// declared in this particular part of the object. Subclasses -// should extend these, by calling [super read/write: aStream] -// before doing their own archiving. These methods are private, in -// the sense that they should only be called from subclasses. - -- read: (TypedStream*)aStream -{ - (void) aStream; /* UNUSED */ - // [super read: aStream]; - return self; -} - -- write: (TypedStream*)aStream -{ - (void) aStream; /* UNUSED */ - // [super write: aStream]; - return self; -} - -- awake -{ - // [super awake]; - return self; -} - -@end diff --git a/gnu/lib/libobjc/libobjc/Protocol.m b/gnu/lib/libobjc/libobjc/Protocol.m deleted file mode 100644 index ab41bfe2ce7..00000000000 --- a/gnu/lib/libobjc/libobjc/Protocol.m +++ /dev/null @@ -1,132 +0,0 @@ -/* This file contains the implementation of class Protocol. - Copyright (C) 1993 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/Protocol.h" -#include "objc/objc-api.h" - -/* Method description list */ -struct objc_method_description_list { - int count; - struct objc_method_description list[1]; -}; - - -@implementation Protocol -{ -@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 -{ - return protocol_name; -} - -/* Testing protocol conformance */ - -- (BOOL) conformsTo: (Protocol *)aProtocolObject -{ - size_t i; - struct objc_protocol_list* proto_list; - - if (!strcmp(aProtocolObject->protocol_name, self->protocol_name)) - return YES; - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - for (i=0; i < proto_list->count; i++) - { - if ([proto_list->list[i] conformsTo: aProtocolObject]) - return YES; - } - } - - return NO; -} - -/* Looking up information specific to a protocol */ - -- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel -{ - int i; - struct objc_protocol_list* proto_list; - const char* name = sel_get_name (aSel); - struct objc_method_description *result; - - if (instance_methods) - for (i = 0; i < instance_methods->count; i++) - { - if (!strcmp ((char*)instance_methods->list[i].name, name)) - return &(instance_methods->list[i]); - } - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - size_t j; - for (j=0; j < proto_list->count; j++) - { - if ((result = [proto_list->list[j] - descriptionForInstanceMethod: aSel])) - return result; - } - } - - return NULL; -} - -- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel; -{ - int i; - struct objc_protocol_list* proto_list; - const char* name = sel_get_name (aSel); - struct objc_method_description *result; - - if (class_methods) - for (i = 0; i < class_methods->count; i++) - { - if (!strcmp ((char*)class_methods->list[i].name, name)) - return &(class_methods->list[i]); - } - - for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) - { - size_t j; - for (j=0; j < proto_list->count; j++) - { - if ((result = [proto_list->list[j] - descriptionForClassMethod: aSel])) - return result; - } - } - - return NULL; -} - -@end diff --git a/gnu/lib/libobjc/libobjc/README b/gnu/lib/libobjc/libobjc/README deleted file mode 100644 index f478d67dec8..00000000000 --- a/gnu/lib/libobjc/libobjc/README +++ /dev/null @@ -1,97 +0,0 @@ - -GNU Objective C notes -********************* - -This document is to explain what has been done, and a little about how -specific features differ from other implementations. The runtime has -been completely rewritten in gcc 2.4. The earlier runtime had several -severe bugs and was rather incomplete. The compiler has had several -new features added as well. - -This is not documentation for Objective C, it is usable to someone -who knows Objective C from somewhere else. - - -Runtime API functions -===================== - -The runtime is modeled after the NeXT Objective C runtime. That is, -most functions have semantics as it is known from the NeXT. The -names, however, have changed. All runtime API functions have names -of lowercase letters and underscores as opposed to the -`traditional' mixed case names. - The runtime api functions are not documented as of now. -Someone offered to write it, and did it, but we were not allowed to -use it by his university (Very sad story). We have started writing -the documentation over again. This will be announced in appropriate -places when it becomes available. - - -Protocols -========= - -Protocols are now fully supported. The semantics is exactly as on the -NeXT. There is a flag to specify how protocols should be typechecked -when adopted to classes. The normal typechecker requires that all -methods in a given protocol must be implemented in the class that -adopts it -- it is not enough to inherit them. The flag -`-Wno-protocol' causes it to allow inherited methods, while -`-Wprotocols' is the default which requires them defined. - - -+initialize -=========== - -This method, if defined, is called before any other instance or class -methods of that particular class. This method is not inherited, and -is thus not called as initializer for a subclass that doesn't define -it itself. Thus, each +initialize method is called exactly once (or -never if no methods of that particular class is never called). -Besides this, it is allowed to have several +initialize methods, one -for each category. The order in which these (multiple methods) are -called is not well defined. I am not completely certain what the -semantics of this method is for other implementations, but this is -how it works for GNU Objective C. - - -Passivation/Activation/Typedstreams -=================================== - -This is supported in the style of NeXT TypedStream's. Consult the -headerfile Typedstreams.h for api functions. I (Kresten) have -rewritten it in Objective C, but this implementation is not part of -2.4, it is available from the GNU Objective C prerelease archive. - There is one difference worth noting concerning objects stored with -objc_write_object_reference (aka NXWriteObjectReference). When these -are read back in, their object is not guaranteed to be available until -the `-awake' method is called in the object that requests that object. -To objc_read_object you must pass a pointer to an id, which is valid -after exit from the function calling it (like e.g. an instance -variable). In general, you should not use objects read in until the --awake method is called. - - -Acknowledgements -================ - -The GNU Objective C team: Geoffrey Knauth <gsk@marble.com> (manager), -Tom Wood <wood@next.com> (compiler) and Kresten Krab Thorup -<krab@iesd.auc.dk> (runtime) would like to thank a some people for -participating in the development of the present GNU Objective C. - -Paul Burchard <burchard@geom.umn.edu> and Andrew McCallum -<mccallum@cs.rochester.edu> has been very helpful debugging the -runtime. Eric Herring <herring@iesd.auc.dk> has been very helpful -cleaning up after the documentation-copyright disaster and is now -helping with the new documentation. - -Steve Naroff <snaroff@next.com> and Richard Stallman -<rms@gnu.ai.mit.edu> has been very helpful with implementation details -in the compiler. - - -Bug Reports -=========== - -Please read the section `Submitting Bugreports' of the gcc manual -before you submit any bugs. diff --git a/gnu/lib/libobjc/libobjc/README.threads b/gnu/lib/libobjc/libobjc/README.threads deleted file mode 100644 index 5f15bd9cb45..00000000000 --- a/gnu/lib/libobjc/libobjc/README.threads +++ /dev/null @@ -1,50 +0,0 @@ -============================================================================== -README.threads - Wed Nov 29 15:16:24 EST 1995 ------------------------------------------------------------------------------- - -Limited documentation is available in the THREADS file. - -This version has been tested on Sun Solaris, SGI Irix, and Windows NT. -It should also work on any single threaded system. - -Thanks go to the following people for help test and debug the library: - - Scott Christley, scottc@ocbi.com - Andrew McCallum, mccallum@cs.rochester.edu - -galen -gchunt@cs.rochester.edu - -Any questions, bug reports, etc should be directed to: - -Scott Christley, scottc@ocbi.com - -Please do not bug Galen with email as he no longer supports the code. - -============================================================================== -Changes from prior releases (in revered chronological order): ------------------------------------------------------------------------------- - -* Fixed bug in copy part of sarray_realloc. I had an < which should - have been <=. (Bug report from Scott). - ------------------------------------------------------------------------------- - -* Support for DEC OSF/1 is definitely broken. My programs always - seg-fault when I link with libpthreads.a. - -* Thread id's are no longer int's, but are instead of type - _objc_thread_t which is typedef'ed from a void *. An invalid thread - id is denoted by NULL and not -1 as before. - ------------------------------------------------------------------------------- - -* Renamed thread-winnt.c to thread-win32.c to better reflect support - for the API on both Windows NT and Windows 95 platforms. - (Who knows, maybe even Win32s :-). - -* Fixed bugs in Win32 support as per report from Scott Christley. - -* Fixed bug in sarray_get as per report from Scott Christley. - - diff --git a/gnu/lib/libobjc/libobjc/THREADS b/gnu/lib/libobjc/libobjc/THREADS deleted file mode 100644 index 8a436832f6c..00000000000 --- a/gnu/lib/libobjc/libobjc/THREADS +++ /dev/null @@ -1,377 +0,0 @@ -This file describes in little detail the modifications to the -Objective-C runtime needed to make it thread safe. - -First off, kudos to Galen Hunt who is the author of this great work. - -If you have an comments or just want to know where to -send me money to express your undying gratitude for threading the -Objective-C runtime you can reach Galen at: - - gchunt@cs.rochester.edu - -Any questions, comments, bug reports, etc. should send email either to the -GCC bug account or to: - - Scott Christley <scottc@net-community.com> - -* Sarray Threading: - -The most critical component of the Objective-C runtime is the sparse array -structure (sarray). Sarrays store object selectors and implementations. -Following in the tradition of the Objective-C runtime, my threading -support assumes that fast message dispatching is far more important -than *ANY* and *ALL* other operations. The message dispatching thus -uses *NO* locks on any kind. In fact, if you look in sarray.h, you -will notice that the message dispatching has not been modified. -Instead, I have modified the sarray management functions so that all -updates to the sarray data structure can be made in parallel will -message dispatching. - -To support concurrent message dispatching, no dynamically allocated -sarray data structures are freed while more than one thread is -operational. Sarray data structures that are no longer in use are -kept in a linked list of garbage and are released whenever the program -is operating with a single thread. The programmer can also flush the -garbage list by calling sarray_remove_garbage when the programmer can -ensure that no message dispatching is taking place concurrently. The -amount of un-reclaimed sarray garbage should normally be extremely -small in a real program as sarray structures are freed only when using -the "poseAs" functionality and early in program initialization, which -normally occurs while the program is single threaded. - -****************************************************************************** -* Static Variables: - -The following variables are either statically or globally defined. This list -does not include variables which are internal to implementation dependent -versions of thread-*.c. - -The following threading designations are used: - SAFE : Implicitly thread safe. - SINGLE : Must only be used in single thread mode. - MUTEX : Protected by single global mutex objc_runtime_mutex. - UNUSED : Not used in the runtime. - -Variable Name: Usage: Defined: Also used in: -=========================== ====== ============ ===================== -__objc_class_hash MUTEX class.c -__objc_class_links_resolved UNUSED class.c runtime.h -__objc_class_number MUTEX class.c -__objc_dangling_categories UNUSED init.c -__objc_module_list MUTEX init.c -__objc_selector_array MUTEX selector.c -__objc_selector_hash MUTEX selector.c -__objc_selector_max_index MUTEX selector.c sendmsg.c runtime.h -__objc_selector_names MUTEX selector.c -__objc_thread_exit_status SAFE thread.c -__objc_uninstalled_dtable MUTEX sendmsg.c selector.c -_objc_load_callback SAFE init.c objc-api.h -_objc_lookup_class SAFE class.c objc-api.h -_objc_object_alloc SINGLE objects.c objc-api.h -_objc_object_copy SINGLE objects.c objc-api.h -_objc_object_dispose SINGLE objects.c objc-api.h -frwd_sel SAFE2 sendmsg.c -idxsize MUTEX sarray.c sendmsg.c sarray.h -initialize_sel SAFE2 sendmsg.c -narrays MUTEX sarray.c sendmsg.c sarray.h -nbuckets MUTEX sarray.c sendmsg.c sarray.h -nindices MUTEX sarray.c sarray.h -previous_constructors SAFE1 init.c -proto_class SAFE1 init.c -unclaimed_categories MUTEX init.c -unclaimed_proto_list MUTEX init.c -uninitialized_statics MUTEX init.c - -Notes: -1) Initialized once in unithread mode. -2) Initialized value will always be same, guaranteed by lock on selector - hash table. - - -****************************************************************************** -* Frontend/Backend design: - -The design of the Objective-C runtime thread and mutex functions utilizes a -frontend/backend implementation. - -The frontend, as characterized by the files thr.h and thr.c, is a set -of platform independent structures and functions which represent the -user interface. Objective-C programs should use these structures and -functions for their thread and mutex work if they wish to maintain a -high degree of portability across platforms. - -The backend is composed of a file with the necessary code to map the ObjC -thread and mutex to a platform specific implementation. For example, the -file thr-solaris.c contains the implementation for Solaris. - -If you are compiling libobjc as part of GCC, the thr-objc.c backend is -always used; this backend uses GCC's gthread code. The thread system -is automatically configured when GCC is configured. Important: make -sure you configure GCC using `--enable-threads' if you want threads ! - -If you want to compile libobjc standalone, then you would need to -modify the configure.in and makefiles for it; and you need to pick an -appropriate backend file for the target platform; you make this choice -by assigning the OBJC_THREAD_FILE make variable to the basename of the -backend file. For example, OBJC_THREAD_FILE=thr-posix would indicate -that the generic posix backend file, thr-posix.c, should be compiled -with the ObjC runtime library. If your platform does not support -threads then you should specify the OBJC_THREAD_FILE=thr-single -backend file to compile the ObjC runtime library without thread or -mutex support; note that programs which rely upon the ObjC thread and -mutex functions will compile and link correctly but attempting to -create a thread or mutex will result in an error. - -It is questionable whether it is really necessary to have both a -frontend and backend function for all available functionality. On the -one hand, it provides a clear, consistent differentiation between what -is public and what is private with the downside of having the overhead -of multiple functions calls. For example, the function to have a -thread yield the processor is objc_thread_yield; in the current -implementation this produces a function call set: - -objc_thread_yield() -> __objc_thread_yield() -> system yield function - -This has two extra function calls over calling the platform specific function -explicitly, but the issue is whether only the overhead of a single function -is necessary. - -objc_thread_yield() -> system yield function - -This breaks the public/private dichotomy between the frontend/backend -for the sake of efficiency. It is possible to just use a preprocessor -define so as to eliminate the extra function call: - -#define objc_thread_yield() __objc_thread_yield() - -This has the undesirable effect that if objc_thread_yield is actually -turned into a function based upon future need; then ObjC programs which -access the thread functions would need to be recompiled versus just -being relinked. - -****************************************************************************** -* Threads: - -The thread system attempts to create multiple threads using whatever -operating system or library thread support is available. It does -assume that all system functions are thread safe. Notably this means -that the system implementation of malloc and free must be thread safe. -If a system has multiple processors, the threads are configured for -full parallel processing. - -* Backend initialization functions - -__objc_init_thread_system(void), int - Initialize the thread subsystem. Called once by __objc_exec_class. - Return -1 if error otherwise return 0. - -__objc_close_thread_system(void), int - Closes the thread subsystem, not currently guaranteed to be called. - Return -1 if error otherwise return 0. - -***** -* Frontend thread functions -* User programs should use these functions. - -objc_thread_detach(SEL selector, id object, id argument), objc_thread_t - Creates and detaches a new thread. The new thread starts by - sending the given selector with a single argument to the - given object. - -objc_thread_set_priority(int priority), int - Sets a thread's relative priority within the program. Valid - options are: - - OBJC_THREAD_INTERACTIVE_PRIORITY - OBJC_THREAD_BACKGROUND_PRIORITY - OBJC_THREAD_LOW_PRIORITY - -objc_thread_get_priority(void), int - Query a thread's priority. - -objc_thread_yield(void), void - Yields processor to another thread with equal or higher - priority. It is up to the system scheduler to determine if - the processor is taken or not. - -objc_thread_exit(void), int - Terminates a thread. If this is the last thread executing - then the program will terminate. - -objc_thread_id(void), int - Returns the current thread's id. - -objc_thread_set_data(void *value), int - Set a pointer to the thread's local storage. Local storage is - thread specific. - -objc_thread_get_data(void), void * - Returns the pointer to the thread's local storage. - -***** -* Backend thread functions -* User programs should *NOT* directly call these functions. - -__objc_thread_detach(void (*func)(void *arg), void *arg), objc_thread_t - Spawns a new thread executing func, called by objc_thread_detach. - Return NULL if error otherwise return thread id. - -__objc_thread_set_priority(int priority), int - Set the thread's priority, called by objc_thread_set_priority. - Return -1 if error otherwise return 0. - -__objc_thread_get_priority(void), int - Query a thread's priority, called by objc_thread_get_priority. - Return -1 if error otherwise return the priority. - -__objc_thread_yield(void), void - Yields the processor, called by objc_thread_yield. - -__objc_thread_exit(void), int - Terminates the thread, called by objc_thread_exit. - Return -1 if error otherwise function does not return. - -__objc_thread_id(void), objc_thread_t - Returns the current thread's id, called by objc_thread_id. - Return -1 if error otherwise return thread id. - -__objc_thread_set_data(void *value), int - Set pointer for thread local storage, called by objc_thread_set_data. - Returns -1 if error otherwise return 0. - -__objc_thread_get_data(void), void * - Returns the pointer to the thread's local storage. - Returns NULL if error, called by objc_thread_get_data. - - -****************************************************************************** -* Mutexes: - -Mutexes can be locked recursively. Each locked mutex remembers -its owner (by thread id) and how many times it has been locked. The -last unlock on a mutex removes the system lock and allows other -threads to access the mutex. - -***** -* Frontend mutex functions -* User programs should use these functions. - -objc_mutex_allocate(void), objc_mutex_t - Allocates a new mutex. Mutex is initially unlocked. - Return NULL if error otherwise return mutex pointer. - -objc_mutex_deallocate(objc_mutex_t mutex), int - Free a mutex. Before freeing the mutex, makes sure that no - one else is using it. - Return -1 if error otherwise return 0. - -objc_mutex_lock(objc_mutex_t mutex), int - Locks a mutex. As mentioned earlier, the same thread may call - this routine repeatedly. - Return -1 if error otherwise return 0. - -objc_mutex_trylock(objc_mutex_t mutex), int - Attempts to lock a mutex. If lock on mutex can be acquired - then function operates exactly as objc_mutex_lock. - Return -1 if failed to acquire lock otherwise return 0. - -objc_mutex_unlock(objc_mutex_t mutex), int - Unlocks the mutex by one level. Other threads may not acquire - the mutex until this thread has released all locks on it. - Return -1 if error otherwise return 0. - -***** -* Backend mutex functions -* User programs should *NOT* directly call these functions. - -__objc_mutex_allocate(objc_mutex_t mutex), int - Allocates a new mutex, called by objc_mutex_allocate. - Return -1 if error otherwise return 0. - -__objc_mutex_deallocate(objc_mutex_t mutex), int - Free a mutex, called by objc_mutex_deallocate. - Return -1 if error otherwise return 0. - -__objc_mutex_lock(objc_mutex_t mutex), int - Locks a mutex, called by objc_mutex_lock. - Return -1 if error otherwise return 0. - -__objc_mutex_trylock(objc_mutex_t mutex), int - Attempts to lock a mutex, called by objc_mutex_trylock. - Return -1 if failed to acquire lock or error otherwise return 0. - -__objc_mutex_unlock(objc_mutex_t mutex), int - Unlocks the mutex, called by objc_mutex_unlock. - Return -1 if error otherwise return 0. - -****************************************************************************** -* Condition Mutexes: - -Mutexes can be locked recursively. Each locked mutex remembers -its owner (by thread id) and how many times it has been locked. The -last unlock on a mutex removes the system lock and allows other -threads to access the mutex. - -* -* Frontend condition mutex functions -* User programs should use these functions. -* - -objc_condition_allocate(void), objc_condition_t - Allocate a condition mutex. - Return NULL if error otherwise return condition pointer. - -objc_condition_deallocate(objc_condition_t condition), int - 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. Does NOT check for - other threads waiting but just wakes them up. - Return -1 if error otherwise return 0. - -objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int - 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 1 so that it can be unlocked - here, for 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. - Return -1 if error otherwise return 0. - -objc_condition_broadcast(objc_condition_t condition), int - 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. - Return -1 if error otherwise return 0. - -objc_condition_signal(objc_condition_t condition), int - Wake up one thread waiting on this condition. - Return -1 if error otherwise return 0. - -* -* Backend condition mutex functions -* User programs should *NOT* directly call these functions. -* - -__objc_condition_allocate(objc_condition_t condition), int - Allocate a condition mutex, called by objc_condition_allocate. - Return -1 if error otherwise return 0. - -__objc_condition_deallocate(objc_condition_t condition), int - Deallocate a condition, called by objc_condition_deallocate. - Return -1 if error otherwise return 0. - -__objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex), int - Wait on the condition, called by objc_condition_wait. - Return -1 if error otherwise return 0 when condition is met. - -__objc_condition_broadcast(objc_condition_t condition), int - Wake up all threads waiting on this condition. - Called by objc_condition_broadcast. - Return -1 if error otherwise return 0. - -__objc_condition_signal(objc_condition_t condition), int - Wake up one thread waiting on this condition. - Called by objc_condition_signal. - Return -1 if error otherwise return 0. diff --git a/gnu/lib/libobjc/libobjc/THREADS.MACH b/gnu/lib/libobjc/libobjc/THREADS.MACH deleted file mode 100644 index 55de6637866..00000000000 --- a/gnu/lib/libobjc/libobjc/THREADS.MACH +++ /dev/null @@ -1,23 +0,0 @@ -This readme refers to the file thr-mach.c. - -Under mach, thread priorities are kinda strange-- any given thread has -a MAXIMUM priority and a BASE priority. The BASE priority is the -current priority of the thread and the MAXIMUM is the maximum possible -priority the thread can assume. The developer can lower, but never -raise the maximum priority. - -The gcc concept of thread priorities is that they run at one of three -levels; interactive, background, and low. - -Under mach, this is translated to: - -interactive -- set priority to maximum -background -- set priority to 2/3 of maximum -low -- set priority to 1/3 of maximum - -This means that it is possible for a thread with the priority of -interactive to actually run at a lower priority than another thread -with a background, or even low, priority if the developer has modified -the maximum priority. - - diff --git a/gnu/lib/libobjc/libobjc/aclocal.m4 b/gnu/lib/libobjc/libobjc/aclocal.m4 deleted file mode 100644 index ed643f6038c..00000000000 --- a/gnu/lib/libobjc/libobjc/aclocal.m4 +++ /dev/null @@ -1,231 +0,0 @@ -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl -dnl Initialize configure bits. -dnl -dnl GLIBCPP_TOPREL_CONFIGURE -AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [ - dnl Default to --enable-multilib - AC_ARG_ENABLE(multilib, - [ --enable-multilib build hella library versions (default)], - [case "${enableval}" in - yes) multilib=yes ;; - no) multilib=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; - esac], [multilib=yes])dnl - -# When building with srcdir == objdir, links to the source files will -# be created in directories within the target_subdir. We have to -# adjust toplevel_srcdir accordingly, so that configure finds -# install-sh and other auxiliary files that live in the top-level -# source directory. -if test "${srcdir}" = "."; then - if test -z "${with_target_subdir}"; then - toprel=".." - else - if test "${with_target_subdir}" != "."; then - toprel="${with_multisrctop}../.." - else - toprel="${with_multisrctop}.." - fi - fi -else - toprel=".." -fi -AC_CONFIG_AUX_DIR(${srcdir}/$toprel) -toplevel_srcdir=\${top_srcdir}/$toprel -AC_SUBST(toplevel_srcdir) -]) - -dnl -dnl Initialize configure bits. -dnl -dnl GLIBCPP_CONFIGURE -AC_DEFUN(GLIBCPP_CONFIGURE, [ -# Export build and source directories. -# 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. -glibcpp_builddir=`${PWDCMD-pwd}` -case $srcdir in -[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;; -*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; -esac -AC_SUBST(glibcpp_builddir) -AC_SUBST(glibcpp_srcdir) - -dnl This is here just to satisfy automake. -ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)]) - -# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also -# be 'cp -p' if linking isn't available. -#ac_cv_prog_LN_S='cp -p' -AC_PROG_LN_S - -# 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]) - - # Never versions of autoconf add an underscore to these functions. - # Prevent future problems ... - ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))]) - ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))]) - ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))]) - ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))]) - -# AC_PROG_CC - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - -AC_DEFUN(LIB_AC_PROG_CC, -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -dnl Fool anybody using AC_PROG_CC. -AC_PROVIDE([AC_PROG_CC]) -AC_CHECK_PROG(CC, gcc, gcc) -if test -z "$CC"; then - AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -fi - -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -dnl Check whether -g works, even if CFLAGS is set, in case the package -dnl plays around with CFLAGS (such as to build both debugging and -dnl normal versions of a library), tasteless as that idea is. - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - AC_PROG_CC_G - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi -]) - -LIB_AC_PROG_CC - - AC_CHECK_TOOL(AS, as) - AC_CHECK_TOOL(AR, ar) - AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) - AC_PROG_INSTALL - - # We need AC_EXEEXT to keep automake happy in cygnus mode. However, - # at least currently, we never actually build a program, so we never - # need to use $(EXEEXT). Moreover, the test for EXEEXT normally - # fails, because we are probably configuring with a cross compiler - # which can't create executables. So we include AC_EXEEXT to keep - # automake happy, but we don't execute it, since we don't care about - # the result. - if false; then - # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands - # to nothing, so nothing would remain between `then' and `fi' if it - # were not for the `:' below. - : - AC_EXEEXT - fi -]) - - -dnl -dnl GLIBCPP_EXPORT_INSTALL_INFO -dnl calculates gxx_install_dir -dnl exports glibcpp_toolexecdir -dnl exports glibcpp_toolexeclibdir -dnl exports glibcpp_prefixdir -dnl -dnl Assumes cross_compiling bits already done, and with_cross_host in -dnl particular -dnl -dnl GLIBCPP_EXPORT_INSTALL_INFO -AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [ -# Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and -# exported correctly in GLIBCPP_CONFIGURE. -glibcpp_toolexecdir=no -glibcpp_toolexeclibdir=no -glibcpp_prefixdir=${prefix} - -AC_MSG_CHECKING([for interface version number]) -libstdcxx_interface=$INTERFACE -AC_MSG_RESULT($libstdcxx_interface) - -# Process the option "--enable-version-specific-runtime-libs" -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)dnl -# Option set, now we can test it. -AC_MSG_RESULT($version_specific_libs) - -gcc_version_trigger=${srcdir}/../gcc/version.c -gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'` -gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` -AC_SUBST(gcc_version) -AC_SUBST(gcc_version_trigger) - -if test $version_specific_libs = yes; then - # Need the gcc compiler version to know where to install libraries - # and header files if --enable-version-specific-runtime-libs option - # is selected. - changequote(,)dnl - glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' - glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)' - changequote([,])dnl -fi - -# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir -# Install a library built with a cross compiler in tooldir, not libdir. -if test x"$glibcpp_toolexecdir" = x"no"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)' - glibcpp_toolexeclibdir='$(toolexecdir)/lib' - else - glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' - glibcpp_toolexeclibdir='$(libdir)' - fi - glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory` -fi - -AC_SUBST(glibcpp_prefixdir) -AC_SUBST(glibcpp_toolexecdir) -AC_SUBST(glibcpp_toolexeclibdir) -]) - -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring an installed -dnl libtool.m4 into aclocal.m4, while still arranging for automake to -dnl add a definition of LIBTOOL to Makefile.in. -ifelse(,,,[AC_SUBST(LIBTOOL) -AC_DEFUN([AM_PROG_LIBTOOL]) -AC_DEFUN([AC_LIBTOOL_DLOPEN]) -AC_DEFUN([AC_PROG_LD]) -]) diff --git a/gnu/lib/libobjc/libobjc/archive.c b/gnu/lib/libobjc/libobjc/archive.c deleted file mode 100644 index f98379bc99d..00000000000 --- a/gnu/lib/libobjc/libobjc/archive.c +++ /dev/null @@ -1,1655 +0,0 @@ - /* GNU Objective C Runtime archiving - Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "runtime.h" -#include "typedstream.h" -#include "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, 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, 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, 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, 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, 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, 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, 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, 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, buf, len) != 0) - return (*stream->write) (stream->physical, 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(hash_value_for_key (stream->stream_table, string)))) - return objc_write_use_common (stream, key); - else - { - int length; - 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, buf, len + 1); - } - else - { - buf[1] = (buf[1]&_B_VALUE)|_B_RCOMM; - return (*stream->write) (stream->physical, 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, buf, 2); - } - else - { - buf[1] = (buf[1]&_B_VALUE)|_B_UCOMM; - return (*stream->write) (stream->physical, 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, &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, &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(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(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; - 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, (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(hash_value_for_key (stream->stream_table, class)))) - return objc_write_use_common (stream, key); - else - { - int length; - 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, "", 0); - sel_name = sel_get_name (selector); - return objc_write_string (stream, 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(hash_value_for_key (stream->stream_table, sel_name)))) - return objc_write_use_common (stream, key); - else - { - int length; - 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, &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, &buf, 1))) - { - if ((buf & _B_CODE) == _B_SINT) - (*val) = (buf & _B_VALUE); - - else if ((buf & _B_NUMBER) == 1) - len = (*stream->read) (stream->physical, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, buf, 1); - } - - switch (buf[0]&_B_CODE) { - case _B_SSTR: - { - int length = buf[0]&_B_VALUE; - (*string) = (char*)objc_malloc (length + 1); - if (key) - 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 = 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) - 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, 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, 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) - 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, 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) = 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 *) hash_value_for_key (stream->object_refs, - LONG2PTR(key)); - 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, 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, buf, 1); - } - - if (buf[0] == (_B_EXT | _BX_CLASS)) - { - char *class_name; - 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) - hash_add (&stream->stream_table, LONG2PTR(key), *class); - - objc_read_unsigned_long (stream, &version); - 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 = 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, 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, buf, 1); - } - - if (buf[0] == (_B_EXT|_BX_SEL)) /* selector! */ - { - char *selector_name; - - /* 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) - 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) = 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, - *(char **) data, strlen (*(char **) data)); - break; - - case _C_ATOM: - return objc_write_string_atomic (stream, *(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: - { - char **str = va_arg (args, char **); - res = objc_write_string (stream, *str, strlen (*str)); - } - break; - - case _C_ATOM: - { - char **str = va_arg (args, char **); - res = objc_write_string_atomic (stream, *str, strlen (*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) -{ - hash_delete (stream->object_table); - stream->object_table = hash_new(64, - (hash_func_type)hash_ptr, - (compare_func_type)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 = hash_new (64, - (hash_func_type) hash_ptr, - (compare_func_type) compare_ptrs); - - /* resolve object forward references */ - for (node = hash_next (stream->object_refs, NULL); node; - node = hash_next (stream->object_refs, node)) - { - struct objc_list *reflist = node->value; - const void *key = node->key; - id object = hash_value_for_key (stream->object_table, key); - while (reflist) - { - *((id*) reflist->head) = object; - if (hash_value_for_key (free_list,reflist) == NULL) - hash_add (&free_list,reflist,reflist); - - reflist = reflist->tail; - } - } - - /* apply __objc_free to all objects stored in free_list */ - for (node = hash_next (free_list, NULL); node; - node = hash_next (free_list, node)) - objc_free ((void *) node->key); - - hash_delete (free_list); - - /* empty object reference table */ - hash_delete (stream->object_refs); - stream->object_refs = hash_new(8, (hash_func_type)hash_ptr, - (compare_func_type)compare_ptrs); - - /* call -awake for all objects read */ - if (awake_sel) - { - for (node = hash_next (stream->object_table, NULL); node; - node = 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 */ - hash_delete (stream->object_table); - stream->object_table = hash_new(64, - (hash_func_type)hash_ptr, - (compare_func_type)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 = hash_new (64, - (hash_func_type) hash_ptr, - (compare_func_type) compare_ptrs); - s->object_table = hash_new (64, - (hash_func_type) hash_ptr, - (compare_func_type) 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 = hash_new (8, (hash_func_type) hash_string, - (compare_func_type) compare_strings); - s->object_refs = hash_new (8, (hash_func_type) hash_ptr, - (compare_func_type) 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... */ - hash_delete (stream->class_table); - hash_delete (stream->object_refs); - } - - hash_delete (stream->stream_table); - 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(hash_value_for_key (stream->class_table, class->name)); - else - return class_get_version (class); -} - diff --git a/gnu/lib/libobjc/libobjc/class.c b/gnu/lib/libobjc/libobjc/class.c deleted file mode 100644 index 1740f38788e..00000000000 --- a/gnu/lib/libobjc/libobjc/class.c +++ /dev/null @@ -1,703 +0,0 @@ -/* 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 GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 "runtime.h" /* the kitchen sink */ -#include "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; -} diff --git a/gnu/lib/libobjc/libobjc/config.h.in b/gnu/lib/libobjc/libobjc/config.h.in deleted file mode 100644 index 70427edaf6b..00000000000 --- a/gnu/lib/libobjc/libobjc/config.h.in +++ /dev/null @@ -1,2 +0,0 @@ -/* Define this if you have the <sched.h> header file */ -#undef HAVE_SCHED_H diff --git a/gnu/lib/libobjc/libobjc/configure b/gnu/lib/libobjc/libobjc/configure deleted file mode 100644 index dc8fa607899..00000000000 --- a/gnu/lib/libobjc/libobjc/configure +++ /dev/null @@ -1,3374 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-multilib build hella library versions (default)" -ac_help="$ac_help - --with-target-subdir=SUBDIR - configuring in a subdirectory" -ac_help="$ac_help - --with-cross-host=HOST configuring with a cross compiler" -ac_help="$ac_help - --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory " -ac_help="$ac_help - --enable-shared[=PKGS] build shared libraries [default=no]" -ac_help="$ac_help - --enable-static[=PKGS] build static libraries [default=yes]" -ac_help="$ac_help - --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" -ac_help="$ac_help - --with-gnu-ld assume the C compiler uses GNU ld [default=no]" -ac_help="$ac_help - --disable-libtool-lock avoid locking (might break parallel builds)" -ac_help="$ac_help - --with-pic try to use only PIC/non-PIC objects [default=use both]" -ac_help="$ac_help - --enable-objc-gc enable the use of Boehm's garbage collector with - the GNU Objective-C runtime." - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -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' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -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 - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # 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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) 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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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) - 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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# 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 - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=objc/objc.h - -# 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_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# 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 "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - -# 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 - - - # 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 "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;; - esac -else - multilib=yes -fi - -# When building with srcdir == objdir, links to the source files will -# be created in directories within the target_subdir. We have to -# adjust toplevel_srcdir accordingly, so that configure finds -# install-sh and other auxiliary files that live in the top-level -# source directory. -if test "${srcdir}" = "."; then - if test -z "${with_target_subdir}"; then - toprel=".." - else - if test "${with_target_subdir}" != "."; then - toprel="${with_multisrctop}../.." - else - toprel="${with_multisrctop}.." - fi - fi -else - toprel=".." -fi -ac_aux_dir= -for ac_dir in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel; 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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -toplevel_srcdir=\${top_srcdir}/$toprel - - - - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:639: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:660: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:678: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -target_alias=${target_alias-$target} - - -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:710: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 715 "configure" -#include "confdefs.h" - -int main() { - -#ifndef __CYGWIN__ -#define __CYGWIN__ __CYGWIN32__ -#endif -return __CYGWIN__; -; return 0; } -EOF -if { (eval echo configure:726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:743: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 748 "configure" -#include "confdefs.h" - -int main() { -return __MINGW32__; -; return 0; } -EOF -if { (eval echo configure:755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - -# Export build and source directories. -# 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. -glibcpp_builddir=`${PWDCMD-pwd}` -case $srcdir in -\\/$* | ?:\\/*) glibcpp_srcdir=${srcdir} ;; -*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; -esac - - - - - -# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also -# be 'cp -p' if linking isn't available. -#ac_cv_prog_LN_S='cp -p' -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:790: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -# 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 - - - # Never versions of autoconf add an underscore to these functions. - # Prevent future problems ... - - - - - -# AC_PROG_CC - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:846: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:876: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -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 $# -gt 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:925: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:949: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - - - # 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:980: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ac_tool_prefix}as" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" -fi -fi -AS="$ac_cv_prog_AS" -if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - - # 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1012: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" -fi -fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - - # 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1044: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1076: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib-not-found-in-path-error" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - RANLIB="ranlib-not-found-in-path-error" -fi -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 -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1120: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - # We need AC_EXEEXT to keep automake happy in cygnus mode. However, - # at least currently, we never actually build a program, so we never - # need to use $(EXEEXT). Moreover, the test for EXEEXT normally - # fails, because we are probably configuring with a cross compiler - # which can't create executables. So we include AC_EXEEXT to keep - # automake happy, but we don't execute it, since we don't care about - # the result. - if false; then - # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands - # to nothing, so nothing would remain between `then' and `fi' if it - # were not for the `:' below. - : - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1188: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - fi - - -# Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and -# exported correctly in GLIBCPP_CONFIGURE. -glibcpp_toolexecdir=no -glibcpp_toolexeclibdir=no -glibcpp_prefixdir=${prefix} - -echo $ac_n "checking for interface version number""... $ac_c" 1>&6 -echo "configure:1228: checking for interface version number" >&5 -libstdcxx_interface=$INTERFACE -echo "$ac_t""$libstdcxx_interface" 1>&6 - -# Process the option "--enable-version-specific-runtime-libs" -echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6 -echo "configure:1234: checking for --enable-version-specific-runtime-libs" >&5 -# 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 "configure: error: Unknown argument to enable/disable version-specific libs" 1>&2; exit 1; };; - esac -else - version_specific_libs=no -fi -# Option set, now we can test it. -echo "$ac_t""$version_specific_libs" 1>&6 - -gcc_version_trigger=${GCCDIR}/gcc/version.c -gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` -gcc_version=`echo ${gcc_version_full} | sed -e 's/\(^ *\) .*/\1/'` - - - -if test $version_specific_libs = yes; then - # Need the gcc compiler version to know where to install libraries - # and header files if --enable-version-specific-runtime-libs option - # is selected. - glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' - glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)' - fi - -# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir -# Install a library built with a cross compiler in tooldir, not libdir. -if test x"$glibcpp_toolexecdir" = x"no"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)' - glibcpp_toolexeclibdir='$(toolexecdir)/lib' - else - glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' - glibcpp_toolexeclibdir='$(libdir)' - fi - glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory` -fi - - - - - - -# If the language specific compiler does not exist, but the "gcc" directory -# does, we do not build anything. Note, $r is set by the top-level Makefile. -# Note that when we look for the compiler, we search both with and without -# extension to handle cross and canadian cross builds. -compiler_name=cc1obj -rm -f skip-this-dir -echo $ac_n "checking if compiler $compiler_name has been built""... $ac_c" 1>&6 -echo "configure:1289: checking if compiler $compiler_name has been built" >&5 -if eval "test \"`echo '$''{'objc_cv_compiler_exists'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - objc_cv_compiler_exists=yes -if test -n "$r"; then - if test -d "$r"/gcc; then - if test -f "$r"/gcc/$compiler_name \ - || test -f "$r"/gcc/$compiler_name.exe; then - true - else - objc_cv_compiler_exists=no - echo "rm -f config.cache config.log multilib.out" > skip-this-dir - fi - fi -fi - -fi - -echo "$ac_t""$objc_cv_compiler_exists" 1>&6 -if test x$objc_cv_compiler_exists = xno -then - rm -f Makefile conftest* confdefs* core - exit 0 -fi - - -# Disable shared libs by default -# 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=no -fi - -# Enable Win32 DLL on MS Windows - FIXME - - -# 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 $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1401: checking for ld used by GCC" >&5 - 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 $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1431: checking for GNU ld" >&5 -else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1434: checking for non-GNU ld" >&5 -fi -if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$LD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } -echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1469: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1486: checking for $LD option to reload object files" >&5 -if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - lt_cv_ld_reload_flag='-r' -fi - -echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1498: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$NM" 1>&6 - -echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1536: checking how to recognise dependant libraries" >&5 -if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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*) - 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 - ;; - -freebsd* ) - 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*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - 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 "$ac_t""$lt_cv_deplibs_check_method" 1>&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1709: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# 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 $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1739: checking for ${ac_tool_prefix}file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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@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 "$ac_t""$MAGIC_CMD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1801: checking for file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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@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 "$ac_t""$MAGIC_CMD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1872: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1904: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - RANLIB=":" -fi -fi - -# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1939: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_STRIP"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1971: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="strip" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" -fi -fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - STRIP=":" -fi -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" - -libtool_flags="$libtool_flags --enable-win32-dll" -# 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 2038 "configure"' > conftest.$ac_ext - if { (eval echo configure:2039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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 configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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 configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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 $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2132: checking whether the C compiler needs -belf" >&5 -if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext <<EOF -#line 2145 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:2152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_cc_needs_belf=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_needs_belf=no -fi -rm -f conftest* - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -fi - -echo "$ac_t""$lt_cv_cc_needs_belf" 1>&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 - ;; - -*-*-cygwin* | *-*-mingw* | *-*-pw32*) - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2182: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -DLLTOOL="$ac_cv_prog_DLLTOOL" -if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_DLLTOOL"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2214: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_DLLTOOL="dlltool" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false" -fi -fi -DLLTOOL="$ac_cv_prog_DLLTOOL" -if test -n "$DLLTOOL"; then - echo "$ac_t""$DLLTOOL" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - DLLTOOL="false" -fi -fi - - # 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2249: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="${ac_tool_prefix}as" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -AS="$ac_cv_prog_AS" -if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_AS"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2281: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AS="as" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false" -fi -fi -AS="$ac_cv_prog_AS" -if test -n "$AS"; then - echo "$ac_t""$AS" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - AS="false" -fi -fi - - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2316: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -OBJDUMP="$ac_cv_prog_OBJDUMP" -if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_OBJDUMP"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2348: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_OBJDUMP="objdump" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false" -fi -fi -OBJDUMP="$ac_cv_prog_OBJDUMP" -if test -n "$OBJDUMP"; then - echo "$ac_t""$OBJDUMP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - OBJDUMP="false" -fi -fi - - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6 -echo "configure:2384: checking if libtool should supply DllMain function" >&5 -if eval "test \"`echo '$''{'lt_cv_need_dllmain'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2389 "configure" -#include "confdefs.h" - -int main() { -extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0); -; return 0; } -EOF -if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_need_dllmain=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_need_dllmain=yes -fi -rm -f conftest* -fi - -echo "$ac_t""$lt_cv_need_dllmain" 1>&6 - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6 -echo "configure:2418: checking how to link DLLs" >&5 -if eval "test \"`echo '$''{'lt_cv_cc_dll_switch'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2423 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_cc_dll_switch=-mdll -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_dll_switch=-dll -fi -rm -f conftest* -fi - -echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6 - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - -esac - - -# Save cache, so that ltconfig can load it -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# 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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - 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 "configure: error: libtool configure failed" 1>&2; exit 1; } - -# Reload cache, that may have been modified by ltconfig -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $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 - - - - - - - -test "$AR" || AR=ar - -if test "$RANLIB"; then : - -else - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2548: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -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 -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2588: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:2641: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 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 conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -# Sanity check for the cross-compilation case: -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2670: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 2685 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 2702 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 2719 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for stdio.h""... $ac_c" 1>&6 -echo "configure:2751: checking for stdio.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2756 "configure" -#include "confdefs.h" -#include <stdio.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -{ echo "configure: 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'." 1>&2; exit 1; } -fi - - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2789: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2794 "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 2819 "configure" -#include "confdefs.h" -#include <string.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 2837 "configure" -#include "confdefs.h" -#include <stdlib.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext <<EOF -#line 2858 "configure" -#include "confdefs.h" -#include <ctype.h> -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - - -for ac_hdr in sched.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2897: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2902 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - -# Determine CFLAGS for gthread. - -echo $ac_n "checking for gthread cflags""... $ac_c" 1>&6 -echo "configure:2937: checking for gthread cflags" >&5 -if eval "test \"`echo '$''{'objc_cv_gthread_flags'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - objc_cv_gthread_flags="" -fi - -echo "$ac_t""$objc_cv_gthread_flags" 1>&6 -GTHREAD_FLAGS=$objc_cv_gthread_flags - - -# Check whether --enable-objc-gc or --disable-objc-gc was given. -if test "${enable_objc_gc+set}" = set; then - enableval="$enable_objc_gc" - if [ x$enable_objc_gc = xno ]; then - OBJC_BOEHM_GC='' -else - OBJC_BOEHM_GC=libobjc_gc.la -fi -else - OBJC_BOEHM_GC='' -fi - - - - -# We need multilib support, but only if configuring for the target. -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# 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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@toplevel_srcdir@%$toplevel_srcdir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@glibcpp_builddir@%$glibcpp_builddir%g -s%@glibcpp_srcdir@%$glibcpp_srcdir%g -s%@LN_S@%$LN_S%g -s%@CC@%$CC%g -s%@AS@%$AS%g -s%@AR@%$AR%g -s%@RANLIB@%$RANLIB%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@EXEEXT@%$EXEEXT%g -s%@gcc_version@%$gcc_version%g -s%@gcc_version_trigger@%$gcc_version_trigger%g -s%@glibcpp_prefixdir@%$glibcpp_prefixdir%g -s%@glibcpp_toolexecdir@%$glibcpp_toolexecdir%g -s%@glibcpp_toolexeclibdir@%$glibcpp_toolexeclibdir%g -s%@OBJEXT@%$OBJEXT%g -s%@STRIP@%$STRIP%g -s%@DLLTOOL@%$DLLTOOL%g -s%@OBJDUMP@%$OBJDUMP%g -s%@LIBTOOL@%$LIBTOOL%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CPP@%$CPP%g -s%@GTHREAD_FLAGS@%$GTHREAD_FLAGS%g -s%@OBJC_BOEHM_GC@%$OBJC_BOEHM_GC%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# 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_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# 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='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <<EOF - CONFIG_HEADERS="config.h" -EOF -cat >> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. 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.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# 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.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <<EOF -srcdir=${srcdir} -host=${host} -target=${target} -with_target_subdir=${with_target_subdir} -with_multisubdir=${with_multisubdir} -ac_configure_args="--enable-multilib ${ac_configure_args}" -toplevel_srcdir=${toplevel_srcdir} -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" - -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -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}" - . ${toplevel_srcdir}/config-ml.in - fi -fi -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - - diff --git a/gnu/lib/libobjc/libobjc/configure.in b/gnu/lib/libobjc/libobjc/configure.in deleted file mode 100644 index ac92c423450..00000000000 --- a/gnu/lib/libobjc/libobjc/configure.in +++ /dev/null @@ -1,155 +0,0 @@ -# Process this file with autoconf to produce a configure script. -# Copyright (C) 1995, 1997, 1998, 1999, 2002, 2003 -# Free Software Foundation, Inc. -# Contributed by Dave Love (d.love@dl.ac.uk). -# -#This file is part of GNU Objective C. -# -#GNU Objective C 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. -# -#GNU Objective C 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 GNU Objective C; see the file COPYING. If not, write to -#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -#02111-1307, USA. - -AC_PREREQ(2.13) -AC_INIT(objc/objc.h) -AC_CONFIG_HEADER(config.h) - -# 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 - -GLIBCPP_TOPREL_CONFIGURE - -AC_CANONICAL_SYSTEM -target_alias=${target_alias-$target} -AC_SUBST(target_alias) - -GLIBCPP_CONFIGURE(.) -GLIBCPP_EXPORT_INSTALL_INFO - -# If the language specific compiler does not exist, but the "gcc" directory -# does, we do not build anything. Note, $r is set by the top-level Makefile. -# Note that when we look for the compiler, we search both with and without -# extension to handle cross and canadian cross builds. -compiler_name=cc1obj -rm -f skip-this-dir -AC_MSG_CHECKING(if compiler $compiler_name has been built) -AC_CACHE_VAL(objc_cv_compiler_exists, -[objc_cv_compiler_exists=yes -if test -n "$r"; then - if test -d "$r"/gcc; then - if test -f "$r"/gcc/$compiler_name \ - || test -f "$r"/gcc/$compiler_name.exe; then - true - else - objc_cv_compiler_exists=no - echo "rm -f config.cache config.log multilib.out" > skip-this-dir - fi - fi -fi -]) -AC_MSG_RESULT($objc_cv_compiler_exists) -if test x$objc_cv_compiler_exists = xno -then - rm -f Makefile conftest* confdefs* core - exit 0 -fi - -dnl Checks for programs. - -# Disable shared libs by default -AC_DISABLE_SHARED -# Enable Win32 DLL on MS Windows - FIXME -AC_LIBTOOL_WIN32_DLL - -AC_PROG_LIBTOOL - -dnl These should be inherited in the recursive make, but ensure they are -dnl defined: -test "$AR" || AR=ar -AC_SUBST(AR) -if test "$RANLIB"; then : - AC_SUBST(RANLIB) -else - AC_PROG_RANLIB -fi -AC_PROG_INSTALL -AC_PROG_MAKE_SET - -dnl Checks for header files. -# 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) - -# Determine CFLAGS for gthread. - -AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags, -[if test -f "$r"/gcc/Makefile -then - objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS "$r"/gcc/Makefile | awk -F= '{ print $2 }'` -else - AC_MSG_ERROR([not found]) -fi]) -GTHREAD_FLAGS=$objc_cv_gthread_flags -AC_SUBST(GTHREAD_FLAGS) - -AC_ARG_ENABLE(objc-gc, -[ --enable-objc-gc enable the use of Boehm's garbage collector with - the GNU Objective-C runtime.], -if [[[ x$enable_objc_gc = xno ]]]; then - OBJC_BOEHM_GC='' -else - OBJC_BOEHM_GC=libobjc_gc.la -fi, -OBJC_BOEHM_GC='') -AC_SUBST(OBJC_BOEHM_GC) - - -# We need multilib support, but only if configuring for the target. -AC_OUTPUT(Makefile, - [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -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}" - . ${toplevel_srcdir}/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}" -toplevel_srcdir=${toplevel_srcdir} -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" -) - - -dnl Local Variables: -dnl comment-start: "dnl " -dnl comment-end: "" -dnl comment-start-skip: "\\bdnl\\b\\s *" -dnl End: diff --git a/gnu/lib/libobjc/libobjc/encoding.c b/gnu/lib/libobjc/libobjc/encoding.c deleted file mode 100644 index be4c08b423e..00000000000 --- a/gnu/lib/libobjc/libobjc/encoding.c +++ /dev/null @@ -1,936 +0,0 @@ -/* Encoding of types for Objective C. - Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2002 - Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup - Bitfield support by Ovidiu Predescu - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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-api.h" -#include "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) objc_skip_typespec (TYPE) - -#define DECL_MODE(TYPE) *(TYPE) -#define TYPE_MODE(TYPE) *(TYPE) - -#define DFmode _C_DBL - -#define get_inner_array_type(TYPE) ((TYPE) + 1) - -/* 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. */ -#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. */ -/* ??? FIXME: As of 2002-06-21, the attribute `unused' doesn't seem to - eliminate the warning. */ -static int __attribute__ ((__unused__)) target_flags = 0; - -/* - 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_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_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_UNION_B: - { - int max_size = 0; - while (*type != _C_UNION_E && *type++ != '=') - /* do nothing */; - while (*type != _C_UNION_E) - { - /* Skip the variable name if any */ - if (*type == '"') - { - for (type++; *type++ != '"';) - /* do nothing */; - } - max_size = MAX (max_size, objc_sizeof_type (type)); - type = objc_skip_typespec (type); - } - return max_size; - } - - 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_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: - { - 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_UNION_B: - { - int maxalign = 0; - while (*type != _C_UNION_E && *type++ != '=') - /* do nothing */; - while (*type != _C_UNION_E) - { - /* Skip the variable name if any */ - if (*type == '"') - { - for (type++; *type++ != '"';) - /* do nothing */; - } - maxalign = MAX (maxalign, objc_alignof_type (type)); - type = objc_skip_typespec (type); - } - return maxalign; - } - - 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_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_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_STRUCT_B) - { - objc_error (nil, OBJC_ERR_BAD_TYPE, - "record type expected in objc_layout_structure, got %s\n", - 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); -} - - -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; - - /* 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 (*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 (*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 -#ifdef ADJUST_FIELD_ALIGN - desired_align = ADJUST_FIELD_ALIGN (type, desired_align); -#endif - - /* 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) -{ - if (layout->type && *layout->type == _C_STRUCT_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__) - layout->record_align = ROUND_TYPE_ALIGN (layout->original_type, - 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; -} diff --git a/gnu/lib/libobjc/libobjc/gc.c b/gnu/lib/libobjc/libobjc/gc.c deleted file mode 100644 index 1010508f64c..00000000000 --- a/gnu/lib/libobjc/libobjc/gc.c +++ /dev/null @@ -1,459 +0,0 @@ -/* Basic data types for Objective C. - Copyright (C) 1998, 2002 Free Software Foundation, Inc. - Contributed by Ovidiu Predescu. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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.h" -#include "encoding.h" - -#include <assert.h> -#include <string.h> - -#if OBJC_WITH_GC - -#include <gc.h> - -/* gc_typed.h uses the following but doesn't declare them */ -typedef GC_word word; -typedef GC_signed_word signed_word; - -#if BITS_PER_WORD == 32 -# define LOGWL 5 -# define modWORDSZ(n) ((n) & 0x1f) /* n mod size of word */ -#endif - -#if BITS_PER_WORD == 64 -# define LOGWL 6 -# define modWORDSZ(n) ((n) & 0x3f) /* n mod size of word */ -#endif - -#define divWORDSZ(n) ((n) >> LOGWL) /* divide n by size of 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; - - 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 and we have to reverse it */ - new_type = objc_atomic_malloc (strlen (ivar->ivar_type)); - strncpy (new_type, ivar->ivar_type, - (size_t)(type - ivar->ivar_type)); - strcat (new_type, type + 1); - ivar->ivar_type = new_type; - } - else - { - char *new_type; - - 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 and we have to make it gc_invisible */ - new_type = objc_malloc (strlen (ivar->ivar_type) + 2); - strncpy (new_type, ivar->ivar_type, - (size_t)(type - ivar->ivar_type)); - 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 */ diff --git a/gnu/lib/libobjc/libobjc/hash.c b/gnu/lib/libobjc/libobjc/hash.c deleted file mode 100644 index 2f58b2c5472..00000000000 --- a/gnu/lib/libobjc/libobjc/hash.c +++ /dev/null @@ -1,283 +0,0 @@ -/* Hash tables for Objective C internal structures - Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "hash.h" - -#include "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 -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 -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 hash_next. this makes 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)) { - hash_remove (cache,node->key); - node = next_node; - } - - hash_remove (cache,node->key); - } - } - - /* Release the array of nodes and the cache itself. */ - objc_free(cache->node_table); - objc_free(cache); -} - - -void -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 = hash_new (EXPANSION (*cachep), - (*cachep)->hash_func, - (*cachep)->compare_func); - - DEBUG_PRINTF ("Expanding cache %#x from %d to %d\n", - *cachep, (*cachep)->size, new->size); - - /* Copy the nodes from the first hash table to the new one. */ - while ((node1 = hash_next (*cachep, node1))) - hash_add (&new, node1->key, node1->value); - - /* Trash the old cache. */ - hash_delete (*cachep); - - /* Return a pointer to the new hash table. */ - *cachep = new; - } -} - - -void -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 -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 * -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 -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; -} diff --git a/gnu/lib/libobjc/libobjc/init.c b/gnu/lib/libobjc/libobjc/init.c deleted file mode 100644 index 098e253649f..00000000000 --- a/gnu/lib/libobjc/libobjc/init.c +++ /dev/null @@ -1,854 +0,0 @@ -/* 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@net-community.com> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 "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; - -/* 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 = (superclass->super_class ? - objc_lookup_class ((char *) superclass->super_class) - : Nil); - 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->super_class ? - objc_lookup_class ((char *) class->super_class) - : Nil) - == 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) - && ! hash_is_key_in_hash (__objc_load_methods, mth->method_imp)) - { - /* Add this method into the +load hash table */ - 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->super_class ? - objc_lookup_class ((char *) class->super_class) - : Nil); - } - - 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 - = hash_new (128, (hash_func_type)hash_ptr, 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; -} diff --git a/gnu/lib/libobjc/libobjc/libobjc.def b/gnu/lib/libobjc/libobjc/libobjc.def deleted file mode 100644 index 7e0a857ecf7..00000000000 --- a/gnu/lib/libobjc/libobjc/libobjc.def +++ /dev/null @@ -1,163 +0,0 @@ -; GNU Objective C Runtime DLL Export Definitions -; Copyright (C) 1997 Free Software Foundation, Inc. -; Contributed by Scott Christley <scottc@net-community.com> -; -; This file is part of GNU CC. -; -; GNU CC 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. -; -; GNU CC 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 -; GNU CC; see the file COPYING. If not, write to the Free Software -; Foundation, 59 Temple Place - Suite 330, -; Boston, MA 02111-1307, USA. - -LIBRARY libobjc -EXPORTS -search_for_method_in_list -objc_get_uninstalled_dtable -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 -hash_add -hash_delete -hash_new -hash_next -hash_remove -hash_value_for_key diff --git a/gnu/lib/libobjc/libobjc/libobjc_entry.c b/gnu/lib/libobjc/libobjc/libobjc_entry.c deleted file mode 100644 index 2d584ab3c1e..00000000000 --- a/gnu/lib/libobjc/libobjc/libobjc_entry.c +++ /dev/null @@ -1,55 +0,0 @@ -/* GNU Objective C Runtime DLL Entry - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Scott Christley <scottc@net-community.com> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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"); diff --git a/gnu/lib/libobjc/libobjc/linking.m b/gnu/lib/libobjc/libobjc/linking.m deleted file mode 100644 index 8ecca028110..00000000000 --- a/gnu/lib/libobjc/libobjc/linking.m +++ /dev/null @@ -1,40 +0,0 @@ -/* Force linking of classes required by Objective C runtime. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Ovidiu Predescu (ovidiu@net-community.com). - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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]; -} - diff --git a/gnu/lib/libobjc/libobjc/makefile.dos b/gnu/lib/libobjc/libobjc/makefile.dos deleted file mode 100644 index 3e1b1871e40..00000000000 --- a/gnu/lib/libobjc/libobjc/makefile.dos +++ /dev/null @@ -1,56 +0,0 @@ -# GNU Objective C Runtime Makefile for compiling with djgpp -# Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. -# -# This file is part of GNU CC. -# -# GNU CC 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. -# -# GNU CC 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 -# GNU CC; see the file COPYING. If not, write to the Free Software -# Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, 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 diff --git a/gnu/lib/libobjc/libobjc/misc.c b/gnu/lib/libobjc/libobjc/misc.c deleted file mode 100644 index 9572d3f0050..00000000000 --- a/gnu/lib/libobjc/libobjc/misc.c +++ /dev/null @@ -1,185 +0,0 @@ -/* 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 GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/nil_method.c b/gnu/lib/libobjc/libobjc/nil_method.c deleted file mode 100644 index 5e37c4d5dfb..00000000000 --- a/gnu/lib/libobjc/libobjc/nil_method.c +++ /dev/null @@ -1,55 +0,0 @@ -/* 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 GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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; -} diff --git a/gnu/lib/libobjc/libobjc/objc/NXConstStr.h b/gnu/lib/libobjc/libobjc/objc/NXConstStr.h deleted file mode 100644 index c9799544a02..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/NXConstStr.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Interface for the NXConstantString class for Objective-C. - Copyright (C) 1995 Free Software Foundation, Inc. - Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "objc/Object.h" - -@interface NXConstantString: Object -{ - char *c_string; - unsigned int len; -} - --(const char *) cString; --(unsigned int) length; - -@end - -#endif diff --git a/gnu/lib/libobjc/libobjc/objc/Object.h b/gnu/lib/libobjc/libobjc/objc/Object.h deleted file mode 100644 index a762acc3f7d..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/Object.h +++ /dev/null @@ -1,124 +0,0 @@ -/* Interface for the Object class for Objective-C. - Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/objc.h> -#include <objc/typedstream.h> - -/* - * All classes are derived from Object. As such, - * this is the overhead tacked onto those objects. - */ -@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; - -@end - -#endif diff --git a/gnu/lib/libobjc/libobjc/objc/Protocol.h b/gnu/lib/libobjc/libobjc/objc/Protocol.h deleted file mode 100644 index f54b7cd2393..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/Protocol.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Declare the class Protocol for Objective C programs. - Copyright (C) 1993 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "objc/Object.h" - -@interface Protocol : Object -{ -@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; - -@end - - - - -#endif /* not __Protocol_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objc/encoding.h b/gnu/lib/libobjc/libobjc/objc/encoding.h deleted file mode 100644 index 36a3d892137..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/encoding.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Encoding of types for Objective C. - Copyright (C) 1993, 1997, 2002 Free Software Foundation, Inc. - -Author: Kresten Krab Thorup - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 <ctype.h> -#include "objc/objc-api.h" - -#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); - -#endif /* __encoding_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objc/hash.h b/gnu/lib/libobjc/libobjc/objc/hash.h deleted file mode 100644 index 446026c821f..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/hash.h +++ /dev/null @@ -1,207 +0,0 @@ -/* Hash tables for Objective C method dispatch. - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/objc.h> - -/* - * 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 - * 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 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 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 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 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 hash_next (cache_ptr cache, node_ptr node); - -/* Used to return a value from a hash table using a given key. */ - -void *hash_value_for_key (cache_ptr cache, const void *key); - -/* Used to determine if the given key exists in the hash table */ - -BOOL 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 -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 -hash_string (cache_ptr cache, const void *key) -{ - unsigned int ret = 0; - unsigned int ctr = 0; - const char *ckey = key; - - while (*ckey) { - ret ^= *ckey++ << ctr; - ctr = (ctr + 1) % sizeof (void *); - } - - return ret & cache->mask; -} - - -/* Compare two pointers for equality. */ -static inline int -compare_ptrs (const void *k1, const void *k2) -{ - return ! (k1 - k2); -} - - -/* Compare two strings. */ -static inline int -compare_strings (const void *k1, const void *k2) -{ - if (k1 == k2) - return 1; - else if (k1 == 0 || k2 == 0) - return 0; - else - return ! strcmp (k1, k2); -} - - -#endif /* not __hash_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objc/objc-api.h b/gnu/lib/libobjc/libobjc/objc/objc-api.h deleted file mode 100644 index 92680209eab..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/objc-api.h +++ /dev/null @@ -1,607 +0,0 @@ -/* GNU Objective-C Runtime API. - Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/objc.h" -#include "objc/hash.h" -#include "objc/thr.h" -#include <stdio.h> -#include <stdarg.h> - -/* 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_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 '!' - - -/* -** 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); -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; - id instances[0]; -}; - -/* -** 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* 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 { - 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_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 Method; -typedef 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. */ - 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_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. */ - Class class; /* Object's super class. */ -} 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. -*/ -extern 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. -*/ -extern void (*_objc_load_callback)(Class class, Category* category); - -/* -** Hook functions for allocating, copying and disposing of instances -*/ -extern id (*_objc_object_alloc)(Class class); -extern id (*_objc_object_copy)(id object); -extern 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. -*/ -extern void *(*_objc_malloc)(size_t); -extern void *(*_objc_atomic_malloc)(size_t); -extern void *(*_objc_valloc)(size_t); -extern void *(*_objc_realloc)(void *, size_t); -extern void *(*_objc_calloc)(size_t, size_t); -extern 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. -*/ -extern 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); - -#endif /* not __objc_api_INCLUDE_GNU */ - - - diff --git a/gnu/lib/libobjc/libobjc/objc/objc-list.h b/gnu/lib/libobjc/libobjc/objc/objc-list.h deleted file mode 100644 index de083a5861e..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/objc-list.h +++ /dev/null @@ -1,147 +0,0 @@ -/* 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 GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 - -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 index, struct objc_list* list) -{ - while(index-- != 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); - } -} -#endif /* not __GNU_OBJC_LIST_H */ diff --git a/gnu/lib/libobjc/libobjc/objc/objc.h b/gnu/lib/libobjc/libobjc/objc/objc.h deleted file mode 100644 index 699542c493b..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/objc.h +++ /dev/null @@ -1,165 +0,0 @@ -/* Basic data types for Objective C. - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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__ */ -@class Protocol; -#endif - -typedef void* retval_t; /* return value */ -typedef void(*apply_t)(void); /* function pointer */ -typedef union { - 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 */ diff --git a/gnu/lib/libobjc/libobjc/objc/runtime.h b/gnu/lib/libobjc/libobjc/objc/runtime.h deleted file mode 100644 index bea9253a8be..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/runtime.h +++ /dev/null @@ -1,89 +0,0 @@ -/* GNU Objective C Runtime internal declarations - Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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/objc.h" /* core data types */ -#include "objc/objc-api.h" /* runtime api functions */ - -#include "objc/thr.h" /* thread and mutex support */ - -#include "objc/hash.h" /* hash structures */ -#include "objc/objc-list.h" /* linear lists */ - -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_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); - -#endif /* not __objc_runtime_INCLUDE_GNU */ - - diff --git a/gnu/lib/libobjc/libobjc/objc/sarray.h b/gnu/lib/libobjc/libobjc/objc/sarray.h deleted file mode 100644 index 17da2720364..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/sarray.h +++ /dev/null @@ -1,237 +0,0 @@ -/* Sparse Arrays for Objective C dispatch tables - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 - -#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 "objc/thr.h" - -extern int nbuckets; /* for stats */ -extern int nindices; -extern int narrays; -extern int idxsize; - -#include <assert.h> - -/* 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 index, void* elem); -void sarray_at_put_safe(struct sarray*, sidx index, 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 index) -{ - union sofftype x; - x.idx = index; -#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 index) -{ - return index; -} - -static inline sidx -soffset_encode(size_t offset) -{ - return offset; -} -#endif /* not PRECOMPUTE_SELECTORS */ - -/* Get element from the Sparse array `array' at offset `index' */ - -static inline void* sarray_get(struct sarray* array, sidx index) -{ -#ifdef PRECOMPUTE_SELECTORS - union sofftype x; - x.idx = index; -#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[index/INDEX_CAPACITY]-> - buckets[(index/BUCKET_SIZE)%INDEX_SIZE]-> - elems[index%BUCKET_SIZE]; -#else /* OBJC_SPARSE2 */ - return array->buckets[index/BUCKET_SIZE]->elems[index%BUCKET_SIZE]; -#endif /* not OBJC_SPARSE3 */ -#endif /* not PRECOMPUTE_SELECTORS */ -} - -static inline void* sarray_get_safe(struct sarray* array, sidx index) -{ - if(soffset_decode(index) < array->capacity) - return sarray_get(array, index); - else - return (array->empty_bucket->elems[0]); -} - -#endif /* __sarray_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objc/thr.h b/gnu/lib/libobjc/libobjc/objc/thr.h deleted file mode 100644 index 48ad0befa0d..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/thr.h +++ /dev/null @@ -1,145 +0,0 @@ -/* Thread and mutex controls for Objective C. - Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/objc.h" - -/************************************************************************* - * 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); - -#endif /* not __thread_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objc/typedstream.h b/gnu/lib/libobjc/libobjc/objc/typedstream.h deleted file mode 100644 index eb4642f344b..00000000000 --- a/gnu/lib/libobjc/libobjc/objc/typedstream.h +++ /dev/null @@ -1,132 +0,0 @@ -/* GNU Objective-C Typed Streams interface. - Copyright (C) 1993, 1995 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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/objc.h" -#include "objc/hash.h" -#include <stdio.h> - -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); - - -/* -** 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); - -#endif /* not __typedstream_INCLUDE_GNU */ diff --git a/gnu/lib/libobjc/libobjc/objects.c b/gnu/lib/libobjc/libobjc/objects.c deleted file mode 100644 index 6858fed2013..00000000000 --- a/gnu/lib/libobjc/libobjc/objects.c +++ /dev/null @@ -1,103 +0,0 @@ -/* 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 GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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.h" -#include "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; -} diff --git a/gnu/lib/libobjc/libobjc/sarray.c b/gnu/lib/libobjc/libobjc/sarray.c deleted file mode 100644 index e78e36d01f1..00000000000 --- a/gnu/lib/libobjc/libobjc/sarray.c +++ /dev/null @@ -1,515 +0,0 @@ -/* Sparse Arrays for Objective C dispatch tables - Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "sarray.h" -#include "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 - - if ((array->is_copy_of) && ((array->is_copy_of->ref_count - 1) == 0)) - sarray_free (array->is_copy_of); - - /* 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 - - /* 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; -} diff --git a/gnu/lib/libobjc/libobjc/selector.c b/gnu/lib/libobjc/libobjc/selector.c deleted file mode 100644 index 5f5a26bc9af..00000000000 --- a/gnu/lib/libobjc/libobjc/selector.c +++ /dev/null @@ -1,455 +0,0 @@ -/* GNU Objective C Runtime selector related functions - Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 "runtime.h" -#include "sarray.h" -#include "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 */ - -static void register_selectors_from_list (MethodList_t); - -/* Number of selectors stored in each of the above tables */ -unsigned int __objc_selector_max_index = 0; /* !T:MUTEX */ - -void __objc_init_selector_tables () -{ - __objc_selector_array = sarray_new (SELECTOR_HASH_SIZE, 0); - __objc_selector_names = sarray_new (SELECTOR_HASH_SIZE, 0); - __objc_selector_hash - = hash_new (SELECTOR_HASH_SIZE, - (hash_func_type) hash_string, - (compare_func_type) 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) - { - 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. - - This one is only called for Class objects. For categories, - class_add_method_list is called. - */ -static void -register_selectors_from_list (MethodList_t method_list) -{ - int i = 0; - while (i < method_list->method_count) - { - Method_t method = &method_list->method_list[i]; - method->method_name - = sel_register_typed_name ((const char *) method->method_name, - method->method_types); - i += 1; - } -} - - -/* 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; - } - - __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) 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) 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) 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; - -/* 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) 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 = objc_malloc (sizeof (struct objc_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 = objc_malloc (sizeof (struct objc_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, - 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) - 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; -} diff --git a/gnu/lib/libobjc/libobjc/sendmsg.c b/gnu/lib/libobjc/libobjc/sendmsg.c deleted file mode 100644 index 6ef711b50d3..00000000000 --- a/gnu/lib/libobjc/libobjc/sendmsg.c +++ /dev/null @@ -1,665 +0,0 @@ -/* GNU Objective C Runtime message lookup - Copyright (C) 1993, 1995, 1996, 1997, 1998, - 2001, 2002 Free Software Foundation, Inc. - Contributed by Kresten Krab Thorup - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "runtime.h" -#include "sarray.h" -#include "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) -{ - 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); - __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 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); - __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 so the - method 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__))) -{ - /* 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) - return; - - objc_mutex_lock (__objc_runtime_mutex); - - 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) -{ - int i; - - /* Passing of a linked list is not allowed. Do multiple calls. */ - assert (! list->method_next); - - /* Check for duplicates. */ - for (i = 0; i < list->method_count; ++i) - { - Method_t method = &list->method_list[i]; - - if (method->method_name) /* Sometimes these are NULL */ - { - /* This is where selector names are transmogrified to SEL's */ - method->method_name = - sel_register_typed_name ((const char *) method->method_name, - method->method_types); - } - } - - /* 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; -} diff --git a/gnu/lib/libobjc/libobjc/thr-dce.c b/gnu/lib/libobjc/libobjc/thr-dce.c deleted file mode 100644 index 3fa5b9b1b3e..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-dce.c +++ /dev/null @@ -1,281 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 <thr.h> -#include "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-decosf1.c b/gnu/lib/libobjc/libobjc/thr-decosf1.c deleted file mode 100644 index 0f7063b7e83..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-decosf1.c +++ /dev/null @@ -1,281 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-irix.c b/gnu/lib/libobjc/libobjc/thr-irix.c deleted file mode 100644 index 528a3e3a434..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-irix.c +++ /dev/null @@ -1,235 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - SGI IRIX Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-mach.c b/gnu/lib/libobjc/libobjc/thr-mach.c deleted file mode 100644 index e95460746d1..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-mach.c +++ /dev/null @@ -1,313 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Modified for Mach threads by Bill Bumgarner <bbum@friday.com> - Condition functions added by Mircea Oancea <mircea@first.elcom.pub.ro> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-objc.c b/gnu/lib/libobjc/libobjc/thr-objc.c deleted file mode 100644 index 48150f0ef3e..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-objc.c +++ /dev/null @@ -1,181 +0,0 @@ -/* GNU Objective C Runtime Thread Interface. - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 -#include "tconfig.h" -#include "defaults.h" -#include <objc/thr.h> -#include "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-os2.c b/gnu/lib/libobjc/libobjc/thr-os2.c deleted file mode 100644 index a0d7d436613..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-os2.c +++ /dev/null @@ -1,267 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Thomas Baier (baier@ci.tuwien.ac.at) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-posix.c b/gnu/lib/libobjc/libobjc/thr-posix.c deleted file mode 100644 index ed40be2459e..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-posix.c +++ /dev/null @@ -1,324 +0,0 @@ -/* GNU Objective C Runtime Thread Interface for POSIX compliant threads - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Modified for Linux/Pthreads by Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de) - Modified for posix compliance by Chris Ball (cball@fmco.com) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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) -{ -#ifndef __OpenBSD__ - 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; - } -#endif - return -1; -} - -/* Return the current thread's priority. */ -int -__objc_thread_get_priority(void) -{ -#ifdef __OpenBSD__ - return OBJC_THREAD_INTERACTIVE_PRIORITY; -#else - int policy; - struct sched_param params; - - if (pthread_getschedparam(pthread_self(), &policy, ¶ms) == 0) - return params.sched_priority; - else - return -1; -#endif -} - -/* 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; -} diff --git a/gnu/lib/libobjc/libobjc/thr-pthreads.c b/gnu/lib/libobjc/libobjc/thr-pthreads.c deleted file mode 100644 index 2efdd15bc54..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-pthreads.c +++ /dev/null @@ -1,218 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation for PCThreads under GNU/Linux. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Scott Christley <scottc@net-community.com> - Condition functions added by: Mircea Oancea <mircea@first.elcom.pub.ro> - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-rtems.c b/gnu/lib/libobjc/libobjc/thr-rtems.c deleted file mode 100644 index 3fd50bef9c8..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-rtems.c +++ /dev/null @@ -1,194 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Renamed from thr-vxworks.c to thr-rtems.c by - Ralf Corsepius (corsepiu@faw.uni-ulm.de) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-single.c b/gnu/lib/libobjc/libobjc/thr-single.c deleted file mode 100644 index b196677c6b6..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-single.c +++ /dev/null @@ -1,192 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-solaris.c b/gnu/lib/libobjc/libobjc/thr-solaris.c deleted file mode 100644 index 90351b43cf6..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-solaris.c +++ /dev/null @@ -1,259 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - Conditions added by Mircea Oancea (mircea@first.elcom.pub.ro) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-vxworks.c b/gnu/lib/libobjc/libobjc/thr-vxworks.c deleted file mode 100644 index b196677c6b6..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-vxworks.c +++ /dev/null @@ -1,192 +0,0 @@ -/* GNU Objective C Runtime Thread Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr-win32.c b/gnu/lib/libobjc/libobjc/thr-win32.c deleted file mode 100644 index 8570ffd997e..00000000000 --- a/gnu/lib/libobjc/libobjc/thr-win32.c +++ /dev/null @@ -1,272 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Win32 Implementation - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 */ diff --git a/gnu/lib/libobjc/libobjc/thr.c b/gnu/lib/libobjc/libobjc/thr.c deleted file mode 100644 index bc94473ce68..00000000000 --- a/gnu/lib/libobjc/libobjc/thr.c +++ /dev/null @@ -1,563 +0,0 @@ -/* GNU Objective C Runtime Thread Interface - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Galen C. Hunt (gchunt@cs.rochester.edu) - -This file is part of GNU CC. - -GNU CC 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. - -GNU CC 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 -GNU CC; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, 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 "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 volatile void -__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 */ diff --git a/gnu/lib/libobjc/libtool.m4 b/gnu/lib/libobjc/libtool.m4 deleted file mode 100644 index deef6c9f618..00000000000 --- a/gnu/lib/libobjc/libtool.m4 +++ /dev/null @@ -1,935 +0,0 @@ -## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -# serial 46 AC_PROG_LIBTOOL -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ -])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ -])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ -])])])])])]) - -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# 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 \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# 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' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -# 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 - AC_PATH_MAGIC - fi - ;; -esac - -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -# 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" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -AC_ARG_WITH(pic, - [ --with-pic try to use only PIC/non-PIC objects [default=use both]], - pic_mode="$withval", pic_mode=default) -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 __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - 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 - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - ]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[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], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[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], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[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], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -]) - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) - else - MAGIC_CMD=: - fi -fi -]) - - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# 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]) -with_gnu_ld=$lt_cv_prog_gnu_ld -]) - -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[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*) - 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 - ;; - -freebsd* ) - 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*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - 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 -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -]) - - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, -[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]) -NM="$lt_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -# If this macro is not defined by Autoconf, define it here. -ifdef([AC_PROVIDE_IFELSE], - [], - [define([AC_PROVIDE_IFELSE], - [ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - -# AC_LIBTOOL_CXX - enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])]) - -AC_DEFUN([_AC_LIBTOOL_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh" -lt_save_CC="$CC" -lt_save_CFLAGS="$CFLAGS" -dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC -dnl is set to the C++ compiler. -AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" 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 -o libtool $libtool_flags \ ---build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \ -|| AC_MSG_ERROR([libtool tag configuration failed]) -CC="$lt_save_CC" -CFLAGS="$lt_save_CFLAGS" - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -# AC_LIBTOOL_GCJ - enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])]) - -AC_DEFUN([_AC_LIBTOOL_GCJ], -[AC_REQUIRE([AC_PROG_LIBTOOL]) -AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh" -lt_save_CC="$CC" -lt_save_CFLAGS="$CFLAGS" -dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC -dnl is set to the C++ compiler. -AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" 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 -o libtool $libtool_flags \ ---build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \ -|| AC_MSG_ERROR([libtool tag configuration failed]) -CC="$lt_save_CC" -CFLAGS="$lt_save_CFLAGS" - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -dnl old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) diff --git a/gnu/lib/libobjc/ltcf-c.sh b/gnu/lib/libobjc/ltcf-c.sh deleted file mode 100644 index ea6a31f4c4e..00000000000 --- a/gnu/lib/libobjc/ltcf-c.sh +++ /dev/null @@ -1,824 +0,0 @@ -#### This script is meant to be sourced by ltconfig. - -# ltcf-c.sh - Create a C compiler specific configuration -# -# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='main(){return(0);}' - -## Linker Characteristics -case $host_os in -cygwin* | mingw*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - darwin* | rhapsody*) - allow_undefined_flag='-undefined suppress' - archive_cmds='$CC `test .$module = .yes && echo -bundle || echo -dynamiclib` $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts -install_name $rpath/$soname `test -n "$verstring" -a x$verstring != x0.0 && echo $verstring`' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - if test "$with_gcc" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - if test $with_gnu_ld = no; then - exp_sym_flag='-Bexport' - no_entry_flag="" - fi - else - # Test if we are trying to use run time linking, or normal AIX style linking. - # If -brtl is somewhere in LDFLAGS, we need to do run time linking. - aix_use_runtimelinking=no - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then - aix_use_runtimelinking=yes - break - fi - done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other run time loading flags (-brtl), -berok will - # link without error, but may produce a broken library. - allow_undefined_flag=' ${wl}-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - if test "$host_cpu" = ia64; then - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - fi - else - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - build_libtool_need_lc=yes - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case "$host_cpu" in - ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' ;; - *) - if test $with_gcc = yes; then - case "$host_os" in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; - esac - else - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - ;; - esac - export_dynamic_flag_spec='${wl}-E' - hardcode_direct=yes - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # cc supports -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi - -## Compiler Characteristics: PIC flags, static flags, etc -if test "X${ac_cv_prog_cc_pic+set}" = Xset; then - : -else - ac_cv_prog_cc_pic= - ac_cv_prog_cc_shlib= - ac_cv_prog_cc_wl= - ac_cv_prog_cc_static= - ac_cv_prog_cc_no_builtin= - ac_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$with_gcc" = yes; then - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - cygwin* | mingw* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - ac_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - ac_cv_prog_cc_pic= - ;; - sysv4*MP*) - if test -d /usr/nec; then - ac_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - ac_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix*) - # All AIX code is PIC. - ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better ac_cv_prog_cc_static that works with the bundled CC? - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - ac_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - ac_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - ac_cv_prog_cc_pic='-KPIC' - ac_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - ac_cv_prog_cc_pic='-Kpic' - ac_cv_prog_cc_static='-dn' - ac_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - ac_cv_prog_cc_pic='-KPIC' - ac_cv_prog_cc_static='-Bstatic' - ac_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - ac_cv_prog_cc_pic='-PIC' - ac_cv_prog_cc_static='-Bstatic' - ac_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - ac_cv_prog_cc_pic='-KPIC' - ac_cv_prog_cc_static='-Bstatic' - ac_cv_prog_cc_wl='-Wl,' - ;; - - uts4*) - ac_cv_prog_cc_pic='-pic' - ac_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - ac_cv_prog_cc_pic='-Kconform_pic' - ac_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - ac_cv_prog_cc_can_build_shared=no - ;; - esac - fi - case "$host_os" in - # Platforms which do not suport PIC and -DPIC is meaningless - # on them: - *djgpp*) - ac_cv_prog_cc_pic= - ;; - *) - ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC" - ;; - esac -fi - -need_lc=yes -if test "$enable_shared" = yes && test "$with_gcc" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6 - if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - need_lc=$ac_cv_archive_cmds_needs_lc - else - $rm conftest* - echo "static int dummy;" > conftest.$ac_ext - if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - soname=conftest - lib=conftest - libobjs=conftest.$objext - deplibs= - wl=$ac_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then - need_lc=no - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - fi - $rm conftest* - echo "$ac_t$need_lc" 1>&6 - ;; - esac -fi -ac_cv_archive_cmds_needs_lc=$need_lc diff --git a/gnu/lib/libobjc/ltcf-cxx.sh b/gnu/lib/libobjc/ltcf-cxx.sh deleted file mode 100644 index 9059b1a002f..00000000000 --- a/gnu/lib/libobjc/ltcf-cxx.sh +++ /dev/null @@ -1,1021 +0,0 @@ -#### This script is meant to be sourced by ltconfig. - -# ltcf-cxx.sh - Create a C++ compiler specific configuration -# -# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# Original C++ support by:Gary V. Vaughan <gvv@techie.com> -# Alexandre Oliva <oliva@lsd.ic.unicamp.br> -# Ossama Othman <ossama@debian.org> -# Thomas Thanner <tanner@gmx.de> -# -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return (0); }' - -# C++ compiler -CXX=${CXX-c++} - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -CC=${CC-"$CXX"} -CFLAGS=${CFLAGS-"$CXXFLAGS"} - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler=$2 -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# Check if we are using GNU gcc (taken/adapted from configure script) -# We need to check here since "--with-gcc" is set at configure time, -# not ltconfig time! -cat > conftest.$ac_ext <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - with_gcc=yes - - # Set up default GNU C++ configuration - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. The - # assumption here is that the linker is going to be the same as that - # used by the C compiler. For the purposes of GCC, this is ok, but - # if someone uses g++ along with a non-GNU C compiler that doesn't - # use GNU ld, we may lose. This is ok for the toolchain tree, since - # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava, - # anyway, and those use both gcc and g++, so the settings are bound - # to be the same. - - if test "$with_gnu_ld" = yes; then - archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - else - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' - -else - with_gcc=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - aix4* | aix5*) - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - if test "$with_gcc" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - if test $with_gnu_ld = no; then - exp_sym_flag='-Bexport' - no_entry_flag="" - fi - else - # Test if we are trying to use run time linking, or normal AIX style linking. - # If -brtl is somewhere in LDFLAGS, we need to do run time linking. - aix_use_runtimelinking=no - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then - aix_use_runtimelinking=yes - break - fi - done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - allow_undefined_flag=' -Wl,-G' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}-brtl \${wl}$exp_sym_flag:\$export_symbols" - else - if test "$host_cpu" = ia64; then - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - fi - else - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, -berok will - # link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bnoerok' - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - build_libtool_need_lc=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs=no - ;; - freebsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs=yes - ;; - gnu*) - ;; - hpux*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no ;; - *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ;; - esac - hardcode_direct=yes - hardcode_libdir_separator=: - export_dynamic_flag_spec='${wl}-E' - fi - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - aCC) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test $with_gcc = yes; then - if test $with_gnu_ld = no; then - case "$host_os" in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) - case "$host_cpu" in - ia64*) - archive_cmds='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;; - *) - archive_cmds='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; - esac - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - archive_cmds='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$with_gcc" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' - fi - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec='${wl}--rpath,$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs' - ;; - cxx) - # Compaq C++ - archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='-rpath $libdir' - hardcode_libdir_separator=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - netbsd*) - # NetBSD uses g++ - do we need to do anything? - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - hardcode_libdir_separator=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - cxx) - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' - else - # FIXME: insert proper C++ library support - ld_shlibs=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - hardcode_libdir_separator=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - cxx) - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec='-rpath $libdir' - hardcode_libdir_separator=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' - else - # FIXME: insert proper C++ library support - ld_shlibs=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - sco*) - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - no_undefined_flag=' -zdefs' - archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag=' ${wl}-z ${wl}defs' - if $CC --version | egrep -v '^2\.7' > /dev/null; then - archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" - fi - - hardcode_libdir_flag_spec='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - esac - ;; - unixware*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs=no - ;; -esac - - -## Compiler Characteristics: PIC flags, static flags, etc - -# We don't use cached values here since only the C compiler -# characteristics should be cached. -ac_cv_prog_cc_pic= -ac_cv_prog_cc_shlib= -ac_cv_prog_cc_wl= -ac_cv_prog_cc_static= -ac_cv_prog_cc_no_builtin= -ac_cv_prog_cc_can_build_shared=$can_build_shared - -ac_cv_prog_cc_pic_works= -ac_cv_prog_cc_static_works= - -if test "$with_gcc" = yes; then - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - cygwin* | mingw* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - ac_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - ac_cv_prog_cc_pic= - ;; - sysv4*MP*) - if test -d /usr/nec; then - ac_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - ac_cv_prog_cc_pic='-fPIC' - ;; - esac -else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # ac_cv_prog_cc_static="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - ac_cv_prog_cc_pic='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - ac_cv_prog_cc_pic='-pic' - ;; - *) - ;; - esac - ;; - freebsd*) - # FreeBSD uses GNU C++ - ;; - gnu*) - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - ac_cv_prog_cc_pic='+Z' - ;; - aCC) - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - ac_cv_prog_cc_pic='+Z' - ;; - *) - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-non_shared' - ac_cv_prog_cc_pic='-KPIC' - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - ac_cv_prog_cc_wl='--backend -Wl,' - ac_cv_prog_cc_pic='-fPIC' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - ac_cv_prog_cc_pic= - ac_cv_prog_cc_static='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - ac_cv_prog_cc_pic='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - ac_cv_prog_cc_wl='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - ac_cv_prog_cc_pic='-pic' - ;; - cxx) - # Digital/Compaq C++ - ac_cv_prog_cc_wl='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - ac_cv_prog_cc_pic= - ac_cv_prog_cc_static='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - ac_cv_prog_cc_pic='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - ac_cv_prog_cc_pic='-KPIC' - ac_cv_prog_cc_static='-Bstatic' - ac_cv_prog_cc_wl='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - ac_cv_prog_cc_pic='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - ac_cv_prog_cc_pic='-pic' - ac_cv_prog_cc_static='-Bstatic' - ;; - lcc) - # Lucid - ac_cv_prog_cc_pic='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - ac_cv_prog_cc_pic='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - ac_cv_prog_cc_can_build_shared=no - ;; - esac -fi - -case "$host_os" in - # Platforms which do not suport PIC and -DPIC is meaningless - # on them: - *djgpp*) - ac_cv_prog_cc_pic= - ;; - *) - ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC" - ;; -esac - - -# Figure out "hidden" C++ library dependencies from verbose -# compiler output whening linking a shared library. -cat > conftest.$ac_ext <<EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -EOF - - -if (eval $ac_compile) 2>&5; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval $output_verbose_link_cmd`; do - - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path"; then - compiler_lib_search_path="${prev}${p}" - else - compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps"; then - postdeps="${prev}${p}" - else - postdeps="${postdeps} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects"; then - predep_objects="$p" - else - predep_objects="$predep_objects $p" - fi - else - if test -z "$postdep_objects"; then - postdep_objects="$p" - else - postdep_objects="$postdep_objects $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out -else - echo "ltcf-cxx.sh: error: problem compiling test program" -fi - -$rm -f confest.$objext - -case " $postdeps " in -*" -lc "*) need_lc=no ;; -*) need_lc=yes ;; -esac diff --git a/gnu/lib/libobjc/ltcf-gcj.sh b/gnu/lib/libobjc/ltcf-gcj.sh deleted file mode 100644 index 0ae9e166f0a..00000000000 --- a/gnu/lib/libobjc/ltcf-gcj.sh +++ /dev/null @@ -1,651 +0,0 @@ -#### This script is meant to be sourced by ltconfig. - -# ltcf-gcj.sh - Create a GCJ compiler specific configuration -# -# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# Original GCJ support by: -# Alexandre Oliva <oliva@lsd.ic.unicamp.br> -# -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' - -## Linker Characteristics -case $host_os in -cygwin* | mingw*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$with_gcc" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$with_gcc" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - if test "$with_gcc" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - if test $with_gnu_ld = no; then - exp_sym_flag='-Bexport' - no_entry_flag="" - fi - else - # Test if we are trying to use run time linking, or normal AIX style linking. - # If -brtl is somewhere in LDFLAGS, we need to do run time linking. - aix_use_runtimelinking=no - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then - aix_use_runtimelinking=yes - break - fi - done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other run time loading flags (-brtl), -berok will - # link without error, but may produce a broken library. - allow_undefined_flag=' ${wl}-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - if test "$host_cpu" = ia64; then - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - fi - else - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - build_libtool_need_lc=yes - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='${wl}-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$with_gcc" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' ${wl}-z ${wl}defs' - archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" - - hardcode_libdir_flag_spec='${wl}-R $wl$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi - -## Compiler Characteristics: PIC flags, static flags, etc - -# We don't use cached values here since only the C compiler -# characteristics should be cached. - ac_cv_prog_cc_pic= - ac_cv_prog_cc_shlib= - ac_cv_prog_cc_wl= - ac_cv_prog_cc_static= - ac_cv_prog_cc_no_builtin= - ac_cv_prog_cc_can_build_shared=$can_build_shared - - ac_cv_prog_cc_wl='-Wl,' - ac_cv_prog_cc_static='-static' - - case $host_os in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" - ;; - *djgpp*) - # DJGPP does not suppot shared libraries at all - ac_cv_prog_cc_pic= - ;; - cygwin* | mingw* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - ac_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - sysv4*MP*) - if test -d /usr/nec; then - ac_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - ac_cv_prog_cc_pic='-fPIC' - ;; - esac - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -need_lc=no - -# All existing releases of GCJ support `-c -o'. -lt_cv_compiler_c_o=yes diff --git a/gnu/lib/libobjc/ltconfig b/gnu/lib/libobjc/ltconfig deleted file mode 100755 index 44a5d698810..00000000000 --- a/gnu/lib/libobjc/ltconfig +++ /dev/null @@ -1,2821 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This file 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 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.4a-GCC3.0 -TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -enable_win32_dll=no -pic_mode=default -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -build=NONE -nonopt=NONE -ofile="$default_ofile" -verify_host=yes -tagname= -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -libext=a -cache_file= -max_cmd_len= - -## Dependencies to place before and after the object being linked: -predep_objects= -postdep_objects= -predeps= -postdeps= -compiler_lib_search_path= - -## Link characteristics: -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -striplib= -old_striplib= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -## Tools: -old_AR="$AR" -old_AR_FLAGS="$AR_FLAGS" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LIBS="$LIBS" -old_MAGIC_CMD="$MAGIC_CMD" -old_LD="$LD" -old_LN_S="$LN_S" -old_LTCC="$LTCC" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_STRIP="$STRIP" -old_AS="$AS" -old_DLLTOOL="$DLLTOOL" -old_OBJDUMP="$OBJDUMP" -old_OBJEXT="$OBJEXT" -old_EXEEXT="$EXEEXT" -old_reload_flag="$reload_flag" -old_deplibs_check_method="$deplibs_check_method" -old_file_magic_cmd="$file_magic_cmd" - -# Parse the command line options. -args= -prev= -for option -do - case $option in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case $option in - --help) cat <<EOM -Usage: $progname [OPTION]... LTMAIN [HOST] - -Generate a system-specific libtool script. - - --build configure for building on BUILD [BUILD=HOST] - --debug enable verbose shell tracing - --disable-shared do not build shared libraries - --disable-static do not build static libraries - --disable-fast-install do not optimize for fast installation - --enable-dlopen enable dlopen support - --enable-win32-dll enable building dlls on win32 hosts - --help display this help and exit - --no-verify do not verify that HOST is a valid host type --o, --output=FILE specify the output file [default=$default_ofile] - --quiet same as \`--silent' - --silent do not print informational messages - --srcdir=DIR find \`config.guess' in DIR - --version output version information and exit - --add-tag=TAG append an alternate configuration - --with-gcc assume that the GNU C compiler will be used - --with-gnu-ld assume that the C compiler uses the GNU linker - --prefer-pic try to use only PIC objects - --prefer-non-pic try to use only non-PIC objects - --disable-lock disable file locking - --cache-file=FILE configure cache file - -LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program -that provides basic libtool functionality. - -HOST is the canonical host system name [default=guessed]. -EOM - exit 0 - ;; - - --build) prev=build ;; - --build=*) build="$optarg" ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --disable-shared) enable_shared=no ;; - - --disable-static) enable_static=no ;; - - --disable-fast-install) enable_fast_install=no ;; - - --enable-dlopen) enable_dlopen=yes ;; - - --enable-win32-dll) enable_win32_dll=yes ;; - - --quiet | --silent) silent=yes ;; - - --srcdir) prev=srcdir ;; - --srcdir=*) srcdir="$optarg" ;; - - --no-verify) verify_host=no ;; - - --output | -o) prev=ofile ;; - --output=*) ofile="$optarg" ;; - - --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;; - - --add-tag) prev=tagname ;; - --add-tag=*) tagname="$optarg" ;; - - --with-gcc) with_gcc=yes ;; - --with-gnu-ld) with_gnu_ld=yes ;; - - --prefer-pic) pic_mode=yes ;; - --prefer-non-pic) pic_mode=no ;; - - --disable-lock) need_locks=no ;; - - --cache-file=*) cache_file="$optarg" ;; - - -*) - echo "$progname: unrecognized option \`$option'" 1>&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test -n "$tagname"; then - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in - "") ;; - *) - echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 - ;; - esac - - if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then - echo "$progname: tag name $tagname already exists" 1>&2 - exit 1 - fi - - if test ! -f "$ofile"; then - echo "$progname: warning: output file \`$ofile' does not exist" 1>&2 - fi - - if test -z "$LTCC"; then - eval "`$SHELL $ofile --config | grep '^LTCC='`" - if test -z "$LTCC"; then - echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2 - else - echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2 - fi - fi -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case $arg in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi -if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case $host_alias in - "") - # Force config.guess to use the C compiler. - # CC_FOR_BUILD overrides the CC variable in config.guess but I had - # problems with it so do it this way for now. - CC="$LTCC" - - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - # Restore the C compiler. - CC="$old_CC" - ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - - # Check for the build system type - echo $ac_n "checking build system type... $ac_c" 1>&6 - - build_alias=$build - case $build_alias in - NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; - esac - - build=`$SHELL $ac_config_sub $build_alias` - build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - echo "$ac_t""$build" 1>&6 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host - build_alias=$host_alias - build=$host -fi - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Source the script associated with the $tagname tag configuration. -if test -n "$tagname"; then - . $ltmain -else - # FIXME: We should use a variable here - # Configure for a C compiler - . $srcdir/ltcf-c.sh -fi - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$objext" && objext=o - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -# We assume here that the value for ac_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -echo "$progname:678:checking for $compiler option to produce PIC" 1>&5 - -if test -z "$ac_cv_prog_cc_pic"; then - echo "$ac_t"none 1>&6 -else - echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6 - echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 - if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \ - test "X${ac_cv_prog_cc_pic_works}" != X; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_cv_prog_cc_pic_works=yes - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC" - if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - ac_cv_prog_cc_pic_works=no - ac_cv_prog_cc_can_build_shared=no - ac_cv_prog_cc_pic= - else - ac_cv_prog_cc_pic_works=yes - ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" - fi - ;; - *) - ac_cv_prog_cc_pic_works=yes - ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - ac_cv_prog_cc_pic_works=no - ac_cv_prog_cc_can_build_shared=no - ac_cv_prog_cc_pic= - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - fi - # Belt *and* braces to stop my trousers falling down: - if test "X$ac_cv_prog_cc_pic_works" = Xno; then - ac_cv_prog_cc_pic= - ac_cv_prog_cc_can_build_shared=no - fi - echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6 -fi - -# Check for any special shared library compilation flags. -if test -n "$ac_cv_prog_cc_shlib"; then - echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then : - else - echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 - ac_cv_prog_cc_can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6 -echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 -if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \ - test "X${ac_cv_prog_cc_static_works}" != X; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - $rm conftest* - echo $lt_simple_link_test_code > conftest.$ac_ext - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static" - if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - ac_cv_prog_cc_static_works=yes - else - ac_cv_prog_cc_static_works=no - ac_cv_prog_cc_static= - fi - LDFLAGS="$save_LDFLAGS" - $rm conftest* -fi -# Belt *and* braces to stop my trousers falling down: -if test "X$ac_cv_prog_cc_static_works" = Xno; then - ac_cv_prog_cc_static= -fi -echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6 -pic_flag="$ac_cv_prog_cc_pic" -special_shlib_compile_flags="$ac_cv_prog_cc_shlib" -wl="$ac_cv_prog_cc_wl" -link_static_flag="$ac_cv_prog_cc_static" -no_builtin_flag="$ac_cv_prog_cc_no_builtin" -can_build_shared="$ac_cv_prog_cc_can_build_shared" - -# find the maximum length of command line arguments -echo "$progname:780: finding the maximum length of command line arguments" 1>&5 -echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - i=0 - testring="ABCD" - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring" && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # add a significant safety factor because C++ compilers can tack on massive amounts - # of additional arguments before passing them to the linker. 1/4 should be good. - len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len` -fi -echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5 -echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6 - -if test -n $lt_cv_sys_max_cmd_len ; then - max_cmd_len=$lt_cv_sys_max_cmd_len -else - max_cmd_len=none -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6 -if test "${lt_cv_compiler_c_o+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - mkdir out - # According to Tom Tromey, Ian Lance Taylor reported there are C compilers - # that will create temporary files in the current directory regardless of - # the output directory. Thus, making CWD read-only will cause this test - # to fail, enabling locking or at least warning the user not to do parallel - # builds. - chmod -w . - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -o out/conftest2.$objext" - echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5 - if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi - else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - lt_cv_compiler_c_o=no - fi - CFLAGS="$save_CFLAGS" - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm -r conftest 2>/dev/null -fi -compiler_c_o=$lt_cv_compiler_c_o -echo "${ac_t}$compiler_c_o" 1>&6 - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -echo "$ac_t$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - -echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "${ac_t}yes" 1>&6 -else - echo "${ac_t}no" 1>&6 -fi - -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of - # lib<name>.a to let people know that these are not typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries though AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - can_build_shared=no - fi - ;; - esac - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $with_gcc,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll; $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' -;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`' - soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lc=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32/usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - if test "$with_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - need_lib_prefix=no - need_version=no - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris* | sysv5*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -EOF - - echo "$progname:1431: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1435: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftstm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - $rm conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -if test "$pipe_works" = yes; then - echo "${ac_t}ok" 1>&6 -else - echo "${ac_t}failed" 1>&6 -fi - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -# configure.in, otherwise build static only libraries. -case $host_os in -cygwin* | mingw* | pw32* | os2*) - if test x$can_build_shared = xyes; then - test x$enable_win32_dll = xno && can_build_shared=no - echo "checking if package supports dlls... $can_build_shared" 1>&6 - fi -;; -esac - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$with_gcc" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# Check whether we must set pic_mode to default -test -z "$pic_flag" && pic_mode=default - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if test "X${lt_cv_dlopen+set}" != Xset; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:1591: checking for dlopen in -ldl" >&5 -if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1598 "ltconfig" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo $progname:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dl_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dl_dlopen=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dl_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1630: checking for dlopen" >&5 -if test "X${ac_cv_func_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1635 "ltconfig" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_dlopen=no -fi -rm -f conftest* -fi -if test "X$ac_cv_func_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "$progname:1677: checking for dlopen in -lsvld" >&5 -if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsvld $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1684 "ltconfig" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { -dlopen() -; return 0; } -EOF -if { (eval echo $progname:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_svld_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_svld_dlopen=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_svld_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:1716: checking for dld_link in -ldld" >&5 -if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1723 "ltconfig" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link(); - -int main() { -dld_link() -; return 0; } -EOF -if { (eval echo $progname:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dld_dld_link=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dld_dld_link=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dld_dld_link" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:1755: checking for shl_load" >&5 -if test "X${ac_cv_func_shl_load+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1760 "ltconfig" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_shl_load=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_shl_load=no -fi -rm -f conftest* -fi - -if test "X$ac_cv_func_shl_load" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:1803: checking for shl_load in -ldld" >&5 -if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1810 "ltconfig" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load(); - -int main() { -shl_load() -; return 0; } -EOF -if { (eval echo $progname:1824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dld_shl_load=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dld_shl_load=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dld_shl_load" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:1871: checking for $ac_hdr" >&5 -if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1876 "ltconfig" -#include <$ac_hdr> -int fnord = 0; -int main () { return(0); } -EOF -ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:1882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1910: checking whether a program can dlopen itself" >&5 -if test "X${lt_cv_dlopen_self+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.$ac_ext <<EOF -#line 1918 "ltconfig" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -void fnord() { int i=42; } -int main() { - void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1984: checking whether a statically linked program can dlopen itself" >&5 -if test "X${lt_cv_dlopen_self_static+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.$ac_ext <<EOF -#line 1992 "ltconfig" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -void fnord() { int i=42; } -int main() { - void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case $ltmain in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ - old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ - old_LN_S old_NM old_RANLIB old_STRIP \ - old_AS old_DLLTOOL old_OBJDUMP \ - old_OBJEXT old_EXEEXT old_reload_flag \ - old_deplibs_check_method old_file_magic_cmd \ - AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - predep_objects postdep_objects predeps postdeps compiler_lib_search_path \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test - ;; - esac - done - - case $ltecho in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - if test -z "$tagname"; then - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat <<EOF > "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -### BEGIN LIBTOOL CONFIG -EOF - else - echo "appending configuration tag \"$tagname\" to $ofile" - echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" - fi - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ - old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ - old_LN_S old_NM old_RANLIB old_STRIP \ - old_AS old_DLLTOOL old_OBJDUMP \ - old_OBJEXT old_EXEEXT old_reload_flag \ - old_deplibs_check_method old_file_magic_cmd; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - if test -z "$tagname"; then - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat <<EOF > "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) - -### BEGIN LIBTOOL CONFIG -EOF - else - echo "appending to $cfgfile" - echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" - fi - ;; -esac - -cat <<EOF >> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\ -# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\ -# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\ -# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\ -# deplibs_check_method=$old_deplibs_check_method \\ -# file_magic_cmd=$old_file_magic_cmd \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR -AR_FLAGS=$AR_FLAGS - -# A C compiler. -LTCC=$LTCC - -# A language-specific compiler. -CC=$CC - -# Is the compiler the GNU C compiler? -with_gcc=$with_gcc - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$compiler_c_o - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$old_striplib -striplib=$striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$compiler_lib_search_path - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$include_expsyms - -EOF - -if test -z "$tagname"; then - echo '### END LIBTOOL CONFIG' >> "$ofile" -else - echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile" -fi - -case $ltmain in -*.sh) - echo >> "$ofile" - if test -z "$tagname"; then - case $host_os in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - cat <<'EOF' >> "$ofile" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include <windows.h> -# #undef WIN32_LEAN_AND_MEAN -# #include <stdio.h> -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include <cygwin/cygwin_dll.h> -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include <stdio.h> /* for printf() */ -# #include <unistd.h> /* for open(), lseek(), read() */ -# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ -# #include <string.h> /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i<nexp; i++) -# { -# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); -# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); -# } -# -# return 0; -# } -# /* impgen.c ends here */ - -EOF - ;; - esac - - - # Append the ltmain.sh script. - sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - - chmod +x "$ofile" - fi - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -# Update the list of available tags. -if test -n "$tagname"; then - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - # Append the new tag name to the list of available tags. - available_tags="$available_tags $tagname" - - # Now substitute the updated of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then - mv ${ofile}.new ${ofile} - chmod +x "$ofile" - else - rm -f ${ofile}.new - echo "$progname: unable to update list of available tagged configurations." - exit 1 - fi -fi - -# Don't cache tagged configuration! -test -n "$cache_file" && test -z "$tagname" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# 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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/gnu/lib/libobjc/ltmain.sh b/gnu/lib/libobjc/ltmain.sh deleted file mode 100644 index 5d4281c54d2..00000000000 --- a/gnu/lib/libobjc/ltmain.sh +++ /dev/null @@ -1,5483 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun ltconfig. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# The name of this program. -progname=`$echo "$0" | sed 's%^.*/%%'` -modename="$progname" - -# Constants. -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.4a-GCC3.0 -TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)" - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -SP2NL='tr \040 \012' -NL2SP='tr \015\012 \040\040' - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi - -if test "$LTCONFIG_VERSION" != "$VERSION"; then - echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - echo "$modename: not configured to build any kind of library" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -taglist= - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - taglist="$taglist $tagname" - ;; - *) - if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" - else - echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0" - # Now print the configurations for the tags. - for tagname in $taglist; do - sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" - done - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - --tag) prevopt="--tag" prev=tag ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case $nonopt in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - prev= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - case $prev in - "") ;; - xcompiler) - # Aesthetically quote the previous argument. - prev= - lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - - case $arg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - # Accept any command-line options. - case $arg in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - case $user_target in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $lastarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case $user_target in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base compile - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - "$CC "*) ;; - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when ltconfig was run. - "`$echo $CC` "*) ;; - *) - for z in $available_tags; do - if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case $base_compile in - "$CC "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - "`$echo $CC` "*) - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - echo "$modename: unable to infer tagged configuration" - echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi - - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T <<EOF -# $libobj - a libtool object file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -EOF - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $srcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $srcfile" - fi - - if test ! -d ${xdir}$objdir; then - $show "$mkdir ${xdir}$objdir" - $run $mkdir ${xdir}$objdir - status=$? - if test $status -ne 0 && test ! -d ${xdir}$objdir; then - exit $status - fi - fi - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - $run $rm "$lobj" "$output_obj" - - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object='$objdir/$objname' - -EOF - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - else - # No PIC object so indicate it doesn't exist in the libtool - # object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object=none - -EOF - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $srcfile" - else - command="$base_compile $srcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$obj" "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object='$objname' - -EOF - else - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object=none - -EOF - fi - - $run $mv "${libobj}T" "${libobj}" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args="$nonopt" - base_compile="$nonopt" - compile_command="$nonopt" - finalize_command="$nonopt" - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - base_compile="$base_compile $arg" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit 1 - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n $prev - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base link - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - "$CC "*) ;; - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when ltconfig was run. - "`$echo $CC` "*) ;; - *) - for z in $available_tags; do - if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case $base_compile in - "$CC "*) - # The compiler in $compile_command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - "`$echo $CC` "*) - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - echo "$modename: unable to infer tagged configuration" - echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - libs="$libs $deplib" - done - - if test $linkmode = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit 1 - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test $linkmode = prog; then - # Determine which files to process - case $pass in - dlopen) - libs="$dlfiles" - save_deplibs="$deplibs" # Collect dlpreopened libraries - deplibs= - ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -l*) - if test $linkmode = oldlib && test $linkmode = obj; then - $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 - continue - fi - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - # Search the libtool library - lib="$searchdir/lib${name}.la" - if test -f "$lib"; then - found=yes - break - fi - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test $pass = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test $pass = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test $pass = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - if test "$deplibs_check_method" != pass_all; then - echo - echo "*** Warning: This library needs some functionality provided by $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - else - echo - echo "*** Warning: Linking the shared library $output against the" - echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test $pass != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test $found = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test $linkmode = oldlib && test $linkmode = obj; }; then - # Add dl[pre]opened files of deplib - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test $pass = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - elif test $linkmode != prog && test $linkmode != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi - continue - fi # $pass = conv - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - - # This library was specified with -dlopen. - if test $pass = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. - dlprefiles="$dlprefiles $lib" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test $pass = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test $linkmode = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" - fi - continue - fi - - if test $linkmode = prog && test $pass != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test $linkalldeplibs = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # Link against this shared library - - if test "$linkmode,$pass" = "prog,link" || - { test $linkmode = lib && test $hardcode_into_libs = yes; }; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - if test $linkmode = prog; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - fi - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`echo $soroot | sed -e 's/^.*\///'` - newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n $old_archive_from_expsyms_cmds - - if test $linkmode = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test $linkmode = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test $linkmode = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - add="-l$name" - fi - - if test $linkmode = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test $linkmode = prog; then - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - - # Try to link the static library - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - echo "*** Warning: This library needs some functionality provided by $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** Therefore, libtool will create a static module, that should work " - echo "*** as long as the dlopening application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test $linkmode = lib; then - if test -n "$dependency_libs" && - { test $hardcode_into_libs != yes || test $build_old_libs = yes || - test $link_static = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - - if test $link_all_deplibs != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" - else - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="-L$absdir" - fi - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test $pass = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test $pass != dlopen; then - test $pass != scan && dependency_libs="$newdependency_libs" - if test $pass != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - *) - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - if test "$pass" = "conv" && - { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then - libs="$deplibs" # reset libs - deplibs= - fi - done # for pass - if test $linkmode = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit 1 - else - echo - echo "*** Warning: Linking the shared library $output against the non-libtool" - echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case $current in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $revision in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $age in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix) - major=`expr $current - $age + 1` - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` - deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` - dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test $hardcode_into_libs != yes || test $build_old_libs = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test $build_libtool_need_lc = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $rm conftest - $LTCC -o conftest conftest.c $deplibs - if test $? -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occured in the first compile. Let's try to salvage the situation: - # Compile a seperate program for each library. - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - $rm conftest - $LTCC -o conftest conftest.c $i - # Did it work? - if test $? -eq 0 ; then - ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - droppeddeps=yes - echo - echo "*** Warning! Library $i is needed by this library but I was not able to" - echo "*** make it link in! You will probably need to install it or some" - echo "*** library that it depends on before this library will be fully" - echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - if eval echo \"$potent_lib\" 2>/dev/null \ - | sed 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test $allow_undefined = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test $hardcode_into_libs = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - test -z "$dlname" && dlname=$soname - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - -# # Ensure that we have .o objects for linkers which dislike .lo -# # (e.g. aix) in case we are running --disable-static -# for obj in $libobjs; do -# xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -# if test "X$xdir" = "X$obj"; then -# xdir="." -# else -# xdir="$xdir" -# fi -# baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -# if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then -# $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" -# $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? -# fi -# done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - if len=`expr "X$cmds" : ".*"` && - test $len -le $max_cmd_len; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$save_output-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && - test $len -le $max_cmd_len; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test $k -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$save_output-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$save_output-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - # Set up a command to remove the reloadale object files - # after they are used. - i=0 - while test $i -lt $k - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~$rm $delfiles\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit 0 - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" -# else -# # Just create a symlink. -# $show $rm $libobj -# $run $rm $libobj -# xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` -# if test "X$xdir" = "X$libobj"; then -# xdir="." -# else -# xdir="$xdir" -# fi -# baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` -# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -# $show "(cd $xdir && $LN_S $oldobj $baseobj)" -# $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - prog) - case $host in - *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles="$objs$old_deplibs" - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test $need_relink = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit 0 - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="cd `pwd`; $relink_command" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case $0 in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) exeext=.exe ;; - *) exeext= ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # win32 systems need to use the prog path for dll - # lookup to work - *-*-cygwin* | *-*-pw32*) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else -# # Ensure that we have .o objects in place in case we decided -# # not to build a shared library, and have fallen back to building -# # static libs even though --disable-static was passed! -# for oldobj in $oldobjs; do -# if test ! -f $oldobj; then -# xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` -# if test "X$xdir" = "X$oldobj"; then -# xdir="." -# else -# xdir="$xdir" -# fi -# baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` -# obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` -# $show "(cd $xdir && ${LN_S} $obj $baseobj)" -# $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? -# fi -# done - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test $len -le $max_cmd_len; then - : - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - # GNU ar 2.10+ was changed to match POSIX; thus no paths are - # encoded into archives. This makes 'ar r' malfunction in - # this piecewise linking case whenever conflicting object - # names appear in distinct ar calls; check, warn and compensate. - if (for obj in $save_oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 - $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 - AR_FLAGS=cq - fi - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && - test $len -le $max_cmd_len; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - eval cmds=\"\$concat_cmds~$old_archive_cmds\" - fi - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - tagopts= - for tag in $taglist; do - tagopts="$tagopts --tag $tag" - done - relink_command="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test $need_relink = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit 1 - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`echo $destfile | sed -e 's,.exe$,,'` - ;; - esac - ;; - esac - - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $0 --finish$current_libdirs' - else - exit 0 - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = ":" && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd='"$cmd"$args' - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - rmdirs= - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$objdir" - else - objdir="$dir/$objdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test $mode = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test $mode = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test $mode = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - # Do a test to see if this is a libtool program. - if test $mode = clean && - (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file - - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit 1 -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -### END LIBTOOL TAG CONFIG: disable-shared - -### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/gnu/lib/libobjc/shlib_version b/gnu/lib/libobjc/shlib_version deleted file mode 100644 index 3066b9771e7..00000000000 --- a/gnu/lib/libobjc/shlib_version +++ /dev/null @@ -1,2 +0,0 @@ -major=5 -minor=0 diff --git a/gnu/usr.bin/cc/libobjc/Makefile b/gnu/usr.bin/cc/libobjc/Makefile deleted file mode 100644 index df06dcdecc3..00000000000 --- a/gnu/usr.bin/cc/libobjc/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# $FreeBSD: src/gnu/lib/libobjc/Makefile,v 1.34.2.1 2009/08/03 08:13:06 kensmith Exp $ -# $OpenBSD: Makefile,v 1.8 2017/07/24 19:22:49 robert Exp $ - -OBJCDIR=${.CURDIR}/../../../gcc/libobjc -GCCDIR= ${.CURDIR}/../../../gcc/gcc -GCCLIB= ${.CURDIR}/../../../gcc - -.PATH: ${OBJCDIR}/objc ${OBJCDIR} - -LIB= objc - -SRCS= archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ - nil_method.c NXConstStr.m Object.m objects.c Protocol.m sarray.c \ - selector.c sendmsg.c thr.c thr-objc.c exception.c - -INCS= encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \ - sarray.h thr.h typedstream.h NXConstStr.h Object.h Protocol.h - -CFLAGS+= -DHAVE_GTHR_DEFAULT -DIN_GCC -DIN_TARGET_LIBS -CFLAGS+= -I. -I${.CURDIR}/../cc_tools -CFLAGS+= -I${OBJCDIR}/objc -I${OBJCDIR} -CFLAGS+= -I${GCCDIR}/config -I${GCCDIR} -CFLAGS+= -I${GCCLIB}/include -CFLAGS+= -fexceptions -frandom-seed=RepeatabilityConsideredGood -.if ${MACHINE_ARCH} == "m88k" -CPPFLAGS+= -DSJLJ_EXCEPTIONS=1 -.endif -OBJCFLAGS= -fgnu-runtime ${CFLAGS} - -GENHDRS= runtime-info.h - -runtime-info.h: - `${CC} --print-prog-name=cc1obj` -print-objc-runtime-info \ - < /dev/null > ${.TARGET} - -.for H in tconfig.h tm.h config.h options.h gthr-default.h unwind.h -$H: ${.CURDIR}/../cc_tools/Makefile - ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET} -GENHDRS+= $H -.endfor - -CLEANFILES+= ${GENHDRS} cs-* optionlist -SRCS+= ${GENHDRS} - -.if !empty(INCS) -includes: ${INCS} - @test -d ${DESTDIR}/usr/include/objc || \ - mkdir ${DESTDIR}/usr/include/objc - ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} \ - ${DESTDIR}/usr/include/objc -.endif - -BUILDFIRST = ${GENHDRS} - -.include <bsd.lib.mk> - -.SUFFIXES: .m - -# ObjC -OBJC?= ${CC} -OBJCFLAGS?= ${CFLAGS} ${CPPFLAGS} -Wno-import -COMPILE.m?= ${OBJC} ${OBJCFLAGS} -c -LINK.m?= ${OBJC} ${OBJCFLAGS} ${LDFLAGS} - -.m: - ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS} -.m.o: - ${COMPILE.m} ${.IMPSRC} -.m.a: - ${COMPILE.m} ${.IMPSRC} - ${AR} ${ARFLAGS} $@ $*.o - rm -f $*.o -.m.po: - ${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}.o - ${LD} -X -r ${.TARGET}.o -o ${.TARGET} - rm -f ${.TARGET}.o -.m.so: - ${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o - ${LD} -X -r ${.TARGET}.o -o ${.TARGET} - rm -f ${.TARGET}.o diff --git a/gnu/usr.bin/cc/libobjc/shlib_version b/gnu/usr.bin/cc/libobjc/shlib_version deleted file mode 100644 index 9c1551636c5..00000000000 --- a/gnu/usr.bin/cc/libobjc/shlib_version +++ /dev/null @@ -1,2 +0,0 @@ -major=6 -minor=0 |