gauche-c-wrapper-0.6.1.orig/0002755000000000000000000000000011237307565012510 5ustar gauche-c-wrapper-0.6.1.orig/ChangeLog0000644000000000000000000003645411237307544014271 0ustar 2009-08-08 KOGURO, Naoki * doc/c-wrapper-ref.texi (Load a header file): Added a description of c-load's :module keyword. * configure.ac: version 0.6.1 2009-08-05 KOGURO, Naoki * lib/c-wrapper.scm (c-load): Added a workaround for cwcompile in cygwin. 2009-08-04 KOGURO, Naoki * src/c-ffi.c (lookup_symbol): Modified to work like dlsym's RTLD_GLOBAL in cygwin. 2009-08-02 KOGURO, Naoki * testsuite/Makefile.in (.SUFFIXES): Added .m suffix. 2009-08-01 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (c-load-library): Added a workaround for cygwin. c-load-library tries to load "libfoo.dll", "cygfoo.dll" and "foo.dll" when "-lfoo" is specified. And it ignores "libc" and "libm" because they are in cygwin1.dll. 2009-07-20 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (init-decl-alist!): Fixed a bug that calculates a wrong bit-field offset after short or char. 2009-07-13 KOGURO, Naoki * configure.ac, src/Makefile.in: Added a workaround for cygwin. 2009-07-12 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (object-apply): Added object-apply for c-promise object, because there is the case that c-promise returns C function's #. 2009-06-27 KOGURO, Naoki * configure.ac: version 0.6.0 2009-06-21 KOGURO, Naoki * src/c-grammar.scm: Fixed a bug that generates #-included expr in macro parser. * src/c-parser.c, src/c-parserlib.stub, lib/c-wrapper/c-parser.scm: Removed ignore-dlsym-check? flag. 2009-06-20 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (c-symbol): Added c-symbol macro to lookup C symbol directly. Here is an example of c-load's :hide-symbols keyword and c-symbol, ;; Hide read(2) and write(2) system calls. (c-load "unistd.h" :hide-symbols '(read write)) ;; If you want to call read(2), use c-symbol. ((c-symbol read) filedes buf nbyte) ;; And you can use original "read" procedure, of cource. (read) * lib/c-wrapper.scm (c-load, %c-include): Added :hide-symbols keyword to prevent export of specified symbols (but the symbols are defined). * Modified to use sandbox module when c-ffi and c-parser defines new symbols. 2009-06-16 KOGURO, Naoki * Rewrote emit-* functions with C. 2009-06-04 KOGURO, Naoki * lib/c-wrapper.scm (%c-include): Added :module keyword option. 2009-04-26 KOGURO, Naoki * src/c-lex.c (read_identifier): Rewrote read-identifier with C. 2009-04-22 KOGURO, Naoki * Rewrote buf-* functions with C. 2009-04-14 KOGURO, Naoki * lib/c-wrapper/c-lex.scm (do-sharp-command): Rewrote sharp-directive-parser without regexp. 2009-04-12 KOGURO, Naoki * src/genyacc.scm: Modified C code generator. genyacc replaces Scheme functions with C ones if possible, by analyzing stub files. * Rewrote some code with C. 2009-04-10 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (parse-macro-body): Fixed a bug that makes an infinite-loop c-promise object when a macro name is equals to its body. 2009-04-04 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (typespec->c-type): Fixed a bug that typespec->c-type reports an error for an invalid type_specifier. (Reported by Shoji Nishimura). 2009-03-31 KOGURO, Naoki * lib/c-wrapper/context.scm (c-lookup-value): Fixed a bug that generating invalid scheme code if a name of function-like macro and a name of function are same. 2009-03-29 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (emit-typedef): Removed wordy code. * lib/c-wrapper/c-parser.scm, lib/c-wrapper/c-grammar.scm: Refactored. * lib/c-wrapper/c-lex.scm (buf-read-line, buf-read-char, buf-peek-char): Modified to use define-inline instead of define. * src/genyacc.scm (ccode-action), src/c-ffi.c: Modified to use Scm_ApplyRec[0-5] instead of Scm_ApplyRec. 2009-03-28 KOGURO, Naoki * Modified to use yacc instead of lalr. 2009-03-21 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (make-var): Removed unused information (typedef). * lib/c-wrapper/c-ffi.scm, lib/c-wrapper/c-parser.scm: Added object-+, object--, object-* and object-/ methods for and . 2009-03-20 KOGURO, Naoki * src/c-ffi.c (c_subr_proc): Fixed a bug that buffer overflow has occurred in vaargs-call. 2009-03-17 KOGURO, Naoki * lib/c-wrapper/c-lex.scm, lib/c-wrapper/c-parser.scm, lib/c-wrapper/context.scm: Made c-wrapper.c-lex module and c-wrapper.context module. 2009-03-15 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (write-object): Added a method for . * lib/c-wrapper/c-ffi.scm (object-apply): Fixed a bug when returns non object. * src/c-ffi.c, lib/c-wrapper/c-ffi.scm, lib/c-wrapper/c-parser.scm, lib/c-wrapper/stubgen.scm.in: Added a support of variable-like macro (for example, "#define FOO foo()" -> "(FOO) ;is equal (foo)") * src/c-ffi.c, src/c-ffilib.stub, src/c-ffi.h, lib/c-wrapper/c-ffi.scm, lib/c-wrapper/c-parser.scm: Added lazy initialization for C function and C variable. 2009-03-14 KOGURO, Naoki * src/c-ffi.c, src/c-ffilib.stub, src/c-ffi.h, lib/c-wrapper/c-ffi.scm: Improved performance of calling C function. 2009-02-21 KOGURO, Naoki * configure.ac: version 0.5.6 * lib/c-wrapper/c-parser.scm (attribute-mode->typespec): Added support of __byte__, __word__ and __pointer__ for the variable attribute 'mode'. * configure.ac: Added --with-rpath option. * libffi/configure.ac: Added NetBSD x86_64 entry. 2009-02-15 KOGURO, Naoki * lib/c-wrapper/c-parser.scm, lib/c-wrapper/c-lex.scm, lib/c-wrapper/c-grammar.scm: Added '__attribute__' parser, and a variable attribute 'mode' is used in parsing C header. 2009-02-14 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (c-parse): Modified to print an error message to current-error-port. * configure.ac: version 0.5.5 2009-02-11 KOGURO, Naoki * libffi/src/prep_cif.c, libffi/src/x86/ffi.c: Fixed a bug that a function can't return a struct-contains-array value in Windows environment. * src/c-ffi.c, src/closure_alloc.c: Fixed to work ffi_closure under NX protection. * src/c-ffi.c (Scm_MakeFFIArrayType): Modified to handle an array type as FFI_TYPE_STRUCT in x86-64 environment. Before this change, libffi can't pass an argument in some testcase (SEGFAULT occured at 'add_struct_array_uint'). 2009-02-06 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (setter): Added (setter ref) for . 2008-07-16 KOGURO, Naoki * configure.ac: Fixed the problem when PATH doesn't include /sbin (Thanks to NIIBE Yutaka and Jens Thiele). 2008-05-11 KOGURO, Naoki * lib/c-wrapper/stubgen.scm.in (run-command): Fixed a typo. * lib/c-wrapper/c-grammar.scm, lib/c-wrapper/c-lex.scm: Added @optional and @required rule. * Makefile.in, src/Makefile.in, testsuite/Makefile.in, lib/Makefile.in, objc/Makefile.in: Added datarootdir. 2008-05-10 KOGURO, Naoki * configure.ac: version 0.5.4 * lib/c-wrapper/c-parser.scm: Reverted workaround changes for cygwin. * src/c-ffilib.stub (, , ): Removed Scm_TopClass from the define-cclass's cpa. 2008-05-09 KOGURO, Naoki * Makefile.in (install, uninstall): Added $(DESTDIR) to an install directory (Reported by NIIBE Yutaka). * src/Makefile.in (libffi/Makefile): Added --with-pic option to libffi's configure (Suggested by NIIBE Yutaka). * configure.ac: Made enable_objc flag be effective in Mac OSX. 2008-05-06 KOGURO, Naoki * lib/c-wrapper/c-grammar.scm, lib/c-wrapper/c-lex.scm: Added @property, @synthesize and @dynamic rule. 2007-10-30 KOGURO, Naoki * src/c-ffilib.stub (, , ): Added Scm_TopClass to the define-cclass's cpa. This is a workaround for cygwin. * configure.ac: Added a cygwin setting. * c-parser.scm (typespec->c-type): Added "short unsigned int" pattern. * c-parser.scm (make-preprocessed-file, make-macro-file&src-file&identifier-queue): Added a workaround for cygwin. 2007-10-30 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (c-load-library): Changed to hold a handle object (this is for preparing to support Windows). 2007-10-29 KOGURO, Naoki * lib/c-wrapper/stubgen.scm.in (run-command): Changed to use run-process instead of with-input-from-process. * configure.ac: Stopped making objc-wrapper in MacOSX, because of it doesn't support Objective-C 2.0. * c-parser.scm (c-parse): Changed to use run-process instead of call-with-process-io. * configure.ac: version 0.5.3 2007-09-15 KOGURO, Naoki * src/c-ffilib.stub (ptr->string): Changed to use SCM_MAKE_STR_COPYING instead of SCM_MAKE_STR_IMMUTABLE, because it is difficult to avoid destroying the string body. 2007-05-20 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (c-parse): Added ad-hoc support of int*_t and u_int*_t for Linux. * configure.ac: version 0.5.2 * lib/c-wrapper/c-ffi.scm: Added support of GCC's unnamed struct/union fields within structs/unions (Reported by HIBINO Kei). 2007-05-19 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (deref): Added deref for . (Patch from HIBINO Kei) * lib/c-wrapper/c-ffi.scm (make-c-func, make-c-func-vaargs): Added c++ keyword experimentally, to mangle a C++ function name. * lib/c-wrapper/c-grammar.scm: Adapted to the C99 array type qualifier and array size expression (Reported by HIBINO Kei). 2007-01-13 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (c-closure-free): Added c-closure-free. 2007-01-06 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (object-apply): Added object-apply method for . * lib/c-wrapper/c-parser.scm, lib/c-wrapper/c-lex.scm: Modified to improve performance. * lib/c-wrapper/c-parser.scm (emit-definition): Fixed the import handling. 2007-01-05 KOGURO, Naoki * configure.ac: version 0.5.1 * lib/c-wrapper/c-ffi.scm (c-load-library): Modified to recognize '-Wl' option. * lib/c-wrapper/c-parser.scm (c-parse): Added the flag that is whether do check an existence of a symbol or not. 2007-01-04 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (emit-define-extern): Don't check an existence of symbols when :import is used. 2007-01-02 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (make-c-var): Added make-c-var function. (cast): Added the cast rule that converts a to a . 2007-01-01 KOGURO, Naoki * lib/c-wrapper/c-parser.scm (emit-define-inline): Modified to define an inline function whose body can't be parsed. cwcompile makes it available. 2006-12-31 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (ref): Added a feature like the indirect component selection operator (->). 2006-12-23 KOGURO, Naoki * objc/c-wrapper/objc-ffi.scm (c-load-library): Fixed the bug that c-load doesn't works well using objc-wrapper. * lib/c-wrapper/c-ffi.scm (c-load-library): Fixed the c-load-library bug. 2006-12-21 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm (c-load-library): Modified the library search rule, the new rule is (1) search LD_LIBRARY_PATH, (2) search the shared library cache (using ldconfig(8)), (3) search /usr/lib and /lib. * lib/c-wrapper/c-parser.scm (parameter-decl): Fixed to adjust a 'function returning type' parameter to 'pointer to function returning type'. 2006-12-20 KOGURO, Naoki * lib/c-wrapper/c-parser.scm, lib/c-wrapper/c-lex.scm (): Collected some global variables in class. * lib/c-wrapper/c-ffi.scm (c-load-library): Changed the library search rule to use ldconfig (in Linux and FreeBSD) or find (in MacOSX). 2006-12-19 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm, lib/c-wrapper/objc-ffi.scm, lib/c-wrapper/stubgen.scm, lib/c-wrapper/c-parser.scm: Renamed some function name for consistency. 2006-12-18 KOGURO, Naoki * lib/c-wrapper/c-parser.scm, lib/c-wrapper/stubgen.scm (c-parse): Modified to accept a procedure as :import parameter. * lib/c-wrapper.scm, lib/c-wrapper/c-ffi.scm, lib/c-wrapper/c-parser.scm: Added a feature to import enum symbols automatically if the enum is used as a parameter type. * lib/objc-wrapper.scm, lib/c-wrapper/objc-ffi.scm, testsuite/objc-test.scm: Added define-objc-class and define-objc-method. * src/Makefile.in: Added the target to make objc-ffilib.so 2006-12-16 KOGURO, Naoki * lib/c-wrapper/objc-ffi.scm (c-load-library): c-load-library recognizes '-framework' option when objc-wrapper is used. * lib/c-wrapper.scm, lib/c-wrapper/stubgen.scm (c-load): Added c-load macro. * configure.ac: version 0.5.0 * lib/c-wrapper.scm (c-include): Added new keyword option 'compiled-lib'. * lib/c-wrapper/c-ffi.scm: Renamed make-c-array to c-array. * lib/c-wrapper/objc-ffi.scm (objc-lookup-class): Added objc-lookup-class function, instead of objc_lookUpClass. * Added cwcompile command, and removed genwrapper. 2006-12-02 KOGURO, Naoki * src/ffi.h, src/ffi.c, src/ffilib.stub: Changed the code to use new Scm_ApplyRec. * testsuite/ffitest.h, testsuite/ffitest.c, testsuite/cwrappertest.scm: Added a test case about a function pointer. * lib/c-wrapper/c-parser.scm (%MACRO-BODY, %SCM-CAST): Added some reduction rules. * configure.ac: version 0.4.9 2006-11-25 KOGURO, Naoki * src/ffi.h, src/ffi.c, src/ffilib.stub: Changed the code to use new Scm_Apply. 2006-11-23 KOGURO, Naoki * lib/c-wrapper/c-lex.scm: Changed a data type for operator and keyword table from alist to hash table. * lib/c-wrapper.scm (c-include): Added keyword option :import, to import specified symbols only. 2006-11-22 KOGURO, Naoki * lib/c-wrapper/c-ffi.scm, lib/c-wrapper/c-parser.scm: Removed deprecated functions and macros. 2006-11-20 KOGURO, Naoki * configure.ac, src/genwrapper.in: Removed GENWRAPPER_MODULE substitution because c-wrapper.c-parser module can now parse both C and Objective-C code. * src/genwrapper.in, lib/c-wrapper.scm (generate-module): Move generate-module from c-wrapper.scm to genwrapper.in. * c-wrapper and objc-wrapper modules are divided into c-wrapper, c-wrapper.c-parser, c-wrapper.c-ffi, objc-wrapper and c-wrapper.objc-ffi. 2006-11-14 KOGURO, Naoki * lib/c-wrapper/c-parser.scm, lib/c-wrapper.scm, lib/objc-wrapper.scm: Added some macros for the preparation of stub generator. 2006-11-12 KOGURO, Naoki * lib/c-wrapper/c-parser.scm, lib/c-wrapper/c-grammar.scm, lib/objc-wrapper.scm: Cleaned up some codes. 2006-11-05 KOGURO, Naoki * lib/c-wrapper/c-grammar.scm, lib/c-wrapper/c-parser.scm: Fixed a bug of interpretation of a complex function pointer declaration (Reported by HIBINO Kei). gauche-c-wrapper-0.6.1.orig/config-ml.in0000644000000000000000000006257711237307544014727 0ustar # Configure fragment invoked in the post-target section for subdirs # wanting multilib support. # # Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # # 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 report bugs to # and send patches to . # It is advisable to support a few --enable/--disable options to let the # user select which libraries s/he really wants. # # Subdirectories wishing to use multilib should put the following lines # in the "post-target" section of configure.in. # # if [ "${srcdir}" = "." ] ; then # if [ "${with_target_subdir}" != "." ] ; then # . ${with_multisrctop}../../config-ml.in # else # . ${with_multisrctop}../config-ml.in # fi # else # . ${srcdir}/../config-ml.in # fi # # # Things are complicated because 6 separate cases must be handled: # 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. # # srcdir=. is special. It must handle make programs that don't handle VPATH. # To implement this, a symlink tree is built for each library and for each # multilib subdir. # # The build tree is layed out as # # ./ # newlib # m68020/ # newlib # m68881/ # newlib # # The nice feature about this arrangement is that inter-library references # in the build tree work without having to care where you are. Note that # inter-library references also work in the source tree because symlink trees # are built when srcdir=. # # Unfortunately, trying to access the libraries in the build tree requires # the user to manually choose which library to use as GCC won't be able to # find the right one. This is viewed as the lesser of two evils. # # Configure variables: # ${with_target_subdir} = "." for native, or ${target_alias} for cross. # Set by top level Makefile. # ${with_multisrctop} = how many levels of multilibs there are in the source # tree. It exists to handle the case of configuring in the source tree: # ${srcdir} is not constant. # ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881). # # Makefile variables: # MULTISRCTOP = number of multilib levels in source tree (+1 if cross) # (FIXME: note that this is different than ${with_multisrctop}. Check out.). # MULTIBUILDTOP = number of multilib levels in build tree # MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...) # (only defined in each library's main Makefile). # MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000) # (only defined in each multilib subdir). # FIXME: Multilib is currently disabled by default for everything other than # newlib. It is up to each target to turn on multilib support for the other # libraries as desired. # Autoconf incoming variables: # srcdir, host, ac_configure_args # # We *could* figure srcdir and host out, but we'd have to do work that # our caller has already done to figure them out and requiring these two # seems reasonable. # Note that `host' in this case is GCC's `target'. Target libraries are # configured for a particular host. Makefile=${ac_file-Makefile} ml_config_shell=${CONFIG_SHELL-/bin/sh} ml_realsrcdir=${srcdir} # Scan all the arguments and set all the ones we need. ml_verbose=--verbose for option in ${ac_configure_args} do # strip single quotes surrounding individual options case $option in \'*\') eval option=$option ;; esac case $option in --*) ;; -*) option=-$option ;; esac case $option in --*=*) optarg=`echo $option | sed -e 's/^[^=]*=//'` ;; esac case $option in --disable-*) enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` eval $enableopt=no ;; --enable-*) case "$option" in *=*) ;; *) optarg=yes ;; esac enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` eval $enableopt="$optarg" ;; --norecursion | --no-recursion) ml_norecursion=yes ;; --silent | --sil* | --quiet | --q*) ml_verbose=--silent ;; --verbose | --v | --verb*) ml_verbose=--verbose ;; --with-*) case "$option" in *=*) ;; *) optarg=yes ;; esac withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` eval $withopt="$optarg" ;; --without-*) withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'` eval $withopt=no ;; esac done # Only do this if --enable-multilib. if [ "${enable_multilib}" = yes ]; then # Compute whether this is the library's top level directory # (ie: not a multilib subdirectory, and not a subdirectory like newlib/src). # ${with_multisubdir} tells us we're in the right branch, but we could be # in a subdir of that. # ??? The previous version could void this test by separating the process into # two files: one that only the library's toplevel configure.in ran (to # configure the multilib subdirs), and another that all configure.in's ran to # update the Makefile. It seemed reasonable to collapse all multilib support # into one file, but it does leave us with having to perform this test. ml_toplevel_p=no if [ -z "${with_multisubdir}" ]; then if [ "${srcdir}" = "." ]; then # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. # ${with_target_subdir} = "." for native, otherwise target alias. if [ "${with_target_subdir}" = "." ]; then if [ -f ${ml_realsrcdir}/../config-ml.in ]; then ml_toplevel_p=yes fi else if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then ml_toplevel_p=yes fi fi else # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}. if [ -f ${ml_realsrcdir}/../config-ml.in ]; then ml_toplevel_p=yes fi fi fi # If this is the library's top level directory, set multidirs to the # multilib subdirs to support. This lives at the top because we need # `multidirs' set right away. if [ "${ml_toplevel_p}" = yes ]; then multidirs= for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do dir=`echo $i | sed -e 's/;.*$//'` if [ "${dir}" = "." ]; then true else if [ -z "${multidirs}" ]; then multidirs="${dir}" else multidirs="${multidirs} ${dir}" fi fi done # Target libraries are configured for the host they run on, so we check # $host here, not $target. case "${host}" in arc-*-elf*) if [ x$enable_biendian != xyes ] then old_multidirs=${multidirs} multidirs="" for x in ${old_multidirs}; do case "${x}" in *be*) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi ;; arm-*-*) if [ x"$enable_fpu" = xno ] then old_multidirs=${multidirs} multidirs="" for x in ${old_multidirs}; do case "${x}" in *fpu*) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x"$enable_26bit" = xno ] then old_multidirs=${multidirs} multidirs="" for x in ${old_multidirs}; do case "${x}" in *26bit*) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x"$enable_underscore" = xno ] then old_multidirs=${multidirs} multidirs="" for x in ${old_multidirs}; do case "${x}" in *under*) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x"$enable_interwork" = xno ] then old_multidirs=${multidirs} multidirs="" for x in ${old_multidirs}; do case "${x}" in *interwork*) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *le* ) : ;; *be* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x"$enable_nofmult" = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *nofmult* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi ;; m68*-*-*) if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_m68881 = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *m68881* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_m68000 = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *m68000* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_m68020 = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *m68020* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi ;; mips*-*-*) if [ x$enable_single_float = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *single* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *el* ) : ;; *eb* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi case " $multidirs " in *" mabi=64 "*) # We will not be able to create libraries with -mabi=64 if # we cannot even link a trivial program. It usually # indicates the 64bit libraries are missing. if echo 'main() {}' > conftest.c && ${CC-gcc} -mabi=64 conftest.c -o conftest; then : else echo Could not link program with -mabi=64, disabling it. old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *mabi=64* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi rm -f conftest.c conftest ;; esac ;; powerpc*-*-* | rs6000*-*-*) if [ x$enable_aix64 = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *ppc64* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_pthread = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *pthread* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *soft-float* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_powercpu = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in power | */power | */power/* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_powerpccpu = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *powerpc* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_powerpcos = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *mcall-linux* | *mcall-solaris* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_biendian = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *mlittle* | *mbig* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi if [ x$enable_sysv = xno ] then old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *mcall-sysv* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi ;; sparc*-*-*) case " $multidirs " in *" m64 "*) # We will not be able to create libraries with -m64 if # we cannot even link a trivial program. It usually # indicates the 64bit libraries are missing. if echo 'main() {}' > conftest.c && ${CC-gcc} -m64 conftest.c -o conftest; then : else echo Could not link program with -m64, disabling it. old_multidirs="${multidirs}" multidirs="" for x in ${old_multidirs}; do case "$x" in *m64* ) : ;; *) multidirs="${multidirs} ${x}" ;; esac done fi rm -f conftest.c conftest ;; esac ;; esac # Remove extraneous blanks from multidirs. # Tests like `if [ -n "$multidirs" ]' require it. multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'` # Add code to library's top level makefile to handle building the multilib # subdirs. cat > Multi.tem <<\EOF PWD_COMMAND=$${PWDCMD-pwd} # FIXME: There should be an @-sign in front of the `if'. # Leave out until this is tested a bit more. multi-do: if [ -z "$(MULTIDIRS)" ]; then \ true; \ else \ rootpre=`${PWD_COMMAND}`/; export rootpre; \ srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \ lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \ compiler="$(CC)"; \ for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \ dir=`echo $$i | sed -e 's/;.*$$//'`; \ if [ "$${dir}" = "." ]; then \ true; \ else \ if [ -d ../$${dir}/$${lib} ]; then \ flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ FCFLAGS="$(FCFLAGS) $${flags}" \ FFLAGS="$(FFLAGS) $${flags}" \ ADAFLAGS="$(ADAFLAGS) $${flags}" \ prefix="$(prefix)" \ exec_prefix="$(exec_prefix)" \ GCJFLAGS="$(GCJFLAGS) $${flags}" \ CXXFLAGS="$(CXXFLAGS) $${flags}" \ LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ LDFLAGS="$(LDFLAGS) $${flags}" \ MULTIFLAGS="$${flags}" \ DESTDIR="$(DESTDIR)" \ INSTALL="$(INSTALL)" \ INSTALL_DATA="$(INSTALL_DATA)" \ INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \ INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \ $(DO)); then \ true; \ else \ exit 1; \ fi; \ else true; \ fi; \ fi; \ done; \ fi # FIXME: There should be an @-sign in front of the `if'. # Leave out until this is tested a bit more. multi-clean: if [ -z "$(MULTIDIRS)" ]; then \ true; \ else \ lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ for dir in Makefile $(MULTIDIRS); do \ if [ -f ../$${dir}/$${lib}/Makefile ]; then \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \ then true; \ else exit 1; \ fi; \ else true; \ fi; \ done; \ fi EOF cat ${Makefile} Multi.tem > Makefile.tem rm -f ${Makefile} Multi.tem mv Makefile.tem ${Makefile} fi # ${ml_toplevel_p} = yes if [ "${ml_verbose}" = --verbose ]; then echo "Adding multilib support to Makefile in ${ml_realsrcdir}" if [ "${ml_toplevel_p}" = yes ]; then echo "multidirs=${multidirs}" fi echo "with_multisubdir=${with_multisubdir}" fi if [ "${srcdir}" = "." ]; then if [ "${with_target_subdir}" != "." ]; then ml_srcdotdot="../" else ml_srcdotdot="" fi else ml_srcdotdot="" fi if [ -z "${with_multisubdir}" ]; then ml_subdir= ml_builddotdot= : # ml_srcdotdot= # already set else ml_subdir="/${with_multisubdir}" # The '[^/][^/]*' appears that way to work around a SunOS sed bug. ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/ if [ "$srcdir" = "." ]; then ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot} else : # ml_srcdotdot= # already set fi fi if [ "${ml_toplevel_p}" = yes ]; then ml_do='$(MAKE)' ml_clean='$(MAKE)' else ml_do=true ml_clean=true fi # TOP is used by newlib and should not be used elsewhere for this purpose. # MULTI{SRC,BUILD}TOP are the proper ones to use. MULTISRCTOP is empty # when srcdir != builddir. MULTIBUILDTOP is always some number of ../'s. # FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can # delete TOP. Newlib may wish to continue to use TOP for its own purposes # of course. # MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile) # and lists the subdirectories to recurse into. # MULTISUBDIR is non-empty in each cpu subdirectory's Makefile # (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with # a leading '/'. # MULTIDO is used for targets like all, install, and check where # $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed. # MULTICLEAN is used for the *clean targets. # # ??? It is possible to merge MULTIDO and MULTICLEAN into one. They are # currently kept separate because we don't want the *clean targets to require # the existence of the compiler (which MULTIDO currently requires) and # therefore we'd have to record the directory options as well as names # (currently we just record the names and use --print-multi-lib to get the # options). sed -e "s:^TOP[ ]*=[ ]*\([./]*\)[ ]*$:TOP = ${ml_builddotdot}\1:" \ -e "s:^MULTISRCTOP[ ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \ -e "s:^MULTIBUILDTOP[ ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \ -e "s:^MULTIDIRS[ ]*=.*$:MULTIDIRS = ${multidirs}:" \ -e "s:^MULTISUBDIR[ ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \ -e "s:^MULTIDO[ ]*=.*$:MULTIDO = $ml_do:" \ -e "s:^MULTICLEAN[ ]*=.*$:MULTICLEAN = $ml_clean:" \ ${Makefile} > Makefile.tem rm -f ${Makefile} mv Makefile.tem ${Makefile} # If this is the library's top level, configure each multilib subdir. # This is done at the end because this is the loop that runs configure # in each multilib subdir and it seemed reasonable to finish updating the # Makefile before going on to configure the subdirs. if [ "${ml_toplevel_p}" = yes ]; then # We must freshly configure each subdirectory. This bit of code is # actually partially stolen from the main configure script. FIXME. if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then if [ "${ml_verbose}" = --verbose ]; then echo "Running configure in multilib subdirs ${multidirs}" echo "pwd: `${PWDCMD-pwd}`" fi ml_origdir=`${PWDCMD-pwd}` ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'` # cd to top-level-build-dir/${with_target_subdir} cd .. for ml_dir in ${multidirs}; do if [ "${ml_verbose}" = --verbose ]; then echo "Running configure in multilib subdir ${ml_dir}" echo "pwd: `${PWDCMD-pwd}`" fi if [ -d ${ml_dir} ]; then true; else # ``mkdir -p ${ml_dir}'' See also mkinstalldirs. pathcomp="" for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? fi if test ! -d "$pathcomp"; then exit $lasterr fi pathcomp="$pathcomp/" done fi if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../ dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'` case ${srcdir} in ".") echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir} if [ "${with_target_subdir}" != "." ]; then ml_unsubdir="../" else ml_unsubdir="" fi (cd ${ml_dir}/${ml_libdir}; ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "") if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then if [ x"${MAKE}" = x ]; then (cd ${ml_dir}/${ml_libdir}; make distclean) else (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean) fi fi ml_newsrcdir="." ml_srcdiroption= multisrctop=${dotdot} ;; *) case "${srcdir}" in /* | [A-Za-z]:[\\/]* ) # absolute path ml_newsrcdir=${srcdir} ;; *) # otherwise relative ml_newsrcdir=${dotdot}${srcdir} ;; esac ml_srcdiroption="-srcdir=${ml_newsrcdir}" multisrctop= ;; esac case "${progname}" in /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;; *) ml_recprog=${dotdot}${progname} ;; esac # FIXME: POPDIR=${PWD=`pwd`} doesn't work here. ML_POPDIR=`${PWDCMD-pwd}` cd ${ml_dir}/${ml_libdir} if [ -f ${ml_newsrcdir}/configure ]; then ml_recprog="${ml_newsrcdir}/configure" fi # find compiler flag corresponding to ${ml_dir} for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do dir=`echo $i | sed -e 's/;.*$//'` if [ "${dir}" = "${ml_dir}" ]; then flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'` break fi done ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"' if [ "${with_target_subdir}" = "." ]; then CC_=$CC' ' CXX_=$CXX' ' F77_=$F77' ' GCJ_=$GCJ' ' GFORTRAN_=$GFORTRAN' ' else # Create a regular expression that matches any string as long # as ML_POPDIR. popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'` CC_= for arg in ${CC}; do case $arg in -[BIL]"${ML_POPDIR}"/*) CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;; "${ML_POPDIR}"/*) CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; *) CC_="${CC_}${arg} " ;; esac done CXX_= for arg in ${CXX}; do case $arg in -[BIL]"${ML_POPDIR}"/*) CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; "${ML_POPDIR}"/*) CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; *) CXX_="${CXX_}${arg} " ;; esac done F77_= for arg in ${F77}; do case $arg in -[BIL]"${ML_POPDIR}"/*) F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; "${ML_POPDIR}"/*) F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; *) F77_="${F77_}${arg} " ;; esac done GCJ_= for arg in ${GCJ}; do case $arg in -[BIL]"${ML_POPDIR}"/*) GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; "${ML_POPDIR}"/*) GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; *) GCJ_="${GCJ_}${arg} " ;; esac done GFORTRAN_= for arg in ${GFORTRAN}; do case $arg in -[BIL]"${ML_POPDIR}"/*) GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; "${ML_POPDIR}"/*) GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; *) GFORTRAN_="${GFORTRAN_}${arg} " ;; esac done if test "x${LD_LIBRARY_PATH+set}" = xset; then LD_LIBRARY_PATH_= for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do case "$arg" in "${ML_POPDIR}"/*) arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` ;; esac if test "x$LD_LIBRARY_PATH_" != x; then LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg else LD_LIBRARY_PATH_=$arg fi done ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_" fi if test "x${SHLIB_PATH+set}" = xset; then SHLIB_PATH_= for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do case "$arg" in "${ML_POPDIR}"/*) arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` ;; esac if test "x$SHLIB_PATH_" != x; then SHLIB_PATH_=$SHLIB_PATH_:$arg else SHLIB_PATH_=$arg fi done ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_" fi fi if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ ${ac_configure_args} ${ml_srcdiroption} ; then true else exit 1 fi cd ${ML_POPDIR} done cd ${ml_origdir} fi fi # ${ml_toplevel_p} = yes fi # ${enable_multilib} = yes gauche-c-wrapper-0.6.1.orig/config.guess0000755000000000000000000012206511237307544015031 0ustar #! /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-07-02' # 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 . # Please send patches to . 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 ." 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) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { 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 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${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*:OpenVMS:*:*) echo alpha-hp-vms 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:4.0:6*) echo sparc-icl-nx6 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 /* 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 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 #include 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 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:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/FreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}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*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' 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 ;; cris:Linux:*:*) echo cris-axis-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 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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 #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' /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 | SHG2:*: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 echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # 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 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} 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 < # include #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 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 # 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 < 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: gauche-c-wrapper-0.6.1.orig/config.sub0000755000000000000000000007315311237307544014477 0ustar #! /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-07-04' # 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 . 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 ." 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* | kfreebsd*-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 \ | c4x | 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 | tic4x | 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]-* | amd64-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | 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-* | tic55x-* | tic6x-* | 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 ;; 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 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-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-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`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 ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-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* | -kfreebsd* | -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* | -nx6 | -nx7 | -sei*) # 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 ;; -kaos*) os=-kaos ;; -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 ;; c4x-* | tic4x-*) os=-coff ;; # 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: gauche-c-wrapper-0.6.1.orig/configure0000755000000000000000000033541711237307562014427 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for c-wrapper 0.6.1. # # Report bugs to . # # 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='c-wrapper' PACKAGE_TARNAME='c-wrapper' PACKAGE_VERSION='0.6.1' PACKAGE_STRING='c-wrapper 0.6.1' PACKAGE_BUGREPORT='naoki@koguro.net' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GOSH GAUCHE_CONFIG GAUCHE_PACKAGE GAUCHE_INSTALL GAUCHE_CESCONV SOEXT OBJEXT EXEEXT DYLIBEXT GAUCHE_PKGINCDIR GAUCHE_PKGLIBDIR GAUCHE_PKGARCHDIR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC YACC MAKEINFO GZIP_PROGRAM SED LDCONFIG LD_LIBRARY_PATH_ENVS TESTLIB_CFLAGS TESTLIB_LDFLAGS OBJC_ENABLE_TRUE STUBGEN_FFI_MODULE LDCONFIG_CMD SYS_LIBRARY_PATHS CPARSER_LIBS CYGWIN_FLAG CWCOMPILE_DEFAULT_LIBS 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_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS 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 c-wrapper 0.6.1 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 c-wrapper 0.6.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-objc turn on Objective-C support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rpath=PATH:PATH... Use -rpath option while building dynamically loadable objects. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _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 c-wrapper configure 0.6.1 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 c-wrapper $as_me 0.6.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- # Extract the first word of "gosh", so it can be a program name with args. set dummy gosh; 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_path_GOSH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GOSH in [\\/]* | ?:[\\/]*) ac_cv_path_GOSH="$GOSH" # Let the user override the test with a path. ;; *) 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_path_GOSH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GOSH=$ac_cv_path_GOSH if test -n "$GOSH"; then echo "$as_me:$LINENO: result: $GOSH" >&5 echo "${ECHO_T}$GOSH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gauche-config", so it can be a program name with args. set dummy gauche-config; 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_path_GAUCHE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GAUCHE_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GAUCHE_CONFIG="$GAUCHE_CONFIG" # Let the user override the test with a path. ;; *) 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_path_GAUCHE_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GAUCHE_CONFIG=$ac_cv_path_GAUCHE_CONFIG if test -n "$GAUCHE_CONFIG"; then echo "$as_me:$LINENO: result: $GAUCHE_CONFIG" >&5 echo "${ECHO_T}$GAUCHE_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gauche-package", so it can be a program name with args. set dummy gauche-package; 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_path_GAUCHE_PACKAGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GAUCHE_PACKAGE in [\\/]* | ?:[\\/]*) ac_cv_path_GAUCHE_PACKAGE="$GAUCHE_PACKAGE" # Let the user override the test with a path. ;; *) 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_path_GAUCHE_PACKAGE="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GAUCHE_PACKAGE=$ac_cv_path_GAUCHE_PACKAGE if test -n "$GAUCHE_PACKAGE"; then echo "$as_me:$LINENO: result: $GAUCHE_PACKAGE" >&5 echo "${ECHO_T}$GAUCHE_PACKAGE" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gauche-install", so it can be a program name with args. set dummy gauche-install; 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_path_GAUCHE_INSTALL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GAUCHE_INSTALL in [\\/]* | ?:[\\/]*) ac_cv_path_GAUCHE_INSTALL="$GAUCHE_INSTALL" # Let the user override the test with a path. ;; *) 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_path_GAUCHE_INSTALL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GAUCHE_INSTALL=$ac_cv_path_GAUCHE_INSTALL if test -n "$GAUCHE_INSTALL"; then echo "$as_me:$LINENO: result: $GAUCHE_INSTALL" >&5 echo "${ECHO_T}$GAUCHE_INSTALL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gauche-cesconv", so it can be a program name with args. set dummy gauche-cesconv; 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_path_GAUCHE_CESCONV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GAUCHE_CESCONV in [\\/]* | ?:[\\/]*) ac_cv_path_GAUCHE_CESCONV="$GAUCHE_CESCONV" # Let the user override the test with a path. ;; *) 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_path_GAUCHE_CESCONV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GAUCHE_CESCONV=$ac_cv_path_GAUCHE_CESCONV if test -n "$GAUCHE_CESCONV"; then echo "$as_me:$LINENO: result: $GAUCHE_CESCONV" >&5 echo "${ECHO_T}$GAUCHE_CESCONV" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi SOEXT=`$GAUCHE_CONFIG --so-suffix` OBJEXT=`$GAUCHE_CONFIG --object-suffix` EXEEXT=`$GAUCHE_CONFIG --executable-suffix` DYLIBEXT=`$GAUCHE_CONFIG --dylib-suffix` ac_default_prefix=`$GAUCHE_CONFIG --prefix` GAUCHE_PKGINCDIR=`$GAUCHE_CONFIG --pkgincdir` GAUCHE_PKGLIBDIR=`$GAUCHE_CONFIG --pkglibdir` GAUCHE_PKGARCHDIR=`$GAUCHE_CONFIG --pkgarchdir` 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 &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &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 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 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 #include #include #include /* 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 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 for ac_prog in 'bison -y' byacc 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_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in makeinfo 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_MAKEINFO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKEINFO"; then ac_cv_prog_MAKEINFO="$MAKEINFO" # 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_MAKEINFO="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi MAKEINFO=$ac_cv_prog_MAKEINFO if test -n "$MAKEINFO"; then echo "$as_me:$LINENO: result: $MAKEINFO" >&5 echo "${ECHO_T}$MAKEINFO" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$MAKEINFO" && break done for ac_prog in gzip 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_GZIP_PROGRAM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GZIP_PROGRAM"; then ac_cv_prog_GZIP_PROGRAM="$GZIP_PROGRAM" # 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_GZIP_PROGRAM="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi GZIP_PROGRAM=$ac_cv_prog_GZIP_PROGRAM if test -n "$GZIP_PROGRAM"; then echo "$as_me:$LINENO: result: $GZIP_PROGRAM" >&5 echo "${ECHO_T}$GZIP_PROGRAM" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$GZIP_PROGRAM" && break done for ac_prog in sed 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_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$SED"; then ac_cv_prog_SED="$SED" # 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_SED="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi SED=$ac_cv_prog_SED if test -n "$SED"; then echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$SED" && break done # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; 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_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LDCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/sbin:/usr/sbin" for as_dir in $as_dummy 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_path_LDCONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then echo "$as_me:$LINENO: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Check whether --enable-objc or --disable-objc was given. if test "${enable_objc+set}" = set; then enableval="$enable_objc" fi; try_rpath=yes rpath= # Check whether --with-rpath or --without-rpath was given. if test "${with_rpath+set}" = set; then withval="$with_rpath" case $with_rpath in yes) ;; no) try_rpath=no;; *) rpath="`echo $with_rpath | sed -e 's/^/-Wl,-rpath /' -e 's/:/ -Wl,-rpath /g'`";; esac fi; STUBGEN_FFI_MODULE=c-wrapper.c-ffi LDCONFIG_CMD="" LD_LIBRARY_PATH_ENVS='"LD_LIBRARY_PATH"' LDFLAGS="$LDFLAGS $rpath" TESTLIB_CFLAGS="-c -fPIC -o" TESTLIB_LDFLAGS="$rpath -shared -o" SYS_LIBRARY_PATHS="/usr/lib /lib" CPARSER_LIBS="" CYGWIN_FLAG="#f" CWCOMPILE_DEFAULT_LIBS="" case "$target" in *darwin*) LD_LIBRARY_PATH_ENVS='"LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH"' TESTLIB_LDFLAGS="-dynamiclib -o" if test "$enable_objc" = ""; then enable_objc="yes" fi ;; *linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -p | $SED -n '/^ /s/^.*=> //p'" fi ;; *freebsd*) if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -r | $SED -n '/^ /s/^.*=> //p'" fi ;; *netbsd*) SYS_LIBRARY_PATHS="$SYS_LIBRARY_PATHS /usr/pkg/lib" if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -r | $SED -n '/^ /s/^.*=> //p'" fi ;; *-cygwin*) LIBS="-lgauche-uvector -lpsapi $LIBS" LDFLAGS="$LDFLAGS -L." TESTLIB_CFLAGS="-c -o" CPARSER_LIBS="-lc-ffi -lc-lex" SYS_LIBRARY_PATHS="$SYS_LIBRARY_PATHS /usr/bin" CYGWIN_FLAG="#t" CWCOMPILE_DEFAULT_LIBS="-lgauche-uvector" ;; esac if test "$enable_objc" = "yes"; then CPPFLAGS="$CPPFLAGS -x objective-c -fobjc-exceptions" LDFLAGS="$LDFLAGS -framework Foundation" OBJC_ENABLE_TRUE="" STUBGEN_FFI_MODULE=c-wrapper.objc-ffi else OBJC_ENABLE_TRUE="#" fi GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/\\""\`\$/\\\&/g'`" { echo "$as_me:$LINENO: creating ${PACKAGE_NAME}.gpd" >&5 echo "$as_me: creating ${PACKAGE_NAME}.gpd" >&6;} $GAUCHE_PACKAGE make-gpd "$PACKAGE_NAME" \ -version "$PACKAGE_VERSION" \ -configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS" echo $PACKAGE_VERSION > VERSION ac_config_files="$ac_config_files Makefile src/Makefile lib/Makefile objc/Makefile testsuite/Makefile src/cwcompile lib/c-wrapper/config.scm lib/c-wrapper/stubgen.scm doc/Makefile" 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 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed 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 : ${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 c-wrapper $as_me 0.6.1, 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ c-wrapper config.status 0.6.1 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 _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 for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES objc/Makefile" ;; "testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "src/cwcompile" ) CONFIG_FILES="$CONFIG_FILES src/cwcompile" ;; "lib/c-wrapper/config.scm" ) CONFIG_FILES="$CONFIG_FILES lib/c-wrapper/config.scm" ;; "lib/c-wrapper/stubgen.scm" ) CONFIG_FILES="$CONFIG_FILES lib/c-wrapper/stubgen.scm" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) { { 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 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,@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,@GOSH@,$GOSH,;t t s,@GAUCHE_CONFIG@,$GAUCHE_CONFIG,;t t s,@GAUCHE_PACKAGE@,$GAUCHE_PACKAGE,;t t s,@GAUCHE_INSTALL@,$GAUCHE_INSTALL,;t t s,@GAUCHE_CESCONV@,$GAUCHE_CESCONV,;t t s,@SOEXT@,$SOEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@EXEEXT@,$EXEEXT,;t t s,@DYLIBEXT@,$DYLIBEXT,;t t s,@GAUCHE_PKGINCDIR@,$GAUCHE_PKGINCDIR,;t t s,@GAUCHE_PKGLIBDIR@,$GAUCHE_PKGLIBDIR,;t t s,@GAUCHE_PKGARCHDIR@,$GAUCHE_PKGARCHDIR,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@YACC@,$YACC,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@GZIP_PROGRAM@,$GZIP_PROGRAM,;t t s,@SED@,$SED,;t t s,@LDCONFIG@,$LDCONFIG,;t t s,@LD_LIBRARY_PATH_ENVS@,$LD_LIBRARY_PATH_ENVS,;t t s,@TESTLIB_CFLAGS@,$TESTLIB_CFLAGS,;t t s,@TESTLIB_LDFLAGS@,$TESTLIB_LDFLAGS,;t t s,@OBJC_ENABLE_TRUE@,$OBJC_ENABLE_TRUE,;t t s,@STUBGEN_FFI_MODULE@,$STUBGEN_FFI_MODULE,;t t s,@LDCONFIG_CMD@,$LDCONFIG_CMD,;t t s,@SYS_LIBRARY_PATHS@,$SYS_LIBRARY_PATHS,;t t s,@CPARSER_LIBS@,$CPARSER_LIBS,;t t s,@CYGWIN_FLAG@,$CYGWIN_FLAG,;t t s,@CWCOMPILE_DEFAULT_LIBS@,$CWCOMPILE_DEFAULT_LIBS,;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 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 " $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 { (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 gauche-c-wrapper-0.6.1.orig/configure.ac0000644000000000000000000001131311237307544014770 0ustar dnl dnl Configuring c-wrapper dnl process this file with autoconf to generate 'configure'. dnl $Id: configure.ac 657 2009-08-08 14:37:26Z naoki $ dnl AC_PREREQ(2.54) AC_INIT(c-wrapper, 0.6.1, naoki@koguro.net) dnl If you want to use the system name (OS, architecture, etc) in the dnl configure, uncomment the following line. In such a case, you need dnl to copy config.guess and config.sub from automake distribution. AC_CANONICAL_SYSTEM dnl Set up gauche related commands. The commands are set by scanning dnl PATH. You can override them by "GOSH=/my/gosh ./configure" etc. AC_PATH_PROG([GOSH], gosh) AC_PATH_PROG([GAUCHE_CONFIG], gauche-config) AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package) AC_PATH_PROG([GAUCHE_INSTALL], gauche-install) AC_PATH_PROG([GAUCHE_CESCONV], gauche-cesconv) dnl Usually these parameters are set by AC_PROG_CC, but we'd rather use dnl the same one as Gauche has been compiled with. SOEXT=`$GAUCHE_CONFIG --so-suffix` OBJEXT=`$GAUCHE_CONFIG --object-suffix` EXEEXT=`$GAUCHE_CONFIG --executable-suffix` DYLIBEXT=`$GAUCHE_CONFIG --dylib-suffix` AC_SUBST(SOEXT) AC_SUBST(OBJEXT) AC_SUBST(EXEEXT) AC_SUBST(DYLIBEXT) ac_default_prefix=`$GAUCHE_CONFIG --prefix` GAUCHE_PKGINCDIR=`$GAUCHE_CONFIG --pkgincdir` GAUCHE_PKGLIBDIR=`$GAUCHE_CONFIG --pkglibdir` GAUCHE_PKGARCHDIR=`$GAUCHE_CONFIG --pkgarchdir` AC_SUBST(GAUCHE_PKGINCDIR) AC_SUBST(GAUCHE_PKGLIBDIR) AC_SUBST(GAUCHE_PKGARCHDIR) dnl Check for headers. dnl Add your macro calls to check required headers, if you have any. dnl Check for other programs. dnl Add your macro calls to check existence of programs, if you have any. AC_PROG_CC AC_PROG_YACC AC_CHECK_PROGS(MAKEINFO, makeinfo) AC_CHECK_PROGS(GZIP_PROGRAM, gzip) AC_CHECK_PROGS(SED, sed) AC_PATH_PROG([LDCONFIG], [ldconfig], [], [$PATH:/sbin:/usr/sbin]) dnl Check for libraries dnl Add your macro calls to check required libraries, if you have any. dnl Platform-dependent configuration. AC_ARG_ENABLE(objc, [ --enable-objc turn on Objective-C support]) try_rpath=yes rpath=AC_ARG_WITH(rpath, AC_HELP_STRING([--with-rpath=PATH:PATH...], [Use -rpath option while building dynamically loadable objects.]), [ case $with_rpath in yes) ;; no) try_rpath=no;; *) rpath="`echo $with_rpath | sed -e 's/^/-Wl,-rpath /' -e 's/:/ -Wl,-rpath /g'`";; esac ]) STUBGEN_FFI_MODULE=c-wrapper.c-ffi LDCONFIG_CMD="" LD_LIBRARY_PATH_ENVS='"LD_LIBRARY_PATH"' LDFLAGS="$LDFLAGS $rpath" TESTLIB_CFLAGS="-c -fPIC -o" TESTLIB_LDFLAGS="$rpath -shared -o" SYS_LIBRARY_PATHS="/usr/lib /lib" CPARSER_LIBS="" CYGWIN_FLAG="#f" CWCOMPILE_DEFAULT_LIBS="" case "$target" in *darwin*) LD_LIBRARY_PATH_ENVS='"LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH"' TESTLIB_LDFLAGS="-dynamiclib -o" if test "$enable_objc" = ""; then enable_objc="yes" fi ;; *linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -p | $SED -n '/^ /s/^.*=> //p'" fi ;; *freebsd*) if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -r | $SED -n '/^ /s/^.*=> //p'" fi ;; *netbsd*) SYS_LIBRARY_PATHS="$SYS_LIBRARY_PATHS /usr/pkg/lib" if test "X$LDCONFIG" != "X" -a "X$SED" != "X"; then LDCONFIG_CMD="$LDCONFIG -r | $SED -n '/^ /s/^.*=> //p'" fi ;; *-cygwin*) LIBS="-lgauche-uvector -lpsapi $LIBS" LDFLAGS="$LDFLAGS -L." TESTLIB_CFLAGS="-c -o" CPARSER_LIBS="-lc-ffi -lc-lex" SYS_LIBRARY_PATHS="$SYS_LIBRARY_PATHS /usr/bin" CYGWIN_FLAG="#t" CWCOMPILE_DEFAULT_LIBS="-lgauche-uvector" ;; esac if test "$enable_objc" = "yes"; then CPPFLAGS="$CPPFLAGS -x objective-c -fobjc-exceptions" LDFLAGS="$LDFLAGS -framework Foundation" OBJC_ENABLE_TRUE="" STUBGEN_FFI_MODULE=c-wrapper.objc-ffi else OBJC_ENABLE_TRUE="#" fi AC_SUBST(LD_LIBRARY_PATH_ENVS) AC_SUBST(TESTLIB_CFLAGS) AC_SUBST(TESTLIB_LDFLAGS) AC_SUBST(OBJC_ENABLE_TRUE) AC_SUBST(STUBGEN_FFI_MODULE) AC_SUBST(LDCONFIG_CMD) AC_SUBST(SYS_LIBRARY_PATHS) AC_SUBST(CPARSER_LIBS) AC_SUBST(CYGWIN_FLAG) AC_SUBST(CWCOMPILE_DEFAULT_LIBS) dnl Creating gpd (gauche package description) file GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`" AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd]) $GAUCHE_PACKAGE make-gpd "$PACKAGE_NAME" \ -version "$PACKAGE_VERSION" \ -configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS" dnl Output echo $PACKAGE_VERSION > VERSION AC_OUTPUT(Makefile src/Makefile lib/Makefile objc/Makefile testsuite/Makefile src/cwcompile lib/c-wrapper/config.scm lib/c-wrapper/stubgen.scm doc/Makefile) gauche-c-wrapper-0.6.1.orig/COPYING0000644000000000000000000000724311237307544013544 0ustar ----------------------------------------------------------------------------- c-wrapper, Copyright notice and license. Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- c-wrapper uses ggc.lang.tools, Copyright (c) 2001 Shigenobu Kimura, All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- c-wrapper uses libffi, libffi - Copyright (c) 1996-2003 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gauche-c-wrapper-0.6.1.orig/depcomp0000755000000000000000000003554511237307544014074 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gauche-c-wrapper-0.6.1.orig/doc/0002755000000000000000000000000011237307565013255 5ustar gauche-c-wrapper-0.6.1.orig/doc/c-wrapper-ref.texi0000644000000000000000000007254311237307544016630 0ustar \input texinfo @c -*-texinfo-*- @comment %**start of header @c EN @setfilename c-wrapper-refe.info @settitle c-wrapper reference manual @dircategory The Algorithmic Language Scheme @direntry * c-wrapper reference: (c-wrapper-refe.info). A generic wrapper for C libraries. @end direntry @c JP @setfilename c-wrapper-refj.info @settitle c-wrapper ¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë @dircategory The Algorithmic Language Scheme @direntry * c-wrapper reference: (c-wrapper-refj.info). A generic wrapper for C libraries. @end direntry @documentencoding euc-jp @c COMMON @comment %**end of header @c $Id: c-wrapper-ref.texi 13 2005-09-29 15:31:11Z naoki $ @c module and class index @defcodeindex md @defcodeindex cl @iftex @finalout @parskip 4pt plus 1pt @end iftex @titlepage @c EN @title c-wrapper reference manual @subtitle version @VERSION@ @author KOGURO, Naoki (naoki@@koguro.net) @c JP @title c-wrapper ¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë @subtitle version @VERSION@ @author KOGURO, Naoki (naoki@@koguro.net) @c COMMON @page @vskip 0pt plus 1filll Copyright @copyright{} 2006 KOGURO, Naoki(naoki@@koguro.net) @end titlepage @node Top, c-wrapper, (dir), (dir) @ifnottex @c EN This is a reference manual of c-wrapper. @c JP Ëܥɥ­¥å¥á¥ó¥È¤Ïc-wrapper¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤Ç¤¹¡£ @c COMMON @end ifnottex @menu * c-wrapper:: * objc-wrapper:: * Function and Syntax Index:: * Class Index:: * Variable Index:: @detailmenu --- The Detailed Node Listing --- c-wrapper * Load a shared library:: * Load a header file:: * Classes and function about C types and values:: objc-wrapper * Load a framework library:: * Load an Objectice-C header file:: * Functions about Objective-C objects:: @end detailmenu @end menu @node c-wrapper, objc-wrapper, Top, Top @comment node-name, next, previous, up @chapter c-wrapper @c EN @code{c-wrapper} is the module which enables to use C libraries. @c JP @code{c-wrapper}¤È¤Ï¡¢C¤Î¥é¥¤¥Ö¥é¥ê¤òGauche¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£ @c COMMON @menu * Load a shared library:: * Load a header file:: * Classes and function about C types and values:: @end menu @node Load a shared library, Load a header file, c-wrapper, c-wrapper @comment node-name, next, previous, up @section Load a shared library @defun c-load-library file-or-list &keyword @c EN Load one or more shared libraries. If you omit the extension, c-wrapper add a extension (.so, .dylib, and so on) automatically. @c JP ¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ @var{file-or-list} ¤Ç¥ê¥¹¥È¤òÅϤ¹¤ÈÊ£¿ô¤Î¥é¥¤¥Ö¥é¥ê¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ ¤Þ¤¿³ÈÄ¥»Ò¤ò¾Êά¤·¤¿¾ì¹ç¡¢´Ä¶­¤Ë±þ¤¸¤¿³ÈÄ¥»Ò (.so ¤ä .dylib ¤Ê¤É ) ¤¬Éղ䵤ì¤Þ¤¹¡£ @c COMMON @c EN Keyword arguments are: @c JP ¥­¡¼¥ï¡¼¥É°ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @table @code @item :option option-string @c EN Specify library names and library load paths with ld like option. @c JP ld¤ËÍ¿¤¨¤ë¥ª¥×¥·¥ç¥ó¤Î¤è¤¦¤Ê·Á¼°¤Ç¶¦Í­¥é¥¤¥Ö¥é¥ê¤äÆÉ¤ß¹þ¤ß¥Ñ¥¹¤Î»ØÄê¤ò¹Ô¤¤¤Þ¤¹¡£¸½¾õ»È¤¨¤ë¤Î¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ @c COMMON @table @code @item -llibrary @c EN Load the library named @var{library}. For example, -lc means to load 'libc'. @c JP ¶¦Í­¥é¥¤¥Ö¥é¥ê @var{library} ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£Î㤨¤Ð¡¢-lc ¤Î¤è¤¦¤Ë»ØÄꤹ¤ë¤È libc ¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ @c COMMON @item -Ldir @c EN Add directory @var{dir} to the library search paths. @c JP ¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¥µ¡¼¥Á¥ê¥¹¥È¤Ë¥Ç¥£¥ì¥¯¥È¥ê @var{dir} ¤òÄɲä·¤Þ¤¹¡£ @c COMMON @end table @end table @end defun @defun c-ld option-string @c EN This function is the same (c-load-library '() :option option-string). and is designed to use with a command returning linker flags like pkg-config. @c JP (c-load-library '() :option option-string) ¤ÈƱ¤¸¤Ç¤¹¡£¤³¤Î´Ø¿ô¤Ï pkg-config ¤Ê¤É¤Î¤è¤¦¤Ê¥ê¥ó¥«¤Î¥Õ¥é¥°¤òÊÖ¤¹¥³¥Þ¥ó¥É¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£ @c COMMON @example (c-ld (process-output->string "pkg-config Wand --libs")) @end example @end defun @node Load a header file, Classes and function about C types and values, Load a shared library, c-wrapper @comment node-name, next, previous, up @section Load a header file @deffn {Macro} c-include file-or-list &keyword @c EN Load one or more header files and define functions, global variables, constants , type definitions and macros in the current module. @c JP »ØÄꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß¡¢´Ø¿ô¡¦¥°¥í¡¼¥Ð¥ëÊÑ¿ô¡¦Äê¿ô¡¦·¿ÄêµÁ¡¦¥Þ¥¯¥í¤ò¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤·¤Þ¤¹¡£ @c EN Keyword arguments are: @c JP keyword °ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @table @code @item :include-dirs @c EN Sets up include directories. You can specify either a string file name or a list of string file names. @c JP ¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£Ê¸»úÎó¤â¤·¤¯¤Ïʸ»úÎó¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£ @c COMMON @item :option @c EN Sets up C preprocessor options. @c JP C¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÅϤ¹¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ê¸»úÎ󤬻ØÄê²Äǽ¤Ç¤¹¡£ @c COMMON @item :import @c EN Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them. If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns @code{#f}, the symbol is ignored, and the symbol is defined otherwise. @c JP ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤à¥·¥ó¥Ü¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¤È¤·¤Æ¡¢¥·¥ó¥Ü¥ë¡¢Ê¸»úÎó¡¢Àµµ¬É½¸½¡¢¼ê³¤­¤È¡¢¤½¤ì¤é¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£ ¼ê³¤­¤¬ÅϤµ¤ì¤¿¾ì¹ç¤Ï¡¢¥·¥ó¥Ü¥ë¤¬¸«¤Ä¤«¤ë¤¿¤Ó¤Ë¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤È¥·¥ó¥Ü¥ë̾¤ò°ú¿ô¤È¤·¤Æ¡¢¤½¤Î¼ê³¤­¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ ¼ê³¤­¤¬@code{#f}¤òÊÖ¤·¤¿¾ì¹ç¤½¤Î¥·¥ó¥Ü¥ë¤Ï̵»ë¤µ¤ì¡¢¤½¤ì°Ê³°¤ÎÃͤξì¹ç¤Ë¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£ @c COMMON @item :export? @c EN Specifies whether symbols in header files are exported or not. If you put @code{#t}, the symbols are exported automatically, and otherwise they are not exported. @c JP ÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤ò@code{export}¤¹¤ë¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£ @code{#t}¤Î¾ì¹ç¤ÏÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤ËÂФ·¼«Æ°Åª¤Ë@code{export}¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£@code{#f}¤Î¾ì¹ç¤Ï²¿¤â¤·¤Þ¤»¤ó¡£ @c COMMON @item :compiled-lib @c EN Sets up a shared library file name which cwcompile command generates. At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files. @c JP cwcompile¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤µ¤ì¤ë¥Ñ¡¼¥ººÑ¤ß¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î̾Á°¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ëÂå¤ï¤ê¤Ë¤½¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤¬¹Ô¤ï¤ì¤Þ¤¹¡£ @c COMMON @end table @c EN In loading header files, @code{c-include} gets these information and defines symbols. @table @asis @item Function prototype Defines a function with the same name. It applies @code{cast} to its arguments and @code{scm-cast} to its return value. @item External variable Defines an object with the same name. @item @code{enum} Defines a constant value with the same name. @item @code{struct} Defines a struct class. You can use it with @code{(c-struct tagname)}. @item @code{union} Defines a union class. You can use it with @code{(c-union tagname)}. @item @code{typedef} Defines a class with the name @code{}. @item Objectlike macro Defines a value with the same name if the macro body is an expression, all identifiers in the body have been defined and the expression has no side-effect. You have to be careful to use the value because it is the header-load-time value, not macro-use-time value. It may be different from one you expected. @item Functionlike macro Defines a macro with the same name if the macro body is an expression or statements and all identifiers in the body have been defined. @end table @c JP ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëÆÉ¤ß¹þ¤ß»þ¤Ë¡¢°Ê²¼¤Î¾ðÊó¤ò¼ý½¸¤·´Ø¿ô¤äÊÑ¿ô¤Ê¤É¤òÄêµÁ¤·¤Æ¤¤¤­¤Þ¤¹¡£ @table @asis @item ´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À ´Ø¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¤³¤Î´Ø¿ô¤Ï°ú¿ô¤ËÂФ·¤Æ@code{cast}¤òÌá¤êÃͤËÂФ·¤Æ@code{scm-cast}¤òŬÍѤ·¤Þ¤¹¡£ @item ³°ÉôÊÑ¿ôÄêµÁ ÊÑ¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç³°ÉôÊÑ¿ô¤ò»²¾È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£ @item @code{enum} Äê¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤ÇÄê¿ô¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£ @item @code{struct} ¹½Â¤ÂΤΥ¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï@code{(c-struct tagname)}¤Ç»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @item @code{union} ¶¦ÍÑÂΤΥ¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï@code{(c-union tagname)}¤Ç»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @item @code{typedef} @code{}¤È¤¤¤¦¥·¥ó¥Ü¥ë¤ÇC¤Î·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£ @item ¥ª¥Ö¥¸¥§¥¯¥È·Á¼° (objectlike) ¤Î¥Þ¥¯¥í ¥Þ¥¯¥í¤ÎÆâÍÆ¤¬¼°¤Ç¤¢¤ê¡¢»ÈÍѤµ¤ì¤Æ¤¤¤ë¼±Ê̻Ҥ¬¤¹¤Ù¤ÆÀë¸ÀºÑ¤ß¤Ç¤¢¤ê¡¢¤«¤ÄÉûºîÍѤòµÚ¤Ü¤¹¼°¤Ç¤Ê¤¤¾ì¹ç¤Ë¡¢¥Þ¥¯¥í̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤ÇÃͤ¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¡¢C¸À¸ì¤Ç¤Î¥Þ¥¯¥í¤È¤Ï°ÕÌ£¤¬°Û¤Ê¤ê¡¢¤³¤ÎÃͤϥإåÀ¥Õ¥¡¥¤¥ëÆÉ¤ß¹þ¤ß»þÅÀ¤Ç¤ÎÃͤǤ¢¤ê¡¢¥Þ¥¯¥í»ÈÍÑ»þÅÀ¤Ç¤ÎÃͤǤϤ¢¤ê¤Þ¤»¤ó¡£ @item ´Ø¿ô·Á¼° (functionlike) ¤Î¥Þ¥¯¥í ¥Þ¥¯¥í¤ÎÆâÍÆ¤¬¼°¤â¤·¤¯¤Ïʸ¤Ç¤¢¤ê»ÈÍѤµ¤ì¤Æ¤¤¤ë¼±Ê̻Ҥ¬¤¹¤Ù¤ÆÀë¸ÀºÑ¤ß¤Î¾ì¹ç¤Ë¤Î¤ß¡¢¥Þ¥¯¥í̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£ @end table @c COMMON @end deffn @deffn {Macro} c-load file-or-list &keyword @c EN Loads libraries, parses header files and defines functions, global variables, constants, type definitions and macros in current module. This macro does @code{c-load-library} and @code{c-include} at once. @c JP »ØÄꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤È¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¡¢´Ø¿ô¡¦¥°¥í¡¼¥Ð¥ëÊÑ¿ô¡¦Äê¿ô¡¦·¿ÄêµÁ¡¦¥Þ¥¯¥í¤ò¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤·¤Þ¤¹¡£ @code{c-load-library}¤È@code{c-include}¤ò°ìÅ٤˹Ԥ¦¤â¤Î¤Ç¤¹¡£ @c COMMON @c EN Keyword arguments are: @c JP keyword °ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @table @code @item :cflags @itemx :cppflags @itemx :ldflags @itemx :libs @c EN Sets up flags for parsing header files and loading libraries, @code{:cppflags} is passed to the preprocessor and @code{:ldflags} and @code{:libs} are used for loading libraries. cwcompile uses these flags, too. @c JP ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤È¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¤Ç»È¤¦¤¿¤á¤Î³Æ¼ï¥Õ¥é¥°¤ò»ØÄꤷ¤Þ¤¹¡£@code{:cppflags}¤Ï¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÅϤµ¤ì¡¢@code{:ldflags}, @code{:libs}¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î¥Õ¥é¥°¤Ïcwcompile¤Ç¤â»È¤ï¤ì¤Þ¤¹¡£ @c COMMON @item :cflags-cmd @itemx :cppflags-cmd @itemx :ldflags-cmd @itemx :libs-cmd @c EN Sets up commands which returns the flags. For example, if you want to parse gtk's header file, you can do the following: @c JP ³Æ¼ï¥Õ¥é¥°¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Î¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡£Î㤨¤Ð¡¢gtk¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ë¤È¤­¤Ëpkg-config¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @example (c-load "gtk/gtk/h" :cppflags-cmd "pkg-config gtk+-2.0 --cflags-only-I" :cflags-cmd "pkg-config gtk+-2.0 --cflags-only-other" :libs-cmd "pkg-config gtk+-2.0 --libs" :compiled-lib "gtklib") @end example @item :import @c EN Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them. If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns @code{#f}, the symbol is ignored, and the symbol is defined otherwise. @c JP ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤à¥·¥ó¥Ü¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¤È¤·¤Æ¡¢¥·¥ó¥Ü¥ë¡¢Ê¸»úÎó¡¢Àµµ¬É½¸½¡¢¼ê³¤­¤È¡¢¤½¤ì¤é¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£ ¼ê³¤­¤¬ÅϤµ¤ì¤¿¾ì¹ç¤Ï¡¢¥·¥ó¥Ü¥ë¤¬¸«¤Ä¤«¤ë¤¿¤Ó¤Ë¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤È¥·¥ó¥Ü¥ë̾¤ò°ú¿ô¤È¤·¤Æ¡¢¤½¤Î¼ê³¤­¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ ¼ê³¤­¤¬@code{#f}¤òÊÖ¤·¤¿¾ì¹ç¤½¤Î¥·¥ó¥Ü¥ë¤Ï̵»ë¤µ¤ì¡¢¤½¤ì°Ê³°¤ÎÃͤξì¹ç¤Ë¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£ @c COMMON @item :hide-symbols @c EN Specifies symbols which doesn't export to other module. These symbols are defined internally, so you can lookup them with @code{c-symbol}. @c JP ³°Éô¤Ë¸ø³«¤·¤Ê¤¤¥·¥ó¥Ü¥ë¤ò¥ê¥¹¥È¤Ç»ØÄꤷ¤Þ¤¹¡£ÄêµÁ¤ÏÆâÉôŪ¤Ë¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢@code{c-symbol}¤Ç»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @item :compiled-lib @c EN Sets up a shared library file name which cwcompile command generates. At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files. @c JP cwcompile¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤µ¤ì¤ë¥Ñ¡¼¥ººÑ¤ß¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î̾Á°¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ëÂå¤ï¤ê¤Ë¤½¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤¬¹Ô¤ï¤ì¤Þ¤¹¡£ @c COMMON @item :module @c EN Controlls a sandbox module for C object. You can specify @code{#t}, @code{#f} or a module. @code{#t} means that @code{c-load} makes its original sandbox module and import it. This is the default behavior. @code{#f} means that @code{c-load} defines symbols in current module. a module means that @code{c-load} defines symbols in the specified module and doesn't import it. @c JP C¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥ó¥É¥Ü¥Ã¥¯¥¹¥â¥¸¥å¡¼¥ë¤òÀ©¸æ¤·¤Þ¤¹¡£°ú¿ô¤È¤·¤Æ¡¢@code{#t}¡¢@code{#f}¡¢¥â¥¸¥å¡¼¥ë¤¬»ØÄê²Äǽ¤Ç¤¹¡£ @code{#t}¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢@code{c-load}¤ò¼Â¹Ô¤¹¤ë¤¿¤Ó¤Ë¥µ¥ó¥É¥Ü¥Ã¥¯¥¹¥â¥¸¥å¡¼¥ë¤¬ºîÀ®¤µ¤ì¡¢¤½¤ÎÃæ¤ËC¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£¤½¤·¤Æ¡¢¼«Æ°Åª¤Ë¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤Ø¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤Þ¤¹¡£¤³¤ì¤¬¡¢¥Ç¥Õ¥©¥ë¥È¤Îưºî¤Ç¤¹¡£ @code{#f}¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢C¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤µ¤ì¤Þ¤¹¡£ ¥â¥¸¥å¡¼¥ë¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢C¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï»ØÄꤵ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¡¢@code{c-load}¤Ç¤Ï¡¢¥¤¥ó¥Ý¡¼¥È¤ò¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ @c COMMON @end table @c COMMON @end deffn @node Classes and function about C types and values, , Load a header file, c-wrapper @comment node-name, next, previous, up @section Classes and functions about C types @deftp {Class} @c EN This is a basic class for the classes related with C types. @c JP C¤Î·¿¤ËÂбþ¤·¤¿¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deftp {Class} @c EN This is a meta class for the classes related with C types. All the classes are instances of @code{}. @c JP C¤Î·¿¤ËÂбþ¤·¤¿¥¯¥é¥¹¤Î¥á¥¿¥¯¥é¥¹¤Ç¤¹¡£C¤Î·¿¤Î¥¯¥é¥¹¤Ï¤¹¤Ù¤Æ @code{} ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤È¤Ê¤ê¤Þ¤¹¡£ @c COMMON @end deftp @deftp {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @deftpx {Class} @clindex c-char @clindex c-uchar @clindex c-short @clindex c-ushort @clindex c-int @clindex c-uint @clindex c-long @clindex c-ulong @clindex c-longlong @clindex c-ulonglong @clindex c-float @clindex c-double @c EN These are classes for arithmetic types in C. you can use @code{make} to make an instance of the class. @c JP C¸À¸ì¤Î»»½Ñ·¿ (Arithmetic types) ¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Ç¤¹¡£ @code{make} ¤ò»È¤Ã¤Æ¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @end deftp @deftp {Class} @clindex c-value-meta @c EN This is a meta class for the classes related with C arithmetic types. @c JP C¸À¸ì¤Î»»½Ñ·¿ (Arithmetic types) ¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Î¥á¥¿¥¯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deffn {Method} ref (obj ) @c EN Returns the value of @var{obj}. @c JP @var{obj} ¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} (setter ref) (obj ) value @c EN Sets @var{value} to @var{obj}. @c JP @var{obj} ¤ËÃÍ @var{value} ¤òÀßÄꤷ¤Þ¤¹¡£ @c COMMON @end deffn @deftp {Class} @c EN This is a class for void type in C. @c JP C¸À¸ì¤Î void ·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deftp {Class} @c EN This is an abstract class for pointer type in C. If you use a pointer type, make a concrete class with @code{ptr}. @c JP C¸À¸ì¤Î¥Ý¥¤¥ó¥¿·¿¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£¼ÂºÝ¤Ë¥Ý¥¤¥ó¥¿·¿¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¸å½Ò¤¹¤ë @code{ptr} ¤ò»ÈÍѤ·¤Æ @code{} ¤Î¶ñ¾Ý¥¯¥é¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ @c COMMON @end deftp @deffn {Method} ptr (class ) @c EN Makes a class for a pointer type of @var{class}, and it is a subclass of @code{}. You can use @code{make} to make an instance of the class. @c JP @var{class} ¤Ç»ØÄꤵ¤ì¤¿·¿¤Î¥Ý¥¤¥ó¥¿·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï @code{} ¤Î¥µ¥Ö¥¯¥é¥¹¤È¤Ê¤ê¤Þ¤¹¡£@code{make} ¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} ptr (obj ) @c EN Returns a pointer object for @var{obj}. @c JP @var{obj} ¤Î¥Ý¥¤¥ó¥¿¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deftp {Class} @c EN This is an abstract class for array type in C. If you use an array type, make a concrete class with @code{c-array}. @code{} is a subclass of @code{}, and you can use the operations of sequence framework (@code{gauche.sequence} module). @c JP C¸À¸ì¤ÎÇÛÎó¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£¼ÂºÝ¤ËÇÛÎó¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¸å½Ò¤¹¤ë @code{c-array} ¤ò»ÈÍѤ·¤Æ¡¢@code{} ¤Î¶ñ¾Ý¥¯¥é¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¤Þ¤¿ @code{} ¤Ï @code{} ¤ò·Ñ¾µ¤·¤Æ¤ª¤ê¡¢¥·¡¼¥±¥ó¥¹¥Õ¥ì¡¼¥à¥ï¡¼¥¯ (@code{gauche.sequence} ¥â¥¸¥å¡¼¥ë) ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÁàºî¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @end deftp @defun c-array (class ) size @c EN Makes a class for an array type of @var{class}, and it is a subclass of @code{}. You can use @code{make} to make an instance of the class. @c JP @var{class} ·¿¤ÇÂ礭¤µ @var{size} ¤ÎÇÛÎ󥯥饹¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï @code{} ¤Î¥µ¥Ö¥¯¥é¥¹¤È¤Ê¤ê¤Þ¤¹¡£@code{make} ¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @c COMMON @end defun @deftp {Class} @c EN This is an abstract class for struct type in C. @c JP C¸À¸ì¤Î¹½Â¤ÂΤËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deftp {Class} @c EN This is an abstract class for union type in C. @c JP C¸À¸ì¤Î¶¦ÍÑÂΤËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deffn {Macro} c-struct tagname @c EN Returns the struct class named @var{tagname}. @c JP @var{tagname}¤È¤¤¤¦Ì¾Á°¤Î¹½Â¤ÂÎ¥¯¥é¥¹¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Macro} c-union tagname @c EN Returns the union class named @var{tagname}. @c JP @var{tagname}¤È¤¤¤¦Ì¾Á°¤Î¶¦ÍÑÂÎ¥¯¥é¥¹¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} ref (obj ) member @deffnx {Method} ref (obj ) member @c EN Returns the value of the @var{member} of the struct or union @var{obj}. If the type of the member is arithmetic type, the type of the return value is casted to @code{} or @code{}. @c JP ¹½Â¤ÂΤ⤷¤¯¤Ï¶¦ÍÑÂΤΥá¥ó¥Ð @var{member} ¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£¥á¥ó¥Ð¤¬»»½Ñ·¿ (Arithmetic types) ¤Î¾ì¹ç¤Ï @code{} ¤â¤·¤¯¤Ï @code{} ¤ØÊÑ´¹¤µ¤ì¤¿Ãͤ¬ÊÖ¤ê¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} (setter ref) (obj ) member value @deffnx {Method} (setter ref) (obj ) member value @c EN Sets @var{value} to the @var{member} of the struct or union @var{obj}. @c JP ¹½Â¤ÂΤ⤷¤¯¤Ï¶¦ÍÑÂΤΥá¥ó¥Ð @var{member} ¤ØÃͤò¥»¥Ã¥È¤·¤Þ¤¹¡£ @c COMMON @end deffn @deftp {Class} @c EN This is an abstract class for function pointer in C. @c JP C¸À¸ì¤Î´Ø¿ô¥Ý¥¤¥ó¥¿¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£ @c COMMON @end deftp @deffn {Method} deref ptrobj @c EN Returns a deference object of @var{ptrobj}. ('*' operator in C) @c JP ¥Ý¥¤¥ó¥¿¥ª¥Ö¥¸¥§¥¯¥È @var{ptrobj} ¤Î»²¾È¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} c-sizeof (class ) @deffnx {Method} c-sizeof (obj ) @c EN Returns a size of @var{class} or @var{obj}. @c JP @var{class}¤â¤·¤¯¤Ï@var{obj}¤Î¥µ¥¤¥º¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Method} cast class obj @c EN Makes an instance of @var{class} from @var{obj}. The following rules are applied to make an instance. @multitable @columnfractions 0.2 0.2 0.6 @item @var{class} @tab Type of @var{obj} @tab Description @item Subclasses of @code{} @tab @code{} @tab Makes an instance of @var{class} which is the same value of @var{obj}. @item Subclasses of @code{} @tab @code{} @tab Makes an instance of @var{class} which is 1 (if @var{obj} is @code{#t}) or 0 (if @var{obj} is @code{#f}). @item @code{} or @code{} @tab @code{} @tab Makes a pointer object whose address is @var{obj}. @item @code{} or @code{} @tab @code{} or @code{} @tab Makes a pointer object whose address is the same of @var{obj}. @item @code{} or @code{} @tab @code{} @tab Makes a pointer object whose address is the same of the first address of @var{obj}. @item @code{} @tab @code{} @tab Makes a pointer object whose address points an internally-generated C string. @item @code{} @tab @code{} @tab Makes a pointer object whose address points the buffer of @code{}. @item @code{} @tab @code{} @tab Makes a pointer object whost address points an internally-generated array which contains the same elements of @var{obj}. @item @code{} @tab @code{} @tab Makes an array which contains the same elements of @var{obj}. @item @code{} @tab @code{} @tab Makes an array object whose first address is @var{obj}. @item @code{} @tab @code{} @tab Makes a pointer of a function which executes calls the procedure @var{obj}. @item @code{} or @code{} @tab @code{} @tab Makes the value of @var{obj}. @item @code{} @tab @code{} or @code{} @tab Makes #f if the value of @var{obj} is 0, #t otherwise. @item @code{} @tab @code{} or @code{} @tab Makes the pointer address of @var{obj}. @item @code{} @tab @code{} @tab Makes the first address of the array @var{obj}. @item @code{} @tab @code{} or @code{} @tab Makes a string from the address of @var{obj}. @item @code{} @tab @code{} @tab Makes a string from the array @var{obj}. It must be 0 terminated string. @item @code{} @tab @code{} @tab Makes an instance of @var{class} which contains the same values of @var{obj}, which are casted with @code{scm-cast}. @end multitable @c JP @var{obj} ¤«¤é @var{class} ·¿¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£À¸À®¤Î¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ @multitable @columnfractions 0.2 0.2 0.6 @item @var{class} @tab @var{obj}¤Î·¿ @tab ÀâÌÀ @item @code{} ¤ò·Ñ¾µ¤·¤¿¥¯¥é¥¹ @tab @code{} @tab @var{obj} ¤ÈƱ¤¸Ãͤò»ý¤Ä @var{class} ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹ @item @code{} ¤ò·Ñ¾µ¤·¤¿¥¯¥é¥¹ @tab @code{} @tab @var{obj} ¤¬ @code{#t} ¤Î»þ¤Ï 1¡¢@code{#f} ¤Î»þ¤Ï 0 ¤ÎÃͤò»ý¤Ä @var{class} ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} ¤Þ¤¿¤Ï @code{} @tab @code{} @tab @var{obj} ¤Î¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹ @item @code{} ¤Þ¤¿¤Ï @code{} @tab @code{} ¤Þ¤¿¤Ï @code{} @tab @var{obj} ¤ÈƱ¤¸¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹ @item @code{} ¤Þ¤¿¤Ï @code{} @tab @code{} @tab @var{obj} ¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab C¤Îʸ»úÎó¤òÀ¸À®¤·¡¢¤½¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab @var{obj} ¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab @var{obj} ¤ÈƱ¤¸ÆâÍÆ¤ÎÇÛÎó¤òÀ¸À®¤·¡¢¤½¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab @var{obj} ¤ÈƱ¤¸ÆâÍÆ¤ÎÇÛÎó¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab ¥Ý¥¤¥ó¥¿¤¬»Ø¤¹¥á¥â¥êÎΰè¤òÇÛÎó¤È¸«¤Ê¤·¤Æ @var{class} ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab @var{obj} ¤ò¼Â¹Ô¤¹¤ë´Ø¿ô¤Î¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} ¤Þ¤¿¤Ï @code{} @tab @code{} @tab @var{obj} ¤ÈƱ¤¸ÃͤοôÃͤòÊÖ¤·¤Þ¤¹¡£ @item @code{} @tab @code{} ¤Þ¤¿¤Ï @code{} @tab Ãͤ¬ 0 ¤Î¤È¤­ @code{#f} ¤¬¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @var{#t} ¤¬ÊÖ¤ê¤Þ¤¹¡£ @item @code{} @tab @code{} ¤Þ¤¿¤Ï @code{} @tab ¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤¬ÊÖ¤ê¤Þ¤¹¡£ @item @code{} @tab @code{} @tab ÇÛÎó¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤¬ÊÖ¤ê¤Þ¤¹¡£ @item @code{} @tab @code{} ¤Þ¤¿¤Ï @code{} @tab ¥Ý¥¤¥ó¥¿¤¬»Ø¤·¼¨¤¹Îΰ褬0½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¸«¤Ê¤·¡¢Ê¸»úÎó¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab ÇÛÎó¤ÎÆâÍÆ¤¬0½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¸«¤Ê¤·¡¢Ê¸»úÎó¤òÀ¸À®¤·¤Þ¤¹¡£ @item @code{} @tab @code{} @tab ÇÛÎó¤ÎÆâÍÆ¤ò»ý¤Ä @var{class} ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£³ÆÍ×ÁǤÎÃÍ¤Ï @code{scm-cast} ¤Ç¥­¥ã¥¹¥È¤µ¤ì¤Þ¤¹¡£ @end multitable @c COMMON @end deffn @defun scm-cast obj @c EN Returns the value of @var{obj} if @var{obj} is an instance of @code{}. Otherwise, returns @var{obj}. @c JP @var{obj} ¤¬ @code{} ·¿¤Ç¤¢¤ë»þ¤Ï¿ôÃͤòÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @var{obj} ¤ò¤½¤Î¤Þ¤ÞÊÖ¤·¤Þ¤¹¡£ @c COMMON @end defun @defun make-null-ptr @c EN Returns NULL pointer. @c JP NULL¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end defun @defun null-ptr? obj @c EN Returns @code{#t} if @var{obj} is a NULL pointer, @code{#f} otherwise. @c JP @var{obj} ¤¬NULL¥Ý¥¤¥ó¥¿¤Ç¤¢¤ì¤Ð @code{#t} ¤¬¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{#f} ¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£ @c COMMON @end defun @defun register-finalizer! ptrobj proc @c EN Register the finalizer @var{proc} to @var{ptrobj}. It is called when @var{ptrobj} is GCed. @c JP @var{ptrobj} ¤Ë¥Õ¥¡¥¤¥Ê¥é¥¤¥¶ @var{proc} ¤òÅÐÏ¿¤·¤Þ¤¹¡£@var{ptrobj} ¤¬GC¤µ¤ì¤ë¤È¤­¤Ë @var{proc} ¤¬¸Æ¤Ð¤ì¤Þ¤¹¡£ @c COMMON @end defun @defun unregister-finalizer! ptrobj @c EN Deletes the finalizer of @var{ptrobj}. @c JP @var{ptrobj} ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤òºï½ü¤·¤Þ¤¹¡£ @c COMMON @end defun @defun finalize! ptrobj @c EN Calls the finalizer of @var{ptrobj}, and deletes it from @var{ptrobj}. @c JP @var{ptrobj} ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê @var{ptrobj} ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£ @c COMMON @end defun @node objc-wrapper, Function and Syntax Index, c-wrapper, Top @comment node-name, next, previous, up @chapter objc-wrapper @c EN @code{objc-wrapper} is the module which enables to use Objective-C libraries. @c JP @code{objc-wrapper} ¤È¤Ï Objective-C ¤Î¥é¥¤¥Ö¥é¥ê¤ò Gauche ¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£ @c COMMON @menu * Load a framework library:: * Load an Objectice-C header file:: * Functions about Objective-C objects:: @end menu @node Load a framework library, Load an Objectice-C header file, objc-wrapper, objc-wrapper @comment node-name, next, previous, up @section Load a framework library @defun c-load-framework framework @c EN Load a framework library @var{framework}. @example (c-load-framework "Foundation") @end example @c JP ¥Õ¥ì¡¼¥à¥ï¡¼¥¯¥é¥¤¥Ö¥é¥ê @var{framework} ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ @example (c-load-framework "Foundation") @end example @c COMMON @end defun @node Load an Objectice-C header file, Functions about Objective-C objects, Load a framework library, objc-wrapper @comment node-name, next, previous, up @section Load an Objective-C header file @defun {Macro} c-include file-or-list &keyword @c EN This extends the @code{c-include} in @code{c-wrapper} module. it defines classes and methods of Objective-C code. If Objective-C class @code{Foo} is defined in the header file, @code{c-include} defines two symbols @code{Foo} and @code{}. @code{Foo} is an instance of @code{} and indicates the Objective-C class @code{Foo}. @code{} is an alias of the type @code{}. @c JP @code{objc-wrapper} ¥â¥¸¥å¡¼¥ë¤Î @code{c-include} ¤Ç¤Ï Objective-C ¤Î¥¯¥é¥¹ÄêµÁ¤ä¥á¥½¥Ã¥ÉÄêµÁ¤Î³ÈÄ¥¤¬¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡£ Objective-C ¤Î¥¯¥é¥¹ @code{Foo} ¤¬¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ @code{Foo} ¤È @code{} ¤Î2¤Ä¤Î¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£@code{Foo} ¤Ï @code{} ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¥¯¥é¥¹ @code{Foo} ¤½¤Î¤â¤Î¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£@code{} ¤Ï @code{} ¤Î¥¨¥¤¥ê¥¢¥¹¤È¤Ê¤ê¤Þ¤¹¡£ @c COMMON @end defun @node Functions about Objective-C objects, , Load an Objectice-C header file, objc-wrapper @comment node-name, next, previous, up @section Functions about Objective-C objects @deffn {Macro} define-objc-class class-name super-class-name @c EN Defines Objective-C class @var{class-name} whose super class is @var{super-class-name}. @c JP @var{super-class-name}¤ò·Ñ¾µ¤·¤¿Objective-C¤Î¥¯¥é¥¹@var{class-name}¤òÄêµÁ¤·¤Þ¤¹¡£ @c COMMON @end deffn @deffn {Macro} define-objc-method objc-class ret-type (message-keyword varspec ...) body ... @c EN Defines an Objective-C method whose message keyword is @var{message-keyword} and return type is @var{ret-type}. @var{varspec} is a list, (variable-name variable-type). In the body, you can use two variables @var{self} and @var{super}. @var{self} is the receiver object and @var{super} is the object which is casted to its super class. @c JP ¥á¥Ã¥»¡¼¥¸¥­¡¼¥ï¡¼¥É¤¬@var{message-keyword}¤Ç¤¢¤êÌá¤êÃͤη¿¤¬@var{ret-type}¤Ç¤¢¤ë¤è¤¦¤Ê@var{objc-class}¤Î¥á¥½¥Ã¥É¤òÄêµÁ¤·¤Þ¤¹¡£@var{varspec}¤Ï(ÊÑ¿ô̾ ÊÑ¿ô·¿)¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£ @var{body}¤Ç¤Ï@var{self}¤È@var{super}¤Î2¤Ä¤ÎÊÑ¿ô¤¬»È¤¨¤Þ¤¹¡£¤½¤ì¤¾¤ì¡¢¥ì¥·¡¼¥Ð¥ª¥Ö¥¸¥§¥¯¥È¡¢¥ì¥·¡¼¥Ð¤ò¥¹¡¼¥Ñ¥¯¥é¥¹¤Ë¥­¥ã¥¹¥È¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£ @c COMMON @example (define-objc-method MyFooClass [:doSomething (v )] [super :doSomething v] [self :foo v] (bar v) ;; The result of (bar v) is the return value of this method. ) @end example @end deffn @deffn {Method} object-apply (obj ) selector-or-args ... @c EN Calls the method of @var{obj}. @example [[NSString :alloc) :init] [[NSString :startWithCString (@ "Hello, world") :encoding NSASCIIStringEncoding]] @end example @c JP @var{obj} ¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ @example [[NSString :alloc] :init] [[NSString :startWithCString (@ "Hello, world") :encoding NSASCIIStringEncoding]] @end example @c COMMON @end deffn @defun @@ str @c EN Returns Objective-C string. @c JP Objective-Cʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end defun @defun @@selector method-name @c EN Returns a selector of @var{method-name}. @c JP ¥á¥½¥Ã¥É̾ @var{method-name} ¤Î¥»¥ì¥¯¥¿¤òÊÖ¤·¤Þ¤¹¡£ @c COMMON @end defun @node Function and Syntax Index, Class Index, objc-wrapper, Top @comment node-name, next, previous, up @appendix Function and Syntax Index @printindex fn @node Class Index, Variable Index, Function and Syntax Index, Top @comment node-name, next, previous, up @appendix Class Index For readability, the surrounding @code{<} and @code{>} are stripped off. @printindex cl @node Variable Index, , Class Index, Top @comment node-name, next, previous, up @appendix Variable Index @printindex vr @contents @bye @c Local variables: @c outline-regexp: "@chap\\|@unnu\\|@\\(sub\\)*section" @c end: gauche-c-wrapper-0.6.1.orig/doc/c-wrapper-refe.html0000644000000000000000000015302711237307544016765 0ustar c-wrapper reference manual: Top
[Top] [Contents] [Index] [ ? ]

c-wrapper reference manual

This is a reference manual of c-wrapper.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. c-wrapper

c-wrapper is the module which enables to use C libraries.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Load a shared library

Function: c-load-library file-or-list &keyword

Load one or more shared libraries. If you omit the extension, c-wrapper add a extension (.so, .dylib, and so on) automatically.

Keyword arguments are:

:option option-string

Specify library names and library load paths with ld like option.

-llibrary

Load the library named library. For example, -lc means to load 'libc'.

-Ldir

Add directory dir to the library search paths.

Function: c-ld option-string

This function is the same (c-load-library '() :option option-string). and is designed to use with a command returning linker flags like pkg-config.

 
(c-ld (process-output->string "pkg-config Wand --libs"))

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Load a header file

Macro: c-include file-or-list &keyword

Load one or more header files and define functions, global variables, constants , type definitions and macros in the current module. Keyword arguments are:

:include-dirs

Sets up include directories. You can specify either a string file name or a list of string file names.

:option

Sets up C preprocessor options.

:import

Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them. If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns #f, the symbol is ignored, and the symbol is defined otherwise.

:export?

Specifies whether symbols in header files are exported or not. If you put #t, the symbols are exported automatically, and otherwise they are not exported.

:compiled-lib

Sets up a shared library file name which cwcompile command generates. At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files.

In loading header files, c-include gets these information and defines symbols.

Function prototype

Defines a function with the same name. It applies cast to its arguments and scm-cast to its return value.

External variable

Defines an object with the same name.

enum

Defines a constant value with the same name.

struct

Defines a struct class. You can use it with (c-struct tagname).

union

Defines a union class. You can use it with (c-union tagname).

typedef

Defines a class with the name <typename>.

Objectlike macro

Defines a value with the same name if the macro body is an expression, all identifiers in the body have been defined and the expression has no side-effect.

You have to be careful to use the value because it is the header-load-time value, not macro-use-time value. It may be different from one you expected.

Functionlike macro

Defines a macro with the same name if the macro body is an expression or statements and all identifiers in the body have been defined.

Macro: c-load file-or-list &keyword

Loads libraries, parses header files and defines functions, global variables, constants, type definitions and macros in current module. This macro does c-load-library and c-include at once.

Keyword arguments are:

:cflags
:cppflags
:ldflags
:libs

Sets up flags for parsing header files and loading libraries, :cppflags is passed to the preprocessor and :ldflags and :libs are used for loading libraries. cwcompile uses these flags, too.

:cflags-cmd
:cppflags-cmd
:ldflags-cmd
:libs-cmd

Sets up commands which returns the flags. For example, if you want to parse gtk's header file, you can do the following:

 
(c-load "gtk/gtk/h"
        :cppflags-cmd "pkg-config gtk+-2.0 --cflags-only-I"
        :cflags-cmd   "pkg-config gtk+-2.0 --cflags-only-other"
        :libs-cmd     "pkg-config gtk+-2.0 --libs"
        :compiled-lib "gtklib")
:import

Sets up symbols which you want to define. You can specify a symbol, a string, a regexp, a procedure or a list of them. If you put a procedure, it is called with two arguments, a header file name and a symbol. When the procedure returns #f, the symbol is ignored, and the symbol is defined otherwise.

:export?

Specifies whether symbols in header files are exported or not. If you put #t, the symbols are exported automatically, and otherwise they are not exported.

:compiled-lib

Sets up a shared library file name which cwcompile command generates. At runtime, if the library is exists, loads it instead of parsing the header files. Otherwise, parses the header files.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Classes and functions about C types

Class: <c-type>

This is a basic class for the classes related with C types.

Class: <c-type-meta>

This is a meta class for the classes related with C types. All the classes are instances of <c-type-meta>.

Class: <c-char>
Class: <c-uchar>
Class: <c-short>
Class: <c-ushort>
Class: <c-int>
Class: <c-uint>
Class: <c-long>
Class: <c-ulong>
Class: <c-longlong>
Class: <c-ulonglong>
Class: <c-float>
Class: <c-double>

These are classes for arithmetic types in C. you can use make to make an instance of the class.

Class: <c-value-meta>

This is a meta class for the classes related with C arithmetic types.

Method: ref (obj <c-value-meta>)

Returns the value of obj.

Method: (setter ref) (obj <c-value-meta>) value

Sets value to obj.

Class: <c-void>

This is a class for void type in C.

Class: <c-ptr>

This is an abstract class for pointer type in C. If you use a pointer type, make a concrete class with ptr.

Method: ptr (class <c-type-meta>)

Makes a class for a pointer type of class, and it is a subclass of <c-ptr>. You can use make to make an instance of the class.

Method: ptr (obj <c-type>)

Returns a pointer object for obj.

Class: <c-array>

This is an abstract class for array type in C. If you use an array type, make a concrete class with c-array.

<c-array> is a subclass of <sequence>, and you can use the operations of sequence framework (gauche.sequence module).

Function: c-array (class <c-type-meta>) size

Makes a class for an array type of class, and it is a subclass of <c-array>. You can use make to make an instance of the class.

Class: <c-struct>

This is an abstract class for struct type in C.

Class: <c-union>

This is an abstract class for union type in C.

Macro: c-struct tagname

Returns the struct class named tagname.

Macro: c-union tagname

Returns the union class named tagname.

Method: ref (obj <c-struct>) member
Method: ref (obj <c-union>) member

Returns the value of the member of the struct or union obj. If the type of the member is arithmetic type, the type of the return value is casted to <real> or <integer>.

Method: (setter ref) (obj <c-struct>) member value
Method: (setter ref) (obj <c-union>) member value

Sets value to the member of the struct or union obj.

Class: <c-func-ptr>

This is an abstract class for function pointer in C.

Method: deref ptrobj

Returns a deference object of ptrobj. ('*' operator in C)

Method: c-sizeof (class <c-type-meta>)
Method: c-sizeof (obj <c-type>)

Returns a size of class or obj.

Method: cast class obj

Makes an instance of class from obj. The following rules are applied to make an instance.

class

Type of obj

Description

Subclasses of <c-value>

<real>

Makes an instance of class which is the same value of obj.

Subclasses of <c-value>

<boolean>

Makes an instance of class which is 1 (if obj is #t) or 0 (if obj is #f).

<c-ptr> or <c-func-ptr>

<integer>

Makes a pointer object whose address is obj.

<c-ptr> or <c-func-ptr>

<c-ptr> or <c-func-ptr>

Makes a pointer object whose address is the same of obj.

<c-ptr> or <c-func-ptr>

<c-array>

Makes a pointer object whose address is the same of the first address of obj.

<c-ptr>

<string>

Makes a pointer object whose address points an internally-generated C string.

<c-ptr>

<uvector>

Makes a pointer object whose address points the buffer of <uvector>.

<c-ptr>

<sequence>

Makes a pointer object whost address points an internally-generated array which contains the same elements of obj.

<c-array>

<sequence>

Makes an array which contains the same elements of obj.

<c-array>

<c-ptr>

Makes an array object whose first address is obj.

<c-func-ptr>

<procedure>

Makes a pointer of a function which executes calls the procedure obj.

<integer> or <real>

<c-value>

Makes the value of obj.

<boolean>

<c-value> or <real>

Makes #f if the value of obj is 0, #t otherwise.

<integer>

<c-ptr> or <c-func-ptr>

Makes the pointer address of obj.

<integer>

<c-array>

Makes the first address of the array obj.

<string>

<c-ptr> or <c-func-ptr>

Makes a string from the address of obj.

<string>

<c-array>

Makes a string from the array obj. It must be 0 terminated string.

<collection>

<c-array>

Makes an instance of class which contains the same values of obj, which are casted with scm-cast.

Function: scm-cast obj

Returns the value of obj if obj is an instance of <c-value>. Otherwise, returns obj.

Function: make-null-ptr

Returns NULL pointer.

Function: null-ptr? obj

Returns #t if obj is a NULL pointer, #f otherwise.

Function: register-finalizer! ptrobj proc

Register the finalizer proc to ptrobj. It is called when ptrobj is GCed.

Function: unregister-finalizer! ptrobj

Deletes the finalizer of ptrobj.

Function: finalize! ptrobj

Calls the finalizer of ptrobj, and deletes it from ptrobj.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. objc-wrapper

objc-wrapper is the module which enables to use Objective-C libraries.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Load a framework library

Function: c-load-framework framework

Load a framework library framework.

 
(c-load-framework "Foundation")

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Load an Objective-C header file

Function: Macro c-include file-or-list &keyword

This extends the c-include in c-wrapper module. it defines classes and methods of Objective-C code.

If Objective-C class Foo is defined in the header file, c-include defines two symbols Foo and <Foo>. Foo is an instance of <c-struct:objc_object> and indicates the Objective-C class Foo. <Foo> is an alias of the type <id>.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Functions about Objective-C objects

Macro: define-objc-class class-name super-class-name

Defines Objective-C class class-name whose super class is super-class-name.

Macro: define-objc-method objc-class ret-type (message-keyword varspec ...) body ...

Defines an Objective-C method whose message keyword is message-keyword and return type is ret-type. varspec is a list, (variable-name variable-type).

In the body, you can use two variables self and super. self is the receiver object and super is the object which is casted to its super class.

 
(define-objc-method MyFooClass <id> [:doSomething (v <c-int>)]
  [super :doSomething v]
  [self :foo v]
  (bar v) ;; The result of (bar v) is the return value of this method.
  )
Method: object-apply (obj <c-struct:objc_object>) selector-or-args ...

Calls the method of obj.

 
[[NSString :alloc) :init]

[[NSString :startWithCString ( "Hello, world") :encoding NSASCIIStringEncoding]]
Function: @ str

Returns Objective-C string.

Function: @selector method-name

Returns a selector of method-name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A. Function and Syntax Index

Jump to:   (   @  
C   D   F   M   N   O   P   R   S   U  
Index Entry Section

(
(setter1.3 Classes and functions about C types
(setter1.3 Classes and functions about C types
(setter1.3 Classes and functions about C types

@
@2.3 Functions about Objective-C objects
@selector2.3 Functions about Objective-C objects

C
c-array1.3 Classes and functions about C types
c-include1.2 Load a header file
c-ld1.1 Load a shared library
c-load1.2 Load a header file
c-load-framework2.1 Load a framework library
c-load-library1.1 Load a shared library
c-sizeof1.3 Classes and functions about C types
c-sizeof1.3 Classes and functions about C types
c-struct1.3 Classes and functions about C types
c-union1.3 Classes and functions about C types
cast1.3 Classes and functions about C types

D
define-objc-class2.3 Functions about Objective-C objects
define-objc-method2.3 Functions about Objective-C objects
deref1.3 Classes and functions about C types

F
finalize!1.3 Classes and functions about C types

M
Macro2.2 Load an Objective-C header file
make-null-ptr1.3 Classes and functions about C types

N
null-ptr?1.3 Classes and functions about C types

O
object-apply2.3 Functions about Objective-C objects

P
ptr1.3 Classes and functions about C types
ptr1.3 Classes and functions about C types

R
ref1.3 Classes and functions about C types
ref1.3 Classes and functions about C types
ref1.3 Classes and functions about C types
register-finalizer!1.3 Classes and functions about C types

S
scm-cast1.3 Classes and functions about C types

U
unregister-finalizer!1.3 Classes and functions about C types

Jump to:   (   @  
C   D   F   M   N   O   P   R   S   U  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B. Class Index

For readability, the surrounding < and > are stripped off.

Jump to:   C  
Index Entry Section

C
c-char1.3 Classes and functions about C types
c-double1.3 Classes and functions about C types
c-float1.3 Classes and functions about C types
c-int1.3 Classes and functions about C types
c-long1.3 Classes and functions about C types
c-longlong1.3 Classes and functions about C types
c-short1.3 Classes and functions about C types
c-uchar1.3 Classes and functions about C types
c-uint1.3 Classes and functions about C types
c-ulong1.3 Classes and functions about C types
c-ulonglong1.3 Classes and functions about C types
c-ushort1.3 Classes and functions about C types
c-value-meta1.3 Classes and functions about C types

Jump to:   C  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C. Variable Index


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated by KOGURO, Naoki on December, 26 2006 using texi2html 1.76.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack beginning of this chapter or previous chapter 1
[ Up ] Up up section 1.2
[ >> ] FastForward next chapter 2
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index index  
[ ? ] About about (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

  • 1. Section One
    • 1.1 Subsection One-One
      • ...
    • 1.2 Subsection One-Two
      • 1.2.1 Subsubsection One-Two-One
      • 1.2.2 Subsubsection One-Two-Two
      • 1.2.3 Subsubsection One-Two-Three     <== Current Position
      • 1.2.4 Subsubsection One-Two-Four
    • 1.3 Subsection One-Three
      • ...
    • 1.4 Subsection One-Four

This document was generated by KOGURO, Naoki on December, 26 2006 using texi2html 1.76.

gauche-c-wrapper-0.6.1.orig/doc/c-wrapper-refj.html0000644000000000000000000015434511237307544016776 0ustar c-wrapper ¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë: Top
[Top] [Contents] [Index] [ ? ]

c-wrapper ¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë

Ëܥɥ­¥å¥á¥ó¥È¤Ïc-wrapper¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤Ç¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. c-wrapper

c-wrapper¤È¤Ï¡¢C¤Î¥é¥¤¥Ö¥é¥ê¤òGauche¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Load a shared library

Function: c-load-library file-or-list &keyword

¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ file-or-list ¤Ç¥ê¥¹¥È¤òÅϤ¹¤ÈÊ£¿ô¤Î¥é¥¤¥Ö¥é¥ê¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ ¤Þ¤¿³ÈÄ¥»Ò¤ò¾Êά¤·¤¿¾ì¹ç¡¢´Ä¶­¤Ë±þ¤¸¤¿³ÈÄ¥»Ò (.so ¤ä .dylib ¤Ê¤É ) ¤¬Éղ䵤ì¤Þ¤¹¡£

¥­¡¼¥ï¡¼¥É°ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

:option option-string

ld¤ËÍ¿¤¨¤ë¥ª¥×¥·¥ç¥ó¤Î¤è¤¦¤Ê·Á¼°¤Ç¶¦Í­¥é¥¤¥Ö¥é¥ê¤äÆÉ¤ß¹þ¤ß¥Ñ¥¹¤Î»ØÄê¤ò¹Ô¤¤¤Þ¤¹¡£¸½¾õ»È¤¨¤ë¤Î¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£

-llibrary

¶¦Í­¥é¥¤¥Ö¥é¥ê library ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£Î㤨¤Ð¡¢-lc ¤Î¤è¤¦¤Ë»ØÄꤹ¤ë¤È libc ¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£

-Ldir

¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¥µ¡¼¥Á¥ê¥¹¥È¤Ë¥Ç¥£¥ì¥¯¥È¥ê dir ¤òÄɲä·¤Þ¤¹¡£

Function: c-ld option-string

(c-load-library '() :option option-string) ¤ÈƱ¤¸¤Ç¤¹¡£¤³¤Î´Ø¿ô¤Ï pkg-config ¤Ê¤É¤Î¤è¤¦¤Ê¥ê¥ó¥«¤Î¥Õ¥é¥°¤òÊÖ¤¹¥³¥Þ¥ó¥É¤ÈÁȤ߹ç¤ï¤»¤Æ»È¤¦¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£

 
(c-ld (process-output->string "pkg-config Wand --libs"))

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 Load a header file

Macro: c-include file-or-list &keyword

»ØÄꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß¡¢´Ø¿ô¡¦¥°¥í¡¼¥Ð¥ëÊÑ¿ô¡¦Äê¿ô¡¦·¿ÄêµÁ¡¦¥Þ¥¯¥í¤ò¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤·¤Þ¤¹¡£

keyword °ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

:include-dirs

¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£Ê¸»úÎó¤â¤·¤¯¤Ïʸ»úÎó¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£

:option

C¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÅϤ¹¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ê¸»úÎ󤬻ØÄê²Äǽ¤Ç¤¹¡£

:import

¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤à¥·¥ó¥Ü¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¤È¤·¤Æ¡¢¥·¥ó¥Ü¥ë¡¢Ê¸»úÎó¡¢Àµµ¬É½¸½¡¢¼ê³¤­¤È¡¢¤½¤ì¤é¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£ ¼ê³¤­¤¬ÅϤµ¤ì¤¿¾ì¹ç¤Ï¡¢¥·¥ó¥Ü¥ë¤¬¸«¤Ä¤«¤ë¤¿¤Ó¤Ë¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤È¥·¥ó¥Ü¥ë̾¤ò°ú¿ô¤È¤·¤Æ¡¢¤½¤Î¼ê³¤­¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ ¼ê³¤­¤¬#f¤òÊÖ¤·¤¿¾ì¹ç¤½¤Î¥·¥ó¥Ü¥ë¤Ï̵»ë¤µ¤ì¡¢¤½¤ì°Ê³°¤ÎÃͤξì¹ç¤Ë¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£

:export?

ÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤òexport¤¹¤ë¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£ #t¤Î¾ì¹ç¤ÏÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤ËÂФ·¼«Æ°Åª¤Ëexport¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£#f¤Î¾ì¹ç¤Ï²¿¤â¤·¤Þ¤»¤ó¡£

:compiled-lib

cwcompile¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤µ¤ì¤ë¥Ñ¡¼¥ººÑ¤ß¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î̾Á°¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ëÂå¤ï¤ê¤Ë¤½¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤¬¹Ô¤ï¤ì¤Þ¤¹¡£

¥Ø¥Ã¥À¥Õ¥¡¥¤¥ëÆÉ¤ß¹þ¤ß»þ¤Ë¡¢°Ê²¼¤Î¾ðÊó¤ò¼ý½¸¤·´Ø¿ô¤äÊÑ¿ô¤Ê¤É¤òÄêµÁ¤·¤Æ¤¤¤­¤Þ¤¹¡£

´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×Àë¸À

´Ø¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¤³¤Î´Ø¿ô¤Ï°ú¿ô¤ËÂФ·¤Æcast¤òÌá¤êÃͤËÂФ·¤Æscm-cast¤òŬÍѤ·¤Þ¤¹¡£

³°ÉôÊÑ¿ôÄêµÁ

ÊÑ¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç³°ÉôÊÑ¿ô¤ò»²¾È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£

enum

Äê¿ô̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤ÇÄê¿ô¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£

struct

¹½Â¤ÂΤΥ¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï(c-struct tagname)¤Ç»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

union

¶¦ÍÑÂΤΥ¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï(c-union tagname)¤Ç»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

typedef

<typename>¤È¤¤¤¦¥·¥ó¥Ü¥ë¤ÇC¤Î·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤òÄêµÁ¤·¤Þ¤¹¡£

¥ª¥Ö¥¸¥§¥¯¥È·Á¼° (objectlike) ¤Î¥Þ¥¯¥í

¥Þ¥¯¥í¤ÎÆâÍÆ¤¬¼°¤Ç¤¢¤ê¡¢»ÈÍѤµ¤ì¤Æ¤¤¤ë¼±Ê̻Ҥ¬¤¹¤Ù¤ÆÀë¸ÀºÑ¤ß¤Ç¤¢¤ê¡¢¤«¤ÄÉûºîÍѤòµÚ¤Ü¤¹¼°¤Ç¤Ê¤¤¾ì¹ç¤Ë¡¢¥Þ¥¯¥í̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤ÇÃͤ¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¡¢C¸À¸ì¤Ç¤Î¥Þ¥¯¥í¤È¤Ï°ÕÌ£¤¬°Û¤Ê¤ê¡¢¤³¤ÎÃͤϥإåÀ¥Õ¥¡¥¤¥ëÆÉ¤ß¹þ¤ß»þÅÀ¤Ç¤ÎÃͤǤ¢¤ê¡¢¥Þ¥¯¥í»ÈÍÑ»þÅÀ¤Ç¤ÎÃͤǤϤ¢¤ê¤Þ¤»¤ó¡£

´Ø¿ô·Á¼° (functionlike) ¤Î¥Þ¥¯¥í

¥Þ¥¯¥í¤ÎÆâÍÆ¤¬¼°¤â¤·¤¯¤Ïʸ¤Ç¤¢¤ê»ÈÍѤµ¤ì¤Æ¤¤¤ë¼±Ê̻Ҥ¬¤¹¤Ù¤ÆÀë¸ÀºÑ¤ß¤Î¾ì¹ç¤Ë¤Î¤ß¡¢¥Þ¥¯¥í̾¤ÈƱ̾¤Î¥·¥ó¥Ü¥ë¤Ç¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£

Macro: c-load file-or-list &keyword

»ØÄꤵ¤ì¤¿¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤È¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¡¢´Ø¿ô¡¦¥°¥í¡¼¥Ð¥ëÊÑ¿ô¡¦Äê¿ô¡¦·¿ÄêµÁ¡¦¥Þ¥¯¥í¤ò¥«¥ì¥ó¥È¥â¥¸¥å¡¼¥ë¤ËÄêµÁ¤·¤Þ¤¹¡£ c-load-library¤Èc-include¤ò°ìÅ٤˹Ԥ¦¤â¤Î¤Ç¤¹¡£

keyword °ú¿ô¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

:cflags
:cppflags
:ldflags
:libs

¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤È¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¤Ç»È¤¦¤¿¤á¤Î³Æ¼ï¥Õ¥é¥°¤ò»ØÄꤷ¤Þ¤¹¡£:cppflags¤Ï¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÅϤµ¤ì¡¢:ldflags, :libs¤Ï¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î¥Õ¥é¥°¤Ïcwcompile¤Ç¤â»È¤ï¤ì¤Þ¤¹¡£

:cflags-cmd
:cppflags-cmd
:ldflags-cmd
:libs-cmd

³Æ¼ï¥Õ¥é¥°¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Î¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡£Î㤨¤Ð¡¢gtk¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ë¤È¤­¤Ëpkg-config¤ò»È¤Ã¤Æ°Ê²¼¤Î¤è¤¦¤Ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

 
(c-load "gtk/gtk/h"
        :cppflags-cmd "pkg-config gtk+-2.0 --cflags-only-I"
        :cflags-cmd   "pkg-config gtk+-2.0 --cflags-only-other"
        :libs-cmd     "pkg-config gtk+-2.0 --libs"
        :compiled-lib "gtklib")
:import

¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤à¥·¥ó¥Ü¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¤È¤·¤Æ¡¢¥·¥ó¥Ü¥ë¡¢Ê¸»úÎó¡¢Àµµ¬É½¸½¡¢¼ê³¤­¤È¡¢¤½¤ì¤é¤Î¥ê¥¹¥È¤¬»ØÄê²Äǽ¤Ç¤¹¡£ ¼ê³¤­¤¬ÅϤµ¤ì¤¿¾ì¹ç¤Ï¡¢¥·¥ó¥Ü¥ë¤¬¸«¤Ä¤«¤ë¤¿¤Ó¤Ë¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹Ì¾¤È¥·¥ó¥Ü¥ë̾¤ò°ú¿ô¤È¤·¤Æ¡¢¤½¤Î¼ê³¤­¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ ¼ê³¤­¤¬#f¤òÊÖ¤·¤¿¾ì¹ç¤½¤Î¥·¥ó¥Ü¥ë¤Ï̵»ë¤µ¤ì¡¢¤½¤ì°Ê³°¤ÎÃͤξì¹ç¤Ë¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£

:export?

ÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤òexport¤¹¤ë¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£ #t¤Î¾ì¹ç¤ÏÄêµÁ¤·¤¿¥·¥ó¥Ü¥ë¤ËÂФ·¼«Æ°Åª¤Ëexport¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£#f¤Î¾ì¹ç¤Ï²¿¤â¤·¤Þ¤»¤ó¡£

:compiled-lib

cwcompile¥³¥Þ¥ó¥É¤Ë¤è¤êºîÀ®¤µ¤ì¤ë¥Ñ¡¼¥ººÑ¤ß¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î̾Á°¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò¥Ñ¡¼¥º¤¹¤ëÂå¤ï¤ê¤Ë¤½¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£¶¦Í­¥é¥¤¥Ö¥é¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥º¤¬¹Ô¤ï¤ì¤Þ¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Classes and functions about C types

Class: <c-type>

C¤Î·¿¤ËÂбþ¤·¤¿¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¤Ç¤¹¡£

Class: <c-type-meta>

C¤Î·¿¤ËÂбþ¤·¤¿¥¯¥é¥¹¤Î¥á¥¿¥¯¥é¥¹¤Ç¤¹¡£C¤Î·¿¤Î¥¯¥é¥¹¤Ï¤¹¤Ù¤Æ <c-type-meta> ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤È¤Ê¤ê¤Þ¤¹¡£

Class: <c-char>
Class: <c-uchar>
Class: <c-short>
Class: <c-ushort>
Class: <c-int>
Class: <c-uint>
Class: <c-long>
Class: <c-ulong>
Class: <c-longlong>
Class: <c-ulonglong>
Class: <c-float>
Class: <c-double>

C¸À¸ì¤Î»»½Ñ·¿ (Arithmetic types) ¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Ç¤¹¡£ make ¤ò»È¤Ã¤Æ¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

Class: <c-value-meta>

C¸À¸ì¤Î»»½Ñ·¿ (Arithmetic types) ¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Î¥á¥¿¥¯¥é¥¹¤Ç¤¹¡£

Method: ref (obj <c-value-meta>)

obj ¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£

Method: (setter ref) (obj <c-value-meta>) value

obj ¤ËÃÍ value ¤òÀßÄꤷ¤Þ¤¹¡£

Class: <c-void>

C¸À¸ì¤Î void ·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤Ç¤¹¡£

Class: <c-ptr>

C¸À¸ì¤Î¥Ý¥¤¥ó¥¿·¿¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£¼ÂºÝ¤Ë¥Ý¥¤¥ó¥¿·¿¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¸å½Ò¤¹¤ë ptr ¤ò»ÈÍѤ·¤Æ <c-ptr> ¤Î¶ñ¾Ý¥¯¥é¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

Method: ptr (class <c-type-meta>)

class ¤Ç»ØÄꤵ¤ì¤¿·¿¤Î¥Ý¥¤¥ó¥¿·¿¤ËÂбþ¤¹¤ë¥¯¥é¥¹¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï <c-ptr> ¤Î¥µ¥Ö¥¯¥é¥¹¤È¤Ê¤ê¤Þ¤¹¡£make ¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

Method: ptr (obj <c-type>)

obj ¤Î¥Ý¥¤¥ó¥¿¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤·¤Þ¤¹¡£

Class: <c-array>

C¸À¸ì¤ÎÇÛÎó¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£¼ÂºÝ¤ËÇÛÎó¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¸å½Ò¤¹¤ë c-array ¤ò»ÈÍѤ·¤Æ¡¢<c-array> ¤Î¶ñ¾Ý¥¯¥é¥¹¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¤Þ¤¿ <c-array> ¤Ï <sequence> ¤ò·Ñ¾µ¤·¤Æ¤ª¤ê¡¢¥·¡¼¥±¥ó¥¹¥Õ¥ì¡¼¥à¥ï¡¼¥¯ (gauche.sequence ¥â¥¸¥å¡¼¥ë) ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ëÁàºî¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

Function: c-array (class <c-type-meta>) size

class ·¿¤ÇÂ礭¤µ size ¤ÎÇÛÎ󥯥饹¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤Î¥¯¥é¥¹¤Ï <c-array> ¤Î¥µ¥Ö¥¯¥é¥¹¤È¤Ê¤ê¤Þ¤¹¡£make ¤ò»È¤Ã¤ÆºîÀ®¤·¤¿¥¯¥é¥¹¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

Class: <c-struct>

C¸À¸ì¤Î¹½Â¤ÂΤËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£

Class: <c-union>

C¸À¸ì¤Î¶¦ÍÑÂΤËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£

Macro: c-struct tagname

tagname¤È¤¤¤¦Ì¾Á°¤Î¹½Â¤ÂÎ¥¯¥é¥¹¤òÊÖ¤·¤Þ¤¹¡£

Macro: c-union tagname

tagname¤È¤¤¤¦Ì¾Á°¤Î¶¦ÍÑÂÎ¥¯¥é¥¹¤òÊÖ¤·¤Þ¤¹¡£

Method: ref (obj <c-struct>) member
Method: ref (obj <c-union>) member

¹½Â¤ÂΤ⤷¤¯¤Ï¶¦ÍÑÂΤΥá¥ó¥Ð member ¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£¥á¥ó¥Ð¤¬»»½Ñ·¿ (Arithmetic types) ¤Î¾ì¹ç¤Ï <real> ¤â¤·¤¯¤Ï <integer> ¤ØÊÑ´¹¤µ¤ì¤¿Ãͤ¬ÊÖ¤ê¤Þ¤¹¡£

Method: (setter ref) (obj <c-struct>) member value
Method: (setter ref) (obj <c-union>) member value

¹½Â¤ÂΤ⤷¤¯¤Ï¶¦ÍÑÂΤΥá¥ó¥Ð member ¤ØÃͤò¥»¥Ã¥È¤·¤Þ¤¹¡£

Class: <c-func-ptr>

C¸À¸ì¤Î´Ø¿ô¥Ý¥¤¥ó¥¿¤ËÂбþ¤¹¤ëÃê¾Ý¥¯¥é¥¹¤Ç¤¹¡£

Method: deref ptrobj

¥Ý¥¤¥ó¥¿¥ª¥Ö¥¸¥§¥¯¥È ptrobj ¤Î»²¾È¤òÊÖ¤·¤Þ¤¹¡£

Method: c-sizeof (class <c-type-meta>)
Method: c-sizeof (obj <c-type>)

class¤â¤·¤¯¤Ïobj¤Î¥µ¥¤¥º¤òÊÖ¤·¤Þ¤¹¡£

Method: cast class obj

obj ¤«¤é class ·¿¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£À¸À®¤Î¥ë¡¼¥ë¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£

class

obj¤Î·¿

ÀâÌÀ

<c-value> ¤ò·Ñ¾µ¤·¤¿¥¯¥é¥¹

<real>

obj ¤ÈƱ¤¸Ãͤò»ý¤Ä class ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹

<c-value> ¤ò·Ñ¾µ¤·¤¿¥¯¥é¥¹

<boolean>

obj ¤¬ #t ¤Î»þ¤Ï 1¡¢#f ¤Î»þ¤Ï 0 ¤ÎÃͤò»ý¤Ä class ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

<integer>

obj ¤Î¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

obj ¤ÈƱ¤¸¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

<c-array>

obj ¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£

<c-ptr>

<string>

C¤Îʸ»úÎó¤òÀ¸À®¤·¡¢¤½¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£

<c-ptr>

<uvector>

obj ¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£

<c-ptr>

<sequence>

obj ¤ÈƱ¤¸ÆâÍÆ¤ÎÇÛÎó¤òÀ¸À®¤·¡¢¤½¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤ò»ý¤Ä¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£

<c-array>

<sequence>

obj ¤ÈƱ¤¸ÆâÍÆ¤ÎÇÛÎó¤òÀ¸À®¤·¤Þ¤¹¡£

<c-array>

<c-ptr>

¥Ý¥¤¥ó¥¿¤¬»Ø¤¹¥á¥â¥êÎΰè¤òÇÛÎó¤È¸«¤Ê¤·¤Æ class ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£

<c-func-ptr>

<procedure>

obj ¤ò¼Â¹Ô¤¹¤ë´Ø¿ô¤Î¥Ý¥¤¥ó¥¿¤òÀ¸À®¤·¤Þ¤¹¡£

<integer> ¤Þ¤¿¤Ï <real>

<c-value>

obj ¤ÈƱ¤¸ÃͤοôÃͤòÊÖ¤·¤Þ¤¹¡£

<boolean>

<c-value> ¤Þ¤¿¤Ï <real>

Ãͤ¬ 0 ¤Î¤È¤­ #f ¤¬¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð #t ¤¬ÊÖ¤ê¤Þ¤¹¡£

<integer>

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤¬ÊÖ¤ê¤Þ¤¹¡£

<integer>

<c-array>

ÇÛÎó¤ÎÀèÆ¬¥¢¥É¥ì¥¹¤¬ÊÖ¤ê¤Þ¤¹¡£

<string>

<c-ptr> ¤Þ¤¿¤Ï <c-func-ptr>

¥Ý¥¤¥ó¥¿¤¬»Ø¤·¼¨¤¹Îΰ褬0½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¸«¤Ê¤·¡¢Ê¸»úÎó¤òÀ¸À®¤·¤Þ¤¹¡£

<string>

<c-array>

ÇÛÎó¤ÎÆâÍÆ¤¬0½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤È¸«¤Ê¤·¡¢Ê¸»úÎó¤òÀ¸À®¤·¤Þ¤¹¡£

<collection>

<c-array>

ÇÛÎó¤ÎÆâÍÆ¤ò»ý¤Ä class ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¤Þ¤¹¡£³ÆÍ×ÁǤÎÃÍ¤Ï scm-cast ¤Ç¥­¥ã¥¹¥È¤µ¤ì¤Þ¤¹¡£

Function: scm-cast obj

obj ¤¬ <c-value> ·¿¤Ç¤¢¤ë»þ¤Ï¿ôÃͤòÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð obj ¤ò¤½¤Î¤Þ¤ÞÊÖ¤·¤Þ¤¹¡£

Function: make-null-ptr

NULL¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£

Function: null-ptr? obj

obj ¤¬NULL¥Ý¥¤¥ó¥¿¤Ç¤¢¤ì¤Ð #t ¤¬¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð #f ¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£

Function: register-finalizer! ptrobj proc

ptrobj ¤Ë¥Õ¥¡¥¤¥Ê¥é¥¤¥¶ proc ¤òÅÐÏ¿¤·¤Þ¤¹¡£ptrobj ¤¬GC¤µ¤ì¤ë¤È¤­¤Ë proc ¤¬¸Æ¤Ð¤ì¤Þ¤¹¡£

Function: unregister-finalizer! ptrobj

ptrobj ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤òºï½ü¤·¤Þ¤¹¡£

Function: finalize! ptrobj

ptrobj ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê ptrobj ¤Î¥Õ¥¡¥¤¥Ê¥é¥¤¥¶¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. objc-wrapper

objc-wrapper ¤È¤Ï Objective-C ¤Î¥é¥¤¥Ö¥é¥ê¤ò Gauche ¤«¤é»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Load a framework library

Function: c-load-framework framework

¥Õ¥ì¡¼¥à¥ï¡¼¥¯¥é¥¤¥Ö¥é¥ê framework ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

 
(c-load-framework "Foundation")

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Load an Objective-C header file

Function: Macro c-include file-or-list &keyword

objc-wrapper ¥â¥¸¥å¡¼¥ë¤Î c-include ¤Ç¤Ï Objective-C ¤Î¥¯¥é¥¹ÄêµÁ¤ä¥á¥½¥Ã¥ÉÄêµÁ¤Î³ÈÄ¥¤¬¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡£

Objective-C ¤Î¥¯¥é¥¹ Foo ¤¬¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢ Foo ¤È <Foo> ¤Î2¤Ä¤Î¥·¥ó¥Ü¥ë¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£Foo ¤Ï <c-struct:objc_objcect> ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¥¯¥é¥¹ Foo ¤½¤Î¤â¤Î¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£<Foo> ¤Ï <id> ¤Î¥¨¥¤¥ê¥¢¥¹¤È¤Ê¤ê¤Þ¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Functions about Objective-C objects

Macro: define-objc-class class-name super-class-name

super-class-name¤ò·Ñ¾µ¤·¤¿Objective-C¤Î¥¯¥é¥¹class-name¤òÄêµÁ¤·¤Þ¤¹¡£

Macro: define-objc-method objc-class ret-type (message-keyword varspec ...) body ...

¥á¥Ã¥»¡¼¥¸¥­¡¼¥ï¡¼¥É¤¬message-keyword¤Ç¤¢¤êÌá¤êÃͤη¿¤¬ret-type¤Ç¤¢¤ë¤è¤¦¤Êobjc-class¤Î¥á¥½¥Ã¥É¤òÄêµÁ¤·¤Þ¤¹¡£varspec¤Ï(ÊÑ¿ô̾ ÊÑ¿ô·¿)¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£

body¤Ç¤Ïself¤Èsuper¤Î2¤Ä¤ÎÊÑ¿ô¤¬»È¤¨¤Þ¤¹¡£¤½¤ì¤¾¤ì¡¢¥ì¥·¡¼¥Ð¥ª¥Ö¥¸¥§¥¯¥È¡¢¥ì¥·¡¼¥Ð¤ò¥¹¡¼¥Ñ¥¯¥é¥¹¤Ë¥­¥ã¥¹¥È¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò»Ø¤·¤Æ¤¤¤Þ¤¹¡£

 
(define-objc-method MyFooClass <id> [:doSomething (v <c-int>)]
  [super :doSomething v]
  [self :foo v]
  (bar v) ;; The result of (bar v) is the return value of this method.
  )
Method: object-apply (obj <c-struct:objc_object>) selector-or-args ...

obj ¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£

 
[[NSString :alloc] :init]

[[NSString :startWithCString ( "Hello, world") :encoding NSASCIIStringEncoding]]
Function: @ str

Objective-Cʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£

Function: @selector method-name

¥á¥½¥Ã¥É̾ method-name ¤Î¥»¥ì¥¯¥¿¤òÊÖ¤·¤Þ¤¹¡£


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A. Function and Syntax Index

Jump to:   (   @  
C   D   F   M   N   O   P   R   S   U  
Index Entry Section

(
(setter1.3 Classes and functions about C types
(setter1.3 Classes and functions about C types
(setter1.3 Classes and functions about C types

@
@2.3 Functions about Objective-C objects
@selector2.3 Functions about Objective-C objects

C
c-array1.3 Classes and functions about C types
c-include1.2 Load a header file
c-ld1.1 Load a shared library
c-load1.2 Load a header file
c-load-framework2.1 Load a framework library
c-load-library1.1 Load a shared library
c-sizeof1.3 Classes and functions about C types
c-sizeof1.3 Classes and functions about C types
c-struct1.3 Classes and functions about C types
c-union1.3 Classes and functions about C types
cast1.3 Classes and functions about C types

D
define-objc-class2.3 Functions about Objective-C objects
define-objc-method2.3 Functions about Objective-C objects
deref1.3 Classes and functions about C types

F
finalize!1.3 Classes and functions about C types

M
Macro2.2 Load an Objective-C header file
make-null-ptr1.3 Classes and functions about C types

N
null-ptr?1.3 Classes and functions about C types

O
object-apply2.3 Functions about Objective-C objects

P
ptr1.3 Classes and functions about C types
ptr1.3 Classes and functions about C types

R
ref1.3 Classes and functions about C types
ref1.3 Classes and functions about C types
ref1.3 Classes and functions about C types
register-finalizer!1.3 Classes and functions about C types

S
scm-cast1.3 Classes and functions about C types

U
unregister-finalizer!1.3 Classes and functions about C types

Jump to:   (   @  
C   D   F   M   N   O   P   R   S   U  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B. Class Index

For readability, the surrounding < and > are stripped off.

Jump to:   C  
Index Entry Section

C
c-char1.3 Classes and functions about C types
c-double1.3 Classes and functions about C types
c-float1.3 Classes and functions about C types
c-int1.3 Classes and functions about C types
c-long1.3 Classes and functions about C types
c-longlong1.3 Classes and functions about C types
c-short1.3 Classes and functions about C types
c-uchar1.3 Classes and functions about C types
c-uint1.3 Classes and functions about C types
c-ulong1.3 Classes and functions about C types
c-ulonglong1.3 Classes and functions about C types
c-ushort1.3 Classes and functions about C types
c-value-meta1.3 Classes and functions about C types

Jump to:   C  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

C. Variable Index


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated by KOGURO, Naoki on December, 26 2006 using texi2html 1.76.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack beginning of this chapter or previous chapter 1
[ Up ] Up up section 1.2
[ >> ] FastForward next chapter 2
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index index  
[ ? ] About about (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

  • 1. Section One
    • 1.1 Subsection One-One
      • ...
    • 1.2 Subsection One-Two
      • 1.2.1 Subsubsection One-Two-One
      • 1.2.2 Subsubsection One-Two-Two
      • 1.2.3 Subsubsection One-Two-Three     <== Current Position
      • 1.2.4 Subsubsection One-Two-Four
    • 1.3 Subsection One-Three
      • ...
    • 1.4 Subsection One-Four

This document was generated by KOGURO, Naoki on December, 26 2006 using texi2html 1.76.

gauche-c-wrapper-0.6.1.orig/doc/extract0000755000000000000000000001236211237307544014654 0ustar ;;; ;;; extract - filter bilingual texinfo document ;;; ;;; Copyright(C) 2001-2003 by Shiro Kawai (shiro@acm.org) ;;; ;;; Permission to use, copy, modify, distribute this software and ;;; accompanying documentation for any purpose is hereby granted, ;;; provided that existing copyright notices are retained in all ;;; copies and that this notice is included verbatim in all ;;; distributions. ;;; This software is provided as is, without express or implied ;;; warranty. In no circumstances the author(s) shall be liable ;;; for any damages arising out of the use of this software. ;;; ;;; $Id: extract,v 1.16 2006/04/07 11:29:48 shirok Exp $ ;;; (use gauche.regexp) (use gauche.parseopt) (use gauche.charconv) (use srfi-13) (define *outfile* #f) (define *lang* 'en) (define *version* (string-trim-both (call-with-input-file "../VERSION" port->string))) (define *node-table* '()) (define *header-table* '()) (define (scan-nodes) (let ((current-node #f) (current-header #f)) (port-for-each (lambda (line) (rxmatch-case line (#/^@node\s+([^,]+)/ (#f node) (set! current-node (string-trim-right node))) (#/^@(chapter|(sub)*section|appendix\w*)\s+(.*)/ (#f #f #f header) (set! current-header (string-trim-right header))) (#/^@c NODE\s+([^,]*)(,(.*))?/ (#f jnode #f jheader) (let* ((jn (string-trim-right jnode)) (jh (if jheader (string-trim-both jheader) jn))) (push! *node-table* (cons current-node jn)) (push! *header-table* (cons current-header jh)))) (#/^@include\s+(\S+)/ (#f file) (with-input-from-file file (cut scan-nodes) :encoding 'euc-jp)) )) read-line))) (define (filter pattern-in pattern-out) (define (in line) (rxmatch-case line (test eof-object?) (pattern-in () (in (read-line))) (pattern-out () (out (read-line))) (#/^@include\s+(\S+)/ (#f file) (with-input-from-file file (cut filter pattern-in pattern-out) :encoding 'euc-jp) (in (read-line))) (#/^@c COMMON$/ () (in (read-line))) (test (lambda _ (eq? *lang* 'en)) (display (regexp-replace-all #/@VERSION@/ line *version*)) (newline) (in (read-line))) (#/^@node\s+(.*)$/ (#f nodedesc) (process-node nodedesc) (in (read-line))) (#/^@(chapter|(sub)*section|appendix\w*)\s+(.*)/ (#f cmd #f header) (process-header cmd header) (in (read-line))) (#/^\* ([^:]+)::(.*)?/ (#f node desc) (process-menu node #f desc) (in (read-line))) (#/^\* ([^:]+):\s+([^)]+\))\.(.*)?/ (#f tag node desc) (process-menu node tag desc) (in (read-line))) (else (display (regexp-replace-all #/@VERSION@/ (regexp-replace-all #/(@x?ref)\{([^\}]+)\}/ line process-ref) *version*)) (newline) (in (read-line))))) (define (out line) (rxmatch-case line (test eof-object?) (pattern-in () (in (read-line))) (#/^@c COMMON$/ () (in (read-line))) (else (out (read-line))))) (in (read-line))) (define (process-node nodedesc) (display "@node ") (display (string-join (map (lambda (name) (cond ((assoc (string-trim-both name) *node-table*) => cdr) (else name))) (string-split nodedesc #\,)) ", ")) (newline)) (define (process-header cmd header) (format #t "@~a ~a\n" cmd (cond ((assoc (string-trim-both header) *header-table*) => cdr) (else header)))) (define (process-menu node tag desc) (if tag (format #t "* ~a: ~a. ~a\n" tag (cond ((assoc (string-trim-both node) *node-table*) => cdr) (else node)) (string-trim-both (or desc ""))) (format #t "* ~a:: ~a\n" (cond ((assoc (string-trim-both node) *node-table*) => cdr) (else node)) (string-trim-both (or desc ""))))) (define (process-ref match) (let ((cmd (rxmatch-substring match 1)) (node (rxmatch-substring match 2))) (format #f "~a{~a}" cmd (cond ((assoc (string-trim-both node) *node-table*) => cdr) (else node))))) (define (usage) (display "Usage: extract [-en|-jp][-o outfile] infile\n") (exit 1)) (define (main args) (let ((a (parse-options (cdr args) (("o=s" (outfile) (set! *outfile* outfile)) ("en" () (set! *lang* 'en)) ("jp" () (set! *lang* 'jp)) (else _ (usage)))))) (define (do-it) (case *lang* ((en) (filter #/^@c EN$/ #/^@c JP$/)) ((jp) (filter #/^@c JP$/ #/^@c EN$/)))) (define outenc (if (eq? *lang* 'jp) 'euc-jp 'utf8)) (unless (= (length a) 1) (usage)) (when (eq? *lang* 'jp) (with-input-from-file (car a) scan-nodes :encoding 'euc-jp)) (with-input-from-file (car a) (lambda () (if *outfile* (with-output-to-file *outfile* do-it :encoding outenc) (let1 out (open-output-conversion-port (current-output-port) outenc) (with-output-to-port out do-it) (close-output-port out)))) :encoding 'euc-jp) 0)) ;; Local variables: ;; mode: Scheme ;; end: gauche-c-wrapper-0.6.1.orig/doc/ja-init.pl0000644000000000000000000000010411237307544015133 0ustar # -*- mode: perl -*- $USE_UNICODE = 0; # $ENCODING = "euc-jp"; 1; gauche-c-wrapper-0.6.1.orig/doc/Makefile.in0000644000000000000000000000601411237307544015316 0ustar SHELL = @SHELL@ srcdir = @srcdir@ VPATH = $(srcdir) top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MANPAGES = EXTRACTED = c-wrapper-refe.texi c-wrapper-refj.texi GENERATED = Makefile $(MANPAGES) GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ INSTALL = @GAUCHE_INSTALL@ MAKEINFO = @MAKEINFO@ GZIP_PROGRAM = @GZIP_PROGRAM@ TEXIS = c-wrapper-ref.texi # Manual page destination. mandir = $(DESTDIR)`$(GAUCHE_CONFIG) --mandir` infodir = $(DESTDIR)`$(GAUCHE_CONFIG) --infodir` all: info install: all if test -f c-wrapper-refe.info.gz -o -f c-wrapper-refj.info.gz; then \ for info in *.info*; do \ $(INSTALL) -m 444 -T $(infodir) $$info; \ done; \ fi uninstall: (cd $(infodir); \ if test -f c-wrapper-refe.info -o -f c-wrapper-refe.info.gz; \ then rm -rf c-wrapper-refe.*; \ fi; \ if test -f c-wrapper-refj.info -o -f c-wrapper-refj.info.gz; \ then rm -rf c-wrapper-refj.*; \ fi) texi : c-wrapper-refe.texi c-wrapper-refj.texi html : c-wrapper-refe.html c-wrapper-refj.html htmls : c-wrapper-refe_toc.html c-wrapper-refj_toc.html dvi : c-wrapper-refe.dvi pdf : c-wrapper-refe.pdf info : c-wrapper-refe.info.gz c-wrapper-refj.info.gz c-wrapper-refe.html : c-wrapper-refe.texi texi2html -number c-wrapper-refe.texi c-wrapper-refe_toc.html : c-wrapper-refe.texi texi2html -split section -number c-wrapper-refe.texi c-wrapper-refe.dvi : c-wrapper-refe.texi texi2dvi c-wrapper-refe.texi c-wrapper-refe.pdf : c-wrapper-refe.texi texi2pdf c-wrapper-refe.texi c-wrapper-refe.texi : $(TEXIS) extract $(GOSH) ./extract -en -o c-wrapper-refe.texi c-wrapper-ref.texi c-wrapper-refe.info.gz : c-wrapper-refe.texi if test X$(MAKEINFO) != X -a X$(GZIP_PROGRAM) != X; then \ $(MAKEINFO) --no-warn c-wrapper-refe.texi; \ rm -rf c-wrapper-refe.info*.gz; \ $(GZIP_PROGRAM) c-wrapper-refe.info; \ fi c-wrapper-refj.html : c-wrapper-refj.texi texi2html --init-file=ja-init.pl -number c-wrapper-refj.texi sed 's/^ $@.t && mv $@.t $@ c-wrapper-refj_toc.html : c-wrapper-refj.texi texi2html --init-file=ja-init.pl -split section -number c-wrapper-refj.texi for f in c-wrapper-refj/c-wrapper-refj*.html; do \ sed 's/^ $$f.t && mv $$f.t $$f; \ done c-wrapper-refj.dvi : c-wrapper-refj.texi texi2dvi c-wrapper-refj.texi c-wrapper-refj.pdf : c-wrapper-refj.texi texi2pdf c-wrapper-refj.texi c-wrapper-refj.texi : $(TEXIS) extract $(GOSH) ./extract -jp -o c-wrapper-refj.texi c-wrapper-ref.texi c-wrapper-refj.info.gz : c-wrapper-refj.texi if test X$(MAKEINFO) != X -a X$(GZIP_PROGRAM) != X; then \ $(MAKEINFO) --no-warn c-wrapper-refj.texi; \ rm -rf c-wrapper-refj.info*.gz; \ $(GZIP_PROGRAM) c-wrapper-refj.info ; \ fi clean: rm -rf core *~ *.aux *.cl *.cls *.cp *.fn *.fns *.ky *.log *.md *.mds \ *.pg *.toc *.tp *.tps *.vr *.vrs *.pdf *.dvi *.info* \ $(EXTRACTED) distclean : clean rm -rf $(GENERATED) maintainer-clean : clean rm -f c-wrapper-ref*.html c-wrapper-refe.dvi Makefile $(GENERATED) gauche-c-wrapper-0.6.1.orig/examples/0002755000000000000000000000000011237307544014323 5ustar gauche-c-wrapper-0.6.1.orig/examples/gtk/0002755000000000000000000000000011237307544015110 5ustar gauche-c-wrapper-0.6.1.orig/examples/gtk/gtk-hello.scm0000644000000000000000000000253511237307544017505 0ustar (use c-wrapper) (c-load "gtk/gtk.h" :cppflags-cmd "pkg-config gtk+-2.0 --cflags-only-I" :cflags-cmd "pkg-config gtk+-2.0 --cflags-only-other" :libs-cmd "pkg-config gtk+-2.0 --libs" :import '(gtk_init gtk_window_new GTK_WINDOW_TOPLEVEL gtk_signal_connect gtk_main_quit gtk_container_set_border_width gtk_button_new_with_label gtk_container_add gtk_widget_show gtk_main NULL) ;; :import '(#/^gtk_/i NULL) :compiled-lib "gtklib") (define (main args) (let ((argc (make ))) (gtk_init (ptr argc) (make-null-ptr))) (let1 window (gtk_window_new GTK_WINDOW_TOPLEVEL) (gtk_signal_connect window "destroy" (lambda _ (format #t "Destroying\n") (gtk_main_quit) NULL) (make-null-ptr)) (gtk_container_set_border_width window 10) (let1 button (gtk_button_new_with_label "Hello world") (gtk_signal_connect button "clicked" (lambda _ (format #t "Hello world\n") NULL) (make-null-ptr)) (gtk_container_add window button) (gtk_widget_show button) (gtk_widget_show window) )) (gtk_main) 0) gauche-c-wrapper-0.6.1.orig/examples/gtk/Makefile0000644000000000000000000000032011237307544016541 0ustar SOEXT = $(shell gauche-config --so-suffix) gtklib.$(SOEXT): gtk-hello.scm cwcompile --verbose gtk-hello.scm run: gtklib.$(SOEXT) gosh -I. gtk-hello.scm clean: cwcompile --verbose --clean gtk-hello.scm gauche-c-wrapper-0.6.1.orig/examples/ImageMagick/0002755000000000000000000000000011237307544016461 5ustar gauche-c-wrapper-0.6.1.orig/examples/ImageMagick/bear.jpg0000644000000000000000000020740311237307544020100 0ustar ÿØÿàJFIFÿþ ÿÀà€!ÿÛ„  #!!!$'$ & !   ÿÄ¢  }!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?ì¦X¼—t!¾_—8;‡¥rSÈ¢b"ˆnçknÉû¼RÑ!uÔ¤ sÅ=rv}?º“K³.À™ûÅ,¿NÔ^Ò½„­kÒÉ#â@ (Ã(Ãê=ë5Éä0Îdà ¯cõªwNÂZ-È|’ ã‘úUŸ¦Û[iÓÐ`šOrúj7W¯,-fc´`d’*­Œˆ%!m„à·LÒZ Þæ£ZY†h¦•Þ6éå€XŸsý+*âÎÒ eÀ†on$+÷@?xúR½ó]M·8 Ž1ÿשiv¯£:iíÌ6Î&-2¶ÜÔú×cj|ͬÍÓ¾)¶Ý“)_©RáY&!°H<CéQÇŒ@±õííQ¶q’[λ•œ÷çñíQ$K(WƒØõ¨Õè=ŽSW„ÃxYõïK¥LN¢œ9#¸ÆGãÞ‹èÅk„2+rOÊFyïÿ׫͘€NZ»²ï«)Íwò„äsòöü©RfŸŸ(«ŸÒ«E°ºê$¦ß˜ä£=+ÆüC îÌÈ$ôÏÿ^¥&lV‰‰€ëǦﯽ_ˆ£é×ô?Ò­Ú×Dô±¡Ýœ=ÿúõmK`uö¡^Öˆíd<®þIéÈëìjµÄ2H ¨ç§Ìyú”Õ¬ÂÏtl#,ú …;Ù~Ra¸,¸a»¶}yè}êRú^vŠù¢-µXdf½.|¬?'9õǽO¨ýnâ`TîÁôé±d©ã´m°o¹]ì¦N>‚Ÿ• ¹ê·ÕŽö#Tg“®Õ§üç½s5´Ä1Ìvž0sǶ>”7a[Kœzå0`Ÿ”&ü*¼ª–‡A»¸ô=³øUÚèÉÝ­FðòÅs¥E *H^23šÕ•‡Ë)»#6>oj–õ³4ZœEä@ÌêFW¢–ýAíU,^;=b cæÆÞ>_n(Ü4Øë|F‘Íië »Ï®{3ÆEWÐ[̶ò‹†=3œ‚?Æ›Ž—cM^Æ´¤ù,œŽ9ãÛµlXÉ`Á— ê*º±^„2¦ÝÌÉ{ÓmÝüà7Ïr8ª–¬~¥Ëˆpÿ2ek:ä(¶àõàVqWvj¨/§.î„z«²ŒB}I~•£½Âïb±Œ.YÎpUräü (¹9Ö«ÝKA^Û—ní¼¨ß{ã<Áõ®>å\K ÜqŸœžÌ8©ÖÄ=]…òƒÇæy¡˜Œ•9ýàõ¨…¬*±I»w òŸÞzƒW¦ƒîg]ù #Ÿ”°þ.êúõDíÙ…\a¸È7p}©éd˜¬ö"^vñØ`uïVõðdÐ!œñŠÎOkCó¼/àv¯æ—Mº´œ.ž"Xc<:—>ƒ= ^–%ݱ.ìæ·ÔÚ8e'æ r@÷ô¬ËˆÈÒŒ¹–'¿­UÚVbÑ»¢%ÈI¶G>ëî+ZÕþÍÚ LxÀ?séõ¦¯ÊHѵ•aº®ÿ›‘œ?ðÖý…ý´—Ñù0*)‘œ|¾Ô}›Ø«\ô$ 9n{Ta¾rNzÔÞû¡Vê'e Šç/ækÔÆóµQǦnèESZhhçå…,áqœú}EAnÑ¥÷ÊO¼¥-6¶.ZIùáówÈã¿jË»²¶·‘¢’sç1ÎÁÜP¢µWØ:Mu4ÛgµÓãi@!0û§¨"«ÂÁÙ¥”—\eˆ=O¨÷§îÞÝ ÛR9¤‘ ;ôÿ<Òƒ)ˆaž¼Ð•ܙÙʪà°íõ÷þµnÒÌËlóJ|¨©?{éøU)kÊ– Õ¶"½»2"11 Ú£°¨£¼\àÒŽ—CF½¿Ê çvñ·0ÔW}£Ìd´ˆ(fàz“YÊË@¿Qn‰’T‘ÐõWK|ÇŽ1œQf˜Ýº”ÈwÈõçŸÎ c!”Fl1âÄ›œ“ôÿëVmŠùw*Ø I ÿé­IºJìï!UûˆÇÐ~´å„¹ÃaW Ÿýj:Œd–ñ¨F äg·µÊàÀÀ¥nàE4¥ŽI8õ¯*ñ„ µ¼ Žqëÿ×  ˆOÊ¥ŽìúŒgØÖ„Y!T/·?ÈÕ!=¦„!s»×‚G§Ö¯#d¹r}ºùò(m^Ö%ßvHó„%É?{ëïM˜lVXÁmÜxϷ֕ƵZÑŽï>ÔŒ« óÆj•˜¥pÜ18Éã>ÇÞ•õ²*úYŽÒfh5»ge'oÏòà{æ½n#æE¡³Ó¯5.èÉ'fX QõÉÁÜu¬ø¥"@®0G\ñš- Þ÷6wîÏ8èxÍDªY¶‘žp3üpØIT  {Öoˆc2èîë,œ«rqø 7vìÏ/g‘Üï9#‚3ÏÒ’A½‹Þq“Žüõªj÷a±ÜxbWB rĽtцdÃsž£=}ø©jå'ÔäµHLwò» .záGÌ;u=Es—n|å` œç)“¹GÐc4%щnÚ;™ÚKß †R£pã$}áùô¬`—ma²>Qž¸¥%n£ètM–ä‚0F3õ­M$ªGåçìçîÒÒÖ@·%œmr»¼¨YÀçr瓌ô¥¢WcóFØ/ 4jOû£?­e\‰€§?Ä@üjÒm+1õ³6`(,l‘˜Nj™%“”Æ8ÉÈ¥b³åFÑ€zôÇ^TÂŒ6}2zÓ÷ÞŒ·?*ÛA#oÿÿæf²’„³òéýÚi­žÆNåÒÊBB»T¼æ3éøÓü²H@x1Ÿ,þum­¬Lmm w¥Ÿ%ÆÖÇï_á쳟#p<ü¼ü£æNÄ{Ð’jö*)ÚÄÄ/-žaÈìkB왼.rAÚx'µE’ØwЧ¡ïÖ‹o5æÉŽq·=?ÙÍ8îw¹£ r¹cݸmÁïêµ¹¤†í (bìfèúâ›¶ÈWHôØ™Uä"LŽ U™|¥Pé‰3ɬ‘FuÔ«’¤œÓÖ¸Ík|/"¶Ð~öÓƒìÕk}«œëÍ;3Ãgæù»ã†üj%GGÜ̹ÁÀ&“kaÛ±OO˜sËeË2EM›‰$Í!Èr{{ … ž…‹­¡K™šÝL™!÷0÷ö©7C+ó)sÉeþzÑÇ—rSW ¼²¡vãùúS…ìÎ&rѨu'Êî5ä]·Ï 6åŽãæϰúÒ\Ln-Áó0ƒ Ç8ÿ ®dÙ-Ý™Œq€rLUèŒca‘ÇJ‹ôeìÍW ¬î úþ£Þ»}ì¼ÈúÕik¿/vßn@ÿ=j‘ ™P€ú‘üø¨³z•¸™,A#ÒÉÁ94´a¡‡¯FZÜ6>ïN3XÖvèª'’.!Ðdg?€èikºØÙÜ(¶FÛ´cyãÛš”_FÇb·'¦ÑÔˆ¡$?AÙ2A`y8ïþ°5Oèú4þUíâ (?çš»_q' ë wNÔUžÞMøÀÆk‘ñÈYfŠTLv w¥gÔ{+¤ ¹O~Ý:ûÑ·.6œƒŸäiéÐY¥ ãvy<õÇõvÞ™€\1=¯ø{{͵ÐÑóc·ˆÂ|§«ŽãÛިȅ°q¼ž¤ nþ|Ñ-v Ù ¬† ^'ß…~½M«C²ð„xc¿µEßr÷3´w±Ê•`?Lu¯^ÒXÏ§ÆØíÎy<Ž•hhºÊJí'J¢Ï åÎ <òÿõèJáa×/h õ×Ö«’Ã7'ðÍhL¶€,XQ´vãµCq\ióF —§^”µ½˜ì­¡äq¯ž2?ˆçšŒà.O¦z~µ]4'®§màçC§È’…IïÀúWU lÎ~=¿úÕ.Ïr–‡/¯Fûrg6lõÍÞÆì[p#žp }FqÅ5¦âóGO¡\-Άa’Urç{Ve«‹m\!Â’r¨N7PUdWC¬#zàíÉv“L–XoH~8ãØŠÏm— ÁÈÝÏ ÝzuQÁÎTî÷9'ü)èÆÚOCEd?cN0~•—p"F&NÔ|¿.é Í›Vë[!Fãéɪr‚ÌFÐäcJo¡].ʈã*:äqPJ †Èýi/1>æŒÈ†',áA>ÃiõúW)ráerIòóûÅ 2÷¸­b½H{èW™Õž NG͸Ÿœz©v°T\¶ÓÉó¿Ò†Ò%>È«tYÖ6Œ‡RtJ1îj P‚\e²™†ïŸAUfô[ =,ÈX¿(à“Ƀßð=«Fæxvæ2ƒ#=+9%Ü¥µŒ 6Û‹‹vMÛÁ‘Ò¨Ý$^Éríˆ8íB¸ÝìHŠTª Ž ÁÛü©×v‘ÙB%Þ2ÿq3–?\tª»{’­Ð¤“K$ƒ.ÄŸÃ?ZÖ„#~G~ ozo]GêOk+$mºpG<ã#±âµlÉ‘°w ýáê=1Þ«¥…äÏM³pö1ù\œ~¼ÕÇ…dù§ëÅORö!h-Ô—<‘Ðc¾+‘ײÿwœu§°ÎRå PvÉŒ®õãû¿…Uˆ±ºE‰'¡ä懪ó"Ä2lu$Œ¦Bs3M×ÛÌ‘d‰ (¶®ãÖû™BìÊ%%~§§ÿZ´;2£Î±þéö4i¨‰LÊ9} çÜT°ZGqå/R_¥V­j šæIc , 0 zSã,Ï^ÞÇéëN×v]‹f8W2B@ Æ$ûU&•›9ã4=а / ÉŸoqôô¯DÓtÕÒ‹$÷i-Ëó¶&%@õ§5-]l4[» O Û'Ú¨†fÀÁ×Óÿ­H±Ï AÃÇ=±Q¬›€xúâ‹2z”µ4SdY”¾; äÚâI壀‡žÝ?„ÌêôR“YeÏä àQZ­l‘.Wobƞ͡œŽü{cá‹ ŠP÷îÔîZùŸVÖïu{ù/.¦f‘Î~”=´س£ø›QÒ®–X§b½ “ÁëRxžÇ\Ð `ãÎ 3Î}*cî6È-›+œqê{ûÑ„ç$°ã‘Èöªzׂ6m ¿¯ÿ\V’À-”*²´Œ2ÛOê=ýj¥îJjü¡òˆÛ,I<£¯¸÷¤c•Ãr:?˜þ´žŽÃßR•ÔEq!$0;¸ŸqZ—ê.tènF'­&­¸GmLy 6ð ŽóÐz}qÒ½ ÂW^~’ŠùÜ8"³ÕjQÑÙÎ8#‘œf©^@¢BpHãÞ‡{}JóÚJëy…@ô8 zz‘V!!PKa³ŸLÒêNãÈÏ9=i褌´ASêUô<³ÄVÞF³ nT’OlóY#ƒž3×?çõª3Óc®ð|aáš2í÷²téÒº¨ÃÁ !w¡ô‘éÐÒiÐÉ×™D‚<’3Æá¸W1w ´[–ËŒGQèriô¹*ýKÞ”fKrÄ.;7^2:S/Šù²¹ÎϺ9ÈÇ?…-/±ZØêí]e³M£nWÓþ´±—Še,œã7~]è“FôŽ­j¥‰\€7c§µT‘ råry'þµpE¨D/hÜ?‡Š¡rÊ«aºži¤ú»lo@ªÖÀ‚7qÞ¨J¸vg9ôqBj÷¸ì¯rŒ¬ÒtE^üõ5X€äƒÈÁ'µ;tÅ©h˜…ó>^xaéõ®RâOßíQ¹ÇÜmÝG÷Mh´^D;§v4ÆÆáXƒ'ä?ݨÄ{C:„U<>s˜ÛÚœìÙ WZ·¨À6ä•UOÊ;ïYÒF1ØÃŒS±ôu»-k¡®.3ÆJ‘ÈíøŠ×ÒÃ6Ÿuî1ÓŽ¸©Ò÷‰Γ9ƒ^ÚFÐ[{U± ¨;;uç(V¹obíí¡IÙ@Ê…~¹çùÖTò1œ¿U'Ô\’NÄ-¨>J•È玿í¥^Wmë¶F“£gù0¤®öØ«XзÏ`$—ÊbA#8Ûþ×>µ¯kjd™üˆ×¬ƒ$ê½°j­­ÈnÛ‡¥Méqˆwe«ñÌå@`1Ûœf’µŠó#˜ÆÀäƒè?•aë&i-ƒ"ï ÷Ѝÿh}*ŸüŽIá–àºù¢4CóÝOfª)qº³I™²pœñJWÚD¦ô9ÍE¾fv8':Ö³NNÒ06í<ŸÆ§mQNÖ3 ˜\Oµ¬½±ÆG¡5r‘2O÷yç>Ç=ëEfÉk©"Cæ±ijY¸ñÙnÁQ åQ} -õÓ"F®$c°2~ï¿áWíãó‚ÆÁ'ôüj¯­ÃÈ“ì†9v‰Ad’zÿõÅ9ÖÙдyi3ŒcNÉ!]lZƒu™YŽÝäd>ç¿øÖæ•pVù|Ì3ƒŒq‘ŸÄçCM+´5w©Õ\†!_=²:Õ Øm¤sœc+MÔ Ã z_þ½=UÜG8ãžµ °÷*^:ÖPðñÞ¸ddäWFçóz¨ö¿C§Ðæ2FÊÏ´ŽwŒûñ\Ÿþ$ÁáèÆÆUšô‚§!=hÛQi{7ê:•Ö©z÷wR´’9É$æ©ÍeêP„Œõ«¶„¶“) vwÓ³Ð:£¢ßÅ{jÁdŸÐ×Ml8>½ôö5¦‰\<¸Yc‹q?9{­MÆsžsŸÔZjÝ7#mY/)ÏãÀéïÓô ï•ôÚ8ü=jlÒк¹¨b çþÀÖ†žªÚ;£7Ï 1â§}lR9û­û‰bXƒ‚IÏàƺŸݲ<ÐH9œÐöÔ<Îå‹nÉ sŽ?ItÆø±Ò¥=4R%fÇ íøTrHrp;ãŽ?5t`7%›tïR¬ ÞÏåIÙh=ÙÇøÒgK£Ž9®3`_žEíOzš:oæY% xR0=wK»oÍ€s× È,þF&¿óB›œ(Ϡʰï×¥srÎæ×ȱwd®Wå>¸¥m·¹KIìõ¤|…pFO^ýië;„åŽFîp¹_©þ´ÝÂöÔÞÐfX)‘ù=öàЕA$*ŸqÓüšZÜ K1ç[ìqÁþ´L#'˜éøóÍdÙRZX ‘£…É!HsU. 2‡8gb< ¨ßpÙ¶ˆDKæ’;•^åTêq€Gæh·Ú ÷2d ¼’£vz{Õy1*Oÿ^«[j#Fr«lWw–:uå[×é\}Ó$O+1àáù?!þõT/c7g±D(ó˜ÈqóðOËýúIURt¿™òü«ƒ‡_Sïô£G«Õìȯ-v[#ÄC“Æsê±Â.Å)9&<ÁŸZ«l˜ôz‘2üÊQ0;z ãü+WDÛ¾dbÀ#9ö©–÷cVÜä®A­·' ÙÆ0z×Q©[ ¥‚F$&ÐsŽ” }ÙÍ][\Cq´ÈFNA9ÿ¾ª²Ÿ5ˆÛÉ+ócÜU­®+\;©Âç¯\õªÅ´í‚¬w#¯Ò§©NÆ„R+°Á0sž»Oø׊æ6Pdaû{ïZÙZïqlw~‘[JU Í·#éÏJÝ„DÃq$ûô¡.£ô ÊH‘ÓŽžõ©ÈâЬnÑóœ=E5vôÅÏ4VÅÜ4Œý;p?Ù8¬¥Ä—K#³<÷¤ö³Ý7‡ž0Bçž3ŠÑY"ûÐA+89#ü*U—RŒ˜á™CJ0qן¥lé‘=Ü€Lå`}±Î?ÄR»Žäî[½š Z sû®¢OïvÍg)X— ¹õÏjßWf_¨ëU(rsžMj xã9Eb6ñÎ*cdö ÀÛLJ«FI$?Cþ4IÙ ÝÌíÒ1ü5I%©1z] Bçç CŽçµ·¥LÉ,-€¸`9ê?Ù©éb­©Ýœ›Q!ÃÜþµœPï-´dð{zTµ¥Âú\•v€Xœ?:…ƒ;Ÿsî(ÓtèC"G±ÐÜù®tÙw)g Cg¯*}j]¯aôÔãüEñûÞ{=:\Ý19`~éîEx­åÜ÷—-=ÄŒìÇ$“šOM¥ˆ{SOÒ–À@¡G=iÖÒuY´ÛÁ‰ŒýåÏjõýQ†úÑe·}ëŒsÔ}jÕ“¸š[,#(XuÏ_ëõ«QFK`Žøà{ý*Ö–bÜ´T \1^üv÷ ?.ÍŒuçÓèhŽ‚õ% V Y±ž'¯¨<ô¤Ó$?ÚMþ$˵fïФúµ¦ ÀñÛßÚ­øRO³ë»C}åÆ M†®T –$wâ.1ò÷ÿëÐöÌ­å•,„‚OJ§q·OËÎÞGò¥¥ÊÙh@‘ùDÙƒÆ>àUèv8ÀÀ?Ýî? ­É^Fg‰l’ãGg »fN}y“d’ž8Á56ÓAy£§ðX y"aÀÇlÿŸð®õUIã¨ê§åJÚ=42uô#^rq–£×¥rî™C!ºÆÝÇzúô¢ÊÚîÌk"^G9Üv0<†äg‚k{RC4qÊ~éÀÀ#Ü¿•w³Õ¾bÖlÁÁË1ùæµe€Ü~ïû?çšWÖå-´/idÑð8ÎÑÅHÒHÌÄTsó2…+íƒÍ Xm Œ–ŸirAã8üj)ai&U ÝÓµ²Ij&ôÔïü"þnšÂI‚xs~zÖôE |§#×:"…™Vùzô¬Ë˜·pÌ$}À9#·åO­Çº¹Äj¾gœD‘¬D6uþõfªÈ×1†T'=齉G?¨0„ ÿ•&Ÿ#%ÉïàŒt¬ÚèR4!·Š}@ €˜Ï~Øõ«òK±·„mDêÉÿ¡U®[=®À–WÈ##ž¸ã?àkZ/ ·IWwdT¹t)+”C™¯ŒIÚ:Öûi"+AÌòq“Œí÷)kt¶á¹…œ·ç/(¹éš†ßÂ/}¾Y·«äóUÌí ´HMGÂw6PfóÜ:É´¶ 1”ìd=Síõ¢|ɧ©/S¸‚C&œ /qÇÿª²ü—šc"3*w$à‘éõ:=ƒaÌø'#öþt›[n7`wïƒíS¿Qé¹Z@W—`=úõáÞ=ñ”Z~¡=ž™*¼‡ ºó·>ô´Z¡^çÜO-ÄÍ$ŒY˜äšŸ¥EÊ9dƒJá° cš8ëŠ`ÃòMkèšõÖ“t¥´DüÈOQ~¡kî{f…¬[êv‰,HÁ¨®Ž" ¯NIíõúV«ML¯m‹L¤rNÒ:míô©#‰a|ɑѱöúU6ÙM«d™æròÀLdß…Be[{˜® ƒÎ2=zõ¨’¾¡{ë(†U–8ʆý?Z¡¥1‡U‰”àç?J‹«hPɬ ¢¨Wà µùúc+Ì6"y™¯Ý'~¢‘-få^ g¥V‚Ù'….,žî?ϵy¡³¿–,3À##¹Ðx7wÚå `qÈÞªHÌX 3üºÒØŸ®A+BŒËò•$cŸCÍr²”‘çŸc}=(ÒÚÔÇ¿µV]É3Èãók¥±ÑÅ߆usæ¨ÇlûéGPWe¯ £ì˜¿)<ã“õ­×VnŸ*ƒÔ:=—q!&)T*ž¸8çjåœ8,…3À< ÞüsGK äè³ HÏñµ©–÷·ÀÆÌª¸br@©¿`ògQol±ÇåÆìç¥djvÞQ'qóÇzkµ†Ñμnìw€xÁª÷)·€ÝÍ$¬ôÜ7/;~ìí 0à|Ãÿ×®NôÌæ<.üƒò?§'8úÖ‰]\ÇU#:úbU¤šŒtqŽ}6÷¬©@fgfLaÀé·¶=é»îÅyZÃfFDà í^½~OêÕQö¦Ð«ó*å2¼lïŸöª’²Ô«÷+ºT!Jår;;ƒïSéR¼Z”M´0èFzŽÝ*¶E«”|C½µ¦•NÒ>lƒŒV†‹q5ÕŒÐÉ('=9£³bÝOH8BJ–'§¶*/9žQçÈÒãÿ­V¶"òYBD Ü8ÏqïïR+³ ÃÀþ!éKÍ ë±0‘¸ã©ÇqÿÖ«i1ß݇\ç¯ûUIi Ÿdz7ƒI|¦DPIÈ=Ïk©¶i#v ªÈÎ3Šj-ÓRĬ`áŽ:íýk>rë2­”íã?ài»òØ;ÔÅÃb:í°@ T’õFòp Nx¤îÄ®`Þ#ÿh» êp ïëŠÞÒô)î!™ÎdÝžƒ·CU¬n ¸†í±ûä.K~5»…"yÀÎ È•.}Q¬WS¢·Ña…‚ ŽœUÕ²B3·“\r«y] 6è>;3€ƒw­[‡C¶HK7ÌÇ“ZRªš~Fu!­ËöËm«×ƒW¢Š3®=ke-53å°ÐËt|ÕÊ^wâ9bÕ'–±8¯¿ÔVôßC9šz´úXߌc=*Œ®W+ dxïïVßBz‘)Âmàç·ùéLžU†"å‚ ç“ÌÓ²é¸$–ÇŒ|Dø”#Y4mņ$™N^!4’M+K#–brI5¶ägžM¯"³‡ƒŠ1‘Ò€m¤Œb“8¯¢k—ZMÒ¼r/ •Í{¯†õÛm^Ú9#qæ(çÕúÕ¢µµ"Kª;[am¸¸ˆ´kÿ,ÁÆN*•Ä­;³ˆÂ!à <o¥\¬–Áu¹X‘»q=y'ñëõÉÔ¼]6óØt>¿NâÒÚ•ÅÞ“—†ƒ©Gpƒr—=i¦Ðû¡ø¢Z,ÈNà>➟AüëZLŒåqǘÿ Ù4È '综GëRíGB»rsŒzú¯Ö„¹EÌ“±^Ñ&’9>hO8ÇÞ?•W¸˜}½HO-U†óùÔh“Fžgk¢ÎRñpcʺa™ƒt_R:Övè-K °8#Ú–K@ÎŽ[f[vA©¦újÞÆsßj¬ÚMÅ“)’-£§ š}î–Œ¯pL`=óÖ¹ÏAö­!¶à2uãœTë¸×fbø2Üþøõ±úW£YÃ2; Ž úÓ}ĵ{šº¬öãFdCóþ/~Õæ1ÄìynæÜ sƒìHêi+^Ìocè A§j‚žrÆ3I‚ÌG95ÅüF¸.£nÖìTÆ3Ò“½´Ç?ºú”PY­œ>s‚g8'ñ¦k6763)¸3¹N\Óå[²¯s V;ù†3Ó¯½niPGua"‰q ž¿•F¶bÜÌxgIŠˆ Á8$m#óÿ ÞÓ$o$¬–ùª³³E]ÍÌpÆÿ <¥uq°žTÿ¦€c¥e]GûÆ}Ë"Œƒþ´ÿ{è*ܹ¯©³Ð£ Ê·˜¦PÜ8dô#ØT,T,"ï-ò»(¼ôÛýqFˆÑi© ªÌÊ3À ·;PubûAló€È¢K•­ÐívG¾h‹œš«§-Å®¥4xã'œTÙZÌz¶uZ´/= ’ N3ŠänRP¬s%Æ]€Çâ*’²¸“¾†{Då …Ú$óúT±:Æ6°QÜ•çñúS^bóEˆbóFøÛj§?CëøÕÈá^ ±R:õÂý=©ù =ÁÑ‘§¼…6¦O$õ?á]KJN7epp;~Ö©m h˜ñ‰.â¼Z¯w(HŠ…ù:{Ó²{ŒáõÊܱ+€>èÀqÊóëÚ¡Ñí —fm„©\žjdÒ@hÛøn7¹›Ï„ü‚k¨Ñ4¿°æâ¤ zS¥Ô|ËCJ’ŒW+í¨’äcøÓò6`"ýkUZÏ–æ..×C.äfTïÅX„”Á# ÅwR“r9¦¬¬Kuh±úšÊxÁ—qÇÒ»%S”Æ1mÜk[ìHœzÞ¤%]aúV®™¢¦Ù[þoøžÖk[ÛdóXpøù…aX|$Ó¼/$©YÎyZÖS‚’!¤Ÿ+&»ðž–¶$Anˆäó…× âO‡6÷¶&Ha]ËË`uù»­»9x>ÀÖ“µ‘Á"²->—spŒŠ:b§Ü9:ÜÅ×þÉg¶ÞÒÍ뎵ÂkžÔtFiÀ=ñZ«Y4`*1ÒšAõÍY!ƒOØJçÜðÿˆ.ôK´xÜùy^ý¡j±k:dw”1PqŸ×ÿ­[BíX†j:`ƒ$v<ÕÝ>ÄÜ;É*yvÉ÷Øœ~^ôìž‚^eëìîuøöÚþårª¹éÅz2ÙΗ0€ çÎ?ÄT9'- è_Òeä,èzžõÝÏ rªÍnç“ô¨Ñ¶=.Ge?:Ð…@1nã®:RÙ6“EØÊIê·J—ªc‰‚9ë×ñ¤4d_[1Œ)ø¬I¡‰£–¹%z÷§p1´dX„ñ¢áA8Èä×QeríÙ”‚ 4+kìí§›ÊžSƒùæ³´*ÖyL—š…½ª ÜÛ¤ÁÇû#=iêÄìu‡â׆ô+C¤èv³NÉòù낹ÍckR]xÇN[Ö¸s ÁçÒ‹t Nj:ÚäA(hðp¤ŽµÒ›Õ:p‚xä|ŒŽA?¯J/ÐfB"¤ÛË“ßiÛïô5» °†ñ£•pºrE$º¡Ýõ5u(­Y„[dnÎ1Xz|/ܬåÀIìÖŒfжd%ÈüŠŽê$u ·'É.ïQ5¦¦<ÁÕ•3Ü@¥’!å|é¹€Î1T»“~ÃDJŒdcuúžÿ…ej6Ï$¬È»Ü”“ăÐãÒ®×ØÎVêss[´‰ˆÞIW<1'æ?ÝÉíY—;Pcaœg<ƒýÁíI]½·*”ÄD«;cÕç˜Í@„NÒ£*ÀOü³ÿ{éWv÷ t"*í Jõ(6ÿ«Á÷ªÒ µXŽ8àp½¿¦Ó^cWZêÒmŽÞNIU;çÅ6뙓cÉÜdÿ`ÊØî ß&JvŒŽ¸®+XÍÙX£UAÓo{Ö‘ÓA>æ;Hë…gùPñ“Âÿˆ¥ZI0wþ§µ&µ&EhÜâE8<‘ÈýjÔ†6x|Ö—h^Ï#ÛéUî-õ=Á¥[I# Ïž„ýßo¥o¶vQ¾P2ÝroÄV‹{¡ù b«ã§¡ô¨î#/6@8r3M§mC[œ¦¯ItTÄqŒqØþgG‚³Ÿ¾CQ+½^–)i¡ÒÛDÁ²Ä¯µ{“$t¯¬­;ÑM¢í£•0a‘R\2ù€zâ«95îIjÊSÜy-—Í2 ‹{‹…ˆH÷Äí"Õúq[A ‡Bâ³µZy<ƒó®—jP¹ .r°È/4ë™xÁ>µuí­dùÔ…±SOÙͶRŽ…YL!¶îQ%ЧkoiÜÏ’ú”nµwwêMD’î²phu•G ý›DêùR‡‘Q§$‚kQ²¹m©bÞY¡“|M´û¿u$Ð!$÷5të¸&“¢¤Ì+†,q’)Ë„ È­)ÖæÔN ÖH›R0¿…ÛÆnÑŠÖU53IêŠ×:]œ² ^0YzW)â¯[ø†ÇËXÀ`0:Vð«iXÎpêx­ïÂ)>ÔÑ«19ç¼ãÄ^ŸE¿ksœ{WZÐæjÆ~—¤ÞjšŒv6Ð3JçÍ{~™ðE­|?&©¬‚»P°CÁ$ ­Ãc̯¼­©d·°e·Ý„ qŠÝðœZÖ‹©Å[K±#¨ªR³Ø—£è} Ã77¶éqt|²Gݺx|' ®Ã¹½8\êÚ‘Ë®¨Ž¦›xf ÆÎqÍ\ÔtÛ-oJ0M(ŠåyŽ=êy®ùQ¥¬Œììtï(yæåÐá™8_§½uš¡§Þ‚ôù0 á‡4–ÚˆÖ]>Êð±Óßo9r?È­k]®š÷Wrù :&:Šv¸jŒG¶Eœìn‡¯­B’ª\í“*¾«Ò–ÃêK-íƒ)þñèKV-Ý´M¼Èã;Aæ–AÅ»y7÷m£qzV¸}ÂsŽ(@T¿{é,¤‘’£Œ’1\3-äÒ»Ü\•Îwy_{ØëM^Àü‹É»·Ÿa×× dæ·<9ªÜi—‚ÞEUŠc´y˜ON”4Ãdt‘‚á%•KJH'‘VÌ–Á‚€nc~hÅr–%¾Ô'›Ék„Œú{U£¢‹Û`¯0võ§,ê¿y™;S²Fl6w]÷•1&#ȫגÅHòlt¢Ê’k`w©fˆ-e{„g=jüHÒdžZJ-¤ï{‰Úö"žÀ²nSÈíSÛÄ«¸ã½‹æÔ$î¬BãiàÓLwuÖüL”´±=»,Œ9É>õ=Övœ{ó\ê.÷.ý ‰\ÆN3а„4asÅoÊôïÊ=P©õÓ;˜;Šð;ŒJ[K'l‚ qƒSLM®V‰_AwJè ‘ÉÅpz§Ãk kQ’îà`ç¸ë^œ{3‘¤GᯄúvâhoØ(œôý+½ñ%¢j޵@2‹ÜûÕsif'¹ xsOŽÄBm“§tªIá"…À´C(à+µT4*æ7á‰#…V4Ú}kAçX­B7c·ZUÔ\­˜·NÏò¨&«*¸*nóYÑ›rº.JÈlÒX¥¡‚k+rÌ€qX6p‡Ö ½ƒ´ž¥Jí½ÌÕý±ôI`’*AÇNõÖi¤zªÉúŠÇ$ŸÅÁÏøUu°™RÿE¼™ÖD–ß´ŠG5qnñFÎÃ=¹&‹æJÇÜä÷ÇSøõ¤1ü¨ïýhvNà¼ÎU§Tñ4ðrAù#•lÛ¬RHW§×Œÿ:ÐloÅoiufUcã$×›jöÑYjr¡Œà7(~fàsÅ$&mø[Äš^’^;»F–*ø‘Ÿç]Üú…õÄ[«kUÀmhÛ¯Ø!º–› :iA(g^©ý+1B5º¤˜Ü8 f–êÅlH…a ñ“×8¤[¸¤™¢¸Û†î:P¤âÖÒTP\ðžµFîQoy¼K€ÝI¢úê ±«o*þy#·zs\4¤Äà#ŽœÒÖÃÒæ4û–VÙ†QžER71Fû‚†9ÉãùÒØ[ì,©ÉÝÇÝ’;ô¬Mn!öut;W`0WÓë[-ÌUÑÀ]2FàÄÁUsåÿ–~¡½Mf—ŒŽ‚@|p;çž¾‚©ßsKw”ãæ(¸ïžûÇßÐU‹tÙÜÜd‡|n_ï·n=)nè‹bvQæxݶ³à~ôvlú õ hú.‰bº¦¡ÞO"ä3 QŸoþ¾j[Øo⧈íb¨ƒäAÍxûÚK„¸eRpIÜÐÑ{ê ì¼Ìíj~f˜ œÿ:ï5]>Ùt³_0ã“¶Až5¬èwÞJñÀÅçv8_ϵs® 6ݤc±íÿÖªz‡RH‰à@•\‰É#$zõ¿Âªé…º#Ø<«ÿüG;#t™õ®‘—b™ŒóÓ·ãN ĵÖÅ«7ó>e0<Ðúë¤´Òæ•’à•ELi»>€®fx‡@ƒS¼ó&ŒºªüÄ60¹ÿɵ²ŠÎo. `£šÆ³´nkvi•†Ç5,rƒ& Í|íggsÓ§µÇ__%´ß“Žõ5ú¼wíA"œrÇŠä[ÍEþD"ÜnŒ„Ô­íÃbU‘óІµáÖ®…®ÔŒ#ÿÖ®œ”v*Q¾âC]–šèœŽëZ0ÞÁdÉ.ê:óMr§ÏÔRæ~ê,½Ì7á_#‰ëL»Ó|øFž¼VÕ-PÎ-Å”›Ø[ƒÔŸZ³k;C!à×éãho½ «›ú`•í¹ËŽô·DyªJr$š5ˆîHD+²¨`8'·µ=[–ÈíœqSê ËpÁ™T¶„“ÇÒ³^ØFû¤ ?_LŠvB¿RÜ“ÕcaŽrIàõçV½:ɧ;"ÁÈÜGîÏ÷ºV±OK¦÷GœÍ ³˜þb~ößoùëÓŸ¥BÖ:çæùÁñýñëô¥m4.íîIo§Dì%Î]\ïã¸þU½¡ÙEkª[4ð‡xp®r«9îžÕnÖ·=Îóû8[[Mq§4¶Ñ U@ú1ƒõ¯/ñw‹dmLC:á«ÑÓ-èUŒ¯5çE¦#~@nõÉø™gkèü¸òõÎ d¯}J4üU]ÉŒ`/_¨¯CÔ§èX&U‡Öš©\]pZf‹yHŒJó\¾·à‹MÃO}u yä?»8ô¦· 4o•Âü¹èsøUȘõÝŽÙ'ô?Ò„í°eðs:ønà¢÷$sœž{ó])teÈb§8”÷ªz$'ÙZP†%éž8_îûWaa÷–¦H‘¶/¡îRÔ[ë«xìM£Z2·QæsÞ°![8â“ÎR¯ÛGk±QNúÛn>^EE4ÑG–õ¯›ªìÚèz”Ó²1îI3:.sŸJÀ’â[­M­{ÅОÕÅSE¾ìî™#ÙZZœÀŸ:òsQZêSËvXîÆo ,‘“¼Ùé)nd‘Â1\éO}:íç=Mur&Û¶Ç:“µ4T@žjÀWˆ€È­?gÊÓ@çu©—{“ÜGîÁæ‘mã#,Ý8¹¥æù‹Oݱ^âÝÁ#ñ¨ÖÖ;Š`Öµ’‚݆ºîodS¡Œî!Æa'gbºRZ¢šWUŽ}+'+'bâ®'’ξb’=*H“õ5«Ñ_¹%™§µ>,sž+eQJv2qÒæŒÁéS"íbäñ]¨çz”y©¸.Ö©¤Ž•œÝ´î;XÜÓ®Ú+7Œ/ËÞ ûwIN>•~ÙE$.K¶Cq¬<ƒMǸÍdηW,[÷Ïzå›ut‰¤R†Œa˜ü¤íV“N¾·JMwt¡Ñ”•îšNÈÕ‰­aU[b:RýŽÞóþ=®ŸC]P„ZäZ3I§vcêi{¦Îw/b1T,µýÓ,i,N1޵ÑRœù åÊ<Èéd—P{4yá)r­[°Ò¥¼³k–Bâ?ã^”nÖ§3ò1®Î6– vHké2 l´sþFûKæUÀ=@éíU|ï;X‘Ð8úÕ0¶·8ßE¶Ê)Ò<cóÁÁéŠ]*á籊`GÌ£!i5}C™Í 8äÿ>´]—»Ð¦‰‰Îr=GÓ?BóÛÔóI Ç)1R§ÀÁÿu‡-ú ³m ·¸ìpq‚p3ÛßÖ–IÎûÃ~(Ô¢ ‚á‘EÆ1ÛQjQÃ%ÈÔ!ÇÚåÔ|Ü“ÏÒ¡­J]ÑfdfŠAᜟ‘­4¶ŒåŒ’ñÎ œjƒ³½Í=6BY^<ŽÇvjÕê9 Oj”ÑV{4BÍ…€Ç¹ü©âQ¡€=i¹w'QŽÅW;xõašÉ½‘ŠÜlôý*w!Œ«ǰ,=>µ‹ªÜµ‘Pç*@$ŸŸýŸzÕtL‹jyìéûÙ ‰».Ñ· ç‘õ¨ÕÝ8rÇ.## {m9üñWk=IKK#ZȬ­‰„$ó¿ÿ„·§8Áƺ/êúxÔžmbHÝc;ÙY€ÉìóžjJæ:¯üB´ºk\§—áR26¨íyV£q¹söØÜÉ€sǾ;Ò•ú—ØÙ–æH´¡y&Lh¹8Ž?ÏËérJÑ=›ÍžÇ56¸ü‰¬üGWQµº˜ S“…7û¼ðGzôxõ[}FÉ22¬0i±.·0Äéiyæ'Ì«Ëk?Ä^0Ðuu·$(ˆrOj#ÏïáÒÉólÉïò‘Ч’xvö>ßJ¥ª± Ýêz÷ƒÊÂ;*yÉ=O¨?Òº[dó$ `O8ÿ[FÖ·Qú–­´XÈ/ýâ{zýkÔ|,rhlˆ2CÎÜuç¯zÊJÃ9/<°ë,B“ÀÖ²q¨ØöïYÕ×CHé©UíÚØÇ8¨ü…v S¥x¾;3Ò¦í xD°y¢ãiÀ+²Ö´È&1àùÆ+òÆw“; ¤ã¡¡”ºÔ®ö¿"Ë0Åmi>ŽÆq,ŒëxjÔÌ'+>SbêÞæf …¦jºEYÇV&®Nm¶‰÷,‘®Z-ˆ&B½,¤(ÝíŒã£!RÑŒ’·¾Xc×"¹Ôå5gÐÝǪ-Ioº¾•P) ƒM§\Ñ=Œ²ç¥_šr‘çÖ»£Q¨Ý˜µ¨è¤Üàc5T¦ÉI-Á£™;4+XЊëm±‰Tn=ëádË8e»zV5á+®…ÓjÚ™¾p·Ê¸$x ¹etÒŒ+|¾õ“‹² ‰nnEs§¤`Gš_SÐUèç.¡\•ìE«Z' L°ÚU¥Ê‰ KúTŸØ¨ê#š¯ÚD«öië¿ùËK·ˆ¼ªº=Ž˺Jî®lîlîB²²ËzVR§&å©”š’Ðô)'¿æFhÎ2ãA[Ýñ²ÓRÞ*Úˆé]½ O<ÕYÞ í"\ñŽÿýjŸOÔ.F‘ä"íb0qÁÿõÐ$ô+ÈÌ<°HVèw‘žÝù©wÈ„’à öÿ?Ò[ÔO{÷‹ÐM£H»‰Ç¨Îxé\߃nãh䳑ðG UµìUúƒ©¤ç¦?Æ£2Dq×¥N¶·g-¬Y ½2ˆö«¾ ž}ñÇæk1Ñ@Ø0‹¡qž½ˆ^Ø÷§w!;v6¼:ÉËÆËþYƒÓZÓºO.áæ pz‚zRo°'й¡L²»A¼çlÝ‚=bÏ"ŒÛ›ßœý1V—Q;lWhž @‘±Õˆ8?ïv¬MO +¯+“Œxc½h¤¯s7¥ÑÆÉ¬‘¢œb7e^Ÿídàh QB*5(,s«ð*“¸–º—‡‘ €‰¦aŒ€IqëÎMÎöê­ÛÔÇp$ñéQuÍ©¥´)Þ™›k8‡îç§¿Ò·ü6óØÜˆRÝWÌईÖõÉ4ž÷céc´¼²Ô"ðËÜZ%ÎÒ'éõ¯6ÖíÞð}˜œ¿Bi;õ@®_‹PÓâ\ª¼ØŽ>ÕÚèןjÓÂ…T8ªºÜ5C$VÓà•b9ÿó‰ ‘ÉÄôÏ4t¸ÞÂA¸t'Žùÿ<ÕõPdsŽrnz—‚¤Y4O)Ÿ"6 Žr9Î~£5ÛZÀ6Ö^N6ÿµøÖÊÚX‘zÒÀÈùbÒrFxÿ¯]…ž¹&‰¦=µŠE·?7'8¡¤ôÞÇ9=Üú£=ÕÛ´Ò“×U«È¡‡g” õ#¥rÔvÔ肾ˆsšMÁx¨®l/½ym{£¶žªÇ=s¥¬êìÇ,ç M¤ø#N³‚[»Ý¯+”vÉJ„g+Ë¡Öë8ÆÈÖ‚ÒÞÛ O§b+YY¾i2+IC›H»]u-Ç‹ B¹=ˆ¹mfÍd*é©6i!'ÒD±—Ï5žmJ.ÃÎ*œyw&÷Ð¥-®3ÅRh°H<šäœRÔÙ;¢³‚ _ZlvÒ3`Šá”¥-­¬õ,­‹`çƒJ¡Óåa]4ÓOROVA-¸S¹N¦)VÞf ù}ê}”›qˆù£k²vH©£~ðÇÔÖÞÇ[Ü•-ËG++¶³åd–Sµ—iô5ƒ½ŽÆW-fã–8Î8úWžøz÷ìšê—šž‚zž§|ƒn$u c•€rAÂÃî3þy ìgëz=‰9èÏé׿ó®7ýpÚªX}ÐJä}0¦ÄÓ¶…»)ü›„W&$ÎݹOm¢º)д|¤zcð©–š"S#ÒXC¨' ÐpkµI–HÆÞTu&ަ.ƒ$žDË@О~+:òîK‹r$€yÈ£¥…¶…Ý1Ù­hÜ}qŠÔ%°AnüE%¦À¼Ç,cf1·=ÎdÝÇ r3=qò’yúR½Õ¶ftò›çÎ8àçÒ°5I[¸(Jçc%[·§¢¾ä_[£™du;$ üê»z}·z«rí/ L™$ XðO¡ÏÕ÷@ž¥x,‘`mànpKIÂú©­Wf ;ƒ·8ÀoE`?Æ…æ^»›—N‹V¯&Dãn@+ø‘Œ­zOö6} ›Mدà®y>™ÆqùT§v=ÍA¥]]Ø,Ú“´‹ú´Q×מõâ¾5Ò.WÉ@vÏAN×ǵ³$›Tò;+Ò¼ÐâÛË·ÐÒÓ¨´ØÑ»±Y¦e9ØF0{×?â }+Iò` ˜yÀÉÿ¤•îS8r’FyÆAÿ<Õ”pNi¢/esѾܪ¼Ð¸ã;ÇžÙúÿzŠOQf>À~¸­V±w o¡,”’f$UG'ŸÃÔVÞ›d÷‚U‡\gùPÕö©bæÅíIo$„n¸²§‰ ýëBBž•ÍZ-ÂÖ6¦ìîÝ£° 6Ôó\@P!ë^’³ç={+’Áæ†3 ÐVl`¸–ÓÉ–CÁÉ#½aïsY=,Na1 «V¨å·3¢«•ó(Ü,oج20É®¨ÇnÖ€î]ôm«0›{Òʱ—UÁ“4¬)JÝœŽÞâ¨Ìƒ–^k–º÷M`ý⵬V>û¹@èkˆ´ç‹6Ó|p1\ôiB*òz³IɽІ17võª7·°I*¨£ ´PÑ“vÝ‘MoSªÇ¸R¶ ›A#íSíã…ò7ÔD¾·o•sº‡”:ìŽo­sûK»G¨ìÒ»3§Ú+\þµNÑÎ ¶ážµƒ‹SX¾e±²’¬1ùV°dƒŠëо¬æjÎÅÁLw$Q#ª'Þ•-¨Êö*Í«7Is´äµšÅ¡ 줎Õ<Íê[ oºcA´zâ¯AI0W*:Œ×m}ZÜÆo§aóýÇ®)–v·iSi¨HŠÝ‰«’»÷™Ó]NŒ^Ìcû¢>qÒOZH.ͬ¢6ÏÝ9­”›iË}™-%±vúðKjQ#½srß-£;6 cÁ­ªM¯xÎ*úá{›Ù¼Â.xÀ©/¬¯L$,s°ÿpŠÓ '(óHŠ›èqZšO¡]0ÙçxiõÅjY®-ž[¿Ív»îŒ }BWM@(Œ²[n÷éÐUطÞÿ(ÆiùØæ|l#}-% gïz{}=kËšFŠæ9ýÂïùTÞÚ¡õÔö=qu¥C"ÉÁ\úæ¯Wb§¡8ã>ü LLkZÄ tBq˜rp÷Q„Æ7¨ÿˆzrz÷éBõæWŒ’róÔ0<·®UF+¨³\ÚvÁ*zl%¹P±ŠñUIÀn~l×GË$9IùÅCì^»‹Ä`>'v2?:tÌ6£ÏAÔUuDÝty”Äb SЊÝR¡ÀÇpyÅL†;y?tê+7Q‡Ì;ÎXý3ÇБBjæ=ÎÀ¸ Aǘôê@®_UbY<°¨ øÂŽá³üÍh®CJƾSlD¢¨à–ˆw=;ÔIˆ×{W=N{s‚iîMúÛR)¤Þ­û³Á†c”=±ØþU‹u9yy'8p¼1ü¨¹qÛB”ÏpCT É zŠôo x¹ô¥× çÁ<Ì·Øžÿ­.U¹G±Dªéͪ|09œW”üM`EK4 Æežô\vìy K‰99näãó5Þx>åCË1ÞF@ÿ=)hG=ÚDÅÛ$ŽI®_¼†îᦊäÉžyü=…;“ès5óÓåÈô¥ÃÀã>§y $u¾ÔÃPŽ@0ò²žÿýzõû9ñ,ŒX‚Aœ~"¶JäÞæ¥¬@˜A…Æpž¾£ü*Õµü°MæÛȪGLœäÿJ¶ôIÎÆÏUMZÁ£™³p§%@ÿ?áX:·’ú^ìrGOʹê&ãØÖ/Sågr8éš«<êSÌ‘I'î€kç*ßfzÔ‘~Þå×Ë)°žø©¬îÑÈr ëžµœ7O`–í>iXyDÝZ…¥÷Vöæô#KjhA2DÀ“š¿¦ ØA ]Q’ŠÐͦ÷#–â7$GÖ©Ì·L¤¬\v¨¨›^ép}+ÍnñùÏÌk!îÌlT©?Jæ“å’LÑj®ŠRêŠ2Æ?¼ME£ŸlW!_ëYNüÊOBâ½Û]3ÈA ·SŠÁ¼‘Õ÷TãÞ±©7wsZqC#׌xGc¾[“Vá.6*ã’M?j¦„éÙèSµÔ¡{¼!RSWnµ‹h“dJ Öj¤mr¥ 6жÉ>¢ÄBœsW,í˜\4R¶ šJI7 œ’mqÆÝÈbÚ-ˆqÞ»"¹^§4µ6¢òÌBW#Jp²?<jR¦›»Ø#>‚¥¼*9çÐUkˆã'.ƒqQI¤fÛ*I»…°=¤FHC¹5¬¥{™»Ø±v¿j…„1—Àå€äT]Ú#K¸í95¤ å;Ä’Ve‹ÍR'•qÄ€pǽsÒx€J²±@¾CeNzÔNkRã.O/Šc–Õ[$‚6œS¢ºŽæ%c–°)ûE=ÉqåÔëô+Ëcó*0è­ŠÔ¾Öí¤ˆàŽêkÑ ×"³9fµ»<ÿ^½Š}û`RzncúÖu®ÔO'šé^fnöЩ} äKžùéß×éI caƒ“ÇOzÒúäs:,4¸ÎsÉí^_"îä;ò:{Ô-®Dz?‚îüÝ,ÛÜb8½ë«ÀÉéÓ?€ÏZZXd­o+€å˜Žã®GZ„C|Ò§ ?àC9¤šÕ[áD¬Wøå€$†£€+sFºFó-Lk´zr=N8Ñ©)«–æŽßÌN{ñÐÿJ¾Œ‹rǹwEíÏ_µ¼I%·ˆìå½y 4«û¤t§¢ÑŠög…\"[ÞÉE—ÝòŒð?ƺO Éäß8y>}£*;ýM%¹Zt5õ¹]àrr}‡5ż °¼ë‚sÓ?OjkG¨®dÜnf ~l÷Ï_Cì)Öäõ_J=ö7¬]T€ÊNPrG¸÷¯VðÕÛ]éãÍ û¾Òzv<Ö·×B–ÈÚE‰N8õæ’éÏÌO©Æ1þ¢JÚ݉4‹«›;µ™$Àa’$¡ëøWb—=ÖœòËûOažsþ‚{ì—c‹¼gk‡QªŽ€*¤.nJ.ãî€:W‰‰¢Ô®¶=3÷lûU2¢N0GJÝÒlƒ-ÀgsÉð+‚ ÎZs´cttÐ ")'°Z_- à{ÞOÞÐÁmf86Ü—#J_;<­8®âw”©ÜÇm]‹R}›AÊÖÍÛK’¬÷,‹t6mÇÖ³.4§ÆÄ:×Zr“N'Dd‘ÁkPi÷¯ÝÍy—‹¯õ]2ùZÖFŠ#ÎêŠw%®¬ÒuZilŒ|m©BNÛæ‘ñë[º'‰nuLS†ÜO¥i_ ew¨F¢gnº`žsFInk)í樂¢FË©¯+‘«¤Ž¨Êë™'†ô¸Ds\_ù™(QÁükWƒÈºiÃí?(ô«•5È—Q)¾gØë4Í^ÖßJ2 rǓϵbh>'±¿Õ$ˆÎ¡Ëq“^ZmÂ(àŒäÏ@;(*A\g"šÐ±íR¢ùX;hÐÕždŒÃ»¿Ô°JHÚ[-ë\|òv‰­’÷‘1vWå³ëQÜß[¢í·zìŒù¼s»ßBº\¾æ=9VIqUúšÒ Ëb–澞ë.뎤W9âß[è¶S‹gPäcoÖ½$£s¯+XñËêW—M3.:ç°Ítº¤Z”RÄËb2@=ëË”“o˜ô-et5ÚºÛǃÔõÅwš=½»¬j_k0EUó6¤aQÙi©Õ¾†«š#½r¤ Í™ìÈu=95ëÓ§½ÄÛg+¬¼1É„}ëžž”ý?-l¸{œãƒë]HÁ»ä Ú—'iŒã²í®‚·”èt þ|õªz‹ÌÅñ”-.Š«ÀÃàvõ¯0™–Ú(öàò[o'èqQÐwînø&ì[ë&ÝŸ`ÀñŸoÈשÈÏ ×¯ZjýքžS 2¢uàt÷æ±üAlÆ(äÝ€-»§ä:NÏ`MØå.%.»UcCÉd$ƒë– øT– ÂJ>`Üsß'‡Ý“ÖçU9.«19{·ÿZ£±¥wLm òwR–…-Mdå·cŽÜût¢G“iUŸìÿ*=ß`Ó®ª 펋]R‚Týå^”®Šäe¸üI¢H±‘Œ‘Ž¿1m¹“«„kO´Æð¹Þ£1Ïoê+Î.‹IrÍ¿#îÝ—Ðüß‘­5µÑ=ÊsìQò8„(À$ŒÄ=œÕ #$²È…xÉW8 ¿ìäõ?J­°Öš•qá´/Bvò¡è*ŒŠä&sÉ,@FÄãô¬·ÎÃFåä» §ƒ»OãÉ<(Á÷òŸ›å èAn*o]E«6ì˘ü§h•þò7£€TÕ«‰Ëí‚9Y~Jo݃»éJÖq~$³6×bEƒÜúÒxeÐjÈX€pqób¥«hËó:-ju[w-Ç8{×0$7™[¶}©­¬GS:åpØà“ŒŽ¾ßJl-×ßš{læ­¤¸ ±ãõü=ë¿ð­ìÞ$HTã2zëT–—–碩M¥–?œŽJõÿ>Ôõ‘Azõcìkf®ˆæcep…c]Ììp@ê}xõü³SÚy¡L‰…Áà—J™]£D\‡[H£x&a“ÁsXqÞð7“¦Ã Ý‚C:Œîï[Ö½e©”'¥ÙÞÛxj;hφP:TÃJҤʘÕ~‚¸a‡¶èéuB•Æoåº[˵a^cã+P†?"Ö”7p:{ÒxdårÕkhpšvŸ©Î×VwIë\Lí.‘¯ˆ„Œ%]’£îØæ[IŸTø.á¯ü=k,§q(2sÞºYìJÆ/¹¥IXÑK[3&[cçnȦ˜Ö*ò•;MÉ›¹]Y/5Š"íì+8ï¯f/µ±ïÀSr”B6Š»:+M>áÆ”¶8UË3V‰‹Km"Æ;ŠèöSŒ;˜©E½GA"A•ó6¾:0¬/è6ÚÅœ­2!Þº£iG–ä6âîy­•–—e,ÖD•—;Jžõv*[µh³»¨aÐWUFéEõ:ùšE©u´¶˜,‹ºEì+WEñBð;Çòç‘ZÓ©­ §Ö‡ ù‘_ÙùštáºÍúWzu¸îš+˜J®~úó^¼#wu±Ã&öfE˰Ÿi—'Ñé[S²ZÄUKç»Èüë±'ÐÁܹ"‰äu ÿúë)íÞ9÷*ïñÉçõäÕlìÚæ7‹°t,©$œçÒ¼¶UÁÇ8ë¹Ï¸â¡ù‘>1µÖídãxnìO_¥{(GeF@`1ÇëÍ+.¨­vEŒNxRîIéǰ5GU·iôÇ å– û4z!&ŽP‘·#Ìç§$žiK”Ã’ÏÞôçÕ»}5¦äËWc­Óî$šÀ3¦æ{¿êjKva¨,láðqÛñ¨»{š"ê/—.ÂHäúÿõég}§åÃc€qúS½®‰–›[ÈßÚŸ/œÃoåžk«ˆ>ÜÏâqŠŸR•ìX\ì7ÓÆ‡Ê0sÁÀâš‘†%I´ß$îfZã56³bH'™ˆcïÉ8ü\\’ÐÏcq·v3Ê›r q^<—V·~ZeâÇjÎpp—2êZ|ÊÍœÿˆ4(®1«[¸˜(æ©ZÝF``ñîã»×%XÅTvêtFî>‡¨A}=û´Q2Fyãß½9ÑĤg¨ÈÆHoÐUiÔVÐB‹ ¶ôn1…ý9®š`Š6äœHâ¤5¾£â}ÎÙˆ¯¯ËýM=ÕÏ)×§jH7ÜâšäÆË mÇuTu5I"!X+ÜdãÛƒüiЛݜÔÊÜ–` ¿ê×ÓƒéT$,ŠTá@(O 3Ñ9·v°"7Úà2I` ÀÏe šÏxÜÊbXÇ| ¾¬ÿÒé­J¿AÕp†|ü¼õ••yýjT ™Œ$Ø…*{°ÎI’×AjÝKu ‰1¸ºîÀC™à,r[¾=ªìÅJ¶&ÞY9PÜ8þøUà0Ç|ÓkK æ¶…‹hžëDž\ år0úWžÚFñx„!äÆèÐÒñ¬²¨?)Çê=땆JjíY"YŠrà=Í]µŒgíù{zK}¥‹á0sèOqôõ>µ³§ò «co^û9þá­â•Èõ; ûËo!È(Ç…?yO¡ëøWQM»pb«Ô¿½hÖº¬8ÆÒ°AŒ©9ülzµ¢î‹ Üg‚OåÒ„õ»¶Ðæµ§1ÚbË–ç±údÖ߆᳹¶DWAÏ=놴Zågc¥šÍæpr¢¥QˆˆÂ¯á^léûͳ±JÚìÄ0 *ýi×2’à!5;-jìÄ è 6?¯*³ ËÖ³“v·R⺖-mخ隺mý+Ji¨£9jôªÀëôª·“å#컆¤(«"üÇšlŠ0£5?Œ7Ôu” JìbµÅì1rNMZ“[Š×'n#óx÷ªOpÓ9–CÈ­“{¥ôo*™Ã±Èj=ü[@Ej¸´•Ù} ÌïàºÕ{©nŠå@U^I5O™¢l¯©Ïê:”× ´J~^0*ŒW—(ÀüÇð¬ùõÑ—BÌRÁ4ß¿^½s["Á öóFƒéXÊ »¢¹¬µ-Zé×B<¤AóüLk:ÿB¿Ë+¢@)û9Jerªi:½¯ïç#û†¶ôÛûÈæÞ¤w5R¦ìÊv’º,j7+³l²óŽýëÌõD™5!@Pky;¢"c¤s-ì‘+f9Ì=ëûKÔ-ewHË)9çÕ‹–ÇDd¯c ïNÖ/˜ˆã ¾í¶³§ðÝݰ2Iv ÷ hŒe-P]lEiªËi ŠBz|Â¥ñ‹mâÓZ‚“nGZî¡'{H檺#…ðwŠ£¼Õ¤†y0l'?ÆXœžòö¯N/MNFšÜÖP£0{ãµR˜8>øê)6¬W1¼M¶ƒ;“ÈÉ= y( ü sÁ ÓßÞ¤zt+Ë/ŽQsŒáýGëž¹hÊ_$ \Ö‡¸&j™eU ©»žà?§ãRùŽQC…Éä• ²Ž]IWQpÊG¨Úvã¶2qõ¬´BÈ2ÁãÆFÈol?Z<„”z2å¬ïöØö/NCÁõoük ÔT<1H…Õ€¤Û`»3f#ºÂ)‰ÜÁ ÛòÅE,*ì SÎqœúä·JZ½ è,¨ê¼ÝØoá<sŒ èìÆ"I;ˆ“úÓµž¢- †>¼sNÞYH~ƒð¥~ÂßSÌæ¸òõ¼689çÓž=úÕéËIf)㜜ÿŸÇéZ-.Ù6Ocž¼ŒÆýUOUÜ>ï«`…ü«Ã&À\|ê‚Ê:ï¸öÍRž„,ÅOšA#íݹ}Icã:‘‹o`§%X–+鎃ò£}ŠÑh3çÝ·#æÏ@6¹ïÓŠtM1¦@\ ûl4z½†ŸCN ¨åF&_™ÔG÷fŽHúÕâ L6.C}Þû×hÆp3V»‰Ý“i’½ëNÍNT$jA@#ƒþÇûµi=ѹ» Æ'I#V89ðXwÜv®ÎÆh®-Òh¤Êc%Ehô’A¾ äoÀÀ~¹©]RH¼·Î@ÀޱÀ«K[ô ˜„HИ³qò€?Ǹ­Ïx^þ0×72ŽC¹S$šå©kC{³ÐçÓͼK–<ôYæ<×(ÞVgZd2Y”9Î)›v6_íXò´Íì$ÌrGµ^#ºAóþƒÖJÆ‹kš±*&§E,ØçÙ¬bûŽ; ŠÕi¦ŽlîAšÉ¦÷h¬c\৆ØÈq’A+5Ùi«XæµVv°®·=oM×’].6 󨮯o.SÊŽ?Ý·Þ#­sÔ––ˆâµÔ}¥„jTÇ~¥Xf¯ÊÍ{^ÉKvÀ¥OÝZ--^¦\дĔµÛô¶·Ú•e¨¦:R”oªÐIØëÅ·îGq$œt À¼¿ÔídaeõcšR掱ԥihôÃ\˜Í™âòùä`Ö¬×w#tmåÍŒäU&§x—ž‡7~¾Îå€álWŸ_Ë}ó¬…ž xúVO¡¢ÙKvAöëwGßSYóøÎ2å ÷ XNV^éæ&£â'üz€ÛÆjºÕíº¼Ò»œsê*à”݈“¶¬òÍoâ ËÎÑÅÖS÷®[PñV§©Û.d„u¯EFÎèÁ½JšF¥>—©Áz…²Œ^¢¾¸øyâ(5Í\$‹¼avƒžqÓž§ð­£½™›Hî#™˜r_v2Ò2=zSnP˜ÆX_åXת#ù²û°9Ü}FOOQMé¨u3eÿÎÇ<–SìLU;ŒïÈ›8V,/«c’ER×`Ñh@Ë·†BÀ€qŽ ú‚{Ÿ¥Y˜°Ár~PI"CÙ_ëBów/•¡V  䈛 ¹Ldõ-ž«õ­%r0¢Aò7+¸‡éþ ;~µ¢³z-IÑhÍ¿,ù$€Í¸d°8fÞÿxWMáùÓkC7—æ+d ‚zú`Õi¹)4¬t‡{I’€À éQN²2Xz®O#ҭݽCrš(Šñf–-ÿ0$€pÞ‡ŸÖ½ ÃRO)YT)À W-T÷5ƒ¾ˆÝÝ_\äÊ€éZI$0ª¨}ïÜמßY3®ÊÖE{ù‘9^xô¬²Þsd’e/åE"]ѰÚi‘@žfõCõ&¹ÜѪnÚ—Ô°ãmIö§„ä}*ÝGy/¹2Ê÷HKà ©$Hïw§Î¤“bå舸^õ"ÌʹŠißD¶§ã>]BÕŠ¹ë^5 Û3Ä™ÁëŠé¡tÛ ¿uXçYšBÍÎ*‘b|î?OZëô0D¶²›™B'ôÍz†-„1Æ/.¡Eê˜f“j×b—cÖ¬õ x"H”†€k]uˆ†UÀ5ç{h¹iÐÕEÛRäWbCæ+쓱r\¤ž]ìFEþð=+{òëÐÍ«šíwYÈI<í5Jå·Í—'®:ÖÚXÏ©vÆææ À:SïuÆŽ2Fñ36>FÎU«Èoöô%¶ãpǦ?ZÐw6`uQæ±i€Ù Ëz8Àý*íÂÅÄlLà¨8TÏýßëTšµ˜®wÆÕ(¬ù•8·¶$]Ç=¨åMnÍ3AlRH6¤A:ÖMÍ‹Æì~ö:š©S\» JìËvUm«fíI,>R‚O>ž•ÍyÝl/mYvX¶–ÎáŒWx¦êÚÊC¹zïÃZ-¦Èš¼t<ÇSÔÑ$ó#+Ï@+ çTrr zì½ÎQöׯ¹\6šõχ^ŸPÔ ¼¿˜„c”By5œÓq±JIç.”`¼ˆBÅ Ó¿UŠ%]¼Ö¼ÞTœ™µïdg[ݘ_k“ŽÙ­¨åYvípO½§¥˜§nJX£‚ŒPCVæ¿v¶€ÜnõÛa"u‹Ò|¡nõ­[F6ëÑŸQZÝÉjE’-αƹ×° ¤f#*êzŒÔôÜ­7%¼H¯áÜãË”¥p:±¿ŒÉ‘ÇÝlVs¾ñE+lÌ«sºæÛ¸*jÝ¥†øä·gJ«ô§Ì‘.Ö¹Âx–ö"&Ñ5ðb)Û¬g¶O§½|ÕãËX,®ÚÞ@®s˜ä^â·K¹t<ôžp Oh¥¯adïΉü,G¥ëþ–åínçÊŰ:ž+Ò~F¶0Ém ìQÐ×>J1Hª¾óv=’Ù–‘êyX—ç„«à’z/§¯zô= ’²²(NåíeŒáŽÂ#§äO˜ïe‹îåÊíÏÓ¯Z•¨ž¨‘Âlã 1ÛÃ߃Ҷ<4cSš6MÛ—pl{õéïI‹Ìî™e‘Ô!ùGR¸þµ+;î e€Núu¥§R®’º Ô’Y¬¦UDmÈRGÏ퓚óÆ-(rÄõ-œcЕióvÒú‘‚HR¥v0:é…ÀúsZ:8SxøÀr2‡>ßΓÔjÆí£ }j'`y8ëúWI2¦â]0§žyüiy{+•Ý Tûà/Þü‡Zµ¥oXJ—Ï8 Ž”‘/]Q° ''¦Iü¸©7ãqíƒÖy#Äcb¸-„¶pFÒ§×',GµlYŽC’»z‚O?ï1ƒVô2V¾¬Ù’V0*=A‡ò`?*À»„±Éðr’;öäzS²µËwîfbâ>oÐÑ{«šØ†`€“…$€pÛW ô{Vÿ‡K‹y"yÕÔòâsõ4IuêW©ÀøÞÝàÖãä:W,¡”Nßþº‹4"Äe[3¸Ö•¾CŸo¯ùíDtÐ~F´[JýÖÇg’?>¾µ¡móÈ3œ u{ Þ)ng¥ËñÌÍûÃò”ç<|¹ãwNý1V<`d*Ø*AÂÿ²x)ëõ¡$ޤߡßh÷BïMŠEÀÁÜ0O¨«—”aW“è*´°ÞìÇi·9»WßÛë]N}oåùA¶œuf²¬¬¬k¶t2dÀýjϲuË· +Í–×gLnPas<ÇæÚ¤óO0¡m®ØQØÅ'+ÜÓkˆ¡MÈçIo>æÆp;ÔI(ì5®¦µ»ÂË'ûÆž÷‘À~UÜÞ‚©rÅs ¦Ý®Y·ºšìrÛv¤» NòW‘vFLÊ‘‚ÀŒúÕd~Ý+6­£+s;ìy!‘‡ËØb¸_øRÞæÕÏ•‰±•⪎žó­sæX\XßI¨T)ô®|#…ÇzÇ;,À]$SwœWÔ_ôDؾ³¨«~"ßü#Ö“nöc²Qg­H’=Ë(éÜÔzˆkƒ‚GOjâiµ+—Øæn&š%&UàjÚy%ˆd=Zビ•º–ö¸—²ÚJY ü,+ZÃZÓî@V•U½ÍuSš½¤g(»]ŽÖÆ=ë7oá5Tk>@ÚÒ_qšô´osŸ–åK­RþRÖ-£ÕjÍ•ÝûH¦PXwö®u9_CF•µ:a¨ÛÍn±Ì½3\¿ˆ&b-o#¶;WCz]õÔá®&FnâB6óÅy—¾!1·òÃY\EÈ‘0¨O¡nÖ¹äZßÅ=GUòÒï÷Ì£k?÷«ÏµBmB饑‰9­õfZl†Xé÷:…À†Ý2{žÂ½Þµ²•&¸Q,Àç‘ÀúTÏf…æzž£j“iñ«ÅÀPQZ¶ŽÝ‚ì#{þ½e„IRŠª×;±è±åqœÏõ«¦R‹°£)=òp=¹Åw]´bT¼Å(rAç#úë^Kwkpº¤ì±9PøÈþ½}*4½†žšÃ1a¶±8È?Þ5oãñlrPƒ¿åÀÁr¥è³i™$ѦÑÌ§Ž„û©æWFy'ž= mB;è1£ Pçc©a±õàqù×ßǶê@Á3»Œó3Å4Þ—nR Æw)$€ãw·<þ•%”§íÑ4€ñ¬A{‘ü¨óDG}Ž‚WT¸…”ò#8ýk¬$˜csÀa‚sš´4V¹^LªžËêýtý.UÃzçüÿ‘EÛ[ ™ƒ© :ûf¦. msŒñÀ#šK@}@!RÇ1œ‘Ÿ¸G¨ã-íVíä°c+Èà†Ê“Û¯Ý÷­7%´Ù½nˆ@À$ôüÇõª×hÁK}ö’É£mÊw³2fBXnþ& ‘ôÛÏçYW@y™!e$È¥z}TöÅ\o'v%¦…@ÌfS K+°}³äôÞµyD„ȪT†pœ7f\žGLÒCÐ'RŽAÚ¾Æ^¿ßRAW4""ÔÇÈåœpĘvl±ÎOÒªM}–'n¥OˆV!ÑnTò&¼Õ òœ`÷þUV_M £ ¨#°ãôü+RÑAsBvdù£fÁÜCïÏqõïWFV ÇiÝÇtÿñ>õª°6J²mŽÈìv“ëõíV£`ÚŠ¸éþÁãéÍ^êÄiµŽËÂWNþu»+÷”€rÞ¿—«¡¸fl Œ9Ç8îö¦˜u1¥Ë9glä¿íp? ¿¤_pÿʲ©~[•ÎóM†?,­×¬Ån#M)ç8Q\ºju&ĺ.àTMÀoJÍ­JOK™×6àvŽÕrÄÇ95†Žnæ«c_t’Eû´ÂúÔ"ºúUM6(ؽÅm@+"óWˆ¹ŽØŸÛ¥MZ‘§ìq‹›2${‹‰‡Úºä"ô«±Á5Ì‹ &qÆòø·fÍ%ÔÝ·´[h°Ã8«ÃÜ¡v] la¼,ñ¿ÃHõ¨Þh0²žqë^Moð[’üÛ¤x$àÐ×U>k+Xõ ~ÏkñÞk×jQNï);û÷(RÇF°K8”*.Ðc”×&²z±_ŸE±em°7n0_+„¿Õ$¶ÔÌó8Ï¥aV|‘LÒ îÃåšÒd ';»Õ¦ÜZ±¹Óg÷Úy°åR•ãº-;+=‰¬µXõ ®§f›Ç#­^ ZÌ ØŸ)û/j覕MZÕÊðvè23T³<‚ëîÜVN§s(˜#!Œg“Zµ%š2ºnè»kqz‘¬ÖÒÔ×i¢ÞÃqÂ#r1E)5+KaÉv2BÏ$GÉÔzã5¹$µ,®À0éÏQ[ôº3]™ÆjW70éSMi&T©,™¯’‡‰…;‚ Âã…ïj‚lE˜.sõ^zš{h$‘œÇk0eRJȇ` ïëNPå€Q½ØávŽ$?Ü œUÝZõö-$nfó Ge$Täãm]ˆlT €HS"¨1úç¯Þ‡µú‹qÅ‚îb|±Ó‡?ºÿgÐûTÚs4:¤nÀÝó ù~c霱¢NËDV–7¼Oh·ZD‡;sÓ¯µx¬‘ùw/RH=JÍt£®¯oóëZ6Îà [?¦iu6­ä,ŒW®q¹ã?J¼£ä»Hèq÷;×Ri¤˜·ß8åÏn=}Açò«À‚K’6ã88þé÷÷«³Ü‹3oÃ7~^¹dâQ‚Àãxÿ•è·Ncä®W¿¯Ö¡!;¥©•33ä†P^éÈ5˜hnÉ?‘¢qmhRÑèz.‘S&æ?¥mÅjÆuo É>•ÀÓ±Ò™bîÐMŽv¨éšŠÖ;xK36@¨åW)4c_«^Ý™V=©À÷ª’L#ùc\kžVø™ªì‰WU¹UD½z“Z¶»Œ[ÜîcúP¤äïÐ-dA<&æBŽûS¿½E¾%Í­Œ«‘XÎ6no~…¦öèM›å7fù¡=ªõ¤-nçpÚ¦1QµŠnè·)ùv“õ®zùÖ7.A5¬šH„‘›;¼±na¶³`»oítŠN94R¨î)E3´Œ\4J ȧ}…‹ª°Éc’O¥W–¢NÈØšD’ÈGá`Wž_èçP¾77=+:ÿ¼ŠC¦ù[f=ŒM ãé׊C)ŸQS™¤†ðØ«bCÊçø«WåWßbç¹·c£E¨Æ×l£ÃÖ›§_éÙY\´gEv*m{Ëæbå}Æj^"Õ,n ‹Ó"QÛÒ°n¼C=üà´œÿtTJ£J׊Ýú&©4Lñ³'­w:^©§Þ8·ûv¢ŒÓVž„ÍktM©¼ðî'ïò¾kÍõ)¯oîgo»Üé’}HIZçãCû#N’tSÍs_1ÞE5þ©)L¶XüÕPI=É“ÓS^ÃK‚Ó "‡“¯"´X‚y5£fe‹þ,×éš]¸2ÄÙ óô=®ÇÔô=rÝ–æÝAû §µPÒ파|ÍÎaéÏøV8-(Ű©ñXë#·Y!ù”1áÀ9öç?ʵ lªþ¿é]Û-Lúh6æ[…lðz:W;¢Ç¨Úø¢ÿSÒ—t‘Ž™÷ú~•/º+Mnfø©"M·EÕf˜—tÚx9ë»#\f¹kI,ãÔUïB¤#’Æ2ØÏñ`~”–Á©ë0;&,¥DßÛ‚}½ª8eÅØ±b:sI]ì=Ä™•xK.ÓŸ›?—‘\¯ŠT£œ8ãn2¾ýÏQK`InÎaÃóg'¨÷þ‚˜_ ‰PÎ@ú‚Ä }Uû‘kÙhu’pùþu»á¸æ{9á1䃸ç¨ÍK¿BÇÉŒÅwÃŒsƒQY«Çªã+–€™4š[Ñ xÛääÿHH ƒÉížhó ¶õœ‘[3õØÌ AÓŠ$´ƒÊV‘€#·­c(§sKÙèF¶âY  ïé[V°E{@ç¹ô¤¡­Êl‚á @Bœ±ã5rÂÖÝ<:ýM.X·aëcFFÈ«ÏaФ‘Æ›¤c¹Ï­g5­ÐEèU¸F¥ØäV4’GpʸÈÍfä’³4]ʺ´«klÌ•ª“I+kžMâEÛrÜàf¹ÛkHžåw¹<=k’qnFѾÇih<˜••ÆwV͕֖’,WCÉn«(âµåŠV‘ ¾…tÝ "mï|ÔÆTç“^zú¬Ú|í%Âù¨NÖ®WŒ“#GÏ>(]ÙjvqK¼t*òxU {q] k™KRmÄŒƒÇJ7dp;еØI f[˜Ø ÝëØôH„/³$‚FsíWºl;/­†À ‹¶Hü¥U‰Jêçb‘Î?‡ÌšçÁ?Ü+ަ÷7m‹,är:ç¯ä?­i Œa‡±]­tFwVÐÔ°Ó›RBèɈùÚÄäŽÿÒ¸-`/â-´pn³Žôbvßü8ëǾ(}-^ÆOŠln­5B,’Gñ¿,?ŸOQ\…Ìd†/ÁxÎÜþꬬ‘ ê{…4ƶðe¤’ÄÅeÛŽ™'Žƒüþu=ÁHå.cÀ\ã$xéYm¡V¾¨¬²Ç*³!Î8Á?N3X¾'·_ìØØ+ägœ¨È§ªÐ;ù`Œª€¯¯Ùø/o©ªàuT Á@@2§Óåñ¥wb.®îv–…þÁ‘pàrÏçZZ6­z58 ØŽ„mÚª#늎åü-@)Ø@¡³’8Î}yª0^Åì.Ê7èJÞåu:Y¤ÁÜ:v4à©€ò„úŽÔÒ¾¤î®Ï ÉW?+ ”^¸õÀïSV`”0òÝžJ®6çp¼dz¥«±6ê_„Æ®¤.AÉe{¼7ë]KºÌ—`N;ôýA§o¼Rmè`ß2Çz  ŒaAþ†²¦bûùOªÿÓ3ÐÖ‹{‹]ŠeˆâC!+Û“±½OݤÂU°ß6ã÷q»ûã©*=:Q£i–®ž¤Éž‘ýòcãÿ–îۖۀ§;rÛ7d§÷ÀîÆ“Z]‘,ƒ*ù²`Þ^ØÉëëU\³8ÕŸ!p:9ì¸AÆ=ê՚ЭNºÊo3JˆÆ¹À3õÁxªÁÞ÷ÎÆÝÌHÆ=ë6Õ´›£‘rO*0:ç¿Ö¬@q×ÔvÿõR»Ø «7,^¹­,þìŒðGLò@í×ïV±¶Ì—tô¿%‰n¿32ÿ}cVß €DÎÇ$1ž„{žõIéaYµf0¿!TÀg#¢Ÿ^¼­z¦/Ÿá{Gn]cäŒÕ4îD$ð&Ýá•Nê?˽fO¸“°ïÇ%»}Gj«&+w5ô‹ä .æË.#3]jZHÞwÞÝBõڸ摴_c©KÁºÊ8áGz…ïoç`Žþ\GŒsY_¢/G«*•„6¸¬üH.³?Ê¥­4*=Êwº„‰t¶®I8$Võ³í㈷ÌÝk+ûÍv/¢5ÒÝB»šIdF¸"_ÔÐÒJÃM²+½Ebeˆp;Ô+¨$òR@^¦²›W±i[Qò˜¥hm°.E¸! YM;hT|ÊÎ$¸,ý=ë™kY¬|N$„‘Àjþ!»lz _k2ÓÞ³C<Ú¤"wùÜço¥:ÎíElL•Ùè±ÉY"1ÀÆ+>+²ßeOÊÀŠë],a«kv—“±NÈ5•®ßFÓ™ÃU·îÜVw+ßÁÙÐÛ‡ùÖ%ÒÏ$Ȥ r1NI…îqµ„W©!#‚;u®BÖÙ¬îö •Ï«šqZ4¡-,ÎÚ xî,y!Hêói^v–T 1ÃZ(Ý‘ÍmNFêylnżìÉðî5Éx‡P„}¢!(#nEJÙd»^èñ-SSšvhemÈ Ç5–“’~•Ó~–1ë¡2·@OËO9pOZz-°+Àçœ×¹øt«iVr„# wÆi«rŠÍîvº´Šo-gÈ0:ný)“˜ŸRµ”}ÉÔŒø§ð®| n„l]_ˆÔ. 猎¿_I(Ü ö˾ßäW Œ·;O Ý:Ú\!‰%Œ•ü¡OåÓü+Á~ ùšOŠí5Q*LÌpÃoäZ—µÊ]I5©õR/Ñy{Õû ñØ{t®fê2Û]Ð|§l9çô£N†z;Xï>j3\,¶rÏ+ÅÊÇÑW=‡µÕêO#MµùYÉ]¿ýzY¥•¬VIT¨R~lc$uýzÕ J6›L™s½º€3í“Uê%~‡*ŒÙ88øïÀùô¥àgy3"HpH÷ô¡´ôDß±Ñi³´ž$w<ŒÇኟA¿“LñJù¶˜ÜðÀö©¹k±Ùj·v÷/ö…Q=U•>Ø€ÖëqªDe9býOÌ[é“N÷ÜëV ŠG–~QNVÝ<}j5 ]ÅwmS¹”üÊ>`§×Ï­M戣å•yîž  /&¶åè‰I=}de|Õg<’„ÿ´1Ç¿¦H]ߌŒ†îÞý?ZŸQ·ubŽ Œ­Á›_pÉ÷Èéýk c„[± ¿°ï»'jvèÈ·TQ%8 Û06Œ•Ý>¹õ§äÄðB‚vžÑð:}+K¤¹l ¦ÉDlp6¶Ñ'pÃdžœà÷5f-¼g QòIž[¯Ýý*¹JØ”áTç÷G;˜‚¹CýñêµC&Ue8/†%WûÀp2~µ7¸]…‰4§C:–R~UÇËè0;×?â»pÖ$©õ¡¦4¯©çÁƒçÓÞ¦‹ phcÓÿ­R¶²ÍKgÆ ýkYP3Û‚F?Ÿ×úQžákI@REœ– ߯"¥Y6osÆvg¿½t.–3¶ŽÂ°•m§>øSéþízƒ'I|?4[Itcòç'ó©I­ ‘°ê¯ÆÙ?—CT§á0pQU­®-Ìäxþ×°ÎÇÈï]½ÅÜ[a‚Øù—L7?„W<Ôaä5µ”¶ey¥ó$Šß°Ô.os3Š®Uu+t¸ùï Ëå¨Ç¹«öf ³02:šÑjÉØiöïÉS+ž¸äÕèm’YѨqOBÓkV_šÝäÚ€”ۘᱵÜýqšÎÛÜ¿$`;,çÎaÇlÔ(ÐÆYU¾wëíX[©¥ÞȘ\0¨}ë6]BrÁ˜dšÏ¥š™ªëöVp—¥ñÀÍbÅ­‹Ù¢h$Uvê}+'4¥ÊŠå|·gO¦^¤×‚Ýœ>ÞI«úŒo¨&ŒýÐ1KWüÅÔ꡸¤ÆûºsL—¡)&t®ô´1cí­ZÖÒVfýã‚Er2™#2½Â–ù9è(qµ‰Nìµv BŽŽJÔT?ð“[ZZ›}ZP ¯½^Ò»ØÖ‡œø–þÆw7=ÞÒ: ®I/îg˜4 îæ«&šåØè‚V×s¢´šG‡bÈFzƒ]zĶz#ÂWyÇÖ½îdÓz3ÌüO­M4O=ÃüÀzWŠjÚåÅÍã:Èp=ZµÝ“+¥cžfšbÌzœÓ¢'¨ük[i¹Ž¶,/±æ¥±·XM!ÁB€qôȯlðTž~ƒjÍœ޾õ¤nïp;ÝmËjJpÉëÉÿPý•mîb—å†QòƒïÇø×6J ú•UÚFœJÑÈNsè:ŸóïÍh¢©UÈäçŠënú™¦ZYaæ|’2Ž3\ßÄ-áËê’mób”•%¿ú‡¶…-ÑËÞj ¯øzÚê@c–4^ŽµÍ¼È "å©`~>žôì´6ü} ~+[ufŽÝ“;ºƽnA Ç:4,ØåNsü…+ #ÊŒ1&;¹ Œûô¨&Xgµ•$‹?)óøñCgŸÏ‚Wb¤©û¡;ûð?­Rfc– œŽvðHõÈÉÏãKK’õØÝÐüÉ,$FpHàmÀÈôä“K8h¦IQ¾`ØRòw;a:i0Í+y‚UÉp­`KÀwÅòl¨yíJú”ïmŽÎÂc&˜Œä¹#$â®ùd ž€šm=„¶< p°ÌT°õ_›oôéRDT c&ÖÎA';?úØö«ípMZ÷.,ƒˆØ°FJrJzméÖµôÛ‡Žõ€óÎF}G'ŠmÙXÖ#@…Ñäa‡NÝ}q\Ô™Ë3ªHR­Ñ÷ÓÖš’»¸+îU Û²{Æ_?1ï¸ûv¥FÎvAqÜzúUÿuMEÀT\|€*çîç$úÕ›a„Üì×´'×¥6Ú[–º“êÎÖÀ,[—þáÿdUf\`2 +’7•ní‚OËõ¤äîì=.tþröSGŒE“À9ÝïÆÍS×í<Ë9Â/@OY¢ºžPëµÈ |­Ôž¾=*x•H€¿^ÞßB·.Áò°b8éþ¥z§Ã« 3PžHîí’y6.ýlw§æ&º˜¾!¶ŠÛ^¸ŽÜG #»U}»|¿‡ZÉ®0íèx%sëëžÞ•»Nú¯óI pwÇð“ýßzì| pÒMuÈËPÁ[¯~¿ÒšVWbW±Ó^2‰Š¨)×Î?oOzÁÔu2Â777±©_ávP@ô#ÖÒV¸š×Cºøá؉0Ýï›?Ý?Ö·tï[>˜Ïov¡ÜeäcÓڹܗCH«jkE¨iÑè±ÜÏr'ºœîE8ÑøsÄ.cH#·’X×;\¬Öú†®mëÏZ¥ÿ SÀäºo#îäÔ¹$;\šËXPÆþú]ó»Ø[¾ñÛu ZGùS€ v¤Þ©Òèí´*F©Ïrj;âš„ËpåÎx2÷´*:;™(#G(AEè}k¼âD5Ë;ô5™›¨jÏgmóŒHzf¹Io§¾ª9¤W5Gu›B*×1îtû·Ë#³*úÔ63ÞGpþM»qÀnÕÌ ã.g¹´ùZ×¡ÔøViུL Ͻz׸̌ íÁ®ºkÝw9'£ÐÇM|F/7! ƒÚµ4½z n–$; ÷­ã;-I”_C«ÔuK;(âóå¡Ï­s×÷6òÇ{{iØÆÀÉãÛŠÍÞ×E¯3Œøu{§êž¿Ðî8o-¾xÙø.¹'¡ý QÔg@ŸaŽ%Š5áŽXo9ï–Æ=1Š/ub5ÜÉÒÙm|Ci/wŽã~Nõô&´XZA 8Àlç%+½ kËCm6×`OL÷ÿ Š8—Í,@Æ@ϾDyÞ´d´é1_^OuÜOò¬×PU‰ˆqž}êXÉu #“‚¤œÿtàvìjÖ‹@v°ðed—G9ùñÔ·Gj–7vÜI+€H?2ûÿ·R—A5»'Vsð`T'nWûzÿõé’ù{Fû¹ òœdÿÏ,ŸÆ‹^6–²6<-°Kp¡vœá²{ã2zWBà5ÌFÝd8îN-FÒèx~©Á©HŒ6Üç§ÿª£€¿wÆòühÜVEØœ€ûÝ2;ú«Ñ¼"i°}¾hÌñ¿ÊûN6©<ÒVÐ:×lÒù¤¼ÓmöÛ¹ùWÑO`;×0äÄp\qݹ#>¼÷í]¿R5î7çùp¡Š þÁ?η<=©A¥]ýªå•µ±¸àþ<ŸÂž‰è'®ÆOˆÇ”„Gðƒ½}uy¢è-¸i”ð1<¹îj-}ÊWZ­ RŽ9vü½j íÉpF8Ïjç”nl¥ÜÁÔá–Úà¢I¸/kEÔ_MŸxlî剬ÝîRwG¢è:¤ÓùòL6ôQêku;ã‹%œäŸJ©$õBNÄRÄB;ü½Z³'Ôa·—ÊDÊç­fí´-]£Ê•纆¹uu¶UEçµI$ùQœ’ÔÍÐõ[á¯Bí;Í‚ z„’Ý\‰ƒÅLT’iqIœ–¦·ÖÚ¾br£¿½wšºjšDs£ââ>§¦ 8A¹86DÝ’‘ã¯)ÓRÊ\¥Â¹ýk'Ã>!ºûBZ_ÎÀÈ6¤ŒNµoí´Dòû‚ê¶·Vš¡¹IJÌ>eeâ²u­zkëAÃn™8ÉêjæÜn»‘¤¬ÑÌÁqÒæLZÖÓ^¹Ù*á3ÔúVJ×)·±»w ØY­®Bœg׫ë6öÀÇ,Û$èa] 1RMó;\òÝvñïf“sïÖ «þ÷kpµ·F™•Ód—‘í“pû§Ú£BúSWµ¢üJ8b¼UèãÞ?úÕV½ìNÌ”ÅÁæ½#á«æ ÈAŸSÿê«H%ªÔôMgXm%”vÀ*xãÓ¯5§¥²2~׌žë\ø•1Ô~ùfDc•·~¨í&d—Ëœ“Ç¿¿Lf»]Ú»2µÝÍt£À‰7n?ër?þµXñ¿ÙmüÚsD<é×Ì.ë¹»CYê‹¿cçÏGñ‚ÛF|¼†Éþ÷·ZéüAjmï]@Àn uÏÿ¯§½ éa5}RåÝIa†×=ˆç­{§†$:¦›ktì ¬C$dóŽzûÑÒáÕ“\#ýªI ÄÆ999ÏN;V{î²r;xàg¥ꇣw8¡‡VbŒ{p¤óØ ©¬MħœáFvÿß9ãêi «îih,£RU®pzá™}SÍtw0€¤cë×aíJÚ„tV%ðô‹¸‡‚O##ô«²N¬9íׯ¥Zãêiøy€¶*ÿ0Sß8ºáeYÅ?4;­áuNY‰$uËSY¨]rí_CÇæÆ©½u%h‹°ºs€6Œ ã…lêÕ³m”’Áv’z/õcÎJýi%¢¹6Ggá"MB8¯c müJÄœÜÖßÄ-2Ê*ÞâÁ"‚Ýð8ϸéëš½"ìÊè®Ï%Ú»ŠoÁÁP\ŸÇ'=ûzF§;”“¥XçŽÊyàûÕÚ"^ëÐsÃç‹s¿  €\ދׂ¿­:02@uf$°aœã˜¡´þ®ÈÜ”n6™ ª÷—§˜ÊÅyAL¨ç ¿ÞòçÓÞž¶ÐVèÍo ˜Åó¦Ð~AÏ(ì¤(ûÞæºÈšØÝªÎ¸¸`§ÿŸÂ¢È½O+ñZãIYàqÏ¿¥r±°U䞃'§·Öœ•˜™až¸üñþè¾ ×!†Ò]ñNÙÉhßi<Oz#½ØžÆŽ²KÓþ–­.z¸;_?ÃŽ˜®VWùw‡ÎzQŸ}ÜñíZ+ÛBlº¥ºŠÝ‡šCm+ÀþáõçœÖmÖ¥%Ég™‚)éÜÓmî .Ç5ª²!†ÙIbpNkž›íò–#,~µ›wW°ô¶†dïp™ªÆúC•’2*Z¶ÛBí–¡5³yМ8èjíωu{‹¨¤¹¼w €…6ÐjÈúá÷ˆlnô+w Í'.Ün=ëgXñ5X¬íŽû˖€~èõ©zjŠëcöÚR ”ÉÆN}kø˜íÉ-µ‰Ç±’zÝÅô.øwU»K”—JïG-¬cc+eöÔÅò«±ÉtEÍ7Äj6ðÍ4£2•nX⺒I¶m‰=Í&¹Óh£kᨯ/2 u$×D4¸¬´æHð»y¬¡J1Ô¹T¾‡™ëÒ¢\<— &¹D¸ùÏ*ÇŠæåMß©¯5¶6ü/ᄼñ åÎâkе»4x ª«xÁ¨\ÎRæiy­\βÇy"€üØô®ë@dƒNK»)7ÄãpÅ*+Þmî²±ÇøëK†ûNk¸›3¡Éæ±t·Öt6ˆH«ym÷—¡ö5N ŸN¢R|¾6«(¶0O!ó¡àßÚ¹›‹¹'ºóLàⳜ®¹JQ³%–•Vx`ž}jÒ_Z@'bÇÓ¢´Y2m«™ZÆ»lˆÌƒb¯|×–kZÁÔnÉGùEl­Ñ=´3AÏ=ê€-æ}êÒêgз&ã àgÓÚ¡„üÇ#4GmDÍA'•Ç=+ZR¸µº°µ±e `sJëþÈ#Ö¥ˆdï'ð4_Rdô=oY¼»n˜À÷ÇåVtÀ~Ôˆ_‚9ö?¥r`n诟æUD¹®Ë7QºI¹Ÿ'¯ËÆÏÖšŽ’¡(»I8ÊžµÞˆ×vhiÉÏºé¶Æ¼’ÜZš¾»§\3JÆ4‰†@ÏNƒ§.íê4|În®4ÇdÌ ¹€~^ò9ézÈž˜·l™®ïsÇoJ”>§ t„« Ã#¡éþA¯RøYtá¹ä%ˆQÓãõ§nâmZçC<¶×!å¶e81ì'?Ž1T²ÆEe.6ñò©çê1Ò˜=NCÅÊ>Ñ Äü¤c0v€ÇŒúsŽ¿Jž„Êú\ÑÓ„0ß@¾iyÿ@Ý@>ÜWTðÆbÀÃÓÓ¥-ÞƒJâh‚¯¤FWi:¢zðjíðGb› à©ÈÉôéúÐ˱?‡®#–;ˆ[®•­¼›ubÇžp¦[Oñ"·Û[$sŒ€ Ïà?­dÛäŒ4[åX€ ý3ýY‹q‚e ‘×nwO›¹õÅ[‰ImŠps“ƒÙm\®"WûŽ—DukÄ‚²çoÌNž†ºÏµ½ý„ZrÀRï Ѩã×ÁéI5}JjëCËïlgÓæòçFv9-ì¸î½ýª ¸ ¿íîFOSþï¿j~W&ýñ~uóGêzñ_ÌS‰,QÏ œg'Óoõv\¥i~bB…¤ÚÀ“Ù‚ݘsÊŽâ¡}©òá‹aËw{ t¡^÷ Ñ{D‘“S]IÞ¹Ldß>õÜÚ<\âUÊž:ceMÚVA~N3â €™¾ÛÜ£‚pp}ÉþUåëŒàƒéÏòúÐÔ·Af‘b1“òÓ=}?»?Á’Í*N«sæ4#>¹ïô¤ÇÐîuK¤¾ðÜsjª÷q7gçä”…yåÌÑÛżmlœ(9Ovݱ[i³zìžÇ3qvÍ6Uõ$óX·ó†rªùçé_—pÙ×iÁl{ g™iI8äæ¡Úå]¢‹\F,IúÕI¶6JíÇÒ—[+ÄUdà`ýjVUèÙ9ô¦U{/êzdK¥Ü‰ô@x«¶ž;ÔâÕ…åÌì]FÏJ‰+0õ=oÃ_íµ-:D¼¸A0Zež»o­NÐùãål+9j¬‹R³º:{9VÞ&5Ú?‰ª–¨|ÅœŸ­e$Ú±i»•4½rãN¸‰Ê!é^„¾1†çE’EF.23YÁÚèÖI]3®Ð¼Go3F¹ ŸZÓ›VµÌÈó)ÇAš×F·1KSÊ|ss[mˆÌs×§5ÃÍ«"Y’@ tÅqÛ[£¡;¤zOÃ=f).cydýîßÏ»¿Ý+i*UÆI]Ìž“<ÛX»³}Hd¾Þ+3À>&6’iWlZÞCòîŸð¬ÓJi¢¬Ü]ËÞ5Ôímûyw ̾•ç÷3Ato,&òËuãð¢kÞ÷w*-ÛÔ².çŸq—æ|g5 ߤy Ϩõ¬ôÝ¡YµX¢“x8SØšÃÖ|Ck™L›HçÑßCdqÇ‹^ê #ƒÔ×,—3+ ÔÖÑ‹KS;ô5mo÷²bŸvȲ)ëFÂèZ·'hßó# E_Þ3J7ÜWÐ×´@HÀãÚµàˆœcø«¾„ù³KÊT6 ǵá$x’Àƒ e :ž3þzU_BnzÞ¾\}’y Û/¿Öyñ2I§pΛXHz®Ò9ô=+Ò´Kñ/‡ ‹ì¦›xü¹F0„ŒõüitºTr÷–IÜêò„ˆÄ÷½€ã'¸­à]WÊÖ§´F*$_•3Ázæ‡$B=X fµ•-Ø×—Œc8¬1|Â);HÇ^™õ¡l[¾èÅñ¯N[H[åT÷u5TDU³åtà…^9èƒÞ©ŸFLG—ÈãØžüíè;hTÝò³+»x*?¼8êzU³Õh è d³  r=Ñ»ÓXŒÍ¿å`\’²vù=i+¾{½ ´§òµX”ß-ÐoPy;@í]”Ìá× ¤FsÏùúPÐy²Än4 Yãß„àmãðâ¼N@ÑÎU² <äÿõúÑä†É‘Ѝ=PsÀÇýkøyÌzÔy¥6X•¨üiyÔí|My¤}….#¾i]‡*ä`;Ú¼Ö÷P724½ÇNkuf®‰g=4êò>[æ'¨Fãø ©z艽ÙZp7üÃ8÷¬‹ùʱŸÖ¦Cë©%’FœóW )šÈ„â9½M_Q˜ƒÇlÓè;è7a-‚~‚«\[HÝä(ßq"¼&âÝ‹Dì¤ñÁ­}Y¸Òï£'$òsšžRÏVÓ|Qö˜áŒJ7±äf·.µ`d3cœT4ÇÐÈk’å·¿=p 6ÞæE|n=sŠç’Ù44޵©}¦4†äÆpqZqë·ðä´ÌÙ9$žµŒ¯Ík—¢Ðçõ½zYÎç|Œã®~[Âeºô¨–ºØk±ÑxC]ŸM¿\9ÔW}¨üA‡P‰RQ¹…k£ µwtGqmu¢‚¬››¦y®^(öÝoŒüøÎE9«ì8ËK2®«s4ÑâI Ç÷¬˜‰ y¨³æÒÐÐŽíeø8çšÄÔukX¤y½h­³%¶•Ù翉'¹¸+•P~R `O{=ÃfY ?ZèŒlµ0{Ü€OÍQ$ѱ"®G3¸~ RzèÍŽI "ü´ù"ò§úñQ¶áÓSVÉFAP}x­ÛPsÈöæµÓtK6!‹la³Î8ïWü?Äþ(°Xó$†`yÍEiòR”»&4µ±êšãÔ0¿À'ê(˜º#Æs‘Ž8õ¬°Q¶>ˆumÌ΂v/g—€û ðP2*¸òÔ¼Ï?…uÝ[Rê‹Æ$pCòOÀ×_¡EtÍ&¤Å䶃æ22€ ~:6 íñ="›Å·w1·àc0?O°|t,õ[‹ißb¿ ‘Æ}?ZnÃgWâ[vVRxê?Ÿù÷®{Ã÷Oñeœí&ÍÛ8ÉçÏ5/`ÙØ÷8âI® ЉÕ6ä°$gõ¬Ù¤‘äfM¥[ ŸQìsK¨ÚÓS+[ 4Rb*í÷·ÓœŠóù‰fÖwnFâsìsÈúSOB^ƒRGYÓÌe\|ÜŒ•ÿkŸð¯BF k#9ÊŒuÏN¼Dµ± 6QÝ´¶øŠérXCt’H’ ¬ªÁÊsÂÓ½vr®âd=ÇAÍ7£v¶å¸å7úcX¶Å ‡Ö¼GT…`Õ&„±$ÉïÏó©{hQPåWhúç·×ð«wÊu¸+¹‡E<Š<År¾©¨\]NÒ±_›·`+YYÔ p£hО…$³|¬=ÉëNkF gëC¿p]ÌÉÉBA|â°îØ–9JÍ®Á¥ÊÑÜ1úÕØŽ=qE¼ŠdS²+>ð5r9w(šBkKÌëR´¥PÇÆ=Å?Q+Ø£VàqP4a\ǽÓa¦KóÂᢕ”Ž85¢þ(ÔãÂ+•Œu=ÍL“*öйmâ‰C‚ýORk­Ñõ8®Ô9pIíšÉ«úš_¡nKûx®reyÁª:ŸŒl s ¾îÊŠlÓ™œeωÄólçnêÜŠî)•o”¯­K¦öËv×! Øx§µÿ–ìY±øÖvÚÆœÉê[=ol1™$Ú½0MY‡ÄÖ1Þ¼rLÛÆMlµ3w3ïuûi#r²‚;Ö\ž#¶·¶,ÒÞ‚‹]Ší=LM_Åå­ÌVíÉA®:}BêàbYKsV¢–¦m»•[=E1‰­=HÔœô©ÔƒÖ€'EÏJг\H ò)¢z±’Ž6µ¸â­˜ÚT Ô÷¦ÕÕÄŸF^³ÊñŸÄÖº DP«!#=€çñ¥}멯j­)ÚŠYµé.—ƒtvñ³KÙ—Ë´Ü3Ô‘ÿêé^vcRÐTa¼¿ÌÖ”u¹açk—¹$±Éãj"T|ª õ;@ë^¤W,TWC‰ÜÛ¶ŒÝiÌÞg™—h9à~uE™cáT?l0äþ¿*vÔz$Y´Ødݸí<È®¢IiëikvJ2îhÔ‚úû}jèÁk©æ>4ðÙÕ#¹žåE±Œ;Êí‹éƒøœ{×’ê“}šö7³Þ£eC îpHÏãJÎÃ[èztEõ ¤ìèÀ ËÜø®&áL3‡Ï̇¡íƒß¯J6]O~ЮVÛÝ®^ÞD`1·"–h º–RåHà€xmq˜Z¬hÚuÂÜo| Ç-Œc¿&¼Ý‚©`AÇRW!Þè÷äÓR³Õemк²ŒÆ~ ~}Mz°‘ôè—qž8öã=i¯k²ŒÙ‰ÖLòÎá¨éZ·2‹Ë4Žz«dT«X»¶îÌ›uòõhع÷ã‚}ý뱘Ü[E ¡*ÎÑÆh»ØvGŸkð~áñÎy9ÁÔ×Wo Ã×pãéÿÖæ¯¡œ|Éà@Ê3®NÏÔÕÈÙUY‹`‡ÁW#·€>µQvÕ Ýô.Á)F c‚à‚}Kå^…áÙn®âŽÜÏDƒ*gCˆÈõ'¿Ò¥èÇ}59i-±5ÓÞ›Ñ3cÌÆÌú ýk]†þKnÕ‡VëÛ¦+TÚVCZ»GÊòøxççæçwoJ±u“h/Ôsø¯­»ºmì<ä‚ÁÎ`pO\>èíQ<~^$ Ù¥ã>¥ÿ¥wLNÅw‘QÔ±ò¶”ºƒåpsÉí]ª5”{†@$7$³éBîC-¡•g`.5Áà½ù òÿÛ4ÌáòrIëõúҳܫÙmÐ2“î/9÷ì+"ïPÈR<T—R™‘=ÓÁrsÅFfÝÉRÛ©­6wÛa’2rÕFâY¼°Û¡ç­F­Y‰é¹E˜“·5NxÆrÇ&¦Îý´Fr>Ùˆ"¬ ˆ|ç”J*Þ]ÌqšÔ‰•@ “õ¥pÛTX8#§¹¤uc}i«ØŸ2EUwŽ;ÔmbKô«Il?"0û{T¦4uÁÅf+v+¼|éô¨Vòê׈¤d=2 +u/¨§Y¼1g?ZÎiI 3dŸZÎÉl1¼ƒš¼5)’‰®=èê4Ù¥eâ·ˆ«‚ÇÜÕkýjK¬%}qP “ÑÚ m^íÕSÌ /J®×³´¦RçwÖ©+w¸†îr…|íBò»ubií¨†Ÿ½Í(Ï¥隌úP!Ê=*eŸ@ò,À2ØÆkJ ÃðjÑ/{¢ôjYy8úUè¤eÊoÊÕYka7vhC2n #<ë]ÿƒ4í/VÔÌ¥ÛCÂÊ@äžÃµæcêNŽu!º7¡y¨ž¿£ø>M.Åõ}NŠêu$#Î[)îñ\'lüH·Is­–7î冞ƒÒ¾{*ÆB½uR³|ïnÈëÄQ”"Ôv54Ò_L¶}ì~QääÖÊ.ÅŽwwãüæ¾É>Ç™n†ÆšÏ³¤$œŽ•QŠa 7ÞÝýA¥£we4Ò;FøäSŽœóô­½éÙÕ–1.ä3IØÓC‹øwysm/ˆÃŸ‘x'>½ëȵ(7C’T·rNŸ ÒÒÃg]à m¦´›G”ѦTâªë–¦ ¦RO'*sì=ýi/0Üô‡÷_jðÂY3±19!ã×µu°Ékf¶ñLG%Ž8ú sOÔI¦d”qm"a²A0áIöÀÍyÅÌh·’ÆdRÊÙùHfÿ8¾ž½2jðl€…[ðgÏ “Éâ®í«ŽÞñv&bŰ¥ÃI1›Žƒµuº©q5«Ç€ãår0OûÇùR³z°ëbÄ’5ååôm=¬*,»ÉìyÈçŽ+…žw–GfYÛ” ŒuÍÁ¿z¥~ƒëqœ†2)'''§\êxYAe`®¼` •÷û½¥=[ØyTÁZÀÚ¨>‰ÓîŸÐÔ-ódYì|øÃŸFã ìiÝ¥k“ßR ª’C7údÉÓí]}œ…´h¤IÂàná‡×´hÝìV«[ùœ¹(ýð9Æø¾ÞÒ6KŸ7?ðçÓ½%{Xìyþ¡~Û|¨[äþè¬y]†p¼žæµ²Ù ‘Hòáqž¼RI‡üjmm¢™Êá²=9ªÒ©?0Õl`ç#©h@o%†zvæ¬ Nïž´öú—íåÎ?Žk¢ðLjeѵË[ÂÌ©‹“õÁâ¹ëÅÔ¥(¥º4„¬ÓGÕ^ñF«ª£=µš=”Ë”’P8½«âbMªÛ‹M>ØLmù‘×\ö¯ÍpØãã¯f{µ’ËØä<:ÒCb‘•S"¤:çoçÞ·"”¬øUÎzõý}ëõ4ìô>výô6tÅ?¼w‘@Û¢¼,ÌUËŽùçÒ¥ÚÚ •†ÉàÐ{Ö΋!´1O´ÊvˆÇ$ûçŸò)_Mªg;ñkYô!q‘$2bG#;ˆÏ àqÖ¼‚T/nØ 8éƒÈþFŸ›%ßb/ ]6›ã+IýÜå‘ëžüëÒüYi¶ÂõcÝ÷{­Jµõ+ÈÃ;È„·ö³Ë¶\ùˆ cvG\~ÝÚÈïÁŽ#å—qèÂÝÅ}Z3تÎccC€Hþuçú¤+¥*Ø¡ÎwpÛœqøS·B_rÙDéd˜óœ0ÞÝ€®¿Hó L¸œäg'òšVHWº¾Ä—Š6°ßó‚9â—Ek™-ävi hves·>†‡¦Å­Uº•'QöålŒoÏlšìô¹Ä(Z%Û ÔØån§«m¥;‚ŒpBð? ýkΦR®Ä®ÞãƒÏ¿=ºuÀ¤™ž¬"9ù±ŒîSÎ=F9þCšž7AÜIÉþsÇíŒÓZ2Ý‹p2+0î$Çb;FxçÜÖö—Mt#ÞåºðOA÷{SÔ•«¹ºÚö·p4‡F(þí¤ú·¯ã\–µ¦ *ùàšê2è>eGݰuŽxr.ø§-O¹J5n È9äž@áqœg×Ö¥TpÊJ‚s’BpO®vôª­nš DJdd Fp6ƒø½úS íÈá ×Ò<篿µ7»LÕ•äFiDYŽÒ§”ŽÞØþ•Óh²ùÚï´Ÿ˜Ž¾¤ûP´bó)øƒW³Ò­L’f# sé^GªjWZ…ËJÜ“Ï^ƒÒ„ #C…$·=8)ª àê{Õ«ÞÂO¹O+L` †i¿È¹¦šÝÌjÀ¯ƒ$¡_û´Ë–`»cÂúÒÓn eLå[àÐ\ÔÆS»鶉ôŒ¦~´ÆP>@9ëK îÞ 0GN{S 劭ZÐ6 1È4v‚v¨}€©$}ñƒüê³'z‡mÑbÏøÑ³R0{Šk R`4õÏzL@DŽ㧑IcÔj§Ò˜¨õ«0*‰åàþ”÷¥õÈ5aÆÄPsV’¶„=ÊϹ_m繫2lAùP•ØôØ¶Š Ê·¿JôßøÇT‰oõ†•¢<¤1p[êkÄÎ1ÒÁáÜà½ç¢;0”Uiò³Ý-¦ºÓ4Ë{; eeíŽ%Éi1Ðg¯ó§é—pˬ¦p‰“«…zŽõù3©RUFõ½Ïª…(ªN0×C˜—L}+T¾·-½<ÂÊz{ž¹«1 !VQî={{×ì¸GÖ0𪺣ä1Ü*8²Õ«¨‘åv¶Ö tcQ´Ù*ʬc9éúWk±Ž·±OxT(TprXœ~_þºÓÒ%+#\¯ ÈcŒgëGKŽÚ”|QnÓx^îîàîvû ·'Ð ñ±–S·vqÎóij'b…ݬ°ª_`Ž ‘ <çó¯hÓJjþŠsõhÃGBE ‰Ž€²¼f` Ä¡•8¸÷¯]vŒÙ¤"1ïÎ3Á©ò->ŒÇré(…‡8#'·×šá¼@ž^¡"Å‚ÙäñœuÚHuõ§~ˆLϰ9¸Q¿8ùÉ5Õi|ÉH˜ó€ ú÷45Ü…ÚÅ»•fM¹†.•cÃÓJ‰qhW(ç ã€úô¯©Nër–¦…nFÕ w“[vò4jŒX‘´w<ŸéMÙl;ßcþªÿ0#O?Ë8¯8½P“ɸ`sŒëÿ맪ÜÅxK 1’qó`.qïƒýjäq•&VL“÷FݡϷU+u#Bd‘dmìÇ„þ&ç±äòN>•Ñh÷ÙH&U[KßÂyç}éÛ¢eu¹ÚÚÛiŸcm[Îg½™O•]ª þ2qÞ¼³W-¡(yI`ÅŒ’d³÷˜äò£  R›Ô:Úâ[d,:n9ôy'­X0bV(lžÒ²”p:õëš¤ì¬Ø$–¨È>r¶rûómøÝøb£‘K)]§qŒò>îs÷cNúY ö± ‹ÁBçÎ3ÓõûÞ¦¬Ã¯[éZ}Ó]H®7;aü8ôuÔ<Ï3ÖµæÔïÞgè[rjŠYpIæ‹èüÃ}߀£hëÇza•×1 ÷¡‘ AøÕ!Á x5/Ì6)ËÛ ô¨š\5h2 -ÃgÞ¡ +dÒ{Ü¡±ÓóZQ¶âüêຉÆÉ€8ÇZ¸˜# óEìîKd˜$Œð}é2°;²{<ÁŠ °Á8Ç#‘¶–ÈäÕ[Qo°Ò00¨œãŽõìUú¼ýÑŒúÑ;mFÀíÍ>·Gƒç'úTn¨z¯åY¶ŠÒâùYLQ²’xÑ`FÌzR=»(ÉRµÕÀŒGØ 6qÒÙÅ5Ô'CŸZAÐù\R Åp0¹«’9"©.âf…«•n~*yJ.njÖÄm¹FFmû˜nÏz¹Ê‘}\/#­}5ðžëKÕ¼þŽÛom”¬€rr+æ8ŠÔ"üÎì í6ÏYžæg¶³‚Úßͦ7cï^]©j6öž$˜ÚÄÒÝ£óá#¶kóʉ¹]O„»º]ˆô{¡­j70 Øá~Ñ(f늻"ì‘¡qŽvúúr+ô\‚½èº/GÉŸ=˜Ã÷¼ë©-¬k¡$üö©/~ò².Ôö>¾ÕôŽý:ýÊc*NO˜LðG½Mk1{•Çè>¿äÑm}t4|JLš\ö‹"˜ÄGåUÎÞ:`ó^?o ³Msp±Ë™¢öüÈ¡o¨JöÐÁÔŒ“³;áIè¡q½áýûÍá“æ>S”e?Ÿò4µz >£u·[-zÊü >Ö`úgµz5¬êi  ªŒ‚qŸÆ–·°?0¹e7Ep¯¿Âø¶0—q8T9)|`û`“Ï~”lÁµc7Kí9fÇÉùûû~U½¦‘ø I,8Ëzö§'Ø›u4îcnH\ƒÇ_Ó¥G¢8: ±Â N‚TØTݬ.¹löלszÖ˜lí€1ÉéUwЙêfßjci#=}3ñ¯3ÔaÛu ogŒ7NqÆ8õé“Mk±–‰êf†PpX*ƒÆ QþI©Õ˜§%<±÷‘ŸïLôœûRMÜ-ÖÅ„rpÙÛÉ€àulà` Ù²P¨hÎÒ>îóÂçŽG\þ•nã}ŽŠàɨMÒF¥¢v1ùsÜqßZÏñU•¥µ¤³áog\,)WéŸP÷#Ö’Ñê7Ùí¼‰µ¸s‚N^[ºg€0jÈ ´ljciÇŸtr{óïZˆ¶ÄÙ;0 3nÀÂY‡°nŠ:Š`nÇ z¼}½*}A&öÜ¡¨N–6mq!uÈÂqêÚ÷¯9Ôµ9¯¦.嶯 Ïjµ» _S ¹ Ÿ‰íMg (ã<œU»³!³üÙÀÔÉbe;œãØÒŽ Ñf• zUižb0xö–Ã!ŒÔDîbIïPÃb …*x9ŠÏs†¡§k²†uëHÌSP!#`¬HëZÁ‘“¿JqÜö';ÝÍ^„™}j££#bQ†m­Î¤ã‘Wº»»†H )‚ÙÏà*oÐk`Ú¤’GñQº¯^}…4·¸ Œã'4·%Z=»p~•+U¨õ¹I¢!Bƒ@‰ÂœúÒÐl”¦SŒS @chëïNÍ«‹Ð dŽG•¹Ë šžƒMâÀ¤h”M‡K‘•vÎÑÓ½BÑ1ç­M†4ÆqóR"ô¢Ú*Ž9V…QÎ>èB—cï0B| ÿOÒºo‡Ò¢º<ãüúR!vFÇ‹¬­–⫘ý¯½vfÒÖõy˜D¤ ddŽ”ìúûšw"K‹qtÑF~bTrGá\‡‰•Z]w6”~ÜÒôFaé#æ•Æ{túÿ“[–j©}³Ù$d{ô§óÝó0`©ýúÕ;{±iª‘•…sÉVÏô£Ì«1Ú­ì·Q—¹w’Lu=jÕ›±²Œ«r{æ‹=7fO4gÈ$ÉÏMÇ¿­y¾±5 w<žI$Ÿaߣ¦¦6më±,d`m óƒ¸~8ÿR#6WØõ ÏÓ?Û­?RÕ‹1¶I`$nÀà.PŒžO'š»nʲd9ã-»9ú·^±Cýã´ðĉ¬Ú‡–$Š&ìÜ£98ôã?¥RÖì.¼S,ÚÞÂð#|£¹ÏËïM-G­®rñ;<ŠRe–âB~VÁÁlnè?\U ªWÌŽåÔrïÀ=~½*ìúj^èR$m') ÙÆ: ùº÷4Ù $§x'¨ûñ÷%k\WÖö.Úx^ vŽ’:ã–|†>çÚ¨ê¿î f[Úƒ’©úTßRícÍuïßé3yÂBޤ æ¥9a0OJ´Õ…°íë…÷š« ’dmÙïš­zˆÝ3òõ3Q±n›¹4´¢+̪Ÿ)p}…B®F8ÇjZŠÒ9 äsÚ©Èrç-D­m "b3Ö™žÕ˜Éìáó%ÜGÊ+P¨c‚0*â‰{Ù‘‹gyB—Ú•iÕ ]Êß ª½„Òê>óFà;TÅÐp4õ½Ã­˜¨‰üDsêi´’Éßa.Äd•?+{f˜ãBhZ=G±$NHÇ=ÍU’Qçd$jR²Õ1îtï©õ©âhœWmF›”!}í´)¬ª„ä÷À¡lGdDùP7 ÓÞ£,ýŸJWhdª’²Œ•AÛ5ZThþbÛ±Í7u¨\– ®›?U—19ÀàÐÕÕÐÀI”Á¨Â`ç?ýjV¸\P =qŸZr}áŽ})u¸‹(Ê\õ©gpÇ `⩽ –ª·~U¤A+´+]\[ˆ¼©Á·ìô{«¯¶ ‡‚Ö<»²çi=~™¯/4jI¿#|:¼ÕÏ£í/e¸¼k%Ì› oâ Õ}O_²ÒZâ Ë9fKŸ“hƒÆ ~WkIÈúu{A§¢Ù¤±Ic¤EnIܨ¤–aæÕ£'+/Ì@%Ç•ôØ ÊPukÎòVåûÎ*°QjZu4í­]ÝDÍån铎jym&ò^‹.9ʽ_ s&‘àÛ£(ÚYEtØ2*°8+ÜV“C;#ó|´Aœš7w jZ:ƒ^ LR8SjaFڼŠNF6¹Ýë‚yæ’ÑÜnÍYýÁ;9$1àg¿°=ëcÁ2츼†<´4ú«•Ê}®#ŠW¿³W|4Ò[iâÆ@ÅU¶p*E¿3¯Ô,îZÅ<¸Ùy#ŽkñE¬±iéæ¡C’ÇŽÞ6êÆŽŠ-ÞGA½¿ˆž¿çÒ­Å#}¶"N~aœG¿Jr½ÄŽ‚P¦2ÁºóÏcùÖ5ù$ àOR)j“°ãkƒ­õ¢É‘¿oÍŽÆ8Åö qŽ94Ö¥Y$j\)“hÆp=ýÖ¼û^¶Ù#( žJíû¾§ÿÖi¥mÙƒjèç¦U»·s0õÿ¨É¦´C%¶,ácÏ^ÕÑ´ WƒBµÉ½Ù–ü1f•±º);EèUµÔ¯#1Ž*©å³S-YD,yâ…˜S¸ðF"Œ —icÈâ¯[hFú–£9ÀªšÐ]°ÆÙÏ_jrwÜvÔ¹j„DŸ7ô¬­¼ío­W(­®¤&G%GSLYšCŽ€w4µOPK¸ÿ0cÇëIæ·CÉííJý‰ácó<¶p>ö+6CºFe]¹=¨ÖŮ̞ÏV<Órë•ì)Y†Ú rT.IÉç,½ÏSÅKA1ó2;TΧ©àÔy Åæ ¨ÍHM Åz¢ŠÐ±öšžeEÀäRº‘¬@Ä0qQc~ ß¾@&¥E qœÞ‹&´ò'„˰úR2–}¹>´÷ÜcBŠ ;jm“*ÙÏZ/m v[XÕçƒÔ× ø#âf¥à6îËI²†_=·÷#Ú¸1ØEŠ£ìÛ±­(K›sÒüñÄ~,×VR;k{[Pf$ãyè üëЮ-§ÖtðòÝlbåŒÜ8¯–_É‹ö;¤ÏroO|ˆìíÕ$v‘·}bkvYmË>>ü§$WÑÓÂaã8Ë—ks­RÞ Ú`™<Õ}íŽ08¬©â°Žçï_Hšjèóߘ|–ÒH_îqëYÒH×Íå+rØ#¶j‰ÛCrßLœCŸç,¾ 3…öë\WÄÝÖÂþÚ{+£rÛvÈá6€Ã°=i«-ÁÜ󉔲`+dÿ_æ:Ðð¸6ºûC*àH¤烟ÿ]?$JZݤŽl''í‘þ±á¿"ê䤰†Îp M»~ç£Bb‡k# 3ów®_ź\7zt÷ó<¾ZŸ3+Ð^xÀ g e ,ëò>½ò©%\#q¸œãÌÿž”ßs8Åõ6ÝÂÖÜF1€ ?•fÍŽÂ!Ì0 â§]ÊÖúž£³$,Ù*Ç ]%”YÁW sMßaêtà#È ¯Lç§Ö¼ïÅn¥…ÎG#-ÓÓAè)«4Ì•Ó9™`X6Þäÿ8?™¨Ó,Âz§ùóúÑrí®„èäOÊŠŽlö=úäóWeM¢7a¦2ÛsÜ*ôÇ©ÿëÓV½…Ö÷:?K:¤S\°lè@ 3ÿxó…¦´µ)ïdÖÂ3‹ˆg%ÙÇgŒc=¨Þåu³9ë¹­¤¼’;8ØÂ´ †#·@05ÅÁ î Ü‘î~÷>ƒùUÅÛfKi;3cE°›QÔa³‚0‡€Ãq‚sëÔã=8¯j´Ò“§"u sžÕ™QØ®×N\íçÏJ§5Ó¹ ·ã\3›Ý )hQ˜ŒeŽ}*ŒŠd,XLrHë\®¤›ÐÞ0²¹ƒ¨èúUÔr+Ú«–ã$ þuå¾#ðŽí.s’Bÿ…z4꨾SMËS‚ÔíîLBÖW—Ð)5FÿH¼³yÐ6æéÇzì‹VÜæq}L;ÛI%ÆqéY%8î(o_xhŠlªàôþuM›æÅCÑÉïW¬á$ùŒ1éJ;ŒÐÁ+óf¦Dx5¤¯rE•„1“ž¬æk­ÇžjekØèmy`íÎ;šeôމ•ŸJ5H]lÂÜ0ƒ¹ïO1+®Ò0,ÕÚÚ1kº"xdFÚ§åé »‚ç4Ú¶ÃÔ•–CoµÉчsYæEGeÚPŽy¬úÙ•qRTÎòp{cµ<‘ž¹Žš [Œ‘$-ÅKnŸçJ +Út²œôÇéÞÈv3q´œýj`ž\¸=)[AØK„ådzÓ¢|Œ1Æ{Ð ;qÞ™Óâ¼p$½‘FýÃ8ö¯H¹²ìÖKxB¾9Åxµy%'dwBé$q:«=»†ÛŸš’ýñù’–Dæ¸ã;ÊÒ:§bý–¸s²4ýÞ09&¦]I'›4 «Ô¸Å{texžlâ“05I^ójô~¸Mt:U¤šŸÚà6O)åL€—#ýž+¢ìŽº˜Ž¡©júƒÜÍÄ€àmãJ©ãm6ÖÛG$ÁïÑ·:ŒgŸ~ôµØzjž]½™’6Ìã )\ª_Pk2Îñà×`”¹› ÏLûŽÕWD'ucÑåc%¸f_|þ^ôÝñ-µ%@Ä«œ×µÜ¨·s¾ŽùâFÆáKqøT~*ÕGü"­J7cã'ßÔzÑe°ìq6 Fr2qÏo©À¢ìaÔ¶¯¥w{267­£Y<•™¶ÆH±’=úrk´?ZVÚÜù¶å7+´çÒu8¦M2K6ò+ÂŒþ¹ª¶J‘ ¸Æ1Ϧ½DA’˜ÏN{ú§Ooz«4ì7d>6*ª@ä d6OÓéÓÐTñs…E#'ž¾¤c¹Ñ«®‡تh£~B aO¹ÿ=ë…ñ\l×j¬#€w`©öëÀöæœm¹Ž®G*ÊKoåø‚xüOáP¹u'æ!ÿˆ“ÀúÿéO­Æ¬Ð) Îâ[9$ŒàÿŸÆ­@¶Õl7_—œ`uöÀúsJ讆…¬ÊLÈJnUØ[nážóÃyÚÚéVž&¿¶Õçt†+EË(ŒúÖ‡°-Y…©¼÷ÚíÅÔÇÎ;Q!TtPqÆ{ãµu¾´·š4XQ¦'ï‘–ôüj5NÌ™ì–èóÛ£6c ªš“j(Æ:æ¢{2ã¹Ï´Š†¨ŠÆä–æ¼ê‰ZÇDo»ÊÁqçò¥Š;¢7HéjãI¾º—‰biš ¨@¬7ÖdpK„•Óm/s&Êï«n8sšçoímî=þn•*²e^ÏAÐŲ¢‰B'—àí+V¸c{/ÕEò»Ô‰ç~4øW§Åi%ΜUQ!kÀ¯í¤µ¹xHÚqÍwós+œ„v°³J©Ç­j«•] cÛ5JÖ¹=G¨>r§éN–MŠÎÀƒÛš»ÛQu0d-<üžõ³l)ÿõÔ.­„˜¿uðOëS’ ?½U{²e~„ˆNìg5; ‘NÐ3ïÞŸ@w*d-»“T´Ük]޾@« en{Wâèþdp;yñŸê}éÅ»èŒ[IÜã$\2«çî8ééÇçUœ*F¼ù³µsŸ§_¯©÷©ßR“ÝŒ6Ð2z€§8ÿëžjÔ$ÈQIÉ=¶áO¿°ïÐvª^Cô. Ÿ »wó ö<ýæéžÂºëw{ß 6Ÿ§±I¤%@Äá«zgëK¨ìµfœz}½—†aµ»t‚îS†vä裇C]¿„|5§Á w19;ˆàþ·Ñ”¶;§š;x±Ø•ÏjÍ3@U¬*»lTÌ™H$ŒÕf”tÎ=«Ï“Ù#¥7»EI.äG.~•—wL„qÛªô»Ø©I&Aö»•C¼*‹³NÙ µ½)ò¸éÜ/ͱ,M!ËŒ†–kpŠ8ï[§n„_[S¹¨7v$ç‘DavIîEâQ¦4`©ÊôÖ¾yÖ¼5=P¸;Tžx®¤íÔÅ«Œ×¼;¦èš:˜cË9îOzà‘ZVÀ^3é] ßD`ÓFƒ¨ŠÝrŸ1õ¨N»BÄQ&ú…™RÊ-òo#ŠÕ1à?Ö”S¶€ÊáYÛ *älB¸üéê„ü‹;ÃG„@=ñK‚§**µì6’C&PÌß•P}¡°#4˜_dY’0Pç­Ut óÎjZ¾Áê@Ûƒp)Tn‘~¼ŠRѪÚG.…“É šãUd`9æ±¢ýÛ3Zš;–aºl8â’@°±;KgÒº~{[S:q‚>µr,RGTêØ‰sŒ¸§Z¼){·‡[$zÕ_¨^ëSмAñE“‘èÚ^œ©ò€\ö>½+Í!˜™ïiJmêÂÖD7qF6ç­1 *Ö•­©]5-[ÛM2ï ¸­K=Qœ£Ü3Í.º‰Y»±àO…²\\G{­&bˆûßZ÷#d–ÛZÛ¬p  1Œ àÄ7c¢¯©q"€Ûî1ymŒœVõ”=,\8<{Wdê\ïmò’ZÜX‚LÝ7N¼»CòÁ W2Q´Iåmݳ’¹¸„\_æÏ RÙêOÁ–Éï‘YRœbïÊœ[Z—EÏ–¾hœóŒ×=r­=ñh“œ£½zÔjµ%¼ãœn›öÎâÞÜ´ À+cÁzÍ¢gKŸÊF” 01kÓó9ºXéõ'J0Ãsml°³|¸ˆ Ž{qŽ+޾ pg÷RµzäÒ°z™ž º°Ð·cy¡pê§¾j§‰Myôûà‡æ„‡&\žN?—àÖ¤·mYæ:EÚéž&ûû’…º{~µÔ꺆f)³äÑk°Ðîü)—I…f—vÑÆ?…kk‘G5©ÂgŽïRÙ{œXQ+7c“êcJ»5¡Bøï–íAÔ}€&܆ùq‘s]‹wsIm(Ü\gä}hIê5äC¨¥²\ «P6“µ£Î1î*œx˜³6c×µ?QëÐé.aQ00‚23Œu®_Å3@ŒNœ¯¯¯œuØÎÖ<öL•c‚¼d’-ßÏš®ÈBm@Ý7H'ÞÝ=4nîZì®ÅU±‘n§ßÿ×ùU¨·6\n# Ôéü½M;õbwÝš(KÌ>]ÌrT¶G¯$öô­ßÛ»ø†–FH•ЏCÇýW|€z·sŒôJÚ#Etz×…$ԵȮ¤eH¡a“ô®òÁÚÒ‰äQŽ8¡0}™%ÝÉ1“匑\äÏ#Èr=»WŸ]뮦ÔÒ±îUëÍWŽ4Á¾c\ðNmXßE¹¤4’ +ÇøÒ6<W â¢¬sîîU}?¥GåT–Rè:Œ)®IicxÈ´¶Œ';WŠ‘¬ÉÓM²ZÔ¯= ÿV‹–=[+ S‘lˆ†(ËÈÞ«X·¡2FDÞdÑþÿ ¾„ÖiÒlnY™Pc=@ëZ&›Ô–»ú烗PTŽDÛ¦3^kâÍMÑÊAjb Ÿ›šì[\Åë©À_HL©àp+›¹c$äZsÕ\JÝ [h¼¸ãæ5bQ¶3‚Oý»)$ÏYN >) `O'ëSp.#dœ⟼äöÇj­èE’<ŽÕ›?zŽhÕ¡W”ÚT)Ý’xôýDñŒ` TK'LúäÔ8éf êv–Ó4º<ѧ;Wô®l‰ÙO<×foU+¡Öòm“ 3š²êûa]·mhbîŒëŒàÕˆ1.HüêzØOmIƒ@'ŽÔÕzžÔï¥Á4gº)~N9§*¢Û»ô¨c.Î#6xLôëU´ëC{y°ã4Áûàß5¥¬l·IЂ<ñ^½cáÝ&ÚÔLËüd沩+"¢®hÙÅn²–SôZ·),Ü6Þxâ¼êϪ: ŸRxƒì$mÇZY§"!†ØÇ Ö¹%v®–†êÛ2%;|É“ÐVµŒI~Û £ïk*QÑ)u*NÏBûèz3<3+9¬ë•†N%¦áÒ¶(B-AsI»ÈÞÎ8Æv‹°¦ý‘í"; ÝÜEÇp¨ï¶ÆuõÜ× ©rv£Vbh²ÇÑEl&:ŸÂ½˜{ÑÔâvR7ô½Vò)£³ù«´ ó9ÛÇQ“Yú„÷_Ú0Äa8ŒîÞ«ÝòH­|éìz2.¯à…¤G(îp„W‹Gm6«¨I€ð†ŒºŒtúPÚ[klxÿ‹t™t›¸/BÇœŠÏ^:WY¦E.»á彈#`aÔžAéHvOS[Âw²@Üœrzb»FRök.Ö!€äqš¦ÐÕºåõ’O ¸€ ë÷Æ:ý+6 Ù}ìHµH}Éìd9!ŒÙÈç§ÿZ¯›¬·:„P?àJžÄõ§­ôµ‹S-ôG „¨a$dÃ×ƒŠ¥<̱ðÅOO¥SZºÔé ‘¯, š1’ÈGóö¬Ý~åÑäW!¤[Û¨ü~”Ekädö<ÆeRß½àŸœ¯îqŒzS“pbW³¸c þ~¦’¾–Ôv[…-ÎÜœã'üõ¡v¶X¨Ç~x>ÄŸ¥6C7tKino’ ²;°Pá¾n õêÝ3Ú½ãMdžìa¶}­Œ‘ÂØ™1ñ÷wI>ùÉ÷¥¹ªHŽÎèÏpH8R}k¢s²Û2Øëž)¥d Á¹¸”’ 5P»g–ÆOZó§/{S¢$òZ@a.w1ì*Kk)¾3óµ«åŠV%6ÝämXM6|‰rôÉ«cMÅágКj\Ñ÷·¹]ÈŸK˜çwJ¥%‹Æ~e•ņ7¯e$È­ŽÙÆ&®3’âF}+¶'/RŒªN9÷¢ÙÀ'§lQÔ:ܮ̖?¥"FiÜH§r J?¥"í¡,sº²&Uû«ØÖÃÝRKMNm9Ý¿!I8÷ã¥WQ¦–§§iQ°L$E !`ÆZì À´X¥B+œâ—–ÅnaÊ¿¾B8-Ï¿½bO†à‡}ÊÇ ŠNè›éL?µ¹û»sšÐž :ñå"a7;YIÆhVê­Nann-/ZœìÆ0ÄóúÖ¡œÏ0¡ÍEj޳Á· ?…â»ý~½zÕ^=âVCÉî;{ûIÜÍõLó˸Ùn+Ü tÀì§óÉÉÅPÛ¨ÇÌSœ pzôÇçÆ½[¾Âi'¡œœŒt~gÛôúÔNYŸ!†{ägoøÿž”ºÙ»#Ûük¥[h\[[pNeºs¹òGHýþõ{Æ:¼V¶rÜÄ›9  ÜÄžRhù”•µ ðý½Ýå™óDAAÜŠ2Xæ»gà¶Ѻ=Z±-7.¬Çi®#’NŠq^kƒrº7VH³^Z‚G?Jµ Û$NqëD¬®TS±³ ä&61ë@IïRmŠ;ÕK]㦬յÕáU #oÇÔÓ\ÛÝ ÉéZF¥ýÖKV÷‘“q=´(Èÿ|t³íc†êçÌ–C±9 žµQM+•ÊìØËÂ×l‰vµ¨[ù› þ™¬ÝÛ¼‹VJÆ=íÑž#Š<`±ïô¬6ÒÖGÈrO§­k}ÚâÑ+–Æ[x·mà=r>"‚âþÎe’ùQq“Åu«XÅësæ"[êÀ²ù‡=k>Ê?.=ç¿¥jís Ñàçzf”Œ“ž*Óvlµd7E·tGuS<3Í+ÝèWQêp6ïúոܘÀ絸›è,Œ»NàsYò`°ÉÉô§«ÜKFh§¼Tà€3Uoæ ô!uà’:ÕEÚ×AXÖ4‹. Íþ‡l¿ÙÒ¶?€×ªDÑ\9Èëžk› ÛLÚ®÷Fdlæa´~• cìÃò®È÷9Êî˜FP9ª°²•?-·±p§s7ÐSÔ©åy"˜^äh…w+ÙéUq šRZ‡KÖ6u :÷?‡ŠFŸ ‡ ‚Æk žf‘zÏiajöêó©ëTîãX$ÙcûÝë—ÒÔÖš»Ô›N¼0œÏ!>ƒÑ[ÜÚùeçFôõ®q‹•å©ÕRö÷KPKk$lѶ1Æ RœK…ÐäÒm7îÇM$:ÒÙoQ•þSß5µae%¾ÝŸ/?7­kN›ºŸQNi.QÃNII‘×9äiÇLÓÇî“6òsëWì`þ-ÙŸ´”tC—A‚ÞyòJDZÀFò4‰`õ¢¥GÝ!ÍÉ™‘Š*1'©éSÁ-½¢í‘å|õUj¸5kÜ‚®´4é¬÷”u“=+™²KK)e¸œ“å®èÀõõ®®‚[—×ÅSê:lñ\ÆDqþf2qè+Ä m­&²»‘UÈVÂ1€i­7¦¤WQë¶z»[ØÌï03<²ºD=Âõ=?Zò˜g}\†å”£$='u©ëZÑáû©®fK܆O¼]©¼Þ¿9Ž@§£w5[jQ— !v?+óÀëúUV‚‘£™:ýÞ:KÌ—ØÃÎø«Œó{V„ºÍÂà Hð6†Uǧ¬˜ –×Â×Ñ4Óê‰w·#r¤ú{U;2†É»M4Ûv'›«/ü;ÕR]/û=ß/Ÿ•Oçé]>§k)+IËuÇj‹>€õ<Æü¬·9,@'¡­î; Í‘@8á@å†G?žyǯåWæÑ+̧u/–  =rsÁSïþ*Ž%iJóðú~4tÔ¿6zŽ‹âË_ø8YEo¾C™$w?—·½súgŠõíOÄn{BöÙ>ZlÜçÆO¯Ö“½õ™ì>y¤ˆN#—ùˆôöÍhêwFn?º£¥j)ƒWf\11|ç5³jÌ#Fæ±ç¶«`Jåùìa‡gÇJÌx Y7n¬*rîofXQÓš½p#[.NÓŽ­L½Ç+£woàõïZö–¥“{JTž)Å&ìÁ»jÊsZ©rìåfñÆ•u§kçÅåîço\}kœŽáÔž:V×f^†„S¨ÎsíS¦d?-Uõ&è–¢2ªF{U`Û ]ß\Sv½Ølî,är*U.Iç4j˜ Øb3ž*,ÈHÝžÀQæ?RÛgœŒSU˜Œ`)ÞòM“}l8¸Á2qž†ªÂÛp¿5_v.æW–§ éo°ùq¨#o5Æë:Ý7˜0s\VÜ™½hò¥c."±ÊYûU¡2·Ì žqÍzIØåë©VbÌYÏÞª@؜󊖵è]‘•€²µ À©ãŸZÕyŒaB§8þuVä—#€k0¹=¼¥Pݵ} àk$“H…¢?6ÜŒv¬eª²+¡ëZ}Œí`¦i@l`’•K.™l‘ï3I'Ö¹kF:¦m÷ˆË[T.Y#ЖâÎáäP%À=G¥r¨7ÊoÍ­¤\²Ñ.Uòó°^¼ŠØ6‘&ÐeðÅuÒ‚‚÷Þ¦3—;Ñ-â‚)â>Õ¨Øh€qZ­z™µÜr{t­[êÄžÆUÊ„€mRsÏÒ–ÖqØä÷è*wW)\}ΠndŽÚ<ù[†ò JúÃ_b¿ðôK1€eE Kc¦:þ=ê[wúVöè‘ ³…Tœ}£šU,Ò¸u°ûs´’5­‚¹n+•¾Œ´›'•˜Æ>|ŠÎbŽvÎk–NìÞ+MŒ“@à©èi—7×]²}*ùÒžè–Îê A”g³Wî5„*R%¿­?h¢†¢Û*Guç𭻞էt#6hŠ 7sÜÔÅó\©hÑ9Âm-ŽØÆëvGqJØ<õ§(®[ ;= {…¶½áßšë--uKæQk"€Ãø¸­)¦õLS¶æì^Ö×¹¸ˆ÷Åcø“F¼]>Co8.£¨®Ø©ZÍœ²jþê>?øŽ—°j²%Ái—nkη195{½ eëWÆcÅjFçƒüêÖ„í°¤–ô8¨È8'8§­_ÌÚ5zúR¬nT¹^=Í+k¨®‰¢šÒ4Ã#1ªŸkg½QÛéEîôW&™†Ò û}i©! °)k}äêcÃyàS- ×#šÊ³J ³H'Ìzg‡",Gl÷®OÅví£(l+dœW„IM©v:ñ ÜLãòÌqÔw«Š@ˆmv¯ZÝQÂû‘°F1ëÞ¨0Ùq”¡m)%G5½WXÆ7¸ÁpAÊ‚@èkBÛSyDà×2©É+3i'%¡h–cÏc\}íÅËß1a“ž1ÞŠ’æHÎ7Jìž]Fâk5„(®{Ôñ;5¡’G!èŒeÍylW6››:=»›šNGbjí‹gV·T\ƒÖ·|´é¤eñ7r­ÌyFW“·Jåµ+ùÑ<µS¶jbìÐË]6)"kˉ•[@'ßéY2ÝÛC¨H y •pCtýnk³M„—r·‡õ¹í¼/©YF¬&—9AN{{×#ãk±¨ÃÜ’×›q$…FM=^äy£áû›o¢*œáÏA^á1¸çHä º”­±§iw#o˜q°ªWÑaŠˆ N:…9§«[•m4(H ›bAó1Þ»}5§°´€É,QyK“ö-øúU½UÅtŽoÅ~$û{„A寙-•&¹ )ƒÛ¸)ÜOšÕÝ ÔòM:wŠê9OPGQœþþ•ôÇ…ïXðÄ"iP`sÐÿs¦CmÄâ5ËHá½™Gú¡’ààž€ÿxÿZç'Bs¼ç®p8ÝÜcØ`wü+IJû•µ3¦ÉB¹9íŽÕ—½Ì¥qž{Z7f—¾¨Ò±„´‹å©bxÏåúÿz¦‰ׇ®!Šâÿɹu mÜÈMßÝúqך\ÊÖcÙ‘itÍj¯!ÜÌ3œc… †gÊ­e4Øh"©F+аŒ@ʊ✹nt-Ä’i1‚2*$bN:VkR®šØ³á†E5¡S•©êiFÛ¬„@w¼O6kœ:çÖ´ä²ÔWi“ÆÀ\TÊìñeæ°o•ò£mZ»25ÊŒA%«‘¾¸ó63Å;ÚWl¨««Ø‚ÆÚ(¥óÛc¶x 5ÖØøŽÞÙ‚Md@ÅuÑvÑòW»ØšçÅziSæ]sØ·Zóÿø°C-D0#VÏ5Óϳ!EõGÌ^:Õe½½bÃ9$–'“\<ò+Dú2Ôn8úÖœl?:¸»"IG8ÉçÒœÀö«¸—˜ÞFyãÒ†'…'Iݰõ"À?Ã×Ò’Vã!sïT¯ÐW¶Ä²6‘éIÜ1Ô´ûÁyŒy@;@ÆMXµ„G8,ÊKs€s\õŸ¸Íi|I©áÉvèÌ:+˜ñêÈ÷‚m…C ò°Íû}6;ª Üóðå$à¡«Ñ’ï_jö‘ç1²í •<ý*„¿}sÁ¢V[.‡ýÎÔ_©¨'¦h*dŒŸÊ«]‚2þ4žàŸB£´ õ¯§> ù–bÒª—ù€ëŸóŠ–®¬WS×â»ÓÖÐ;°i˜r{Ь³¦ærwÙ5ËQ¦ìmô¹Ÿs²K•s•Áìk¨²¸·–Q!ltQÉ&“hÒi´˜ëÉ#(ÃqQô¬xâù‹g÷ÏJЉ9+„t‹Eø%sòlSe„‰UÑØc¾k’pæfÐ’NÅÉ5X–ßȘ1=Žk0Ý$¬oÍoˆÍÆúˆMÀã±gj×ZS¯QÖº ÔÌ$ì´-ÜÏ.Ÿ¡ÈŠ0BáG­púuéŠážxÈ%ºã¥UdÝ’è(5gæo–û €ùCïqŠçµ) 3³0éÀª†ú’Õ´E(¦Š[°vdŠÝêô°=Ô §¥¸ŒÝ0L€:}+±mv$“F¯‡¾%£Ü½ÅË;?*Ê  ÿtƒõë\Œlô›ý7Q¶k8ìnôçÚ²ÄNÙ²zò{ñI´Ú°¶G•øh-—‹í\³ëê1^åkG‡rFH#Ši]èëcZÎS§hñºí/óg½jx¦2÷"X —Œô¢]ʶ¶8Ë×|Ø×c¯«PiZ­Ý )G $ mÌ?/ëDµÜ:ÙÞ¥¡ÝX™$]UfqÏ‘"•$~uSMÈ#V\“Á= (%anyuœj0@öú{õ…z¯ošÑœ¨~xú ýŸz7z“¶‡S¯i AÓvHŸ_ð®îÞHÁB1Æ0q‘è\úž¿JnÛ®´1$]²íþZÏxÄsŒóÅ/2÷Øëü);Z\IÁs æ6*Æþö;ÿú«»ðæ‘ÕÄž}Ĭ\£Ç,¼z⟓¹è…ED@ª;DgÊ$šÎ¥ïqhFí¹·t>•*>¯-ݽ•nRBCsŽ}©»9ÛCM- ܳlT8Ü8®Š°’Èî¾?*Þ½¤D®Ö†Ö¥e$/Ëž¢‘¡*¹ж•¯`O]J2ÀóÉ€ûGz±$ðZB#$q^z´[“:5iEW·É!*‹Ÿzä/¤™nwù!=)ûE7tŠå²µÀd y©dŠiP1#ëŠì§vô0•ú‘K¢Zj16&Þ­pÚïˆÞÖò2äÿv(ójÑ›ºv¹àþ7Ó.´ûÓÇ 0k‰äÖ–ÐÉ»²hsÓ5£I²ERD–Ñ‹wÀéJr§hç×5¢Z´ÍÜäÒ1vqô£K]…ï¨+¦ý¯@Rà°Æ:Q¾‚Ôc¾é c‘O@*y6°®‘uÍYÓQšçwíXâlé³z_ÏLÒ§Hí0ƒqÙ=œ¶QÛb`Þ Ö‹•I¹½Û!Žñ®sT¤e.Lrì>…³\3åæ»6ÔlgÜK’wqÉ«Vj$ÇåÚ³çÔnÉs»’E@‘šè¼5tK¤L8Ç+ï]j{æU!hÜ—Ä:²fÔîÇîŽßçúVM®ž²ËËÜã ®çQJvFj7fÜZyŽÜüàär¡zW=¨hqK!m˜'¾+e§S>n‡;s¥ý›÷›ÃqÆJÚð•ÔVº¢_ßñDG=H­VÖ‘ìšv¿£j…’Ë [æ-ŒkÀþ%h{ëWönX/$ýâp²6>ï·ÿëÔß[–ÇÏŽËWŽRÜE %‡= {•ް‚Ê17Íi{iJ‡Q°[‹;”‡Ë;¼¾w7ô¦G.£2ܨ¯ñœ ÷¤÷Ô¯‹c:æGò•ŽÖÇQž†¡±ñ$ºyed 9+Þ4‡æVÖ5ë=YÌ—åÉŒgNÄ/*áÔÿæ³ZÊËæ-÷GúLZy„¬›™†NO©íô×Q¡†‚é~BnÒ©\u=È­vÔ™ëlÇRÓ#0—¾õÀkšk‡r"-ÓŒþŸSÖ£TÅËmÆ]Ær àõîÏùôªW¹ žsÉ5]5Å'T{Y¼¿àr7qŸÇë^Áá¹^XZ]±Fr—2œŸp£ ýÍ ö4³="+VKEH c­U–=Ù5•[%¡+{1¢6<Ô¨›~õyGtty!G*9©"\ýåÅC›OBÒV.ÇJ†6vö/Ùn#8e t®ˆ^ZÛBl‘bcàÈù8¬™.žL¿/j¹ÊÚD˜§¹YœÆ…dJw#;©ßšá¨ïîµ¹ÑmJÂÞ16Kä*¦¡oÝç{Ò¥¦9;É6Ű *ð8™q¨%«˜ØmÅvBëVdìݶ)\kb̰·#šæ®üQ-Ñ+2g××ÌÕˆk™_±å_n´iíd&\Üúw¯8Ü@é] «hs’FÀtëZÜ3íNílK-!-Æ1Î*ï–F?OzÓF® ßb³FÊ9R;ýi»ÉSƒ´}j¢¤±<äúÔÖb6º&EÊc½i¥õ%…ÎÁ+yj¨ò;uëÖ–Îè]`NHêΚÅfe'Ž•Íˆ÷i»Røô=#ѯ—¸‚vóÏz×ñ %ÿ†§P§÷|׉K•MòÖ #Ã.d¬2x5±Ìàw=ëèn®y›è[”„ä{wªŽrzúS}Á+@ä(ÏY.»?QØB1Ï¥E¼vð9ëCÔh¤7Ž ®÷Áš••–¯\‚W *j4°úŸDiRÅy 5ª2:žÕÓÙ2m)3”u.G5“\º”¶ó'Š9`íx»oya[8ìMf½Õråï;##P®$x8¦5Œ‰’9rÏÒ¸¾6Ù¶‘J63b‡Sg+çåOAéVbÒÜe¤rXòMp{)JW“Øíö‘މ-œl0OOZ¿o 1— Zß‘EXÆV¹Ã,’©ë“éRÙ™!—9Æ{ŠçEÎ6Ve¥·ˆ^µÍÔf\ñ×¥lÛÝéðÂD`¬ž˜¯f‹ŠÔá›oE±•y®¥+¶g>‘®j‹j«:“Ì‹=¤R?*udÝ„ãÊ®cÞÛw«o\ÑÜK¤ÜF‰ûÅIÛÎ vÆNOB#£Ð§§ÚøŽîØÃovÚ| ÿ¬ó géëY^#Ò”1µÆ¤nnÇ.ò’v·¨êi¦Ú¸îÏñº@Ìæuf'¢Ö½ Áú‚ßøzØÈ¿tl$ûSORofu¡ÞÖØ\,o„<0ïíEÅìwÑ cŽH¥QóÐRèk~†\“¼ˆÁ†Ò½óÅR†Î[ëá°D%Øà~Näl¬PÖ4ëhœ$’O÷jŸÃé"[y*2rNÚ‡'výÊ÷Úeä–ÖÚ…Ã$QÈ1Iü ØýOæjÕ¤d„ElÇÇ=}?yª¾½È¿CØ´=PÓ¼6’j äïÒ#3žT}ß¡çךåµäk‰ˆ1ü¿p¸öúŸÒ¥êõ-5ªGœê1*O ¾IÇùç·n•B(¾Ð¤mÁóU{ìF‹s!eùP3ƒØWÐ> 3ã[ºäÞ þÔvÏ|Rµ÷/Ðí×~v¹ÃwôÖSœòMgUiq-¢ªõúT›ºŽ½ëÌšêtǰ¦1œVa_ ÍßšˆÓoV[’:M>KkxÄj¸À¨®ägrÛ0³]±²ŠHÂIÞæ6£,,@Q“Ž•UbfˆÆ9¬gg-´4Z"¼ð4‡hcÆ+Þ´MEõ–y.•ßXÎéhTNÖÂI ¿ŠÔ·µaš—¸ÕÏ2›wº)^\ÅÐqéU"Ôv·—’Þ¸ç(©htB--I¢“k|¾Õ º‹<…#lQ'ÐÒÖwcíÜÉ. ³Ï4³\´hù®hÉë~…¾ÄJd\3ž˜©e)C.N;Tò»{¢º½†®ª†ÎãµG¯k,˜Ü¼{×lkÅZ20tô¹±i Ÿ¡D€p _“DIS÷²îÏ9®Ø^Z¶sËC"ïHÆËm# = qÓÛ][O¸Ê ‹Îêꧦ­“Þæ«^²Sw³ órØ-í\Þ¹k%Ý£^"'îݽ[ßB¯­;Õ<=£ß³"j]c;@ÎN+¦ð®™oe¡ÃžTá¾\`úRV“ÐÍ^í³«k¡mhÝvÃ2¬ùn‚²½£¨ŒýåSÖŸ7IV¹763Ó­Ig5¤Zs¤Ä™ H<AMê$’ØçõX ÖæXÁ9UM:ù¡H•æ1È;€Í&¬ü„Ñ)½¾TQð.ÅÜKïøóZv,ð2\ï(ëÂí`Hô2ß‚÷5 $ìöG¤èój#“V¾HÌܬdÝ}; zóëísRŽÙ!3œ…¿¶­ vúžA©ÄÏ{+m –'#¿ÓØtΣ²ˆÃ§^HË–ÛÅV hrö6rÞk ôBÍÕŽSí_Dø]-!Ó¢¶µŸÎ ¹ö§£vêZÞçYfÀZ›c7;zÖSîeÍ®£Z&Q´ÐXûWÓ[›®ã`sÖ¦G™ð©€Ozç¼¥¢FÉGvlØ!P®Û˜õ'½M«ÞÄmþFk²Œla«‘Ë­Òn;ãëSÅ#m,ç’kÙµ­ ôUcÓÒ ¹u‚ÍÙŽ3GK…ú#“³ÔæYÙ› ïXš¦©;åw‘è3X§£ÔѤžÇ.úÌ·¥Ò% ¦¹‹¹¯Zãj±9„ä÷-Z(Úd0î“#ÜWâ]ÖÑÉqùGj튒ŒdõY³ë]–‹àoøcm/F¹¸Gû®àã¯=)Zû jû³¨Òþkš–—w}+Go™"MÇ$yéVõ/éÑVêÒܺ’e“éùŠnéj;7±ã<Ïzí×q&¬Óå~5,2Ç|Z)0½ù­mÌŒ¶~ åœl-žÔ¢3{Czf·ƒ”•̦­£ï-² CÌ85›or†x$ËÎë]QWÑìbÒ¹b=B È oòî“õ¬Kýtíkk¶TÚq“Å]ÒM™´Ö¥û{¹Î3Êʸ Ö¹ÍNýÒW“ÈéÀÅU“”Z]ÓC6Ò[^Æò+¤ÃyGË?Å»¶+C‘"¾’äwÀÉÏ8®®Í‚ºÔÞ3BÓ,Rñ¼à7]µ,ÊèvÊwèÞ¢šm´UõÔ´Ò'ÙvîÈÆ@"°Å¥Åýç“Rç8À§ÌÞãZ3NÓNK I­ØÇ àŸJç.-b·•ä´m²)ÎÑÒ2y¹ªi¯ä–Ñ~ú䎀מkþ¾€<ºdb6ps‚=…½Ù+œ ž•um¬”¾“’ÌÝ~ŸZúB /ƒc…T ¯?¥KÓ`¶—<ßRƒf©"Ë܆,ÞÇË»ƒîÄÖ½ÚIw¡0B«°àp¥=m©KcÉukAczCw>•µáÛ«§¸Hm‡< ¼“íþz 4%w>…ðž‘2ź•ü Ú»Cå©Ù8úu¡+n)%bR9Ö©ÊÌÍsUJ*åF×+½Ï—ÀëB]K)ÎÜ+Ëudåh -Ù"4òçfqŠÅ:=Þ­¬­´{±üL{ R¦æ”Q¬\bÛ=*ÛGGÓ q“Ž8ëYZ¤ÞEº¡nI¯V+’6KDŽI77vaMuò9À®WÄs,%'$v5Ë-ocXÛCŽÐý¬§B§¥t÷%fïYÑO•´j»= Þl?-ùÏ¿Jã¼Mx±Äê‡t®¸¥m72IÞò8è5Hf·te±Åy/ŒÞ_¶_‚sŒÖÐÔ™&•Î0ó’O4…¹­ý EŠ•H\`pzRåÙ²‘å:]³HÏ8(Š&–Ü1Š},ÌÞ¤Iò:äçšúOÁÙñxZG+ É#…®jÍ­M¡{4u6÷º|ጒ1À¿¥µÄiú„ƒZ2:”rØ t"½­t½N±$Þãi êHïZ s4‘¤Påz`u¦ï-‡è)4Cs#{V}²]­á1 $òyëMÛ~ƒíau î­­å$oå\5bCv²Ãç°Îx`Md•´L‹XÿÙgauche-c-wrapper-0.6.1.orig/examples/ImageMagick/magick.scm0000644000000000000000000000122111237307544020412 0ustar (use c-wrapper) (c-load '("stdio.h" "wand/magick_wand.h") :cppflags-cmd "Wand-config --cppflags" :ldflags-cmd "Wand-config --ldflags" :libs-cmd "Wand-config --libs" :compiled-lib "magicklib") (define (main args) (MagickWandGenesis) (let ((magick-wand (NewMagickWand))) (MagickReadImage magick-wand "bear.jpg") (MagickResetIterator magick-wand) (MagickNextImage magick-wand) (MagickResizeImage magick-wand 100 75 LanczosFilter 1.0) (MagickWriteImages magick-wand "thumbnail.png" MagickTrue) (print "thumbnail.png is created.") (DestroyMagickWand magick-wand) (MagickWandTerminus)) 0) gauche-c-wrapper-0.6.1.orig/examples/ImageMagick/Makefile0000644000000000000000000000033711237307544020122 0ustar SOEXT = $(shell gauche-config --so-suffix) magicklib.$(SOEXT): magick.scm cwcompile --verbose magick.scm run: magicklib.$(SOEXT) gosh -I. magick.scm clean: cwcompile --verbose --clean magick.scm rm -f thumbnail.png gauche-c-wrapper-0.6.1.orig/examples/perl/0002755000000000000000000000000011237307544015265 5ustar gauche-c-wrapper-0.6.1.orig/examples/perl/perl.scm0000644000000000000000000000074211237307544016734 0ustar #!/usr/bin/env gosh (use c-wrapper) (c-load-library "/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE/libperl") (c-include '("EXTERN.h" "perl.h") :include-dirs "/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE") (define perl (perl_alloc)) (perl_construct perl) (perl_parse perl NULL 3 '("" "-e" "0") NULL) (perl_run perl) (Perl_eval_pv perl "$var = 3; $var **=2;" TRUE) (print (SvIVX (Perl_get_sv perl "var" FALSE))) (perl_destruct perl) (perl_free perl) gauche-c-wrapper-0.6.1.orig/examples/sdl/0002755000000000000000000000000011237307544015105 5ustar gauche-c-wrapper-0.6.1.orig/examples/sdl/breakout.scm0000644000000000000000000002556111237307544017434 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; breakout.scm - Breakout ;; ;; Copyright (c) 2007 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; $Id: $ ;; (use c-wrapper) (use srfi-1) (use srfi-27) (c-load '("SDL.h" "SDL_mixer.h" "stdio.h" "stdlib.h" "sdl_helper.c") :cppflags-cmd "sdl-config --cflags" :libs-cmd "sdl-config --libs; echo '-lSDL_mixer'" :import (list (lambda (header sym) (#/\/SDL\/.*\.h$/ header)) 'NULL 'run_sdl_main) :compiled-lib "sdllib") (define *screen* #f) (define-constant *screen-width* 640) (define-constant *screen-height* 480) (define-constant *screen-depth* 8) (define *unit* 8) (define *ball-rect* #f) ;; vx and vy must be a multiple of *unit*. (define *ball-vx* 0) (define *ball-vy* 0) (define *ball-count* 0) (define-constant *ball-size* *unit*) (define *paddle-rect* #f) (define *paddle-width* (* 8 *unit*)) (define *paddle-vx* 0) (define *block-list* '()) (define *block-start-x* 0) (define *block-start-y* 0) (define *block-end-x* 0) (define *block-end-y* 0) (define-constant *block-width* (* 6 *unit*)) (define-constant *block-height* (* 3 *unit*)) (define *tick* 0) (define *tick-threshold* 20) (define *bounce-sound* #f) (define *shoot-sound* #f) (define (init) (SDL_Init (logior SDL_INIT_VIDEO SDL_INIT_AUDIO)) (set! *screen* (SDL_SetVideoMode *screen-width* *screen-height* *screen-depth* (logior SDL_HWSURFACE SDL_DOUBLEBUF))) (SDL_WM_SetCaption "Breakout" NULL) (set! *paddle-rect* (make )) (set! (ref *paddle-rect* 'w) *paddle-width*) (set! (ref *paddle-rect* 'h) *unit*) (Mix_OpenAudio 44100 AUDIO_S16SYS 2 1024) (set! *bounce-sound* (Mix_LoadWAV "cursor5.wav")) (set! *shoot-sound* (Mix_LoadWAV "cursor6.wav")) (init-game)) (define (init-game) (set! (ref *paddle-rect* 'x) (- (/ *screen-width* 2) (/ (ref *paddle-rect* 'w) 2))) (set! (ref *paddle-rect* 'y) (- *screen-height* (* 3 *unit*))) (set! *ball-count* 2) (make-blocks)) (define (make-block x y color) (let ((rect (make ))) (set! (ref rect 'x) (+ x 1)) (set! (ref rect 'y) (+ y 1)) (set! (ref rect 'w) (- *block-width* 2)) (set! (ref rect 'h) (- *block-height* 2)) (vector (list x y (+ x *block-width*) (+ y *block-height*)) rect color))) (define (block-vertical-reflect? block x y vx) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sy y ey) (or (and (= x sx) (< 0 vx)) (and (= x ex) (< vx 0)))))) (define (block-horizontal-reflect? block x y vy) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sx x ex) (or (and (= y sy) (< 0 vy)) (and (= y ey) (< vy 0)))))) (define (block-hit? block x y) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sx x ex) (<= sy y ey)))) (define (make-blocks) (do ((block-list '()) (level 0 (+ level 1)) (colors '(#o700 #o770 #o373 #o077 #o007) (cdr colors)) (y (* 7 *unit*) (+ y *block-height*))) ((<= 5 level) (set! *block-list* block-list)) (do ((x (* 1 *unit*) (+ x *block-width*))) ((<= *screen-width* (+ x *block-width*))) (push! block-list (make-block x y (car colors))))) (set! *block-start-x* *screen-width*) (set! *block-start-y* *screen-height*) (set! *block-end-x* 0) (set! *block-end-y* 0) (for-each (lambda (block) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (when (< sx *block-start-x*) (set! *block-start-x* sx)) (when (< sy *block-start-y*) (set! *block-start-y* sy)) (when (< *block-end-x* ex) (set! *block-end-x* ex)) (when (< *block-end-y* ey) (set! *block-end-y* ey)))) *block-list*)) (define (teardown) (Mix_CloseAudio) (SDL_Quit)) (define clear-screen (let ((rect (make ))) (set! (ref rect 'x) 0) (set! (ref rect 'y) 0) (set! (ref rect 'w) *screen-width*) (set! (ref rect 'h) *screen-height*) (lambda () (SDL_FillRect *screen* (ptr rect) 0)))) (define (draw-paddle) (SDL_FillRect *screen* (ptr *paddle-rect* ) #o777)) (define (move-paddle-left) (set! *paddle-vx* (- *unit*))) (define (move-paddle-right) (set! *paddle-vx* *unit*)) (define (move-paddle) (let ((new-x (+ (ref *paddle-rect* 'x) *paddle-vx*)) (w (ref *paddle-rect* 'w))) (when (< new-x 0) (set! new-x 0)) (when (< (- *screen-width* w) new-x) (set! new-x (- *screen-width* w))) (set! (ref *paddle-rect* 'x) new-x))) (define (stop-paddle) (set! *paddle-vx* 0)) (define (draw-ball) (when *ball-rect* (SDL_FillRect *screen* (ptr *ball-rect*) #o777))) (define (move-ball) (let ((reflect? #f)) (define (reflect-x) (set! *ball-vx* (- *ball-vx*)) (set! reflect? #t)) (define (reflect-y) (set! *ball-vy* (- *ball-vy*)) (set! reflect? #t)) (when *ball-rect* (let ((new-x (+ (ref *ball-rect* 'x) *ball-vx*)) (new-y (+ (ref *ball-rect* 'y) *ball-vy*)) (paddle-x (ref *paddle-rect* 'x)) (paddle-y (ref *paddle-rect* 'y)) (paddle-w (ref *paddle-rect* 'w)) (paddle-h (ref *paddle-rect* 'h)) (w (ref *ball-rect* 'w)) (h (ref *ball-rect* 'h))) (when (< new-x 0) (reflect-x) (set! new-x (- new-x))) (when (< (- *screen-width* w) new-x) (reflect-x) (set! new-x (- (* 2 (- *screen-width* w)) new-x))) (when (< new-y 0) (reflect-y) (set! new-y 0)) (when (and (<= paddle-y new-y (+ paddle-y paddle-h)) (<= paddle-x new-x (+ paddle-x paddle-w))) (reflect-y) (when (or (and (= paddle-x new-x) (< 0 *ball-vx*)) (and (= (+ paddle-x paddle-w (- *unit*)) new-x) (< *ball-vx* 0))) (reflect-x)) (set! new-y (- paddle-y h))) (when (< (- *screen-height* h) new-y) (dec! *ball-count*) (set! *ball-rect* #f)) (when (and (<= *block-start-x* new-x *block-end-x*) (<= *block-start-x* new-y *block-end-y*)) (do ((block-list *block-list* (cdr block-list)) (result '() (cons (car block-list) result))) ((or (null? block-list) (block-hit? (car block-list) new-x new-y)) (unless (null? block-list) (when (block-vertical-reflect? (car block-list) new-x new-y *ball-vx*) (reflect-x)) (when (block-horizontal-reflect? (car block-list) new-x new-y *ball-vy*) (reflect-y)) (set! *block-list* (append result (cdr block-list))))))) (when *ball-rect* (set! (ref *ball-rect* 'x) new-x) (set! (ref *ball-rect* 'y) new-y)) (when reflect? (Mix_PlayChannel -1 *bounce-sound* 0)))))) (define (shoot-ball) (unless *ball-rect* (let ((paddle-x (ref *paddle-rect* 'x)) (paddle-y (ref *paddle-rect* 'y)) (paddle-w (ref *paddle-rect* 'w)) (paddle-h (ref *paddle-rect* 'h))) (set! *ball-rect* (make )) (set! (ref *ball-rect* 'w) *ball-size*) (set! (ref *ball-rect* 'h) *ball-size*) (set! (ref *ball-rect* 'x) (+ paddle-x (/ paddle-w 2))) (set! (ref *ball-rect* 'y) paddle-y) (set! *ball-vx* (* (- (* 2 (random-integer 2)) 1) *unit*)) (set! *ball-vy* (- *unit*)) (format #t "ball: ~a~%" *ball-count*) (Mix_PlayChannel -1 *shoot-sound* 0)))) (define (draw-blocks) (for-each (lambda (block) (SDL_FillRect *screen* (ptr (vector-ref block 1)) (vector-ref block 2))) *block-list*)) (define (poll-event event) (SDL_PollEvent (ptr event)) (unless (< 0 (SDL_PollEvent (ptr event))) (let ((type (ref event 'type))) (cond ((eq? type SDL_QUIT) #f) ((eq? type SDL_KEYDOWN) (case (ref* event 'key 'keysym 'sym) ((27) #f) ((32) (shoot-ball) #t) ((122) (move-paddle-left) #t) ((120) (move-paddle-right) #t) (else #t))) (else #t))))) (define (sdl-main argc argv) (init) (let ((event (make ))) (do ((continue? (poll-event event) (poll-event event))) ((not continue?) #f) (clear-screen) (move-paddle) (let ((delta (- (SDL_GetTicks) *tick*))) (when (< *tick-threshold* delta) (move-ball) (set! *tick* (SDL_GetTicks)))) (draw-paddle) (draw-ball) (draw-blocks) (stop-paddle) (SDL_Flip *screen*) (cond ((< *ball-count* 0) (print "GAME OVER!!") (init-game)) ((null? *block-list*) (set! *ball-rect* #f) (make-blocks))))) (teardown) 0) (define (main args) (run_sdl_main (length args) args sdl-main)) ;; end of file gauche-c-wrapper-0.6.1.orig/examples/sdl/breakout_cygwin.scm0000644000000000000000000002543511237307544021014 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; breakout_cygwin.scm - Breakout for cygwin ;; ;; Copyright (c) 2007 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; $Id: $ ;; (use c-wrapper) (use srfi-1) (use srfi-27) (c-load '("SDL.h" "SDL_mixer.h" "stdio.h" "stdlib.h") :cppflags-cmd "sdl-config --cflags" :libs "-L/usr/local/lib -lSDL -lSDL_mixer" :import (list (lambda (header sym) (#/\/SDL\/.*\.h$/ header)) 'NULL)) (define *screen* #f) (define-constant *screen-width* 640) (define-constant *screen-height* 480) (define-constant *screen-depth* 8) (define *unit* 8) (define *ball-rect* #f) ;; vx and vy must be a multiple of *unit*. (define *ball-vx* 0) (define *ball-vy* 0) (define *ball-count* 0) (define-constant *ball-size* *unit*) (define *paddle-rect* #f) (define *paddle-width* (* 8 *unit*)) (define *paddle-vx* 0) (define *block-list* '()) (define *block-start-x* 0) (define *block-start-y* 0) (define *block-end-x* 0) (define *block-end-y* 0) (define-constant *block-width* (* 6 *unit*)) (define-constant *block-height* (* 3 *unit*)) (define *tick* 0) (define *tick-threshold* 20) (define *bounce-sound* #f) (define *shoot-sound* #f) (define (init) (SDL_Init (logior SDL_INIT_VIDEO SDL_INIT_AUDIO)) (set! *screen* (SDL_SetVideoMode *screen-width* *screen-height* *screen-depth* (logior SDL_HWSURFACE SDL_DOUBLEBUF))) (SDL_WM_SetCaption "Breakout" NULL) (set! *paddle-rect* (make )) (set! (ref *paddle-rect* 'w) *paddle-width*) (set! (ref *paddle-rect* 'h) *unit*) (Mix_OpenAudio 44100 AUDIO_S16SYS 2 1024) (set! *bounce-sound* (Mix_LoadWAV "cursor5.wav")) (set! *shoot-sound* (Mix_LoadWAV "cursor6.wav")) (init-game)) (define (init-game) (set! (ref *paddle-rect* 'x) (- (/ *screen-width* 2) (/ (ref *paddle-rect* 'w) 2))) (set! (ref *paddle-rect* 'y) (- *screen-height* (* 3 *unit*))) (set! *ball-count* 2) (make-blocks)) (define (make-block x y color) (let ((rect (make ))) (set! (ref rect 'x) (+ x 1)) (set! (ref rect 'y) (+ y 1)) (set! (ref rect 'w) (- *block-width* 2)) (set! (ref rect 'h) (- *block-height* 2)) (vector (list x y (+ x *block-width*) (+ y *block-height*)) rect color))) (define (block-vertical-reflect? block x y vx) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sy y ey) (or (and (= x sx) (< 0 vx)) (and (= x ex) (< vx 0)))))) (define (block-horizontal-reflect? block x y vy) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sx x ex) (or (and (= y sy) (< 0 vy)) (and (= y ey) (< vy 0)))))) (define (block-hit? block x y) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (and (<= sx x ex) (<= sy y ey)))) (define (make-blocks) (do ((block-list '()) (level 0 (+ level 1)) (colors '(#o700 #o770 #o373 #o077 #o007) (cdr colors)) (y (* 7 *unit*) (+ y *block-height*))) ((<= 5 level) (set! *block-list* block-list)) (do ((x (* 1 *unit*) (+ x *block-width*))) ((<= *screen-width* (+ x *block-width*))) (push! block-list (make-block x y (car colors))))) (set! *block-start-x* *screen-width*) (set! *block-start-y* *screen-height*) (set! *block-end-x* 0) (set! *block-end-y* 0) (for-each (lambda (block) (receive (sx sy ex ey) (apply values (vector-ref block 0)) (when (< sx *block-start-x*) (set! *block-start-x* sx)) (when (< sy *block-start-y*) (set! *block-start-y* sy)) (when (< *block-end-x* ex) (set! *block-end-x* ex)) (when (< *block-end-y* ey) (set! *block-end-y* ey)))) *block-list*)) (define (teardown) (Mix_CloseAudio) (SDL_Quit)) (define clear-screen (let ((rect (make ))) (set! (ref rect 'x) 0) (set! (ref rect 'y) 0) (set! (ref rect 'w) *screen-width*) (set! (ref rect 'h) *screen-height*) (lambda () (SDL_FillRect *screen* (ptr rect) 0)))) (define (draw-paddle) (SDL_FillRect *screen* (ptr *paddle-rect* ) #o777)) (define (move-paddle-left) (set! *paddle-vx* (- *unit*))) (define (move-paddle-right) (set! *paddle-vx* *unit*)) (define (move-paddle) (let ((new-x (+ (ref *paddle-rect* 'x) *paddle-vx*)) (w (ref *paddle-rect* 'w))) (when (< new-x 0) (set! new-x 0)) (when (< (- *screen-width* w) new-x) (set! new-x (- *screen-width* w))) (set! (ref *paddle-rect* 'x) new-x))) (define (stop-paddle) (set! *paddle-vx* 0)) (define (draw-ball) (when *ball-rect* (SDL_FillRect *screen* (ptr *ball-rect*) #o777))) (define (move-ball) (let ((reflect? #f)) (define (reflect-x) (set! *ball-vx* (- *ball-vx*)) (set! reflect? #t)) (define (reflect-y) (set! *ball-vy* (- *ball-vy*)) (set! reflect? #t)) (when *ball-rect* (let ((new-x (+ (ref *ball-rect* 'x) *ball-vx*)) (new-y (+ (ref *ball-rect* 'y) *ball-vy*)) (paddle-x (ref *paddle-rect* 'x)) (paddle-y (ref *paddle-rect* 'y)) (paddle-w (ref *paddle-rect* 'w)) (paddle-h (ref *paddle-rect* 'h)) (w (ref *ball-rect* 'w)) (h (ref *ball-rect* 'h))) (when (< new-x 0) (reflect-x) (set! new-x (- new-x))) (when (< (- *screen-width* w) new-x) (reflect-x) (set! new-x (- (* 2 (- *screen-width* w)) new-x))) (when (< new-y 0) (reflect-y) (set! new-y 0)) (when (and (<= paddle-y new-y (+ paddle-y paddle-h)) (<= paddle-x new-x (+ paddle-x paddle-w))) (reflect-y) (when (or (and (= paddle-x new-x) (< 0 *ball-vx*)) (and (= (+ paddle-x paddle-w (- *unit*)) new-x) (< *ball-vx* 0))) (reflect-x)) (set! new-y (- paddle-y h))) (when (< (- *screen-height* h) new-y) (dec! *ball-count*) (set! *ball-rect* #f)) (when (and (<= *block-start-x* new-x *block-end-x*) (<= *block-start-x* new-y *block-end-y*)) (do ((block-list *block-list* (cdr block-list)) (result '() (cons (car block-list) result))) ((or (null? block-list) (block-hit? (car block-list) new-x new-y)) (unless (null? block-list) (when (block-vertical-reflect? (car block-list) new-x new-y *ball-vx*) (reflect-x)) (when (block-horizontal-reflect? (car block-list) new-x new-y *ball-vy*) (reflect-y)) (set! *block-list* (append result (cdr block-list))))))) (when *ball-rect* (set! (ref *ball-rect* 'x) new-x) (set! (ref *ball-rect* 'y) new-y)) (when reflect? (Mix_PlayChannel -1 *bounce-sound* 0)))))) (define (shoot-ball) (unless *ball-rect* (let ((paddle-x (ref *paddle-rect* 'x)) (paddle-y (ref *paddle-rect* 'y)) (paddle-w (ref *paddle-rect* 'w)) (paddle-h (ref *paddle-rect* 'h))) (set! *ball-rect* (make )) (set! (ref *ball-rect* 'w) *ball-size*) (set! (ref *ball-rect* 'h) *ball-size*) (set! (ref *ball-rect* 'x) (+ paddle-x (/ paddle-w 2))) (set! (ref *ball-rect* 'y) paddle-y) (set! *ball-vx* (* (- (* 2 (random-integer 2)) 1) *unit*)) (set! *ball-vy* (- *unit*)) (format #t "ball: ~a~%" *ball-count*) (Mix_PlayChannel -1 *shoot-sound* 0)))) (define (draw-blocks) (for-each (lambda (block) (SDL_FillRect *screen* (ptr (vector-ref block 1)) (vector-ref block 2))) *block-list*)) (define (poll-event event) (SDL_PollEvent (ptr event)) (unless (< 0 (SDL_PollEvent (ptr event))) (let ((type (ref event 'type))) (cond ((eq? type SDL_QUIT) #f) ((eq? type SDL_KEYDOWN) (case (ref* event 'key 'keysym 'sym) ((27) #f) ((32) (shoot-ball) #t) ((122) (move-paddle-left) #t) ((120) (move-paddle-right) #t) (else #t))) (else #t))))) (define (sdl-main argc argv) (init) (let ((event (make ))) (do ((continue? (poll-event event) (poll-event event))) ((not continue?) #f) (clear-screen) (move-paddle) (let ((delta (- (SDL_GetTicks) *tick*))) (when (< *tick-threshold* delta) (move-ball) (set! *tick* (SDL_GetTicks)))) (draw-paddle) (draw-ball) (draw-blocks) (stop-paddle) (SDL_Flip *screen*) (cond ((< *ball-count* 0) (print "GAME OVER!!") (init-game)) ((null? *block-list*) (set! *ball-rect* #f) (make-blocks))))) (teardown) 0) (define (main args) (sdl-main (length args) args)) ;; end of file gauche-c-wrapper-0.6.1.orig/examples/sdl/cursor5.wav0000644000000000000000000001373411237307544017234 0ustar RIFFÔWAVEfmt "V"VdataY€€€€€€€€…‰•›¢§ª«©¤”Š~rg\RIB<62/..038AKWeu…–¦µÁÊÐÒÒÏÊú³­¨¥¤£¤¥¦¥£ž˜†{pdYQKHHILORTUUTRRRTW]dmx‚Œ•œ¡¤§¨©©ª¬®±²´³²°«¤›’ˆ€xqkgc_\XSLE>6/)%#%*2=K[l‘£´ÃÏØßáàÛÔ˹°¨¡œœžžœ™’‰~qbRB3% "3G]u¦½ÒâíóôïçÛÍ¿²§ ž ¥«±´´±©}kXE4& !1CWm„š®ÀÏÛâåäàÙÒÊü¶³²±²±°­©¢™ŽrcTE7* '4BQ`n}Š–¡«´¼ÃÊÐÕÙÜÝÜÚÕÎż²¨“‰€xog^ULC:2,(&'+07>FMU[aflqxŒ™¦µÄÒÞçìíéáÖÇ·§—‰}skfb_]\ZYXXXYZZ[[[ZYVSPNMNQWan}ŽŸ°ÀÍÖÜÝÚÔʾ°¢”‡|rkgdeglrx„‡ˆ‡„~vlbXOGB??BHPZep{‡‘𢍭°±²°¬¦ ˜‘‰‚~||„‹’™Ÿ£¤¢•Š~qeZQKHGHKOSX\`behknsx}‚ˆ’–™›Ÿ¡£¦©¬¯±²²±®ª£œ“Š‚yrkfa^\[YWURPMJGFFGJNT\dny…‘©³¼ÃÇÉÈÅÁ»´­¥Ÿ™•’Ž‹‰†{skbYOG?83/-,-/3:DO]m‘¤µÄÐØÜÜÙÒÉ¿µ«£š˜™š›œœš”ƒxk]PD8/(" &.8ETdu‡—¦³½ÆËÍÌÊÆÁ¼·´°®¬««ª¨¥¡›”‹vj_SG<3+&#"$(/8BMYdpz…Ž–£©¯´¸½ÁÄÆÇÇŽ¶¯¦ž•‹ƒ{skc[SKD>:88:>DLSZaglpsvy|‡˜¡¬·ÀÈÎÒÒÏÉÁ¸­¡–‹‚yqje`\XVTTTUWY\^`aba`_^]^`ciq{†’ž©´¼ÂÄÅþ¸¯¦œ’ˆ~vojgfgjnrwz|}|yuqkf`\YWWY\agnv~‡–œ¡¤§¨¨¦£ž™“Œ…{xvwz~ƒ‰Ž“••”Š‚zrjd`]\]_bfilnprstvxz}€ƒ…‡‰Š‹Œ‘“–™›ŸŸŸ›—“Žˆƒ~yurponmmljhfc`][YYYZ]`ekqyŠ“œ£ª¯²³²°¬§¢˜”‘ŽŽŒŠˆ„€{ung`YSMHDB@@AEJR[fr™¥®¶º¼¼¹´¯¨¢™—––—™›œ›™•ˆukaXOGA;63236+Õ†L½‹z X KýNýð›ðúëì\ïuïoøø!õÒÖ§êÍÊÍî'îlÛ½ÛîÎKÏÎWÎ)ÛiÛõõ”^µ7=7ÚN:N†TÞS GF¶+\+Ï Å øë#ììÔCÕ—ÊúÊÍxÍÚOÚHîgîaUÌŽ/)/ 65h//l/þù‹å¶åÖÓ2ÔÏÓ!Ôúå9柌6$î#×9_9>œ=B/ä.¬•ûá<╳&´0‘ ’‡ˆ šàšçÄVÅpûxû/.Í-OòNùVFVÆC=C^)ô/ôÓÓÓ¢ÇȨÓúÓ‚ñšñŒX‘3(3ÄCDC~CûB–3-3þÐ ö4öKÕ£Õm¾æ¾š·%¸vÁìÁÝ×"Ø#ô>ôÖ·›(P(@6Ð5 65…';'P = €î¢î4ÔŠÔ¢ÈÉéÏHÐ çR秘¼$o$79¶8³?.?ï7~7Û$${ [ ?öKöè·è"æOæàíøízýsýݶŠ!@!„'6'˜dc_âÃâÝÁZ¬À¬”§<¨>µÎµçÑ3Ò ÷÷Ó•+<´;OXN‚QëPgCâBw(#(ýßîìí\ÚªÚãÓ3ÔŽÙÔÙJè{èú“ú1  üÓªpC’ n ÊüØüŒéÂé`Ú«Ú#ÖpÖ{߹ߌò¤ò0$ñ¾R.—  ýö÷âNâÓtÓ3ΕÎÔÚÔšåÅå^ÿbÿG,9»8LqK©PÿO¢EE%,Ï+« ‘ ØêëáÕ5Ö1ЇÐ=׊וäÍäÛñðñÚúÝúUý\ý@úIú&óHóPêêºâïâ†ÝÊÝxܽÜá\áàìí¾ÿ½ÿ”ek((z3"3r44=*ì)úÊ|ÿ†ÿê:ê¤ÛòÛðÖI׆ÜÈܤëÅëI³&m&)³(9 ƒ€šê¸êAØØ„ÓáÓ—Ý×ÝÉñåñ;,qL; ¤„$&ñ?ñ âIâÉÙÚÛOÛõå)æ^ù`ùʪ·*b*ç=f=ˆEEƒ??ü-§-U×þÔþ<êiênÚµÚ+ЈÐR̬ÌÏmÏf×¶×ÌãúãöòóL 4 ¤„ùâ úçÙ¦ éà ô R5D m5X'^ G ƒú›úCéré›ÝÛÝ!ÝeÝûé$ê2+¥pç'’'d,,¤$`$¦‹týlýâèé¶ÛÜXØ ØÏÜÝ7æbæ-òPòÊþÌþ ÷ Y/ ÙçÅ} j †}ù.ù2ôMôžõ¼õNýVýue¥z}Dæ$$D'ò&7!ú ­‡÷úû,âjâ·ÍΑÃÄãÇKÈŠÚÒÚö.ö£{$Æ#O((>B%ãüæüò)òúðñ}øƒø„zö”i·R2<*'ò?ò®âéâsÛÁÛ_Þ¢Þé;é^øoøSB?U*òµï{ c ðýýý.ïNïþàFá›×ß×CÖ–Ö7ÞrÞéì ízþ}þ[<•dˆMšhŸ€s: $ VBo W '[#$òïÆêà‚ó¥óœÜáÜ´ÊˬÄÅáÍNΟãèãwþþݵx$2$A)î(Ô%%èZ3‚jSü]ü9ñOñGçrç¦âÞâ_å“å²íÔíïøÿø e I 1 æ´êÅÍÍ_øoø'íDíLætæIæ‚æBî\îÐüÌüö × ä± ÑiúþöþâìíàGà9ÝvݯäÞäÔòãòâÒÛ¹ä«H%ÿ$¥%Y%c-a4‘zÄþ¸þcülü©ý¨ý ÿ¢ÿÔÿ×ÿˆüŽüõ«õÿìí^æ˜ænä—äàæç¨ëÊëŸñ¾ñ›ø¥øpc ù<Зa%%®$_$Òž”CóUóã6ãJÚ›Ú¢ÙðÙà½à1íHí‰ý†ýi F —prg`÷p÷Âêñêdç”ç$îDî<ûHû õ âg@~ h 1ú9úKêxê¯ßêßkݬÝäSä…ñŸñÃÂ'ÿ %U%¸/T/…0-0à(‡(É ö þ þ2ðGð*å`åôÝ3Þ±ÚýÚ.ÜsÜ¡ãÑãñ-ñýîñÓl5Ç‚gˆx"ú,úpöŒöZúiú,'ƒ l ãiH ù $ûûÎðòðíèéñæ$çDìhì±ö¼ö3,% ÿË- 7  Šý’ýô4ôÙïüï–ñªñ ÷'÷|ýŠý«¤òæ~vqn4ÿ3ÿ{üzüøøsô‡ôõ-õöúû31¥Žo?:#ó"Ý(Œ(…'-'JV A ÄñÛñØÔØvÅìÅa¾à¾¦ÅÆ—ÙÚÙIôRôG"ú ° N(ý'B$÷#í3  Zÿ`ÿpù~ù/÷>÷¸÷Í÷ßûÝûòß Ä ÷ Þ xh¾ýÁýó7óØëì±êÜêÎïòï$ù*ùlYr _ Ç©6Ö¨Þ¿ª ‘ uu¥ù¹ùyî–î°äâäßß%àKããSïjï·ÿ¶ÿÆ©p<·P+X B ëéýýý ýµ°)¯ — ¨ “ yqº÷Ò÷çJçgÙ°ÙÔvÔÙWÙæIæÑ÷Ü÷  zN: õ0!ô 5þwQ¾ ¤ Åý×ý`ò|òì7ìí í²óÇóý ýûe c ý Þ í Ö Æ ² ²¯üü#óBóðê&ëÑæÿæ²éÝéaôvô"³ÕšB*÷aÿ`ÿYêzêâÚ-Û ÕïÕµÙúÙ~ä¿äìó ôŹó¾˜#T#%(Õ'$Ù#Þ£¦‹ÙÏü"ü"ö8öøòóœð¸ðËí÷íÇêðê×è éDéméfì’ì ò$ò_ùjù,'#³Ö É ÉŸ˜af,l?oWÜÄBûQû«ñÊñê&êØåæ¶çæç?ð\ðþ þ¾ — D !P!)îS.EýIýÝíûíšåËåúå0æî6î!ú)ú<. ÷ c B òâéý÷ýØ÷ê÷†óžóñ*ñæñ ò²÷È÷Œ†M*O${!@! #Ì"§k`;¨ • 3ý<ýØðëð~å¼åÔÜÝ4Ù†ÙÂÜÝ3çiçKöaöͺS+„Zq»±7úJúó³óô'ô ú)ú…~`E†Vu6X&×À›ó6óè·èÚåæ™ëÀëW÷_÷‡zð Ì 8Ö¯ öæãæýîý>úIú/÷@÷UôhôYñƒñEïwï±ðØð«õÂõËûÖû—ÿ—ÿòÿïÿÙþÚþ†þ“þ×ÿÞÿ!Ä°ã Æ•#âV[™d¦ ” ù*ùâYâ®Í Î!¨ÂÃõèÑöчé«é÷ãÊ(?(Â(t(`#V4åãFôSô”ë¸ëê)êððBûAûçÍóÎ6Ŧ˜ … ,$ÙÿÜÿeýeýœû ûù‹ù$ø,ø'ù8ùÅü¿ü(((© ‹  969öEö§êÑêä8äµäääÚëìöºö@- ð ŠûÆa7+ MB‰þ‘þúú¬û·û± 2»íƦ „ ¿ùËùÁçðçÚ^ÚÀÔÕÙXÙÕäåàóðó=5^BDÝ£.ú-ÿ¤ æÙ‘úœúööRôdôGõ_õùù¬þ®þ¦™x j Î · Þ Ç øèDþKþ0ó=óë(ë…é§éíï ðºü·üž ûÌï¿Ê †ò£òYã’ã¨ÙùÙøÖG×?ÝzÝí5íÄ»è‡,%,¦3A3š/9/»"r"À÷:÷J÷Ïñçñëï ð˜ï®ïIïbïàîúî ï,ï¥ðÅðiôô‹ùŽùþþ‚ÿ†ÿþþXübü¦ý¤ýsiÁ © ß$ýà  |l’ý“ýAôNô…í§íÙëúëcð~ðLûKûô Ü Û dØ¡_?¿þ¸þ)îPîÓâ ãÛß àºåæåòòDJÜ ¿ )ÝÉ ® œßöóöøë*ìSçƒçê0ê}ó’ófFÛžˆ!H!!#Ô"Ä ~ q8ª‡ïãÐõåõcå›å¶Ù ÚÖÙÖŠÜÖÜëéê¨ú®úѾ‹i8˜†F>ûûcùpù”û¤ûÑϼ ¥ ´•Gb.‰bØóøóRçƒçýá5âìåæ^ñwñ}| ë uBÚ·åR E F>Qùcù'óLóÓíõínêŠê¾êäê–ï¼ï¿öÒö ýŸýÿÎÆÀ¯ïß[EþŽŠlgk Z “iŸp ÓˆXKôaôà@à0ÑŽÑïÌVÍÔÔ$ÕËæûæ€ü‰üP8'éåÌ–‡\=;÷+÷]ì‰ìÚèéËíçí9ùSùò®‰b(ŸpaôÃþ¿þ`øjø:óTóôïðÞîïØðôðÒõáõ†ý„ýƲ¿ H&ɬ hø~øùìíæ1æ•äÌä&éOé&ó;ó¼ ¦ d1PÕ¥ú ì YVÚþßþjÿjÿÁ²N2Ê£áQ G ÔûÛûëOëMÝ’Ý ÖYÖbÖ¹ÖLݕݘèÁè9÷C÷¡™ ÖU! !Ô#‹#Ý`0#¤û­û ó:ó”î¹îhîŽî´ñÍñm÷€÷?ÿ=ÿ4"Žs‰W·‘ ë øÿüÿñ¢ñ?çrç†å³å(íXíû&ûØÃ!ùC!¤ Œ @ÿ=ÿæñûñÖåæQß”ßáDáWëƒëûûüË¥JM'ù& 'Â&H )ɼ ü¦ü¢õ¾õàñýñ!ñCñmò€òªô³ô3÷E÷ÀùÐù£ü¥ügþqþ;ýBý ù#ùçóùó\ñ„ñ9óQó0ùIùöþÖÊ ô~\º˜Aϲö6øDøŒí¬íÂéñéÅîáîëúñúI , 7L±‹îâúõöoêžê™æÌæ‘ê¯êÅóÚóOþOþ¸¥ý Ša8  ÓÑ(ö:ö”ë¶ë;åtåBåså\ìŽì?ùFù? ! “Wö#¯#*Á)|*-*m%%_(  ÷.÷¯äâä·Ö ×Ñ`Ñ_Õ±Õ³âêâ'ô2ô1)5²†[/"  ÿõ,ú/úQõdõïöûö˜þšþÌ ¼ Ý8ͪ¿ › “þŽþÃñãñëêëì.ìô4ôV = õ©ƒ3§™!ZúfúÝòüòªëÕëbçç4è^èhî’îµ÷¿÷îèïײ ž z Z ´ ¤ ÏÀļ¥üªü”ùù‚úŽú§£Û  ŒbBý¶yE| d õ,õÐàá¬ÓûÓÑvÑþØMÙÀçíçåøîø€k–sØ÷Ï ‚ !ÁöÕöóòóéõóõ„þ„þ >K õÐ ° J=šÿ“ÿÕøÝøñòÿòî)îìëìÉíéíjô~ô}ÿÿ ì¹Ô­„^E úúàëìá¹áÝ`ÝÉß àé5éŸö­ö*(W3r2É-ô×»%lÿoÿÿ‘ÿtf v œ x a ? [aâòûòaæ’æ]Þ¦ÞÎÛÜ“ÞÖÞ‚æ²æÕòìòƒwðñÑo>–qtZzÿ}ÿ÷—÷þñòtï”ïñ0ñ÷,÷àØ&  éÀuAæ'·³lð‹ðYããdߟßVåŽå¿ñâñZÿ\ÿÕ ¿ Ѭ2?#ŒƒÐõåõ'éQéáÅá¸âóâ¨ìÇìèüïüÐ ¯ €KßžÙFbNI;ƒ}‹ý’ý_ütüåúñú¤ø¹ø»öÐöBöLöÿö÷=÷D÷ õ¶õ-òGòvîžîµìâì„î¤îiôyôãýãýãÓŠk*ùû  ÷³ì·ë Ù ,ù?ùë(ëAäwäªæáæÕðïð†ÿ€ÿ£ „ Ðß„d±›{ûûó0ó_îî.îMîcòxòÑùÙùLCSD z XNçüìü!ó;ó7ìhìäêëð0ðsúyú¡›(Þ"!à [# #œ!W!|D›xØÏöí îÝVÝ#ÔxÔêÕ?Ö8ázáXñkñH>:  =…fÉ ­ ni÷8÷_ð}ðÖïõïÉõÞõÌÒw T ñÀOöÃï ¤¡+ø8øÊñçñ¬ñËñÞöðöÐýÌý”Œi\ ZEÿ”ÿœÿSùZùóšó†ðªðñ9ñóôõbúpú!ÿÿffC?ÍÊõì´µéûïûÆ÷×÷æ÷ê÷‘ý–ýsdå"9")È(~%:%›{ÒÿÑÿHèqè[Ö¬ÖÎpζÏлÙ÷Ùàè éJúNú ù ‘a3ù¤w>,<Azû‚ûÁ÷×÷œù¨ùæþëþæÙR = P ; /  ýåéýþÿû$ûr÷‹÷Xôlô…ó óyö‹ö›ýýþóÓ ¼ åÀ-»¬ýýßðìðæ;æ›ßßß“ßÌßËæøæô¼ôý2‰ P å!¤!‹Žsðõ¤ù·ù:øEøNýRýWF õ Î ¶ ‘|ƒy‚øšøTðwðíèé ä:ä ãDã‚ç²çñ3ñTýTýN 5 gJoä¾>$:"mütü¢ø©ø§÷®÷ÝùâùÁþ»þ‡v í Ë¡ÑùÖ~oô…ôûæ$çžàÑàúâ4ãÚìûìûûÞ Ë / \°vÿ ç ¼ü¼ü{ë“ëæÞßWۜۧáÒátïŽï./kT—dÿºå¬u9 – u ´¡EÿBÿÅ÷Û÷ò3ò½ïÝïpð‘ðæòóîô õõ(õoóóeñƒñèðÿðöò ó øøÿÿB=0  ×±a,.õà³   †þ„þðïð%æKæQä„äðëìû û× ± ›oèÓ‘oJGrôƒôAëcësç¤ç¸éßé—ð¯ð¸ù¾ù¡§•)  Û̓ÀùÎùOõaõ(ô@ô+öAörûûôë õ †bÄ”Ëý»ê¼! ÿ EýFý»íÝí‡ãÆãÆàá³äâä"íFí÷.÷±¶‹3  ìÑ;4BøOøSðvðÃíáí…ò ò*þ#þ¥ Š a2§ p Ɉ^óå)ù6ùþî!ïì,ìÀîâîô+ô©ùºù=ÿ9ÿ"YIz f ¿ ¬ ¦£’ÿ™ÿúøùô/ôAò[ò óó6õSõø÷øgûsû8ÿ7ÿui¹¬•– ²ý²ýýý­ÿ§ÿ]NýÚ-öÍ  »~n=o$ô:ôzã³ãNØžØÚÔ3ÕsÙÄÙºäéägô~ô ܱ9= òÚ•Žû•ûÈõÞõõ*õ'ø9øuýxýãÜóçX E ‘ } ù è ; - ½ùÊùûóô4òQò¥ôÀô~ú‹úfip ] ôá3ü5üéôúô*ïQï†ì®ìTîvî˜ô®ôþ þóñ˘r·¢ù è  hûuûªù¸ùHýOý¦¥Ç ¸ w b ú Ý ä Î €{åûîûYòvòSê~ê æ?ææÂæýë"ì|ô’ôîýîý¿·.  dI†ccQ.  I;ãêüüÁøÍø øøøú û#!.© Œ 6 % º¯þƒþ®öÀöíñò–ñ³ñõ-õ0û6û&xež …  ø Û¾geìõöí/í¾èêè@êgêüðñ3ûEû¤–8£pK …VôÖÅ µ ]Uÿÿ"ú,úÌößö€õ—õAöVöaørøÞúïú¾üÉü~ý„ýîüùüßûéûìúõúUúeúeúpúÞûæûÿÿèÜåÙ¯ – v â Î ÙýæýÂ÷Õ÷Tõlõª÷·÷SýZýëé  • ~ Ú Ä 8*£ yûû0öDö#ó7óÔòôòšõ°õàúêú-*RA°˜± #PÿPÿ¥ú±ú­÷Â÷÷÷¹øÅøÀûÄûOÿVÿSIúíÜ À iN ýé Ñ sg“ÿ’ÿ<øIø=óVóvññ…òžò×õîõPú_úÒþÓþ0'ÕÑÜþßþûûü¸úÁúßûêû%ÿ'ÿ³«]Ly i Ù Æ    ÇþÇþÏúÙúÞøëø¿øËøêùõù-ü3ü4ÿ3ÿmi-#¦—@1öì‚‚'ý0ý¿úÈú”ù˜ùRù\ù¹ùÄùÀúÉú‚üˆü×þÜþ=5ûäÞŽ‡úõïÿíÿ”þ“þÿÿІ(kXã Î ÝË?1áúêúÈöÜöÀôÔôÌôáôÛöëöxúƒúÚþÚþ÷í„{ìÞg]ÈÁÿÿýüýUü]üýýáþäþó𳯠õë=1›’ïè{wàýãý¼ûÆû¹úÄúûûjüoü…þ„þ¸µxqzuzgbUSÚýÝý²û¼û–úŸú×úàúdüküÞþÝþŒˆunâØçàFCÒÿÓÿ‡†±®¼¶IB8.‘ŠNK™ÿ™ÿ¤ý©ýËûÔûˆú“ú'ú3úæúïúxü}ünþrþki@9£šUN†zwXW3ÿ5ÿJþLþíýñýGþJþOÿPÿ¤¢¿»HCDA""ÿÿ]þ`þ#þ'þ^þ`þÿÿêÿëÿËÉIG-*~“ÿ“ÿ³þ¶þ,þ/þ"þ&þ—þšþaÿcÿ==çåB?VS=:À¿mlÌÿÌÿœÿœÿ‘ÿ’ÿ¨ÿ¨ÿÐÿÐÿõÿõÿþÿþÿïÿðÿâÿâÿLISTHINFOICRD 2002-02-28IENG Tetsu AokiISFTSound Forge XP 4.5gauche-c-wrapper-0.6.1.orig/examples/sdl/Makefile0000644000000000000000000000031411237307544016541 0ustar SOEXT = $(shell gauche-config --so-suffix) sdllib.$(SOEXT): breakout.scm cwcompile --verbose breakout.scm run: sdllib.$(SOEXT) gosh -I. breakout.scm clean: cwcompile --verbose --clean breakout.scm gauche-c-wrapper-0.6.1.orig/examples/sdl/README0000644000000000000000000000056211237307544015766 0ustar breakout.scm is an example of using c-wrapper and SDL. - How to play (1) Install SDL and SDL_mixer. (2) Create sdlib.so. % make (3) Run breakout.scm. % make run - Key binding 'z': The paddle moves left. 'x': The paddle moves right. space: Shoot a ball. Note: cursor5.wav and cursor6.wav are downloaded from http://www.tam-music.com/. gauche-c-wrapper-0.6.1.orig/examples/sdl/sdl_helper.c0000644000000000000000000000400311237307544017365 0ustar /** * sdl_helper.c * * Copyright (c) 2007 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: $ */ #ifdef main static int (*main_func)(int argc, char *argv[]); int main(int argc, char *argv[]) { return main_func(argc, argv); } #endif int run_sdl_main(int argc, char *argv[], int (*func)(int argc, char *argv[])) { #ifdef main #undef main main_func = func; return main(argc, argv); #else return func(argc, argv); #endif } /* end of file */ gauche-c-wrapper-0.6.1.orig/examples/stdio/0002755000000000000000000000000011237307544015445 5ustar gauche-c-wrapper-0.6.1.orig/examples/stdio/hello.scm0000644000000000000000000000034311237307544017252 0ustar (use c-wrapper) (c-load-library "libc") (c-include "stdio.h") (define (main args) (let ((fp (fopen "greeting.txt" "w"))) (fprintf fp "Hello, %s\n" "world") (fclose fp)) (printf "greeting.txt is created.\n") 0) gauche-c-wrapper-0.6.1.orig/examples/stdio/Makefile0000644000000000000000000000006211237307544017101 0ustar run: gosh hello.scm clean: rm -f greeting.txt gauche-c-wrapper-0.6.1.orig/install-sh0000755000000000000000000002202111237307544014504 0ustar #!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # 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 $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gauche-c-wrapper-0.6.1.orig/lib/0002755000000000000000000000000011237307565013256 5ustar gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/0002755000000000000000000000000011237307565015156 5ustar gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/c-ffi.scm0000644000000000000000000015054511237307544016653 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; c-ffi.scm ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: $ (define-module c-wrapper.c-ffi (use srfi-1) (use srfi-13) (use gauche.sequence) (use file.util) (use gauche.uvector) (use util.queue) (use c-wrapper.config) (use util.match) (use util.list) (use gauche.parameter) (export c-load-library c-ld c-lookup-symbol @ @selector c-symbol c-delay c-force c-sizeof c-type? c-value-ref c-value-set! post++ post-- pre++ pre-- c-ptr-ref c-ptr-set! c-ptr+ c-ptr- null-ptr? make-null-ptr register-finalizer! unregister-finalizer! finalize! make-c-var c-array-ref c-array-set! c-array-length c-array make-c-array ;deprecated c-array-length define-c-struct init-c-struct! c-bit-field make-bit-field ;deprecated c-struct-symbol c-struct c-struct-ref c-struct-set! c-offsetof raw-ref define-c-union init-c-union! c-union-symbol c-union c-union-ref c-union-set! c-enum define-c-enum init-c-enum! ;deprecated ptr deref c-func-ptr make-c-func-ptr ;deprecated c-func-vaargs-ptr make-c-func-vaargs-ptr ;deprecated c-func make-c-func-type ;deprecated make-c-func make-c-func-vaargs c-closure-free cast c-cast scm-cast ) (dynamic-load "c-ffi") ) (select-module c-wrapper.c-ffi) (define (find-dylib-from-la lafile) (call-with-input-file lafile (lambda (in) (let loop ((dlname #f) (libdir #f) (installed? #f) (str (read-line in))) (rxmatch-cond (test (eof-object? str) (if (and dlname libdir installed?) (build-path libdir dlname) #f)) ((#/dlname='(.+)'/ str) (#f dn) (loop dn libdir installed? (read-line in))) ((#/libdir='(.+)'/ str) (#f lb) (loop dlname lb installed? (read-line in))) ((#/installed=yes/ str) (#f) (loop dlname libdir #t (read-line in))) (else (loop dlname libdir installed? (read-line in)))))))) (define (find-library lib paths need-prefix?) (define (find-library-in-paths filename) (find-file-in-paths filename :paths paths :pred file-is-readable?)) (define (find-library-add-extension basename) (let loop ((extensions `("" ".la" ,(string-append "." DYLIBEXT)))) (cond ((null? extensions) #f) (else (or (and-let* ((filename (find-library-in-paths (string-append basename (car extensions))))) (if (equal? (path-extension filename) "la") (find-dylib-from-la filename) filename)) (loop (cdr extensions))))))) (define (find-library-add-prefix libname) (any find-library-add-extension (map (cut string-append <> libname) libname-prefix-list))) ((if need-prefix? find-library-add-prefix find-library-add-extension) lib)) (define (%c-load-framework name) #f) (define (c-load-library libraries . keywords) (define (try-ld-script dlfile) (guard (e (else #f)) (call-with-input-file dlfile (lambda (in) (let loop ((str (read-line in))) (rxmatch-cond (test (eof-object? str) #f) ((#/GROUP\s*\((.*)\)/ str) (#f libs) (or (and-let* ((dl (find (cut #/\.so/ <>) (string-split libs #[,\s])))) (dlopen dl)) #f)) (else (loop (read-line in))))))))) (define (lib-load lib search-paths need-prefix?) (or (and-let* ((dlfile (cond ((string-scan lib "/") (find-library lib '(".") need-prefix?)) (else (or (find-library lib (ld-library-paths) need-prefix?) (search-library-with-ldconfig lib) (find-library lib (append search-paths (sys-library-paths)) need-prefix?))))) (handle (or (dlopen dlfile) (try-ld-script dlfile)))) handle) (errorf "can't load ~a ~a" lib (or (and-let* ((errmsg (dlerror))) (string-append "(" errmsg ")")) "")))) (let-keywords* keywords ((library-dirs '()) (option "")) (let loop ((libs '()) (paths (if (list? library-dirs) (reverse library-dirs) (list library-dirs))) (rest-opts (string-split option #[\s]))) (define (opt) (car rest-opts)) (cond ((null? rest-opts) (for-each (lambda (lib) (unless (member lib ignore-library-list) (lib-load lib (reverse paths) #f))) (if (list? libraries) (reverse libraries) (list libraries))) (for-each (lambda (lib) (lib-load lib (reverse paths) #t)) (reverse libs))) ((string-prefix? "-l" (opt)) (let ((libname (substring (opt) 2 (string-length (opt))))) (loop (if (member libname ignore-libname-list) libs (cons libname libs)) paths (cdr rest-opts)))) ((string-prefix? "-L" (opt)) (loop libs (cons (substring (opt) 2 (string-length (opt))) paths) (cdr rest-opts))) ((string-prefix? "-Wl," (opt)) (loop libs paths (append (string-split (substring (opt) 4 (string-length (opt))) ",") (cdr rest-opts)))) ((string=? (car rest-opts) "-framework") (%c-load-framework (cadr rest-opts)) (loop libs paths (cddr rest-opts))) (else (loop libs paths (cdr rest-opts))))))) (define (c-ld option) (c-load-library '() :option option)) (define (c-lookup-symbol sym) (let ([str (symbol->string sym)]) (dlsym str))) ;; for Objective-C functions (define (@ str) (error "Objective-C string is not supported.")) (define (@selector str) (error "@selector is not supported.")) ;; FFI sandbox (define ffi-sandbox-module (let ((mod #f)) (lambda () (or mod (let ((m (or (make-module 'c-wrapper.c-ffi.sandbox :if-exists #f) (find-module 'c-wrapper.c-ffi.sandbox)))) (eval `(extend ,(if (library-exists? 'c-wrapper.objc-ffi) 'c-wrapper.objc-ffi 'c-wrapper.c-ffi)) m) (set! mod m) m))))) (define-macro (c-symbol sym) `(with-module c-wrapper.c-ffi.sandbox ,sym)) ;; ;; basic class and functions for C type system ;; (define-class () ((type-name :init-value #f :accessor type-name-of) (ptr-class :init-value #f) (array-class-alist :init-value '()) (ffi-type :init-value #f :init-keyword :ffi-type :accessor ffi-type-of))) (define-class () ((identifier :init-value #f :init-keyword :identifier) (buffer :init-value #f :init-keyword :buffer)) :metaclass ) (define-class () ()) (define-class () ((trunk :init-value #f :init-keyword :trunk) (info :init-value #f :init-keyword :info)) :metaclass ) (define (c-delay trunk . rest) (let-optionals* rest ((info #f)) (make :trunk trunk :info info))) (define-method c-force ((obj )) ((slot-ref obj 'trunk))) (define-method c-force ((obj )) obj) (define-method ref ((obj ) . rest) (apply ref (c-force obj) rest)) (define-method (setter ref) ((obj ) . rest) (apply (setter ref) (c-force obj) rest)) (define buffer-of (let ((alloc-buffer-if-needed (lambda (obj) (unless (slot-ref obj 'buffer) (slot-set! obj 'buffer (or (and-let* ((identifier (slot-ref obj 'identifier))) (or (and-let* ((vptr (c-lookup-symbol identifier))) (%deref-uvector vptr (c-sizeof obj))) (errorf "variable ~a is not found." identifier))) (make-u8vector-nonatomic (c-sizeof obj)))))))) (getter-with-setter (lambda (obj) (alloc-buffer-if-needed obj) (slot-ref obj 'buffer)) (lambda (obj v) (alloc-buffer-if-needed obj) (slot-set! obj 'buffer v))))) (define-method object-equal? ((obj1 ) (obj2 )) (eq? (type-name-of obj1) (type-name-of obj2))) (define-method object-equal? ((obj1 ) (obj2 )) (and (eq? (class-of obj1) (class-of obj2)) (equal? (buffer-of obj1) (buffer-of obj2)))) (define-method object-hash ((obj )) (hash (type-name-of obj))) (define-method write-object ((obj ) port) (format port "#<~a>" (type-name-of obj))) (define-method write-object ((obj ) port) (format port "#<~a ~a>" (type-name-of (class-of obj)) (buffer-of obj))) (define-method write-object ((obj ) port) (format port "#" (slot-ref obj 'info))) (define-method object-apply ((obj ) . args) (apply (c-force obj) args)) (define-method initialize ((obj ) initargs) (next-method)) (define (c-sizeof-type type) (cond ((slot-ref type 'ffi-type) => (cut slot-ref <> 'size)) (else 0))) (define-method c-sizeof ((obj )) (c-sizeof-type obj)) (define-method c-sizeof ((obj )) (c-sizeof (c-force obj))) (define-method c-sizeof ((obj )) (c-sizeof (class-of obj))) (define (c-type? obj) (is-a? obj )) ;; ;; C value class (char, short, int, long, long long, float, double) ;; (define-class () ()) (define-class () () :metaclass ) (define (%signed-uvector-alias obj) (case (slot-ref (ffi-type-of (class-of obj)) 'size) ((1) (uvector-alias (buffer-of obj))) ((2) (uvector-alias (buffer-of obj))) ((4) (uvector-alias (buffer-of obj))) ((8) (uvector-alias (buffer-of obj))) (else (error "Unsupported size: " (slot-ref (ffi-type-of (class-of obj)) 'size))))) (define (%unsigned-uvector-alias obj) (case (slot-ref (ffi-type-of (class-of obj)) 'size) ((1) (uvector-alias (buffer-of obj))) ((2) (uvector-alias (buffer-of obj))) ((4) (uvector-alias (buffer-of obj))) ((8) (uvector-alias (buffer-of obj))) (else (error "Unsupported size: " (slot-ref (ffi-type-of (class-of obj)) 'size))))) (define-syntax define-c-value (syntax-rules (signed unsigned) ((_ name ffi-type) (begin (define-class name () ()) (set! (ffi-type-of name) ffi-type) (set! (type-name-of name) (string->symbol (substring (symbol->string 'name) 1 (- (string-length (symbol->string 'name)) 1)))))) ((_ name ffi-type signed) (begin (define-c-value name ffi-type) (define-method c-value-ref ((obj name)) (ref (%signed-uvector-alias obj) 0)) (define-method c-value-set! ((obj name) v) (if (<= 0 v) (set! (ref (%unsigned-uvector-alias obj) 0) v) (set! (ref (%signed-uvector-alias obj) 0) v))))) ((_ name ffi-type unsigned) (begin (define-c-value name ffi-type) (define-method c-value-ref ((obj name)) (ref (%unsigned-uvector-alias obj) 0)) (define-method c-value-set! ((obj name) v) (if (<= 0 v) (set! (ref (%unsigned-uvector-alias obj) 0) v) (set! (ref (%signed-uvector-alias obj) 0) v))))) ((_ name ffi-type uvector-class) (begin (define-c-value name ffi-type) (define-method c-value-ref ((obj name)) (ref (uvector-alias uvector-class (buffer-of obj)) 0)) (define-method c-value-set! ((obj name) v) (set! (ref (uvector-alias uvector-class (buffer-of obj)) 0) v)))))) (define-method c-value-ref ((obj )) (c-value-ref (c-force obj))) (define-method c-value-set! ((obj ) v) (c-value-set! (c-force obj) v)) (define-class () () :metaclass ) (set! (ffi-type-of ) (ffi-type-longdouble)) (set! (type-name-of ) 'c-longdouble) (define-c-value (ffi-type-float) ) (define-c-value (ffi-type-double) ) (define-c-value (ffi-type-uchar) unsigned) (define-c-value (ffi-type-schar) signed) (define-c-value (ffi-type-ushort) unsigned) (define-c-value (ffi-type-sshort) signed) (define-c-value (ffi-type-uint) unsigned) (define-c-value (ffi-type-sint) signed) (define-c-value (ffi-type-ulong) unsigned) (define-c-value (ffi-type-slong) signed) (define-c-value (ffi-type-ulonglong) unsigned) (define-c-value (ffi-type-slonglong) signed) (define-method write-object ((obj ) port) (format port "#<~a ~a>" (type-name-of (class-of obj)) (c-value-ref obj))) (define-method ref ((obj )) (c-value-ref obj)) (define-method (setter ref) ((obj ) (v )) (c-value-set! obj v)) (define-method object-apply ((obj )) (c-value-ref obj)) (define-method object-apply ((obj )) (scm-cast (c-force obj))) (define-method object-apply ((obj ) (v )) (c-value-set! obj v)) (define-method object-apply ((obj ) (v )) ((c-force obj) v)) (define-method post++ ((obj )) (let ((v (make (class-of obj) :buffer (u8vector-copy (buffer-of obj))))) (c-value-set! obj (+ (c-value-ref obj) 1)) v)) (define-method post++ ((obj )) (post++ (c-force obj))) (define-method post-- ((obj )) (let ((v (make (class-of obj) :buffer (u8vector-copy (buffer-of obj))))) (c-value-set! obj (- (c-value-ref obj) 1)) v)) (define-method post-- ((obj )) (post-- (c-force obj))) (define-method pre++ ((obj )) (c-value-set! obj (+ (c-value-ref obj) 1)) obj) (define-method pre++ ((obj )) (pre++ (c-force obj))) (define-method pre-- ((obj )) (c-value-set! obj (- (c-value-ref obj) 1)) obj) (define-method pre-- ((obj )) (pre-- (c-force obj))) (define-syntax define-object-op-for-c-value (syntax-rules () ((_ object-op op) (begin (define-method object-op ((v0 ) v1) (op (c-value-ref v0) v1)) (define-method object-op ((v0 ) v1) (op (c-force v0) v1)) (define-method object-op (v0 (v1 )) (op v0 (c-value-ref v1))) (define-method object-op (v0 (v1 )) (op v0 (c-force v1))))))) (define-object-op-for-c-value object-+ +) (define-object-op-for-c-value object-- -) (define-object-op-for-c-value object-* *) (define-object-op-for-c-value object-/ /) (define-method object-- ((v )) (- (c-value-ref v))) (define-method object-- ((v )) (- (c-force v))) ;; ;; void ;; (define-class () () ) (define-class () () :metaclass ) (set! (ffi-type-of ) (ffi-type-void)) (set! (type-name-of ) 'c-void) (define-method write-object ((obj ) port) (format port "#<~a>" (type-name-of (class-of obj)))) ;; ;; basic-pointer ;; (define-class () () ) (define-class () () ) (define-method write-object ((obj ) port) (format port "#<~a 0x~x>" (type-name-of (class-of obj)) (c-ptr-ref obj))) (define-method c-ptr-ref ((ptr )) (ref (%unsigned-uvector-alias ptr) 0)) (define-method c-ptr-ref ((obj )) (c-ptr-ref (c-force obj))) (define-method c-ptr-set! ((obj ) (v )) (if (<= 0 v) (set! (ref (%unsigned-uvector-alias obj) 0) v) (set! (ref (%signed-uvector-alias obj) 0) v))) (define-method c-ptr-set! ((obj ) (v )) (u8vector-copy! (buffer-of obj) 0 (buffer-of v))) (define-method c-ptr-set! ((obj ) v) (c-ptr-set! (c-force obj) v)) (define-method ref ((obj )) (c-ptr-ref obj)) (define-method (setter ref) ((obj ) v) (c-ptr-set! obj v)) ;; ;; pointer ;; (define-class () ((orig-c-type :accessor orig-c-type-of)) ) (define-class () ((finalizer :init-value #f :accessor finalizer-of)) :metaclass ) (define c-ptr (let* ((t-ptr (ffi-type-pointer))) (lambda (c-type) (or (slot-ref c-type 'ptr-class) (let* ((mod (ffi-sandbox-module)) (type-name-str (string-append "c-ptr:" (symbol->string (type-name-of c-type)))) (type-name (string->symbol type-name-str)) (class-name (string->symbol (string-append "<" type-name-str ">")))) (eval `(define-class ,class-name () () :metaclass ) mod) (let ((class (global-variable-ref mod class-name #f))) (set! (ffi-type-of class) t-ptr) (set! (type-name-of class) type-name) (set! (orig-c-type-of class) c-type) (slot-set! c-type 'ptr-class class) class)))))) (define-method ptr ((c-type )) (c-ptr c-type)) (define-method c-ptr-set! ((obj ) (v )) (c-ptr-set! obj (cast (ptr ) v))) (define-method ref ((obj ) (n )) (c-array-ref (cast (c-array (orig-c-type-of (class-of obj)) #f) obj) n)) (define-method (setter ref) ((obj ) (n ) v) (c-array-set! (cast (c-array (orig-c-type-of (class-of obj)) #f) obj) n v)) (define-method post++ ((obj )) (let ((v (make (class-of obj) :buffer (u8vector-copy (buffer-of obj))))) (c-ptr-set! obj (+ (c-ptr-ref obj) (c-sizeof-type (orig-c-type-of (class-of obj))))) v)) (define-method post-- ((obj )) (let ((v (make (class-of obj) :buffer (u8vector-copy (buffer-of obj))))) (c-ptr-set! obj (- (c-ptr-ref obj) (c-sizeof-type (orig-c-type-of (class-of obj))))) v)) (define-method pre++ ((obj )) (c-ptr-set! obj (+ (c-ptr-ref obj) (c-sizeof-type (orig-c-type-of (class-of obj))))) obj) (define-method pre-- ((obj )) (c-ptr-set! obj (- (c-ptr-ref obj) (c-sizeof-type (orig-c-type-of (class-of obj))))) obj) (define-method c-ptr+ ((ptr ) (n )) (let ((newptr (make (class-of ptr)))) (c-ptr-set! newptr (+ (c-ptr-ref ptr) (* (c-sizeof-type (orig-c-type-of (class-of ptr))) n))) newptr)) (define-method c-ptr+ ((ptr ) (obj )) (c-ptr+ ptr (c-value-ref obj))) (define-method c-ptr+ ((ptr ) (obj )) (c-ptr+ ptr (c-force obj))) (define-method c-ptr+ ((obj ) n) (c-ptr+ (c-force obj) n)) (define-method c-ptr- ((ptr ) (n )) (c-ptr+ ptr (- n))) (define-method c-ptr- ((ptr ) (obj )) (c-ptr- ptr (c-value-ref obj))) (define-method c-ptr- ((ptr ) (obj )) (c-ptr- ptr (c-force obj))) (define-method c-ptr- ((obj ) n) (c-ptr- (c-force obj) n)) (define-method register-finalizer! ((ptrobj ) proc) (set! (finalizer-of ptrobj) proc) (%register-finalizer! ptrobj)) (define-method register-finalizer! ((obj ) proc) (register-finalizer! (c-force obj) proc)) (define-method unregister-finalizer! ((ptrobj )) (set! (finalizer-of ptrobj) #f) (%unregister-finalizer! ptrobj)) (define-method unregister-finalizer! ((obj )) (unregister-finalizer! (c-force obj))) (define-method finalize! ((ptrobj )) (and-let* ((proc (finalizer-of ptrobj))) (set! (finalizer-of ptrobj) #f) (proc ptrobj)) (%unregister-finalizer! ptrobj)) (define-method finalize! ((obj )) (finalize! (c-force obj))) (define (make-c-var identifier type) (make type :identifier identifier)) ;; ;; function pointer ;; (define-class () ((ret-type :accessor ret-type-of) (arg-types :accessor arg-types-of))) (define-method object-equal? ((obj1 ) (obj2 )) (and (equal? (ret-type-of obj1) (ret-type-of obj2)) (equal? (arg-types-of obj1) (arg-types-of obj2)))) (define-method object-hash ((obj )) (logxor (hash (ret-type-of obj)) (hash (arg-types-of obj)))) (define-class () () :metaclass ) (define (normalize-arg-types arg-types) (match arg-types (((_ (? (cut eq? <>) void))) '()) (((? (cut eq? <>) void)) '()) (else (map (lambda (atype) (let ((t (if (pair? atype) (cadr atype) atype))) (cond ((is-a? t ) ;; array -> pointer (ptr (element-type-of t))) ((equal? t ) (error "can't use void as a parameter")) ((= (c-sizeof-type t) 0) (errorf "can't use the incomplete type ~a as a parameter" t)) (else t)))) arg-types)))) (define (normalize-ret-type ret-type) (cond ((is-a? ret-type ) ;; array -> pointer (ptr (element-type-of ret-type))) ((= (c-sizeof-type ret-type) 0) (errorf "can't use the incomplete type ~a as a return type" ret-type)) (else ret-type))) (define (c-func-ptr ret-type arg-types . _) (let ((class (make :name (gensym) :supers (list ) :slots () :defined-modules (list (ffi-sandbox-module))))) (set! (ffi-type-of class) (ffi-type-pointer)) (set! (type-name-of class) 'c-func-ptr) (set! (ret-type-of class) (normalize-ret-type ret-type)) (set! (arg-types-of class) (normalize-arg-types arg-types)) class)) ;; deprecated (define make-c-func-ptr c-func-ptr) (define (c-func-vaargs-ptr ret-type arg-types . _) (c-func-ptr ret-type arg-types)) ;; deprecated (define make-c-func-vaargs-ptr c-func-vaargs-ptr) (define-class () ((ret-type :init-keyword :ret-type :accessor ret-type-of) (arg-types :init-keyword :arg-types :accessor arg-types-of))) (define (c-func ret-type arg-types . _) (make :ret-type ret-type :arg-types arg-types)) ;; deprecated (define make-c-func-type c-func) (define-method ptr ((func-type )) (c-func-ptr (ret-type-of func-type) (arg-types-of func-type))) (define-method deref ((fptr )) (let ((func-type (class-of fptr))) (%make-c-func-vaargs fptr (ret-type-of func-type) (arg-types-of func-type)))) (define-method object-apply ((fptr ) . args) (apply (deref fptr) args)) ;; ;; array ;; (define-class () ((element-type :accessor element-type-of) (size :accessor size-of))) (define-method object-equal? ((obj1 ) (obj2 )) (and (equal? (element-type-of obj1) (element-type-of obj2)) (equal? (size-of obj1) (size-of obj2)))) (define-method object-hash ((obj )) (logxor (hash (element-type-of obj)) (hash (size-of obj)))) (define-class ( ) ()) (define (c-array element-type size) (or (and-let* ((pair (assq size (slot-ref element-type 'array-class-alist)))) (cdr pair)) (let ((class (make :name (gensym) :supers (list ) :slots () :defined-modules (list (ffi-sandbox-module)))) (size (if size size 0))) (set! (ffi-type-of class) (make-ffi-array-type (ffi-type-of element-type) size)) (set! (type-name-of class) (string->symbol (format "c-array:~a[~a]" (type-name-of element-type) size))) (set! (element-type-of class) element-type) (set! (size-of class) size) (push! (slot-ref element-type 'array-class-alist) (cons size class)) class))) ;; deprecated (define (make-c-array element-type size) (c-array element-type size)) (define-method c-array-ref ((obj ) (index )) (let* ((start (* index (c-sizeof-type (element-type-of (class-of obj))))) (end (+ start (c-sizeof-type (element-type-of (class-of obj)))))) (scm-cast (make (element-type-of (class-of obj)) :buffer (uvector-alias (if (= (size-of (class-of obj)) 0) (%expand-u8vector (buffer-of obj) end) (buffer-of obj)) start end))))) (define-method c-array-ref ((obj ) index) (c-array-ref (c-force obj) index)) (define-method c-array-set! ((obj ) (index ) value) (let* ((tstart (* index (c-sizeof-type (element-type-of (class-of obj))))) (send (c-sizeof-type (element-type-of (class-of obj)))) (casted-value (cast (element-type-of (class-of obj)) value))) (u8vector-copy! (if (= (size-of (class-of obj)) 0) (%expand-u8vector (buffer-of obj) (+ tstart send)) (buffer-of obj)) tstart (buffer-of casted-value) 0 send))) (define-method c-array-set! ((obj ) index value) (c-array-set! (c-force obj) index value)) (define-method c-array-length ((array )) (size-of (class-of array))) (define-method c-array-length ((obj )) (c-array-length (c-force obj))) (define-method object-apply ((c-type ) (size )) (c-array c-type size)) ;; gauche.sequence support (define-method call-with-iterator ((array ) proc . args) (let-keywords* args ((start 0)) (let ((i start)) (proc (lambda () (<= (size-of array) i)) (lambda () (begin0 (c-array-ref array i) (inc! i))))))) (define-method call-with-iterator ((obj ) proc . args) (apply call-with-iterator (c-force obj) proc args)) (define-method size-of ((array )) (c-array-length array)) (define-method size-of ((obj )) (size-of (c-force obj))) (define-method referencer ((obj )) c-array-ref) (define-method referencer ((obj )) (referencer (c-force obj))) (define-method modifier ((obj )) c-array-set!) (define-method modifier ((obj )) (modifier (c-force obj))) ;; ;; struct ;; (define-class () ((decl-alist :accessor decl-alist-of) (unnamed-alist :accessor unnamed-alist-of))) (define-class () ()) (define-syntax define-c-struct (syntax-rules () ((_ tagname) (let ((classname (c-struct-symbol 'tagname))) (unless (global-variable-ref (ffi-sandbox-module) classname #f) (eval `(define-class ,classname () () :metaclass ) (ffi-sandbox-module)) (set! (type-name-of (c-struct 'tagname)) (string->symbol (string-append "c-struct:" (symbol->string 'tagname))))))))) (define-class () ((bits :init-keyword :bits :accessor bits-of) (signed? :init-keyword :signed? :accessor signed?) (shift :accessor shift-of) (leader? :accessor leader?) (bit-mask :allocation :virtual :getter bit-mask-of :slot-ref (lambda (obj) (- (expt 2 (bits-of obj)) 1))))) (define (bit-field? obj) (is-a? obj )) (define (follower? obj) (not (leader? obj))) (define-method ffi-type-of ((obj )) (ffi-type-of )) (define-method c-sizeof ((obj )) (c-sizeof-type )) (define-method leader? ((obj )) #t) (define (c-bit-field c-type num) (make :bits num :signed? (eq? c-type ))) ;; deprecated (define make-bit-field c-bit-field) (define (init-decl-alist! alist) (define (dispatch rest accum) (cond ((null? rest) alist) ((bit-field? (cdar rest)) (do-bit-field (cdar rest) (cdr rest) accum)) (else (dispatch (cdr rest) (max (* (- (c-sizeof-type ) (c-sizeof-type (cdar rest))) 8) 0))))) (define (do-bit-field bit-field rest accum) (if (< (* (c-sizeof-type ) 8) (+ accum (bits-of bit-field))) (do-bit-field bit-field rest 0) (begin (set! (shift-of bit-field) (if (big-endian?) (- (* (c-sizeof-type ) 8) accum (bits-of bit-field)) accum)) (set! (leader? bit-field) (= accum 0)) (dispatch rest (+ accum (bits-of bit-field)))))) (dispatch alist 0)) (define (unnamed-symbol? sym) (#/^%unnamed/ (symbol->string sym))) (define (make-unnamed-alist decl-alist) (define (%member-unnamed-alist type unnamed-name knil) (fold (lambda (pair result) (match-let (((sym . mem-type) pair)) (if (unnamed-symbol? sym) (%member-unnamed-alist mem-type unnamed-name result) (cons (cons sym unnamed-name) result)))) knil (decl-alist-of type))) (fold (lambda (pair result) (match-let (((sym . mem-type) pair)) (if (unnamed-symbol? sym) (%member-unnamed-alist mem-type sym result) result))) '() decl-alist)) (define (unnamed-member class name) (assoc-ref (unnamed-alist-of class) name #f)) (define (init-c-struct! class alist) (let ((decl-alist (init-decl-alist! alist))) (set! (ffi-type-of class) (make-ffi-struct-type (map (lambda (pair) (ffi-type-of (cdr pair))) (remove (lambda (pair) (or (follower? (cdr pair)) ;; remove zero-sized array (= (c-sizeof (cdr pair)) 0))) decl-alist)))) (set! (decl-alist-of class) decl-alist) (set! (unnamed-alist-of class) (make-unnamed-alist decl-alist))) class) (define-method align (offset (alignment )) (+ (logior (- offset 1) (- alignment 1)) 1)) (define-method align (offset (c-type )) (align offset (slot-ref (ffi-type-of c-type) 'alignment))) (define-method align (offset (bit-field )) (if (leader? bit-field) (align offset ) offset)) (define-method c-struct-get-value (obj offset (c-type )) (make c-type :buffer (uvector-alias (buffer-of obj) offset (+ offset (c-sizeof c-type))))) (define-method c-struct-get-value (obj offset (bit-field )) (let* ((v (make :buffer (uvector-alias (buffer-of obj) offset (+ offset (c-sizeof-type ))))) (n (logand (ash (c-value-ref v) (- (shift-of bit-field))) (bit-mask-of bit-field)))) (if (and (signed? bit-field) (< (ash (bit-mask-of bit-field) -1) n)) (- -1 (logand (lognot n) (bit-mask-of bit-field))) n))) (define-method c-struct-set-value! (obj offset (c-type ) value) (u8vector-copy! (buffer-of obj) offset (buffer-of (cast c-type value)) 0 (c-sizeof c-type))) (define-method c-struct-set-value! (obj offset (bit-field ) value) (let1 intval (make :buffer (u8vector-copy (buffer-of obj) offset (+ offset (c-sizeof-type )))) (c-value-set! intval (logior (logand (c-value-ref intval) (lognot (ash (bit-mask-of bit-field) (shift-of bit-field)))) (ash (logand (cast value) (bit-mask-of bit-field)) (shift-of bit-field)))) (u8vector-copy! (buffer-of obj) offset (buffer-of intval) 0 (c-sizeof intval)))) (define (next-offset offset type rest) (cond ((null? rest) offset) ((follower? (cdar rest)) offset) (else (+ offset (c-sizeof type))))) (define-syntax c-struct (syntax-rules () ((_ tagname) (global-variable-ref (ffi-sandbox-module) (c-struct-symbol tagname))))) (define (offset&type struct-class name) (let loop ((rest (decl-alist-of struct-class)) (offset 0)) (when (null? rest) (errorf "~a doesn't have such element: ~a" struct-class name)) (let ((elem-name (caar rest)) (elem-type (cdar rest))) (set! offset (align offset elem-type)) (if (eq? elem-name name) (values offset elem-type) (loop (cdr rest) (next-offset offset elem-type (cdr rest))))))) (define (c-offsetof struct-class name) (receive (offset elem-type) (offset&type struct-class name) offset)) (define-method c-struct-ref ((obj ) (name ) . args) (let-optionals* args ((auto-cast? #t)) (or (and-let* ((unnamed-name (unnamed-member (class-of obj) name))) (ref (c-struct-ref obj unnamed-name) name auto-cast?)) (receive (offset elem-type) (offset&type (class-of obj) name) (let ((result (c-struct-get-value obj offset elem-type))) (if auto-cast? (scm-cast result) result)))))) (define-method c-struct-ref ((obj ) name . args) (apply c-struct-ref (c-force obj) name args)) (define-method c-struct-set! ((obj ) (name ) value) (or (and-let* ((unnamed-name (unnamed-member (class-of obj) name))) (set! (ref (c-struct-ref obj unnamed-name) name) value)) (receive (offset elem-type) (offset&type (class-of obj) name) (c-struct-set-value! obj offset elem-type value)))) (define-method c-struct-set! ((obj ) name value) (c-struct-set! (c-force obj) name value)) (define-method ref ((obj ) (name ) . rest) (apply c-struct-ref obj name rest)) (define-method (setter ref) ((obj ) (name ) value) (c-struct-set! obj name value)) (define-method raw-ref ((obj ) (name )) (c-struct-ref obj name #f)) (define-method raw-ref ((obj ) name) (raw-ref (c-force obj) name)) (define-method ref ((obj ) (name )) (ref (deref obj) name)) (define-method (setter ref) ((obj ) (name ) value) (set! (ref (deref obj) name) value)) ;; ;; union ;; (define-class () ((decl-alist :accessor decl-alist-of) (unnamed-alist :accessor unnamed-alist-of))) (define-class () ()) (define-syntax define-c-union (syntax-rules () ((_ tagname) (let ((classname (c-union-symbol 'tagname))) (unless (global-variable-ref (ffi-sandbox-module) classname #f) (eval `(define-class ,classname () () :metaclass ) (ffi-sandbox-module)) (set! (type-name-of (c-union 'tagname)) (string->symbol (string-append "c-union:" (symbol->string 'tagname))))))))) (define (init-c-union! class decl-alist) (set! (ffi-type-of class) (make-ffi-struct-type (list (ffi-type-of (fold (lambda (p c-type) (if (or (not c-type) (< (c-sizeof c-type) (c-sizeof (cdr p)))) (cdr p) c-type)) #f decl-alist))))) (set! (decl-alist-of class) decl-alist) (set! (unnamed-alist-of class) (make-unnamed-alist decl-alist)) class) (define-syntax c-union (syntax-rules () ((_ tagname) (global-variable-ref (ffi-sandbox-module) (c-union-symbol tagname))))) (define-method c-union-ref ((obj ) (name ) . args) (let-optionals* args ((auto-cast? #t)) (or (and-let* ((unnamed-name (unnamed-member (class-of obj) name))) (ref (c-union-ref obj unnamed-name) name auto-cast?)) (or (and-let* ((pair (assq name (decl-alist-of (class-of obj))))) (let* ((elem-type (cdr pair)) (v (make elem-type :buffer (uvector-alias (buffer-of obj) 0 (c-sizeof elem-type))))) (if auto-cast? (scm-cast v) v))) (errorf "~a doesn't have such element: ~a" (class-of obj) name))))) (define-method c-union-ref ((obj ) name . args) (apply c-union-ref (c-force obj) name args)) (define-method c-union-set! ((obj ) (name ) value) (or (and-let* ((unnamed-name (unnamed-member (class-of obj) name))) (set! (ref (c-union-ref obj unnamed-name) name) value)) (or (and-let* ((pair (assq name (decl-alist-of (class-of obj))))) (let1 elem-type (cdr pair) (u8vector-copy! (buffer-of obj) 0 (buffer-of (cast elem-type value)) 0 (c-sizeof elem-type)))) (errorf "~a doesn't have such element: ~a" (class-of obj) name)))) (define-method c-union-set! ((obj ) name value) (c-union-set! (c-force obj) name value)) (define-method ref ((obj ) (name ) . rest) (apply c-union-ref obj name rest)) (define-method (setter ref) ((obj ) (name ) value) (c-union-set! obj name value)) (define-method raw-ref ((obj ) (name )) (c-union-ref obj name #f)) ;; ;; enum ;; (define-syntax c-enum (syntax-rules () ((_ tagname) ))) (define (init-c-enum! class enum-symbols) class) (define-syntax define-c-enum (syntax-rules () ((_ tagname ()) ()) ((_ tagname ((sym val) rest ...)) (begin (define sym val) (define-c-enum tagname (rest ...)))))) ;; ;; functions to make pointer and dereference ;; (define-method ptr ((obj )) (%ptr obj)) (define-method ptr ((obj )) (ptr (c-force obj))) (define-method deref ((obj )) (%deref obj)) (define-method deref ((obj )) (deref (c-force obj))) (define-method (setter deref) ((obj ) value) (let ((deref-obj (deref obj)) (casted-value (cast (orig-c-type-of (class-of obj)) value))) (u8vector-copy! (buffer-of deref-obj) 0 (buffer-of casted-value)))) (define-method (setter deref) ((obj ) value) ((setter deref) (c-force obj) value)) ;; ;; functions and macro to define C function and closure ;; (define (errchk func . args) (receive (status result) (apply func args) (cond ((eq? status FFI_OK) result) ((eq? status FFI_BAD_TYPEDEF) (error "One of the ffi_type objects that ffi_prep_cif came across is bad.")) ((eq? status FFI_BAD_ABI) (error "FFI_BAD_ABI")) (else (error "Unknown error: " status))))) (define (c++-type->str type) (cond ((is-a? type ) (string-append "P" (type->str (orig-c-type-of type)))) ((is-a? type ) (let ((name ((#// (symbol->string (class-name type))) 1))) (format "~a~a" (string-length name) name))) ((is-a? type ) (let ((name ((#// (symbol->string (class-name type))) 1))) (format "~a~a" (string-length name) name))) ((is-a? type ) (format "P~a" (type->str (element-type-of type)))) ((eq? type ) "v") ((eq? type ) "h") ((eq? type ) "c") ((eq? type ) "s") ((eq? type ) "t") ((eq? type ) "i") ((eq? type ) "j") ((eq? type ) "l") ((eq? type ) "m") ((eq? type ) "x") ((eq? type ) "y") ((eq? type ) "f") ((eq? type ) "d") ((eq? type ) "e") ((eq? type 'ellipsis) "z"))) (define (c++-mangle name arg-types) (string->symbol (format "_Z~a~a~a" (string-length (symbol->string name)) name (apply string-append (map type->str (if (null? arg-types) (list ) arg-types)))))) (define (make-c-func identifier ret-type arg-types . opts) (let-keywords* opts ((c++? #f)) (make-c-subr #f (normalize-ret-type ret-type) (normalize-arg-types arg-types) #f (if c++? (c++-mangle identifier arg-types) identifier)))) (define (%make-c-func-vaargs fptr ret-type arg-types . rest) (let-optionals* rest ((identifier #f)) (let ((nret-type (normalize-ret-type ret-type)) (narg-types (normalize-arg-types arg-types))) (make-c-subr fptr nret-type narg-types #t identifier)))) (define (make-c-func-vaargs identifier ret-type arg-types . opts) (let-keywords* opts ((c++? #f)) (%make-c-func-vaargs #f ret-type arg-types (if c++? (c++-mangle identifier (append arg-types '(ellipsis))) identifier)))) (define-class () ((fp-class :init-keyword :fp-class :accessor fp-class-of) (proc :init-keyword :proc :accessor proc-of))) (define-method object-equal? ((obj1 ) (obj2 )) (and (equal? (fp-class-of obj1) (fp-class-of obj2)) (eq? (proc-of obj1) (proc-of obj2)))) (define-method object-hash ((obj )) (hash (fp-class-of obj))) (define *closure-table* (make-hash-table 'equal?)) (define (make-c-closure fp-class proc) (let ((key (make :fp-class fp-class :proc proc))) (unless (hash-table-exists? *closure-table* key) (let* ((cif (errchk ffi-prep-cif (ffi-type-of (ret-type-of fp-class)) (map ffi-type-of (arg-types-of fp-class)))) (closure-obj (errchk ffi-prep-closure cif (lambda args (let ((rvalue (cast (ret-type-of fp-class) (apply proc (map (lambda (c-type pointer) (scm-cast (deref (cast (ptr c-type) pointer)))) (arg-types-of fp-class) args))))) (ptr rvalue)))))) (hash-table-put! *closure-table* key closure-obj))) (cast fp-class (ffi-closure (hash-table-get *closure-table* key))))) (define (c-closure-free func-ptr) (for-each (cut hash-table-delete! *closure-table* <>) (hash-table-fold *closure-table* (lambda (key val kons) (if (equal? (buffer-of func-ptr) (ffi-closure val)) (cons key kons) kons)) '()))) ;; ;; cast ;; (define-method cast (class value) (if (is-a? value class) value (errorf "cast ~a to ~a is not allowed." value class))) (define-method cast (class (obj )) (cast class (c-force obj))) (define-method cast ((c-type ) (value )) (cast c-type (c-value-ref value))) (define-method cast ((c-type ) (value )) (let ((new-value (make c-type))) (c-value-set! new-value value) new-value)) (define-method cast ((c-type ) (value )) (let ((v (c-ptr-ref value)) (new-value (make c-type))) (c-value-set! new-value v) new-value)) (define-method cast ((c-type ) (value )) (let ((new-value (make c-type))) (c-value-set! new-value (if value 1 0)) new-value)) (define-method cast ((c-type ) (num )) (if (= num 0) (cast c-type (make-null-ptr)) (let ((new-ptr (make c-type))) (c-ptr-set! new-ptr num) new-ptr))) (define-method cast ((c-type ) (p )) (make c-type :buffer (buffer-of p))) (define-method cast ((c-type ) (str )) (let ((vec (make-u8vector (+ (string-size str) 1) 0))) (%ptr-uvector c-type (string->u8vector! vec 0 str)))) (define-method cast ((c-type ) (array )) (%ptr-uvector c-type (buffer-of array))) (define-method cast ((c-type ) (array )) (%ptr-uvector c-type (uvector-alias array))) (define-method cast ((c-type ) (seq )) (cast c-type (cast (c-array (orig-c-type-of c-type) (size-of seq)) seq))) (define-method cast ((c-type ) (fptr )) (foreign-pointer->c-ptr c-type fptr)) (define-method cast ((c-type ) (seq )) (let ((array (make c-type))) (dotimes (i (size-of seq) array) (c-array-set! array i (ref seq i))))) (define-method cast ((c-type ) (p )) (deref (cast (ptr c-type) p))) (define-method cast ((c-type ) (proc )) (make-c-closure c-type proc)) ;; There is no conversion if you change a function-pointer's type to ;; other function-pointer type. ;; Some function pointers which allow any arguments are defined ;; as "ret_type (*fn)()" in header files. This cast rule is for the case. (define-method cast ((c-type ) (func-ptr )) func-ptr) ;; This cast will be called when c-closure's return is void. (define-method cast ((c-type ) value) (make )) (define-method cast (class (value )) (cond ((eq? class ) (x->integer (c-value-ref value))) ((memq class (class-precedence-list )) (c-value-ref value)) ((eq? class ) (if (= (c-value-ref value) 0) #f #t)) (else (next-method)))) (define-method cast (class (value )) (cond ((eq? class ) (x->integer value)) ((memq class (class-precedence-list )) value) ((eq? class ) (if (= value 0) #f #t)) (else (next-method)))) (define-method cast (class (value )) (cond ((memq class (class-precedence-list )) (c-ptr-ref value)) ((eq? class ) (ptr->string value)) (else (next-method)))) (define-method cast (class (value )) (cast class (ptr value))) (define-method cast ((coll-class ) (array )) (if (memq (class-precedence-list coll-class)) (map-to coll-class scm-cast array) (next-method))) (define-method scm-cast ((obj )) (scm-cast (c-force obj))) (define-method scm-cast ((value )) (c-value-ref value)) (define-method scm-cast ((value )) (undefined)) (define-method scm-cast (obj) obj) (define-method c-cast ((v )) (define (containable? type v signed?) (let ((size (c-sizeof-type type))) ((case ( - size (if signed? 1 0)) ((7) (cut <= -128 <> 127)) ((8) (cut <= 0 <> 255)) ((15) (cut <= -32768 <> 32767)) ((16) (cut <= 0 <> 65535)) ((31) (cut <= -2147483648 <> 2147483647)) ((32) (cut <= 0 <> 4294967295)) ((63) (cut <= -9223372036854775808 <> 9223372036854775807)) ((64) (cut <= 0 <> 18446744073709551616)) (else (lambda (x) #f))) v))) (cond ((containable? v #t) (cast v)) ((containable? v #f) (cast v)) ((containable? v #t) (cast v)) ((containable? v #f) (cast v)) ((containable? v #t) (cast v)) ((containable? v #f) (cast v)) (else (next-method)))) (define-method c-cast ((v )) (cast v)) (define-method c-cast ((v )) (cast (ptr ) v)) (define-method c-cast ((v )) (c-cast (c-force v))) (define-method c-cast ((v )) v) (define-method c-cast (v) v) (define-method x->string ((obj )) (cast obj)) (define-method x->string ((obj )) (cast (ptr obj))) (define-method x->number ((obj )) (cast obj)) (provide "c-wrapper/c-ffi") gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/c-lex.scm0000644000000000000000000006651411237307544016701 0ustar ;;; ;;; C-LEX for C-PARSE ;;; (define-module c-wrapper.c-lex (use c-wrapper.context) (use srfi-1) (use util.queue) (export c-scan make-error-message print-current-line lineno lineno-set! filename filename-set! set-input-port! free-input-port! set-input-string! last-token-set! init-type-table install-type start-macro-set! start-macro-reset! parser-attribute-clear! parser-attribute parser-attribute-add!) (dynamic-load "c-lex") ) (select-module c-wrapper.c-lex) (define (make-error-message msg) (format "~a:~a: ~a (at token: ~s)" (filename) (lineno) msg (last-token))) (define (print-current-line) (let ((str (current-line))) (format (current-error-port) "~a:~a: ~a" (filename) (lineno) str) (unless (and (string? str) (#/\n$/ str)) (newline (current-error-port))))) ;; (define-inline (buf-read-line) ;; (let ((line (read-line (input-port) #t))) ;; (current-line line) ;; (cond ;; ((eof-object? line) ;; (let ((chars (circular-list line))) ;; (rest-chars chars) ;; chars)) ;; ((eq? (string-size line) 0) ;; (lineno (+ (lineno) 1)) ;; (buf-read-line)) ;; ((string-incomplete? line) ;; (lineno (+ (lineno) 1)) ;; (buf-read-line)) ;; (else ;; (lineno (+ (lineno) 1)) ;; (let ((chars (string->list (string-append line "\n")))) ;; (rest-chars chars) ;; chars))))) ;; (define-inline (buf-read-char) ;; (let ((rest (rest-chars))) ;; (when (null? rest) ;; (set! rest (buf-read-line))) ;; (rest-chars (cdr rest)) ;; (car rest))) ;; (define-inline (buf-peek-char) ;; (let ((rest (rest-chars))) ;; (when (null? rest) ;; (set! rest (buf-read-line))) ;; (car rest))) ;; (define-inline (buf-next-char) ;; (rest-chars (cdr (rest-chars)))) ;; ;; (define c-keywords ;; '((auto AUTO) ;; (break BREAK) ;; (case CASE) ;; (const CONST) ;; (__const CONST) ;; (continue CONTINUE) ;; (default DEFAULT) ;; (do DO) ;; (else ELSE) ;; (enum ENUM) ;; (extern EXTERN) ;; (for FOR) ;; (goto GOTO) ;; (if IF) ;; (register REGISTER) ;; (return RETURN) ;; (signed SIGNED) ;; (__signed SIGNED) ;; (sizeof SIZEOF) ;; (static STATIC) ;; (struct STRUCT) ;; (switch SWITCH) ;; (typedef TYPEDEF) ;; (union UNION) ;; (unsigned UNSIGNED) ;; (__unsigned UNSIGNED) ;; (volatile VOLATILE) ;; (__volatile VOLATILE) ;; (__volatile__ VOLATILE) ;; (while WHILE) ;; (inline INLINE) ;; (__inline INLINE) ;; (__inline__ INLINE) ;; (asm ASM) ;; (__asm ASM) ;; (__asm__ ASM) ;; (__restrict RESTRICT) ;; (__restrict__ RESTRICT) ;; (__extension__ EXTENSION) ;; (__attribute__ ATTRIBUTE) ; ignore ;; (@interface AT_INTERFACE) ;; (@implementation AT_IMPLEMENTATION) ;; (@end AT_END) ;; (@selector AT_SELECTOR) ;; (@defs AT_DEFS) ;; (@encode AT_ENCODE) ;; (@public AT_PUBLIC) ;; (@private AT_PRIVATE) ;; (@protected AT_PROTECTED) ;; (@protocol AT_PROTOCOL) ;; (@class AT_CLASS) ;; (@compatibility_alias AT_ALIAS) ;; (@throw AT_THROW) ;; (@try AT_TRY) ;; (@catch AT_CATCH) ;; (@finally AT_FINALLY) ;; (@synchronized AT_SYNCHRONIZED) ;; (@property AT_PROPERTY) ;; (@synthesize AT_SYNTHESIZE) ;; (@dynamic AT_DYNAMIC) ;; (@optional AT_OPTIONAL) ;; (@required AT_REQUIRED) ;; )) ;; (define c-operators ;; '((>>= RIGHT_ASSIGN) ;; (<<= LEFT_ASSIGN) ;; (+= ADD_ASSIGN) ;; (-= SUB_ASSIGN) ;; (*= MUL_ASSIGN) ;; (/= DIV_ASSIGN) ;; (%= MOD_ASSIGN) ;; (&= AND_ASSIGN) ;; (^= XOR_ASSIGN) ;; ;;(|= OR_ASSIGN) ;; (>> RIGHT_OP) ;; (<< LEFT_OP) ;; (> >) ;; (< <) ;; (++ INC_OP) ;; (-- DEC_OP) ;; (-> PTR_OP) ;; (&& AND_OP) ;; ;;(|| OR_OP) ;; (<= LE_OP) ;; (>= GE_OP) ;; (== EQ_OP) ;; (!= NE_OP) ;; (* *) ;; (/ /) ;; (+ +) ;; (- -) ;; (% %) ;; (& &) ;; (^ ^) ;; (= =) ;; (? ?) ;; (! !) ;; (~ ~) ;; )) ;;; ;;; ;;; ;; (define %keyword-tbl (let ((tbl (make-hash-table))) ;; (for-each (lambda (lst) ;; (hash-table-put! tbl (car lst) lst)) ;; c-keywords) ;; tbl)) ;; (define %operator-tbl (let ((tbl (make-hash-table))) ;; (for-each (lambda (lst) ;; (hash-table-put! tbl (car lst) lst)) ;; c-operators) ;; tbl)) ;; (define (get-keyword-val symbol) (hash-table-get %keyword-tbl symbol #f)) ;; (define (get-operator-val symbol) (hash-table-get %operator-tbl symbol #f)) ;;; ;;; ;;; ;; gcc of GCC allows dollar sign ;;(define initial-identifier-charset #[A-Za-z_]) ;;(define identifier-charset #[A-Za-z_0-9]) ;; (define initial-identifier-charset #[A-Za-z_$@]) ;; (define identifier-charset #[A-Za-z_$0-9]) ;; (define operator-charset #[*~!+\-/\^&%=?<>]) ;; (define special-operator-charset #[|.]) ; cant be in scheme symbol ;; (define scheme-token-charset ;; (char-set #\. ; DOT ;; #\: ; COLON ;; #\( ; LPAREN ;; #\) ; RPAREN ;; #\{ ; LCBRA ;; #\} ; RCBRA ;; #\[ ; LSBRA ;; #\] ; RSBRA ;; #\| ; OR ;; )) ;; (define (char-digit? c) (char-set-contains? #[0-9] c)) ;; (define (char-nonzero-digit? c) (char-set-contains? #[1-9] c)) ;; (define (char-hex-digit? c) (char-set-contains? #[0-9A-Fa-f] c)) ;; (define (char-octal-digit? c) (char-set-contains? #[0-7] c)) ;; (define skip-spaces ;; (let ((space-char-list '(#\space #\tab #\x0b #\page))) ;; (lambda () ;; (let loop ((c (buf-peek-char))) ;; (when (memq c space-char-list) ;; (buf-next-char) ;; (loop (buf-peek-char))))))) ;; (define (skip-line) ;; (let loop ((c (buf-peek-char))) ;; (if (and (not (eof-object? c)) ;; (not (char=? c #\newline))) ;; (begin ;; (buf-next-char) ;; (loop (buf-peek-char)))))) ;; (define (l->symbol l) ;; (string->symbol (list->string (reverse l)))) ;; (define (read-identifier l) ;; (let ((c (buf-peek-char))) ;; (if (char-set-contains? identifier-charset c) ;; (begin ;; (buf-next-char) ;; (read-identifier (cons c l))) ;; (let ((s (l->symbol l))) ;; (cond ;; ((force-identifier?) ;; (cons 'IDENTIFIER s)) ;; ((get-keyword-val s) => (lambda (k) ;; ;; parse __attribute__ ;; (if (eq? k 'ATTRIBUTE) ;; (parse-attribute) ;; k))) ;; ((memq s '(int long double char short float)) ;; (cons 'TYPENAME s)) ;; ((and (pair? (last-token)) (eq? (car (last-token)) 'TYPENAME)) ;; (cons 'IDENTIFIER s)) ;; ((or (eq? (last-token) 'STRUCT) (eq? (last-token) 'UNION)) ;; (cons 'IDENTIFIER s)) ;; ((eq? (last-token) 'AT_INTERFACE) ;; (install-type s) ;; (cons 'IDENTIFIER s)) ;; ((typedefed? s) ;; (cons 'TYPENAME s)) ;; (else ;; (cons 'IDENTIFIER s))))))) ;; (define (read-operator c) ;; (define (l->opval l) ;; (get-operator-val (l->symbol l))) ;; (let lp ((cand (l->opval (list c))) ;; (l (list c))) ;; (let* ((c (buf-peek-char)) ;; (k (l->opval (cons c l)))) ;; (if k ;; (begin ;; (buf-next-char) ;; (lp k (cons c l))) ;; cand)))) ;;; ;;; ;;; ;; (define (hexchar->integer c) ;; (cond ((char=? c #\0) 0) ;; ((char=? c #\1) 1) ;; ((char=? c #\2) 2) ;; ((char=? c #\3) 3) ;; ((char=? c #\4) 4) ;; ((char=? c #\5) 5) ;; ((char=? c #\6) 6) ;; ((char=? c #\7) 7) ;; ((char=? c #\8) 8) ;; ((char=? c #\9) 9) ;; ((char-ci=? c #\a) 10) ;; ((char-ci=? c #\b) 11) ;; ((char-ci=? c #\c) 12) ;; ((char-ci=? c #\d) 13) ;; ((char-ci=? c #\e) 14) ;; ((char-ci=? c #\f) 15) ;; (else ;; (error "can not be, there must be a bug in lexer")))) ;; (define (backslash c) ;; (define (readn c n v) ;; (if (and (> n 0) (char-octal-digit? c)) ;; (begin ;; (buf-next-char) ;; (readn (buf-peek-char) ;; (- n 1) ;; (+ (* v 8) (hexchar->integer c)))) ;; (integer->char v))) ;; (define (readx c) ;; (let lp ((c c) ;; (v 0)) ;; (if (char-hex-digit? c) ;; (begin ;; (buf-next-char) ;; (lp (buf-peek-char) ;; (+ (* v 16) (hexchar->integer c)))) ;; (integer->char v)))) ;; (define (readu c) ;; (define (range-check v) ;; ;; CARM: Sec 2.9, p41 ;; (or (= v #x24) ;; (= v #x40) ;; (= v #x60) ;; (not (or (< v #xa0) ;; (and (<= #xd800 v) (<= v #xdfff)))))) ;; (receive (n v) ;; (let lp ((c c) ;; (n 0) ;; (v 0)) ;; (if (char-hex-digit? c) ;; (begin ;; (buf-read-char) ;; (lp (buf-peek-char) ;; (+ n 1) ;; (+ (* v 16) (hexchar->integer c)))) ;; (values n v))) ;; (cond ;; ((not (or (= n 4) (= n 8))) ;; (error "Universal character name must be 4 or 8 hex-digit")) ;; ((not (range-check v)) ;; (errorf "\\u~4,'0x is not a valid universal character" v)) ;; (else ;; (ucs->char v))))) ;; (if (char=? c #\\) ;; (let ((c (buf-read-char))) ;; (cond ;; ((char=? c #\n) #\newline) ; NL 0A ^J ;; ((char=? c #\x) ; not char-ci=?, cf. CARM p. 35 ;; (if (char-hex-digit? (buf-peek-char)) ;; (readx (buf-peek-char)) ;; (error "\\x must be followed by hex-digit" (buf-peek-char)))) ;; ((char=? c #\t) #\tab) ; HT 09 ^I ;; ((char-ci=? c #\u) ;; (if (char-hex-digit? (buf-peek-char)) ;; (readu (buf-peek-char)) ;; (error "\\u must be followed by hex-digit" (buf-peek-char)))) ;; ((char-octal-digit? c) ;; (readn (buf-peek-char) 3 (hexchar->integer c))) ;; ((char-set-contains? #[?\'\"\\] c) c) ; first two backslash ;; ; are placed to fool emacs ;; ((char=? c #\p) ;; ;; TODO: pascal string ;; c) ;; ((char=? c #\a) #\x07) ; BEL 07 ^G ;; ((char=? c #\b) #\x08) ; BS 08 ^H ;; ((char=? c #\v) #\x0b) ; VT 0B ^K ;; ((char=? c #\f) #\page) ; NP 0C ^L ;; ((char=? c #\r) #\return) ; CR 0D ^M ;; ((char-set-contains? #[a-z] c) ;; (warning "Unknown lower case escape character is used: ~a" c) ;; c) ;; ((char-set-contains? #[A-Z] c) ;; (warning "No upper case espace character is defined: ~a" c) ;; c) ;; (else ;; (buf-read-char)))) ;; c)) ;; (define (read-string-literal) ;; (let lp ((c (buf-read-char)) ;; (s '())) ;; (if (eof-object? c) ;; (error "missing double quote") ;; (if (char=? c #\") ;; (apply string (reverse s)) ;; (let ((cc (backslash c))) ;; (lp (buf-read-char) (cons cc s))))))) ;; (define (read-character-constant) ;; (let lp ((c (buf-read-char)) ;; (s 0)) ;; (if (eof-object? c) ;; (error "missing quote") ;; (if (char=? c #\') ;; s ;; (let ((cc (backslash c))) ;; ;; Meaning of Multicharacter constant is implementation ;; ;; dependent. Here we implement a convention with left-to-right ;; ;; packing, which is described in CARM pp. 31--32. ;; (lp (buf-read-char) ;; (+ (* 256 s) ;; (char->integer cc)))))))) ;;; ;;; read-hexadecimal, octal. ;;; ;; (define (read-octal-or-flonum l) ;; (define (rl->n l) ;; (for-each (lambda (c) ;; (if (not (char-set-contains? #[0-7] c)) ;; (error "invalid char in octal" c))) ;; l) ;; (strtoll (apply string (reverse l)))) ;; (let ((c (buf-peek-char))) ;; (cond ;; ((char-set-contains? #[0-9] c) ;; (buf-next-char) ;; (read-octal-or-flonum (cons c l))) ;; ((char=? #\. c) ;; (buf-next-char) ;; (read-flonum (cons c l) #[0-9] 10 #[Ee])) ;; ((char-set-contains? #[Ee] c) ;; (buf-next-char) ;; (read-expnum (cons c l) 10)) ;; ((char-set-contains? #[ULul] c) ;; (buf-next-char) ;; (list (integer-suffix c) ;; (rl->n l))) ;; (else ;; (list 'int (rl->n l)))))) ;;; ;;; read decimal integer or floating point ;;; ;; (define (read-number-constant l ics radix ecs) ;; (define (rl->n l) ;; (strtoll (apply string (reverse l)))) ;; (let ((c (buf-peek-char))) ;; (cond ;; ((char-set-contains? ics c) ;; (buf-next-char) ;; (read-number-constant (cons c l) ics radix ecs)) ;; ((char=? c #\.) ;; (buf-next-char) ;; (read-flonum (cons c l) ics radix ecs)) ;; ((char-set-contains? ecs c) ;; (buf-next-char) ;; (read-expnum (cons c l) radix)) ;; ((char-set-contains? #[ULul] c) ;; (buf-next-char) ;; (list (integer-suffix c) ;; (rl->n l))) ;; (else ;; (list 'int (rl->n l)))))) ;; (define (read-decimal l) ;; (read-number-constant l #[0-9] 10 #[Ee])) ;; (define (read-hexadecimal l) ;; (read-number-constant l #[0-9A-Fa-f] 16 #[Pp])) ;; (define (integer-suffix c) ;; ;; ugly... ;; (cond ;; ((char-ci=? c #\u) ;; (let ((c (buf-peek-char))) ;; (cond ((char=? c #\l) ;; (buf-next-char) ;; (let ((c (buf-peek-char))) ;; (if (char=? c #\l) ;; (begin ;; (buf-next-char) ;; 'unsigned-long-long) ;; 'unsigned-long))) ;; ((char=? c #\L) ;; (buf-next-char) ;; (let ((c (buf-peek-char))) ;; (if (char=? c #\L) ;; (begin ;; (buf-next-char) ;; 'unsigned-long-long) ;; 'unsigned-long))) ;; (else ;; 'unsigned-int)))) ;; ((char=? c #\l) ;; (let ((c (buf-peek-char))) ;; (cond ((char=? c #\l) ;; (begin ;; (buf-next-char) ;; (let ((c (buf-peek-char))) ;; (if (char-ci=? c #\u) ;; (begin (buf-next-char) ;; 'unsigned-long-long) ;; 'long-long)))) ;; ((char-ci=? c #\u) ;; (buf-next-char) ;; 'unsinged-long) ;; (else 'long)))) ;; ((char=? c #\L) ;; (let ((c (buf-peek-char))) ;; (cond ((char=? c #\L) ;; (begin ;; (buf-next-char) ;; (let ((c (buf-peek-char))) ;; (if (char-ci=? c #\u) ;; (begin (buf-next-char) ;; 'unsigned-long-long) ;; 'long-long)))) ;; ((char-ci=? c #\u) ;; (buf-next-char) ;; 'unsinged-long) ;; (else 'long)))) ;; (else ;; (error "there is a bug in lexer")))) ;; (define (read-flonum l ics radix ecs) ;; (define (rl->n l) ;; (strtod (apply string (reverse l)))) ;; (define (error-if-hex) ;; (if (= radix 16) ;; (error "hexadecimal floating constants require an exponent"))) ;; (let ((c (buf-peek-char))) ;; (cond ;; ((char-set-contains? ics c) ;; (buf-next-char) ;; (read-flonum (cons c l) ics radix ecs)) ;; ((char-set-contains? ecs c) ;; (buf-next-char) ;; (read-expnum (cons c l) radix)) ;; ((char-ci=? c #\f) ;; (buf-next-char) ;; (error-if-hex) ;; (list 'float (rl->n l))) ;; ((char-ci=? c #\l) ;; (buf-next-char) ;; (error-if-hex) ;; (list 'long-double (rl->n l))) ;; (else ;; (error-if-hex) ;; (list 'double (rl->n l)))))) ;;; ;;; ;;; ;; (define (read-expnum l radix) ;; (define (rl->n l) (strtod (apply string (reverse l)))) ;; (define (exp1 c l) ;; (cond ;; ((char-numeric? c) ;; (buf-next-char) ;; (exp1 (buf-peek-char) (cons c l))) ;; ((char-ci=? c #\f) ;; (buf-next-char) ;; (list 'float (rl->n l))) ;; ((char-ci=? c #\l) ;; (buf-next-char) ;; (list 'long-double (rl->n l))) ;; (else ;; (list 'double (rl->n l))))) ;; (if (char-set-contains? #[0-9\-\+] (buf-peek-char)) ;; (let ((c (buf-read-char))) ;; (exp1 (buf-peek-char) (cons c l))) ;; (error "malformed floating point expression"))) ;;; ;;; ;;; (define (follow expect ifyes ifno) (let ((c (buf-peek-char))) (if (char=? c expect) (begin (buf-next-char) ifyes) ifno))) ;;; ;;; ;;; (define (enqueue-macro! name args) (enqueue! (macro-queue) (list* (if args (string-append (symbol->string name) "(" (string-join (map symbol->string args) ",") ")") (symbol->string name)) (cons (filename) (lineno)) name args))) ;; (define sc-ignore skip-line) ;; (define sc-do-define skip-line) ;; (define (sc-do-sharp-space) ;; (skip-spaces) ;; (let ((c (buf-read-char))) ;; (when (char-numeric? c) ;; (let ((num (read-decimal (list c)))) ;; (skip-spaces) ;; (let ((c (buf-read-char))) ;; (when (char=? c #\") ;; (let ((str (read-string-literal))) ;; (lineno-set! (- num 1)) ;; (filename-set! str)))))) ;; (skip-line))) ;; (define (sc-do-define) ;; (skip-spaces) ;; (let ((c (buf-read-char))) ;; (when (char-set-contains? initial-identifier-charset c) ;; (force-identifier-set! #t) ;; (call/cc (lambda (break) ;; (let ((name (cdr (read-identifier (list c)))) ;; (args #f)) ;; (when (char=? (buf-peek-char) #\() ;; (buf-next-char) ;; (set! args '()) ;; (skip-spaces) ;; (let loop ((c (buf-read-char))) ;; (cond ;; ((char=? c #\)) ;; (set! args (reverse args))) ;; ((char-set-contains? initial-identifier-charset c) ;; (push! args (cdr (read-identifier (list c)))) ;; (skip-spaces) ;; (loop (buf-read-char))) ;; ((char=? c #\,) ;; (skip-spaces) ;; (loop (buf-read-char))) ;; (else ;; (break #f))))) ;; (enqueue-macro! name args)))) ;; (force-identifier-set! #f)) ;; (skip-line))) ;; (define sharp-commands ;; `((pragma ,sc-ignore) ;; (define ,sc-do-define)) ;; ) ;; (define (do-sharp-command) ;; (if (char=? (buf-peek-char) #\space) ;; (begin ;; (buf-next-char) ;; (sc-do-sharp-space)) ;; (let lp ((c (buf-peek-char)) ;; (l '())) ;; (cond ((char-alphabetic? c) ;; (buf-next-char) ;; (lp (buf-peek-char) (cons c l))) ;; (else ;; (let ((cmd (assq (l->symbol l) sharp-commands))) ;; (if cmd ;; ((cadr cmd)) ;; (sc-ignore)))))))) ;;; ;;; Changes from c-lex.scm: ;;; ;;; STRING -> STRING_LITERAL ;;; OROR -> OR_OP ;;; (ASSIGN . OR) -> OR_ASSIGN ;;; ;; (define (c-scan) ;; (let ((token (%c-scan))) ;; (last-token-set! token) ;; token)) ;; (define (%c-scan) ;; (skip-spaces) ;; (let loop ((c (buf-read-char))) ;; (cond ;; ((eof-object? c) '*eoi*) ;; ((char=? c #\newline) ;; (skip-spaces) ;; (loop (buf-read-char))) ;; ((char=? c #\#) ;; (do-sharp-command) ;; (skip-spaces) ;; (loop (buf-read-char))) ;; ((char=? c #\0) ;; (cond ;; ((char-ci=? (buf-peek-char) #\x) ;; (begin (buf-next-char) ;; (cons 'CONSTANT (read-hexadecimal '(#\x #\0))))) ;; (else ;; (cons 'CONSTANT (read-octal-or-flonum (list c)))))) ;; ((char-numeric? c) ;; (cons 'CONSTANT (read-decimal (list c)))) ;; ((and (char=? c #\.) (char-numeric? (buf-peek-char))) ;; (cons 'CONSTANT (read-flonum (list c) #[0-9] 10 #[Ee]))) ;; ((char=? c #\.) ;; (if (char=? (buf-peek-char) #\.) ;; (begin ;; (buf-next-char) ;; (if (char=? (buf-peek-char) #\.) ;; (begin ;; (buf-next-char) ;; 'ELLIPSIS) ;; 'UNKNOWN)) ;; 'DOT)) ;; ((and (char=? c #\L) (char=? (buf-peek-char) #\")) ;; (buf-next-char) ; L ;; (cons 'STRING (read-string-literal))) ;; ((and (char=? c #\L) (char=? (buf-peek-char) #\')) ;; (buf-next-char) ; L ;; (cons 'CONSTANT (read-character-constant))) ;; ((and (char=? c #\@) (char=? (buf-peek-char) #\")) ;; (buf-next-char) ; @ ;; (cons 'OBJC_STRING (read-string-literal))) ;; ((char=? c #\") ;; (cons 'STRING (read-string-literal))) ;; ((char=? c #\') ;; (cons 'CONSTANT (read-character-constant))) ;; ((char-set-contains? initial-identifier-charset c) ;; (read-identifier (list c))) ;; ((char-set-contains? operator-charset c) ;; (read-operator c)) ;; ((char=? c #\,) 'COMMA) ;; ((char=? c #\:) 'COLON) ;; ((char=? c #\;) 'SEMICOLON) ;; ((char=? c #\() 'LPAREN) ;; ((char=? c #\)) 'RPAREN) ;; ((char=? c #\{) 'LCBRA) ;; ((char=? c #\}) 'RCBRA) ;; ((char=? c #\[) 'LSBRA) ;; ((char=? c #\]) 'RSBRA) ;; ;; special case for c-operator due to Scheme ;; ((char=? c #\|) (or (follow #\| 'OR_OP #f) ; || ;; (follow #\= 'OR_ASSIGN #f) ; |= ;; 'OR)) ; | ;; (else ;; (error "warning: illegal character: " c) ;; (skip-spaces) ;; (loop (buf-read-char)))))) ;;;;;; ;; attribute-specifier := __attribute__ ( ( attribute-list ) ;; attribute-list := ) ;; | attribute attribute-list-rest ;; attribute-list-rest := ) ;; | , ) ;; | , attribute attribute-list-rest ;; attribute := word ;; | word ( param-list ;; param-list := ) | word param-list-rest ;; param-list-rest := ) ;; | , ) ;; | , word param-list-rest ;; word := IDENTIFIER ;; | ( word ) (define (parse-attribute) (define (token-collector seed) (do ((lst (cons (c-scan) seed) (cons (c-scan) lst))) ((memq (car lst) '(RPAREN *eoi*)) (if (eq? (car lst) 'RPAREN) lst (cdr lst))) (when (eq? (car lst) 'LPAREN) (set! lst (token-collector lst))))) (define (%parse-attribute token-list) (call/cc (lambda (break) (define (accept t) (and-let* ((result (if (and (pair? (car token-list)) (eq? (caar token-list) t)) (cdar token-list) (equal? t (car token-list))))) (next) result)) (define (next) (if (null? (cdr token-list)) (break #f) (set! token-list (cdr token-list)))) (define (skip t) (while (accept t) #t)) (define (word) (cond ((accept 'IDENTIFIER) => values) ((accept 'STRING) => values) ((accept 'CONSTANT) => values) ((accept 'LPAREN) (begin0 (word) (skip 'RPAREN))) (else #f))) (define (param-list-rest p-lst) (cond ((accept 'RPAREN) (reverse p-lst)) ((accept 'COMMA) (cond ((accept 'RPAREN) (reverse p-lst)) (else (param-list-rest (cons (word) p-lst))))) (else (next) (param-list-rest p-lst)))) (define (param-list) (cond ((accept 'RPAREN) '()) (else (param-list-rest (list (word)))))) (define (attribute) (let ((w (word))) (cond ((accept 'LPAREN) (cons w (param-list))) (else (list w))))) (define (attribute-list-rest attr-list) (cond ((accept 'RPAREN) (reverse attr-list)) ((accept 'COMMA) (cond ((accept 'RPAREN) (reverse attr-list)) (else (attribute-list-rest (cons (attribute) attr-list))))) (else (next) (attribute-list-rest attr-list)))) (define (attribute-list) (cond ((accept 'RPAREN) '()) (else (attribute-list-rest (list (attribute)))))) (define (attribute-specifier) (cond ((accept 'LPAREN) (skip 'LPAREN) (begin0 (parser-attribute-add! (attribute-list)) (skip 'RPAREN))) (else #t))) (attribute-specifier)))) (let ((t (c-scan))) (if (eq? t 'LPAREN) (begin (%parse-attribute (unwind-protect (begin (force-identifier-set! #t) (reverse (token-collector (list t)))) (force-identifier-set! #f))) (c-scan)) t))) (provide "c-wrapper/c-lex") ;;;;;; ;;;;;; END OF LEXER PART gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/c-parser.scm0000644000000000000000000012376211237307544017404 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; parser.scm ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: $ (define-module c-wrapper.c-parser (use srfi-1) (use srfi-13) (use srfi-11) (use gauche.process) (use gauche.sequence) (use file.util) (use util.match) (use gauche.vport) (use gauche.uvector) (use gauche.regexp) (use gauche.config) (use util.queue) (use c-wrapper.config) (use c-wrapper.c-ffi) (use c-wrapper.context) (use c-wrapper.c-lex) (use util.list) (export c-parse) (dynamic-load "c-parser") ) (select-module c-wrapper.c-parser) (define (with-parse-context trunk) (unwind-protect (begin (set! context (make )) (init-type-table) (init-value-pool) (init-struct-pool) (init-union-pool) (parser-attribute-clear!) (all-referenced-info-clear!) (defchunk-dict-init) (trunk)) (set! context #f))) ;; (define (register-identifier name value) ;; (hash-table-put! (value-pool) name value) ;; value) ;; (define (registered-identifier? name) ;; (or (hash-table-exists? (value-pool) name) ;; (memq name (arg-pool)))) ;; (define (c-lookup-value v) ;; (match v ;; (('identity (? symbol? name)) ;; (hash-table-get (value-pool) name #f)) ;; (else ;; v))) (debug-print-width #f) ;; moved to c-parserlib.stub ;; (define (c-type->class-symbol type) ;; (string->symbol (string-append "<" (symbol->string type) ">"))) ;; ;; ;; ;; (define (%INT v) ;; (if (real? v) ;; (x->integer v) ;; `((with-module c-wrapper.c-ffi cast) ,v))) (define (%REAL v) (if (real? v) v `((with-module c-wrapper.c-ffi cast) ,v))) (define (%SCM-CAST expr) (match expr ((? number? v) v) ((? string? v) v) (('begin (or (? number? v) (? string? v))) v) ((('with-module 'c-wrapper.c-ffi 'cast) _ (? number? v)) v) (else `(scm-cast ,expr)))) (define (%IDENTIFIER v) (if (registered-identifier? v) (begin (referenced-identifier-list-add! v) v) #f)) (define-syntax define-maybe (syntax-rules () ((_ (name . args) . body) (define (name . args) (if (and . args) (begin . body) #f))))) ;; (define-maybe (%TYPENAME v) ;; (referenced-typename-list-add! v) ;; (list v)) (define-maybe (%STRUCT-OR-UNION-SPECIFIER v) (referenced-typename-list-add! (list-ref v 1)) (list v)) (define-maybe (%ENUM-SPECIFIER v) (referenced-typename-list-add! (list-ref v 1)) (list v)) (define-maybe (%MACRO-BODY body) (let ((new-body (if (null? (cdr body)) (%SCM-CAST (car body)) (%SCM-CAST `(begin ,@body))))) (macro-body-set! new-body) new-body)) (define-maybe (%FUNCTION-BODY body) `(call/cc (lambda (%return) ,body))) (define-maybe (%OBJC-STRING v) `(@ ,v)) (define-maybe (%EXPR-IN-PARENS expr) (if (symbol? expr) `(identity ,expr) expr)) (define-maybe (%COMPOUND-STATEMENT statements) `(begin ,@statements)) (define-maybe (%COMPOUND-STATEMENT-WITH-DECLARATION declaration-list statements) (let ((var-list '()) (init-list '())) (for-each (lambda (declaration) (let* ((type (type-of declaration)) (identifier (name-of declaration)) (init-val (value-of declaration))) ;; TODO: typedef in compound_statement is not supported (push! var-list `(,identifier (make ,type))) (when init-val (push! init-list `(set! ((with-module c-wrapper.c-ffi ref) ,identifier) ,init-val))))) declaration-list) `(let* ,(reverse var-list) ,@(reverse init-list) ,@statements))) (define-maybe (%REF-ARRAY v index) `((with-module c-wrapper.c-ffi ref) ,v ,(%INT index))) (define-maybe (%FUNCALL func names) (cons (c-lookup-value func) names)) (define-maybe (%DOT-REF v name) `(raw-ref ,v ',name)) (define-maybe (%PTR-REF p name) `(raw-ref ((with-module c-wrapper.c-ffi deref) ,p) ',name)) (define-maybe (%POST-INC v) `(post++ ,v)) (define-maybe (%POST-DEC v) `(post-- ,v)) ;; (define-maybe (%LIST v) ;; (list v)) ;; (define-maybe (%ADD-LIST lst v) ;; (append lst (list v))) (define-maybe (%PRE-INC v) `(pre++ ,v)) (define-maybe (%PRE-DEC v) `(pre-- ,v)) (define-maybe (%UNARY op v) (case op ((+) v) ((-) (%SUB 0 v)) ((!) (%IF v 0 1)) ((~) (%BIT-NOT v)) ((&) `((with-module c-wrapper.c-ffi ptr) ,v)) ((*) `((with-module c-wrapper.c-ffi deref) ,v)) (else #f))) (define-maybe (%BIT-NOT v) (if (integer? v) (lognot v) `(lognot ,(%INT v)))) (define-maybe (%SIZEOF-EXPR v) `(c-sizeof ,v)) (define-maybe (%SIZEOF-TYPE v) `(c-sizeof ,(type-of v))) (define-maybe (%CAST type-name expr) `((with-module c-wrapper.c-ffi cast) ,(type-of type-name) ,expr)) (define-maybe (%MUL expr1 expr2) (if (and (real? expr1) (real? expr2)) (* expr1 expr2) `(* ,expr1 ,expr2))) (define-maybe (%DIV expr1 expr2) (if (and (real? expr1) (real? expr2)) (/ expr1 expr2) `(/ ,expr1 ,expr2))) (define-maybe (%MOD expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (modulo expr1 expr2) `(modulo ,(%INT expr1) ,(%INT expr2)))) (define-maybe (%ADD expr1 expr2) (if (and (real? expr1) (real? expr2)) (+ expr1 expr2) `(if (is-a? ,expr1 ) (c-ptr+ ,expr1 ,expr2) (+ ,expr1 ,expr2)))) (define-maybe (%SUB expr1 expr2) (if (and (real? expr1) (real? expr2)) (- expr1 expr2) `(if (is-a? ,expr1 ) (c-ptr- ,expr1 ,expr2) (- ,expr1 ,expr2)))) (define-maybe (%SHIFT-LEFT expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (ash expr1 expr2) `(ash ,(%INT expr1) ,(%INT expr2)))) (define-maybe (%SHIFT-RIGHT expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (ash expr1 (- expr2)) `(ash ,(%INT expr1) (- ,expr2)))) (define-maybe (%LT expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (< expr1 expr2) 1 0) `(if (< ,(%REAL expr1) ,(%REAL expr2)) 1 0))) (define-maybe (%GT expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (> expr1 expr2) 1 0) `(if (> ,(%REAL expr1) ,(%REAL expr2)) 1 0))) (define-maybe (%LE expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (<= expr1 expr2) 1 0) `(if (<= ,(%REAL expr1) ,(%REAL expr2)) 1 0))) (define-maybe (%GE expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (>= expr1 expr2) 1 0) `(if (>= ,(%REAL expr1) ,(%REAL expr2)) 1 0))) (define-maybe (%EQ expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (eq? expr1 expr2) 1 0) `(if (equal? ,(%REAL expr1) ,(%REAL expr2)) 1 0))) (define-maybe (%NE expr1 expr2) (if (and (real? expr1) (real? expr2)) (if (eq? expr1 expr2) 0 1) `(if (equal? ,(%REAL expr1) ,(%REAL expr2)) 0 1))) (define-maybe (%BIT-AND expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (logand expr1 expr2) `(logand ,(%INT expr1) ,(%INT expr2)))) (define-maybe (%BIT-XOR expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (logxor expr1 expr2) `(logxor ,(%INT expr1) ,(%INT expr2)))) (define-maybe (%BIT-OR expr1 expr2) (if (and (integer? expr1) (integer? expr2)) (logior expr1 expr2) `(logior ,(%INT expr1) ,(%INT expr2)))) (define-maybe (%LOG-AND expr1 expr2) (let ((v (gensym "%"))) `(let ((,v ,(%REAL expr1))) (if (eq? ,v 0) ,v ,expr2)))) (define-maybe (%LOG-OR expr1 expr2) (let ((v (gensym "%"))) `(let ((,v ,(%REAL expr1))) (if (eq? ,v 0) ,expr2 ,v)))) (define-maybe (%IF test then else) `(if (eq? ,(%REAL test) 0) ,else ,then)) (define-maybe (%ASSIGN lhs rhs) (match lhs ((? symbol? x) `(let ((%v ,rhs)) (set! ((with-module c-wrapper.c-ffi ref) ,x) %v) %v)) (((or ('with-module 'c-wrapper.c-ffi 'ref) 'raw-ref) x ...) `(let ((%v ,rhs)) (set! ((with-module c-wrapper.c-ffi ref) ,@x) %v) %v)) ((('with-module 'c-wrapper.c-ffi 'deref) x) `(let ((%v ,rhs)) (set! ((with-module c-wrapper.c-ffi deref) ,x) %v) %v)) (else #f))) (define-maybe (%CONCAT-EXPR expr1 expr2) `(begin ,expr1 ,expr2)) (define-maybe (%FOR init test update body) (use-iterator-set! #t) `(call/cc (lambda (%break) ,init (let %continue () ,(%IF test `(begin ,body ,update (%continue)) '(%break 0)))))) (define-maybe (%WHILE test statement) (use-iterator-set! #t) `(call/cc (lambda (%break) (let %continue () ,(%IF test `(begin ,statement (%continue)) '(%break 0)))))) (define-maybe (%DO-WHILE test statement) (use-iterator-set! #t) `(call/cc (lambda (%break) (letrec ((%body (lambda () ,statement (%continue))) (%continue (lambda () ,(%IF test '(%body) '(%break 0))))) (%body))))) (define (%CONTINUE) (use-jump-set! #t) '(%continue)) (define (%BREAK) (use-jump-set! #t) '(%break 0)) (define-maybe (%RETURN v) (use-return-set! #t) `(%return ,v)) (define-maybe (%QUOTE v) `(',v)) ;; (define-maybe (%APPEND v1 v2) ;; (append v1 v2)) ;; (define-maybe (%COMPOSE-DECLARATOR d1 d2) ;; (lambda (var) ;; (d1 (d2 var)))) (define-maybe (%KEYWORD-ARG selector expr) `(',selector ,expr)) (define-maybe (%KEYWORD-ARG-WITHOUT-SELECTOR expr) (list : expr)) (define-maybe (%OBJC-MESSAGE-EXPR receiver args) `(,receiver ,@args)) (define-maybe (%SELECTOR selector) `(@selector ,selector)) ;; ;; (define (external-declaration declaration-specifiers init-declarator-list) ;; (parser-attribute-clear!) ;; (if (eq? (car declaration-specifiers) 'TYPEDEF) ;; (emit-typedef (make-type-decl-list (cdr declaration-specifiers) init-declarator-list)) ;; (for-each (lambda (init-declarator) ;; (let ((declaration (make-type-decl declaration-specifiers init-declarator))) ;; (emit-define-extern declaration))) ;; init-declarator-list))) ;; (define-maybe (parameter-declaration v) ;; (parser-attribute-clear!) ;; (let ((type (type-of v))) ;; ;; ISO/IEC 9899:1999 6.7.5.3 ;; (when (pair? type) ;; (case (car type) ;; ((c-func) (set-car! type 'c-func-ptr)) ;; ((c-func-vaargs) (set-car! type 'c-func-vaargs-ptr)) ;; (else #f))) ;; (and-let* ((name (name-of v))) ;; (arg-pool-add! name)) ;; v)) ;; (define (declaration specifiers declarator-list) ;; (parser-attribute-clear!) ;; (let ((var-list (make-type-decl-list specifiers declarator-list))) ;; (for-each (lambda (var) ;; (arg-pool-add! (name-of var))) ;; var-list) ;; var-list)) (define (decl-keyword selector . typename-list) (cons (list (string-append (x->string selector) (if (null? typename-list) "" ":"))) typename-list)) (define (decl-enum identifier lst) (list 'ENUM (or identifier (gensym "%")) lst)) (define (decl-enumerator identifier expr) (cons identifier expr)) (define (combine-decl-keyword decl1 . rest) (let-optionals* rest ((decl2 #f)) (if decl2 (cons (append (car decl1) (car decl2)) (append (cdr decl1) (cdr decl2))) decl1))) (define (decl-objc-method ret-type decl-arg) (list (car decl-arg) (cons ret-type (cdr decl-arg)))) (define (decl-struct-or-union struct-or-union identifier decl-list) (list struct-or-union (or identifier (gensym "%")) decl-list)) (define (var-id) (make-type-decl '(id) (null-declarator))) ;; ;; moved to c-parser.c and c-parserlib.stub ;; (define-maybe (make-type-decl type-spec-list qualifier) ;; (and-let* ((c-type (typespec->c-type ((with-module srfi-1 remove) ;; (cut eq? 'TYPEDEF <>) ;; type-spec-list)))) ;; (qualifier (vector c-type #f #f)))) ;; (define-inline (name-of v) ;; (vector-ref v 1)) ;; (define-inline (set-name! v name) ;; (vector-set! v 1 name)) ;; (define-inline (type-of v) ;; (vector-ref v 0)) ;; (define-inline (set-type! v type) ;; (vector-set! v 0 type)) ;; (define-inline (value-of v) ;; (vector-ref v 2)) ;; (define-inline (set-value! v val) ;; (vector-set! v 2 val)) ;; (define (identifier-declarator name) ;; (lambda (var) ;; (set-name! var name) ;; var)) ;; (define (array-declarator n) ;; (lambda (var) ;; (set-type! var `(c-array ,(type-of var) ,(and n (%INT n)))) ;; var)) ;; (define (func-declarator args) ;; (lambda (var) ;; (set-type! var `(c-func ,(type-of var) (list ,@(map (lambda (arg) ;; `(list ',(name-of arg) ;; ,(type-of arg))) ;; args)))) ;; var)) ;; (define (func-vaargs-declarator args) ;; (lambda (var) ;; (set-type! var `(c-func-vaargs ,(type-of var) (list ,@(map (lambda (arg) ;; `(list ',(name-of arg) ;; ,(type-of arg))) ;; args)))) ;; var)) ;; (define (ptr-declarator) ;; (lambda (var) ;; (let ((type (type-of var))) ;; (define (%ptr-qualifier) ;; (set-type! var `((with-module c-wrapper.c-ffi ptr) ,type))) ;; (if (pair? type) ;; (case (car type) ;; ((c-func) (set-car! type 'c-func-ptr)) ;; ((c-func-vaargs) (set-car! type 'c-func-vaargs-ptr)) ;; (else ;; (%ptr-qualifier))) ;; (%ptr-qualifier)) ;; var))) ;; (define (bit-field-declarator n) ;; (lambda (var) ;; (set-type! var `(c-bit-field ,(type-of var) ,n)) ;; (unless (name-of var) ;; (set-name! var (gensym "%"))) ;; var)) ;; (define (init-value-declarator v) ;; (lambda (var) ;; (set-value! var v) ;; var)) ;; (define (compose-variable-attribute declarator) ;; (let ((attr-list (parser-attribute))) ;; (parser-attribute-clear!) ;; (lambda (var) ;; (let ((type (type-of var))) ;; (set-type! var (let ((unsigned? (memq type '( ))) ;; (size->mode (cut assoc-ref '((1 . QI) (2 . HI) (4 . SI) (8 . DI)) <>))) ;; (let %attribute-mode->c-type ((mode (cadr (or (assq 'mode attr-list) ;; (assq '__mode__ attr-list) ;; (list #f #f))))) ;; (case mode ;; ((QI __QI__ byte __byte__) (if unsigned? ;; ' ;; ')) ;; ((HI __HI__) (if unsigned? ;; ' ;; ')) ;; ((SI __SI__) (if unsigned? ;; ' ;; ')) ;; ((DI __DI__) (if unsigned? ;; ' ;; ')) ;; ((SF __SF__) ') ;; ((DF __DF__) ') ;; ((word __word__) ;; (%attribute-mode->c-type (size->mode (word-size)))) ;; ((pointer __pointer__) ;; (%attribute-mode->c-type (size->mode (pointer-size)))) ;; (else ;; type))))) ;; (declarator var))))) ;; (define (make-type-decl-list type-spec-list qualifiers) ;; (map (cut make-type-decl type-spec-list <>) qualifiers)) ;; (define (typespec->c-type type) ;; (match type ;; (('char) ') ;; (('SIGNED 'char) ') ;; (('UNSIGNED 'char) ') ;; (('short) ') ;; (('short 'int) ') ;; (('short 'UNSIGNED 'int) ') ;; (('SIGNED 'short) ') ;; (('SIGNED 'short 'int) ') ;; (('UNSIGNED 'short) ') ;; (('UNSIGNED 'short 'int) ') ;; (('int) ') ;; (('SIGNED 'int) ') ;; (('SIGNED) ') ;; (('UNSIGNED 'int) ') ;; (('UNSIGNED) ') ;; (('long) ') ;; (('long 'int) ') ;; (('SIGNED 'long) ') ;; (('SIGNED 'long 'int) ') ;; (('long 'SIGNED 'int) ') ;; (('UNSIGNED 'long) ') ;; (('UNSIGNED 'long 'int) ') ;; (('long 'UNSIGNED 'int) ') ;; (('long 'long) ') ;; (('long 'long 'int) ') ;; (('SIGNED 'long 'long) ') ;; (('SIGNED 'long 'long 'int) ') ;; (('long 'long 'SIGNED 'int) ') ;; (('UNSIGNED 'long 'long) ') ;; (('UNSIGNED 'long 'long 'int) ') ;; (('long 'long 'UNSIGNED 'int) ') ;; (('float) ') ;; (('double) ') ;; (('long 'double) ') ;; (('void) ') ;; (('_Bool) ') ;; (('__builtin_va_list) '((with-module c-wrapper.c-ffi ptr) )) ;; ((('STRUCT tagname (elem-alist ...))) ;; (emit-init-struct tagname elem-alist) ;; `(c-struct ',tagname)) ;; ((('STRUCT tagname #f)) ;; (emit-alloc-struct tagname) ;; `(c-struct ',tagname)) ;; ((('UNION tagname (elem-alist ...))) ;; (emit-init-union tagname elem-alist) ;; `(c-union ',tagname)) ;; ((('UNION tagname #f)) ;; (emit-alloc-union tagname) ;; `(c-union ',tagname)) ;; ((('ENUM tagname (enum-alist ...))) ;; (emit-define-enum tagname enum-alist) ;; `(c-enum ',tagname)) ;; (((? symbol? x)) ;; (c-type->class-symbol x)) ;; (else ;; #f))) ;;; ;; (define (emit-definition name define-list . rest) ;; (let-optionals* rest ((dependent-symbols define-list)) ;; (if (import-cond) ;; (let ((pair (enqueue-code define-list #f))) ;; (enqueue-import-pool name (cons pair dependent-symbols)) ;; (when (or (hash-table-exists? (imported-pool) name) ;; (need-import? name)) ;; (imp-sym name))) ;; (begin ;; (enqueue-code define-list #t) ;; (when (and (export?) name) ;; (enqueue-code `(export ,name) #t)))))) ;; (define (make-member-alist elem-list) ;; (map (lambda (elem) ;; `(cons ',(name-of elem) ,(type-of elem))) ;; elem-list)) ;; (define (emit-alloc-struct tagname) ;; (unless (hash-table-exists? (struct-pool) tagname) ;; (hash-table-put! (struct-pool) tagname #t) ;; (emit-definition `(c-struct ',tagname) `(define-c-struct ,tagname)))) ;; (define (emit-alloc-struct tagname) ;; (unless (hash-table-exists? (struct-pool) tagname) ;; (hash-table-put! (struct-pool) tagname #t) ;; (defchunk-dict-set-typename! tagname ;; (make-defchunk 'alloc-struct ;; tagname ;; (list (c-struct-symbol tagname)) ;; `(define-c-struct ,tagname))))) ;; (define (emit-init-struct tagname member-list) ;; (emit-alloc-struct tagname) ;; (emit-definition `(c-struct ',tagname) ;; `(init-c-struct! (c-struct ',tagname) ;; (list ,@(make-member-alist member-list))))) ;; (define (emit-init-struct tagname member-list) ;; (emit-alloc-struct tagname) ;; (defchunk-dict-set-typename! tagname ;; (make-defchunk 'init-struct ;; tagname ;; (list (c-struct-symbol tagname)) ;; `(init-c-struct! (c-struct ',tagname) (list ,@(make-member-alist member-list)))))) ;; (define (emit-alloc-union tagname) ;; (unless (hash-table-exists? (union-pool) tagname) ;; (hash-table-put! (union-pool) tagname #t) ;; (emit-definition `(c-union ',tagname) `(define-c-union ,tagname)))) ;; (define (emit-alloc-union tagname) ;; (unless (hash-table-exists? (union-pool) tagname) ;; (hash-table-put! (union-pool) tagname #t) ;; (defchunk-dict-set-typename! tagname ;; (make-defchunk 'alloc-union ;; tagname ;; (list (c-union-symbol tagname)) ;; `(define-c-union ,tagname))))) ;; (define (emit-init-union tagname member-list) ;; (emit-alloc-union tagname) ;; (emit-definition `(c-union ',tagname) ;; `(init-c-union! (c-union ',tagname) ;; (list ,@(make-member-alist member-list))))) ;; (define (emit-init-union tagname member-list) ;; (emit-alloc-union tagname) ;; (defchunk-dict-set-typename! tagname ;; (make-defchunk 'init-union tagname ;; (list (c-union-symbol tagname)) ;; `(init-c-union! (c-union ',tagname) (list ,@(make-member-alist member-list)))))) ;; (define (emit-define-enum tagname enum-alist) ;; (fold (lambda (p prev) ;; (let ((v (or (cdr p) ;; (if (number? prev) ;; (+ prev 1) ;; `(+ (scm-cast ,prev) 1))))) ;; (register-identifier (car p) v) ;; (emit-definition (car p) `((with-module c-wrapper define-enum) ,(car p) ,v)) ;; v)) ;; -1 ;; enum-alist) ;; (emit-definition `(c-enum ',tagname) ;; `(init-c-enum! (c-enum ',tagname) ;; (list ,@(map car enum-alist))))) ;; (define (emit-define-enum tagname enum-alist) ;; (let ((prev -1)) ;; (for-each (lambda (p) ;; (let ((v (or (cdr p) ;; (if (number? prev) ;; (+ prev 1) ;; `(+ (scm-cast ,prev) 1))))) ;; (register-identifier (car p) v) ;; (defchunk-dict-set-identifier! (car p) ;; (make-defchunk 'define-enum (car p) (list (car p)) `((with-module c-wrapper define-enum) ,(car p) ,v))) ;; (set! prev v))) ;; enum-alist))) ;; (define (emit-typedef var-list) ;; (for-each (lambda (v) ;; (let ((obj (type-of v)) ;; (sym (c-type->class-symbol (name-of v)))) ;; (emit-definition sym `(define ,sym ,obj))) ;; (install-type (name-of v))) ;; var-list)) ;; (define (emit-typedef var-list) ;; (for-each (lambda (v) ;; (let* ((obj (type-of v)) ;; (c-type (name-of v)) ;; (sym (c-type->class-symbol c-type))) ;; (defchunk-dict-set-typename! c-type ;; (make-defchunk 'typedef ;; c-type ;; (list sym) ;; `(define ,sym ,obj))) ;; (install-type c-type))) ;; var-list)) ;; (define (emit-define-inline declaration-specifiers declarator function-body) ;; (define (make-bindings name-list type-list) ;; (let loop ((bindings '()) ;; (i 0) ;; (name-rest name-list) ;; (type-rest type-list)) ;; (if (null? name-rest) ;; (reverse bindings) ;; (loop (cons `(,(car name-rest) ((with-module c-wrapper.c-ffi cast) ,(car type-rest) ;; (list-ref %args ,i))) ;; bindings) ;; (+ i 1) ;; (cdr name-rest) ;; (cdr type-rest))))) ;; (let* ((declaration (make-type-decl declaration-specifiers declarator)) ;; (c-type (type-of declaration)) ;; (identifier (name-of declaration))) ;; (match c-type ;; (('c-func ret-type ('list ('list ('quote names) types) ...)) ;; (register-identifier identifier ;; `(lambda args ;; (apply ,identifier args))) ;; (emit-definition identifier ;; `((with-module c-wrapper define-inline-cfunc) ;; ,identifier ,ret-type ,names ,types ;; ,(or function-body ;; `(errorf "~a is not supported. Try cwcompile if you want to use." ,identifier))))) ;; (('c-func-ptr ret-type ('list ('list ('quote names) types) ...)) ;; (warning "'~a' is ignored. It appears in a function definition, but it is a pointer of a function in reality." identifier)) ;; (((? (lambda (v) (memq v '(c-func-vaargs-ptr func-vaargs))) v) ;; ret-type ('list ('list ('quote names) types) ...)) ;; (warning "The inline function '~a' is ignored, because it gets variable arguments" identifier)) ;; (else ;; (warning "'~a' is ignored, it is not a function." identifier))))) ;; (define (emit-define-inline declaration-specifiers declarator function-body) ;; (let* ((declaration (make-type-decl declaration-specifiers declarator)) ;; (c-type (type-of declaration)) ;; (identifier (name-of declaration))) ;; (defchunk-dict-set-identifier! identifier ;; (make-defchunk 'define-inline ;; identifier ;; (list identifier) ;; (vector declaration c-type identifier function-body))) ;; (register-identifier identifier ;; `(lambda args ;; (apply ,identifier args))))) ;; (define (emit-define-extern declaration) ;; (and-let* ((c-type (type-of declaration)) ;; (identifier (name-of declaration))) ;; (when (or (ignore-dlsym-check?) ;; (c-lookup-symbol identifier)) ;; (and-let* ((obj (match c-type ;; (('c-func ret-type ('list ('list _ arg-type) ...)) ;; `(make-c-func ',identifier ;; ,ret-type ;; (list ,@arg-type))) ;; (('c-func-vaargs ret-type ('list ('list _ arg-type) ...)) ;; `(make-c-func-vaargs ',identifier ;; ,ret-type ;; (list ,@arg-type))) ;; (else ;; `(make-c-var ',identifier ,c-type))))) ;; (register-identifier identifier obj) ;; (emit-definition identifier `(define ,identifier ,obj)))))) ;; (define (emit-define-extern declaration) ;; (and-let* ((c-type (type-of declaration)) ;; (identifier (name-of declaration))) ;; (when (or (ignore-dlsym-check?) ;; (c-lookup-symbol identifier)) ;; (let ((obj (match c-type ;; (('c-func ret-type ('list ('list _ arg-type) ...)) ;; `(make-c-func ',identifier ;; ,ret-type ;; (list ,@arg-type))) ;; (('c-func-vaargs ret-type ('list ('list _ arg-type) ...)) ;; `(make-c-func-vaargs ',identifier ;; ,ret-type ;; (list ,@arg-type))) ;; (else ;; `(make-c-var ',identifier ,c-type))))) ;; (defchunk-dict-set-identifier! identifier ;; (make-defchunk 'define-extern ;; identifier ;; (list identifier) ;; `(define ,identifier ,obj))) ;; (register-identifier identifier obj))))) ;; (define (emit-define-objc-class classname-list) ;; (for-each (lambda (classname) ;; (when classname ;; (install-type classname) ;; (let ((sym (c-type->class-symbol classname))) ;; (emit-definition sym `(define ,sym (c-struct 'objc_object)))) ;; (emit-definition classname ;; `(define ,classname ;; (objc-lookup-class ',classname))))) ;; classname-list)) ;; (define (emit-define-objc-class classname-list) ;; (for-each (lambda (classname) ;; (when classname ;; (install-type classname) ;; (let ((sym (c-type->class-symbol classname))) ;; (defchunk-dict-set-typename! classname ;; (make-defchunk 'alloc-objc-class ;; classname ;; (list sym) ;; `(define ,sym (c-struct 'objc_object))))) ;; (defchunk-dict-set-typename! classname ;; (make-defchunk 'init-objc-class ;; classname ;; (list classname) ;; `(define ,classname ;; (objc-lookup-class ',classname)))))) ;; classname-list)) ;; (define (emit-objc-method keywords type-list) ;; (let ((name (apply string-append keywords))) ;; (emit-definition #f ;; `(objc-register-method ,name ;; (list ,@(map type-of type-list)))))) ;; (define (emit-objc-method keywords type-list) ;; (let ((name (apply string-append keywords))) ;; (make-defchunk 'define-objc-method ;; #f ;; '() ;; `(objc-register-method ,name (list ,@(map type-of type-list)))))) ;; (define (emit-define-cmacro name body) ;; (emit-definition name `(define ,name ,body))) ;; (define (emit-define-cmacro name body) ;; (defchunk-dict-set-identifier! name ;; (make-defchunk 'define-cmacro ;; name ;; (list name) ;; `(define ,name ,body)))) ;; (define (emit-define-cfunclike-macro name args body) ;; (emit-definition name ;; `((with-module c-wrapper define-cfunclike-macro) ;; ,name ,args ,body))) ;; (define (emit-define-cfunclike-macro name args body) ;; (defchunk-dict-set-identifier! name ;; (make-defchunk 'define-cfunclike-macro ;; name ;; (list name) ;; `((with-module c-wrapper define-cfunclike-macro) ;; ,name ,args ,body)))) (define (make-define-inline-expr defchunk) (let* ((vec (defchunk-object defchunk)) (declaration (vector-ref vec 0)) (c-type (vector-ref vec 1)) (identifier (vector-ref vec 2)) (function-body (vector-ref vec 3))) (match c-type (('c-func ret-type ('list ('list ('quote names) types) ...)) `((with-module c-wrapper define-inline-cfunc) ,identifier ,ret-type ,names ,types ,(or function-body `(errorf "~a is not supported. Try cwcompile if you want to use." ,identifier)))) (('c-func-ptr ret-type ('list ('list ('quote names) types) ...)) (warning "'~a' is ignored. It appears in a function definition, but it is a pointer of a function in reality." identifier)) (((? (lambda (v) (memq v '(c-func-vaargs-ptr func-vaargs))) v) ret-type ('list ('list ('quote names) types) ...)) (warning "The inline function '~a' is ignored, because it gets variable arguments" identifier)) (else (warning "'~a' is ignored, it is not a function." identifier))))) ;; (define (defchunk->sexpr defchunk) ;; (case (defchunk-type defchunk) ;; ((define-inline) ;; (make-define-inline-expr defchunk)) ;; (else ;; (defchunk-object defchunk)))) ;;; (define (call-with-gcc-io include-dirs headers options proc . rest) (let ((gcc-error #f)) (let-keywords* rest ((show-define? #t)) (call-with-process-io (cpp-command include-dirs headers options show-define?) proc :on-abnormal-exit (lambda (process) (format (current-error-port) (make-error-message "GCC exitted abnormally")) (newline (current-error-port)) (set! gcc-error (format "process ~a exitted abnormally with exit code ~a" (process-pid process) (process-exit-status process)))))) (when gcc-error (error gcc-error)))) (define (cpp-command include-dirs headers options . rest) (let-optionals* rest ((show-define? #t)) (string-join (append (list GCC "-E") (if show-define? '("-dD") '()) options (map (cut format "-I~a" <>) include-dirs) (map (cut format "-include ~a" <>) headers) (list "-")) " "))) (define (report-parse-error msg . args) (errorf msg)) (define (do-parse initializer finalizer error-reporter) (last-token-set! #f) (unwind-protect (begin (initializer) (guard (e (( e) (let ((errmsg (make-error-message (condition-ref e 'message)))) (print-current-line) (display errmsg (current-error-port)) (newline (current-error-port)) (raise e))) (else (let ((errmsg (make-error-message e))) (print-current-line) (display errmsg (current-error-port)) (newline (current-error-port)) (raise e)))) (c-grammar error-reporter))) (finalizer))) (define (parse-from-port port error-reporter) (do-parse (lambda () (set-input-port! port) (start-macro-reset!)) free-input-port! error-reporter)) ;;; ;; (define (parse-macro-body name args body-str) ;; (init-macro-parser-state) ;; (and-let* ((body (and body-str ;; (begin ;; (all-referenced-info-clear!) ;; (arg-pool-set! (or args '())) ;; (start-macro-set!) ;; (last-token-set! #f) ;; (set-input-string! (string-append body-str ";\n")) ;; (c-grammar #f) ;; (macro-body))))) ;; (cond ;; ((or (and (not (use-iterator?)) (use-jump?)) ;; (use-return?)) ;; #f) ;; ((not args) ;; (match body ;; (('scm-cast v) ;; (unless (eq? name v) ;; (let ((new-body `(c-delay (lambda () (c-cast ,v)) ',v))) ;; (emit-define-cmacro name new-body)))) ;; (else ;; (unless (eq? name body) ;; (emit-define-cmacro name body))))) ;; (args ;; (emit-define-cfunclike-macro name args body)) ;; (else ;; #f)))) ;; (define (parse-macro-code in macro-list) ;; (define (skip line) ;; (cond ;; ((eof-object? line) ;; #f) ;; ((eq? (string-size line) 0) ;; (skip (read-line in #t))) ;; ((not (eq? (string-byte-ref line 0) 35)) ;; '#' != 35 (ASCII) ;; (skip (read-line in #t))) ;; ((string-incomplete? line) ;; (skip (read-line in #t))) ;; ((string=? line "# 1 \"\"") ;; (parse (read-line in #t))) ;; (else ;; (skip (read-line in #t))))) ;; (define (parse line) ;; (cond ;; ((eof-object? line) ;; #f) ;; ((null? macro-list) ;; (error "[bug] lost macro body")) ;; (else ;; (let ((pos&name&args (cdr (pop! macro-list)))) ;; (filename-set! (caar pos&name&args)) ;; (lineno-set! (cdar pos&name&args)) ;; (parse-macro-body (cadr pos&name&args) ;; (cddr pos&name&args) ;; line)) ;; (parse (read-line in #t))))) ;; ;; skip the first line '# 1 ""' ;; (read-line in #t) ;; (skip (read-line in #t))) ;; (define (parse-macro include-dirs headers options) ;; (unwind-protect ;; (guard (e (( e) ;; (let ((errmsg (make-error-message (condition-ref e 'message)))) ;; (print-current-line) ;; (display errmsg (current-error-port)) ;; (newline (current-error-port)) ;; (raise e))) ;; (else ;; (let ((errmsg (make-error-message e))) ;; (print-current-line) ;; (display errmsg (current-error-port)) ;; (newline (current-error-port)) ;; (raise e)))) ;; (call-with-gcc-io include-dirs headers options ;; (lambda (in out) ;; (let ((identifier-queue (make-queue))) ;; (for-each (lambda (macro-def) ;; (display (car macro-def) out) ;; (newline out) ;; (enqueue! identifier-queue (cdr macro-def))) ;; (queue->list (macro-queue))) ;; (close-output-port out) ;; (parse-macro-code in identifier-queue))) ;; :show-define? #f)) ;; (start-macro-reset!))) (define (parse-macro include-dirs headers options) (unwind-protect (guard (e (( e) (let ((errmsg (make-error-message (condition-ref e 'message)))) (print-current-line) (display errmsg (current-error-port)) (newline (current-error-port)) (raise e))) (else (let ((errmsg (make-error-message e))) (print-current-line) (display errmsg (current-error-port)) (newline (current-error-port)) (raise e)))) (call-with-gcc-io include-dirs headers options (lambda (in out) (let ((macro-list (queue->list (macro-queue)))) (for-each (lambda (macro-def) (display (car macro-def) out) (newline out)) macro-list) (close-output-port out) (parse-macro-code in macro-list))) :show-define? #f)) (start-macro-reset!))) (define (parse-source-code) (parse-from-port (current-input-port) report-parse-error)) (define (parse-source include-dirs headers options) (call-with-gcc-io include-dirs headers options (lambda (in out) (close-output-port out) (with-input-from-port in parse-source-code)))) (define (need-import? defchunk import-cond) (let ((id (defchunk-identifier defchunk))) (cond ((regexp? import-cond) (rxmatch import-cond (symbol->string id))) ((is-a? import-cond ) (find (cut need-import? defchunk <>) import-cond)) ((symbol? import-cond) (eq? id import-cond)) ((string? import-cond) (string=? (symbol->string id) import-cond)) ((procedure? import-cond) (apply import-cond (list (defchunk-filename defchunk) id))) (else (errorf "~s can't be used for :import argument." import-cond))))) (define (c-parse include-dirs headers options import-arg export? sandbox hides) (with-parse-context (lambda () (parse-source include-dirs headers options) (parse-macro include-dirs headers options) (let ((export-syms (if import-arg (let ((syms '())) (defchunk-dict-set-mark! (lambda (defchunk) (let ((result (need-import? defchunk import-arg))) (when result (for-each (lambda (sym) (push! syms sym)) (defchunk-symbol-list defchunk))) result))) syms) #f))) (defchunk-dict-for-each (if (module? sandbox) #f sandbox) (not import-arg)) (if (module? sandbox) (bridge-symbols sandbox export-syms hides) (sandbox (cons 'export ((with-module srfi-1 remove) (cut memq <> hides) (or export-syms (defchunk-dict-all-symbols)))))))))) (provide "c-wrapper/c-parser") gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/config.scm.in0000644000000000000000000000330511237307544017530 0ustar ;; -*- coding: utf-8; mode: scheme -*- (define-module c-wrapper.config (use gauche.process) (use file.util) (use srfi-13) (export GCC DYLIBEXT libname-prefix-list ignore-libname-list ignore-library-list force-load-library-when-compiledlib-exists? ld-library-paths sys-library-paths search-library-with-ldconfig )) (select-module c-wrapper.config) (define GCC "@CC@") (define DYLIBEXT "@DYLIBEXT@") (define libname-prefix-list '("lib")) (define ignore-libname-list '()) (define ignore-library-list '()) (define force-load-library-when-compiledlib-exists? #f) (when @CYGWIN_FLAG@ (set! libname-prefix-list (append libname-prefix-list (list "cyg" ""))) (set! ignore-libname-list (append ignore-libname-list '("c" "m"))) (set! ignore-library-list (append ignore-library-list '("libc" "libm"))) (set! force-load-library-when-compiledlib-exists? #t)) (define sys-library-paths (let ((paths (string-split "@SYS_LIBRARY_PATHS@" #[\s]))) (lambda () paths))) (define (ld-library-paths) (apply append (map (lambda (env) (or (and-let* ((paths (sys-getenv env))) (string-split paths ":")) '())) '(@LD_LIBRARY_PATH_ENVS@)))) (define (search-library-with-ldconfig lib) (let ((ldconfig-cmd "@LDCONFIG_CMD@")) (and (< 0 (string-length ldconfig-cmd)) (find (lambda (pathname) (string-prefix? (path-swap-extension lib DYLIBEXT) (sys-basename pathname))) (process-output->string-list ldconfig-cmd))))) (provide "c-wrapper/config") gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/context.scm0000644000000000000000000000451311237307544017344 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; context.scm - Parser context ;; ;; Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; (define-module c-wrapper.context (use util.queue) (use util.match) (export-all) ) (select-module c-wrapper.context) (define-class () ((macro-queue :init-form (make-queue)) )) (define context #f) (define-macro (define-context-accessor name) `(define-syntax ,name (syntax-rules () ((_) (slot-ref context ',name)) ((_ val) (slot-set! context ',name val))))) (define-context-accessor macro-queue) (define (warning fmt . args) (apply format (standard-error-port) (string-append "Warning: " fmt "~%") args)) (provide "c-wrapper/context") ;; end of file gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/objc-ffi.scm0000644000000000000000000000013311237307544017331 0ustar ;; This is a dummy module. (define-module c-wrapper.objc-ffi (extend c-wrapper.c-ffi)) gauche-c-wrapper-0.6.1.orig/lib/c-wrapper/stubgen.scm.in0000644000000000000000000006467111237307544017747 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; stubgen.scm - stub generator ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; $Id: $ ;; (define-module c-wrapper.stubgen (use srfi-1) (use srfi-13) (use gauche.parameter) (use gauche.process) (use gauche.parseopt) (use file.util) (use util.match) (use c-wrapper.c-parser) (use @STUBGEN_FFI_MODULE@) (use text.tr) (export compile-wrapper) ) (select-module c-wrapper.stubgen) (define (listize obj) (if (list? obj) (cond ((null? obj) obj) ((eq? (car obj) 'quote) (cadr obj)) (else obj)) (list obj))) (define *dummy-line* "/**/") ;; from genstub.scm (define (get-c-name prefix scheme-name) (with-output-to-string (lambda () (display (x->string prefix)) (with-input-from-string (x->string scheme-name) (lambda () (let loop ((c (read-char))) (unless (eof-object? c) (case c ((#\-) (let ((d (read-char))) (cond ((eof-object? d) (display #\_)) ((eqv? d #\>) (display "_TO") (loop (read-char))) (else (display #\_) (loop d))))) ((#\?) (display #\P) (loop (read-char))) ((#\!) (display #\X) (loop (read-char))) ((#\<) (display "_LT") (loop (read-char))) ((#\>) (display "_GT") (loop (read-char))) ((#\* #\> #\@ #\$ #\% #\^ #\& #\* #\+ #\= #\: #\. #\/ #\~) (display #\_) (display (number->string (char->integer c) 16)) (loop (read-char))) (else (display c) (loop (read-char))) )))) ) ) ) ) (define stub-unit (make-parameter #f)) (define-class () ((stub-file :init-keyword :stub-file :init-value #f) (header-comments :init-value '()) (footer-comments :init-value '()) (includes :init-value '()) (embedding-c-codes :init-value '()) (define-cprocs :init-value '()) (define-symbols :init-value '()) (initcodes :init-value '()) (value-table :init-form (make-hash-table)) (symbol-table :init-form (make-hash-table)) (string-table :init-form (make-hash-table 'string=?)) (memoise-table :init-form (make-hash-table 'equal?)) (cproc-table :init-form (make-hash-table)))) (define (make-stub-unit stub-file) (let ((unit (make :stub-file stub-file))) (parameterize ((stub-unit unit)) (emit-header-comment #`";;;") (emit-header-comment #`";;; ,(slot-ref unit 'stub-file)") (emit-header-comment #`";;;") (emit-include "stdlib.h") (emit-include "gauche.h") (emit-include "gauche/extend.h") (emit-include "gauche/uvector.h") (let ((cname (get-c-name "" (path-sans-extension stub-file)))) (emit-c-code "/* Hack for initialization stub */") (emit-c-code "static void internal_init(ScmModule*);") (emit-c-code "static ScmObj __c_wrapper_mod;") (emit-c-code "static ScmObj __sandbox_mod;") (emit-c-code #`"void Scm_Init_,|cname|(void)") (emit-c-code #`"{") (emit-c-code #`" SCM_INIT_EXTENSION(,|cname|);") (emit-c-code #`" __c_wrapper_mod = Scm_ApplyRec0(Scm_GlobalVariableRef(SCM_FIND_MODULE(\"c-wrapper.c-ffi\",, FALSE),, SCM_SYMBOL(SCM_INTERN(\"ffi-sandbox-module\")),, FALSE));") (emit-c-code #`" __sandbox_mod = Scm_ApplyRec0(Scm_GlobalVariableRef(SCM_FIND_MODULE(\"c-wrapper\",, FALSE),, SCM_SYMBOL(SCM_INTERN(\"sandbox-module\")),, FALSE));") (emit-c-code #`" internal_init(SCM_MODULE(__c_wrapper_mod));") (emit-c-code #`"}") (emit-c-code #`"#define Scm_Init_,|cname| internal_init")) ;; define helper functions (emit-c-code "#define INIT_SYMVAL(var, sym) if (!var) { var = Scm_GlobalVariableRef(SCM_MODULE(__c_wrapper_mod), SCM_SYMBOL(SCM_INTERN(sym)), FALSE); }") (emit-c-code "static ScmObj cw_boxvar(ScmObj klass, void *varptr)") (emit-c-code "{") (emit-c-code " static ScmObj make_proc = NULL;") (emit-c-code " static ScmObj csizeof_proc = NULL;") (emit-c-code " ScmObj obj;") (emit-c-code " ScmObj buf;") (emit-c-code " size_t size;") (emit-c-code " INIT_SYMVAL(make_proc, \"make\");") (emit-c-code " INIT_SYMVAL(csizeof_proc, \"c-sizeof\");") (emit-c-code " size = Scm_GetIntegerU(Scm_ApplyRec1(csizeof_proc, klass));") (emit-c-code " buf = Scm_MakeU8VectorFromArrayShared(size, varptr);") (emit-c-code " obj = Scm_ApplyRec3(make_proc, klass, SCM_MAKE_KEYWORD(\"buffer\"), buf);") (emit-c-code " SCM_RETURN(obj);") (emit-c-code "}") (emit-c-code "static void cw_unbox(void *dest, ScmObj obj, size_t size)") (emit-c-code "{") (emit-c-code " static ScmObj bufferof_proc = NULL;") (emit-c-code " ScmObj buf;") (emit-c-code " if (!bufferof_proc) {") (emit-c-code " bufferof_proc = Scm_GlobalVariableRef(SCM_FIND_MODULE(\"c-wrapper.c-ffi\", FALSE), SCM_SYMBOL(SCM_INTERN(\"buffer-of\")), FALSE);") (emit-c-code " }") (emit-c-code " buf = Scm_ApplyRec1(bufferof_proc, obj);") (emit-c-code " memcpy(dest, SCM_UVECTOR_ELEMENTS(buf), size);") (emit-c-code "}") (emit-footer-comment ";; Local variables:") (emit-footer-comment ";; mode: scheme") (emit-footer-comment ";; end:")) unit)) (define-method emit-header-comment ((comment )) (slot-push! (stub-unit) 'header-comments comment)) (define-method emit-footer-comment ((comment )) (slot-push! (stub-unit) 'footer-comments comment)) (define-method emit-include ((header-file )) (slot-push! (stub-unit) 'includes header-file)) (define-method emit-c-code ((c-code )) (slot-push! (stub-unit) 'embedding-c-codes c-code)) (define-method emit-define-cproc ((name ) ret-type (arg-types ) (args ) (body )) (cond ((hash-table-exists? (slot-ref (stub-unit) 'cproc-table) name) ;; DO NOTHING #t) (else (slot-push! (stub-unit) 'define-cprocs (with-output-to-string (lambda () (format #t "(define-cproc ~a ~a" name args) (let ((bodies (string-split body #[\x0d\x0a]))) (format #t "~% (code ~s" (car bodies)) (for-each (cut format #t "~% ~s" <>) (cdr bodies)) (format #t "))~%"))))) (hash-table-put! (slot-ref (stub-unit) 'cproc-table) name (cons ret-type arg-types))))) (define-method emit-define-symbol ((name ) (varnam )) (slot-push! (stub-unit) 'define-symbols (format "(define-symbol ~a \"~a\")" name varnam))) (define-method emit-initcode ((c-code )) (slot-push! (stub-unit) 'initcodes c-code)) (define (write-stub dir) (with-output-to-file (build-path dir (slot-ref (stub-unit) 'stub-file)) (lambda () (for-each print (reverse (slot-ref (stub-unit) 'header-comments))) (for-each (cut format #t "\"#include \\\"~a\\\"\"~%" <>) (reverse (slot-ref (stub-unit) 'includes))) (for-each (cut format #t "~s~%" <>) (reverse (slot-ref (stub-unit) 'embedding-c-codes))) (for-each print (reverse (slot-ref (stub-unit) 'define-symbols))) (for-each print (reverse (slot-ref (stub-unit) 'define-cprocs))) (for-each (lambda (line) (unless (string=? line *dummy-line*) (format #t "(initcode ~s)~%" (string-append line ";")))) (reverse (slot-ref (stub-unit) 'initcodes))) (for-each print (reverse (slot-ref (stub-unit) 'footer-comments)))))) ;; (define (classname->ctype sym) (match sym (('c-struct ('quote nam)) #`"struct ,nam") (('c-union ('quote nam)) #`"union ,nam") ((('with-module 'c-wrapper.c-ffi 'ptr) type) "void*") (('c-array type num) "void*") (('c-func-ptr ret-type ('list ('list nam arg-type) ...)) "void*") (('c-func-ptr ret-type ('list arg-type ...)) "void*") (' "char") (' "unsigned char") (' "short") (' "unsigned short") (' "int") (' "unsigned int") (' "long") (' "unsigned long") (' "long long") (' "unsigned long long") (' "float") (' "double") (' "long double") (' "void") ((= (lambda (sym) (#/^<(.*)>$/ (x->string sym))) rmatch) (if rmatch (rmatch 1) (errorf "Unknown type ~a" sym))))) (define-method emit-define-cproc ((name ) ret-type (arg-types )) (let* ((narg-types (remove (cut equal? ' <>) arg-types)) (ret-ctype (classname->ctype ret-type)) (narg-ctypes (map classname->ctype narg-types)) (arg-objs (map (cut format "obj~a" <>) (iota (length narg-types)))) (arg-vars (map (cut format "v~a" <>) (iota (length narg-types)))) (body (with-output-to-string (lambda () (for-each (cut format #t "~a ~a;~%" <> <>) narg-ctypes arg-vars) (for-each (lambda (var obj type) (format #t "cw_unbox(&~a, ~a, sizeof(~a));~%" var (ccode-eval `((with-module c-wrapper.c-ffi cast) ,type (cexpr ,(string->symbol obj)))) var)) arg-vars arg-objs narg-types) (cond ((equal? ' ret-type) (format #t "(~a)(~a);~%" name (string-join arg-vars ",")) (format #t "SCM_RETURN(SCM_UNDEFINED);")) (else (format #t "{~%") (format #t " ~a *result_buf = SCM_NEW2(~a*, sizeof(~a));~%" ret-ctype ret-ctype ret-ctype) (format #t " *result_buf = (~a) (~a)(~a);~%" ret-ctype name (string-join arg-vars ",")) (format #t " SCM_RETURN(~a);~%" (ccode-eval `(scm-cast (cexpr ,(format "cw_boxvar(~a, result_buf)" (ccode-eval ret-type)))))) (format #t "}"))))))) (emit-define-cproc name ret-type arg-types (map string->symbol arg-objs) body))) (define (ccode-intern sym) (let ((symbol-table (slot-ref (stub-unit) 'symbol-table))) (symbol->string (or (hash-table-get symbol-table sym #f) (let ((varnam (gensym "__c_wrapper_"))) (emit-define-symbol sym varnam) (hash-table-put! symbol-table sym varnam) varnam))))) (define (ccode-string str) (let ((string-table (slot-ref (stub-unit) 'string-table))) (format "SCM_OBJ(&~a)" (or (hash-table-get string-table str #f) (let ((varnam (gensym "__c_wrapper_")) (len (string-length str))) (emit-c-code (format "static SCM_DEFINE_STRING_CONST(~a, ~s, ~a, ~a);" varnam str len len)) (hash-table-put! string-table str varnam) varnam))))) (define (ccode-lookup-value sym) (let ((value-table (slot-ref (stub-unit) 'value-table))) (or (hash-table-get value-table sym #f) (let ((varnam (gensym "__c_wrapper_"))) (emit-c-code (format "static ScmObj ~a; /* ~a */" varnam sym)) (emit-initcode (format "~a = Scm_SymbolValue(SCM_MODULE(__c_wrapper_mod), SCM_SYMBOL(~a))" varnam (ccode-intern sym))) (hash-table-put! value-table sym varnam) (symbol->string varnam))))) (define (ccode-define name cexpr) (let ((varnam (gensym "__c_wrapper_")) (value-table (slot-ref (stub-unit) 'value-table))) (hash-table-put! value-table name varnam) (emit-c-code (format "static ScmObj ~a; /* ~a */" varnam name)) (emit-initcode (format "~a = ~a" varnam cexpr)) (format "Scm_Define(SCM_MODULE(__c_wrapper_mod), SCM_SYMBOL(~a), ~a)" (ccode-intern name) varnam))) (define (ccode-memoise-apply proc args) (let ((memoise-table (slot-ref (stub-unit) 'memoise-table))) (symbol->string (or (hash-table-get memoise-table (cons proc args) #f) (let ((varnam (gensym "__c_wrapper_"))) (emit-c-code (format "static ScmObj ~a; /* ~a */" varnam (cons proc args))) (emit-initcode (format "~a = ~a" varnam (ccode-eval `(apply ,proc (list ,@args))))) (hash-table-put! memoise-table (cons proc args) varnam) varnam))))) (define (ccode-eval expr) (match expr ((('with-module 'c-wrapper 'define-inline-cfunc) name ret-type _ (arg-types ...) _ ...) (emit-define-cproc name ret-type arg-types) *dummy-line*) (('define sym expr) (ccode-define sym (ccode-eval expr))) ((('with-module 'c-wrapper 'define-enum) name val) (ccode-define name (format "Scm_MakeInteger(~a)" name))) (('init-c-struct! name members) (ccode-eval `(apply init-c-struct! (list ,name ,members)))) (('init-c-union! name members) (ccode-eval `(apply init-c-union! (list ,name ,members)))) (('c-enum tagname) (ccode-eval ')) (('export symbols ...) (for-each (lambda (sym) (let ((sym-val (ccode-intern sym))) (emit-initcode (format "Scm_Define(SCM_MODULE(__sandbox_mod), SCM_SYMBOL(~a), Scm_GlobalVariableRef(SCM_MODULE(__c_wrapper_mod), SCM_SYMBOL(~a), 0))" sym-val sym-val)))) symbols) *dummy-line*) ((? symbol? x) (ccode-lookup-value x)) (#t "SCM_TRUE") (#f "SCM_FALSE") ((? string? x) (ccode-string x)) ((? fixnum? x) (format "SCM_MAKE_INT(~a)" x)) ((? number? x) (format "Scm_ReadFromCString(\"~a\")" x)) (('list) "SCM_NIL") (('list a) (apply (cut format "SCM_LIST1(~a)" <>) (map ccode-eval (cdr expr)))) (('list a b) (apply (cut format "SCM_LIST2(~a, ~a)" <> <>) (map ccode-eval (cdr expr)))) (('list a b c) (apply (cut format "SCM_LIST3(~a, ~a, ~a)" <> <> <>) (map ccode-eval (cdr expr)))) (('list a b c d) (apply (cut format "SCM_LIST4(~a, ~a, ~a, ~a)" <> <> <> <>) (map ccode-eval (cdr expr)))) (('list a b c d e) (apply (cut format "SCM_LIST5(~a, ~a, ~a, ~a, ~a)" <> <> <> <> <>) (map ccode-eval (cdr expr)))) (('list kar rest ...) (format "Scm_Cons(~a, ~a)" (ccode-eval kar) (ccode-eval `(list ,@rest)))) (('quote #f) "SCM_FALSE") (('quote name) (ccode-intern name)) (('cons kar kdr) (format "Scm_Cons(~a, ~a)" (ccode-eval kar) (ccode-eval kdr))) ((('with-module 'c-wrapper.c-ffi 'ptr) ctype) (ccode-memoise-apply '(with-module c-wrapper.c-ffi ptr) (list ctype))) (('apply proc lst) (format "Scm_ApplyRec(~a, ~a)" (ccode-eval proc) (ccode-eval lst))) ((('with-module 'c-wrapper.c-ffi 'cast) ctype val) (ccode-eval `(apply (with-module c-wrapper.c-ffi cast) (list ,ctype ,val)))) (('scm-cast val) (ccode-eval `(apply scm-cast (list ,val)))) (('c-cast val) (ccode-eval `(apply c-cast (list ,val)))) (('c-bit-field ctype n) (ccode-eval `(apply c-bit-field (list ,ctype ,n)))) (('c-array ctype size) (ccode-memoise-apply 'c-array (list ctype size))) (('c-func-ptr rettype argtypes) (ccode-memoise-apply 'c-func-ptr (list rettype argtypes))) (('c-struct ('quote name)) (ccode-eval ((with-module c-wrapper.c-ffi c-struct-symbol) name))) (('c-union ('quote name)) (ccode-eval ((with-module c-wrapper.c-ffi c-union-symbol) name))) (('make-c-func-vaargs name rettype argtypes) (ccode-memoise-apply 'make-c-func-vaargs (list name rettype argtypes))) (('cexpr expr) expr) (else (format "Scm_EvalRec(~a, SCM_OBJ(__c_wrapper_mod))" (letrec ((traverse (lambda (obj) (cond ((list? obj) `(cexpr ,(ccode-eval `(list ,@(map traverse obj))))) ((pair? obj) `(cexpr ,(ccode-eval `(cons ,(traverse (car obj)) ,(traverse (cdr obj)))))) ((symbol? obj) `(cexpr ,(ccode-eval `(quote ,obj)))) ((or (number? obj) (string? obj) (boolean? obj)) `(cexpr ,(ccode-eval obj))) (else `(cexpr ,(format "Scm_ReadFromCString(\"~s\")" obj))))))) (ccode-eval (traverse expr))))))) (define (wrapper->c headers include-dirs options import-arg export? hide) (for-each emit-include headers) (let ((lst '())) (c-parse include-dirs headers options import-arg export? (lambda (expr) (push! lst expr)) hide) (for-each (lambda (expr) (emit-initcode (ccode-eval expr))) (reverse lst)))) (define (run-command command compiled-lib headers include-dirs import-arg export? hide cppflags cflags ldflags libs verbose?) (let* ((extension (path-sans-extension compiled-lib)) (stub-file (path-swap-extension compiled-lib "stub")) (cmdlines (case command ((compile) `(("gauche-package" "compile" ,@(if verbose? '("--verbose") '()) ,#`"--cflags=,|cflags|" ,#`"--cppflags=,|cppflags|" ,#`"--ldflags=,|ldflags|" ,#`"--libs=,|libs|" ,extension ,stub-file))) ((clean) `(("gauche-package" "compile" "--clean" ,@(if verbose? '("--verbose") '()) ,extension ,stub-file) ("rm" "-f" ,stub-file)))))) (parameterize ((stub-unit (make-stub-unit stub-file))) (wrapper->c (listize headers) (listize include-dirs) (string-split cppflags #[\s]) import-arg export? hide) (write-stub (sys-dirname compiled-lib)) (for-each (lambda (cmd) (when verbose? (print (string-join cmd " "))) (run-process cmd :wait #t)) cmdlines)))) (define (compile-wrapper filename command cflags-arg cppflags-arg ldflags-arg libs-arg verbose?) (with-input-from-file filename (lambda () (let loop ((expr (read)) (cppflags (list cppflags-arg)) (ldflags (list ldflags-arg)) (libs (list libs-arg))) (match expr ((? eof-object? v) #t) (('define-module module lst ...) (with-input-from-string (with-output-to-string (lambda () (for-each (cut format #t "~s" <>) lst))) (lambda () (loop (read) cppflags ldflags libs))) (loop (read) cppflags ldflags libs)) (('use 'objc-wrapper) (loop (read) (append cppflags (list "-ObjC")) ldflags libs)) (('c-load-framework frameworks) (loop (read) cppflags ldflags (append libs (map (lambda (fw) #`"-framework ,|fw|") (listize frameworks))))) (('c-ld keywords ...) (loop `(c-load-library () ,@keywords) cppflags ldflags libs)) (('c-load-library libs keywords ...) (let-keywords* keywords ((library-dirs '()) (option "")) (let ((ldflags&libs (fold (lambda (filename ldflags&libs) (receive (dir lib _) (decompose-path filename) (cons (append (car ldflags&libs) (if (string=? dir ".") '() (list #`"-L,|dir|"))) (append (cdr ldflags&libs) (let ((name (regexp-replace #/lib(.*)/ "\\1"))) (list #`"-l,|name|")))))) (receive (libs ldflags) (partition (cut string-prefix? "-l" <>) (string-split option #[\s])) (cons ldflags libs)) (listize libs)))) (loop (read) cppflags (append ldflags (car ldflags&libs)) (append libs (cdr ldflags&libs)))))) (('c-include headers keywords ...) (let-keywords* keywords ((include-dirs '()) (option "") (import-arg :import #f) (module #t) (export? #f) (compiled-lib #f)) (when compiled-lib (let* ((options (string-split option #[\s])) (cppflags-str (string-join (append cppflags options) " ")) (ldflags-str (string-join ldflags " ")) (libs-str (string-join libs " "))) (run-command command compiled-lib headers include-dirs (eval import-arg (current-module)) (if module #t export?) hide cppflags-str "" ldflags-str libs-str verbose?)))) (loop (read) cppflags ldflags libs)) (('c-load headers keywords ...) (let-keywords* keywords ((cflags-str :cflags "") (cflags-cmd #f) (cppflags-str :cppflags "") (cppflags-cmd #f) (ldflags-str :ldflags "") (ldflags-cmd #f) (libs-str :libs "") (libs-cmd #f) (compiled-lib #f) (module #t) (export? #f) (import-arg :import #f) (hide '())) (when compiled-lib (let ((append-cmd (lambda (flags str cmd) (string-join (append (reverse flags) (list str) (list (cond (cmd => process-output->string) (else "")))) " ")))) (run-command command compiled-lib headers '() (eval import-arg (current-module)) (if module #t export?) hide (append-cmd cppflags cppflags-str cppflags-cmd) (append-cmd '() cflags-str cflags-cmd) (append-cmd ldflags ldflags-str ldflags-cmd) (append-cmd libs libs-str libs-cmd) verbose?)))) (loop (read) cppflags ldflags libs)) (('select-module module) (loop (read) cppflags ldflags libs)) (else (loop (read) cppflags ldflags libs))))))) (provide "c-wrapper/stubgen") ;; end of file gauche-c-wrapper-0.6.1.orig/lib/c-wrapper.scm0000644000000000000000000001621011237307544015655 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; c-wrapper.scm - A generic wrapper for C libraries ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: $ (define-module c-wrapper (use srfi-1) (use srfi-13) (use gauche.process) (use gauche.parameter) (use gauche.sequence) (use file.util) (use util.match) (use gauche.vport) (use gauche.uvector) (use gauche.regexp) (use gauche.config) (use util.queue) (use c-wrapper.config) (use c-wrapper.c-parser) (extend c-wrapper.c-ffi) (export c-include c-load) ) (select-module c-wrapper) (define-syntax c-include (syntax-rules () ((_ headers . args) (%c-include (current-module) headers . args)))) (define (compiled-lib-exist? compiled-lib) (and compiled-lib (find-file-in-paths (path-swap-extension compiled-lib (gauche-config "--so-suffix")) :paths *dynamic-load-path* :pred file-is-readable?))) (define make-sandbox (let ((cnt 0)) (lambda (curmod module) (cond ((module? module) module) ((eq? module #t) (inc! cnt) (let ((m (make-module (string->symbol (format "c-wrapper.sandbox.~a" cnt))))) (eval '(export-all) m) m)) ((eq? module #f) curmod) (else (errorf ", #t or #f required, but got ~s" module)))))) (define sandbox-module (make-parameter #f)) (define (%c-include curmod headers . args) (let-keywords* args ((include-dirs '()) (option #f) (import-arg :import #f) (compiled-lib #f) (module #t) (export? #f) (output #f) (hide-symbols '())) (when (eq? module #t) (set! export? #t)) (parameterize ((sandbox-module (make-sandbox curmod module))) (cond ((compiled-lib-exist? compiled-lib) (dynamic-load compiled-lib) (when module (eval `(import ,(module-name (sandbox-module))) curmod))) (else (let ((output-list '())) (c-parse (if (list? include-dirs) include-dirs (list include-dirs)) (if (list? headers) headers (list headers)) (if option (string-split option #[\s]) '()) import-arg export? (if output (lambda (expr) (push! output-list expr)) (sandbox-module)) hide-symbols) (if output (call-with-output-file output (lambda (out) (for-each (lambda (expr) (write expr out) (newline out)) (reverse output-list)))) (when module (eval `(import ,(module-name (sandbox-module))) curmod))))))))) (define (append-cmd str cmd) (string-join (append (list str) (list (cond ((list? cmd) (apply string-append (map process-output->string cmd))) (cmd => process-output->string) (else "")))) " ")) (define-macro (c-load headers . keywords) (let-keywords* keywords ((cflags "") (cflags-cmd #f) (cppflags "") (cppflags-cmd #f) (ldflags "") (ldflags-cmd #f) (libs "") (libs-cmd #f) (compiled-lib #f) (import-arg :import #f) (module #t) (export? #f) (output #f) (hide-symbols '())) (cond ((compiled-lib-exist? compiled-lib) `(begin ,(if force-load-library-when-compiledlib-exists? `(c-ld ,(string-join (list (append-cmd ldflags ldflags-cmd) (append-cmd libs libs-cmd)) " ")) #f) ((with-module c-wrapper %c-include) (current-module) '() :compiled-lib ,compiled-lib :module ,module))) (else (let* ((cpp-option (append-cmd cppflags cppflags-cmd)) (ld-option (string-join (list (append-cmd ldflags ldflags-cmd) (append-cmd libs libs-cmd)) " "))) `(begin (c-ld ,ld-option) (c-include ,headers :option ,cpp-option :import ,import-arg :output ,output :module ,module :export? ,export? :hide-symbols ,hide-symbols))))))) (define-syntax define-enum (syntax-rules () ((_ name value) (define name value)))) (define-macro (define-inline-cfunc name ret-type arg-names arg-types body) (define (make-bindings name-list type-list) (let loop ((bindings '()) (i 0) (name-rest name-list) (type-rest type-list)) (if (null? name-rest) (reverse bindings) (loop (cons `(,(car name-rest) (cast ,(car type-rest) (list-ref %args ,i))) bindings) (+ i 1) (cdr name-rest) (cdr type-rest))))) `(define (,name . %args) (scm-cast (cast ,ret-type (let ,(make-bindings arg-names arg-types) ,body))))) (define-syntax define-cfunclike-macro (syntax-rules () ((_ name args body) (define-syntax name (syntax-rules () ((_ . args) body)))))) (provide "c-wrapper") gauche-c-wrapper-0.6.1.orig/lib/Makefile.in0000644000000000000000000000246311237307544015323 0ustar # # $Id: Makefile.in 619 2009-04-12 12:26:06Z naoki $ # # General info SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ datarootdir = @datarootdir@ srcdir = @srcdir@ VPATH = $(srcdir) # These may be overridden by make invocators DESTDIR = GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@ INSTALL = @GAUCHE_INSTALL@ # Other parameters SOEXT = @SOEXT@ OBJEXT = @OBJEXT@ EXEEXT = @EXEEXT@ # Module-specific stuff PACKAGE = c-wrapper SCMFILES = c-wrapper.scm \ c-wrapper/c-lex.scm c-wrapper/c-parser.scm c-wrapper/c-ffi.scm \ c-wrapper/config.scm c-wrapper/context.scm c-wrapper/stubgen.scm GENERATED = CONFIG_GENERATED = Makefile c-wrapper/config.scm c-wrapper/stubgen.scm GAUCHE_PKGINCDIR = @GAUCHE_PKGINCDIR@ GAUCHE_PKGLIBDIR = @GAUCHE_PKGLIBDIR@ GAUCHE_PKGARCHDIR = @GAUCHE_PKGARCHDIR@ all : install : all $(INSTALL) -m 444 -T $(DESTDIR)$(GAUCHE_PKGLIBDIR) $(SCMFILES) uninstall : $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGLIBDIR) $(SCMFILES) rmdir $(DESTDIR)$(GAUCHE_PKGLIBDIR)/c-wrapper clean : rm -rf core $(GENERATED) *~ distclean : clean rm -rf $(CONFIG_GENERATED) maintainer-clean : clean rm -rf $(CONFIG_GENERATED) gauche-c-wrapper-0.6.1.orig/libffi/0002755000000000000000000000000011237307544013740 5ustar gauche-c-wrapper-0.6.1.orig/libffi/acinclude.m40000644000000000000000000000631111237307544016130 0ustar # mmap(2) blacklisting. Some platforms provide the mmap library routine # but don't support all of the features we need from it. AC_DEFUN([AC_FUNC_MMAP_BLACKLIST], [ AC_CHECK_HEADER([sys/mman.h], [libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no]) AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no]) if test "$libffi_header_sys_mman_h" != yes \ || test "$libffi_func_mmap" != yes; then ac_cv_func_mmap_file=no ac_cv_func_mmap_dev_zero=no ac_cv_func_mmap_anon=no else AC_CACHE_CHECK([whether read-only mmap of a plain file works], ac_cv_func_mmap_file, [# Add a system to this blacklist if # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a # memory area containing the same data that you'd get if you applied # read() to the same fd. The only system known to have a problem here # is VMS, where text files have record structure. case "$host_os" in vms* | ultrix*) ac_cv_func_mmap_file=no ;; *) ac_cv_func_mmap_file=yes;; esac]) AC_CACHE_CHECK([whether mmap from /dev/zero works], ac_cv_func_mmap_dev_zero, [# Add a system to this blacklist if it has mmap() but /dev/zero # does not exist, or if mmapping /dev/zero does not give anonymous # zeroed pages with both the following properties: # 1. If you map N consecutive pages in with one call, and then # unmap any subset of those pages, the pages that were not # explicitly unmapped remain accessible. # 2. If you map two adjacent blocks of memory and then unmap them # both at once, they must both go away. # Systems known to be in this category are Windows (all variants), # VMS, and Darwin. case "$host_os" in vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) ac_cv_func_mmap_dev_zero=no ;; *) ac_cv_func_mmap_dev_zero=yes;; esac]) # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon, [AC_TRY_COMPILE( [#include #include #include #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif ], [int n = MAP_ANONYMOUS;], ac_cv_decl_map_anon=yes, ac_cv_decl_map_anon=no)]) if test $ac_cv_decl_map_anon = no; then ac_cv_func_mmap_anon=no else AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], ac_cv_func_mmap_anon, [# Add a system to this blacklist if it has mmap() and MAP_ANON or # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) # doesn't give anonymous zeroed pages with the same properties listed # above for use of /dev/zero. # Systems known to be in this category are Windows, VMS, and SCO Unix. case "$host_os" in vms* | cygwin* | pe | mingw* | sco* | udk* ) ac_cv_func_mmap_anon=no ;; *) ac_cv_func_mmap_anon=yes;; esac]) fi fi if test $ac_cv_func_mmap_file = yes; then AC_DEFINE(HAVE_MMAP_FILE, 1, [Define if read-only mmap of a plain file works.]) fi if test $ac_cv_func_mmap_dev_zero = yes; then AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, [Define if mmap of /dev/zero works.]) fi if test $ac_cv_func_mmap_anon = yes; then AC_DEFINE(HAVE_MMAP_ANON, 1, [Define if mmap with MAP_ANON(YMOUS) works.]) fi ]) gauche-c-wrapper-0.6.1.orig/libffi/aclocal.m40000644000000000000000000075320011237307544015605 0ustar # 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. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # 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 And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) 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_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)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 AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH 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 # 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'] # 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' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # 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 "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # 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 case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # 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_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${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 </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then 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. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" 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="$lt_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 configure 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 fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-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* ;; 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_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) 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 ;; AC_PROVIDE_IFELSE([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) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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 ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; 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 all BSDs 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` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # 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. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = 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 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$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}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH 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. 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 can_build_shared=no fi ;; esac # 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH 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}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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" # 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 shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' 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 ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # 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' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # 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'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # 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], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # 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_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # 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], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # 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_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # 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], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # 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_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # 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_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [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]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl 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_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 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 IFS="$lt_save_ifs" 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 <&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="$lt_save_ifs" MAGIC_CMD="$lt_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_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$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_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--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([LT_AC_PROG_SED])dnl 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 $CC]) 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. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname 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 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" 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 variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /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|DragonFly)/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*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in 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_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) 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_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) 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 ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in 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*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_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* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL 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 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL 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, lt_dlinit, [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 LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # --------------- AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [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])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no 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. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $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 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = 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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=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 _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=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 _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$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' # 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) | grep "[[-]]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 "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$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' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$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) | grep "\-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 "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; 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. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.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$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # 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 _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; 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. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$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 ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # 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 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=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. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$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 ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # 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 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=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. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # 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. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$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. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | 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 ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_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=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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=$_LT_AC_TAGVAR(hardcode_action, $1) # 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=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # 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=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # 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 # 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? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # 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 an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/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 if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_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. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_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 -f conftest* cat > conftest.$ac_ext < $nlist) && 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 grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> 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" | grep -v main >> 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.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 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'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # 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). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 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'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | 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). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | 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). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # 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 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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 _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp 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'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_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= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # 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 _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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*) _LT_AC_TAGVAR(archive_cmds, $1)='$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)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II 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't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # 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 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=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 _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) _LT_AC_TAGVAR(archive_cmds, $1)='$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)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # 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. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$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. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=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*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$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' else _LT_AC_TAGVAR(archive_cmds, $1)='$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' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$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' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -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 _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) 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. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #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 # 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 */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # 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]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 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 4 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 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 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # 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 ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) gauche-c-wrapper-0.6.1.orig/libffi/ChangeLog0000644000000000000000000023254711237307544015525 0ustar 2006-02-28 Release Manager * GCC 4.1.0 released. 2006-01-18 Jakub Jelinek * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, instead do the shifting inline. * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 and 8 byte structs, for the remaining struct sizes don't call __lshrdi3, instead do the shifting inline. 2005-12-07 Thiemo Seufer * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add missing parentheses. * src/mips/o32.S (ffi_call_O32): Code formatting. Define and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, FA_0_0_OFF2. * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix endianness bugs. (ffi_prep_closure): Improve trampoline instruction scheduling. (ffi_closure_mips_inner_O32): Fix endianness bugs. 2005-09-30 Geoffrey Keating * testsuite/lib/libffi-dg.exp (libffi_target_compile): For darwin, use -shared-libgcc not -lgcc_s, and explain why. 2005-09-26 Tom Tromey * testsuite/libffi.call/float1.c (value_type): New typedef. (CANARY): New define. (main): Check for result buffer overflow. * src/powerpc/linux64.S: Handle linux64 long double returns. * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. (ffi_prep_cif_machdep): Handle linux64 long double returns. 2005-08-25 Alan Modra PR target/23404 * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack homed fp args. (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. 2005-08-11 Jakub Jelinek * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. (AH_BOTTOM): Add FFI_HIDDEN definition. * configure: Rebuilt. * fficonfig.h.in: Rebuilt. * src/powerpc/ffi.c (hidden): Remove. (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, add FFI_HIDDEN to its prototype. (ffi_closure_SYSV_inner): New. * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. 2005-08-10 Alfred M. Szmidt PR libffi/21819: * configure: Rebuilt. * configure.ac: Handle i*86-*-gnu*. 2005-08-09 Jakub Jelinek * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use DW_CFA_offset_extended_sf rather than DW_CFA_GNU_negative_offset_extended. * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. 2005-07-22 SUGIOKA Toshinobu * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly on sh3. (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is partially on register. (ffi_closure_helper_SYSV): Likewise. (ffi_prep_cif_machdep): Don't set too many cif->flags. 2005-07-20 Kaz Kojima * src/sh/ffi.c (ffi_call): Handle small structures correctly. Remove empty line. * src/sh64/ffi.c (simple_type): Remove. (return_type): Handle small structures correctly. (ffi_prep_args): Likewise. (ffi_call): Likewise. (ffi_closure_helper_SYSV): Likewise. * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. Emit position independent code if PIC and remove wrong datalabel prefixes from EH data. 2005-07-19 Andreas Tobler * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. * Makefile.in: Regenerate. * include/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * configure.ac: Add POWERPC_FREEBSD rules. * configure: Regenerate. * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. (FFI_SYSV_TYPE_SMALL_STRUCT): Define. * src/powerpc/ffi.c: Add flags to handle small structure returns in ffi_call_SYSV. (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. Aka FFI_SYSV. (ffi_closure_helper_SYSV): Likewise. * src/powerpc/ppc_closure.S: Add return types for small structures. * src/powerpc/sysv.S: Add bits to handle small structures for final SYSV 4 ABI. 2005-07-10 Andreas Tobler * testsuite/libffi.call/cls_5_1_byte.c: New test file. * testsuite/libffi.call/cls_6_1_byte.c: Likewise. * testsuite/libffi.call/cls_7_1_byte.c: Likewise. 2005-07-05 Randolph Chung * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte structures. Kill compilation warnings. (ffi_closure_inner_LINUX): Print return values as hex in debug message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. Properly handle 5-7 byte structure returns. * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) (FFI_TYPE_SMALL_STRUCT2): Remove. (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. * src/pa/linux.S: Mark source file as using PA1.1 assembly. (checksmst1, checksmst2): Remove. (checksmst3): Optimize handling of 3-byte struct returns. (checksmst567): Properly handle 5-7 byte struct returns. 2005-06-15 Rainer Orth PR libgcj/21943 * src/mips/n32.S: Enforce PIC code. * src/mips/o32.S: Likewise. 2005-06-15 Rainer Orth * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64. * configure: Regenerate. 2005-06-01 Alan Modra * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET to call ffi_closure_helper_SYSV. Append @local instead. * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. 2005-05-17 Kelley Cook * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config. * aclocal.m4, configure, fficonfig.h.in, Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerate. 2005-05-09 Mike Stump * configure: Regenerate. 2005-05-08 Richard Henderson PR libffi/21285 * src/alpha/osf.S: Update unwind into to match code. 2005-05-04 Andreas Degert Richard Henderson * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in bit 11 of flags. (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. (ffi_prep_closure): Set carry bit if sse-used flag set. * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. Only load sse registers if ssecount non-zero. (ffi_closure_unix64): Only save sse registers if carry set on entry. 2005-04-29 Ralf Corsepius * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*, powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*. * configure: Regenerate. 2005-04-20 Hans-Peter Nilsson * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use, have Tcl8.3-compatible intermediate variable. 2005-04-18 Simon Posnjak Hans-Peter Nilsson * Makefile.am: Add CRIS support. * configure.ac: Likewise. * Makefile.in, configure, testsuite/Makefile.in, include/Makefile.in: Regenerate. * src/cris: New directory. * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with \r?\n in output tests. 2005-04-12 Mike Stump * configure: Regenerate. 2005-03-30 Hans Boehm * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI. 2005-03-30 Steve Ellcey * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute. (ffi_sarg) Ditto. * src/ia64/unix.S (ffi_closure_unix): Extend gp to 64 bits in ILP32 mode. Load 64 bits even for short data. 2005-03-23 Mike Stump * src/powerpc/darwin.S: Update for -m64 multilib. * src/powerpc/darwin_closure.S: Likewise. 2005-03-21 Zack Weinberg * configure.ac: Do not invoke TL_AC_GCC_VERSION. Do not set tool_include_dir. * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in: Regenerate. * include/Makefile.am: Set gcc_version and toollibffidir. * include/Makefile.in: Regenerate. 2005-02-22 Andrew Haley * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to odd-numbered register pairs for 64-bit integer types. 2005-02-23 Andreas Tobler PR libffi/20104 * testsuite/libffi.call/return_ll1.c: New test case. 2005-02-11 Janis Johnson * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options. * testsuite/libffi.call/float.c: Ditto. * testsuite/libffi.call/float2.c: Ditto. * testsuite/libffi.call/float3.c: Ditto. 2005-02-08 Andreas Tobler * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv. 2005-01-12 Eric Botcazou * testsuite/libffi.special/special.exp (cxx_options): Add -shared-libgcc. 2004-12-31 Richard Henderson * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove. (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and offset parameters with a type parameter; deduce size and structure alignment. Update all users. 2004-12-31 Richard Henderson * src/types.c (FFI_TYPE_POINTER): Define with sizeof. (FFI_TYPE_LONGDOUBLE): Fix for ia64. * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move into ffi_prep_closure. * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite from scratch. 2004-12-27 Richard Henderson * src/x86/unix64.S: Fix typo in unwind info. 2004-12-25 Richard Henderson * src/x86/ffi64.c (struct register_args): Rename from stackLayout. (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS. (merge_classes): Check for it. (SSE_CLASS_P): New. (classify_argument): Pass byte_offset by value; perform all updates inside struct case. (examine_argument): Add classes argument; handle X86_64_COMPLEX_X87_CLASS. (ffi_prep_args): Merge into ... (ffi_call): ... here. Share stack frame with ffi_call_unix64. (ffi_prep_cif_machdep): Setup cif->flags for proper structure return. (ffi_fill_return_value): Remove. (ffi_prep_closure): Remove dead assert. (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner. Rewrite to use struct register_args instead of va_list. Create flags for handling structure returns. * src/x86/unix64.S: Remove dead strings. (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share stack frame with ffi_call. Handle structure returns properly. (float2sse, floatfloat2sse, double2sse): Remove. (sse2float, sse2double, sse2floatfloat): Remove. (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite to handle structure returns properly. 2004-12-08 David Edelsohn * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and PICFLAG. * Makefile.in: Regenerated. 2004-12-02 Richard Sandiford * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. * configure, aclocal.m4, Makefile.in: Regenerate. * include/Makefile.in, testsuite/Makefile.in: Regenerate. 2004-11-29 Kelley Cook * configure: Regenerate for libtool change. 2004-11-25 Kelley Cook * configure: Regenerate for libtool reversion. 2004-11-24 Kelley Cook * configure: Regenerate for libtool change. 2004-11-23 John David Anglin * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. 2004-11-23 Richard Sandiford * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead of jal. Use an absolute encoding for the frame information. 2004-11-23 Kelley Cook * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS. * acinclude.m4: Delete logic for sincludes. * aclocal.m4, Makefile.in, configure: Regenerate. * include/Makefile: Likewise. * testsuite/Makefile: Likewise. 2004-11-22 Eric Botcazou * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers on a 8-byte boundary. * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments. 2004-10-27 Richard Earnshaw * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return long long values. Round stack allocation to a multiple of 8 bytes for ATPCS compatibility. * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register names. Handle returning long long types. Add Thumb and interworking support. Improve soft-float code. 2004-10-27 Richard Earnshaw * testsuite/lib/libffi-db.exp (load_gcc_lib): New function. (libffi_exit): New function. (libffi_init): Build the testglue wrapper if needed. 2004-10-25 Eric Botcazou PR other/18138 * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc. 2004-10-25 Kazuhiro Inaoka * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0. 2004-10-20 Kaz Kojima * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data. * testsuite/libffi.call/float3.c: New test case. 2004-10-18 Kaz Kojima * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for the function returning a structure pointed with R2. * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to the structure return value if T bit set. Emit position independent code and EH data if PIC. 2004-10-13 Kazuhiro Inaoka * Makefile.am: Add m32r support. * configure.ac: Likewise. * Makefile.in: Regenerate. * confiugre: Regenerate. * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF (uint64, sint64, double, longdouble) * src/m32r: New directory. * src/m32r/ffi.c: New file. * src/m32r/sysv.S: Likewise. * src/m32r/ffitarget.h: Likewise. 2004-10-02 Kaz Kojima * testsuite/libffi.call/negint.c: New test case. 2004-09-14 H.J. Lu PR libgcj/17465 * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path. Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH, LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and DYLD_LIBRARY_PATH. 2004-09-05 Andreas Tobler * testsuite/libffi.call/many_win32.c: Remove whitespaces. * testsuite/libffi.call/promotion.c: Likewise. * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup whitespaces. * testsuite/libffi.call/return_sc.c: Likewise. * testsuite/libffi.call/return_uc.c: Likewise. 2004-09-05 Andreas Tobler * src/powerpc/darwin.S: Fix comments and identation. * src/powerpc/darwin_closure.S: Likewise. 2004-09-02 Andreas Tobler * src/powerpc/ffi_darwin.c: Add flag for longdouble return values. (ffi_prep_args): Handle longdouble arguments. (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for longdouble. (ffi_closure_helper_DARWIN): Add closure handling for longdouble. * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble values. * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise. * src/types.c: Defined longdouble size and alignment for darwin. 2004-09-02 Andreas Tobler * src/powerpc/aix.S: Remove whitespaces. * src/powerpc/aix_closure.S: Likewise. * src/powerpc/asm.h: Likewise. * src/powerpc/ffi.c: Likewise. * src/powerpc/ffitarget.h: Likewise. * src/powerpc/linux64.S: Likewise. * src/powerpc/linux64_closure.S: Likewise. * src/powerpc/ppc_closure.S: Likewise. * src/powerpc/sysv.S: Likewise. 2004-08-30 Anthony Green * Makefile.am: Add frv support. * Makefile.in, testsuite/Makefile.in: Rebuilt. * configure.ac: Read configure.host. * configure.in: Read configure.host. * configure.host: New file. frv-elf needs libgloss. * include/ffi.h.in: Force ffi_closure to have a nice big (8) alignment. This is needed to frv and shouldn't harm the others. * include/ffi_common.h (ALIGN_DOWN): New macro. * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files. 2004-08-24 David Daney * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*. * testsuite/libffi.call/closure_fn1.c: Likewise. * testsuite/libffi.call/closure_fn2.c Likewise. * testsuite/libffi.call/closure_fn3.c: Likewise. * testsuite/libffi.call/closure_fn4.c: Likewise. * testsuite/libffi.call/closure_fn5.c: Likewise. * testsuite/libffi.call/cls_18byte.c: Likewise. * testsuite/libffi.call/cls_19byte.c: Likewise. * testsuite/libffi.call/cls_1_1byte.c: Likewise. * testsuite/libffi.call/cls_20byte.c: Likewise. * testsuite/libffi.call/cls_20byte1.c: Likewise. * testsuite/libffi.call/cls_24byte.c: Likewise. * testsuite/libffi.call/cls_2byte.c: Likewise. * testsuite/libffi.call/cls_3_1byte.c: Likewise. * testsuite/libffi.call/cls_3byte1.c: Likewise. * testsuite/libffi.call/cls_3byte2.c: Likewise. * testsuite/libffi.call/cls_4_1byte.c: Likewise. * testsuite/libffi.call/cls_4byte.c: Likewise. * testsuite/libffi.call/cls_64byte.c: Likewise. * testsuite/libffi.call/cls_6byte.c: Likewise. * testsuite/libffi.call/cls_7byte.c: Likewise. * testsuite/libffi.call/cls_8byte.c: Likewise. * testsuite/libffi.call/cls_9byte1.c: Likewise. * testsuite/libffi.call/cls_9byte2.c: Likewise. * testsuite/libffi.call/cls_align_double.c: Likewise. * testsuite/libffi.call/cls_align_float.c: Likewise. * testsuite/libffi.call/cls_align_longdouble.c: Likewise. * testsuite/libffi.call/cls_align_pointer.c: Likewise. * testsuite/libffi.call/cls_align_sint16.c: Likewise. * testsuite/libffi.call/cls_align_sint32.c: Likewise. * testsuite/libffi.call/cls_align_sint64.c: Likewise. * testsuite/libffi.call/cls_align_uint16.c: Likewise. * testsuite/libffi.call/cls_align_uint32.c: Likewise. * testsuite/libffi.call/cls_align_uint64.c: Likewise. * testsuite/libffi.call/cls_double.c: Likewise. * testsuite/libffi.call/cls_float.c: Likewise. * testsuite/libffi.call/cls_multi_schar.c: Likewise. * testsuite/libffi.call/cls_multi_sshort.c: Likewise. * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. * testsuite/libffi.call/cls_multi_uchar.c: Likewise. * testsuite/libffi.call/cls_multi_ushort.c: Likewise. * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. * testsuite/libffi.call/cls_schar.c: Likewise. * testsuite/libffi.call/cls_sint.c: Likewise. * testsuite/libffi.call/cls_sshort.c: Likewise. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/nested_struct.c: Likewise. * testsuite/libffi.call/nested_struct1.c: Likewise. * testsuite/libffi.call/nested_struct2.c: Likewise. * testsuite/libffi.call/nested_struct3.c: Likewise. * testsuite/libffi.call/problem1.c: Likewise. * testsuite/libffi.special/unwindtest.cc: Likewise. * testsuite/libffi.call/cls_12byte.c: Likewise and set return value to zero. * testsuite/libffi.call/cls_16byte.c: Likewise. * testsuite/libffi.call/cls_5byte.c: Likewise. 2004-08-23 David Daney PR libgcj/13141 * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI. * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation. (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point parameters and return types. (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI. (ffi_prep_closure): Ditto. (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix alignment calculations. * src/mips/o32.S (ffi_closure_O32): Don't use floating point instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant. 2004-08-14 Casey Marshall * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to contain `FFI_TYPE_UINT64' as return type for any 64-bit integer (O32 ABI only). (ffi_prep_closure): new function. (ffi_closure_mips_inner_O32): new function. * src/mips/ffitarget.h: Define `FFI_CLOSURES' and `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32. * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return 64 bit integers correctly. (ffi_closure_O32): new function. Added DWARF-2 unwind info for both functions. 2004-08-10 Andrew Haley * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. 2004-08-01 Robert Millan * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. * configure: Regenerate. 2004-07-30 Maciej W. Rozycki * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for and mmap() explicitly instead of relying on preset autoconf cache variables. * aclocal.m4: Regenerate. * configure: Regenerate. 2004-07-11 Ulrich Weigand * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation. (ffi_check_float_struct): Remove unused prototype. 2004-06-30 Geoffrey Keating * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment character on Darwin, use '\n\t' instead. 2004-06-26 Matthias Klose * libtool-version: Fix typo in revision/age. 2004-06-17 Matthias Klose * libtool-version: New. * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname. * Makefile.in: Regenerate. 2004-06-15 Paolo Bonzini * Makefile.am: Remove useless multilib rules. * Makefile.in: Regenerate. * aclocal.m4: Regenerate with automake 1.8.5. * configure.ac: Remove useless multilib configury. * configure: Regenerate. 2004-06-15 Paolo Bonzini * .cvsignore: New file. 2004-06-10 Jakub Jelinek * src/ia64/unix.S (ffi_call_unix): Insert group barrier break fp_done. (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever changed from 8. 2004-06-06 Sean McNeil * configure.ac: Add x86_64-*-freebsd* support. * configure: Regenerate. 2004-04-26 Joe Buck Bug 15093 * configure.ac: Test for existence of mmap and sys/mman.h before checking blacklist. Fix suggested by Jim Wilson. * configure: Regenerate. 2004-04-26 Matt Austern * src/powerpc/darwin.S: Go through a non-lazy pointer for initial FDE location. * src/powerpc/darwin_closure.S: Likewise. 2004-04-24 Andreas Tobler * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization error. Reported by Thomas Heller . * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise. * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise. 2004-03-20 Matthias Klose * src/pa/linux.S: Fix typo. 2004-03-19 Matthias Klose * Makefile.am: Update. * Makefile.in: Regenerate. * src/pa/ffi.h.in: Remove. * src/pa/ffitarget.h: New file. 2004-02-10 Randolph Chung * Makefile.am: Add PA support. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * configure.ac: Add PA target. * configure: Regenerate. * src/pa/ffi.c: New file. * src/pa/ffi.h.in: Add PA support. * src/pa/linux.S: New file. * prep_cif.c: Add PA support. 2004-03-16 Hosaka Yuji * src/types.c: Fix alignment size of X86_WIN32 case int64 and double. * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type with ecif->cif->flags. (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type with cif->flags. (ffi_prep_cif_machdep): Add X86_WIN32 struct case. (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32. * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b, sc_retstruct2b): Add for 1 or 2-bytes struct case. 2004-03-15 Kelley Cook * configure.in: Rename file to ... * configure.ac: ... this. * fficonfig.h.in: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. 2004-03-12 Matt Austern * src/powerpc/darwin.S: Fix EH information so it corresponds to changes in EH format resulting from addition of linkonce support. * src/powerpc/darwin_closure.S: Likewise. 2004-03-11 Andreas Tobler Paolo Bonzini * Makefile.am (AUTOMAKE_OPTIONS): Set them. Remove VPATH. Remove rules for object files. Remove multilib support. (AM_CCASFLAGS): Add. * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER. (AC_PREREQ): Bump version to 2.59. (AC_INIT): Fill with version info and bug address. (ORIGINAL_LD_FOR_MULTILIBS): Remove. (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE. De-precious CC so that the right flags are passed down to multilibs. (AC_MSG_ERROR): Replace obsolete macro AC_ERROR. (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES. (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS. * configure: Rebuilt. * aclocal.m4: Likewise. * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise. * fficonfig.h.in: Likewise. 2004-03-11 Andreas Schwab * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point arguments from fp registers only for the first 8 parameter slots. Don't convert a float parameter when passed in memory. 2004-03-09 Hans-Peter Nilsson * configure: Regenerate for config/accross.m4 correction. 2004-02-25 Matt Kraai * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change ecif->cif->bytes to bytes. (ffi_prep_cif_machdep): Add braces around nested if statement. 2004-02-09 Alan Modra * src/types.c (pointer): POWERPC64 has 8 byte pointers. * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling. (ffi_closure_helper_LINUX64): Fix typo. * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 for powerpc64-*-*. * testsuite/libffi.call/float.c: Likewise. * testsuite/libffi.call/float2.c: Likewise. 2004-02-08 Alan Modra * src/powerpc/ffi.c (ffi_prep_cif_machdep ): Correct long double function return and long double arg handling. (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var. Use "end_pfr" instead of "nf". Correct long double handling. Localise "temp". * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double return value. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate space for long double return value. Adjust stack frame and offsets. Load f2 long double return. 2004-02-07 Alan Modra * src/types.c: Use 16 byte long double for POWERPC64. 2004-01-25 Eric Botcazou * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array when the structure return address is passed in %o0. (ffi_V9_return_struct): Rename into ffi_v9_layout_struct. (ffi_v9_layout_struct): Align the field following a nested structure on a word boundary. Use memmove instead of memcpy. (ffi_call): Update call to ffi_V9_return_struct. (ffi_prep_closure): Define 'ctx' only for V8. (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8 and ffi_closure_sparc_inner_v9. (ffi_closure_sparc_inner_v8): Return long doubles by reference. Always skip the structure return address. For structures and long doubles, copy the argument directly. (ffi_closure_sparc_inner_v9): Skip the structure return address only if required. Shift the maximum floating-point slot accordingly. For big structures, copy the argument directly; otherwise, left-justify the argument and call ffi_v9_layout_struct to lay out the structure on the stack. * src/sparc/v8.S: Undef STACKFRAME before defining it. (ffi_closure_v8): Pass the structure return address. Update call to ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling. Skip the 'unimp' insn when returning long doubles and structures. * src/sparc/v9.S: Undef STACKFRAME before defining it. (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit FFI_TYPE_INT handling. Load structures both in integers and floating-point registers on return. * README: Update status of the SPARC port. 2004-01-24 Andreas Tobler * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value as of type ffi_arg. * testsuite/libffi.call/struct3.c (main): Fix CHECK. 2004-01-22 Ulrich Weigand * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result value as of type ffi_arg, not unsigned int. 2004-01-21 Michael Ritzert * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead of the LHS. 2004-01-12 Andreas Tobler * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for Solaris. 2004-01-08 Rainer Orth * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED to void *. 2003-12-10 Richard Henderson * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to size_t instead of int. 2003-12-04 Hosaka Yuji * testsuite/libffi.call/many_win32.c: Include . * testsuite/libffi.call/many_win32.c (main): Replace variable int i with unsigned long ul. * testsuite/libffi.call/cls_align_uint64.c: New test case. * testsuite/libffi.call/cls_align_sint64.c: Likewise. * testsuite/libffi.call/cls_align_uint32.c: Likewise. * testsuite/libffi.call/cls_align_sint32.c: Likewise. * testsuite/libffi.call/cls_align_uint16.c: Likewise. * testsuite/libffi.call/cls_align_sint16.c: Likewise. * testsuite/libffi.call/cls_align_float.c: Likewise. * testsuite/libffi.call/cls_align_double.c: Likewise. * testsuite/libffi.call/cls_align_longdouble.c: Likewise. * testsuite/libffi.call/cls_align_pointer.c: Likewise. 2003-12-02 Hosaka Yuji PR other/13221 * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Align arguments to 32 bits. 2003-12-01 Andreas Tobler PR other/13221 * testsuite/libffi.call/cls_multi_sshort.c: New test case. * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. * testsuite/libffi.call/cls_multi_uchar.c: Likewise. * testsuite/libffi.call/cls_multi_schar.c: Likewise. * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. * testsuite/libffi.call/cls_multi_ushort.c: Likewise. * testsuite/libffi.special/unwindtest.cc: Cosmetics. 2003-11-26 Kaveh R. Ghazi * testsuite/libffi.call/ffitest.h: Include . * testsuite/libffi.special/ffitestcxx.h: Likewise. 2003-11-22 Andreas Tobler * Makefile.in: Rebuilt. * configure: Likewise. * testsuite/libffi.special/unwindtest.cc: Convert the mmap to the right type. 2003-11-21 Andreas Jaeger Andreas Tobler * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST. * configure.in: Call AC_FUNC_MMAP_BLACKLIST. * Makefile.in: Rebuilt. * aclocal.m4: Likewise. * configure: Likewise. * fficonfig.h.in: Likewise. * testsuite/lib/libffi-dg.exp: Add include dir. * testsuite/libffi.call/ffitest.h: Add MMAP definitions. * testsuite/libffi.special/ffitestcxx.h: Likewise. * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality for ffi_closure if available. * testsuite/libffi.call/closure_fn1.c: Likewise. * testsuite/libffi.call/closure_fn2.c: Likewise. * testsuite/libffi.call/closure_fn3.c: Likewise. * testsuite/libffi.call/closure_fn4.c: Likewise. * testsuite/libffi.call/closure_fn5.c: Likewise. * testsuite/libffi.call/cls_12byte.c: Likewise. * testsuite/libffi.call/cls_16byte.c: Likewise. * testsuite/libffi.call/cls_18byte.c: Likewise. * testsuite/libffi.call/cls_19byte.c: Likewise. * testsuite/libffi.call/cls_1_1byte.c: Likewise. * testsuite/libffi.call/cls_20byte.c: Likewise. * testsuite/libffi.call/cls_20byte1.c: Likewise. * testsuite/libffi.call/cls_24byte.c: Likewise. * testsuite/libffi.call/cls_2byte.c: Likewise. * testsuite/libffi.call/cls_3_1byte.c: Likewise. * testsuite/libffi.call/cls_3byte1.c: Likewise. * testsuite/libffi.call/cls_3byte2.c: Likewise. * testsuite/libffi.call/cls_4_1byte.c: Likewise. * testsuite/libffi.call/cls_4byte.c: Likewise. * testsuite/libffi.call/cls_5byte.c: Likewise. * testsuite/libffi.call/cls_64byte.c: Likewise. * testsuite/libffi.call/cls_6byte.c: Likewise. * testsuite/libffi.call/cls_7byte.c: Likewise. * testsuite/libffi.call/cls_8byte.c: Likewise. * testsuite/libffi.call/cls_9byte1.c: Likewise. * testsuite/libffi.call/cls_9byte2.c: Likewise. * testsuite/libffi.call/cls_double.c: Likewise. * testsuite/libffi.call/cls_float.c: Likewise. * testsuite/libffi.call/cls_schar.c: Likewise. * testsuite/libffi.call/cls_sint.c: Likewise. * testsuite/libffi.call/cls_sshort.c: Likewise. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/nested_struct.c: Likewise. * testsuite/libffi.call/nested_struct1.c: Likewise. * testsuite/libffi.call/nested_struct2.c: Likewise. * testsuite/libffi.call/nested_struct3.c: Likewise. * testsuite/libffi.call/problem1.c: Likewise. * testsuite/libffi.special/unwindtest.cc: Likewise. 2003-11-20 Andreas Tobler * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional. 2003-11-19 Andreas Tobler * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin. Add -lgcc_s to additional flags. 2003-11-12 Andreas Tobler * configure.in, include/Makefile.am: PR libgcj/11147, install the ffitarget.h header file in a gcc versioned and target dependent place. * configure: Regenerated. * Makefile.in, include/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. 2003-11-09 Andreas Tobler * testsuite/libffi.call/closure_fn0.c: Print result and check with dg-output to make debugging easier. * testsuite/libffi.call/closure_fn1.c: Likewise. * testsuite/libffi.call/closure_fn2.c: Likewise. * testsuite/libffi.call/closure_fn3.c: Likewise. * testsuite/libffi.call/closure_fn4.c: Likewise. * testsuite/libffi.call/closure_fn5.c: Likewise. * testsuite/libffi.call/cls_12byte.c: Likewise. * testsuite/libffi.call/cls_16byte.c: Likewise. * testsuite/libffi.call/cls_18byte.c: Likewise. * testsuite/libffi.call/cls_19byte.c: Likewise. * testsuite/libffi.call/cls_1_1byte.c: Likewise. * testsuite/libffi.call/cls_20byte.c: Likewise. * testsuite/libffi.call/cls_20byte1.c: Likewise. * testsuite/libffi.call/cls_24byte.c: Likewise. * testsuite/libffi.call/cls_2byte.c: Likewise. * testsuite/libffi.call/cls_3_1byte.c: Likewise. * testsuite/libffi.call/cls_3byte1.c: Likewise. * testsuite/libffi.call/cls_3byte2.c: Likewise. * testsuite/libffi.call/cls_4_1byte.c: Likewise. * testsuite/libffi.call/cls_4byte.c: Likewise. * testsuite/libffi.call/cls_5byte.c: Likewise. * testsuite/libffi.call/cls_64byte.c: Likewise. * testsuite/libffi.call/cls_6byte.c: Likewise. * testsuite/libffi.call/cls_7byte.c: Likewise. * testsuite/libffi.call/cls_8byte.c: Likewise. * testsuite/libffi.call/cls_9byte1.c: Likewise. * testsuite/libffi.call/cls_9byte2.c: Likewise. * testsuite/libffi.call/cls_double.c: Likewise. * testsuite/libffi.call/cls_float.c: Likewise. * testsuite/libffi.call/cls_schar.c: Likewise. * testsuite/libffi.call/cls_sint.c: Likewise. * testsuite/libffi.call/cls_sshort.c: Likewise. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/problem1.c: Likewise. * testsuite/libffi.special/unwindtest.cc: Make ffi_closure static. 2003-11-08 Andreas Tobler * testsuite/libffi.call/cls_9byte2.c: New test case. * testsuite/libffi.call/cls_9byte1.c: Likewise. * testsuite/libffi.call/cls_64byte.c: Likewise. * testsuite/libffi.call/cls_20byte1.c: Likewise. * testsuite/libffi.call/cls_19byte.c: Likewise. * testsuite/libffi.call/cls_18byte.c: Likewise. * testsuite/libffi.call/closure_fn4.c: Likewise. * testsuite/libffi.call/closure_fn5.c: Likewise. * testsuite/libffi.call/cls_schar.c: Likewise. * testsuite/libffi.call/cls_sint.c: Likewise. * testsuite/libffi.call/cls_sshort.c: Likewise. * testsuite/libffi.call/nested_struct2.c: Likewise. * testsuite/libffi.call/nested_struct3.c: Likewise. 2003-11-08 Andreas Tobler * testsuite/libffi.call/cls_double.c: Do a check on the result. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/return_sc.c: Cleanup whitespaces. 2003-11-06 Andreas Tobler * src/prep_cif.c (ffi_prep_cif): Move the validity check after the initialization. 2003-10-23 Andreas Tobler * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace FFI_ASSERT(FALSE) with FFI_ASSERT(0). 2003-10-22 David Daney * src/mips/ffitarget.h: Replace undefined UINT32 and friends with __attribute__((__mode__(__SI__))) and friends. 2003-10-22 Andreas Schwab * src/ia64/ffi.c: Replace FALSE/TRUE with false/true. 2003-10-21 Andreas Tobler * configure.in: AC_LINK_FILES(ffitarget.h). * configure: Regenerate. * Makefile.in: Likewise. * include/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * fficonfig.h.in: Likewise. 2003-10-21 Paolo Bonzini Richard Henderson Avoid that ffi.h includes fficonfig.h. * Makefile.am (EXTRA_DIST): Include ffitarget.h files (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. (TARGET_SRC_MIPS_SGI): Removed. (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. (MIPS_SGI): Removed. (CLEANFILES): Removed. (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New targets. * acconfig.h: Removed. * configure.in: Compute sizeofs only for double and long double. Use them to define and subst HAVE_LONG_DOUBLE. Include comments into AC_DEFINE instead of using acconfig.h. Create include/ffitarget.h instead of include/fficonfig.h. Rename MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. AC_DEFINE EH_FRAME_FLAGS. * include/Makefile.am (DISTCLEANFILES): New automake macro. (hack_DATA): Add ffitarget.h. * include/ffi.h.in: Remove all system specific definitions. Declare raw API even if it is not installed, why bother? Use limits.h instead of SIZEOF_* to define ffi_type_*. Do not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include ffitarget.h instead of fficonfig.h. Remove ALIGN macro. (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. * include/ffi_common.h (bool): Do not define. (ffi_assert): Accept failed assertion. (ffi_type_test): Return void and accept file/line. (FFI_ASSERT): Pass stringized failed assertion. (FFI_ASSERT_AT): New macro. (FFI_ASSERT_VALID_TYPE): New macro. (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, UINT64, SINT64): Define here with gcc's __attribute__ macro instead of in ffi.h (FLOAT32, ALIGN): Define here instead of in ffi.h * include/ffi-mips.h: Removed. Its content moved to src/mips/ffitarget.h after separating assembly and C sections. * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: SIZEOF_ARG -> FFI_SIZEOF_ARG. * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). * src/debug.c (ffi_assert): Accept stringized failed assertion. (ffi_type_test): Rewritten. * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call FFI_ASSERT_VALID_TYPE. * src/alpha/ffitarget.h, src/arm/ffitarget.h, src/ia64/ffitarget.h, src/m68k/ffitarget.h, src/mips/ffitarget.h, src/powerpc/ffitarget.h, src/s390/ffitarget.h, src/sh/ffitarget.h, src/sh64/ffitarget.h, src/sparc/ffitarget.h, src/x86/ffitarget.h: New files. * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, src/powerpc/aix.S, src/powerpc/darwin.S, src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: include fficonfig.h 2003-10-20 Rainer Orth * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external _MIPS_SIM_NABI32, _MIPS_SIM_ABI32. 2003-10-19 Andreas Tobler * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again. Used when FFI_DEBUG = 1. 2003-10-14 Alan Modra * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size and align. 2003-10-06 Rainer Orth * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs, FFI_MIPS_O32 for O32 ABI. 2003-10-01 Andreas Tobler * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for SPARC64. Cleanup whitespaces. 2003-09-19 Andreas Tobler * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm, strongarm, xscale. Cleanup whitespaces. * testsuite/libffi.call/closure_fn1.c: Likewise. * testsuite/libffi.call/closure_fn2.c: Likewise. * testsuite/libffi.call/closure_fn3.c: Likewise. * testsuite/libffi.call/cls_12byte.c: Likewise. * testsuite/libffi.call/cls_16byte.c: Likewise. * testsuite/libffi.call/cls_1_1byte.c: Likewise. * testsuite/libffi.call/cls_20byte.c: Likewise. * testsuite/libffi.call/cls_24byte.c: Likewise. * testsuite/libffi.call/cls_2byte.c: Likewise. * testsuite/libffi.call/cls_3_1byte.c: Likewise. * testsuite/libffi.call/cls_3byte1.c: Likewise. * testsuite/libffi.call/cls_3byte2.c: Likewise. * testsuite/libffi.call/cls_4_1byte.c: Likewise. * testsuite/libffi.call/cls_4byte.c: Likewise. * testsuite/libffi.call/cls_5byte.c: Likewise. * testsuite/libffi.call/cls_6byte.c: Likewise. * testsuite/libffi.call/cls_7byte.c: Likewise. * testsuite/libffi.call/cls_8byte.c: Likewise. * testsuite/libffi.call/cls_double.c: Likewise. * testsuite/libffi.call/cls_float.c: Likewise. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/nested_struct.c: Likewise. * testsuite/libffi.call/nested_struct1.c: Likewise. * testsuite/libffi.call/problem1.c: Likewise. * testsuite/libffi.special/unwindtest.cc: Likewise. * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces. 2003-09-18 David Edelsohn * src/powerpc/aix.S: Cleanup whitespaces. * src/powerpc/aix_closure.S: Likewise. 2003-09-18 Andreas Tobler * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting. * src/powerpc/darwin_closure.S: Likewise. * src/powerpc/ffi_darwin.c: Likewise. 2003-09-18 Andreas Tobler David Edelsohn * src/types.c (double): Add AIX and Darwin to the right TYPEDEF. * src/powerpc/aix_closure.S: Remove the pointer to the outgoing parameter stack. * src/powerpc/darwin_closure.S: Likewise. * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures according to the Darwin/AIX ABI. (ffi_prep_cif_machdep): Likewise. (ffi_closure_helper_DARWIN): Likewise. Remove the outgoing parameter stack logic. Simplify the evaluation of the different CASE types. (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch statement in the trampoline code. 2003-09-18 Kaz Kojima * src/sh/ffi.c (ffi_prep_args): Take account into the alignement for the register size. (ffi_closure_helper_SYSV): Handle the structure return value address correctly. (ffi_closure_helper_SYSV): Return the appropriate type when the registers are used for the structure return value. * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for the 64-bit return value. Update copyright years. 2003-09-17 Rainer Orth * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in srcdir for ffi_mips.h. 2003-09-12 Alan Modra * src/prep_cif.c (initialize_aggregate): Include tail padding in structure size. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct placement of float result. * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct cast of "resp" for big-endian 64 bit machines. 2003-09-11 Alan Modra * src/types.c (double, longdouble): Merge identical SH and ARM typedefs, and add POWERPC64. * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for struct split over gpr and rest. (ffi_prep_cif_machdep): Correct intarg_count for structures. * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. 2003-09-09 Andreas Tobler * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct passing correctly. 2003-09-09 Alan Modra * configure: Regenerate. 2003-09-04 Andreas Tobler * Makefile.am: Remove build rules for ffitest. * Makefile.in: Rebuilt. 2003-09-04 Andreas Tobler * src/java_raw_api.c: Include to fix compiler warning about implicit declaration of abort(). 2003-09-04 Andreas Tobler * Makefile.am: Add dejagnu test framework. Fixes PR other/11411. * Makefile.in: Rebuilt. * configure.in: Add dejagnu test framework. * configure: Rebuilt. * testsuite/Makefile.am: New file. * testsuite/Makefile.in: Built * testsuite/lib/libffi-dg.exp: New file. * testsuite/config/default.exp: Likewise. * testsuite/libffi.call/call.exp: Likewise. * testsuite/libffi.call/ffitest.h: Likewise. * testsuite/libffi.call/closure_fn0.c: Likewise. * testsuite/libffi.call/closure_fn1.c: Likewise. * testsuite/libffi.call/closure_fn2.c: Likewise. * testsuite/libffi.call/closure_fn3.c: Likewise. * testsuite/libffi.call/cls_1_1byte.c: Likewise. * testsuite/libffi.call/cls_3_1byte.c: Likewise. * testsuite/libffi.call/cls_4_1byte.c: Likewise. * testsuite/libffi.call/cls_2byte.c: Likewise. * testsuite/libffi.call/cls_3byte1.c: Likewise. * testsuite/libffi.call/cls_3byte2.c: Likewise. * testsuite/libffi.call/cls_4byte.c: Likewise. * testsuite/libffi.call/cls_5byte.c: Likewise. * testsuite/libffi.call/cls_6byte.c: Likewise. * testsuite/libffi.call/cls_7byte.c: Likewise. * testsuite/libffi.call/cls_8byte.c: Likewise. * testsuite/libffi.call/cls_12byte.c: Likewise. * testsuite/libffi.call/cls_16byte.c: Likewise. * testsuite/libffi.call/cls_20byte.c: Likewise. * testsuite/libffi.call/cls_24byte.c: Likewise. * testsuite/libffi.call/cls_double.c: Likewise. * testsuite/libffi.call/cls_float.c: Likewise. * testsuite/libffi.call/cls_uchar.c: Likewise. * testsuite/libffi.call/cls_uint.c: Likewise. * testsuite/libffi.call/cls_ulonglong.c: Likewise. * testsuite/libffi.call/cls_ushort.c: Likewise. * testsuite/libffi.call/float.c: Likewise. * testsuite/libffi.call/float1.c: Likewise. * testsuite/libffi.call/float2.c: Likewise. * testsuite/libffi.call/many.c: Likewise. * testsuite/libffi.call/many_win32.c: Likewise. * testsuite/libffi.call/nested_struct.c: Likewise. * testsuite/libffi.call/nested_struct1.c: Likewise. * testsuite/libffi.call/pyobjc-tc.c: Likewise. * testsuite/libffi.call/problem1.c: Likewise. * testsuite/libffi.call/promotion.c: Likewise. * testsuite/libffi.call/return_ll.c: Likewise. * testsuite/libffi.call/return_sc.c: Likewise. * testsuite/libffi.call/return_uc.c: Likewise. * testsuite/libffi.call/strlen.c: Likewise. * testsuite/libffi.call/strlen_win32.c: Likewise. * testsuite/libffi.call/struct1.c: Likewise. * testsuite/libffi.call/struct2.c: Likewise. * testsuite/libffi.call/struct3.c: Likewise. * testsuite/libffi.call/struct4.c: Likewise. * testsuite/libffi.call/struct5.c: Likewise. * testsuite/libffi.call/struct6.c: Likewise. * testsuite/libffi.call/struct7.c: Likewise. * testsuite/libffi.call/struct8.c: Likewise. * testsuite/libffi.call/struct9.c: Likewise. * testsuite/libffi.special/special.exp: New file. * testsuite/libffi.special/ffitestcxx.h: Likewise. * testsuite/libffi.special/unwindtest.cc: Likewise. 2003-08-13 Kaz Kojima * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update copyright years. 2003-08-02 Alan Modra * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc structure passing. (ffi_closure_helper_LINUX64): Likewise. * src/powerpc/linux64.S: Remove code writing to parm save area. * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return address in lr from ffi_closure_helper_LINUX64 call to calculate table address. Optimize function tail. 2003-07-28 Andreas Tobler * src/sparc/ffi.c: Handle all floating point registers. * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. 2003-07-11 Gerald Pfeifer * README: Note that libffi is not part of GCC. Update the project URL and status. 2003-06-19 Franz Sirl * src/powerpc/ppc_closure.S: Include ffi.h. 2003-06-13 Rainer Orth * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives. Use C style comments. 2003-06-13 Kaz Kojima * Makefile.am: Add SHmedia support. Fix a typo of SH support. * Makefile.in: Regenerate. * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target. * configure: Regenerate. * include/ffi.h.in: Add SHmedia support. * src/sh64/ffi.c: New file. * src/sh64/sysv.S: New file. 2003-05-16 Jakub Jelinek * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section should be read-only. * configure: Rebuilt. * fficonfig.h.in: Rebuilt. * include/ffi.h.in (EH_FRAME_FLAGS): Define. * src/alpha/osf.S: Use EH_FRAME_FLAGS. * src/powerpc/linux64.S: Likewise. * src/powerpc/linux64_closure.S: Likewise. Include ffi.h. * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding if -fpic/-fPIC/-mrelocatable. * src/powerpc/powerpc_closure.S: Likewise. * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include #write in .eh_frame flags. * src/sparc/v9.S: Likewise. * src/x86/unix64.S: Use EH_FRAME_FLAGS. * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC. * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h. 2003-05-07 Jeff Sturm Fixes PR bootstrap/10656 * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler support for .register pseudo-op. * src/sparc/v8.S: Use it. * fficonfig.h.in: Rebuilt. * configure: Rebuilt. 2003-04-18 Jakub Jelinek * include/ffi.h.in (POWERPC64): Define if 64-bit. (enum ffi_abi): Add FFI_LINUX64 on POWERPC. Make it the default on POWERPC64. (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64. * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*. * configure: Rebuilt. * src/powerpc/ffi.c (hidden): Define. (ffi_prep_args_SYSV): Renamed from ffi_prep_args. Cast pointers to unsigned long to shut up warnings. (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64, ASM_NEEDS_REGISTERS64): New. (ffi_prep_args64): New function. (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI. (ffi_call): Likewise. (ffi_prep_closure): Likewise. (flush_icache): Surround by #ifndef POWERPC64. (ffi_dblfl): New union type. (ffi_closure_helper_SYSV): Use it to avoid aliasing problems. (ffi_closure_helper_LINUX64): New function. * src/powerpc/ppc_closure.S: Surround whole file by #ifndef __powerpc64__. * src/powerpc/sysv.S: Likewise. (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV. * src/powerpc/linux64.S: New file. * src/powerpc/linux64_closure.S: New file. * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and src/powerpc/linux64_closure.S. (TARGET_SRC_POWERPC): Likewise. * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2, closure_test_fn3): Fix result printing on big-endian 64-bit machines. (main): Print tst2_arg instead of uninitialized tst2_result. * src/ffitest.c (main): Hide what closure pointer really points to from the compiler. 2003-04-16 Richard Earnshaw * configure.in (arm-*-netbsdelf*): Add configuration. (configure): Regenerated. 2003-04-04 Loren J. Rittle * include/Makefile.in: Regenerate. 2003-03-21 Zdenek Dvorak * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 bit mode. * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Receive closure pointer through parameter, read args using __builtin_dwarf_cfa. (FFI_INIT_TRAMPOLINE): Send closure reference through eax. 2003-03-12 Andreas Schwab * configure.in: Avoid trailing /. in toolexeclibdir. * configure: Rebuilt. 2003-03-03 Andreas Tobler * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries. 2003-02-06 Andreas Tobler * libffi/src/powerpc/darwin_closure.S: Fix alignement bug, allocate 8 bytes for the result. * libffi/src/powerpc/aix_closure.S: Likewise. * libffi/src/powerpc/ffi_darwin.c: Update stackframe description for aix/darwin_closure.S. 2003-02-06 Jakub Jelinek * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility attribute. 2003-01-31 Christian Cornelssen , Andreas Schwab * configure.in: Adjust command to source config-ml.in to account for changes to the libffi_basedir definition. (libffi_basedir): Remove ${srcdir} from value and include trailing slash if nonempty. * configure: Regenerate. 2003-01-29 Franz Sirl * src/powerpc/ppc_closure.S: Recode to fit shared libs. 2003-01-28 Andrew Haley * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. * src/x86/ffi64.c (ffi_prep_closure): New. (ffi_closure_UNIX64_inner): New. * src/x86/unix64.S (ffi_closure_UNIX64): New. 2003-01-27 Alexandre Oliva * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. Remove USE_LIBDIR conditional. * Makefile.am (toolexecdir, toolexeclibdir): Don't override. * Makefile.in, configure: Rebuilt. 2003-01027 David Edelsohn * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo. * Makefile.in: Regenerate. 2003-01-22 Andrew Haley * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to unwind info. 2003-01-21 Andreas Tobler * src/powerpc/darwin.S: Add unwind info. * src/powerpc/darwin_closure.S: Likewise. 2003-01-14 Andrew Haley * src/x86/ffi64.c (ffi_prep_args): Check for void retval. (ffi_prep_cif_machdep): Likewise. * src/x86/unix64.S: Add unwind info. 2003-01-14 Andreas Jaeger * src/ffitest.c (main): Only use ffi_closures if those are supported. 2003-01-13 Andreas Tobler * libffi/src/ffitest.c add closure testcases 2003-01-13 Kevin B. Hendricks * libffi/src/powerpc/ffi.c fix alignment bug for float (4 byte aligned iso 8 byte) 2003-01-09 Geoffrey Keating * src/powerpc/ffi_darwin.c: Remove RCS version string. * src/powerpc/darwin.S: Remove RCS version string. 2003-01-03 Jeff Sturm * include/ffi.h.in: Add closure defines for SPARC, SPARC64. * src/ffitest.c (main): Use static storage for closure. * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. * src/sparc/v8.S (ffi_closure_v8): New. * src/sparc/v9.S (ffi_closure_v9): New. 2002-11-10 Ranjit Mathew * include/ffi.h.in: Added FFI_STDCALL ffi_type enumeration for X86_WIN32. * src/x86/win32.S: Added ffi_call_STDCALL function definition. * src/x86/ffi.c (ffi_call/ffi_raw_call): Added switch cases for recognising FFI_STDCALL and calling ffi_call_STDCALL if target is X86_WIN32. * src/ffitest.c (my_stdcall_strlen/stdcall_many): stdcall versions of the "my_strlen" and "many" test functions (for X86_WIN32). Added test cases to test stdcall invocation using these functions. 2002-12-02 Kaz Kojima * src/sh/sysv.S: Add DWARF2 unwind info. 2002-11-27 Ulrich Weigand * src/s390/sysv.S (.eh_frame section): Make section read-only. 2002-11-26 Jim Wilson * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. 2002-11-23 H.J. Lu * acinclude.m4: Add dummy AM_PROG_LIBTOOL. Include ../config/accross.m4. * aclocal.m4; Rebuild. * configure: Likewise. 2002-11-15 Ulrich Weigand * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. 2002-11-11 DJ Delorie * configure.in: Look for common files in the right place. 2002-10-08 Ulrich Weigand * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret raw data as _Jv_word values, not ffi_raw. (ffi_java_ptrarray_to_raw): Likewise. (ffi_java_rvalue_to_raw): New function. (ffi_java_raw_call): Call it. (ffi_java_raw_to_rvalue): New function. (ffi_java_translate_args): Call it. * src/ffitest.c (closure_test_fn): Interpret return value as ffi_arg, not int. * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing FFI_TYPE_POINTER case. (ffi_closure_helper_SYSV): Likewise. Also, assume return values extended to word size. 2002-10-02 Andreas Jaeger * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. 2002-10-01 Bo Thorsen * include/ffi.h.in: Fix i386 win32 compilation. 2002-09-30 Ulrich Weigand * configure.in: Add s390x-*-linux-* target. * configure: Regenerate. * include/ffi.h.in: Define S390X for s390x targets. (FFI_CLOSURES): Define for s390/s390x. (FFI_TRAMPOLINE_SIZE): Likewise. (FFI_NATIVE_RAW_API): Likewise. * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. * src/s390/ffi.c: Major rework of existing code. Add support for s390x targets. Add closure support. * src/s390/sysv.S: Likewise. 2002-09-29 Richard Earnshaw * src/arm/sysv.S: Fix typo. 2002-09-28 Richard Earnshaw * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor has defined __USER_LABEL_PREFIX__, then use it in CNAME. (ffi_call_SYSV): Handle soft-float. 2002-09-27 Bo Thorsen * include/ffi.h.in: Fix multilib x86-64 support. 2002-09-22 Kaveh R. Ghazi * Makefile.am (all-multi): Fix multilib parallel build. 2002-07-19 Kaz Kojima * configure.in (sh[34]*-*-linux*): Add brackets. * configure: Regenerate. 2002-07-18 Kaz Kojima * Makefile.am: Add SH support. * Makefile.in: Regenerate. * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. * configure: Regenerate. * include/ffi.h.in: Add SH support. * src/sh/ffi.c: New file. * src/sh/sysv.S: New file. * src/types.c: Add SH support. 2002-07-16 Bo Thorsen * src/x86/ffi64.c: New file that adds x86-64 support. * src/x86/unix64.S: New file that handles argument setup for x86-64. * src/x86/sysv.S: Don't use this on x86-64. * src/x86/ffi.c: Don't use this on x86-64. Remove unused vars. * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation for x86-64. * src/ffitest.c (struct6): New test that tests a special case in the x86-64 ABI. (struct7): Likewise. (struct8): Likewise. (struct9): Likewise. (closure_test_fn): Silence warning about this when it's not used. (main): Add the new tests. (main): Fix a couple of wrong casts and silence some compiler warnings. * include/ffi.h.in: Add x86-64 ABI definition. * fficonfig.h.in: Regenerate. * Makefile.am: Add x86-64 support. * configure.in: Likewise. * Makefile.in: Regenerate. * configure: Likewise. 2002-06-24 Bo Thorsen * src/types.c: Merge settings for similar architectures. Add x86-64 sizes and alignments. 2002-06-23 Bo Thorsen * src/arm/ffi.c (ffi_prep_args): Remove unused vars. * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. * src/mips/ffi.c (ffi_prep_args): Likewise. * src/m68k/ffi.c (ffi_prep_args): Likewise. 2002-07-18 H.J. Lu (hjl@gnu.org) * Makefile.am (TARGET_SRC_MIPS_LINUX): New. (libffi_la_SOURCES): Support MIPS_LINUX. (libffi_convenience_la_SOURCES): Likewise. * Makefile.in: Regenerated. * configure.in (mips64*-*): Skip. (mips*-*-linux*): New. * configure: Regenerated. * src/mips/ffi.c: Include . 2002-06-06 Ulrich Weigand * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. 2002-05-27 Roger Sayle * src/x86/ffi.c (ffi_prep_args): Remove reference to avn. 2002-05-27 Bo Thorsen * src/x86/ffi.c (ffi_prep_args): Remove unused variable and fix formatting. 2002-05-13 Andreas Tobler * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at beginning of function (for older apple cc). 2002-05-08 Alexandre Oliva * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at script entry, and set LD to it when configuring multilibs. * configure: Rebuilt. 2002-05-05 Jason Thorpe * configure.in (sparc64-*-netbsd*): Add target. (sparc-*-netbsdelf*): Likewise. * configure: Regenerate. 2002-04-28 David S. Miller * configure.in, configure: Fix SPARC test in previous change. 2002-04-29 Gerhard Tonn * Makefile.am: Add Linux for S/390 support. * Makefile.in: Regenerate. * configure.in: Add Linux for S/390 support. * configure: Regenerate. * include/ffi.h.in: Add Linux for S/390 support. * src/s390/ffi.c: New file from libffi CVS tree. * src/s390/sysv.S: New file from libffi CVS tree. 2002-04-28 Jakub Jelinek * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working %r_disp32(). * src/sparc/v8.S: Use it. * src/sparc/v9.S: Likewise. * fficonfig.h.in: Rebuilt. * configure: Rebuilt. 2002-04-08 Hans Boehm * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE correctly. * src/ia64/unix.S: Add unwind information. Fix comments. Save sp in a way that's compatible with unwind info. (ffi_call_unix): Correctly restore sp in all cases. * src/ia64/ffi.c: Add, fix comments. 2002-04-08 Jakub Jelinek * src/sparc/v8.S: Make .eh_frame dependent on target word size. 2002-04-06 Jason Thorpe * configure.in (alpha*-*-netbsd*): Add target. * configure: Regenerate. 2002-04-04 Jeff Sturm * src/sparc/v8.S: Add unwind info. * src/sparc/v9.S: Likewise. 2002-03-30 Krister Walfridsson * configure.in: Enable i*86-*-netbsdelf*. * configure: Rebuilt. 2002-03-29 David Billinghurst PR other/2620 * src/mips/n32.s: Delete * src/mips/o32.s: Delete 2002-03-21 Loren J. Rittle * configure.in: Enable alpha*-*-freebsd*. * configure: Rebuilt. 2002-03-17 Bryce McKinlay * Makefile.am: libfficonvenience -> libffi_convenience. * Makefile.in: Rebuilt. * Makefile.am: Define ffitest_OBJECTS. * Makefile.in: Rebuilt. 2002-03-07 Andreas Tobler David Edelsohn * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files. (TARGET_SRC_POWERPC_AIX): Add aix_closure.S. (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S. * Makefile.in: Regenerate. * include/ffi.h.in: Add AIX and Darwin closure definitions. * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function. (flush_icache, flush_range): New functions. (ffi_closure_helper_DARWIN): New function. * src/powerpc/aix_closure.S: New file. * src/powerpc/darwin_closure.S: New file. 2002-02-24 Jeff Sturm * include/ffi.h.in: Add typedef for ffi_arg. * src/ffitest.c (main): Declare rint with ffi_arg. 2002-02-21 Andreas Tobler * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate number of GPRs for floating-point arguments. 2002-01-31 Anthony Green * configure: Rebuilt. * configure.in: Replace CHECK_SIZEOF and endian tests with cross-compiler friendly macros. * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New macros. 2002-01-18 David Edelsohn * src/powerpc/darwin.S (_ffi_call_AIX): New. * src/powerpc/aix.S (ffi_call_DARWIN): New. 2002-01-17 David Edelsohn * Makefile.am (EXTRA_DIST): Add Darwin and AIX files. (TARGET_SRC_POWERPC_AIX): New. (POWERPC_AIX): New stanza. * Makefile.in: Regenerate. * configure.in: Add AIX case. * configure: Regenerate. * include/ffi.h.in (ffi_abi): Add FFI_AIX. * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame size. Fix "long double" support. (ffi_call): Add FFI_AIX case. * src/powerpc/aix.S: New. 2001-10-09 John Hornkvist Implement Darwin PowerPC ABI. * configure.in: Handle powerpc-*-darwin*. * Makefile.am: Set source files for POWERPC_DARWIN. * configure: Rebuilt. * Makefile.in: Rebuilt. * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for POWERPC_DARWIN. * src/powerpc/darwin.S: New file. * src/powerpc/ffi_darwin.c: New file. 2001-10-07 Joseph S. Myers * src/x86/ffi.c: Fix spelling error of "separate" as "seperate". 2001-07-16 Rainer Orth * src/x86/sysv.S: Avoid gas-only .balign directive. Use C style comments. 2001-07-16 Rainer Orth * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic. Fixes PR bootstrap/3563. 2001-06-26 Rainer Orth * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF. 2001-06-25 Rainer Orth * configure.in: Recognize sparc*-sun-* host. * configure: Regenerate. 2001-06-06 Andrew Haley * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. 2001-06-03 Andrew Haley * src/alpha/osf.S: Add unwind info. * src/powerpc/sysv.S: Add unwind info. * src/powerpc/ppc_closure.S: Likewise. 2000-05-31 Jeff Sturm * configure.in: Fix AC_ARG_ENABLE usage. * configure: Rebuilt. 2001-05-06 Bryce McKinlay * configure.in: Remove warning about beta code. * configure: Rebuilt. 2001-04-25 Hans Boehm * src/ia64/unix.S: Restore stack pointer when returning from ffi_closure_UNIX. * src/ia64/ffi.c: Fix typo in comment. 2001-04-18 Jim Wilson * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2 to eliminate RAW DV. 2001-04-12 Bryce McKinlay * Makefile.am: Make a libtool convenience library. * Makefile.in: Rebuilt. 2001-03-29 Bryce McKinlay * configure.in: Use different syntax for subdirectory creation. * configure: Rebuilt. 2001-03-27 Jon Beniston * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW). * configure: Rebuilt. * Makefile.am: Added X86_WIN32 target support. * Makefile.in: Rebuilt. * include/ffi.h.in: Added X86_WIN32 target support. * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets. * src/types.c: Added X86_WIN32 target support. * src/x86/win32.S: New file. Based on sysv.S, but with EH stuff removed and made to work with CygWin's gas. 2001-03-26 Bryce McKinlay * configure.in: Make target subdirectory in build dir. * Makefile.am: Override suffix based rules to specify correct output subdirectory. * Makefile.in: Rebuilt. * configure: Rebuilt. 2001-03-23 Kevin B Hendricks * src/powerpc/ppc_closure.S: New file. * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug involving long long and register pairs. (ffi_prep_closure): New function. (flush_icache): Likewise. (ffi_closure_helper_SYSV): Likewise. * include/ffi.h.in (FFI_CLOSURES): Define on PPC. (FFI_TRAMPOLINE_SIZE): Likewise. (FFI_NATIVE_RAW_API): Likewise. * Makefile.in: Rebuilt. * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S. (TARGET_SRC_POWERPC): Likewise. 2001-03-19 Tom Tromey * Makefile.in: Rebuilt. * Makefile.am (ffitest_LDFLAGS): New macro. 2001-03-02 Nick Clifton * include/ffi.h.in: Remove RCS ident string. * include/ffi_mips.h: Remove RCS ident string. * src/debug.c: Remove RCS ident string. * src/ffitest.c: Remove RCS ident string. * src/prep_cif.c: Remove RCS ident string. * src/types.c: Remove RCS ident string. * src/alpha/ffi.c: Remove RCS ident string. * src/alpha/osf.S: Remove RCS ident string. * src/arm/ffi.c: Remove RCS ident string. * src/arm/sysv.S: Remove RCS ident string. * src/mips/ffi.c: Remove RCS ident string. * src/mips/n32.S: Remove RCS ident string. * src/mips/o32.S: Remove RCS ident string. * src/sparc/ffi.c: Remove RCS ident string. * src/sparc/v8.S: Remove RCS ident string. * src/sparc/v9.S: Remove RCS ident string. * src/x86/ffi.c: Remove RCS ident string. * src/x86/sysv.S: Remove RCS ident string. 2001-02-08 Joseph S. Myers * include/ffi.h.in: Change sourceware.cygnus.com references to gcc.gnu.org. 2000-12-09 Richard Henderson * src/alpha/ffi.c (ffi_call): Simplify struct return test. (ffi_closure_osf_inner): Index rather than increment avalue and arg_types. Give ffi_closure_osf the raw return value type. * src/alpha/osf.S (ffi_closure_osf): Handle return value type promotion. 2000-12-07 Richard Henderson * src/raw_api.c (ffi_translate_args): Fix typo. (ffi_prep_closure): Likewise. * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and FFI_TRAMPOLINE_SIZE. * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal cif->bytes for new ffi_call_osf implementation. (ffi_prep_args): Absorb into ... (ffi_call): ... here. Do all stack allocation here and avoid a callback function. (ffi_prep_closure, ffi_closure_osf_inner): New. * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback. (ffi_closure_osf): New. 2000-09-10 Alexandre Oliva * config.guess, config.sub, install-sh: Removed. * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise. * Makefile.in: Rebuilt. * acinclude.m4: Include libtool macros from the top level. * aclocal.m4, configure: Rebuilt. 2000-08-22 Alexandre Oliva * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set. * configure: Rebuilt. 2000-05-11 Scott Bambrough * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to memory correctly. Use conditional instructions, not branches where possible. 2000-05-04 Tom Tromey * configure: Rebuilt. * configure.in: Match `arm*-*-linux-*'. From Chris Dornan . 2000-04-28 Jakub Jelinek * Makefile.am (SUBDIRS): Define. (AM_MAKEFLAGS): Likewise. (Multilib support.): Add section. * Makefile.in: Rebuilt. * ltconfig (extra_compiler_flags, extra_compiler_flags_value): New variables. Set for gcc using -print-multi-lib. Export them to libtool. (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options for -shared links. (extra_compiler_flags_value, extra_compiler_flags): Check these for extra compiler options which need to be passed down in compiler_flags. 2000-04-16 Anthony Green * configure: Rebuilt. * configure.in: Change i*86-pc-linux* to i*86-*-linux*. 2000-04-14 Jakub Jelinek * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. Replace all void * sizeofs with sizeof(int). Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is different than DOUBLE. Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere). (ffi_prep_args_v9): New function. (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8. (ffi_V9_return_struct): New function. (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from 32bit code (not yet cross-arch calls). * src/sparc/v8.S: Add struct return delay nop. Handle long long. * src/sparc/v9.S: New file. * src/prep_cif.c (ffi_prep_cif): Return structure pointer is used on sparc64 only for structures larger than 32 bytes. Pass by reference for structures is done for structure arguments larger than 16 bytes. * src/ffitest.c (main): Use 64bit rint on sparc64. Run long long tests on sparc. * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and sparc64. (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits on sparc64. * configure.in (sparc-*-linux*): New supported target. (sparc64-*-linux*): Likewise. * configure: Rebuilt. * Makefile.am: Add v9.S to SPARC files. * Makefile.in: Likewise. (LINK): Surround $(CCLD) into double quotes, so that multilib compiles work correctly. 2000-04-04 Alexandre Petit-Bianco * configure: Rebuilt. * configure.in: (i*86-*-solaris*): New libffi target. Patch proposed by Bryce McKinlay. 2000-03-20 Tom Tromey * Makefile.in: Hand edit for java_raw_api.lo. 2000-03-08 Bryce McKinlay * config.guess, config.sub: Update from the gcc tree. Fix for PR libgcj/168. 2000-03-03 Tom Tromey * Makefile.in: Fixed ia64 by hand. * configure: Rebuilt. * configure.in (--enable-multilib): New option. (libffi_basedir): New subst. (AC_OUTPUT): Added multilib code. 2000-03-02 Tom Tromey * Makefile.in: Rebuilt. * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as directory name. 2000-02-25 Hans Boehm * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New files. * src/raw_api.c (ffi_translate_args): Fixed typo in argument list. (ffi_prep_raw_closure): Use ffi_translate_args, not ffi_closure_translate. * src/java_raw_api.c: New file. * src/ffitest.c (closure_test_fn): New function. (main): Define `rint' as long long on IA64. Added new test when FFI_CLOSURES is defined. * include/ffi.h.in (ALIGN): Use size_t, not unsigned. (ffi_abi): Recognize IA64. (ffi_raw): Added `flt' field. Added "Java raw API" code. * configure.in: Recognize ia64. * Makefile.am (TARGET_SRC_IA64): New macro. (libffi_la_common_SOURCES): Added java_raw_api.c. (libffi_la_SOURCES): Define in IA64 case. 2000-01-04 Tom Tromey * Makefile.in: Rebuilt with newer automake. 1999-12-31 Tom Tromey * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src. 1999-09-01 Tom Tromey * include/ffi.h.in: Removed PACKAGE and VERSION defines and undefs. * fficonfig.h.in: Rebuilt. * configure: Rebuilt. * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE. Use AM_PROG_LIBTOOL (automake 1.4 compatibility). * acconfig.h: Don't #undef PACKAGE or VERSION. 1999-08-09 Anthony Green * include/ffi.h.in: Try to work around messy header problem with PACKAGE and VERSION. * configure: Rebuilt. * configure.in: Change version to 2.00-beta. * fficonfig.h.in: Rebuilt. * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. * src/x86/ffi.c (ffi_raw_call): Rename. 1999-08-02 Kresten Krab Thorup * src/x86/ffi.c (ffi_closure_SYSV): New function. (ffi_prep_incoming_args_SYSV): Ditto. (ffi_prep_closure): Ditto. (ffi_closure_raw_SYSV): Ditto. (ffi_prep_raw_closure): More ditto. (ffi_call_raw): Final ditto. * include/ffi.h.in: Add definitions for closure and raw API. * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for FFI_TYPE_UINT64. * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c * src/raw_api.c: New file. * include/ffi.h.in (ffi_raw): New type. (UINT_ARG, SINT_ARG): New defines. (ffi_closure, ffi_raw_closure): New types. (ffi_prep_closure, ffi_prep_raw_closure): New declarations. * configure.in: Add check for endianness and sizeof void*. * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, instead of directly. * configure: Rebuilt. Thu Jul 8 14:28:42 1999 Anthony Green * configure.in: Add x86 and powerpc BeOS configurations. From Makoto Kato . 1999-05-09 Anthony Green * configure.in: Add warning about this being beta code. Remove src/Makefile.am from the picture. * configure: Rebuilt. * Makefile.am: Move logic from src/Makefile.am. Add changes to support libffi as a target library. * Makefile.in: Rebuilt. * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: Upgraded to new autoconf, automake, libtool. * README: Tweaks. * LICENSE: Update copyright date. * src/Makefile.am, src/Makefile.in: Removed. 1998-11-29 Anthony Green * include/ChangeLog: Removed. * src/ChangeLog: Removed. * src/mips/ChangeLog: Removed. * src/sparc/ChangeLog: Remboved. * src/x86/ChangeLog: Removed. * ChangeLog.v1: Created. gauche-c-wrapper-0.6.1.orig/libffi/ChangeLog.libgcj0000644000000000000000000000211711237307544016742 0ustar 2004-01-14 Kelley Cook * configure.in: Add in AC_PREREQ(2.13) 2003-02-20 Alexandre Oliva * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to config.status. * configure: Rebuilt. 2002-01-27 Alexandre Oliva * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. Remove USE_LIBDIR conditional. * Makefile.am (toolexecdir, toolexeclibdir): Don't override. * Makefile.in, configure: Rebuilt. Mon Aug 9 18:33:38 1999 Rainer Orth * include/Makefile.in: Rebuilt. * Makefile.in: Rebuilt * Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native builds. Use USE_LIBDIR. * configure: Rebuilt. * configure.in (USE_LIBDIR): Define for native builds. Use lowercase in configure --help explanations. 1999-08-08 Anthony Green * include/ffi.h.in (FFI_FN): Remove `...'. 1999-08-08 Anthony Green * Makefile.in: Rebuilt. * Makefile.am (AM_CFLAGS): Compile with -fexceptions. * src/x86/sysv.S: Add exception handling metadata. gauche-c-wrapper-0.6.1.orig/libffi/ChangeLog.v10000644000000000000000000005474011237307544016047 0ustar The libffi version 1 ChangeLog archive. Version 1 of libffi had per-directory ChangeLogs. Current and future versions have a single ChangeLog file in the root directory. The version 1 ChangeLogs have all been concatonated into this file for future reference only. --- libffi ---------------------------------------------------------------- Mon Oct 5 02:17:50 1998 Anthony Green * configure.in: Boosted rev. * configure, Makefile.in, aclocal.m4: Rebuilt. * README: Boosted rev and updated release notes. Mon Oct 5 01:03:03 1998 Anthony Green * configure.in: Boosted rev. * configure, Makefile.in, aclocal.m4: Rebuilt. * README: Boosted rev and updated release notes. 1998-07-25 Andreas Schwab * m68k/ffi.c (ffi_prep_cif_machdep): Use bitmask for cif->flags. Correctly handle small structures. (ffi_prep_args): Also handle small structures. (ffi_call): Pass size of return type to ffi_call_SYSV. * m68k/sysv.S: Adjust for above changes. Correctly align small structures in the return value. * types.c (uint64, sint64) [M68K]: Change alignment to 4. Fri Apr 17 17:26:58 1998 Anthony Green * configure.in: Boosted rev. * configure,Makefile.in,aclocal.m4: Rebuilt. * README: Boosted rev and added release notes. Sun Feb 22 00:50:41 1998 Geoff Keating * configure.in: Add PowerPC config bits. 1998-02-14 Andreas Schwab * configure.in: Add m68k config bits. Change AC_CANONICAL_SYSTEM to AC_CANONICAL_HOST, this is not a compiler. Use $host instead of $target. Remove AC_CHECK_SIZEOF(char), we already know the result. Fix argument of AC_ARG_ENABLE. * configure, fficonfig.h.in: Rebuilt. Tue Feb 10 20:53:40 1998 Richard Henderson * configure.in: Add Alpha config bits. Tue May 13 13:39:20 1997 Anthony Green * README: Updated dates and reworded Irix comments. * configure.in: Removed AC_PROG_RANLIB. * Makefile.in, aclocal.m4, config.guess, config.sub, configure, ltmain.sh, */Makefile.in: libtoolized again and rebuilt with automake and autoconf. Sat May 10 18:44:50 1997 Tom Tromey * configure, aclocal.m4: Rebuilt. * configure.in: Don't compute EXTRADIST; now handled in src/Makefile.in. Removed macros implied by AM_INIT_AUTOMAKE. Don't run AM_MAINTAINER_MODE. Thu May 8 14:34:05 1997 Anthony Green * missing, ltmain.sh, ltconfig.sh: Created. These are new files required by automake and libtool. * README: Boosted rev to 1.14. Added notes. * acconfig.h: Moved PACKAGE and VERSION for new automake. * configure.in: Changes for libtool. * Makefile.am (check): make test now make check. Uses libtool now. * Makefile.in, configure.in, aclocal.h, fficonfig.h.in: Rebuilt. Thu May 1 16:27:07 1997 Anthony Green * missing: Added file required by new automake. Tue Nov 26 14:10:42 1996 Anthony Green * acconfig.h: Added USING_PURIFY flag. This is defined when --enable-purify-safety was used at configure time. * configure.in (allsources): Added --enable-purify-safety switch. (VERSION): Boosted rev to 1.13. * configure: Rebuilt. Fri Nov 22 06:46:12 1996 Anthony Green * configure.in (VERSION): Boosted rev to 1.12. Removed special CFLAGS hack for gcc. * configure: Rebuilt. * README: Boosted rev to 1.12. Added notes. * Many files: Cygnus Support changed to Cygnus Solutions. Wed Oct 30 11:15:25 1996 Anthony Green * configure.in (VERSION): Boosted rev to 1.11. * configure: Rebuilt. * README: Boosted rev to 1.11. Added notes about GNU make. Tue Oct 29 12:25:12 1996 Anthony Green * configure.in: Fixed -Wall trick. (VERSION): Boosted rev. * configure: Rebuilt * acconfig.h: Needed for --enable-debug configure switch. * README: Boosted rev to 1.09. Added more notes on building libffi, and LCLint. * configure.in: Added --enable-debug switch. Boosted rev to 1.09. * configure: Rebuilt Tue Oct 15 13:11:28 1996 Anthony Green * configure.in (VERSION): Boosted rev to 1.08 * configure: Rebuilt. * README: Added n32 bug fix notes. * Makefile.am: Added "make lint" production. * Makefile.in: Rebuilt. Mon Oct 14 10:54:46 1996 Anthony Green * README: Added web page reference. * configure.in, README: Boosted rev to 1.05 * configure: Rebuilt. * README: Fixed n32 sample code. Fri Oct 11 17:09:28 1996 Anthony Green * README: Added sparc notes. * configure.in, README: Boosted rev to 1.04. * configure: Rebuilt. Thu Oct 10 10:31:03 1996 Anthony Green * configure.in, README: Boosted rev to 1.03. * configure: Rebuilt. * README: Added struct notes. * Makefile.am (EXTRA_DIST): Added LICENSE to distribution. * Makefile.in: Rebuilt. * README: Removed Linux section. No special notes now because aggregates arg/return types work. Wed Oct 9 16:16:42 1996 Anthony Green * README, configure.in (VERSION): Boosted rev to 1.02 * configure: Rebuilt. Tue Oct 8 11:56:33 1996 Anthony Green * README (NOTE): Added n32 notes. * Makefile.am: Added test production. * Makefile: Rebuilt * README: spell checked! * configure.in (VERSION): Boosted rev to 1.01 * configure: Rebuilt. Mon Oct 7 15:50:22 1996 Anthony Green * configure.in: Added nasty bit to support SGI tools. * configure: Rebuilt. * README: Added SGI notes. Added note about automake bug. Mon Oct 7 11:00:28 1996 Anthony Green * README: Rewrote intro, and fixed examples. Fri Oct 4 10:19:55 1996 Anthony Green * configure.in: -D$TARGET is no longer used as a compiler switch. It is now inserted into ffi.h at configure time. * configure: Rebuilt. * FFI_ABI and FFI_STATUS are now ffi_abi and ffi_status. Thu Oct 3 13:47:34 1996 Anthony Green * README, LICENSE: Created. Wrote some docs. * configure.in: Don't barf on i586-unknown-linuxaout. Added EXTRADIST code for "make dist". * configure: Rebuilt. * */Makefile.in: Rebuilt with patched automake. Tue Oct 1 17:12:25 1996 Anthony Green * Makefile.am, aclocal.m4, config.guess, config.sub, configure.in, fficonfig.h.in, install-sh, mkinstalldirs, stamp-h.in: Created * Makefile.in, configure: Generated --- libffi/include -------------------------------------------------------- Tue Feb 24 13:09:36 1998 Anthony Green * ffi_mips.h: Updated FFI_TYPE_STRUCT_* values based on ffi.h.in changes. This is a work-around for SGI's "simple" assembler. Sun Feb 22 00:51:55 1998 Geoff Keating * ffi.h.in: PowerPC support. 1998-02-14 Andreas Schwab * ffi.h.in: Add m68k support. (FFI_TYPE_LONGDOUBLE): Make it a separate value. Tue Feb 10 20:55:16 1998 Richard Henderson * ffi.h.in (SIZEOF_ARG): Use a pointer type by default. * ffi.h.in: Alpha support. Fri Nov 22 06:48:45 1996 Anthony Green * ffi.h.in, ffi_common.h: Cygnus Support -> Cygnus Solutions. Wed Nov 20 22:31:01 1996 Anthony Green * ffi.h.in: Added ffi_type_void definition. Tue Oct 29 12:22:40 1996 Anthony Green * Makefile.am (hack_DATA): Always install ffi_mips.h. * ffi.h.in: Removed FFI_DEBUG. It's now in the correct place (acconfig.h). Added #include for size_t definition. Tue Oct 15 17:23:35 1996 Anthony Green * ffi.h.in, ffi_common.h, ffi_mips.h: More clean up. Commented out #define of FFI_DEBUG. Tue Oct 15 13:01:06 1996 Anthony Green * ffi_common.h: Added bool definition. * ffi.h.in, ffi_common.h: Clean up based on LCLint output. Added funny /*@...@*/ comments to annotate source. Mon Oct 14 12:29:23 1996 Anthony Green * ffi.h.in: Interface changes based on feedback from Jim Blandy. Fri Oct 11 16:49:35 1996 Anthony Green * ffi.h.in: Small change for sparc support. Thu Oct 10 14:53:37 1996 Anthony Green * ffi_mips.h: Added FFI_TYPE_STRUCT_* definitions for special structure return types. Wed Oct 9 13:55:57 1996 Anthony Green * ffi.h.in: Added SIZEOF_ARG definition for X86 Tue Oct 8 11:40:36 1996 Anthony Green * ffi.h.in (FFI_FN): Added macro for eliminating compiler warnings. Use it to case your function pointers to the proper type. * ffi_mips.h (SIZEOF_ARG): Added magic to fix type promotion bug. * Makefile.am (EXTRA_DIST): Added ffi_mips.h to EXTRA_DIST. * Makefile: Rebuilt. * ffi_mips.h: Created. Moved all common mips definitions here. Mon Oct 7 10:58:12 1996 Anthony Green * ffi.h.in: The SGI assember is very picky about parens. Redefined some macros to avoid problems. * ffi.h.in: Added FFI_DEFAULT_ABI definitions. Also added externs for pointer, and 64bit integral ffi_types. Fri Oct 4 09:51:37 1996 Anthony Green * ffi.h.in: Added FFI_ABI member to ffi_cif and changed function prototypes accordingly. Added #define @TARGET@. Now programs including ffi.h don't have to specify this themselves. Thu Oct 3 15:36:44 1996 Anthony Green * ffi.h.in: Changed ffi_prep_cif's values from void* to void** * Makefile.am (EXTRA_DIST): Added EXTRA_DIST for "make dist" to work. * Makefile.in: Regenerated. Wed Oct 2 10:16:59 1996 Anthony Green * Makefile.am: Created * Makefile.in: Generated * ffi_common.h: Added rcsid comment Tue Oct 1 17:13:51 1996 Anthony Green * ffi.h.in, ffi_common.h: Created --- libffi/src ------------------------------------------------------------ Mon Oct 5 02:17:50 1998 Anthony Green * arm/ffi.c, arm/sysv.S: Created. * Makefile.am: Added arm files. * Makefile.in: Rebuilt. Mon Oct 5 01:41:38 1998 Anthony Green * Makefile.am (libffi_la_LDFLAGS): Incremented revision. Sun Oct 4 16:27:17 1998 Anthony Green * alpha/osf.S (ffi_call_osf): Patch for DU assembler. * ffitest.c (main): long long and long double return values work for x86. Fri Apr 17 11:50:58 1998 Anthony Green * Makefile.in: Rebuilt. * ffitest.c (main): Floating point tests not executed for systems with broken lond double (SunOS 4 w/ GCC). * types.c: Fixed x86 alignment info for long long types. Thu Apr 16 07:15:28 1998 Anthony Green * ffitest.c: Added more notes about GCC bugs under Irix 6. Wed Apr 15 08:42:22 1998 Anthony Green * ffitest.c (struct5): New test function. (main): New test with struct5. Thu Mar 5 10:48:11 1998 Anthony Green * prep_cif.c (initialize_aggregate): Fix assertion for nested structures. Tue Feb 24 16:33:41 1998 Anthony Green * prep_cif.c (ffi_prep_cif): Added long double support for sparc. Sun Feb 22 00:52:18 1998 Geoff Keating * powerpc/asm.h: New file. * powerpc/ffi.c: New file. * powerpc/sysv.S: New file. * Makefile.am: PowerPC port. * ffitest.c (main): Allow all tests to run even in presence of gcc bug on PowerPC. 1998-02-17 Anthony Green * mips/ffi.c: Fixed comment typo. * x86/ffi.c (ffi_prep_cif_machdep), x86/sysv.S (retfloat): Fixed x86 long double return handling. * types.c: Fixed x86 long double alignment info. 1998-02-14 Andreas Schwab * types.c: Add m68k support. * ffitest.c (floating): Add long double parameter. (return_ll, ldblit): New functions to test long long and long double return value. (main): Fix type error in assignment of ts[1-4]_type.elements. Add tests for long long and long double arguments and return values. * prep_cif.c (ffi_prep_cif) [M68K]: Don't allocate argument for struct value pointer. * m68k/ffi.c, m68k/sysv.S: New files. * Makefile.am: Add bits for m68k port. Add kludge to work around automake deficiency. (test): Don't require "." in $PATH. * Makefile.in: Rebuilt. Wed Feb 11 07:36:50 1998 Anthony Green * Makefile.in: Rebuilt. Tue Feb 10 20:56:00 1998 Richard Henderson * alpha/ffi.c, alpha/osf.S: New files. * Makefile.am: Alpha port. Tue Nov 18 14:12:07 1997 Anthony Green * mips/ffi.c (ffi_prep_cif_machdep): Initialize rstruct_flag for n32. Tue Jun 3 17:18:20 1997 Anthony Green * ffitest.c (main): Added hack to get structure tests working correctly. Sat May 10 19:06:42 1997 Tom Tromey * Makefile.in: Rebuilt. * Makefile.am (EXTRA_DIST): Explicitly list all distributable files in subdirs. (VERSION, CC): Removed. Thu May 8 17:19:01 1997 Anthony Green * Makefile.am: Many changes for new automake and libtool. * Makefile.in: Rebuilt. Fri Nov 22 06:57:56 1996 Anthony Green * ffitest.c (main): Fixed test case for non mips machines. Wed Nov 20 22:31:59 1996 Anthony Green * types.c: Added ffi_type_void declaration. Tue Oct 29 13:07:19 1996 Anthony Green * ffitest.c (main): Fixed character constants. (main): Emit warning for structure test 3 failure on Sun. * Makefile.am (VPATH): Fixed VPATH def'n so automake won't strip it out. Moved distdir hack from libffi to automake. (ffitest): Added missing -c for $(COMPILE) (change in automake). * Makefile.in: Rebuilt. Tue Oct 15 13:08:20 1996 Anthony Green * Makefile.am: Added "make lint" production. * Makefile.in: Rebuilt. * prep_cif.c (STACK_ARG_SIZE): Improved STACK_ARG_SIZE macro. Clean up based on LCLint output. Added funny /*@...@*/ comments to annotate source. * ffitest.c, debug.c: Cleaned up code. Mon Oct 14 12:26:56 1996 Anthony Green * ffitest.c: Changes based on interface changes. * prep_cif.c (ffi_prep_cif): Cleaned up interface based on feedback from Jim Blandy. Fri Oct 11 15:53:18 1996 Anthony Green * ffitest.c: Reordered tests while porting to sparc. Made changes to handle lame structure passing for sparc. Removed calls to fflush(). * prep_cif.c (ffi_prep_cif): Added special case for sparc aggregate type arguments. Thu Oct 10 09:56:51 1996 Anthony Green * ffitest.c (main): Added structure passing/returning tests. * prep_cif.c (ffi_prep_cif): Perform proper initialization of structure return types if needed. (initialize_aggregate): Bug fix Wed Oct 9 16:04:20 1996 Anthony Green * types.c: Added special definitions for x86 (double doesn't need double word alignment). * ffitest.c: Added many tests Tue Oct 8 09:19:22 1996 Anthony Green * prep_cif.c (ffi_prep_cif): Fixed assertion. * debug.c (ffi_assert): Must return a non void now. * Makefile.am: Added test production. * Makefile: Rebuilt. * ffitest.c (main): Created. * types.c: Created. Stripped common code out of */ffi.c. * prep_cif.c: Added missing stdlib.h include. * debug.c (ffi_type_test): Used "a" to eliminate compiler warnings in non-debug builds. Included ffi_common.h. Mon Oct 7 15:36:42 1996 Anthony Green * Makefile.am: Added a rule for .s -> .o This is required by the SGI compiler. * Makefile: Rebuilt. Fri Oct 4 09:51:08 1996 Anthony Green * prep_cif.c (initialize_aggregate): Moved abi specification to ffi_prep_cif(). Thu Oct 3 15:37:37 1996 Anthony Green * prep_cif.c (ffi_prep_cif): Changed values from void* to void**. (initialize_aggregate): Fixed aggregate type initialization. * Makefile.am (EXTRA_DIST): Added support code for "make dist". * Makefile.in: Regenerated. Wed Oct 2 11:41:57 1996 Anthony Green * debug.c, prep_cif: Created. * Makefile.am: Added debug.o and prep_cif.o to OBJ. * Makefile.in: Regenerated. * Makefile.am (INCLUDES): Added missing -I../include * Makefile.in: Regenerated. Tue Oct 1 17:11:51 1996 Anthony Green * error.c, Makefile.am: Created. * Makefile.in: Generated. --- libffi/src/x86 -------------------------------------------------------- Sun Oct 4 16:27:17 1998 Anthony Green * sysv.S (retlongdouble): Fixed long long return value support. * ffi.c (ffi_prep_cif_machdep): Ditto. Wed May 13 04:30:33 1998 Anthony Green * ffi.c (ffi_prep_cif_machdep): Fixed long double return value support. Wed Apr 15 08:43:20 1998 Anthony Green * ffi.c (ffi_prep_args): small struct support was missing. Thu May 8 16:53:58 1997 Anthony Green * objects.mak: Removed. Mon Dec 2 15:12:58 1996 Tom Tromey * sysv.S: Use .balign, for a.out Linux boxes. Tue Oct 15 13:06:50 1996 Anthony Green * ffi.c: Clean up based on LCLint output. Added funny /*@...@*/ comments to annotate source. Fri Oct 11 16:43:38 1996 Anthony Green * ffi.c (ffi_call): Added assertion for bad ABIs. Wed Oct 9 13:57:27 1996 Anthony Green * sysv.S (retdouble): Fixed double return problems. * ffi.c (ffi_call): Corrected fn arg definition. (ffi_prep_cif_machdep): Fixed double return problems Tue Oct 8 12:12:49 1996 Anthony Green * ffi.c: Moved ffi_type definitions to types.c. (ffi_prep_args): Fixed type promotion bug. Mon Oct 7 15:53:06 1996 Anthony Green * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' Fri Oct 4 09:54:53 1996 Anthony Green * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped remaining args. Wed Oct 2 10:07:05 1996 Anthony Green * ffi.c, sysv.S, objects.mak: Created. (ffi_prep_cif): cif->rvalue no longer initialized to NULL. (ffi_prep_cif_machdep): Moved machine independent cif processing to src/prep_cif.c. Introduced ffi_prep_cif_machdep(). --- libffi/src/mips ------------------------------------------------------- Tue Feb 17 17:18:07 1998 Anthony Green * o32.S: Fixed typo in comment. * ffi.c (ffi_prep_cif_machdep): Fixed argument processing. Thu May 8 16:53:58 1997 Anthony Green * o32.s, n32.s: Wrappers for SGI tool support. * objects.mak: Removed. Tue Oct 29 14:37:45 1996 Anthony Green * ffi.c (ffi_prep_args): Changed int z to size_t z. Tue Oct 15 13:17:25 1996 Anthony Green * n32.S: Fixed bad stack munging. * ffi.c: Moved prototypes for ffi_call_?32() to here from ffi_mips.h because extended_cif is not defined in ffi_mips.h. Mon Oct 14 12:42:02 1996 Anthony Green * ffi.c: Interface changes based on feedback from Jim Blandy. Thu Oct 10 11:22:16 1996 Anthony Green * n32.S, ffi.c: Lots of changes to support passing and returning structures with the n32 calling convention. * n32.S: Fixed fn pointer bug. * ffi.c (ffi_prep_cif_machdep): Fix for o32 structure return values. (ffi_prep_args): Fixed n32 structure passing when structures partially fit in registers. Wed Oct 9 13:49:25 1996 Anthony Green * objects.mak: Added n32.o. * n32.S: Created. * ffi.c (ffi_prep_args): Added magic to support proper n32 processing. Tue Oct 8 10:37:35 1996 Anthony Green * ffi.c: Moved ffi_type definitions to types.c. (ffi_prep_args): Fixed type promotion bug. * o32.S: This code is only built for o32 compiles. A lot of the #define cruft has moved to ffi_mips.h. * ffi.c (ffi_prep_cif_machdep): Fixed arg flags. Second arg is only processed if the first is either a float or double. Mon Oct 7 15:33:59 1996 Anthony Green * o32.S: Modified to compile under each of o32, n32 and n64. * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' Fri Oct 4 09:53:25 1996 Anthony Green * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped remaining args. Wed Oct 2 17:41:22 1996 Anthony Green * o32.S: Removed crufty definitions. Wed Oct 2 12:53:42 1996 Anthony Green * ffi.c (ffi_prep_cif): cif->rvalue no longer initialized to NULL. (ffi_prep_cif_machdep): Moved all machine independent cif processing to src/prep_cif.c. Introduced ffi_prep_cif_machdep. Return types of FFI_TYPE_STRUCT are no different than FFI_TYPE_INT. Tue Oct 1 17:11:02 1996 Anthony Green * ffi.c, o32.S, object.mak: Created --- libffi/src/sparc ------------------------------------------------------ Tue Feb 24 16:33:18 1998 Anthony Green * ffi.c (ffi_prep_args): Added long double support. Thu May 8 16:53:58 1997 Anthony Green * objects.mak: Removed. Thu May 1 16:07:56 1997 Anthony Green * v8.S: Fixed minor portability problem reported by Russ McManus . Tue Nov 26 14:12:43 1996 Anthony Green * v8.S: Used STACKFRAME define elsewhere. * ffi.c (ffi_prep_args): Zero out space when USING_PURIFY is set. (ffi_prep_cif_machdep): Allocate the correct stack frame space for functions with < 6 args. Tue Oct 29 15:08:55 1996 Anthony Green * ffi.c (ffi_prep_args): int z is now size_t z. Mon Oct 14 13:31:24 1996 Anthony Green * v8.S (ffi_call_V8): Gordon rewrites this again. It looks great now. * ffi.c (ffi_call): The comment about hijacked registers is no longer valid after gordoni hacked v8.S. * v8.S (ffi_call_V8): Rewrote with gordoni. Much simpler. * v8.S, ffi.c: ffi_call() had changed to accept more than two args, so v8.S had to change (because it hijacks incoming arg registers). * ffi.c: Interface changes based on feedback from Jim Blandy. Thu Oct 10 17:48:16 1996 Anthony Green * ffi.c, v8.S, objects.mak: Created. gauche-c-wrapper-0.6.1.orig/libffi/compile0000755000000000000000000000717311237307544015324 0ustar #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gauche-c-wrapper-0.6.1.orig/libffi/config.guess0000755000000000000000000012470211237307544016264 0ustar #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-11-12' # 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 . # Please send patches to . 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 ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { 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 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # 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 Pn.n version is a patched version. # 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/^[PVTX]//' | 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 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 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:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis: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 ;; m68k:machten:*:*) echo m68k-apple-machten${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 /* 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 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 #include 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 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 craynv-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 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-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:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 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*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' 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:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*: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 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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 #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 #ifdef __dietlibc__ LIBC=dietlibc #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:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable 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' /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[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*: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 | SHG2:*:4.0:3.0 | S7501*:*: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 echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # 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:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) 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-?: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 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix 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 < # include #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 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 # 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 < 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: gauche-c-wrapper-0.6.1.orig/libffi/config.sub0000755000000000000000000007547011237307544015736 0ustar #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # 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 . 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 ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-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 | -knuth | -cray) 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] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | 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 \ | mipsisa64r2 | mipsisa64r2el \ | 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 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | 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-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | 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-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | 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-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | 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-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | 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 ;; abacus) basic_machine=abacus-unknown ;; 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 ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; 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 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; 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 ;; 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 ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; 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 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-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-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`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 ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-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 ;; tpf) basic_machine=s390x-ibm os=-tpf ;; 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 ;; xbox) basic_machine=i686-pc os=-mingw32 ;; 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 ;; mmix) basic_machine=mmix-knuth ;; 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 | sparcv8 | 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* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -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* | -linux-uclibc* | -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* | -nx6 | -nx7 | -sei* | -dragonfly*) # 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-dietlibc) os=-linux-dietlibc ;; -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 ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -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 ;; -tpf*) os=-tpf ;; -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 ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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 ;; c4x-* | tic4x-*) os=-coff ;; # 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 ;; *-knuth) os=-mmixware ;; *-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 ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -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: gauche-c-wrapper-0.6.1.orig/libffi/configure0000755000000000000000000300644411237307544015660 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for libffi 2.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${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 </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then 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. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" 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="$lt_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 configure 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 fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libffi' PACKAGE_TARNAME='libffi' PACKAGE_VERSION='2.1' PACKAGE_STRING='libffi 2.1' PACKAGE_BUGREPORT='http://gcc.gnu.org/bugs.html' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS TARGETDIR TARGET HAVE_LONG_DOUBLE ALLOCA PA_FALSE PA_TRUE SH64_FALSE SH64_TRUE SH_FALSE SH_TRUE X86_64_FALSE X86_64_TRUE S390_FALSE S390_TRUE FRV_FALSE FRV_TRUE LIBFFI_CRIS_FALSE LIBFFI_CRIS_TRUE ARM_FALSE ARM_TRUE POWERPC_FREEBSD_FALSE POWERPC_FREEBSD_TRUE POWERPC_DARWIN_FALSE POWERPC_DARWIN_TRUE POWERPC_AIX_FALSE POWERPC_AIX_TRUE POWERPC_FALSE POWERPC_TRUE M68K_FALSE M68K_TRUE M32R_FALSE M32R_TRUE IA64_FALSE IA64_TRUE ALPHA_FALSE ALPHA_TRUE X86_FREEBSD_FALSE X86_FREEBSD_TRUE X86_DARWIN_FALSE X86_DARWIN_TRUE X86_WIN32_FALSE X86_WIN32_TRUE X86_FALSE X86_TRUE SPARC_FALSE SPARC_TRUE MIPS_LINUX_FALSE MIPS_LINUX_TRUE MIPS_IRIX_FALSE MIPS_IRIX_TRUE LIBTOOL ac_ct_F77 FFLAGS F77 CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP RANLIB AR ECHO LN_S EGREP GREP CCASFLAGS CCAS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static enable_fast_install with_gnu_ld enable_libtool_lock with_pic with_tags enable_debug enable_structs enable_raw_api enable_purify_safety ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CCAS CCASFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) { $as_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 && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 libffi 2.1 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libffi] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libffi 2.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug debugging mode --disable-structs omit code for struct support --disable-raw-api make the raw api unavailable --enable-purify-safety purify-safe mode Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libffi configure 2.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libffi $as_me 2.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`$as_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_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 { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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 { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_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_config_headers="$ac_config_headers fficonfig.h" 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 { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 $as_echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # 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}- . ${srcdir}/configure.host am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libffi' VERSION='2.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_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. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_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 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_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 # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=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 #include #include #include /* 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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS if test "x$CC" != xcc; then { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_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 core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # 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 # Check whether --enable-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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-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. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${lt_cv_path_SED+set}" = set; then $as_echo_n "(cached) " >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { $as_echo "$as_me:$LINENO: result: $SED" >&5 $as_echo "$SED" >&6; } { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --with-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. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname 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 { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" 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 variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 $as_echo_n "checking for BSD-compatible nm... " >&6; } if test "${lt_cv_path_NM+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 $as_echo_n "checking how to recognise dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then $as_echo_n "(cached) " >&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 extended 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 aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) 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*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. 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=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) 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|DragonFly)/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*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in 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_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) 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_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) 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 ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in 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*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in 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=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4619 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_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* ;; 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=$? $as_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" { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then $as_echo_n "(cached) " >&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 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$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 need_locks="$enable_libtool_lock" 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 { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&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 $as_echo_n "(cached) " >&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 to if __STDC__ is defined, since # 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 #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$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 to if __STDC__ is defined, since # 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 #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&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 #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core 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 _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 _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 #include #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to http://gcc.gnu.org/bugs.html ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # 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 #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # 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 #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_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 nonexistent 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:$LINENO: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then $as_echo_n "(cached) " >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then $as_echo_n "(cached) " >&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 ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; 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 all BSDs 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` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # 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. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else # 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 an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/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 if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_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. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_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 -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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 grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> 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" | grep -v main >> 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.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" 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 $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi { $as_echo "$as_me:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir 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 # 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' # 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' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # 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 "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # 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 case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # 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 { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" 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 <&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="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" 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 <&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="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 $as_echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { $as_echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 $as_echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 $as_echo_n "checking if $compiler static flag $lt_prog_compiler_static works... " >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 $as_echo "$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7398: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7402: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_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_prog_compiler_static='-Bstatic' 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'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | 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). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | 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). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7660: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7664: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 $as_echo "$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7722: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7726: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= 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 extended regexp 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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # 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 <&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 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't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach 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* | pw32*) # _LT_AC_TAGVAR(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=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; 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 $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' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&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 | grep ': 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 | grep ': 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" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= 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 "$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*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # 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 | grep '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 aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$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' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi 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 # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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" else # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' 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=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its 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 ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # 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 # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # 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"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; 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* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then 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' else 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' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$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}${output_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 ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' 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 $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; 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 "$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}${output_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 ${output_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 "$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}${output_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 ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -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 export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' 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 wlarc='' 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].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; 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 ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | 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 ;; 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 ;; *) ld_shlibs=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$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. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$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}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH 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. 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 can_build_shared=no fi ;; esac # 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH 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}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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" # 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 shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' 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 ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # 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' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; 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 "$_LT_AC_TAGVAR(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 { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&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 striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 # Report which librarie types wil actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&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* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { $as_echo "$as_me:$LINENO: creating $ofile" >&5 $as_echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | 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 ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_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=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} 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 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # 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=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_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=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # 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 # 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? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 $as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # 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'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 $as_echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 $as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-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. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname 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 { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" 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 variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${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" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no 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_CXX='$CC -shared -nostdlib $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 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = 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_CXX=yes else # We have old collect2 hardcode_direct_CXX=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_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi 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_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$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" else # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$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_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=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_CXX=no ;; aCC*) archive_cmds_CXX='$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' # 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) | grep "[-]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 "$GXX" = yes; then archive_cmds_CXX='$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' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$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) | grep "\-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 "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$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}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; 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_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.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$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; 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_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $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_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # 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_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; 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_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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 ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=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_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$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 ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # 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 "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$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}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # 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 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=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. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # 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_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` 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_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${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_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' 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'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # 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). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-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_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12326: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12330: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12388: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12392: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # 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 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$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_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX 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. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$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}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH 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. 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 can_build_shared=no fi ;; esac # 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH 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}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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" # 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 shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' 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 ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # 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' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = 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 striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_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=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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_CXX # 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=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # 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_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&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* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' 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'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | 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). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | 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). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 $as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14743: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14747: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14805: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14809: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$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_F77= # exclude_expsyms can be an extended regexp 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_F77="_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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # 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_F77=no cat <&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_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II 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't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_F77=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&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 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$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_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # 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 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$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_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$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_F77=yes else # We have old collect2 hardcode_direct_F77=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_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi 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_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$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" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$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_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # 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_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$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_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$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' else archive_cmds_F77='$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' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$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}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$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}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$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 wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$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_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -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_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$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_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 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. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 $as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$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}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH 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. 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 can_build_shared=no fi ;; esac # 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH 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}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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" # 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 shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' 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 ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # 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' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = 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 striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_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=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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_F77 # 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=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # 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_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' 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'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | 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). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | 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). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 $as_echo "$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17200: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17204: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 $as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17262: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17266: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 $as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&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 { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$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_GCJ= # exclude_expsyms can be an extended regexp 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_GCJ="_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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # 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_GCJ=no cat <&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_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II 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't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_GCJ=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $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 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&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 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$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_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) 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 exp_sym_flag='-Bexport' no_entry_flag="" else # 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 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$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_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # 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 runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # 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. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$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_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=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_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi 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_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$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" else # Determine the default libpath from the value encoded in an empty executable. 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$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_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # 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_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$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_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$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' else archive_cmds_GCJ='$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' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$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}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$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}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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 ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$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 wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$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_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -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_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$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_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 $as_echo "$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ 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. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 $as_echo "$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$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}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH 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. 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 can_build_shared=no fi ;; esac # 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH 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}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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" # 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 shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' 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 ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) 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}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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 # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # 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' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$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}${shared_ext}$versuffix ${libname}${shared_ext}$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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 $as_echo "$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = 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 striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_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=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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_GCJ # 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=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # 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_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_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=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # 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_RC # 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=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # 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_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" ;; *) { { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 $as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 $as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion for ac_header in sys/mman.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to http://gcc.gnu.org/bugs.html ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mmap do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_sys_mman_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for sys/mman.h" >&5 $as_echo_n "checking for sys/mman.h... " >&6; } if test "${ac_cv_header_sys_mman_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 $as_echo "$ac_cv_header_sys_mman_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking sys/mman.h usability" >&5 $as_echo_n "checking sys/mman.h usability... " >&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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking sys/mman.h presence" >&5 $as_echo_n "checking sys/mman.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&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 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: sys/mman.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: sys/mman.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: sys/mman.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: sys/mman.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to http://gcc.gnu.org/bugs.html ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for sys/mman.h" >&5 $as_echo_n "checking for sys/mman.h... " >&6; } if test "${ac_cv_header_sys_mman_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mman_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 $as_echo "$ac_cv_header_sys_mman_h" >&6; } fi if test "x$ac_cv_header_sys_mman_h" = x""yes; then libffi_header_sys_mman_h=yes else libffi_header_sys_mman_h=no fi { $as_echo "$as_me:$LINENO: checking for mmap" >&5 $as_echo_n "checking for mmap... " >&6; } if test "${ac_cv_func_mmap+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define mmap to an innocuous variant, in case declares mmap. For example, HP-UX 11i declares gettimeofday. */ #define mmap innocuous_mmap /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mmap (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef mmap /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mmap (); /* 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_mmap || defined __stub___mmap choke me #endif int main () { return mmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_mmap=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_mmap=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 $as_echo "$ac_cv_func_mmap" >&6; } if test "x$ac_cv_func_mmap" = x""yes; then libffi_func_mmap=yes else libffi_func_mmap=no fi if test "$libffi_header_sys_mman_h" != yes \ || test "$libffi_func_mmap" != yes; then ac_cv_func_mmap_file=no ac_cv_func_mmap_dev_zero=no ac_cv_func_mmap_anon=no else { $as_echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5 $as_echo_n "checking whether read-only mmap of a plain file works... " >&6; } if test "${ac_cv_func_mmap_file+set}" = set; then $as_echo_n "(cached) " >&6 else # Add a system to this blacklist if # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a # memory area containing the same data that you'd get if you applied # read() to the same fd. The only system known to have a problem here # is VMS, where text files have record structure. case "$host_os" in vms* | ultrix*) ac_cv_func_mmap_file=no ;; *) ac_cv_func_mmap_file=yes;; esac fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5 $as_echo "$ac_cv_func_mmap_file" >&6; } { $as_echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5 $as_echo_n "checking whether mmap from /dev/zero works... " >&6; } if test "${ac_cv_func_mmap_dev_zero+set}" = set; then $as_echo_n "(cached) " >&6 else # Add a system to this blacklist if it has mmap() but /dev/zero # does not exist, or if mmapping /dev/zero does not give anonymous # zeroed pages with both the following properties: # 1. If you map N consecutive pages in with one call, and then # unmap any subset of those pages, the pages that were not # explicitly unmapped remain accessible. # 2. If you map two adjacent blocks of memory and then unmap them # both at once, they must both go away. # Systems known to be in this category are Windows (all variants), # VMS, and Darwin. case "$host_os" in vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) ac_cv_func_mmap_dev_zero=no ;; *) ac_cv_func_mmap_dev_zero=yes;; esac fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_dev_zero" >&5 $as_echo "$ac_cv_func_mmap_dev_zero" >&6; } # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. { $as_echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5 $as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; } if test "${ac_cv_decl_map_anon+set}" = set; then $as_echo_n "(cached) " >&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 #include #include #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif int main () { int n = MAP_ANONYMOUS; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_decl_map_anon=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_decl_map_anon=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_decl_map_anon" >&5 $as_echo "$ac_cv_decl_map_anon" >&6; } if test $ac_cv_decl_map_anon = no; then ac_cv_func_mmap_anon=no else { $as_echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5 $as_echo_n "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; } if test "${ac_cv_func_mmap_anon+set}" = set; then $as_echo_n "(cached) " >&6 else # Add a system to this blacklist if it has mmap() and MAP_ANON or # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) # doesn't give anonymous zeroed pages with the same properties listed # above for use of /dev/zero. # Systems known to be in this category are Windows, VMS, and SCO Unix. case "$host_os" in vms* | cygwin* | pe | mingw* | sco* | udk* ) ac_cv_func_mmap_anon=no ;; *) ac_cv_func_mmap_anon=yes;; esac fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_anon" >&5 $as_echo "$ac_cv_func_mmap_anon" >&6; } fi fi if test $ac_cv_func_mmap_file = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP_FILE 1 _ACEOF fi if test $ac_cv_func_mmap_dev_zero = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP_DEV_ZERO 1 _ACEOF fi if test $ac_cv_func_mmap_anon = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP_ANON 1 _ACEOF fi TARGETDIR="unknown" case "$host" in i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-gnu*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris2.1[0-9]*) TARGET=X86_64; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86_FREEBSD; TARGETDIR=x86;; i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;; i*86-*-rtems*) TARGET=X86; TARGETDIR=x86;; i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;; i*86-*-darwin*) TARGET=X86_DARWIN; TARGETDIR=x86;; i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;; i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; frv-*-*) TARGET=FRV; TARGETDIR=frv;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; sparc-*-linux* | sparc-*-netbsdelf* | sparc-*-knetbsd*-gnu) TARGET=SPARC; TARGETDIR=sparc;; sparc*-*-rtems*) TARGET=SPARC; TARGETDIR=sparc;; sparc64-*-linux* | sparc64-*-netbsd* | sparc64-*-knetbsd*-gnu) TARGET=SPARC; TARGETDIR=sparc;; alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m32r*-*-linux* ) TARGET=M32R; TARGETDIR=m32r;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; mips64*-*);; mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; powerpc-*-freebsd*) TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc;; powerpc*-*-rtems*) TARGET=POWERPC; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; arm*-*-netbsdelf* | arm*-*-knetbsd*-gnu) TARGET=ARM; TARGETDIR=arm;; arm*-*-rtems*) TARGET=ARM; TARGETDIR=arm;; cris-*-*) TARGET=LIBFFI_CRIS; TARGETDIR=cris;; s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; x86_64-*-linux* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu | x86_64-*-netbsd*) TARGET=X86_64; TARGETDIR=x86;; sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; sh-*-rtems*) TARGET=SH; TARGETDIR=sh;; sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;; hppa-*-linux* | parisc-*-linux*) TARGET=PA; TARGETDIR=pa;; esac if test $TARGETDIR = unknown; then { { $as_echo "$as_me:$LINENO: error: \"libffi has not been ported to $host.\"" >&5 $as_echo "$as_me: error: \"libffi has not been ported to $host.\"" >&2;} { (exit 1); exit 1; }; } fi if test x$TARGET = xMIPS_IRIX; then MIPS_IRIX_TRUE= MIPS_IRIX_FALSE='#' else MIPS_IRIX_TRUE='#' MIPS_IRIX_FALSE= fi if test x$TARGET = xMIPS_LINUX; then MIPS_LINUX_TRUE= MIPS_LINUX_FALSE='#' else MIPS_LINUX_TRUE='#' MIPS_LINUX_FALSE= fi if test x$TARGET = xSPARC; then SPARC_TRUE= SPARC_FALSE='#' else SPARC_TRUE='#' SPARC_FALSE= fi if test x$TARGET = xX86; then X86_TRUE= X86_FALSE='#' else X86_TRUE='#' X86_FALSE= fi if test x$TARGET = xX86_WIN32; then X86_WIN32_TRUE= X86_WIN32_FALSE='#' else X86_WIN32_TRUE='#' X86_WIN32_FALSE= fi if test x$TARGET = xX86_DARWIN; then X86_DARWIN_TRUE= X86_DARWIN_FALSE='#' else X86_DARWIN_TRUE='#' X86_DARWIN_FALSE= fi if test x$TARGET = xX86_FREEBSD; then X86_FREEBSD_TRUE= X86_FREEBSD_FALSE='#' else X86_FREEBSD_TRUE='#' X86_FREEBSD_FALSE= fi if test x$TARGET = xALPHA; then ALPHA_TRUE= ALPHA_FALSE='#' else ALPHA_TRUE='#' ALPHA_FALSE= fi if test x$TARGET = xIA64; then IA64_TRUE= IA64_FALSE='#' else IA64_TRUE='#' IA64_FALSE= fi if test x$TARGET = xM32R; then M32R_TRUE= M32R_FALSE='#' else M32R_TRUE='#' M32R_FALSE= fi if test x$TARGET = xM68K; then M68K_TRUE= M68K_FALSE='#' else M68K_TRUE='#' M68K_FALSE= fi if test x$TARGET = xPOWERPC; then POWERPC_TRUE= POWERPC_FALSE='#' else POWERPC_TRUE='#' POWERPC_FALSE= fi if test x$TARGET = xPOWERPC_AIX; then POWERPC_AIX_TRUE= POWERPC_AIX_FALSE='#' else POWERPC_AIX_TRUE='#' POWERPC_AIX_FALSE= fi if test x$TARGET = xPOWERPC_DARWIN; then POWERPC_DARWIN_TRUE= POWERPC_DARWIN_FALSE='#' else POWERPC_DARWIN_TRUE='#' POWERPC_DARWIN_FALSE= fi if test x$TARGET = xPOWERPC_FREEBSD; then POWERPC_FREEBSD_TRUE= POWERPC_FREEBSD_FALSE='#' else POWERPC_FREEBSD_TRUE='#' POWERPC_FREEBSD_FALSE= fi if test x$TARGET = xARM; then ARM_TRUE= ARM_FALSE='#' else ARM_TRUE='#' ARM_FALSE= fi if test x$TARGET = xLIBFFI_CRIS; then LIBFFI_CRIS_TRUE= LIBFFI_CRIS_FALSE='#' else LIBFFI_CRIS_TRUE='#' LIBFFI_CRIS_FALSE= fi if test x$TARGET = xFRV; then FRV_TRUE= FRV_FALSE='#' else FRV_TRUE='#' FRV_FALSE= fi if test x$TARGET = xS390; then S390_TRUE= S390_FALSE='#' else S390_TRUE='#' S390_FALSE= fi if test x$TARGET = xX86_64; then X86_64_TRUE= X86_64_FALSE='#' else X86_64_TRUE='#' X86_64_FALSE= fi if test x$TARGET = xSH; then SH_TRUE= SH_FALSE='#' else SH_TRUE='#' SH_FALSE= fi if test x$TARGET = xSH64; then SH64_TRUE= SH64_FALSE='#' else SH64_TRUE='#' SH64_FALSE= fi if test x$TARGET = xPA; then PA_TRUE= PA_FALSE='#' else PA_TRUE='#' PA_FALSE= fi case x$TARGET in xMIPS*) TARGET=MIPS ;; *) ;; esac { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&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 #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core 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 _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 _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 #include #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$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_func in memcpy do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then $as_echo_n "(cached) " >&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 int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_working_alloca_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_alloca_works=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 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 int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (double)); } static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (double))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (double)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (double)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 $as_echo "$ac_cv_sizeof_double" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_DOUBLE $ac_cv_sizeof_double _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of long double" >&5 $as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; esac 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 static long int longval () { return (long int) (sizeof (long double)); } static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (long double))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (long double)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (long double)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 $as_echo "$ac_cv_sizeof_long_double" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double _ACEOF # Also AC_SUBST this variable for ffi.h. HAVE_LONG_DOUBLE=0 if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then if test $ac_cv_sizeof_long_double != 0; then HAVE_LONG_DOUBLE=1 cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi fi { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # Check for potential -arch flags. It is not universal unless # there are some -arch flags. Note that *ppc* also matches # ppc64. This check is also rather less than ideal. case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to _BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; #( no) ;; #( universal) cat >>confdefs.h <<\_ACEOF #define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF ;; #( *) { { $as_echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 $as_echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test x$TARGET = xSPARC; then { $as_echo "$as_me:$LINENO: checking assembler and linker support unaligned pc related relocs" >&5 $as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; } if test "${libffi_cv_as_sparc_ua_pcrel+set}" = set; then $as_echo_n "(cached) " >&6 else save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS -shared" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text"); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then libffi_cv_as_sparc_ua_pcrel=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 libffi_cv_as_sparc_ua_pcrel=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $libffi_cv_as_sparc_ua_pcrel" >&5 $as_echo "$libffi_cv_as_sparc_ua_pcrel" >&6; } if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_AS_SPARC_UA_PCREL 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking assembler .register pseudo-op support" >&5 $as_echo_n "checking assembler .register pseudo-op support... " >&6; } if test "${libffi_cv_as_register_pseudo_op+set}" = set; then $as_echo_n "(cached) " >&6 else libffi_cv_as_register_pseudo_op=unknown # Check if we have .register cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ asm (".register %g2, #scratch"); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then libffi_cv_as_register_pseudo_op=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 libffi_cv_as_register_pseudo_op=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $libffi_cv_as_register_pseudo_op" >&5 $as_echo "$libffi_cv_as_register_pseudo_op" >&6; } if test "x$libffi_cv_as_register_pseudo_op" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_AS_REGISTER_PSEUDO_OP 1 _ACEOF fi fi { $as_echo "$as_me:$LINENO: checking whether .eh_frame section should be read-only" >&5 $as_echo_n "checking whether .eh_frame section should be read-only... " >&6; } if test "${libffi_cv_ro_eh_frame+set}" = set; then $as_echo_n "(cached) " >&6 else libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then libffi_cv_ro_eh_frame=yes elif grep '.section.*eh_frame.*#alloc' conftest.c \ | grep -v '#write' > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi rm -f conftest.* fi { $as_echo "$as_me:$LINENO: result: $libffi_cv_ro_eh_frame" >&5 $as_echo "$libffi_cv_ro_eh_frame" >&6; } if test "x$libffi_cv_ro_eh_frame" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RO_EH_FRAME 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define EH_FRAME_FLAGS "a" _ACEOF else cat >>confdefs.h <<\_ACEOF #define EH_FRAME_FLAGS "aw" _ACEOF fi { $as_echo "$as_me:$LINENO: checking for __attribute__((visibility(\"hidden\")))" >&5 $as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; } if test "${libffi_cv_hidden_visibility_attribute+set}" = set; then $as_echo_n "(cached) " >&6 else echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c libffi_cv_hidden_visibility_attribute=no if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep '\.hidden.*foo' conftest.s >/dev/null; then libffi_cv_hidden_visibility_attribute=yes fi fi rm -f conftest.* fi { $as_echo "$as_me:$LINENO: result: $libffi_cv_hidden_visibility_attribute" >&5 $as_echo "$libffi_cv_hidden_visibility_attribute" >&6; } if test $libffi_cv_hidden_visibility_attribute = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1 _ACEOF fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; if test "$enable_debug" = "yes"; then cat >>confdefs.h <<\_ACEOF #define FFI_DEBUG 1 _ACEOF fi fi # Check whether --enable-structs was given. if test "${enable_structs+set}" = set; then enableval=$enable_structs; if test "$enable_structs" = "no"; then cat >>confdefs.h <<\_ACEOF #define FFI_NO_STRUCTS 1 _ACEOF fi fi # Check whether --enable-raw-api was given. if test "${enable_raw_api+set}" = set; then enableval=$enable_raw_api; if test "$enable_raw_api" = "no"; then cat >>confdefs.h <<\_ACEOF #define FFI_NO_RAW_API 1 _ACEOF fi fi # Check whether --enable-purify-safety was given. if test "${enable_purify_safety+set}" = set; then enableval=$enable_purify_safety; if test "$enable_purify_safety" = "yes"; then cat >>confdefs.h <<\_ACEOF #define USING_PURIFY 1 _ACEOF fi fi ac_config_commands="$ac_config_commands include" ac_config_commands="$ac_config_commands src" ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile" 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' 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_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MIPS_IRIX_TRUE}" && test -z "${MIPS_IRIX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"MIPS_IRIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"MIPS_IRIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MIPS_LINUX_TRUE}" && test -z "${MIPS_LINUX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"MIPS_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"MIPS_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SPARC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X86_TRUE}" && test -z "${X86_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"X86\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"X86\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X86_WIN32_TRUE}" && test -z "${X86_WIN32_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"X86_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"X86_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X86_DARWIN_TRUE}" && test -z "${X86_DARWIN_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"X86_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"X86_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X86_FREEBSD_TRUE}" && test -z "${X86_FREEBSD_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"X86_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"X86_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ALPHA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ALPHA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${IA64_TRUE}" && test -z "${IA64_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"IA64\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"IA64\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${M32R_TRUE}" && test -z "${M32R_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"M32R\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"M32R\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${M68K_TRUE}" && test -z "${M68K_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"M68K\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"M68K\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"POWERPC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${POWERPC_AIX_TRUE}" && test -z "${POWERPC_AIX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"POWERPC_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${POWERPC_DARWIN_TRUE}" && test -z "${POWERPC_DARWIN_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"POWERPC_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${POWERPC_FREEBSD_TRUE}" && test -z "${POWERPC_FREEBSD_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"POWERPC_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ARM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ARM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LIBFFI_CRIS_TRUE}" && test -z "${LIBFFI_CRIS_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"LIBFFI_CRIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"LIBFFI_CRIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FRV_TRUE}" && test -z "${FRV_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"FRV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"FRV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${S390_TRUE}" && test -z "${S390_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"S390\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"S390\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X86_64_TRUE}" && test -z "${X86_64_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"X86_64\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"X86_64\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SH_TRUE}" && test -z "${SH_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SH64_TRUE}" && test -z "${SH64_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"SH64\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"SH64\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PA_TRUE}" && test -z "${PA_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"PA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"PA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $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 || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libffi $as_me 2.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent 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 links: $config_links Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ libffi config.status 2.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_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" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" TARGETDIR="$TARGETDIR" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;; "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;; "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_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_LINKS+set}" = set || CONFIG_LINKS=$config_links 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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in "$ac_file" | "$ac_file":* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for "$ac_file"" >`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :L) # # CONFIG_LINK # if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then : else # Prefer the file from the source tree if names are identical. if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then ac_source=$srcdir/$ac_source fi { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;} if test ! -r "$ac_source"; then { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 $as_echo "$as_me: error: $ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi rm -f "$ac_file" # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; *) ac_rel_source=$ac_top_build_prefix$ac_source ;; esac ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || ln "$ac_source" "$ac_file" 2>/dev/null || cp -p "$ac_source" "$ac_file" || { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 $as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} { (exit 1); exit 1; }; } fi ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "include":C) test -d include || mkdir include ;; "src":C) test -d src || mkdir src test -d src/$TARGETDIR || mkdir src/$TARGETDIR ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi gauche-c-wrapper-0.6.1.orig/libffi/configure.ac0000644000000000000000000002125311237307544016227 0ustar dnl Process this with autoconf to create configure AC_PREREQ(2.59) AC_INIT([libffi], [2.1], [http://gcc.gnu.org/bugs.html]) AC_CONFIG_HEADERS([fficonfig.h]) AC_CANONICAL_SYSTEM . ${srcdir}/configure.host AM_INIT_AUTOMAKE AC_PROG_CC AM_PROG_AS AM_PROG_CC_C_O AC_PROG_LIBTOOL AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_FUNCS(mmap) AC_FUNC_MMAP_BLACKLIST TARGETDIR="unknown" case "$host" in i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-gnu*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; i*86-*-freebsd* | i*86-*-kfreebsd*-gnu) TARGET=X86_FREEBSD; TARGETDIR=x86;; i*86-*-netbsdelf* | i*86-*-knetbsd*-gnu) TARGET=X86; TARGETDIR=x86;; i*86-*-rtems*) TARGET=X86; TARGETDIR=x86;; i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;; i*86-*-darwin*) TARGET=X86_DARWIN; TARGETDIR=x86;; i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;; i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; frv-*-*) TARGET=FRV; TARGETDIR=frv;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; sparc-*-linux* | sparc-*-netbsdelf* | sparc-*-knetbsd*-gnu) TARGET=SPARC; TARGETDIR=sparc;; sparc*-*-rtems*) TARGET=SPARC; TARGETDIR=sparc;; sparc64-*-linux* | sparc64-*-netbsd* | sparc64-*-knetbsd*-gnu) TARGET=SPARC; TARGETDIR=sparc;; alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m32r*-*-linux* ) TARGET=M32R; TARGETDIR=m32r;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; mips64*-*);; mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; powerpc-*-freebsd*) TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc;; powerpc*-*-rtems*) TARGET=POWERPC; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; arm*-*-netbsdelf* | arm*-*-knetbsd*-gnu) TARGET=ARM; TARGETDIR=arm;; arm*-*-rtems*) TARGET=ARM; TARGETDIR=arm;; cris-*-*) TARGET=LIBFFI_CRIS; TARGETDIR=cris;; s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; x86_64-*-linux* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu | x86_64-*-netbsd*) TARGET=X86_64; TARGETDIR=x86;; sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; sh-*-rtems*) TARGET=SH; TARGETDIR=sh;; sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;; hppa-*-linux* | parisc-*-linux*) TARGET=PA; TARGETDIR=pa;; esac if test $TARGETDIR = unknown; then AC_MSG_ERROR(["libffi has not been ported to $host."]) fi AM_CONDITIONAL(MIPS_IRIX, test x$TARGET = xMIPS_IRIX) AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN) AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA) AM_CONDITIONAL(IA64, test x$TARGET = xIA64) AM_CONDITIONAL(M32R, test x$TARGET = xM32R) AM_CONDITIONAL(M68K, test x$TARGET = xM68K) AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC) AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD) AM_CONDITIONAL(ARM, test x$TARGET = xARM) AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS) AM_CONDITIONAL(FRV, test x$TARGET = xFRV) AM_CONDITIONAL(S390, test x$TARGET = xS390) AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) AM_CONDITIONAL(SH, test x$TARGET = xSH) AM_CONDITIONAL(SH64, test x$TARGET = xSH64) AM_CONDITIONAL(PA, test x$TARGET = xPA) case x$TARGET in xMIPS*) TARGET=MIPS ;; *) ;; esac AC_HEADER_STDC AC_CHECK_FUNCS(memcpy) AC_FUNC_ALLOCA AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(long double) # Also AC_SUBST this variable for ffi.h. HAVE_LONG_DOUBLE=0 if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then if test $ac_cv_sizeof_long_double != 0; then HAVE_LONG_DOUBLE=1 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double]) fi fi AC_SUBST(HAVE_LONG_DOUBLE) AC_C_BIGENDIAN if test x$TARGET = xSPARC; then AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs], libffi_cv_as_sparc_ua_pcrel, [ save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS -shared" AC_TRY_LINK([asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");],, [libffi_cv_as_sparc_ua_pcrel=yes], [libffi_cv_as_sparc_ua_pcrel=no]) CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"]) if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1, [Define if your assembler and linker support unaligned PC relative relocs.]) fi AC_CACHE_CHECK([assembler .register pseudo-op support], libffi_cv_as_register_pseudo_op, [ libffi_cv_as_register_pseudo_op=unknown # Check if we have .register AC_TRY_COMPILE([asm (".register %g2, #scratch");],, [libffi_cv_as_register_pseudo_op=yes], [libffi_cv_as_register_pseudo_op=no]) ]) if test "x$libffi_cv_as_register_pseudo_op" = xyes; then AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1, [Define if your assembler supports .register.]) fi fi AC_CACHE_CHECK([whether .eh_frame section should be read-only], libffi_cv_ro_eh_frame, [ libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then libffi_cv_ro_eh_frame=yes elif grep '.section.*eh_frame.*#alloc' conftest.c \ | grep -v '#write' > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi rm -f conftest.* ]) if test "x$libffi_cv_ro_eh_frame" = xyes; then AC_DEFINE(HAVE_RO_EH_FRAME, 1, [Define if .eh_frame sections should be read-only.]) AC_DEFINE(EH_FRAME_FLAGS, "a", [Define to the flags needed for the .section .eh_frame directive.]) else AC_DEFINE(EH_FRAME_FLAGS, "aw", [Define to the flags needed for the .section .eh_frame directive.]) fi AC_CACHE_CHECK([for __attribute__((visibility("hidden")))], libffi_cv_hidden_visibility_attribute, [ echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c libffi_cv_hidden_visibility_attribute=no if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then if grep '\.hidden.*foo' conftest.s >/dev/null; then libffi_cv_hidden_visibility_attribute=yes fi fi rm -f conftest.* ]) if test $libffi_cv_hidden_visibility_attribute = yes; then AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1, [Define if __attribute__((visibility("hidden"))) is supported.]) fi AH_BOTTOM([ #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE #ifdef LIBFFI_ASM #define FFI_HIDDEN(name) .hidden name #else #define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) #endif #else #ifdef LIBFFI_ASM #define FFI_HIDDEN(name) #else #define FFI_HIDDEN #endif #endif ]) AC_SUBST(TARGET) AC_SUBST(TARGETDIR) AC_SUBST(SHELL) AC_ARG_ENABLE(debug, [ --enable-debug debugging mode], if test "$enable_debug" = "yes"; then AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.]) fi) AC_ARG_ENABLE(structs, [ --disable-structs omit code for struct support], if test "$enable_structs" = "no"; then AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.]) fi) AC_ARG_ENABLE(raw-api, [ --disable-raw-api make the raw api unavailable], if test "$enable_raw_api" = "no"; then AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.]) fi) AC_ARG_ENABLE(purify-safety, [ --enable-purify-safety purify-safe mode], if test "$enable_purify_safety" = "yes"; then AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) fi) AC_CONFIG_COMMANDS(include, [test -d include || mkdir include]) AC_CONFIG_COMMANDS(src, [ test -d src || mkdir src test -d src/$TARGETDIR || mkdir src/$TARGETDIR ], [TARGETDIR="$TARGETDIR"]) AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile) AC_OUTPUT gauche-c-wrapper-0.6.1.orig/libffi/configure.host0000644000000000000000000000041311237307544016614 0ustar # configure.host # # This shell script handles all host based configuration for libffi. # # THIS TABLE IS SORTED. KEEP IT THAT WAY. case "${host}" in frv*-elf) LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ ;; esac gauche-c-wrapper-0.6.1.orig/libffi/depcomp0000755000000000000000000003710011237307544015314 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gauche-c-wrapper-0.6.1.orig/libffi/fficonfig.h.in0000644000000000000000000001067011237307544016452 0ustar /* fficonfig.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to the flags needed for the .section .eh_frame directive. */ #undef EH_FRAME_FLAGS /* Define this if you want extra debugging. */ #undef FFI_DEBUG /* Define this is you do not want support for the raw API. */ #undef FFI_NO_RAW_API /* Define this is you do not want support for aggregate types. */ #undef FFI_NO_STRUCTS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if your assembler supports .register. */ #undef HAVE_AS_REGISTER_PSEUDO_OP /* Define if your assembler and linker support unaligned PC relative relocs. */ #undef HAVE_AS_SPARC_UA_PCREL /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if __attribute__((visibility("hidden"))) is supported. */ #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the long double type and it is bigger than a double */ #undef HAVE_LONG_DOUBLE /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define if mmap with MAP_ANON(YMOUS) works. */ #undef HAVE_MMAP_ANON /* Define if mmap of /dev/zero works. */ #undef HAVE_MMAP_DEV_ZERO /* Define if read-only mmap of a plain file works. */ #undef HAVE_MMAP_FILE /* Define if .eh_frame sections should be read-only. */ #undef HAVE_RO_EH_FRAME /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the 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 /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `double', as computed by sizeof. */ #undef SIZEOF_DOUBLE /* The size of `long double', as computed by sizeof. */ #undef SIZEOF_LONG_DOUBLE /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define this if you are using Purify and want to suppress spurious messages. */ #undef USING_PURIFY /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE #ifdef LIBFFI_ASM #define FFI_HIDDEN(name) .hidden name #else #define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) #endif #else #ifdef LIBFFI_ASM #define FFI_HIDDEN(name) #else #define FFI_HIDDEN #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/include/0002755000000000000000000000000011237307543015362 5ustar gauche-c-wrapper-0.6.1.orig/libffi/include/ffi.h.in0000644000000000000000000002166711237307543016716 0ustar /* -----------------------------------------------------------------*-C-*- libffi @VERSION@ - Copyright (c) 1996-2003 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ /* ------------------------------------------------------------------- The basic API is described in the README file. The raw API is designed to bypass some of the argument packing and unpacking on architectures for which it can be avoided. The closure API allows interpreted functions to be packaged up inside a C function pointer, so that they can be called as C functions, with no understanding on the client side that they are interpreted. It can also be used in other cases in which it is necessary to package up a user specified parameter and a function pointer as a single function pointer. The closure API must be implemented in order to get its functionality, e.g. for use by gij. Routines are provided to emulate the raw API if the underlying platform doesn't allow faster implementation. More details on the raw and cloure API can be found in: http://gcc.gnu.org/ml/java/1999-q3/msg00138.html and http://gcc.gnu.org/ml/java/1999-q3/msg00174.html -------------------------------------------------------------------- */ #ifndef LIBFFI_H #define LIBFFI_H #ifdef __cplusplus extern "C" { #endif /* Specify which architecture libffi is configured for. */ #define @TARGET@ /* ---- System configuration information --------------------------------- */ #include #ifndef LIBFFI_ASM #include #include /* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). But we can find it either under the correct ANSI name, or under GNU C's internal name. */ #ifdef LONG_LONG_MAX # define FFI_LONG_LONG_MAX LONG_LONG_MAX #else # ifdef LLONG_MAX # define FFI_LONG_LONG_MAX LLONG_MAX # else # ifdef __GNUC__ # define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ # endif # endif #endif #if SCHAR_MAX == 127 # define ffi_type_uchar ffi_type_uint8 # define ffi_type_schar ffi_type_sint8 #else #error "char size not supported" #endif #if SHRT_MAX == 32767 # define ffi_type_ushort ffi_type_uint16 # define ffi_type_sshort ffi_type_sint16 #elif SHRT_MAX == 2147483647 # define ffi_type_ushort ffi_type_uint32 # define ffi_type_sshort ffi_type_sint32 #else #error "short size not supported" #endif #if INT_MAX == 32767 # define ffi_type_uint ffi_type_uint16 # define ffi_type_sint ffi_type_sint16 #elif INT_MAX == 2147483647 # define ffi_type_uint ffi_type_uint32 # define ffi_type_sint ffi_type_sint32 #elif INT_MAX == 9223372036854775807 # define ffi_type_uint ffi_type_uint64 # define ffi_type_sint ffi_type_sint64 #else #error "int size not supported" #endif #define ffi_type_ulong ffi_type_uint64 #define ffi_type_slong ffi_type_sint64 #if LONG_MAX == 2147483647 # if FFI_LONG_LONG_MAX != 9223372036854775807 #error "no 64-bit data type supported" # endif #elif LONG_MAX != 9223372036854775807 #error "long size not supported" #endif /* The closure code assumes that this works on pointers, i.e. a size_t */ /* can hold a pointer. */ typedef struct _ffi_type { size_t size; unsigned short alignment; unsigned short type; /*@null@*/ struct _ffi_type **elements; } ffi_type; /* These are defined in types.c */ extern ffi_type ffi_type_void; extern ffi_type ffi_type_uint8; extern ffi_type ffi_type_sint8; extern ffi_type ffi_type_uint16; extern ffi_type ffi_type_sint16; extern ffi_type ffi_type_uint32; extern ffi_type ffi_type_sint32; extern ffi_type ffi_type_uint64; extern ffi_type ffi_type_sint64; extern ffi_type ffi_type_float; extern ffi_type ffi_type_double; extern ffi_type ffi_type_longdouble; extern ffi_type ffi_type_pointer; typedef enum { FFI_OK = 0, FFI_BAD_TYPEDEF, FFI_BAD_ABI } ffi_status; typedef unsigned FFI_TYPE; typedef struct { ffi_abi abi; unsigned nargs; /*@dependent@*/ ffi_type **arg_types; /*@dependent@*/ ffi_type *rtype; unsigned bytes; unsigned flags; #ifdef FFI_EXTRA_CIF_FIELDS FFI_EXTRA_CIF_FIELDS; #endif } ffi_cif; /* ---- Definitions for the raw API -------------------------------------- */ #ifndef FFI_SIZEOF_ARG # if LONG_MAX == 2147483647 # define FFI_SIZEOF_ARG 4 # elif LONG_MAX == 9223372036854775807 # define FFI_SIZEOF_ARG 8 # endif #endif typedef union { ffi_sarg sint; ffi_arg uint; float flt; char data[FFI_SIZEOF_ARG]; void* ptr; } ffi_raw; void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ ffi_raw *avalue); void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); size_t ffi_raw_size (ffi_cif *cif); /* This is analogous to the raw API, except it uses Java parameter */ /* packing, even on 64-bit machines. I.e. on 64-bit machines */ /* longs and doubles are followed by an empty 64-bit word. */ void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ ffi_raw *avalue); void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); size_t ffi_java_raw_size (ffi_cif *cif); /* ---- Definitions for closures ----------------------------------------- */ #if FFI_CLOSURES typedef struct { char tramp[FFI_TRAMPOLINE_SIZE]; ffi_cif *cif; void (*fun)(ffi_cif*,void*,void**,void*); void *user_data; } ffi_closure __attribute__((aligned (8))); ffi_status ffi_prep_closure (ffi_closure*, ffi_cif *, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data); typedef struct { char tramp[FFI_TRAMPOLINE_SIZE]; ffi_cif *cif; #if !FFI_NATIVE_RAW_API /* if this is enabled, then a raw closure has the same layout as a regular closure. We use this to install an intermediate handler to do the transaltion, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); void *this_closure; #endif void (*fun)(ffi_cif*,void*,ffi_raw*,void*); void *user_data; } ffi_raw_closure; ffi_status ffi_prep_raw_closure (ffi_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data); ffi_status ffi_prep_java_raw_closure (ffi_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data); #endif /* FFI_CLOSURES */ /* ---- Public interface definition -------------------------------------- */ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, ffi_abi abi, unsigned int nargs, /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, /*@dependent@*/ ffi_type **atypes); void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue); /* Useful for eliminating compiler warnings */ #define FFI_FN(f) ((void (*)())f) /* ---- Definitions shared with assembly code ---------------------------- */ #endif /* If these change, update src/mips/ffitarget.h. */ #define FFI_TYPE_VOID 0 #define FFI_TYPE_INT 1 #define FFI_TYPE_FLOAT 2 #define FFI_TYPE_DOUBLE 3 #if @HAVE_LONG_DOUBLE@ #define FFI_TYPE_LONGDOUBLE 4 #else #define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE #endif #define FFI_TYPE_UINT8 5 #define FFI_TYPE_SINT8 6 #define FFI_TYPE_UINT16 7 #define FFI_TYPE_SINT16 8 #define FFI_TYPE_UINT32 9 #define FFI_TYPE_SINT32 10 #define FFI_TYPE_UINT64 11 #define FFI_TYPE_SINT64 12 #define FFI_TYPE_STRUCT 13 #define FFI_TYPE_POINTER 14 /* This should always refer to the last type code (for sanity checks) */ #define FFI_TYPE_LAST FFI_TYPE_POINTER #ifdef __cplusplus } #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/include/ffi_common.h0000644000000000000000000000466411237307543017657 0ustar /* ----------------------------------------------------------------------- ffi_common.h - Copyright (c) 1996 Red Hat, Inc. Common internal definitions and macros. Only necessary for building libffi. ----------------------------------------------------------------------- */ #ifndef FFI_COMMON_H #define FFI_COMMON_H #ifdef __cplusplus extern "C" { #endif #include /* Do not move this. Some versions of AIX are very picky about where this is positioned. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif #endif /* Check for the existence of memcpy. */ #if STDC_HEADERS # include #else # ifndef HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if defined(FFI_DEBUG) #include #endif #ifdef FFI_DEBUG /*@exits@*/ void ffi_assert(/*@temp@*/ char *expr, /*@temp@*/ char *file, int line); void ffi_stop_here(void); void ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a, /*@temp@*/ char *file, int line); #define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__)) #define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l))) #define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__) #else #define FFI_ASSERT(x) #define FFI_ASSERT_AT(x, f, l) #define FFI_ASSERT_VALID_TYPE(x) #endif #define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) #define ALIGN_DOWN(v, a) (((size_t) (v)) & -a) /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif); /* Extended cif, used in callback from assembly routine */ typedef struct { /*@dependent@*/ ffi_cif *cif; /*@dependent@*/ void *rvalue; /*@dependent@*/ void **avalue; } extended_cif; /* Terse sized type definitions. */ typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); typedef signed int SINT8 __attribute__((__mode__(__QI__))); typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); typedef signed int SINT16 __attribute__((__mode__(__HI__))); typedef unsigned int UINT32 __attribute__((__mode__(__SI__))); typedef signed int SINT32 __attribute__((__mode__(__SI__))); typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); typedef signed int SINT64 __attribute__((__mode__(__DI__))); typedef float FLOAT32; #ifdef __cplusplus } #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/include/Makefile.am0000644000000000000000000000026411237307543017416 0ustar ## Process this with automake to create Makefile.in AUTOMAKE_OPTIONS=foreign DISTCLEANFILES=ffitarget.h EXTRA_DIST=ffi.h.in ffi_common.h hackdir=$(includedir) hack_DATA=ffi.h gauche-c-wrapper-0.6.1.orig/libffi/include/Makefile.in0000644000000000000000000002644411237307543017437 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ffi.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/fficonfig.h CONFIG_CLEAN_FILES = ffi.h ffitarget.h SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(hackdir)" hackDATA_INSTALL = $(INSTALL_DATA) DATA = $(hack_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALPHA_FALSE = @ALPHA_FALSE@ ALPHA_TRUE = @ALPHA_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARM_FALSE = @ARM_FALSE@ ARM_TRUE = @ARM_TRUE@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FRV_FALSE = @FRV_FALSE@ FRV_TRUE = @FRV_TRUE@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ IA64_FALSE = @IA64_FALSE@ IA64_TRUE = @IA64_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBFFI_CRIS_FALSE = @LIBFFI_CRIS_FALSE@ LIBFFI_CRIS_TRUE = @LIBFFI_CRIS_TRUE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M32R_FALSE = @M32R_FALSE@ M32R_TRUE = @M32R_TRUE@ M68K_FALSE = @M68K_FALSE@ M68K_TRUE = @M68K_TRUE@ MAKEINFO = @MAKEINFO@ MIPS_IRIX_FALSE = @MIPS_IRIX_FALSE@ MIPS_IRIX_TRUE = @MIPS_IRIX_TRUE@ MIPS_LINUX_FALSE = @MIPS_LINUX_FALSE@ MIPS_LINUX_TRUE = @MIPS_LINUX_TRUE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PA_FALSE = @PA_FALSE@ PA_TRUE = @PA_TRUE@ POWERPC_AIX_FALSE = @POWERPC_AIX_FALSE@ POWERPC_AIX_TRUE = @POWERPC_AIX_TRUE@ POWERPC_DARWIN_FALSE = @POWERPC_DARWIN_FALSE@ POWERPC_DARWIN_TRUE = @POWERPC_DARWIN_TRUE@ POWERPC_FALSE = @POWERPC_FALSE@ POWERPC_FREEBSD_FALSE = @POWERPC_FREEBSD_FALSE@ POWERPC_FREEBSD_TRUE = @POWERPC_FREEBSD_TRUE@ POWERPC_TRUE = @POWERPC_TRUE@ RANLIB = @RANLIB@ S390_FALSE = @S390_FALSE@ S390_TRUE = @S390_TRUE@ SET_MAKE = @SET_MAKE@ SH64_FALSE = @SH64_FALSE@ SH64_TRUE = @SH64_TRUE@ SHELL = @SHELL@ SH_FALSE = @SH_FALSE@ SH_TRUE = @SH_TRUE@ SPARC_FALSE = @SPARC_FALSE@ SPARC_TRUE = @SPARC_TRUE@ STRIP = @STRIP@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ VERSION = @VERSION@ X86_64_FALSE = @X86_64_FALSE@ X86_64_TRUE = @X86_64_TRUE@ X86_DARWIN_FALSE = @X86_DARWIN_FALSE@ X86_DARWIN_TRUE = @X86_DARWIN_TRUE@ X86_FALSE = @X86_FALSE@ X86_FREEBSD_FALSE = @X86_FREEBSD_FALSE@ X86_FREEBSD_TRUE = @X86_FREEBSD_TRUE@ X86_TRUE = @X86_TRUE@ X86_WIN32_FALSE = @X86_WIN32_FALSE@ X86_WIN32_TRUE = @X86_WIN32_TRUE@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = ffitarget.h EXTRA_DIST = ffi.h.in ffi_common.h hackdir = $(includedir) hack_DATA = ffi.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ffi.h: $(top_builddir)/config.status $(srcdir)/ffi.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-hackDATA: $(hack_DATA) @$(NORMAL_INSTALL) test -z "$(hackdir)" || $(mkdir_p) "$(DESTDIR)$(hackdir)" @list='$(hack_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(hackDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(hackdir)/$$f'"; \ $(hackDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(hackdir)/$$f"; \ done uninstall-hackDATA: @$(NORMAL_UNINSTALL) @list='$(hack_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(hackdir)/$$f'"; \ rm -f "$(DESTDIR)$(hackdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(hackdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-hackDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-hackDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-hackDATA install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-hackDATA uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gauche-c-wrapper-0.6.1.orig/libffi/install-sh0000755000000000000000000001270111237307544015743 0ustar #!/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 : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : 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 : 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 : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; 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 : 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 :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 gauche-c-wrapper-0.6.1.orig/libffi/libtool-version0000644000000000000000000000037111237307544017011 0ustar # This file is used to maintain libtool version info for libffi. See # the libtool manual to understand the meaning of the fields. This is # a separate file so that version updates don't involve re-running # automake. # CURRENT:REVISION:AGE 4:1:0 gauche-c-wrapper-0.6.1.orig/libffi/LICENSE0000644000000000000000000000204411237307544014743 0ustar libffi - Copyright (c) 1996-2003 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gauche-c-wrapper-0.6.1.orig/libffi/ltcf-c.sh0000644000000000000000000010230611237307544015444 0ustar #### 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 , 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 <&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 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 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$BUILD_CC" != "x" ; then $BUILD_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* | knetbsd*-gnu) 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 <&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 ;; tpf*) ld_shlibs=yes ;; *) 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 file_list_spec='${wl}-f,' # 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"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac # Disable shared library build on OS-X older than 10.3. case $host_os in darwin[1-6]*) can_build_shared=no ;; darwin7*) can_build_shared=yes ;; esac output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, # it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes ;; 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* | kfreebsd*-gnu) 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* | knetbsd*-gnu) 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 ac_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 gauche-c-wrapper-0.6.1.orig/libffi/ltconfig0000755000000000000000000025174111237307544015503 0ustar #! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 </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= file_list_spec= ## 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 <&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= shrext=".so" 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.so instead of # lib.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" lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes version_type=darwin need_lib_prefix=no need_version=no # Disable shared library build on OS-X older than 10.3. case $host_os in darwin[1-6]*) can_build_shared=no ;; darwin7*) can_build_shared=yes ;; esac library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; 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 ;; kfreebsd*-gnu | knetbsd*-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 shlibpath_overrides_runpath=yes 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 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 ;; tpf*) 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=no hardcode_into_libs=yes dynamic_linker='GNU/Linux ld.so' ;; 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 <&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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> 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* | aix5*) 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 <&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 < /* 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 <&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 <&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 < /* 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 <&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 < 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 < #endif #include #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 < #endif #include #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 file_list_spec; 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 < "$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 , 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 < "$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 <> "$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" # Shared library suffix (normally ".so"). shrext='$shrext' # 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 # Specify filename containing input files. file_list_spec=$file_list_spec # with_gnu_ld value with_gnu_ld=$with_gnu_ld 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 # #undef WIN32_LEAN_AND_MEAN # #include # # #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 # 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 /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* 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> "$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: gauche-c-wrapper-0.6.1.orig/libffi/ltmain.sh0000644000000000000000000055461011237307544015571 0ustar # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.20 TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # 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 "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # 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. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # 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 ;; 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 $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" status=$? if test "$status" -ne 0 && test ! -d "$my_xdir"; then exit $status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # 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" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 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" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # 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" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --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 $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE 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 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 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 $EXIT_FAILURE 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= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= 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. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.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 $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 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 $EXIT_FAILURE 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 $EXIT_FAILURE" 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 $EXIT_FAILURE" 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 "$progpath" "$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 $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $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 </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 $EXIT_FAILURE 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 <> ${libobj}T </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 $EXIT_FAILURE 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 <> ${libobj}T <&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" 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 $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_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 | grep "^# 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE ;; 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 ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= 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 $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch) prev=darwin_framework compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix 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* | /*-*-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 $EXIT_FAILURE 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 ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) # 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 compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext 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 ;; -precious-files-regex) prev=precious_regex continue ;; -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 $EXIT_FAILURE ;; 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 ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= 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= 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 ;; -XCClinker) prev=xcclinker 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 | grep "^# 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 oldlibs= # 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 $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; 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 if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi 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= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 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 fi 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 $EXIT_FAILURE ;; 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,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 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 for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done 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 else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_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 fi ;; *) ;; esac fi 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" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 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) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $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" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." 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" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then 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 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 $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE 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 variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then 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 $EXIT_FAILURE 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" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" 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 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi 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 $EXIT_FAILURE 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" # used for prog,scan pass 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 if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # 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 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 fi 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 if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if 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 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* | mingw*) 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'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $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'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $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" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac 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" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi 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 $EXIT_FAILURE 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" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi 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 # 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 system can not link to static lib archive $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 "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 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 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" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi 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="$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 $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_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 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 # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. 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 # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi 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/-version-number' 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 shared_ext=\"$shrext_cmds\" 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 $EXIT_FAILURE 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 shared_ext=\"$shrext_cmds\" 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 $EXIT_FAILURE 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/-version-number' 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. 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 $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # 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]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; 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 $EXIT_FAILURE 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="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$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" -ne 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 $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac 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}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi 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. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # 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 behavior. 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 </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 fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $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" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; 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 potlib="$potent_lib" # see symlink-check above in file_magic test 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 fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $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" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -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" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi 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 shared_ext=\"$shrext_cmds\" 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 if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" 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 cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi 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 tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" 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" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" 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 "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; 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 output_la=`$echo "X$output" | $Xsed -e "$basename"` # 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/$output_la-${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" : ".*" 2>/dev/null` && 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/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${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\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. 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 "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_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 $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS 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 $EXIT_FAILURE 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" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" 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" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $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 $EXIT_SUCCESS 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 $EXIT_SUCCESS 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" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; 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 case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; 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" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi 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=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 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/$outputname.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/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.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" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | 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 void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 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 $EXIT_FAILURE ;; 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 $EXIT_SUCCESS 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 $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --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 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${outputname}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 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. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 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 $EXIT_FAILURE 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 # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE 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 $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; 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="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $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 fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds 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 # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" 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. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" 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 | *mingw*,*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 # Should we warn about portability when linking against -modules? shouldnotlink=$module # 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 $EXIT_SUCCESS ;; # 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" | 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) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -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 $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 $EXIT_FAILURE ;; 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 | grep "^# 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 $EXIT_FAILURE 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 # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $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 $EXIT_FAILURE 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. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_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 $EXIT_FAILURE ;; 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 $EXIT_SUCCESS ;; *) # 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 # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE 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= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; 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-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $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$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway 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 "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $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 $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS 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. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $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 $EXIT_SUCCESS $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 $EXIT_SUCCESS ;; # 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 $EXIT_FAILURE 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 $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# 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 $EXIT_FAILURE 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 $EXIT_FAILURE 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 | grep "^# 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 environment 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 $EXIT_SUCCESS 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 $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" 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 | grep "^# 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. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 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. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 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 | grep "^# 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 ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # 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 $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE 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. Report bugs to ." exit $EXIT_SUCCESS ;; 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 -precious-files-regex REGEX don't remove output files matching REGEX -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 $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # 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: gauche-c-wrapper-0.6.1.orig/libffi/Makefile.am0000644000000000000000000000645711237307544016006 0ustar ## Process this with automake to create Makefile.in AUTOMAKE_OPTIONS = foreign subdir-objects SUBDIRS = include EXTRA_DIST = LICENSE ChangeLog.v1 \ src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \ src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \ src/mips/ffi.c src/mips/n32.S src/mips/o32.S \ src/mips/ffitarget.h \ src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ src/powerpc/ffi.c src/powerpc/sysv.S \ src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/powerpc/ppc_closure.S src/powerpc/asm.h \ src/powerpc/aix.S src/powerpc/darwin.S \ src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ src/sparc/ffi.c \ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \ src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \ src/pa/ffi.c src/pa/linux.S src/frv/eabi.S src/frv/ffitarget.h lib_LTLIBRARIES = libffi.la libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c if MIPS_IRIX libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S endif if MIPS_LINUX libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S endif if X86 libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S endif if X86_WIN32 libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S endif if X86_DARWIN libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S endif if X86_FREEBSD libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S endif if SPARC libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S endif if ALPHA libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S endif if IA64 libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S endif if M32R libffi_la_SOURCES += src/m32r/sysv.S src/m32r/ffi.c endif if M68K libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S endif if POWERPC libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S endif if POWERPC_AIX libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S endif if POWERPC_DARWIN libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S endif if POWERPC_FREEBSD libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S endif if ARM libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c endif if LIBFFI_CRIS libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c endif if FRV libffi_la_SOURCES += src/frv/eabi.S src/frv/ffi.c endif if S390 libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c endif if X86_64 libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S endif if SH libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c endif if SH64 libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c endif if PA libffi_la_SOURCES += src/pa/linux.S src/pa/ffi.c endif AM_CFLAGS = -Wall -g -fexceptions libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CCASFLAGS = $(AM_CPPFLAGS) gauche-c-wrapper-0.6.1.orig/libffi/Makefile.in0000644000000000000000000013216311237307544016011 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @MIPS_IRIX_TRUE@am__append_1 = src/mips/ffi.c src/mips/o32.S src/mips/n32.S @MIPS_LINUX_TRUE@am__append_2 = src/mips/ffi.c src/mips/o32.S @X86_TRUE@am__append_3 = src/x86/ffi.c src/x86/sysv.S @X86_WIN32_TRUE@am__append_4 = src/x86/ffi.c src/x86/win32.S @X86_DARWIN_TRUE@am__append_5 = src/x86/ffi.c src/x86/darwin.S @X86_FREEBSD_TRUE@am__append_6 = src/x86/ffi.c src/x86/sysv.S @SPARC_TRUE@am__append_7 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S @ALPHA_TRUE@am__append_8 = src/alpha/ffi.c src/alpha/osf.S @IA64_TRUE@am__append_9 = src/ia64/ffi.c src/ia64/unix.S @M32R_TRUE@am__append_10 = src/m32r/sysv.S src/m32r/ffi.c @M68K_TRUE@am__append_11 = src/m68k/ffi.c src/m68k/sysv.S @POWERPC_TRUE@am__append_12 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S @POWERPC_AIX_TRUE@am__append_13 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S @POWERPC_DARWIN_TRUE@am__append_14 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S @POWERPC_FREEBSD_TRUE@am__append_15 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S @ARM_TRUE@am__append_16 = src/arm/sysv.S src/arm/ffi.c @LIBFFI_CRIS_TRUE@am__append_17 = src/cris/sysv.S src/cris/ffi.c @FRV_TRUE@am__append_18 = src/frv/eabi.S src/frv/ffi.c @S390_TRUE@am__append_19 = src/s390/sysv.S src/s390/ffi.c @X86_64_TRUE@am__append_20 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S @SH_TRUE@am__append_21 = src/sh/sysv.S src/sh/ffi.c @SH64_TRUE@am__append_22 = src/sh64/sysv.S src/sh64/ffi.c @PA_TRUE@am__append_23 = src/pa/linux.S src/pa/ffi.c DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/fficonfig.h.in \ $(top_srcdir)/configure ChangeLog compile config.guess \ config.sub depcomp install-sh ltcf-c.sh ltconfig ltmain.sh \ missing mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = fficonfig.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libffi_la_LIBADD = am__libffi_la_SOURCES_DIST = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c src/mips/ffi.c src/mips/o32.S \ src/mips/n32.S src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ src/x86/darwin.S src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ src/alpha/ffi.c src/alpha/osf.S src/ia64/ffi.c src/ia64/unix.S \ src/m32r/sysv.S src/m32r/ffi.c src/m68k/ffi.c src/m68k/sysv.S \ src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S \ src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/powerpc/ffi_darwin.c src/powerpc/aix.S \ src/powerpc/aix_closure.S src/powerpc/darwin.S \ src/powerpc/darwin_closure.S src/arm/sysv.S src/arm/ffi.c \ src/cris/sysv.S src/cris/ffi.c src/frv/eabi.S src/frv/ffi.c \ src/s390/sysv.S src/s390/ffi.c src/x86/ffi64.c \ src/x86/unix64.S src/sh/sysv.S src/sh/ffi.c src/sh64/sysv.S \ src/sh64/ffi.c src/pa/linux.S src/pa/ffi.c am__dirstamp = $(am__leading_dot)dirstamp @MIPS_IRIX_TRUE@am__objects_1 = src/mips/ffi.lo src/mips/o32.lo \ @MIPS_IRIX_TRUE@ src/mips/n32.lo @MIPS_LINUX_TRUE@am__objects_2 = src/mips/ffi.lo src/mips/o32.lo @X86_TRUE@am__objects_3 = src/x86/ffi.lo src/x86/sysv.lo @X86_WIN32_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/win32.lo @X86_DARWIN_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/darwin.lo @X86_FREEBSD_TRUE@am__objects_6 = src/x86/ffi.lo src/x86/sysv.lo @SPARC_TRUE@am__objects_7 = src/sparc/ffi.lo src/sparc/v8.lo \ @SPARC_TRUE@ src/sparc/v9.lo @ALPHA_TRUE@am__objects_8 = src/alpha/ffi.lo src/alpha/osf.lo @IA64_TRUE@am__objects_9 = src/ia64/ffi.lo src/ia64/unix.lo @M32R_TRUE@am__objects_10 = src/m32r/sysv.lo src/m32r/ffi.lo @M68K_TRUE@am__objects_11 = src/m68k/ffi.lo src/m68k/sysv.lo @POWERPC_TRUE@am__objects_12 = src/powerpc/ffi.lo src/powerpc/sysv.lo \ @POWERPC_TRUE@ src/powerpc/ppc_closure.lo \ @POWERPC_TRUE@ src/powerpc/linux64.lo \ @POWERPC_TRUE@ src/powerpc/linux64_closure.lo @POWERPC_AIX_TRUE@am__objects_13 = src/powerpc/ffi_darwin.lo \ @POWERPC_AIX_TRUE@ src/powerpc/aix.lo \ @POWERPC_AIX_TRUE@ src/powerpc/aix_closure.lo @POWERPC_DARWIN_TRUE@am__objects_14 = src/powerpc/ffi_darwin.lo \ @POWERPC_DARWIN_TRUE@ src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@ src/powerpc/darwin_closure.lo @POWERPC_FREEBSD_TRUE@am__objects_15 = src/powerpc/ffi.lo \ @POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \ @POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo @ARM_TRUE@am__objects_16 = src/arm/sysv.lo src/arm/ffi.lo @LIBFFI_CRIS_TRUE@am__objects_17 = src/cris/sysv.lo src/cris/ffi.lo @FRV_TRUE@am__objects_18 = src/frv/eabi.lo src/frv/ffi.lo @S390_TRUE@am__objects_19 = src/s390/sysv.lo src/s390/ffi.lo @X86_64_TRUE@am__objects_20 = src/x86/ffi64.lo src/x86/unix64.lo \ @X86_64_TRUE@ src/x86/ffi.lo src/x86/sysv.lo @SH_TRUE@am__objects_21 = src/sh/sysv.lo src/sh/ffi.lo @SH64_TRUE@am__objects_22 = src/sh64/sysv.lo src/sh64/ffi.lo @PA_TRUE@am__objects_23 = src/pa/linux.lo src/pa/ffi.lo am_libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ src/raw_api.lo src/java_raw_api.lo $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) \ $(am__objects_14) $(am__objects_15) $(am__objects_16) \ $(am__objects_17) $(am__objects_18) $(am__objects_19) \ $(am__objects_20) $(am__objects_21) $(am__objects_22) \ $(am__objects_23) libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \ $(CCASFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libffi_la_SOURCES) DIST_SOURCES = $(am__libffi_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALPHA_FALSE = @ALPHA_FALSE@ ALPHA_TRUE = @ALPHA_TRUE@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARM_FALSE = @ARM_FALSE@ ARM_TRUE = @ARM_TRUE@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FRV_FALSE = @FRV_FALSE@ FRV_TRUE = @FRV_TRUE@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ IA64_FALSE = @IA64_FALSE@ IA64_TRUE = @IA64_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBFFI_CRIS_FALSE = @LIBFFI_CRIS_FALSE@ LIBFFI_CRIS_TRUE = @LIBFFI_CRIS_TRUE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M32R_FALSE = @M32R_FALSE@ M32R_TRUE = @M32R_TRUE@ M68K_FALSE = @M68K_FALSE@ M68K_TRUE = @M68K_TRUE@ MAKEINFO = @MAKEINFO@ MIPS_IRIX_FALSE = @MIPS_IRIX_FALSE@ MIPS_IRIX_TRUE = @MIPS_IRIX_TRUE@ MIPS_LINUX_FALSE = @MIPS_LINUX_FALSE@ MIPS_LINUX_TRUE = @MIPS_LINUX_TRUE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PA_FALSE = @PA_FALSE@ PA_TRUE = @PA_TRUE@ POWERPC_AIX_FALSE = @POWERPC_AIX_FALSE@ POWERPC_AIX_TRUE = @POWERPC_AIX_TRUE@ POWERPC_DARWIN_FALSE = @POWERPC_DARWIN_FALSE@ POWERPC_DARWIN_TRUE = @POWERPC_DARWIN_TRUE@ POWERPC_FALSE = @POWERPC_FALSE@ POWERPC_FREEBSD_FALSE = @POWERPC_FREEBSD_FALSE@ POWERPC_FREEBSD_TRUE = @POWERPC_FREEBSD_TRUE@ POWERPC_TRUE = @POWERPC_TRUE@ RANLIB = @RANLIB@ S390_FALSE = @S390_FALSE@ S390_TRUE = @S390_TRUE@ SET_MAKE = @SET_MAKE@ SH64_FALSE = @SH64_FALSE@ SH64_TRUE = @SH64_TRUE@ SHELL = @SHELL@ SH_FALSE = @SH_FALSE@ SH_TRUE = @SH_TRUE@ SPARC_FALSE = @SPARC_FALSE@ SPARC_TRUE = @SPARC_TRUE@ STRIP = @STRIP@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ VERSION = @VERSION@ X86_64_FALSE = @X86_64_FALSE@ X86_64_TRUE = @X86_64_TRUE@ X86_DARWIN_FALSE = @X86_DARWIN_FALSE@ X86_DARWIN_TRUE = @X86_DARWIN_TRUE@ X86_FALSE = @X86_FALSE@ X86_FREEBSD_FALSE = @X86_FREEBSD_FALSE@ X86_FREEBSD_TRUE = @X86_FREEBSD_TRUE@ X86_TRUE = @X86_TRUE@ X86_WIN32_FALSE = @X86_WIN32_FALSE@ X86_WIN32_TRUE = @X86_WIN32_TRUE@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AUTOMAKE_OPTIONS = foreign subdir-objects SUBDIRS = include EXTRA_DIST = LICENSE ChangeLog.v1 \ src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \ src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \ src/cris/ffi.c src/cris/sysv.S src/cris/ffitarget.h \ src/mips/ffi.c src/mips/n32.S src/mips/o32.S \ src/mips/ffitarget.h \ src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ src/powerpc/ffi.c src/powerpc/sysv.S \ src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/powerpc/ppc_closure.S src/powerpc/asm.h \ src/powerpc/aix.S src/powerpc/darwin.S \ src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \ src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \ src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \ src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \ src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \ src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \ src/sparc/ffi.c \ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S src/x86/darwin.S \ src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h \ src/pa/ffi.c src/pa/linux.S src/frv/eabi.S src/frv/ffitarget.h lib_LTLIBRARIES = libffi.la libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c $(am__append_1) \ $(am__append_2) $(am__append_3) $(am__append_4) \ $(am__append_5) $(am__append_6) $(am__append_7) \ $(am__append_8) $(am__append_9) $(am__append_10) \ $(am__append_11) $(am__append_12) $(am__append_13) \ $(am__append_14) $(am__append_15) $(am__append_16) \ $(am__append_17) $(am__append_18) $(am__append_19) \ $(am__append_20) $(am__append_21) $(am__append_22) \ $(am__append_23) AM_CFLAGS = -Wall -g -fexceptions libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CCASFLAGS = $(AM_CPPFLAGS) all: fficonfig.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) fficonfig.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status fficonfig.h $(srcdir)/fficonfig.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f fficonfig.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done src/$(am__dirstamp): @$(mkdir_p) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/debug.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/prep_cif.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/types.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/java_raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/mips/$(am__dirstamp): @$(mkdir_p) src/mips @: > src/mips/$(am__dirstamp) src/mips/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/mips/$(DEPDIR) @: > src/mips/$(DEPDIR)/$(am__dirstamp) src/mips/ffi.lo: src/mips/$(am__dirstamp) \ src/mips/$(DEPDIR)/$(am__dirstamp) src/mips/o32.lo: src/mips/$(am__dirstamp) \ src/mips/$(DEPDIR)/$(am__dirstamp) src/mips/n32.lo: src/mips/$(am__dirstamp) \ src/mips/$(DEPDIR)/$(am__dirstamp) src/x86/$(am__dirstamp): @$(mkdir_p) src/x86 @: > src/x86/$(am__dirstamp) src/x86/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/x86/$(DEPDIR) @: > src/x86/$(DEPDIR)/$(am__dirstamp) src/x86/ffi.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/x86/sysv.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/x86/win32.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/x86/darwin.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/sparc/$(am__dirstamp): @$(mkdir_p) src/sparc @: > src/sparc/$(am__dirstamp) src/sparc/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/sparc/$(DEPDIR) @: > src/sparc/$(DEPDIR)/$(am__dirstamp) src/sparc/ffi.lo: src/sparc/$(am__dirstamp) \ src/sparc/$(DEPDIR)/$(am__dirstamp) src/sparc/v8.lo: src/sparc/$(am__dirstamp) \ src/sparc/$(DEPDIR)/$(am__dirstamp) src/sparc/v9.lo: src/sparc/$(am__dirstamp) \ src/sparc/$(DEPDIR)/$(am__dirstamp) src/alpha/$(am__dirstamp): @$(mkdir_p) src/alpha @: > src/alpha/$(am__dirstamp) src/alpha/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/alpha/$(DEPDIR) @: > src/alpha/$(DEPDIR)/$(am__dirstamp) src/alpha/ffi.lo: src/alpha/$(am__dirstamp) \ src/alpha/$(DEPDIR)/$(am__dirstamp) src/alpha/osf.lo: src/alpha/$(am__dirstamp) \ src/alpha/$(DEPDIR)/$(am__dirstamp) src/ia64/$(am__dirstamp): @$(mkdir_p) src/ia64 @: > src/ia64/$(am__dirstamp) src/ia64/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/ia64/$(DEPDIR) @: > src/ia64/$(DEPDIR)/$(am__dirstamp) src/ia64/ffi.lo: src/ia64/$(am__dirstamp) \ src/ia64/$(DEPDIR)/$(am__dirstamp) src/ia64/unix.lo: src/ia64/$(am__dirstamp) \ src/ia64/$(DEPDIR)/$(am__dirstamp) src/m32r/$(am__dirstamp): @$(mkdir_p) src/m32r @: > src/m32r/$(am__dirstamp) src/m32r/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/m32r/$(DEPDIR) @: > src/m32r/$(DEPDIR)/$(am__dirstamp) src/m32r/sysv.lo: src/m32r/$(am__dirstamp) \ src/m32r/$(DEPDIR)/$(am__dirstamp) src/m32r/ffi.lo: src/m32r/$(am__dirstamp) \ src/m32r/$(DEPDIR)/$(am__dirstamp) src/m68k/$(am__dirstamp): @$(mkdir_p) src/m68k @: > src/m68k/$(am__dirstamp) src/m68k/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/m68k/$(DEPDIR) @: > src/m68k/$(DEPDIR)/$(am__dirstamp) src/m68k/ffi.lo: src/m68k/$(am__dirstamp) \ src/m68k/$(DEPDIR)/$(am__dirstamp) src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \ src/m68k/$(DEPDIR)/$(am__dirstamp) src/powerpc/$(am__dirstamp): @$(mkdir_p) src/powerpc @: > src/powerpc/$(am__dirstamp) src/powerpc/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/powerpc/$(DEPDIR) @: > src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/ffi.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/sysv.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/ppc_closure.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/linux64.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/linux64_closure.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/ffi_darwin.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/aix.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/aix_closure.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/darwin.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/powerpc/darwin_closure.lo: src/powerpc/$(am__dirstamp) \ src/powerpc/$(DEPDIR)/$(am__dirstamp) src/arm/$(am__dirstamp): @$(mkdir_p) src/arm @: > src/arm/$(am__dirstamp) src/arm/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/arm/$(DEPDIR) @: > src/arm/$(DEPDIR)/$(am__dirstamp) src/arm/sysv.lo: src/arm/$(am__dirstamp) \ src/arm/$(DEPDIR)/$(am__dirstamp) src/arm/ffi.lo: src/arm/$(am__dirstamp) \ src/arm/$(DEPDIR)/$(am__dirstamp) src/cris/$(am__dirstamp): @$(mkdir_p) src/cris @: > src/cris/$(am__dirstamp) src/cris/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/cris/$(DEPDIR) @: > src/cris/$(DEPDIR)/$(am__dirstamp) src/cris/sysv.lo: src/cris/$(am__dirstamp) \ src/cris/$(DEPDIR)/$(am__dirstamp) src/cris/ffi.lo: src/cris/$(am__dirstamp) \ src/cris/$(DEPDIR)/$(am__dirstamp) src/frv/$(am__dirstamp): @$(mkdir_p) src/frv @: > src/frv/$(am__dirstamp) src/frv/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/frv/$(DEPDIR) @: > src/frv/$(DEPDIR)/$(am__dirstamp) src/frv/eabi.lo: src/frv/$(am__dirstamp) \ src/frv/$(DEPDIR)/$(am__dirstamp) src/frv/ffi.lo: src/frv/$(am__dirstamp) \ src/frv/$(DEPDIR)/$(am__dirstamp) src/s390/$(am__dirstamp): @$(mkdir_p) src/s390 @: > src/s390/$(am__dirstamp) src/s390/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/s390/$(DEPDIR) @: > src/s390/$(DEPDIR)/$(am__dirstamp) src/s390/sysv.lo: src/s390/$(am__dirstamp) \ src/s390/$(DEPDIR)/$(am__dirstamp) src/s390/ffi.lo: src/s390/$(am__dirstamp) \ src/s390/$(DEPDIR)/$(am__dirstamp) src/x86/ffi64.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/x86/unix64.lo: src/x86/$(am__dirstamp) \ src/x86/$(DEPDIR)/$(am__dirstamp) src/sh/$(am__dirstamp): @$(mkdir_p) src/sh @: > src/sh/$(am__dirstamp) src/sh/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/sh/$(DEPDIR) @: > src/sh/$(DEPDIR)/$(am__dirstamp) src/sh/sysv.lo: src/sh/$(am__dirstamp) \ src/sh/$(DEPDIR)/$(am__dirstamp) src/sh/ffi.lo: src/sh/$(am__dirstamp) src/sh/$(DEPDIR)/$(am__dirstamp) src/sh64/$(am__dirstamp): @$(mkdir_p) src/sh64 @: > src/sh64/$(am__dirstamp) src/sh64/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/sh64/$(DEPDIR) @: > src/sh64/$(DEPDIR)/$(am__dirstamp) src/sh64/sysv.lo: src/sh64/$(am__dirstamp) \ src/sh64/$(DEPDIR)/$(am__dirstamp) src/sh64/ffi.lo: src/sh64/$(am__dirstamp) \ src/sh64/$(DEPDIR)/$(am__dirstamp) src/pa/$(am__dirstamp): @$(mkdir_p) src/pa @: > src/pa/$(am__dirstamp) src/pa/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) src/pa/$(DEPDIR) @: > src/pa/$(DEPDIR)/$(am__dirstamp) src/pa/linux.lo: src/pa/$(am__dirstamp) \ src/pa/$(DEPDIR)/$(am__dirstamp) src/pa/ffi.lo: src/pa/$(am__dirstamp) src/pa/$(DEPDIR)/$(am__dirstamp) libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libffi_la_LDFLAGS) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/alpha/ffi.$(OBJEXT) -rm -f src/alpha/ffi.lo -rm -f src/alpha/osf.$(OBJEXT) -rm -f src/alpha/osf.lo -rm -f src/arm/ffi.$(OBJEXT) -rm -f src/arm/ffi.lo -rm -f src/arm/sysv.$(OBJEXT) -rm -f src/arm/sysv.lo -rm -f src/cris/ffi.$(OBJEXT) -rm -f src/cris/ffi.lo -rm -f src/cris/sysv.$(OBJEXT) -rm -f src/cris/sysv.lo -rm -f src/debug.$(OBJEXT) -rm -f src/debug.lo -rm -f src/frv/eabi.$(OBJEXT) -rm -f src/frv/eabi.lo -rm -f src/frv/ffi.$(OBJEXT) -rm -f src/frv/ffi.lo -rm -f src/ia64/ffi.$(OBJEXT) -rm -f src/ia64/ffi.lo -rm -f src/ia64/unix.$(OBJEXT) -rm -f src/ia64/unix.lo -rm -f src/java_raw_api.$(OBJEXT) -rm -f src/java_raw_api.lo -rm -f src/m32r/ffi.$(OBJEXT) -rm -f src/m32r/ffi.lo -rm -f src/m32r/sysv.$(OBJEXT) -rm -f src/m32r/sysv.lo -rm -f src/m68k/ffi.$(OBJEXT) -rm -f src/m68k/ffi.lo -rm -f src/m68k/sysv.$(OBJEXT) -rm -f src/m68k/sysv.lo -rm -f src/mips/ffi.$(OBJEXT) -rm -f src/mips/ffi.lo -rm -f src/mips/n32.$(OBJEXT) -rm -f src/mips/n32.lo -rm -f src/mips/o32.$(OBJEXT) -rm -f src/mips/o32.lo -rm -f src/pa/ffi.$(OBJEXT) -rm -f src/pa/ffi.lo -rm -f src/pa/linux.$(OBJEXT) -rm -f src/pa/linux.lo -rm -f src/powerpc/aix.$(OBJEXT) -rm -f src/powerpc/aix.lo -rm -f src/powerpc/aix_closure.$(OBJEXT) -rm -f src/powerpc/aix_closure.lo -rm -f src/powerpc/darwin.$(OBJEXT) -rm -f src/powerpc/darwin.lo -rm -f src/powerpc/darwin_closure.$(OBJEXT) -rm -f src/powerpc/darwin_closure.lo -rm -f src/powerpc/ffi.$(OBJEXT) -rm -f src/powerpc/ffi.lo -rm -f src/powerpc/ffi_darwin.$(OBJEXT) -rm -f src/powerpc/ffi_darwin.lo -rm -f src/powerpc/linux64.$(OBJEXT) -rm -f src/powerpc/linux64.lo -rm -f src/powerpc/linux64_closure.$(OBJEXT) -rm -f src/powerpc/linux64_closure.lo -rm -f src/powerpc/ppc_closure.$(OBJEXT) -rm -f src/powerpc/ppc_closure.lo -rm -f src/powerpc/sysv.$(OBJEXT) -rm -f src/powerpc/sysv.lo -rm -f src/prep_cif.$(OBJEXT) -rm -f src/prep_cif.lo -rm -f src/raw_api.$(OBJEXT) -rm -f src/raw_api.lo -rm -f src/s390/ffi.$(OBJEXT) -rm -f src/s390/ffi.lo -rm -f src/s390/sysv.$(OBJEXT) -rm -f src/s390/sysv.lo -rm -f src/sh/ffi.$(OBJEXT) -rm -f src/sh/ffi.lo -rm -f src/sh/sysv.$(OBJEXT) -rm -f src/sh/sysv.lo -rm -f src/sh64/ffi.$(OBJEXT) -rm -f src/sh64/ffi.lo -rm -f src/sh64/sysv.$(OBJEXT) -rm -f src/sh64/sysv.lo -rm -f src/sparc/ffi.$(OBJEXT) -rm -f src/sparc/ffi.lo -rm -f src/sparc/v8.$(OBJEXT) -rm -f src/sparc/v8.lo -rm -f src/sparc/v9.$(OBJEXT) -rm -f src/sparc/v9.lo -rm -f src/types.$(OBJEXT) -rm -f src/types.lo -rm -f src/x86/darwin.$(OBJEXT) -rm -f src/x86/darwin.lo -rm -f src/x86/ffi.$(OBJEXT) -rm -f src/x86/ffi.lo -rm -f src/x86/ffi64.$(OBJEXT) -rm -f src/x86/ffi64.lo -rm -f src/x86/sysv.$(OBJEXT) -rm -f src/x86/sysv.lo -rm -f src/x86/unix64.$(OBJEXT) -rm -f src/x86/unix64.lo -rm -f src/x86/win32.$(OBJEXT) -rm -f src/x86/win32.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/java_raw_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/prep_cif.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_darwin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/s390/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/sh/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/sh64/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi64.Plo@am__quote@ .S.o: $(CCASCOMPILE) -c $< .S.obj: $(CCASCOMPILE) -c `$(CYGPATH_W) '$<'` .S.lo: $(LTCCASCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \ @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`; \ @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Po"; else rm -f "$$depbase.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \ @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$$depbase.Tpo" "$$depbase.Plo"; else rm -f "$$depbase.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf src/.libs src/_libs -rm -rf src/alpha/.libs src/alpha/_libs -rm -rf src/arm/.libs src/arm/_libs -rm -rf src/cris/.libs src/cris/_libs -rm -rf src/frv/.libs src/frv/_libs -rm -rf src/ia64/.libs src/ia64/_libs -rm -rf src/m32r/.libs src/m32r/_libs -rm -rf src/m68k/.libs src/m68k/_libs -rm -rf src/mips/.libs src/mips/_libs -rm -rf src/pa/.libs src/pa/_libs -rm -rf src/powerpc/.libs src/powerpc/_libs -rm -rf src/s390/.libs src/s390/_libs -rm -rf src/sh/.libs src/sh/_libs -rm -rf src/sh64/.libs src/sh64/_libs -rm -rf src/sparc/.libs src/sparc/_libs -rm -rf src/x86/.libs src/x86/_libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/cris $(distdir)/src/frv $(distdir)/src/m32r $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/pa $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh $(distdir)/src/sh64 $(distdir)/src/sparc $(distdir)/src/x86 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) fficonfig.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -rm -f src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(am__dirstamp) -rm -f src/alpha/$(DEPDIR)/$(am__dirstamp) -rm -f src/alpha/$(am__dirstamp) -rm -f src/arm/$(DEPDIR)/$(am__dirstamp) -rm -f src/arm/$(am__dirstamp) -rm -f src/cris/$(DEPDIR)/$(am__dirstamp) -rm -f src/cris/$(am__dirstamp) -rm -f src/frv/$(DEPDIR)/$(am__dirstamp) -rm -f src/frv/$(am__dirstamp) -rm -f src/ia64/$(DEPDIR)/$(am__dirstamp) -rm -f src/ia64/$(am__dirstamp) -rm -f src/m32r/$(DEPDIR)/$(am__dirstamp) -rm -f src/m32r/$(am__dirstamp) -rm -f src/m68k/$(DEPDIR)/$(am__dirstamp) -rm -f src/m68k/$(am__dirstamp) -rm -f src/mips/$(DEPDIR)/$(am__dirstamp) -rm -f src/mips/$(am__dirstamp) -rm -f src/pa/$(DEPDIR)/$(am__dirstamp) -rm -f src/pa/$(am__dirstamp) -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp) -rm -f src/powerpc/$(am__dirstamp) -rm -f src/s390/$(DEPDIR)/$(am__dirstamp) -rm -f src/s390/$(am__dirstamp) -rm -f src/sh/$(DEPDIR)/$(am__dirstamp) -rm -f src/sh/$(am__dirstamp) -rm -f src/sh64/$(DEPDIR)/$(am__dirstamp) -rm -f src/sh64/$(am__dirstamp) -rm -f src/sparc/$(DEPDIR)/$(am__dirstamp) -rm -f src/sparc/$(am__dirstamp) -rm -f src/x86/$(DEPDIR)/$(am__dirstamp) -rm -f src/x86/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf src/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/mips/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/x86/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-recursive ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-recursive \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gauche-c-wrapper-0.6.1.orig/libffi/missing0000755000000000000000000002453311237307544015344 0ustar #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 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, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gauche-c-wrapper-0.6.1.orig/libffi/mkinstalldirs0000755000000000000000000000341111237307544016543 0ustar #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here gauche-c-wrapper-0.6.1.orig/libffi/README0000644000000000000000000003576711237307544014640 0ustar This directory contains the libffi package, which is not part of GCC but shipped with GCC as convenience. Status ====== libffi-2.00 has not been released yet! This is a development snapshot! libffi-1.20 was released on October 5, 1998. Check the libffi web page for updates: . What is libffi? =============== Compilers for high level languages generate code that follow certain conventions. These conventions are necessary, in part, for separate compilation to work. One such convention is the "calling convention". The "calling convention" is essentially a set of assumptions made by the compiler about where function arguments will be found on entry to a function. A "calling convention" also specifies where the return value for a function is found. Some programs may not know at the time of compilation what arguments are to be passed to a function. For instance, an interpreter may be told at run-time about the number and types of arguments used to call a given function. Libffi can be used in such programs to provide a bridge from the interpreter program to compiled code. The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time. Ffi stands for Foreign Function Interface. A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language. The libffi library really only provides the lowest, machine dependent layer of a fully featured foreign function interface. A layer must exist above libffi that handles type conversions for values passed between the two languages. Supported Platforms and Prerequisites ===================================== Libffi has been ported to: SunOS 4.1.3 & Solaris 2.x (SPARC-V8, SPARC-V9) Irix 5.3 & 6.2 (System V/o32 & n32) Intel x86 - Linux (System V ABI) Alpha - Linux and OSF/1 m68k - Linux (System V ABI) PowerPC - Linux (System V ABI, Darwin, AIX) ARM - Linux (System V ABI) Libffi has been tested with the egcs 1.0.2 gcc compiler. Chances are that other versions will work. Libffi has also been built and tested with the SGI compiler tools. On PowerPC, the tests failed (see the note below). You must use GNU make to build libffi. SGI's make will not work. Sun's probably won't either. If you port libffi to another platform, please let me know! I assume that some will be easy (x86 NetBSD), and others will be more difficult (HP). Installing libffi ================= [Note: before actually performing any of these installation steps, you may wish to read the "Platform Specific Notes" below.] First you must configure the distribution for your particular system. Go to the directory you wish to build libffi in and run the "configure" program found in the root directory of the libffi source distribution. You may want to tell configure where to install the libffi library and header files. To do that, use the --prefix configure switch. Libffi will install under /usr/local by default. If you want to enable extra run-time debugging checks use the the --enable-debug configure switch. This is useful when your program dies mysteriously while using libffi. Another useful configure switch is --enable-purify-safety. Using this will add some extra code which will suppress certain warnings when you are using Purify with libffi. Only use this switch when using Purify, as it will slow down the library. Configure has many other options. Use "configure --help" to see them all. Once configure has finished, type "make". Note that you must be using GNU make. SGI's make will not work. Sun's probably won't either. You can ftp GNU make from prep.ai.mit.edu:/pub/gnu. To ensure that libffi is working as advertised, type "make test". To install the library and header files, type "make install". Using libffi ============ The Basics ---------- Libffi assumes that you have a pointer to the function you wish to call and that you know the number and types of arguments to pass it, as well as the return type of the function. The first thing you must do is create an ffi_cif object that matches the signature of the function you wish to call. The cif in ffi_cif stands for Call InterFace. To prepare a call interface object, use the following function: ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes); CIF is a pointer to the call interface object you wish to initialize. ABI is an enum that specifies the calling convention to use for the call. FFI_DEFAULT_ABI defaults to the system's native calling convention. Other ABI's may be used with care. They are system specific. NARGS is the number of arguments this function accepts. libffi does not yet support vararg functions. RTYPE is a pointer to an ffi_type structure that represents the return type of the function. Ffi_type objects describe the types of values. libffi provides ffi_type objects for many of the native C types: signed int, unsigned int, signed char, unsigned char, etc. There is also a pointer ffi_type object and a void ffi_type. Use &ffi_type_void for functions that don't return values. ATYPES is a vector of ffi_type pointers. ARGS must be NARGS long. If NARGS is 0, this is ignored. ffi_prep_cif will return a status code that you are responsible for checking. It will be one of the following: FFI_OK - All is good. FFI_BAD_TYPEDEF - One of the ffi_type objects that ffi_prep_cif came across is bad. Before making the call, the VALUES vector should be initialized with pointers to the appropriate argument values. To call the the function using the initialized ffi_cif, use the ffi_call function: void ffi_call(ffi_cif *cif, void *fn, void *rvalue, void **avalues); CIF is a pointer to the ffi_cif initialized specifically for this function. FN is a pointer to the function you want to call. RVALUE is a pointer to a chunk of memory that is to hold the result of the function call. Currently, it must be at least one word in size (except for the n32 version under Irix 6.x, which must be a pointer to an 8 byte aligned value (a long long). It must also be at least word aligned (depending on the return type, and the system's alignment requirements). If RTYPE is &ffi_type_void, this is ignored. If RVALUE is NULL, the return value is discarded. AVALUES is a vector of void* that point to the memory locations holding the argument values for a call. If NARGS is 0, this is ignored. If you are expecting a return value from FN it will have been stored at RVALUE. An Example ---------- Here is a trivial example that calls puts() a few times. #include #include int main() { ffi_cif cif; ffi_type *args[1]; void *values[1]; char *s; int rc; /* Initialize the argument info vectors */ args[0] = &ffi_type_uint; values[0] = &s; /* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint, args) == FFI_OK) { s = "Hello World!"; ffi_call(&cif, puts, &rc, values); /* rc now holds the result of the call to puts */ /* values holds a pointer to the function's arg, so to call puts() again all we need to do is change the value of s */ s = "This is cool!"; ffi_call(&cif, puts, &rc, values); } return 0; } Aggregate Types --------------- Although libffi has no special support for unions or bit-fields, it is perfectly happy passing structures back and forth. You must first describe the structure to libffi by creating a new ffi_type object for it. Here is the definition of ffi_type: typedef struct _ffi_type { unsigned size; short alignment; short type; struct _ffi_type **elements; } ffi_type; All structures must have type set to FFI_TYPE_STRUCT. You may set size and alignment to 0. These will be calculated and reset to the appropriate values by ffi_prep_cif(). elements is a NULL terminated array of pointers to ffi_type objects that describe the type of the structure elements. These may, in turn, be structure elements. The following example initializes a ffi_type object representing the tm struct from Linux's time.h: struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; /* Those are for future use. */ long int __tm_gmtoff__; __const char *__tm_zone__; }; { ffi_type tm_type; ffi_type *tm_type_elements[12]; int i; tm_type.size = tm_type.alignment = 0; tm_type.elements = &tm_type_elements; for (i = 0; i < 9; i++) tm_type_elements[i] = &ffi_type_sint; tm_type_elements[9] = &ffi_type_slong; tm_type_elements[10] = &ffi_type_pointer; tm_type_elements[11] = NULL; /* tm_type can now be used to represent tm argument types and return types for ffi_prep_cif() */ } Platform Specific Notes ======================= Intel x86 --------- There are no known problems with the x86 port. Sun SPARC - SunOS 4.1.3 & Solaris 2.x ------------------------------------- You must use GNU Make to build libffi on Sun platforms. MIPS - Irix 5.3 & 6.x --------------------- Irix 6.2 and better supports three different calling conventions: o32, n32 and n64. Currently, libffi only supports both o32 and n32 under Irix 6.x, but only o32 under Irix 5.3. Libffi will automatically be configured for whichever calling convention it was built for. By default, the configure script will try to build libffi with the GNU development tools. To build libffi with the SGI development tools, set the environment variable CC to either "cc -32" or "cc -n32" before running configure under Irix 6.x (depending on whether you want an o32 or n32 library), or just "cc" for Irix 5.3. With the n32 calling convention, when returning structures smaller than 16 bytes, be sure to provide an RVALUE that is 8 byte aligned. Here's one way of forcing this: double struct_storage[2]; my_small_struct *s = (my_small_struct *) struct_storage; /* Use s for RVALUE */ If you don't do this you are liable to get spurious bus errors. "long long" values are not supported yet. You must use GNU Make to build libffi on SGI platforms. ARM - System V ABI ------------------ The ARM port was performed on a NetWinder running ARM Linux ELF (2.0.31) and gcc 2.8.1. PowerPC System V ABI -------------------- There are two `System V ABI's which libffi implements for PowerPC. They differ only in how small structures are returned from functions. In the FFI_SYSV version, structures that are 8 bytes or smaller are returned in registers. This is what GCC does when it is configured for solaris, and is what the System V ABI I have (dated September 1995) says. In the FFI_GCC_SYSV version, all structures are returned the same way: by passing a pointer as the first argument to the function. This is what GCC does when it is configured for linux or a generic sysv target. EGCS 1.0.1 (and probably other versions of EGCS/GCC) also has a inconsistency with the SysV ABI: When a procedure is called with many floating-point arguments, some of them get put on the stack. They are all supposed to be stored in double-precision format, even if they are only single-precision, but EGCS stores single-precision arguments as single-precision anyway. This causes one test to fail (the `many arguments' test). What's With The Crazy Comments? =============================== You might notice a number of cryptic comments in the code, delimited by /*@ and @*/. These are annotations read by the program LCLint, a tool for statically checking C programs. You can read all about it at . History ======= 1.20 Oct-5-98 Raffaele Sena produces ARM port. 1.19 Oct-5-98 Fixed x86 long double and long long return support. m68k bug fixes from Andreas Schwab. Patch for DU assembler compatibility for the Alpha from Richard Henderson. 1.18 Apr-17-98 Bug fixes and MIPS configuration changes. 1.17 Feb-24-98 Bug fixes and m68k port from Andreas Schwab. PowerPC port from Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes. 1.16 Feb-11-98 Richard Henderson produces Alpha port. 1.15 Dec-4-97 Fixed an n32 ABI bug. New libtool, auto* support. 1.14 May-13-97 libtool is now used to generate shared and static libraries. Fixed a minor portability problem reported by Russ McManus . 1.13 Dec-2-96 Added --enable-purify-safety to keep Purify from complaining about certain low level code. Sparc fix for calling functions with < 6 args. Linux x86 a.out fix. 1.12 Nov-22-96 Added missing ffi_type_void, needed for supporting void return types. Fixed test case for non MIPS machines. Cygnus Support is now Cygnus Solutions. 1.11 Oct-30-96 Added notes about GNU make. 1.10 Oct-29-96 Added configuration fix for non GNU compilers. 1.09 Oct-29-96 Added --enable-debug configure switch. Clean-ups based on LCLint feedback. ffi_mips.h is always installed. Many configuration fixes. Fixed ffitest.c for sparc builds. 1.08 Oct-15-96 Fixed n32 problem. Many clean-ups. 1.07 Oct-14-96 Gordon Irlam rewrites v8.S again. Bug fixes. 1.06 Oct-14-96 Gordon Irlam improved the sparc port. 1.05 Oct-14-96 Interface changes based on feedback. 1.04 Oct-11-96 Sparc port complete (modulo struct passing bug). 1.03 Oct-10-96 Passing struct args, and returning struct values works for all architectures/calling conventions. Expanded tests. 1.02 Oct-9-96 Added SGI n32 support. Fixed bugs in both o32 and Linux support. Added "make test". 1.01 Oct-8-96 Fixed float passing bug in mips version. Restructured some of the code. Builds cleanly with SGI tools. 1.00 Oct-7-96 First release. No public announcement. Authors & Credits ================= libffi was written by Anthony Green . Portions of libffi were derived from Gianni Mariani's free gencall library for Silicon Graphics machines. The closure mechanism was designed and implemented by Kresten Krab Thorup. The Sparc port was derived from code contributed by the fine folks at Visible Decisions Inc . Further enhancements were made by Gordon Irlam at Cygnus Solutions . The Alpha port was written by Richard Henderson at Cygnus Solutions. Andreas Schwab ported libffi to m68k Linux and provided a number of bug fixes. Geoffrey Keating ported libffi to the PowerPC. Raffaele Sena ported libffi to the ARM. Jesper Skov and Andrew Haley both did more than their fair share of stepping through the code and tracking down bugs. Thanks also to Tom Tromey for bug fixes and configuration help. Thanks to Jim Blandy, who provided some useful feedback on the libffi interface. If you have a problem, or have found a bug, please send a note to green@cygnus.com. gauche-c-wrapper-0.6.1.orig/libffi/src/0002755000000000000000000000000011237307543014526 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/alpha/0002755000000000000000000000000011237307543015613 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/alpha/ffi.c0000644000000000000000000001450311237307543016524 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998, 2001 Red Hat, Inc. Alpha Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)()); extern void ffi_closure_osf(void); ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Adjust cif->bytes to represent a minimum 6 words for the temporary register argument loading area. */ if (cif->bytes < 6*FFI_SIZEOF_ARG) cif->bytes = 6*FFI_SIZEOF_ARG; /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags = cif->rtype->type; break; default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { unsigned long *stack, *argp; long i, avn; ffi_type **arg_types; FFI_ASSERT (cif->abi == FFI_OSF); /* If the return value is a struct and we don't have a return value address then we need to make one. */ if (rvalue == NULL && cif->flags == FFI_TYPE_STRUCT) rvalue = alloca(cif->rtype->size); /* Allocate the space for the arguments, plus 4 words of temp space for ffi_call_osf. */ argp = stack = alloca(cif->bytes + 4*FFI_SIZEOF_ARG); if (cif->flags == FFI_TYPE_STRUCT) *(void **) argp++ = rvalue; i = 0; avn = cif->nargs; arg_types = cif->arg_types; while (i < avn) { switch ((*arg_types)->type) { case FFI_TYPE_SINT8: *(SINT64 *) argp = *(SINT8 *)(* avalue); break; case FFI_TYPE_UINT8: *(SINT64 *) argp = *(UINT8 *)(* avalue); break; case FFI_TYPE_SINT16: *(SINT64 *) argp = *(SINT16 *)(* avalue); break; case FFI_TYPE_UINT16: *(SINT64 *) argp = *(UINT16 *)(* avalue); break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: /* Note that unsigned 32-bit quantities are sign extended. */ *(SINT64 *) argp = *(SINT32 *)(* avalue); break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_POINTER: *(UINT64 *) argp = *(UINT64 *)(* avalue); break; case FFI_TYPE_FLOAT: if (argp - stack < 6) { /* Note the conversion -- all the fp regs are loaded as doubles. The in-register format is the same. */ *(double *) argp = *(float *)(* avalue); } else *(float *) argp = *(float *)(* avalue); break; case FFI_TYPE_DOUBLE: *(double *) argp = *(double *)(* avalue); break; case FFI_TYPE_STRUCT: memcpy(argp, *avalue, (*arg_types)->size); break; default: FFI_ASSERT(0); } argp += ALIGN((*arg_types)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++, arg_types++, avalue++; } ffi_call_osf(stack, cif->bytes, cif->flags, rvalue, fn); } ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp; FFI_ASSERT (cif->abi == FFI_OSF); tramp = (unsigned int *) &closure->tramp[0]; tramp[0] = 0x47fb0401; /* mov $27,$1 */ tramp[1] = 0xa77b0010; /* ldq $27,16($27) */ tramp[2] = 0x6bfb0000; /* jmp $31,($27),0 */ tramp[3] = 0x47ff041f; /* nop */ *(void **) &tramp[4] = ffi_closure_osf; closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* Flush the Icache. Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal instead, since both Compaq as and gas can handle it. 0x86 is PAL_imb in Tru64 UNIX . */ asm volatile ("call_pal 0x86" : : : "memory"); return FFI_OK; } int ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp) { ffi_cif *cif; void **avalue; ffi_type **arg_types; long i, avn, argn; cif = closure->cif; avalue = alloca(cif->nargs * sizeof(void *)); argn = 0; /* Copy the caller's structure return address to that the closure returns the data directly to the caller. */ if (cif->flags == FFI_TYPE_STRUCT) { rvalue = (void *) argp[0]; argn = 1; } i = 0; avn = cif->nargs; arg_types = cif->arg_types; /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) { switch (arg_types[i]->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_POINTER: case FFI_TYPE_STRUCT: avalue[i] = &argp[argn]; break; case FFI_TYPE_FLOAT: if (argn < 6) { /* Floats coming from registers need conversion from double back to float format. */ *(float *)&argp[argn - 6] = *(double *)&argp[argn - 6]; avalue[i] = &argp[argn - 6]; } else avalue[i] = &argp[argn]; break; case FFI_TYPE_DOUBLE: avalue[i] = &argp[argn - (argn < 6 ? 6 : 0)]; break; default: FFI_ASSERT(0); } argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++; } /* Invoke the closure. */ (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_osf how to perform return type promotions. */ return cif->rtype->type; } gauche-c-wrapper-0.6.1.orig/libffi/src/alpha/ffitarget.h0000644000000000000000000000335611237307543017744 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for Alpha. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_OSF, FFI_DEFAULT_ABI = FFI_OSF, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 24 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/alpha/osf.S0000644000000000000000000001701611237307543016531 0ustar /* ----------------------------------------------------------------------- osf.S - Copyright (c) 1998, 2001 Red Hat Alpha/OSF Foreign Function Interface $Id: osf.S,v 1.1.1.1 1998/11/29 16:48:16 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include .arch ev6 .text /* ffi_call_osf (void *args, unsigned long bytes, unsigned flags, void *raddr, void (*fnaddr)()); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also deallocate some of the stack that has been alloca'd. */ .align 3 .globl ffi_call_osf .ent ffi_call_osf ffi_call_osf: .frame $15, 32, $26, 0 .mask 0x4008000, -32 $LFB1: addq $16,$17,$1 mov $16, $30 stq $26, 0($1) stq $15, 8($1) stq $18, 16($1) mov $1, $15 $LCFI1: .prologue 0 stq $19, 24($1) mov $20, $27 # Load up all of the (potential) argument registers. ldq $16, 0($30) ldt $f16, 0($30) ldt $f17, 8($30) ldq $17, 8($30) ldt $f18, 16($30) ldq $18, 16($30) ldt $f19, 24($30) ldq $19, 24($30) ldt $f20, 32($30) ldq $20, 32($30) ldt $f21, 40($30) ldq $21, 40($30) # Deallocate the register argument area. lda $30, 48($30) jsr $26, ($27), 0 ldgp $29, 0($26) # If the return value pointer is NULL, assume no return value. ldq $19, 24($15) ldq $18, 16($15) ldq $26, 0($15) $LCFI2: beq $19, $noretval # Store the return value out in the proper type. cmpeq $18, FFI_TYPE_INT, $1 bne $1, $retint cmpeq $18, FFI_TYPE_FLOAT, $2 bne $2, $retfloat cmpeq $18, FFI_TYPE_DOUBLE, $3 bne $3, $retdouble .align 3 $noretval: ldq $15, 8($15) ret .align 4 $retint: stq $0, 0($19) nop ldq $15, 8($15) ret .align 4 $retfloat: sts $f0, 0($19) nop ldq $15, 8($15) ret .align 4 $retdouble: stt $f0, 0($19) nop ldq $15, 8($15) ret $LFE1: .end ffi_call_osf /* ffi_closure_osf(...) Receives the closure argument in $1. */ .align 3 .globl ffi_closure_osf .ent ffi_closure_osf ffi_closure_osf: .frame $30, 16*8, $26, 0 .mask 0x4000000, -16*8 $LFB2: ldgp $29, 0($27) subq $30, 16*8, $30 $LCFI5: stq $26, 0($30) $LCFI6: .prologue 1 # Store all of the potential argument registers in va_list format. stt $f16, 4*8($30) stt $f17, 5*8($30) stt $f18, 6*8($30) stt $f19, 7*8($30) stt $f20, 8*8($30) stt $f21, 9*8($30) stq $16, 10*8($30) stq $17, 11*8($30) stq $18, 12*8($30) stq $19, 13*8($30) stq $20, 14*8($30) stq $21, 15*8($30) # Call ffi_closure_osf_inner to do the bulk of the work. mov $1, $16 lda $17, 2*8($30) lda $18, 10*8($30) jsr $26, ffi_closure_osf_inner ldgp $29, 0($26) ldq $26, 0($30) # Load up the return value in the proper type. lda $1, $load_table s4addq $0, $1, $1 ldl $1, 0($1) addq $1, $29, $1 jmp $31, ($1), $load_32 .align 4 $load_none: addq $30, 16*8, $30 ret .align 4 $load_float: lds $f0, 16($30) nop addq $30, 16*8, $30 ret .align 4 $load_double: ldt $f0, 16($30) nop addq $30, 16*8, $30 ret .align 4 $load_u8: #ifdef __alpha_bwx__ ldbu $0, 16($30) nop #else ldq $0, 16($30) and $0, 255, $0 #endif addq $30, 16*8, $30 ret .align 4 $load_s8: #ifdef __alpha_bwx__ ldbu $0, 16($30) sextb $0, $0 #else ldq $0, 16($30) sll $0, 56, $0 sra $0, 56, $0 #endif addq $30, 16*8, $30 ret .align 4 $load_u16: #ifdef __alpha_bwx__ ldwu $0, 16($30) nop #else ldq $0, 16($30) zapnot $0, 3, $0 #endif addq $30, 16*8, $30 ret .align 4 $load_s16: #ifdef __alpha_bwx__ ldwu $0, 16($30) sextw $0, $0 #else ldq $0, 16($30) sll $0, 48, $0 sra $0, 48, $0 #endif addq $30, 16*8, $30 ret .align 4 $load_32: ldl $0, 16($30) nop addq $30, 16*8, $30 ret .align 4 $load_64: ldq $0, 16($30) nop addq $30, 16*8, $30 ret $LFE2: .end ffi_closure_osf #ifdef __ELF__ .section .rodata #else .rdata #endif $load_table: .gprel32 $load_none # FFI_TYPE_VOID .gprel32 $load_32 # FFI_TYPE_INT .gprel32 $load_float # FFI_TYPE_FLOAT .gprel32 $load_double # FFI_TYPE_DOUBLE .gprel32 $load_double # FFI_TYPE_LONGDOUBLE .gprel32 $load_u8 # FFI_TYPE_UINT8 .gprel32 $load_s8 # FFI_TYPE_SINT8 .gprel32 $load_u16 # FFI_TYPE_UINT16 .gprel32 $load_s16 # FFI_TYPE_SINT16 .gprel32 $load_32 # FFI_TYPE_UINT32 .gprel32 $load_32 # FFI_TYPE_SINT32 .gprel32 $load_64 # FFI_TYPE_UINT64 .gprel32 $load_64 # FFI_TYPE_SINT64 .gprel32 $load_none # FFI_TYPE_STRUCT .gprel32 $load_64 # FFI_TYPE_POINTER /* Assert that the table above is in sync with ffi.h. */ #if FFI_TYPE_FLOAT != 2 \ || FFI_TYPE_DOUBLE != 3 \ || FFI_TYPE_UINT8 != 5 \ || FFI_TYPE_SINT8 != 6 \ || FFI_TYPE_UINT16 != 7 \ || FFI_TYPE_SINT16 != 8 \ || FFI_TYPE_UINT32 != 9 \ || FFI_TYPE_SINT32 != 10 \ || FFI_TYPE_UINT64 != 11 \ || FFI_TYPE_SINT64 != 12 \ || FFI_TYPE_STRUCT != 13 \ || FFI_TYPE_POINTER != 14 \ || FFI_TYPE_LAST != 14 #error "osf.S out of sync with ffi.h" #endif #ifdef __ELF__ .section .eh_frame,EH_FRAME_FLAGS,@progbits __FRAME_BEGIN__: .4byte $LECIE1-$LSCIE1 # Length of Common Information Entry $LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor .byte 0x78 # sleb128 -8; CIE Data Alignment Factor .byte 26 # CIE RA Column .byte 0x1 # uleb128 0x1; Augmentation size .byte 0x1b # FDE Encoding (pcrel sdata4) .byte 0xc # DW_CFA_def_cfa .byte 30 # uleb128 column 30 .byte 0 # uleb128 offset 0 .align 3 $LECIE1: $LSFDE1: .4byte $LEFDE1-$LASFDE1 # FDE Length $LASFDE1: .4byte $LASFDE1-__FRAME_BEGIN__ # FDE CIE offset .4byte $LFB1-. # FDE initial location .4byte $LFE1-$LFB1 # FDE address range .byte 0x0 # uleb128 0x0; Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI1-$LFB1 .byte 0x9a # DW_CFA_offset, column 26 .byte 4 # uleb128 4*-8 .byte 0x8f # DW_CFA_offset, column 15 .byte 0x3 # uleb128 3*-8 .byte 0xc # DW_CFA_def_cfa .byte 15 # uleb128 column 15 .byte 32 # uleb128 offset 32 .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI2-$LCFI1 .byte 0xda # DW_CFA_restore, column 26 .align 3 $LEFDE1: $LSFDE3: .4byte $LEFDE3-$LASFDE3 # FDE Length $LASFDE3: .4byte $LASFDE3-__FRAME_BEGIN__ # FDE CIE offset .4byte $LFB2-. # FDE initial location .4byte $LFE2-$LFB2 # FDE address range .byte 0x0 # uleb128 0x0; Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI5-$LFB2 .byte 0xe # DW_CFA_def_cfa_offset .byte 0x80,0x1 # uleb128 128 .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI6-$LCFI5 .byte 0x9a # DW_CFA_offset, column 26 .byte 16 # uleb128 offset 16*-8 .align 3 $LEFDE3: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/arm/0002755000000000000000000000000011237307543015305 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/arm/ffi.c0000644000000000000000000001123411237307543016214 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Red Hat, Inc. ARM Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { register unsigned int i; register void **p_argv; register char *argp; register ffi_type **p_arg; argp = stack; if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { *(void **) argp = ecif->rvalue; argp += 4; } p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++) { size_t z; /* Align if necessary */ if (((*p_arg)->alignment - 1) & (unsigned) argp) { argp = (char *) ALIGN(argp, (*p_arg)->alignment); } z = (*p_arg)->size; if (z < sizeof(int)) { z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_STRUCT: *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); break; default: FFI_ASSERT(0); } } else if (z == sizeof(int)) { *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); } else { memcpy(argp, *p_argv, z); } p_argv++; argp += z; } return; } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Round the stack up to a multiple of 8 bytes. This isn't needed everywhere, but it is on some platforms, and it doesn't harm anything when it isn't needed. */ cif->bytes = (cif->bytes + 7) & ~7; /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags = (unsigned) FFI_TYPE_SINT64; break; default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } } gauche-c-wrapper-0.6.1.orig/libffi/src/arm/ffitarget.h0000644000000000000000000000331711237307543017433 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for ARM. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 0 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/arm/sysv.S0000644000000000000000000001150311237307543016433 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 1998 Red Hat, Inc. ARM Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef HAVE_MACHINE_ASM_H #include #else #ifdef __USER_LABEL_PREFIX__ #define CONCAT1(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b /* Use the right prefix for global labels. */ #define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) #else #define CNAME(x) x #endif #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): #endif #ifdef __ELF__ #define LSYM(x) .x #else #define LSYM(x) x #endif /* We need a better way of testing for this, but for now, this is all we can do. */ @ This selects the minimum architecture level required. #define __ARM_ARCH__ 3 #if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) # undef __ARM_ARCH__ # define __ARM_ARCH__ 4 #endif #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \ || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \ || defined(__ARM_ARCH_5TEJ__) # undef __ARM_ARCH__ # define __ARM_ARCH__ 5 #endif #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ || defined(__ARM_ARCH_6ZK__) # undef __ARM_ARCH__ # define __ARM_ARCH__ 6 #endif #if __ARM_ARCH__ >= 5 # define call_reg(x) blx x #elif defined (__ARM_ARCH_4T__) # define call_reg(x) mov lr, pc ; bx x # if defined(__thumb__) || defined(__THUMB_INTERWORK__) # define __INTERWORKING__ # endif #else # define call_reg(x) mov lr, pc ; mov pc, x #endif #if defined(__thumb__) && !defined(__THUMB_INTERWORK__) .macro ARM_FUNC_START name .text .align 0 .thumb .thumb_func ENTRY(\name) bx pc nop .arm /* A hook to tell gdb that we've switched to ARM mode. Also used to call directly from other local arm routines. */ _L__\name: .endm #else .macro ARM_FUNC_START name .text .align 0 .arm ENTRY(\name) .endm #endif .macro RETLDM regs=, cond=, dirn=ia #if defined (__INTERWORKING__) .ifc "\regs","" ldr\cond lr, [sp], #4 .else ldm\cond\dirn sp!, {\regs, lr} .endif bx\cond lr #else .ifc "\regs","" ldr\cond pc, [sp], #4 .else ldm\cond\dirn sp!, {\regs, pc} .endif #endif .endm @ r0: ffi_prep_args @ r1: &ecif @ r2: cif->bytes @ r3: fig->flags @ sp+0: ecif.rvalue @ sp+4: fn @ This assumes we are using gas. ARM_FUNC_START ffi_call_SYSV @ Save registers stmfd sp!, {r0-r3, fp, lr} mov fp, sp @ Make room for all of the new args. sub sp, fp, r2 @ Place all of the ffi_prep_args in position mov ip, r0 mov r0, sp @ r1 already set @ Call ffi_prep_args(stack, &ecif) call_reg(ip) @ move first 4 parameters in registers ldmia sp, {r0-r3} @ and adjust stack ldr ip, [fp, #8] cmp ip, #16 movhs ip, #16 add sp, sp, ip @ call (fn) (...) ldr ip, [fp, #28] call_reg(ip) @ Remove the space we pushed for the args mov sp, fp @ Load r2 with the pointer to storage for the return value ldr r2, [sp, #24] @ Load r3 with the return type code ldr r3, [sp, #12] @ If the return value pointer is NULL, assume no return value. cmp r2, #0 beq LSYM(Lepilogue) @ return INT cmp r3, #FFI_TYPE_INT #ifdef __SOFTFP__ cmpne r3, #FFI_TYPE_FLOAT #endif streq r0, [r2] beq LSYM(Lepilogue) @ return INT64 cmp r3, #FFI_TYPE_SINT64 #ifdef __SOFTFP__ cmpne r3, #FFI_TYPE_DOUBLE #endif stmeqia r2, {r0, r1} #ifndef __SOFTFP__ beq LSYM(Lepilogue) @ return FLOAT cmp r3, #FFI_TYPE_FLOAT stfeqs f0, [r2] beq LSYM(Lepilogue) @ return DOUBLE or LONGDOUBLE cmp r3, #FFI_TYPE_DOUBLE stfeqd f0, [r2] #endif LSYM(Lepilogue): RETLDM "r0-r3,fp" .ffi_call_SYSV_end: .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) gauche-c-wrapper-0.6.1.orig/libffi/src/cris/0002755000000000000000000000000011237307543015466 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/cris/ffi.c0000644000000000000000000002253511237307543016403 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Cygnus Solutions Copyright (c) 2004 Simon Posnjak Copyright (c) 2005 Axis Communications AB CRIS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) static ffi_status initialize_aggregate_packed_struct (ffi_type * arg) { ffi_type **ptr; FFI_ASSERT (arg != NULL); FFI_ASSERT (arg->elements != NULL); FFI_ASSERT (arg->size == 0); FFI_ASSERT (arg->alignment == 0); ptr = &(arg->elements[0]); while ((*ptr) != NULL) { if (((*ptr)->size == 0) && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT (ffi_type_test ((*ptr))); arg->size += (*ptr)->size; arg->alignment = (arg->alignment > (*ptr)->alignment) ? arg->alignment : (*ptr)->alignment; ptr++; } if (arg->size == 0) return FFI_BAD_TYPEDEF; else return FFI_OK; } int ffi_prep_args (char *stack, extended_cif * ecif) { unsigned int i; unsigned int struct_count = 0; void **p_argv; char *argp; ffi_type **p_arg; argp = stack; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++) { size_t z; switch ((*p_arg)->type) { case FFI_TYPE_STRUCT: { z = (*p_arg)->size; if (z <= 4) { memcpy (argp, *p_argv, z); z = 4; } else if (z <= 8) { memcpy (argp, *p_argv, z); z = 8; } else { unsigned int uiLocOnStack; z = sizeof (void *); uiLocOnStack = 4 * ecif->cif->nargs + struct_count; struct_count = struct_count + (*p_arg)->size; *(unsigned int *) argp = (unsigned int) (UINT32 *) (stack + uiLocOnStack); memcpy ((stack + uiLocOnStack), *p_argv, (*p_arg)->size); } break; } default: z = (*p_arg)->size; if (z < sizeof (int)) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv); break; default: FFI_ASSERT (0); } z = sizeof (int); } else if (z == sizeof (int)) *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); else memcpy (argp, *p_argv, z); break; } p_argv++; argp += z; } return (struct_count); } ffi_status ffi_prep_cif (ffi_cif * cif, ffi_abi abi, unsigned int nargs, ffi_type * rtype, ffi_type ** atypes) { unsigned bytes = 0; unsigned int i; ffi_type **ptr; FFI_ASSERT (cif != NULL); FFI_ASSERT ((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); cif->abi = abi; cif->arg_types = atypes; cif->nargs = nargs; cif->rtype = rtype; cif->flags = 0; if ((cif->rtype->size == 0) && (initialize_aggregate_packed_struct (cif->rtype) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT_VALID_TYPE (cif->rtype); for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { if (((*ptr)->size == 0) && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; FFI_ASSERT_VALID_TYPE (*ptr); if (((*ptr)->alignment - 1) & bytes) bytes = ALIGN (bytes, (*ptr)->alignment); if ((*ptr)->type == FFI_TYPE_STRUCT) { if ((*ptr)->size > 8) { bytes += (*ptr)->size; bytes += sizeof (void *); } else { if ((*ptr)->size > 4) bytes += 8; else bytes += 4; } } else bytes += STACK_ARG_SIZE ((*ptr)->size); } cif->bytes = bytes; return ffi_prep_cif_machdep (cif); } ffi_status ffi_prep_cif_machdep (ffi_cif * cif) { switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags = (unsigned) cif->rtype->type; break; default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } extern void ffi_call_SYSV (int (*)(char *, extended_cif *), extended_cif *, unsigned, unsigned, unsigned *, void (*fn) ()) __attribute__ ((__visibility__ ("hidden"))); void ffi_call (ffi_cif * cif, void (*fn) (), void *rvalue, void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ecif.rvalue = alloca (cif->rtype->size); } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; default: FFI_ASSERT (0); break; } } /* Because the following variables are not exported outside libffi, we mark them hidden. */ /* Assembly code for the jump stub. */ extern const char ffi_cris_trampoline_template[] __attribute__ ((__visibility__ ("hidden"))); /* Offset into ffi_cris_trampoline_template of where to put the ffi_prep_closure_inner function. */ extern const int ffi_cris_trampoline_fn_offset __attribute__ ((__visibility__ ("hidden"))); /* Offset into ffi_cris_trampoline_template of where to put the closure data. */ extern const int ffi_cris_trampoline_closure_offset __attribute__ ((__visibility__ ("hidden"))); /* This function is sibling-called (jumped to) by the closure trampoline. We get R10..R13 at PARAMS[0..3] and a copy of [SP] at PARAMS[4] to simplify handling of a straddling parameter. A copy of R9 is at PARAMS[5] and SP at PARAMS[6]. These parameters are put at the appropriate place in CLOSURE which is then executed and the return value is passed back to the caller. */ static unsigned long long ffi_prep_closure_inner (void **params, ffi_closure* closure) { char *register_args = (char *) params; void *struct_ret = params[5]; char *stack_args = params[6]; char *ptr = register_args; ffi_cif *cif = closure->cif; ffi_type **arg_types = cif->arg_types; /* Max room needed is number of arguments as 64-bit values. */ void **avalue = alloca (closure->cif->nargs * sizeof(void *)); int i; int doing_regs; long long llret = 0; /* Find the address of each argument. */ for (i = 0, doing_regs = 1; i < cif->nargs; i++) { /* Types up to and including 8 bytes go by-value. */ if (arg_types[i]->size <= 4) { avalue[i] = ptr; ptr += 4; } else if (arg_types[i]->size <= 8) { avalue[i] = ptr; ptr += 8; } else { FFI_ASSERT (arg_types[i]->type == FFI_TYPE_STRUCT); /* Passed by-reference, so copy the pointer. */ avalue[i] = *(void **) ptr; ptr += 4; } /* If we've handled more arguments than fit in registers, start looking at the those passed on the stack. Step over the first one if we had a straddling parameter. */ if (doing_regs && ptr >= register_args + 4*4) { ptr = stack_args + ((ptr > register_args + 4*4) ? 4 : 0); doing_regs = 0; } } /* Invoke the closure. */ (closure->fun) (cif, cif->rtype->type == FFI_TYPE_STRUCT /* The caller allocated space for the return structure, and passed a pointer to this space in R9. */ ? struct_ret /* We take advantage of being able to ignore that the high part isn't set if the return value is not in R10:R11, but in R10 only. */ : (void *) &llret, avalue, closure->user_data); return llret; } /* API function: Prepare the trampoline. */ ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif *, void *, void **, void*), void *user_data) { void *innerfn = ffi_prep_closure_inner; FFI_ASSERT (cif->abi == FFI_SYSV); closure->cif = cif; closure->user_data = user_data; closure->fun = fun; memcpy (closure->tramp, ffi_cris_trampoline_template, FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE); memcpy (closure->tramp + ffi_cris_trampoline_fn_offset, &innerfn, sizeof (void *)); memcpy (closure->tramp + ffi_cris_trampoline_closure_offset, &closure, sizeof (void *)); return FFI_OK; } gauche-c-wrapper-0.6.1.orig/libffi/src/cris/ffitarget.h0000644000000000000000000000362711237307543017620 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for CRIS. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE 36 #define FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE (7*4) #define FFI_TRAMPOLINE_SIZE \ (FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE + FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE) #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/cris/sysv.S0000644000000000000000000001254711237307543016625 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2004 Simon Posnjak Copyright (c) 2005 Axis Communications AB CRIS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #define CONCAT(x,y) x ## y #define XCONCAT(x,y) CONCAT (x, y) #define L(x) XCONCAT (__USER_LABEL_PREFIX__, x) .text ;; OK, when we get called we should have this (according to ;; AXIS ETRAX 100LX Programmer's Manual chapter 6.3). ;; ;; R10: ffi_prep_args (func. pointer) ;; R11: &ecif ;; R12: cif->bytes ;; R13: fig->flags ;; sp+0: ecif.rvalue ;; sp+4: fn (function pointer to the function that we need to call) .globl L(ffi_call_SYSV) .type L(ffi_call_SYSV),@function .hidden L(ffi_call_SYSV) L(ffi_call_SYSV): ;; Save the regs to the stack. push $srp ;; Used for stack pointer saving. push $r6 ;; Used for function address pointer. push $r7 ;; Used for stack pointer saving. push $r8 ;; We save fig->flags to stack we will need them after we ;; call The Function. push $r13 ;; Saving current stack pointer. move.d $sp,$r8 move.d $sp,$r6 ;; Move address of ffi_prep_args to r13. move.d $r10,$r13 ;; Make room on the stack for the args of fn. sub.d $r12,$sp ;; Function void ffi_prep_args(char *stack, extended_cif *ecif) parameters are: ;; r10 <-- stack pointer ;; r11 <-- &ecif (already there) move.d $sp,$r10 ;; Call the function. jsr $r13 ;; Save the size of the structures which are passed on stack. move.d $r10,$r7 ;; Move first four args in to r10..r13. move.d [$sp+0],$r10 move.d [$sp+4],$r11 move.d [$sp+8],$r12 move.d [$sp+12],$r13 ;; Adjust the stack and check if any parameters are given on stack. addq 16,$sp sub.d $r7,$r6 cmp.d $sp,$r6 bpl go_on nop go_on_no_params_on_stack: move.d $r6,$sp go_on: ;; Discover if we need to put rval address in to r9. move.d [$r8+0],$r7 cmpq FFI_TYPE_STRUCT,$r7 bne call_now nop ;; Move rval address to $r9. move.d [$r8+20],$r9 call_now: ;; Move address of The Function in to r7. move.d [$r8+24],$r7 ;; Call The Function. jsr $r7 ;; Reset stack. move.d $r8,$sp ;; Load rval type (fig->flags) in to r13. pop $r13 ;; Detect rval type. cmpq FFI_TYPE_VOID,$r13 beq epilogue cmpq FFI_TYPE_STRUCT,$r13 beq epilogue cmpq FFI_TYPE_DOUBLE,$r13 beq return_double_or_longlong cmpq FFI_TYPE_UINT64,$r13 beq return_double_or_longlong cmpq FFI_TYPE_SINT64,$r13 beq return_double_or_longlong nop ;; Just return the 32 bit value. ba return nop return_double_or_longlong: ;; Load half of the rval to r10 and the other half to r11. move.d [$sp+16],$r13 move.d $r10,[$r13] addq 4,$r13 move.d $r11,[$r13] ba epilogue nop return: ;; Load the rval to r10. move.d [$sp+16],$r13 move.d $r10,[$r13] epilogue: pop $r8 pop $r7 pop $r6 Jump [$sp+] .size ffi_call_SYSV,.-ffi_call_SYSV /* Save R10..R13 into an array, somewhat like varargs. Copy the next argument too, to simplify handling of any straddling parameter. Save R9 and SP after those. Jump to function handling the rest. Since this is a template, copied and the main function filled in by the user. */ .globl L(ffi_cris_trampoline_template) .type L(ffi_cris_trampoline_template),@function .hidden L(ffi_cris_trampoline_template) L(ffi_cris_trampoline_template): 0: /* The value we get for "PC" is right after the prefix instruction, two bytes from the beginning, i.e. 0b+2. */ move.d $r10,[$pc+2f-(0b+2)] move.d $pc,$r10 1: addq 2f-1b+4,$r10 move.d $r11,[$r10+] move.d $r12,[$r10+] move.d $r13,[$r10+] move.d [$sp],$r11 move.d $r11,[$r10+] move.d $r9,[$r10+] move.d $sp,[$r10+] subq FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE,$r10 move.d 0,$r11 3: jump 0 2: .size ffi_cris_trampoline_template,.-0b /* This macro create a constant usable as "extern const int \name" in C from within libffi, when \name has no prefix decoration. */ .macro const name,value .globl \name .type \name,@object .hidden \name \name: .dword \value .size \name,4 .endm /* Constants for offsets within the trampoline. We could do this with just symbols, avoiding memory contents and memory accesses, but the C usage code would look a bit stranger. */ const L(ffi_cris_trampoline_fn_offset),2b-4-0b const L(ffi_cris_trampoline_closure_offset),3b-4-0b gauche-c-wrapper-0.6.1.orig/libffi/src/debug.c0000644000000000000000000000430511237307543015760 0ustar /* ----------------------------------------------------------------------- debug.c - Copyright (c) 1996 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include /* General debugging routines */ void ffi_stop_here(void) { /* This function is only useful for debugging purposes. Place a breakpoint on ffi_stop_here to be notified of significant events. */ } /* This function should only be called via the FFI_ASSERT() macro */ void ffi_assert(char *expr, char *file, int line) { fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line); ffi_stop_here(); abort(); } /* Perform a sanity check on an ffi_type structure */ void ffi_type_test(ffi_type *a, char *file, int line) { FFI_ASSERT_AT(a != NULL, file, line); /*@-usedef@*/ FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line); FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line); FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line); FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line); /*@=usedef@*/ } gauche-c-wrapper-0.6.1.orig/libffi/src/frv/0002755000000000000000000000000011237307543015323 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/frv/eabi.S0000644000000000000000000000662011237307543016351 0ustar /* ----------------------------------------------------------------------- eabi.S - Copyright (c) 2004 Anthony Green FR-V Assembly glue. $Id: sysv.S,v 1.1.1.1 1998/11/29 16:48:16 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include .globl ffi_prep_args_EABI .text .p2align 4 .globl ffi_call_EABI .type ffi_call_EABI, @function # gr8 : ffi_prep_args # gr9 : &ecif # gr10: cif->bytes # gr11: fig->flags # gr12: ecif.rvalue # gr13: fn ffi_call_EABI: addi sp, #-80, sp sti fp, @(sp, #24) addi sp, #24, fp movsg lr, gr5 /* Make room for the new arguments. */ /* subi sp, fp, gr10 */ /* Store return address and incoming args on stack. */ sti gr5, @(fp, #8) sti gr8, @(fp, #-4) sti gr9, @(fp, #-8) sti gr10, @(fp, #-12) sti gr11, @(fp, #-16) sti gr12, @(fp, #-20) sti gr13, @(fp, #-24) sub sp, gr10, sp /* Call ffi_prep_args. */ ldi @(fp, #-4), gr4 addi sp, #0, gr8 ldi @(fp, #-8), gr9 #ifdef __FRV_FDPIC__ ldd @(gr4, gr0), gr14 calll @(gr14, gr0) #else calll @(gr4, gr0) #endif /* ffi_prep_args returns the new stack pointer. */ mov gr8, gr4 ldi @(sp, #0), gr8 ldi @(sp, #4), gr9 ldi @(sp, #8), gr10 ldi @(sp, #12), gr11 ldi @(sp, #16), gr12 ldi @(sp, #20), gr13 /* Always copy the return value pointer into the hidden parameter register. This is only strictly necessary when we're returning an aggregate type, but it doesn't hurt to do this all the time, and it saves a branch. */ ldi @(fp, #-20), gr3 /* Use the ffi_prep_args return value for the new sp. */ mov gr4, sp /* Call the target function. */ ldi @(fp, -24), gr4 #ifdef __FRV_FDPIC__ ldd @(gr4, gr0), gr14 calll @(gr14, gr0) #else calll @(gr4, gr0) #endif /* Store the result. */ ldi @(fp, #-16), gr10 /* fig->flags */ ldi @(fp, #-20), gr4 /* ecif.rvalue */ /* Is the return value stored in two registers? */ cmpi gr10, #8, icc0 bne icc0, 0, .L2 /* Yes, save them. */ sti gr8, @(gr4, #0) sti gr9, @(gr4, #4) bra .L3 .L2: /* Is the return value a structure? */ cmpi gr10, #-1, icc0 beq icc0, 0, .L3 /* No, save a 4 byte return value. */ sti gr8, @(gr4, #0) .L3: /* Restore the stack, and return. */ ldi @(fp, 8), gr5 ld @(fp, gr0), fp addi sp,#80,sp jmpl @(gr5,gr0) .size ffi_call_EABI, .-ffi_call_EABI gauche-c-wrapper-0.6.1.orig/libffi/src/frv/ffi.c0000644000000000000000000002006611237307543016235 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Anthony Green FR-V Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ void *ffi_prep_args(char *stack, extended_cif *ecif) { register unsigned int i; register void **p_argv; register char *argp; register ffi_type **p_arg; register int count = 0; p_argv = ecif->avalue; argp = stack; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++) { size_t z; z = (*p_arg)->size; if ((*p_arg)->type == FFI_TYPE_STRUCT) { z = sizeof(void*); *(void **) argp = *p_argv; } /* if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (count > 24) { // This is going on the stack. Turn it into a double. *(double *) argp = (double) *(float*)(* p_argv); z = sizeof(double); } else *(void **) argp = *(void **)(* p_argv); } */ else if (z < sizeof(int)) { z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; default: FFI_ASSERT(0); } } else if (z == sizeof(int)) { *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); } else { memcpy(argp, *p_argv, z); } p_argv++; argp += z; count += z; } return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8))); } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { if (cif->rtype->type == FFI_TYPE_STRUCT) cif->flags = -1; else cif->flags = cif->rtype->size; cif->bytes = ALIGN (cif->bytes, 8); return FFI_OK; } extern void ffi_call_EABI(void *(*)(char *, extended_cif *), extended_cif *, unsigned, unsigned, unsigned *, void (*fn)()); void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ecif.rvalue = alloca(cif->rtype->size); } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_EABI: ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; default: FFI_ASSERT(0); break; } } void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, unsigned arg4, unsigned arg5, unsigned arg6) { /* This function is called by a trampoline. The trampoline stows a pointer to the ffi_closure object in gr7. We must save this pointer in a place that will persist while we do our work. */ register ffi_closure *creg __asm__ ("gr7"); ffi_closure *closure = creg; /* Arguments that don't fit in registers are found on the stack at a fixed offset above the current frame pointer. */ register char *frame_pointer __asm__ ("fp"); char *stack_args = frame_pointer + 16; /* Lay the register arguments down in a continuous chunk of memory. */ unsigned register_args[6] = { arg1, arg2, arg3, arg4, arg5, arg6 }; ffi_cif *cif = closure->cif; ffi_type **arg_types = cif->arg_types; void **avalue = alloca (cif->nargs * sizeof(void *)); char *ptr = (char *) register_args; int i; /* Find the address of each argument. */ for (i = 0; i < cif->nargs; i++) { switch (arg_types[i]->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = ptr + 3; break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = ptr + 2; break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_FLOAT: avalue[i] = ptr; break; case FFI_TYPE_STRUCT: avalue[i] = *(void**)ptr; break; default: /* This is an 8-byte value. */ avalue[i] = ptr; ptr += 4; break; } ptr += 4; /* If we've handled more arguments than fit in registers, start looking at the those passed on the stack. */ if (ptr == ((char *)register_args + (6*4))) ptr = stack_args; } /* Invoke the closure. */ if (cif->rtype->type == FFI_TYPE_STRUCT) { /* The caller allocates space for the return structure, and passes a pointer to this space in gr3. Use this value directly as the return value. */ register void *return_struct_ptr __asm__("gr3"); (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data); } else { /* Allocate space for the return value and call the function. */ long long rvalue; (closure->fun) (cif, &rvalue, avalue, closure->user_data); /* Functions return 4-byte or smaller results in gr8. 8-byte values also use gr9. We fill the both, even for small return values, just to avoid a branch. */ asm ("ldi @(%0, #0), gr8" : : "r" (&rvalue)); asm ("ldi @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1])); } } ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp = (unsigned int *) &closure->tramp[0]; unsigned long fn = (long) ffi_closure_eabi; unsigned long cls = (long) closure; #ifdef __FRV_FDPIC__ register void *got __asm__("gr15"); #endif int i; fn = (unsigned long) ffi_closure_eabi; #ifdef __FRV_FDPIC__ tramp[0] = &tramp[2]; tramp[1] = got; tramp[2] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ tramp[3] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ tramp[4] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ tramp[5] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ tramp[6] = 0x9cc86000; /* ldi @(gr6, #0), gr14 */ tramp[7] = 0x8030e000; /* jmpl @(gr14, gr0) */ #else tramp[0] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ tramp[2] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ tramp[3] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ tramp[4] = 0x80300006; /* jmpl @(gr0, gr6) */ #endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* Cache flushing. */ for (i = 0; i < FFI_TRAMPOLINE_SIZE; i++) __asm__ volatile ("dcf @(%0,%1)\n\tici @(%0,%1)" :: "r" (tramp), "r" (i)); return FFI_OK; } gauche-c-wrapper-0.6.1.orig/libffi/src/frv/ffitarget.h0000644000000000000000000000377611237307543017462 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2004 Red Hat, Inc. Target configuration macros for FR-V Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- System specific configurations ----------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, #ifdef FRV FFI_EABI, FFI_DEFAULT_ABI = FFI_EABI, #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_NATIVE_RAW_API 0 #ifdef __FRV_FDPIC__ /* Trampolines are 8 4-byte instructions long. */ #define FFI_TRAMPOLINE_SIZE (8*4) #else /* Trampolines are 5 4-byte instructions long. */ #define FFI_TRAMPOLINE_SIZE (5*4) #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/src/ia64/0002755000000000000000000000000011237307543015271 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/ia64/ffi.c0000644000000000000000000003463211237307543016207 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include #include #include "ia64_flags.h" /* A 64-bit pointer value. In LP64 mode, this is effectively a plain pointer. In ILP32 mode, it's a pointer that's been extended to 64 bits by "addp4". */ typedef void *PTR64 __attribute__((mode(DI))); /* Memory image of fp register contents. This is the implementation specific format used by ldf.fill/stf.spill. All we care about is that it wants a 16 byte aligned slot. */ typedef struct { UINT64 x[2] __attribute__((aligned(16))); } fpreg; /* The stack layout given to ffi_call_unix and ffi_closure_unix_inner. */ struct ia64_args { fpreg fp_regs[8]; /* Contents of 8 fp arg registers. */ UINT64 gp_regs[8]; /* Contents of 8 gp arg registers. */ UINT64 other_args[]; /* Arguments passed on stack, variable size. */ }; /* Adjust ADDR, a pointer to an 8 byte slot, to point to the low LEN bytes. */ static inline void * endian_adjust (void *addr, size_t len) { #ifdef __BIG_ENDIAN__ return addr + (8 - len); #else return addr; #endif } /* Store VALUE to ADDR in the current cpu implementation's fp spill format. */ static inline void stf_spill(fpreg *addr, __float80 value) { asm ("stf.spill %0 = %1%P0" : "=m" (*addr) : "f"(value)); } /* Load a value from ADDR, which is in the current cpu implementation's fp spill format. */ static inline __float80 ldf_fill(fpreg *addr) { __float80 ret; asm ("ldf.fill %0 = %1%P1" : "=f"(ret) : "m"(*addr)); return ret; } /* Return the size of the C type associated with with TYPE. Which will be one of the FFI_IA64_TYPE_HFA_* values. */ static size_t hfa_type_size (int type) { switch (type) { case FFI_IA64_TYPE_HFA_FLOAT: return sizeof(float); case FFI_IA64_TYPE_HFA_DOUBLE: return sizeof(double); case FFI_IA64_TYPE_HFA_LDOUBLE: return sizeof(__float80); default: abort (); } } /* Load from ADDR a value indicated by TYPE. Which will be one of the FFI_IA64_TYPE_HFA_* values. */ static __float80 hfa_type_load (int type, void *addr) { switch (type) { case FFI_IA64_TYPE_HFA_FLOAT: return *(float *) addr; case FFI_IA64_TYPE_HFA_DOUBLE: return *(double *) addr; case FFI_IA64_TYPE_HFA_LDOUBLE: return *(__float80 *) addr; default: abort (); } } /* Load VALUE into ADDR as indicated by TYPE. Which will be one of the FFI_IA64_TYPE_HFA_* values. */ static void hfa_type_store (int type, void *addr, __float80 value) { switch (type) { case FFI_IA64_TYPE_HFA_FLOAT: *(float *) addr = value; break; case FFI_IA64_TYPE_HFA_DOUBLE: *(double *) addr = value; break; case FFI_IA64_TYPE_HFA_LDOUBLE: *(__float80 *) addr = value; break; default: abort (); } } /* Is TYPE a struct containing floats, doubles, or extended doubles, all of the same fp type? If so, return the element type. Return FFI_TYPE_VOID if not. */ static int hfa_element_type (ffi_type *type, int nested) { int element = FFI_TYPE_VOID; switch (type->type) { case FFI_TYPE_FLOAT: /* We want to return VOID for raw floating-point types, but the synthetic HFA type if we're nested within an aggregate. */ if (nested) element = FFI_IA64_TYPE_HFA_FLOAT; break; case FFI_TYPE_DOUBLE: /* Similarly. */ if (nested) element = FFI_IA64_TYPE_HFA_DOUBLE; break; case FFI_TYPE_LONGDOUBLE: /* Similarly, except that that HFA is true for double extended, but not quad precision. Both have sizeof == 16, so tell the difference based on the precision. */ if (LDBL_MANT_DIG == 64 && nested) element = FFI_IA64_TYPE_HFA_LDOUBLE; break; case FFI_TYPE_STRUCT: { ffi_type **ptr = &type->elements[0]; for (ptr = &type->elements[0]; *ptr ; ptr++) { int sub_element = hfa_element_type (*ptr, 1); if (sub_element == FFI_TYPE_VOID) return FFI_TYPE_VOID; if (element == FFI_TYPE_VOID) element = sub_element; else if (element != sub_element) return FFI_TYPE_VOID; } } break; default: return FFI_TYPE_VOID; } return element; } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { int flags; /* Adjust cif->bytes to include space for the bits of the ia64_args frame that preceeds the integer register portion. The estimate that the generic bits did for the argument space required is good enough for the integer component. */ cif->bytes += offsetof(struct ia64_args, gp_regs[0]); if (cif->bytes < sizeof(struct ia64_args)) cif->bytes = sizeof(struct ia64_args); /* Set the return type flag. */ flags = cif->rtype->type; switch (cif->rtype->type) { case FFI_TYPE_LONGDOUBLE: /* Leave FFI_TYPE_LONGDOUBLE as meaning double extended precision, and encode quad precision as a two-word integer structure. */ if (LDBL_MANT_DIG != 64) flags = FFI_IA64_TYPE_SMALL_STRUCT | (16 << 8); break; case FFI_TYPE_STRUCT: { size_t size = cif->rtype->size; int hfa_type = hfa_element_type (cif->rtype, 0); if (hfa_type != FFI_TYPE_VOID) { size_t nelts = size / hfa_type_size (hfa_type); if (nelts <= 8) flags = hfa_type | (size << 8); } else { if (size <= 32) flags = FFI_IA64_TYPE_SMALL_STRUCT | (size << 8); } } break; default: break; } cif->flags = flags; return FFI_OK; } extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(), UINT64); void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { struct ia64_args *stack; long i, avn, gpcount, fpcount; ffi_type **p_arg; FFI_ASSERT (cif->abi == FFI_UNIX); /* If we have no spot for a return value, make one. */ if (rvalue == NULL && cif->rtype->type != FFI_TYPE_VOID) rvalue = alloca (cif->rtype->size); /* Allocate the stack frame. */ stack = alloca (cif->bytes); gpcount = fpcount = 0; avn = cif->nargs; for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: stack->gp_regs[gpcount++] = *(SINT8 *)avalue[i]; break; case FFI_TYPE_UINT8: stack->gp_regs[gpcount++] = *(UINT8 *)avalue[i]; break; case FFI_TYPE_SINT16: stack->gp_regs[gpcount++] = *(SINT16 *)avalue[i]; break; case FFI_TYPE_UINT16: stack->gp_regs[gpcount++] = *(UINT16 *)avalue[i]; break; case FFI_TYPE_SINT32: stack->gp_regs[gpcount++] = *(SINT32 *)avalue[i]; break; case FFI_TYPE_UINT32: stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i]; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; break; case FFI_TYPE_POINTER: stack->gp_regs[gpcount++] = (UINT64)(PTR64) *(void **)avalue[i]; break; case FFI_TYPE_FLOAT: if (gpcount < 8 && fpcount < 8) stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]); stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i]; break; case FFI_TYPE_DOUBLE: if (gpcount < 8 && fpcount < 8) stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]); stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; break; case FFI_TYPE_LONGDOUBLE: if (gpcount & 1) gpcount++; if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8) stf_spill (&stack->fp_regs[fpcount++], *(__float80 *)avalue[i]); memcpy (&stack->gp_regs[gpcount], avalue[i], 16); gpcount += 2; break; case FFI_TYPE_STRUCT: { size_t size = (*p_arg)->size; size_t align = (*p_arg)->alignment; int hfa_type = hfa_element_type (*p_arg, 0); FFI_ASSERT (align <= 16); if (align == 16 && (gpcount & 1)) gpcount++; if (hfa_type != FFI_TYPE_VOID) { size_t hfa_size = hfa_type_size (hfa_type); size_t offset = 0; size_t gp_offset = gpcount * 8; while (fpcount < 8 && offset < size && gp_offset < 8 * 8) { stf_spill (&stack->fp_regs[fpcount], hfa_type_load (hfa_type, avalue[i] + offset)); offset += hfa_size; gp_offset += hfa_size; fpcount += 1; } } memcpy (&stack->gp_regs[gpcount], avalue[i], size); gpcount += (size + 7) / 8; } break; default: abort (); } } ffi_call_unix (stack, rvalue, fn, cif->flags); } /* Closures represent a pair consisting of a function pointer, and some user data. A closure is invoked by reinterpreting the closure as a function pointer, and branching to it. Thus we can make an interpreted function callable as a C function: We turn the interpreter itself, together with a pointer specifying the interpreted procedure, into a closure. For IA64, function pointer are already pairs consisting of a code pointer, and a gp pointer. The latter is needed to access global variables. Here we set up such a pair as the first two words of the closure (in the "trampoline" area), but we replace the gp pointer with a pointer to the closure itself. We also add the real gp pointer to the closure. This allows the function entry code to both retrieve the user data, and to restire the correct gp pointer. */ extern void ffi_closure_unix (); ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data) { /* The layout of a function descriptor. A C function pointer really points to one of these. */ struct ia64_fd { UINT64 code_pointer; UINT64 gp; }; struct ffi_ia64_trampoline_struct { UINT64 code_pointer; /* Pointer to ffi_closure_unix. */ UINT64 fake_gp; /* Pointer to closure, installed as gp. */ UINT64 real_gp; /* Real gp value. */ }; struct ffi_ia64_trampoline_struct *tramp; struct ia64_fd *fd; FFI_ASSERT (cif->abi == FFI_UNIX); tramp = (struct ffi_ia64_trampoline_struct *)closure->tramp; fd = (struct ia64_fd *)(void *)ffi_closure_unix; tramp->code_pointer = fd->code_pointer; tramp->real_gp = fd->gp; tramp->fake_gp = (UINT64)(PTR64)closure; closure->cif = cif; closure->user_data = user_data; closure->fun = fun; return FFI_OK; } UINT64 ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack, void *rvalue, void *r8) { ffi_cif *cif; void **avalue; ffi_type **p_arg; long i, avn, gpcount, fpcount; cif = closure->cif; avn = cif->nargs; avalue = alloca (avn * sizeof (void *)); /* If the structure return value is passed in memory get that location from r8 so as to pass the value directly back to the caller. */ if (cif->flags == FFI_TYPE_STRUCT) rvalue = r8; gpcount = fpcount = 0; for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 1); break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 2); break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 4); break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: avalue[i] = &stack->gp_regs[gpcount++]; break; case FFI_TYPE_POINTER: avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], sizeof(void*)); break; case FFI_TYPE_FLOAT: if (gpcount < 8 && fpcount < 8) { void *addr = &stack->fp_regs[fpcount++]; avalue[i] = addr; *(float *)addr = ldf_fill (addr); } else avalue[i] = endian_adjust(&stack->gp_regs[gpcount], 4); gpcount++; break; case FFI_TYPE_DOUBLE: if (gpcount < 8 && fpcount < 8) { void *addr = &stack->fp_regs[fpcount++]; avalue[i] = addr; *(double *)addr = ldf_fill (addr); } else avalue[i] = &stack->gp_regs[gpcount]; gpcount++; break; case FFI_TYPE_LONGDOUBLE: if (gpcount & 1) gpcount++; if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8) { void *addr = &stack->fp_regs[fpcount++]; avalue[i] = addr; *(__float80 *)addr = ldf_fill (addr); } else avalue[i] = &stack->gp_regs[gpcount]; gpcount += 2; break; case FFI_TYPE_STRUCT: { size_t size = (*p_arg)->size; size_t align = (*p_arg)->alignment; int hfa_type = hfa_element_type (*p_arg, 0); FFI_ASSERT (align <= 16); if (align == 16 && (gpcount & 1)) gpcount++; if (hfa_type != FFI_TYPE_VOID) { size_t hfa_size = hfa_type_size (hfa_type); size_t offset = 0; size_t gp_offset = gpcount * 8; void *addr = alloca (size); avalue[i] = addr; while (fpcount < 8 && offset < size && gp_offset < 8 * 8) { hfa_type_store (hfa_type, addr + offset, ldf_fill (&stack->fp_regs[fpcount])); offset += hfa_size; gp_offset += hfa_size; fpcount += 1; } if (offset < size) memcpy (addr + offset, (char *)stack->gp_regs + gp_offset, size - offset); } else avalue[i] = &stack->gp_regs[gpcount]; gpcount += (size + 7) / 8; } break; default: abort (); } } closure->fun (cif, rvalue, avalue, closure->user_data); return cif->flags; } gauche-c-wrapper-0.6.1.orig/libffi/src/ia64/ffitarget.h0000644000000000000000000000361411237307543017417 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for IA-64. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long long ffi_arg; typedef signed long long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_UNIX, /* Linux and all Unix variants use the same conventions */ FFI_DEFAULT_ABI = FFI_UNIX, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */ /* can be interpreted as a C function */ /* descriptor: */ #endif gauche-c-wrapper-0.6.1.orig/libffi/src/ia64/ia64_flags.h0000644000000000000000000000361111237307543017360 0ustar /* ----------------------------------------------------------------------- ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company IA64/unix Foreign Function Interface Original author: Hans Boehm, HP Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ /* "Type" codes used between assembly and C. When used as a part of a cfi->flags value, the low byte will be these extra type codes, and bits 8-31 will be the actual size of the type. */ /* Small structures containing N words in integer registers. */ #define FFI_IA64_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 1) /* Homogeneous Floating Point Aggregates (HFAs) which are returned in FP registers. */ #define FFI_IA64_TYPE_HFA_FLOAT (FFI_TYPE_LAST + 2) #define FFI_IA64_TYPE_HFA_DOUBLE (FFI_TYPE_LAST + 3) #define FFI_IA64_TYPE_HFA_LDOUBLE (FFI_TYPE_LAST + 4) gauche-c-wrapper-0.6.1.orig/libffi/src/ia64/unix.S0000644000000000000000000002641311237307543016404 0ustar /* ----------------------------------------------------------------------- unix.S - Copyright (c) 1998 Red Hat, Inc. Copyright (c) 2000 Hewlett Packard Company IA64/unix Foreign Function Interface Primary author: Hans Boehm, HP Labs Loosely modeled on Cygnus code for other platforms. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #include "ia64_flags.h" .pred.safe_across_calls p1-p5,p16-p63 .text /* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue, void (*fn)(), int flags); */ .align 16 .global ffi_call_unix .proc ffi_call_unix ffi_call_unix: .prologue /* Bit o trickiness. We actually share a stack frame with ffi_call. Rely on the fact that ffi_call uses a vframe and don't bother tracking one here at all. */ .fframe 0 .save ar.pfs, r36 // loc0 alloc loc0 = ar.pfs, 4, 3, 8, 0 .save rp, loc1 mov loc1 = b0 .body add r16 = 16, in0 mov loc2 = gp mov r8 = in1 ;; /* Load up all of the argument registers. */ ldf.fill f8 = [in0], 32 ldf.fill f9 = [r16], 32 ;; ldf.fill f10 = [in0], 32 ldf.fill f11 = [r16], 32 ;; ldf.fill f12 = [in0], 32 ldf.fill f13 = [r16], 32 ;; ldf.fill f14 = [in0], 32 ldf.fill f15 = [r16], 24 ;; ld8 out0 = [in0], 16 ld8 out1 = [r16], 16 ;; ld8 out2 = [in0], 16 ld8 out3 = [r16], 16 ;; ld8 out4 = [in0], 16 ld8 out5 = [r16], 16 ;; ld8 out6 = [in0] ld8 out7 = [r16] ;; /* Deallocate the register save area from the stack frame. */ mov sp = in0 /* Call the target function. */ ld8 r16 = [in2], 8 ;; ld8 gp = [in2] mov b6 = r16 br.call.sptk.many b0 = b6 ;; /* Dispatch to handle return value. */ mov gp = loc2 zxt1 r16 = in3 ;; mov ar.pfs = loc0 addl r18 = @ltoffx(.Lst_table), gp ;; ld8.mov r18 = [r18], .Lst_table mov b0 = loc1 ;; shladd r18 = r16, 3, r18 ;; ld8 r17 = [r18] shr in3 = in3, 8 ;; add r17 = r17, r18 ;; mov b6 = r17 br b6 ;; .Lst_void: br.ret.sptk.many b0 ;; .Lst_uint8: zxt1 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_sint8: sxt1 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_uint16: zxt2 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_sint16: sxt2 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_uint32: zxt4 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_sint32: sxt4 r8 = r8 ;; st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_int64: st8 [in1] = r8 br.ret.sptk.many b0 ;; .Lst_float: stfs [in1] = f8 br.ret.sptk.many b0 ;; .Lst_double: stfd [in1] = f8 br.ret.sptk.many b0 ;; .Lst_ldouble: stfe [in1] = f8 br.ret.sptk.many b0 ;; .Lst_small_struct: add sp = -16, sp cmp.lt p6, p0 = 8, in3 cmp.lt p7, p0 = 16, in3 cmp.lt p8, p0 = 24, in3 ;; add r16 = 8, sp add r17 = 16, sp add r18 = 24, sp ;; st8 [sp] = r8 (p6) st8 [r16] = r9 mov out0 = in1 (p7) st8 [r17] = r10 (p8) st8 [r18] = r11 mov out1 = sp mov out2 = in3 br.call.sptk.many b0 = memcpy# ;; mov ar.pfs = loc0 mov b0 = loc1 mov gp = loc2 br.ret.sptk.many b0 .Lst_hfa_float: add r16 = 4, in1 cmp.lt p6, p0 = 4, in3 ;; stfs [in1] = f8, 8 (p6) stfs [r16] = f9, 8 cmp.lt p7, p0 = 8, in3 cmp.lt p8, p0 = 12, in3 ;; (p7) stfs [in1] = f10, 8 (p8) stfs [r16] = f11, 8 cmp.lt p9, p0 = 16, in3 cmp.lt p10, p0 = 20, in3 ;; (p9) stfs [in1] = f12, 8 (p10) stfs [r16] = f13, 8 cmp.lt p6, p0 = 24, in3 cmp.lt p7, p0 = 28, in3 ;; (p6) stfs [in1] = f14 (p7) stfs [r16] = f15 br.ret.sptk.many b0 ;; .Lst_hfa_double: add r16 = 8, in1 cmp.lt p6, p0 = 8, in3 ;; stfd [in1] = f8, 16 (p6) stfd [r16] = f9, 16 cmp.lt p7, p0 = 16, in3 cmp.lt p8, p0 = 24, in3 ;; (p7) stfd [in1] = f10, 16 (p8) stfd [r16] = f11, 16 cmp.lt p9, p0 = 32, in3 cmp.lt p10, p0 = 40, in3 ;; (p9) stfd [in1] = f12, 16 (p10) stfd [r16] = f13, 16 cmp.lt p6, p0 = 48, in3 cmp.lt p7, p0 = 56, in3 ;; (p6) stfd [in1] = f14 (p7) stfd [r16] = f15 br.ret.sptk.many b0 ;; .Lst_hfa_ldouble: add r16 = 16, in1 cmp.lt p6, p0 = 16, in3 ;; stfe [in1] = f8, 32 (p6) stfe [r16] = f9, 32 cmp.lt p7, p0 = 32, in3 cmp.lt p8, p0 = 48, in3 ;; (p7) stfe [in1] = f10, 32 (p8) stfe [r16] = f11, 32 cmp.lt p9, p0 = 64, in3 cmp.lt p10, p0 = 80, in3 ;; (p9) stfe [in1] = f12, 32 (p10) stfe [r16] = f13, 32 cmp.lt p6, p0 = 96, in3 cmp.lt p7, p0 = 112, in3 ;; (p6) stfe [in1] = f14 (p7) stfe [r16] = f15 br.ret.sptk.many b0 ;; .endp ffi_call_unix .align 16 .global ffi_closure_unix .proc ffi_closure_unix #define FRAME_SIZE (8*16 + 8*8 + 8*16) ffi_closure_unix: .prologue .save ar.pfs, r40 // loc0 alloc loc0 = ar.pfs, 8, 4, 4, 0 .fframe FRAME_SIZE add r12 = -FRAME_SIZE, r12 .save rp, loc1 mov loc1 = b0 .save ar.unat, loc2 mov loc2 = ar.unat .body /* Retrieve closure pointer and real gp. */ #ifdef _ILP32 addp4 out0 = 0, gp addp4 gp = 16, gp #else mov out0 = gp add gp = 16, gp #endif ;; ld8 gp = [gp] /* Spill all of the possible argument registers. */ add r16 = 16 + 8*16, sp add r17 = 16 + 8*16 + 16, sp ;; stf.spill [r16] = f8, 32 stf.spill [r17] = f9, 32 mov loc3 = gp ;; stf.spill [r16] = f10, 32 stf.spill [r17] = f11, 32 ;; stf.spill [r16] = f12, 32 stf.spill [r17] = f13, 32 ;; stf.spill [r16] = f14, 32 stf.spill [r17] = f15, 24 ;; .mem.offset 0, 0 st8.spill [r16] = in0, 16 .mem.offset 8, 0 st8.spill [r17] = in1, 16 add out1 = 16 + 8*16, sp ;; .mem.offset 0, 0 st8.spill [r16] = in2, 16 .mem.offset 8, 0 st8.spill [r17] = in3, 16 add out2 = 16, sp ;; .mem.offset 0, 0 st8.spill [r16] = in4, 16 .mem.offset 8, 0 st8.spill [r17] = in5, 16 mov out3 = r8 ;; .mem.offset 0, 0 st8.spill [r16] = in6 .mem.offset 8, 0 st8.spill [r17] = in7 /* Invoke ffi_closure_unix_inner for the hard work. */ br.call.sptk.many b0 = ffi_closure_unix_inner ;; /* Dispatch to handle return value. */ mov gp = loc3 zxt1 r16 = r8 ;; addl r18 = @ltoffx(.Lld_table), gp mov ar.pfs = loc0 ;; ld8.mov r18 = [r18], .Lld_table mov b0 = loc1 ;; shladd r18 = r16, 3, r18 mov ar.unat = loc2 ;; ld8 r17 = [r18] shr r8 = r8, 8 ;; add r17 = r17, r18 add r16 = 16, sp ;; mov b6 = r17 br b6 ;; .label_state 1 .Lld_void: .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_int: .body .copy_state 1 ld8 r8 = [r16] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_float: .body .copy_state 1 ldfs f8 = [r16] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_double: .body .copy_state 1 ldfd f8 = [r16] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_ldouble: .body .copy_state 1 ldfe f8 = [r16] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_small_struct: .body .copy_state 1 add r17 = 8, r16 cmp.lt p6, p0 = 8, r8 cmp.lt p7, p0 = 16, r8 cmp.lt p8, p0 = 24, r8 ;; ld8 r8 = [r16], 16 (p6) ld8 r9 = [r17], 16 ;; (p7) ld8 r10 = [r16] (p8) ld8 r11 = [r17] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_hfa_float: .body .copy_state 1 add r17 = 4, r16 cmp.lt p6, p0 = 4, r8 ;; ldfs f8 = [r16], 8 (p6) ldfs f9 = [r17], 8 cmp.lt p7, p0 = 8, r8 cmp.lt p8, p0 = 12, r8 ;; (p7) ldfs f10 = [r16], 8 (p8) ldfs f11 = [r17], 8 cmp.lt p9, p0 = 16, r8 cmp.lt p10, p0 = 20, r8 ;; (p9) ldfs f12 = [r16], 8 (p10) ldfs f13 = [r17], 8 cmp.lt p6, p0 = 24, r8 cmp.lt p7, p0 = 28, r8 ;; (p6) ldfs f14 = [r16] (p7) ldfs f15 = [r17] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_hfa_double: .body .copy_state 1 add r17 = 8, r16 cmp.lt p6, p0 = 8, r8 ;; ldfd f8 = [r16], 16 (p6) ldfd f9 = [r17], 16 cmp.lt p7, p0 = 16, r8 cmp.lt p8, p0 = 24, r8 ;; (p7) ldfd f10 = [r16], 16 (p8) ldfd f11 = [r17], 16 cmp.lt p9, p0 = 32, r8 cmp.lt p10, p0 = 40, r8 ;; (p9) ldfd f12 = [r16], 16 (p10) ldfd f13 = [r17], 16 cmp.lt p6, p0 = 48, r8 cmp.lt p7, p0 = 56, r8 ;; (p6) ldfd f14 = [r16] (p7) ldfd f15 = [r17] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .Lld_hfa_ldouble: .body .copy_state 1 add r17 = 16, r16 cmp.lt p6, p0 = 16, r8 ;; ldfe f8 = [r16], 32 (p6) ldfe f9 = [r17], 32 cmp.lt p7, p0 = 32, r8 cmp.lt p8, p0 = 48, r8 ;; (p7) ldfe f10 = [r16], 32 (p8) ldfe f11 = [r17], 32 cmp.lt p9, p0 = 64, r8 cmp.lt p10, p0 = 80, r8 ;; (p9) ldfe f12 = [r16], 32 (p10) ldfe f13 = [r17], 32 cmp.lt p6, p0 = 96, r8 cmp.lt p7, p0 = 112, r8 ;; (p6) ldfe f14 = [r16] (p7) ldfe f15 = [r17] .restore sp add sp = FRAME_SIZE, sp br.ret.sptk.many b0 ;; .endp ffi_closure_unix .section .rodata .align 8 .Lst_table: data8 @pcrel(.Lst_void) // FFI_TYPE_VOID data8 @pcrel(.Lst_sint32) // FFI_TYPE_INT data8 @pcrel(.Lst_float) // FFI_TYPE_FLOAT data8 @pcrel(.Lst_double) // FFI_TYPE_DOUBLE data8 @pcrel(.Lst_ldouble) // FFI_TYPE_LONGDOUBLE data8 @pcrel(.Lst_uint8) // FFI_TYPE_UINT8 data8 @pcrel(.Lst_sint8) // FFI_TYPE_SINT8 data8 @pcrel(.Lst_uint16) // FFI_TYPE_UINT16 data8 @pcrel(.Lst_sint16) // FFI_TYPE_SINT16 data8 @pcrel(.Lst_uint32) // FFI_TYPE_UINT32 data8 @pcrel(.Lst_sint32) // FFI_TYPE_SINT32 data8 @pcrel(.Lst_int64) // FFI_TYPE_UINT64 data8 @pcrel(.Lst_int64) // FFI_TYPE_SINT64 data8 @pcrel(.Lst_void) // FFI_TYPE_STRUCT data8 @pcrel(.Lst_int64) // FFI_TYPE_POINTER data8 @pcrel(.Lst_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT data8 @pcrel(.Lst_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT data8 @pcrel(.Lst_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE data8 @pcrel(.Lst_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE .Lld_table: data8 @pcrel(.Lld_void) // FFI_TYPE_VOID data8 @pcrel(.Lld_int) // FFI_TYPE_INT data8 @pcrel(.Lld_float) // FFI_TYPE_FLOAT data8 @pcrel(.Lld_double) // FFI_TYPE_DOUBLE data8 @pcrel(.Lld_ldouble) // FFI_TYPE_LONGDOUBLE data8 @pcrel(.Lld_int) // FFI_TYPE_UINT8 data8 @pcrel(.Lld_int) // FFI_TYPE_SINT8 data8 @pcrel(.Lld_int) // FFI_TYPE_UINT16 data8 @pcrel(.Lld_int) // FFI_TYPE_SINT16 data8 @pcrel(.Lld_int) // FFI_TYPE_UINT32 data8 @pcrel(.Lld_int) // FFI_TYPE_SINT32 data8 @pcrel(.Lld_int) // FFI_TYPE_UINT64 data8 @pcrel(.Lld_int) // FFI_TYPE_SINT64 data8 @pcrel(.Lld_void) // FFI_TYPE_STRUCT data8 @pcrel(.Lld_int) // FFI_TYPE_POINTER data8 @pcrel(.Lld_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE gauche-c-wrapper-0.6.1.orig/libffi/src/java_raw_api.c0000644000000000000000000001756111237307543017325 0ustar /* ----------------------------------------------------------------------- java_raw_api.c - Copyright (c) 1999 Red Hat, Inc. Cloned from raw_api.c Raw_api.c author: Kresten Krab Thorup Java_raw_api.c author: Hans-J. Boehm $Id $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ /* This defines a Java- and 64-bit specific variant of the raw API. */ /* It assumes that "raw" argument blocks look like Java stacks on a */ /* 64-bit machine. Arguments that can be stored in a single stack */ /* stack slots (longs, doubles) occupy 128 bits, but only the first */ /* 64 bits are actually used. */ #include #include #include #if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API) size_t ffi_java_raw_size (ffi_cif *cif) { size_t result = 0; int i; ffi_type **at = cif->arg_types; for (i = cif->nargs-1; i >= 0; i--, at++) { switch((*at) -> type) { case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: result += 2 * FFI_SIZEOF_ARG; break; case FFI_TYPE_STRUCT: /* No structure parameters in Java. */ abort(); default: result += FFI_SIZEOF_ARG; } } return result; } void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) { unsigned i; ffi_type **tp = cif->arg_types; #if WORDS_BIGENDIAN for (i = 0; i < cif->nargs; i++, tp++, args++) { switch ((*tp)->type) { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: *args = (void*) ((char*)(raw++) + 3); break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: *args = (void*) ((char*)(raw++) + 2); break; #if FFI_SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: *args = (void *)raw; raw += 2; break; #endif case FFI_TYPE_POINTER: *args = (void*) &(raw++)->ptr; break; default: *args = raw; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } #else /* WORDS_BIGENDIAN */ #if !PDP /* then assume little endian */ for (i = 0; i < cif->nargs; i++, tp++, args++) { #if FFI_SIZEOF_ARG == 8 switch((*tp)->type) { case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: *args = (void*) raw; raw += 2; break; default: *args = (void*) raw++; } #else /* FFI_SIZEOF_ARG != 8 */ *args = (void*) raw; raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); #endif /* FFI_SIZEOF_ARG == 8 */ } #else #error "pdp endian not supported" #endif /* ! PDP */ #endif /* WORDS_BIGENDIAN */ } void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) { unsigned i; ffi_type **tp = cif->arg_types; for (i = 0; i < cif->nargs; i++, tp++, args++) { switch ((*tp)->type) { case FFI_TYPE_UINT8: #if WORDS_BIGENDIAN *(UINT32*)(raw++) = *(UINT8*) (*args); #else (raw++)->uint = *(UINT8*) (*args); #endif break; case FFI_TYPE_SINT8: #if WORDS_BIGENDIAN *(SINT32*)(raw++) = *(SINT8*) (*args); #else (raw++)->sint = *(SINT8*) (*args); #endif break; case FFI_TYPE_UINT16: #if WORDS_BIGENDIAN *(UINT32*)(raw++) = *(UINT16*) (*args); #else (raw++)->uint = *(UINT16*) (*args); #endif break; case FFI_TYPE_SINT16: #if WORDS_BIGENDIAN *(SINT32*)(raw++) = *(SINT16*) (*args); #else (raw++)->sint = *(SINT16*) (*args); #endif break; case FFI_TYPE_UINT32: #if WORDS_BIGENDIAN *(UINT32*)(raw++) = *(UINT32*) (*args); #else (raw++)->uint = *(UINT32*) (*args); #endif break; case FFI_TYPE_SINT32: #if WORDS_BIGENDIAN *(SINT32*)(raw++) = *(SINT32*) (*args); #else (raw++)->sint = *(SINT32*) (*args); #endif break; case FFI_TYPE_FLOAT: (raw++)->flt = *(FLOAT32*) (*args); break; #if FFI_SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_DOUBLE: raw->uint = *(UINT64*) (*args); raw += 2; break; #endif case FFI_TYPE_POINTER: (raw++)->ptr = **(void***) args; break; default: #if FFI_SIZEOF_ARG == 8 FFI_ASSERT(0); /* Should have covered all cases */ #else memcpy ((void*) raw->data, (void*)*args, (*tp)->size); raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; #endif } } } #if !FFI_NATIVE_RAW_API static void ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) { #if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 switch (cif->rtype->type) { case FFI_TYPE_UINT8: case FFI_TYPE_UINT16: case FFI_TYPE_UINT32: *(UINT64 *)rvalue <<= 32; break; case FFI_TYPE_SINT8: case FFI_TYPE_SINT16: case FFI_TYPE_SINT32: case FFI_TYPE_INT: *(SINT64 *)rvalue <<= 32; break; default: break; } #endif } static void ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) { #if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 switch (cif->rtype->type) { case FFI_TYPE_UINT8: case FFI_TYPE_UINT16: case FFI_TYPE_UINT32: *(UINT64 *)rvalue >>= 32; break; case FFI_TYPE_SINT8: case FFI_TYPE_SINT16: case FFI_TYPE_SINT32: case FFI_TYPE_INT: *(SINT64 *)rvalue >>= 32; break; default: break; } #endif } /* This is a generic definition of ffi_raw_call, to be used if the * native system does not provide a machine-specific implementation. * Having this, allows code to be written for the raw API, without * the need for system-specific code to handle input in that format; * these following couple of functions will handle the translation forth * and back automatically. */ void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ ffi_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ffi_java_raw_to_ptrarray (cif, raw, avalue); ffi_call (cif, fn, rvalue, avalue); ffi_java_rvalue_to_raw (cif, rvalue); } #if FFI_CLOSURES /* base system provides closures */ static void ffi_java_translate_args (ffi_cif *cif, void *rvalue, void **avalue, void *user_data) { ffi_raw *raw = (ffi_raw*)alloca (ffi_java_raw_size (cif)); ffi_raw_closure *cl = (ffi_raw_closure*)user_data; ffi_java_ptrarray_to_raw (cif, avalue, raw); (*cl->fun) (cif, rvalue, raw, cl->user_data); ffi_java_raw_to_rvalue (cif, rvalue); } /* Again, here is the generic version of ffi_prep_raw_closure, which * will install an intermediate "hub" for translation of arguments from * the pointer-array format, to the raw format */ ffi_status ffi_prep_java_raw_closure (ffi_raw_closure* cl, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data) { ffi_status status; status = ffi_prep_closure ((ffi_closure*) cl, cif, &ffi_java_translate_args, (void*)cl); if (status == FFI_OK) { cl->fun = fun; cl->user_data = user_data; } return status; } #endif /* FFI_CLOSURES */ #endif /* !FFI_NATIVE_RAW_API */ #endif /* !FFI_NO_RAW_API */ gauche-c-wrapper-0.6.1.orig/libffi/src/m32r/0002755000000000000000000000000011237307543015311 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/m32r/ffi.c0000644000000000000000000001331311237307543016220 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Renesas Technology M32R Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments. */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { unsigned int i; int tmp; unsigned int avn; void **p_argv; char *argp; ffi_type **p_arg; tmp = 0; argp = stack; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8) { *(void **) argp = ecif->rvalue; argp += 4; } avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0) && (avn != 0); i--, p_arg++) { size_t z; /* Align if necessary. */ if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN (argp, (*p_arg)->alignment); if (avn != 0) { avn--; z = (*p_arg)->size; if (z < sizeof (int)) { z = sizeof (int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_STRUCT: z = (*p_arg)->size; if ((*p_arg)->alignment != 1) memcpy (argp, *p_argv, z); else memcpy (argp + 4 - z, *p_argv, z); z = sizeof (int); break; default: FFI_ASSERT(0); } } else if (z == sizeof (int)) { *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); } else { if ((*p_arg)->type == FFI_TYPE_STRUCT) { if (z > 8) { *(unsigned int *) argp = (unsigned int)(void *)(* p_argv); z = sizeof(void *); } else { memcpy(argp, *p_argv, z); z = 8; } } else { /* Double or long long 64bit. */ memcpy (argp, *p_argv, z); } } p_argv++; argp += z; } } return; } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Set the return type flag. */ switch (cif->rtype->type) { case FFI_TYPE_VOID: cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_STRUCT: if (cif->rtype->size <= 4) cif->flags = FFI_TYPE_INT; else if (cif->rtype->size <= 8) cif->flags = FFI_TYPE_DOUBLE; else cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_DOUBLE: cif->flags = FFI_TYPE_DOUBLE; break; case FFI_TYPE_FLOAT: default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return value address then we need to make one. */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca (cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); if (cif->rtype->type == FFI_TYPE_STRUCT) { int size = cif->rtype->size; int align = cif->rtype->alignment; if (size < 4) { if (align == 1) *(unsigned long *)(ecif.rvalue) <<= (4 - size) * 8; } else if (4 < size && size < 8) { if (align == 1) { memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); } else if (align == 2) { if (size & 1) size += 1; if (size != 8) memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); } } } /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } } gauche-c-wrapper-0.6.1.orig/libffi/src/m32r/ffitarget.h0000644000000000000000000000340011237307543017430 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 2004 Renesas Technology. Target configuration macros for M32R. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- Generic type definitions ----------------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif #define FFI_CLOSURES 0 #define FFI_TRAMPOLINE_SIZE 24 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/m32r/sysv.S0000644000000000000000000000575211237307543016450 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2004 Renesas Technology M32R Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef HAVE_MACHINE_ASM_H #include #else /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x)! .type CNAME(x),%function! CNAME(x): #endif .text /* R0: ffi_prep_args */ /* R1: &ecif */ /* R2: cif->bytes */ /* R3: fig->flags */ /* sp+0: ecif.rvalue */ /* sp+4: fn */ /* This assumes we are using gas. */ ENTRY(ffi_call_SYSV) /* Save registers. */ push fp push lr push r3 push r2 push r1 push r0 mv fp, sp /* Make room for all of the new args. */ sub sp, r2 /* Place all of the ffi_prep_args in position. */ mv lr, r0 mv r0, sp /* R1 already set. */ /* And call. */ jl lr /* Move first 4 parameters in registers... */ ld r0, @(0,sp) ld r1, @(4,sp) ld r2, @(8,sp) ld r3, @(12,sp) /* ...and adjust the stack. */ ld lr, @(8,fp) cmpi lr, #16 bc adjust_stack ldi lr, #16 adjust_stack: add sp, lr /* Call the function. */ ld lr, @(28,fp) jl lr /* Remove the space we pushed for the args. */ mv sp, fp /* Load R2 with the pointer to storage for the return value. */ ld r2, @(24,sp) /* Load R3 with the return type code. */ ld r3, @(12,sp) /* If the return value pointer is NULL, assume no return value. */ beqz r2, epilogue /* Return INT. */ ldi r4, #FFI_TYPE_INT bne r3, r4, return_double st r0, @r2 bra epilogue return_double: /* Return DOUBLE or LONGDOUBLE. */ ldi r4, #FFI_TYPE_DOUBLE bne r3, r4, epilogue st r0, @r2 st r1, @(4,r2) epilogue: pop r0 pop r1 pop r2 pop r3 pop lr pop fp jmp lr .ffi_call_SYSV_end: .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) gauche-c-wrapper-0.6.1.orig/libffi/src/m68k/0002755000000000000000000000000011237307543015313 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/m68k/ffi.c0000644000000000000000000000721311237307543016224 0ustar /* ----------------------------------------------------------------------- ffi.c m68k Foreign Function Interface ----------------------------------------------------------------------- */ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments. */ static void * ffi_prep_args (void *stack, extended_cif *ecif) { unsigned int i; void **p_argv; char *argp; ffi_type **p_arg; void *struct_value_ptr; argp = stack; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8) struct_value_ptr = ecif->rvalue; else struct_value_ptr = NULL; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++) { size_t z; /* Align if necessary. */ if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN (argp, (*p_arg)->alignment); z = (*p_arg)->size; if (z < sizeof (int)) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; break; case FFI_TYPE_STRUCT: memcpy (argp + sizeof (int) - z, *p_argv, z); break; default: FFI_ASSERT (0); } z = sizeof (int); } else memcpy (argp, *p_argv, z); p_argv++; argp += z; } return struct_value_ptr; } #define CIF_FLAGS_INT 1 #define CIF_FLAGS_DINT 2 #define CIF_FLAGS_FLOAT 4 #define CIF_FLAGS_DOUBLE 8 #define CIF_FLAGS_LDOUBLE 16 #define CIF_FLAGS_POINTER 32 #define CIF_FLAGS_STRUCT 64 /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep (ffi_cif *cif) { /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: cif->flags = 0; break; case FFI_TYPE_STRUCT: if (cif->rtype->size > 4 && cif->rtype->size <= 8) cif->flags = CIF_FLAGS_DINT; else if (cif->rtype->size <= 4) cif->flags = CIF_FLAGS_STRUCT; else cif->flags = 0; break; case FFI_TYPE_FLOAT: cif->flags = CIF_FLAGS_FLOAT; break; case FFI_TYPE_DOUBLE: cif->flags = CIF_FLAGS_DOUBLE; break; case FFI_TYPE_LONGDOUBLE: cif->flags = CIF_FLAGS_LDOUBLE; break; case FFI_TYPE_POINTER: cif->flags = CIF_FLAGS_POINTER; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags = CIF_FLAGS_DINT; break; default: cif->flags = CIF_FLAGS_INT; break; } return FFI_OK; } extern void ffi_call_SYSV (void *(*) (void *, extended_cif *), extended_cif *, unsigned, unsigned, unsigned, void *, void (*fn) ()); void ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return value address then we need to make one. */ if (rvalue == NULL && cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size > 8) ecif.rvalue = alloca (cif->rtype->size); else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->rtype->size * 8, ecif.rvalue, fn); break; default: FFI_ASSERT (0); break; } } gauche-c-wrapper-0.6.1.orig/libffi/src/m68k/ffitarget.h0000644000000000000000000000333011237307543017434 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for Motorola 68K. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 0 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/m68k/sysv.S0000644000000000000000000000304111237307543016437 0ustar /* ----------------------------------------------------------------------- sysv.S m68k Foreign Function Interface ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include .text .globl ffi_call_SYSV .type ffi_call_SYSV,@function ffi_call_SYSV: link %fp,#0 move.l %d2,-(%sp) | Make room for all of the new args. sub.l 16(%fp),%sp | Call ffi_prep_args move.l 12(%fp),-(%sp) pea 4(%sp) move.l 8(%fp),%a0 jsr (%a0) addq.l #8,%sp | Pass pointer to struct value, if any move.l %a0,%a1 | Call the function move.l 32(%fp),%a0 jsr (%a0) | Remove the space we pushed for the args add.l 16(%fp),%sp | Load the pointer to storage for the return value move.l 28(%fp),%a1 | Load the return type code move.l 20(%fp),%d2 | If the return value pointer is NULL, assume no return value. tst.l %a1 jbeq noretval btst #0,%d2 jbeq retlongint move.l %d0,(%a1) jbra epilogue retlongint: btst #1,%d2 jbeq retfloat move.l %d0,(%a1) move.l %d1,4(%a1) jbra epilogue retfloat: btst #2,%d2 jbeq retdouble fmove.s %fp0,(%a1) jbra epilogue retdouble: btst #3,%d2 jbeq retlongdouble fmove.d %fp0,(%a1) jbra epilogue retlongdouble: btst #4,%d2 jbeq retpointer fmove.x %fp0,(%a1) jbra epilogue retpointer: btst #5,%d2 jbeq retstruct move.l %a0,(%a1) jbra epilogue retstruct: btst #6,%d2 jbeq noretval move.l 24(%fp),%d2 bfins %d0,(%a1){#0,%d2} noretval: epilogue: move.l (%sp)+,%d2 unlk %a6 rts .size ffi_call_SYSV,.-ffi_call_SYSV gauche-c-wrapper-0.6.1.orig/libffi/src/mips/0002755000000000000000000000000011237307543015476 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/mips/ffi.c0000644000000000000000000003615611237307543016417 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1996 Red Hat, Inc. MIPS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include #if _MIPS_SIM == _ABIN32 #define FIX_ARGP \ FFI_ASSERT(argp <= &stack[bytes]); \ if (argp == &stack[bytes]) \ { \ argp = stack; \ ffi_stop_here(); \ } #else #define FIX_ARGP #endif /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ static void ffi_prep_args(char *stack, extended_cif *ecif, int bytes, int flags) { int i; void **p_argv; char *argp; ffi_type **p_arg; #if _MIPS_SIM == _ABIN32 /* If more than 8 double words are used, the remainder go on the stack. We reorder stuff on the stack here to support this easily. */ if (bytes > 8 * sizeof(ffi_arg)) argp = &stack[bytes - (8 * sizeof(ffi_arg))]; else argp = stack; #else argp = stack; #endif memset(stack, 0, bytes); #if _MIPS_SIM == _ABIN32 if ( ecif->cif->rstruct_flag != 0 ) #else if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) #endif { *(ffi_arg *) argp = (ffi_arg) ecif->rvalue; argp += sizeof(ffi_arg); FIX_ARGP; } p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) { size_t z; unsigned int a; /* Align if necessary. */ a = (*p_arg)->alignment; if (a < sizeof(ffi_arg)) a = sizeof(ffi_arg); if ((a - 1) & (unsigned int) argp) { argp = (char *) ALIGN(argp, a); FIX_ARGP; } z = (*p_arg)->size; if (z <= sizeof(ffi_arg)) { z = sizeof(ffi_arg); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(ffi_arg *)argp = *(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(ffi_arg *)argp = *(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(ffi_arg *)argp = *(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(ffi_arg *)argp = *(UINT16 *)(* p_argv); break; case FFI_TYPE_SINT32: *(ffi_arg *)argp = *(SINT32 *)(* p_argv); break; case FFI_TYPE_UINT32: case FFI_TYPE_POINTER: *(ffi_arg *)argp = *(UINT32 *)(* p_argv); break; /* This can only happen with 64bit slots. */ case FFI_TYPE_FLOAT: *(float *) argp = *(float *)(* p_argv); break; /* Handle small structures. */ case FFI_TYPE_STRUCT: default: memcpy(argp, *p_argv, (*p_arg)->size); break; } } else { #if _MIPS_SIM == _ABIO32 memcpy(argp, *p_argv, z); #else { unsigned end = (unsigned) argp+z; unsigned cap = (unsigned) stack+bytes; /* Check if the data will fit within the register space. Handle it if it doesn't. */ if (end <= cap) memcpy(argp, *p_argv, z); else { unsigned portion = end - cap; memcpy(argp, *p_argv, portion); argp = stack; memcpy(argp, (void*)((unsigned)(*p_argv)+portion), z - portion); } } #endif } p_argv++; argp += z; FIX_ARGP; } } #if _MIPS_SIM == _ABIN32 /* The n32 spec says that if "a chunk consists solely of a double float field (but not a double, which is part of a union), it is passed in a floating point register. Any other chunk is passed in an integer register". This code traverses structure definitions and generates the appropriate flags. */ unsigned calc_n32_struct_flags(ffi_type *arg, unsigned *shift) { unsigned flags = 0; unsigned index = 0; ffi_type *e; while (e = arg->elements[index]) { if (e->type == FFI_TYPE_DOUBLE) { flags += (FFI_TYPE_DOUBLE << *shift); *shift += FFI_FLAG_BITS; } else if (e->type == FFI_TYPE_STRUCT) flags += calc_n32_struct_flags(e, shift); else *shift += FFI_FLAG_BITS; index++; } return flags; } unsigned calc_n32_return_struct_flags(ffi_type *arg) { unsigned flags = 0; unsigned index = 0; unsigned small = FFI_TYPE_SMALLSTRUCT; ffi_type *e; /* Returning structures under n32 is a tricky thing. A struct with only one or two floating point fields is returned in $f0 (and $f2 if necessary). Any other struct results at most 128 bits are returned in $2 (the first 64 bits) and $3 (remainder, if necessary). Larger structs are handled normally. */ if (arg->size > 16) return 0; if (arg->size > 8) small = FFI_TYPE_SMALLSTRUCT2; e = arg->elements[0]; if (e->type == FFI_TYPE_DOUBLE) flags = FFI_TYPE_DOUBLE << FFI_FLAG_BITS; else if (e->type == FFI_TYPE_FLOAT) flags = FFI_TYPE_FLOAT << FFI_FLAG_BITS; if (flags && (e = arg->elements[1])) { if (e->type == FFI_TYPE_DOUBLE) flags += FFI_TYPE_DOUBLE; else if (e->type == FFI_TYPE_FLOAT) flags += FFI_TYPE_FLOAT; else return small; if (flags && (arg->elements[2])) { /* There are three arguments and the first two are floats! This must be passed the old way. */ return small; } } else if (!flags) return small; return flags; } #endif /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { cif->flags = 0; #if _MIPS_SIM == _ABIO32 /* Set the flags necessary for O32 processing. FFI_O32_SOFT_FLOAT * does not have special handling for floating point args. */ if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32) { if (cif->nargs > 0) { switch ((cif->arg_types)[0]->type) { case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags += (cif->arg_types)[0]->type; break; default: break; } if (cif->nargs > 1) { /* Only handle the second argument if the first is a float or double. */ if (cif->flags) { switch ((cif->arg_types)[1]->type) { case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS; break; default: break; } } } } } /* Set the return type flag */ if (cif->abi == FFI_O32_SOFT_FLOAT) { switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_DOUBLE: cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); break; case FFI_TYPE_FLOAT: default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); break; } } else { /* FFI_O32 */ switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); break; default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); break; } } #endif #if _MIPS_SIM == _ABIN32 /* Set the flags necessary for N32 processing */ { unsigned shift = 0; unsigned count = (cif->nargs < 8) ? cif->nargs : 8; unsigned index = 0; unsigned struct_flags = 0; if (cif->rtype->type == FFI_TYPE_STRUCT) { struct_flags = calc_n32_return_struct_flags(cif->rtype); if (struct_flags == 0) { /* This means that the structure is being passed as a hidden argument */ shift = FFI_FLAG_BITS; count = (cif->nargs < 7) ? cif->nargs : 7; cif->rstruct_flag = !0; } else cif->rstruct_flag = 0; } else cif->rstruct_flag = 0; while (count-- > 0) { switch ((cif->arg_types)[index]->type) { case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags += ((cif->arg_types)[index]->type << shift); shift += FFI_FLAG_BITS; break; case FFI_TYPE_STRUCT: cif->flags += calc_n32_struct_flags((cif->arg_types)[index], &shift); break; default: shift += FFI_FLAG_BITS; } index++; } /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_STRUCT: { if (struct_flags == 0) { /* The structure is returned through a hidden first argument. Do nothing, 'cause FFI_TYPE_VOID is 0 */ } else { /* The structure is returned via some tricky mechanism */ cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8)); } break; } case FFI_TYPE_VOID: /* Do nothing, 'cause FFI_TYPE_VOID is 0 */ break; case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); break; default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); break; } } #endif return FFI_OK; } /* Low level routine for calling O32 functions */ extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, unsigned, unsigned *, void (*)()); /* Low level routine for calling N32 functions */ extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), extended_cif *, unsigned, unsigned, unsigned *, void (*)()); void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) ecif.rvalue = alloca(cif->rtype->size); else ecif.rvalue = rvalue; switch (cif->abi) { #if _MIPS_SIM == _ABIO32 case FFI_O32: case FFI_O32_SOFT_FLOAT: ffi_call_O32(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; #endif #if _MIPS_SIM == _ABIN32 case FFI_N32: ffi_call_N32(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; #endif default: FFI_ASSERT(0); break; } } #if FFI_CLOSURES /* N32 not implemented yet, FFI_CLOSURES not defined */ #if defined(FFI_MIPS_O32) extern void ffi_closure_O32(void); #endif /* FFI_MIPS_O32 */ ffi_status ffi_prep_closure (ffi_closure *closure, ffi_cif *cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data) { unsigned int *tramp = (unsigned int *) &closure->tramp[0]; unsigned int fn; unsigned int ctx = (unsigned int) closure; #if defined(FFI_MIPS_O32) FFI_ASSERT(cif->abi == FFI_O32 || cif->abi == FFI_O32_SOFT_FLOAT); fn = (unsigned int) ffi_closure_O32; #else /* FFI_MIPS_N32 */ FFI_ASSERT(cif->abi == FFI_N32); FFI_ASSERT(!"not implemented"); #endif /* FFI_MIPS_O32 */ tramp[0] = 0x3c190000 | (fn >> 16); /* lui $25,high(fn) */ tramp[1] = 0x37390000 | (fn & 0xffff); /* ori $25,low(fn) */ tramp[2] = 0x3c080000 | (ctx >> 16); /* lui $8,high(ctx) */ tramp[3] = 0x03200008; /* jr $25 */ tramp[4] = 0x35080000 | (ctx & 0xffff); /* ori $8,low(ctx) */ closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* XXX this is available on Linux, but anything else? */ cacheflush (tramp, FFI_TRAMPOLINE_SIZE, ICACHE); return FFI_OK; } /* * Decodes the arguments to a function, which will be stored on the * stack. AR is the pointer to the beginning of the integer arguments * (and, depending upon the arguments, some floating-point arguments * as well). FPR is a pointer to the area where floating point * registers have been saved, if any. * * RVALUE is the location where the function return value will be * stored. CLOSURE is the prepared closure to invoke. * * This function should only be called from assembly, which is in * turn called from a trampoline. * * Returns the function return type. * * Based on the similar routine for sparc. */ int ffi_closure_mips_inner_O32 (ffi_closure *closure, void *rvalue, ffi_arg *ar, double *fpr) { ffi_cif *cif; void **avaluep; ffi_arg *avalue; ffi_type **arg_types; int i, avn, argn, seen_int; cif = closure->cif; avalue = alloca (cif->nargs * sizeof (ffi_arg)); avaluep = alloca (cif->nargs * sizeof (ffi_arg)); seen_int = (cif->abi == FFI_O32_SOFT_FLOAT); argn = 0; if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT) { rvalue = (void *) ar[0]; argn = 1; } i = 0; avn = cif->nargs; arg_types = cif->arg_types; while (i < avn) { if (i < 2 && !seen_int && (arg_types[i]->type == FFI_TYPE_FLOAT || arg_types[i]->type == FFI_TYPE_DOUBLE)) { #ifdef __MIPSEB__ if (arg_types[i]->type == FFI_TYPE_FLOAT) avaluep[i] = ((char *) &fpr[i]) + sizeof (float); else #endif avaluep[i] = (char *) &fpr[i]; } else { if (arg_types[i]->alignment == 8 && (argn & 0x1)) argn++; switch (arg_types[i]->type) { case FFI_TYPE_SINT8: avaluep[i] = &avalue[i]; *(SINT8 *) &avalue[i] = (SINT8) ar[argn]; break; case FFI_TYPE_UINT8: avaluep[i] = &avalue[i]; *(UINT8 *) &avalue[i] = (UINT8) ar[argn]; break; case FFI_TYPE_SINT16: avaluep[i] = &avalue[i]; *(SINT16 *) &avalue[i] = (SINT16) ar[argn]; break; case FFI_TYPE_UINT16: avaluep[i] = &avalue[i]; *(UINT16 *) &avalue[i] = (UINT16) ar[argn]; break; default: avaluep[i] = (char *) &ar[argn]; break; } seen_int = 1; } argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; i++; } /* Invoke the closure. */ (closure->fun) (cif, rvalue, avaluep, closure->user_data); if (cif->abi == FFI_O32_SOFT_FLOAT) { switch (cif->rtype->type) { case FFI_TYPE_FLOAT: return FFI_TYPE_INT; case FFI_TYPE_DOUBLE: return FFI_TYPE_UINT64; default: return cif->rtype->type; } } else { return cif->rtype->type; } } #endif /* FFI_CLOSURES */ gauche-c-wrapper-0.6.1.orig/libffi/src/mips/ffitarget.h0000644000000000000000000001105411237307543017621 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for MIPS. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #if !defined(_MIPS_SIM) -- something is very wrong -- #else # if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64)) # define FFI_MIPS_N32 # else # if (_MIPS_SIM==_ABIO32 && defined(_ABIO32)) # define FFI_MIPS_O32 # else -- this is an unsupported platform -- # endif # endif #endif #ifdef FFI_MIPS_O32 /* O32 stack frames have 32bit integer args */ #define FFI_SIZEOF_ARG 4 #else /* N32 and N64 frames have 64bit integer args */ #define FFI_SIZEOF_ARG 8 #endif #define FFI_FLAG_BITS 2 /* SGI's strange assembler requires that we multiply by 4 rather than shift left by FFI_FLAG_BITS */ #define FFI_ARGS_D FFI_TYPE_DOUBLE #define FFI_ARGS_F FFI_TYPE_FLOAT #define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE #define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT #define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT #define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE /* Needed for N32 structure returns */ #define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8 #define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8 #if 0 /* The SGI assembler can't handle this.. */ #define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT /* (and so on) */ #else /* ...so we calculate these by hand! */ #define FFI_TYPE_STRUCT_D 61 #define FFI_TYPE_STRUCT_F 45 #define FFI_TYPE_STRUCT_DD 253 #define FFI_TYPE_STRUCT_FF 173 #define FFI_TYPE_STRUCT_FD 237 #define FFI_TYPE_STRUCT_DF 189 #define FFI_TYPE_STRUCT_SMALL 93 #define FFI_TYPE_STRUCT_SMALL2 109 #endif #ifdef LIBFFI_ASM #define v0 $2 #define v1 $3 #define a0 $4 #define a1 $5 #define a2 $6 #define a3 $7 #define a4 $8 #define a5 $9 #define a6 $10 #define a7 $11 #define t0 $8 #define t1 $9 #define t2 $10 #define t3 $11 #define t4 $12 #define t5 $13 #define t6 $14 #define t7 $15 #define t8 $24 #define t9 $25 #define ra $31 #ifdef FFI_MIPS_O32 #define REG_L lw #define REG_S sw #define SUBU subu #define ADDU addu #define SRL srl #define LI li #else /* !FFI_MIPS_O32 */ #define REG_L ld #define REG_S sd #define SUBU dsubu #define ADDU daddu #define SRL dsrl #define LI dli #endif /* !FFI_MIPS_O32 */ #else /* !LIBFFI_ASM */ #ifdef FFI_MIPS_O32 /* O32 stack frames have 32bit integer args */ typedef unsigned int ffi_arg __attribute__((__mode__(__SI__))); typedef signed int ffi_sarg __attribute__((__mode__(__SI__))); #else /* N32 and N64 frames have 64bit integer args */ typedef unsigned int ffi_arg __attribute__((__mode__(__DI__))); typedef signed int ffi_sarg __attribute__((__mode__(__DI__))); #endif typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_O32, FFI_N32, FFI_N64, FFI_O32_SOFT_FLOAT, #ifdef FFI_MIPS_O32 #ifdef __mips_soft_float FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT, #else FFI_DEFAULT_ABI = FFI_O32, #endif #else FFI_DEFAULT_ABI = FFI_N32, #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag #endif /* !LIBFFI_ASM */ /* ---- Definitions for closures ----------------------------------------- */ #if defined(FFI_MIPS_O32) #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 20 #else /* N32/N64 not implemented yet. */ #define FFI_CLOSURES 0 #endif /* FFI_MIPS_O32 */ #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/mips/n32.S0000644000000000000000000001642511237307543016232 0ustar /* ----------------------------------------------------------------------- n32.S - Copyright (c) 1996, 1998, 2005 Red Hat, Inc. MIPS Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include /* Only build this code if we are compiling for n32 */ #if defined(FFI_MIPS_N32) #define callback a0 #define bytes a2 #define flags a3 #define raddr a4 #define fn a5 #define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG ) .abicalls .text .align 2 .globl ffi_call_N32 .ent ffi_call_N32 ffi_call_N32: # Prologue SUBU $sp, SIZEOF_FRAME # Frame size REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address move $fp, $sp move t9, callback # callback function pointer REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn # Allocate at least 4 words in the argstack move v0, bytes bge bytes, 4 * FFI_SIZEOF_ARG, bigger LI v0, 4 * FFI_SIZEOF_ARG b sixteen bigger: ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry. sixteen: SUBU $sp, $sp, v0 # move the stack pointer to reflect the # arg space ADDU a0, $sp, 0 # 4 * FFI_SIZEOF_ARG ADDU a3, $fp, 3 * FFI_SIZEOF_ARG # Call ffi_prep_args jal t9 # ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args # Copy the stack pointer to t9 move t9, $sp # Fix the stack if there are more than 8 64bit slots worth # of arguments. # Load the number of bytes REG_L t6, 2*FFI_SIZEOF_ARG($fp) # Is it bigger than 8 * FFI_SIZEOF_ARG? dadd t7, $0, 8 * FFI_SIZEOF_ARG dsub t8, t6, t7 bltz t8, loadregs add t9, t9, t8 loadregs: REG_L t4, 3*FFI_SIZEOF_ARG($fp) # load the flags word add t6, t4, 0 # and copy it into t6 and t4, ((1< #include /* Only build this code if we are compiling for o32 */ #if defined(FFI_MIPS_O32) #define callback a0 #define bytes a2 #define flags a3 #define SIZEOF_FRAME (4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG) #define A3_OFF (SIZEOF_FRAME + 3 * FFI_SIZEOF_ARG) #define FP_OFF (SIZEOF_FRAME - 2 * FFI_SIZEOF_ARG) #define RA_OFF (SIZEOF_FRAME - 1 * FFI_SIZEOF_ARG) .abicalls .text .align 2 .globl ffi_call_O32 .ent ffi_call_O32 ffi_call_O32: $LFB0: # Prologue SUBU $sp, SIZEOF_FRAME # Frame size $LCFI0: REG_S $fp, FP_OFF($sp) # Save frame pointer $LCFI1: REG_S ra, RA_OFF($sp) # Save return address $LCFI2: move $fp, $sp $LCFI3: move t9, callback # callback function pointer REG_S flags, A3_OFF($fp) # flags # Allocate at least 4 words in the argstack LI v0, 4 * FFI_SIZEOF_ARG blt bytes, v0, sixteen ADDU v0, bytes, 7 # make sure it is aligned and v0, -8 # to an 8 byte boundry sixteen: SUBU $sp, v0 # move the stack pointer to reflect the # arg space ADDU a0, $sp, 4 * FFI_SIZEOF_ARG jalr t9 REG_L t0, A3_OFF($fp) # load the flags word SRL t2, t0, 4 # shift our arg info and t0, ((1<<4)-1) # mask out the return type ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args bnez t0, pass_d # make it quick for int REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. REG_L a2, 2*FFI_SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d: bne t0, FFI_ARGS_D, pass_f l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_f: bne t0, FFI_ARGS_F, pass_d_d l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float REG_L a2, 2*FFI_SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d_d: bne t0, FFI_ARGS_DD, pass_f_f l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles b call_it pass_f_f: bne t0, FFI_ARGS_FF, pass_d_f l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats REG_L a2, 2*FFI_SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_d_f: bne t0, FFI_ARGS_DF, pass_f_d l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float REG_L a3, 3*FFI_SIZEOF_ARG($sp) b call_it pass_f_d: # assume that the only other combination must be float then double # bne t0, FFI_ARGS_F_D, call_it l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float call_it: # Load the function pointer REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp) # If the return value pointer is NULL, assume no return value. REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) beqz t1, noretval bne t2, FFI_TYPE_INT, retlonglong jalr t9 REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) REG_S v0, 0(t0) b epilogue retlonglong: # Really any 64-bit int, signed or not. bne t2, FFI_TYPE_UINT64, retfloat jalr t9 REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) REG_S v1, 4(t0) REG_S v0, 0(t0) b epilogue retfloat: bne t2, FFI_TYPE_FLOAT, retdouble jalr t9 REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) s.s $f0, 0(t0) b epilogue retdouble: bne t2, FFI_TYPE_DOUBLE, noretval jalr t9 REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) s.d $f0, 0(t0) b epilogue noretval: jalr t9 # Epilogue epilogue: move $sp, $fp REG_L $fp, FP_OFF($sp) # Restore frame pointer REG_L ra, RA_OFF($sp) # Restore return address ADDU $sp, SIZEOF_FRAME # Fix stack pointer j ra $LFE0: .end ffi_call_O32 /* ffi_closure_O32. Expects address of the passed-in ffi_closure in t0. Stores any arguments passed in registers onto the stack, then calls ffi_closure_mips_inner_O32, which then decodes them. Stack layout: 14 - Start of parameters, original sp 13 - ra save 12 - fp save 11 - $16 (s0) save 10 - cprestore 9 - return value high (v1) 8 - return value low (v0) 7 - f14 (le high, be low) 6 - f14 (le low, be high) 5 - f12 (le high, be low) 4 - f12 (le low, be high) 3 - Called function a3 save 2 - Called function a2 save 1 - Called function a1 save 0 - Called function a0 save our sp, fp point here */ #define SIZEOF_FRAME2 (14 * FFI_SIZEOF_ARG) #define A3_OFF2 (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG) #define A2_OFF2 (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG) #define A1_OFF2 (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG) #define A0_OFF2 (SIZEOF_FRAME2 + 0 * FFI_SIZEOF_ARG) #define RA_OFF2 (SIZEOF_FRAME2 - 1 * FFI_SIZEOF_ARG) #define FP_OFF2 (SIZEOF_FRAME2 - 2 * FFI_SIZEOF_ARG) #define S0_OFF2 (SIZEOF_FRAME2 - 3 * FFI_SIZEOF_ARG) #define GP_OFF2 (SIZEOF_FRAME2 - 4 * FFI_SIZEOF_ARG) #define V1_OFF2 (SIZEOF_FRAME2 - 5 * FFI_SIZEOF_ARG) #define V0_OFF2 (SIZEOF_FRAME2 - 6 * FFI_SIZEOF_ARG) #define FA_1_1_OFF2 (SIZEOF_FRAME2 - 7 * FFI_SIZEOF_ARG) #define FA_1_0_OFF2 (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG) #define FA_0_1_OFF2 (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG) #define FA_0_0_OFF2 (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG) .text .align 2 .globl ffi_closure_O32 .ent ffi_closure_O32 ffi_closure_O32: $LFB1: # Prologue .frame $fp, SIZEOF_FRAME2, ra .set noreorder .cpload t9 .set reorder SUBU $sp, SIZEOF_FRAME2 .cprestore GP_OFF2 $LCFI4: REG_S $16, S0_OFF2($sp) # Save s0 REG_S $fp, FP_OFF2($sp) # Save frame pointer REG_S ra, RA_OFF2($sp) # Save return address $LCFI6: move $fp, $sp $LCFI7: # Store all possible argument registers. If there are more than # four arguments, then they are stored above where we put a3. REG_S a0, A0_OFF2($fp) REG_S a1, A1_OFF2($fp) REG_S a2, A2_OFF2($fp) REG_S a3, A3_OFF2($fp) # Load ABI enum to s0 REG_L $16, 20($8) # cif pointer follows tramp. REG_L $16, 0($16) # abi is first member. li $13, 1 # FFI_O32 bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT # Store all possible float/double registers. s.d $f12, FA_0_0_OFF2($fp) s.d $f14, FA_1_0_OFF2($fp) 1: # Call ffi_closure_mips_inner_O32 to do the work. la t9, ffi_closure_mips_inner_O32 move a0, $8 # Pointer to the ffi_closure addu a1, $fp, V0_OFF2 addu a2, $fp, A0_OFF2 addu a3, $fp, FA_0_0_OFF2 jalr t9 # Load the return value into the appropriate register. move $8, $2 li $9, FFI_TYPE_VOID beq $8, $9, closure_done li $13, 1 # FFI_O32 bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT li $9, FFI_TYPE_FLOAT l.s $f0, V0_OFF2($fp) beq $8, $9, closure_done li $9, FFI_TYPE_DOUBLE l.d $f0, V0_OFF2($fp) beq $8, $9, closure_done 1: REG_L $3, V1_OFF2($fp) REG_L $2, V0_OFF2($fp) closure_done: # Epilogue move $sp, $fp REG_L $16, S0_OFF2($sp) # Restore s0 REG_L $fp, FP_OFF2($sp) # Restore frame pointer REG_L ra, RA_OFF2($sp) # Restore return address ADDU $sp, SIZEOF_FRAME2 j ra $LFE1: .end ffi_closure_O32 /* DWARF-2 unwind info. */ .section .eh_frame,"a",@progbits $Lframe0: .4byte $LECIE0-$LSCIE0 # Length of Common Information Entry $LSCIE0: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .uleb128 0x1 # CIE Code Alignment Factor .sleb128 4 # CIE Data Alignment Factor .byte 0x1f # CIE RA Column .uleb128 0x1 # Augmentation size .byte 0x00 # FDE Encoding (absptr) .byte 0xc # DW_CFA_def_cfa .uleb128 0x1d .uleb128 0x0 .align 2 $LECIE0: $LSFDE0: .4byte $LEFDE0-$LASFDE0 # FDE Length $LASFDE0: .4byte $LASFDE0-$Lframe0 # FDE CIE offset .4byte $LFB0 # FDE initial location .4byte $LFE0-$LFB0 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI0-$LFB0 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0x18 .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI2-$LCFI0 .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x1e # $fp .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x1f # $ra .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI3-$LCFI2 .byte 0xc # DW_CFA_def_cfa .uleb128 0x1e .uleb128 0x18 .align 2 $LEFDE0: $LSFDE1: .4byte $LEFDE1-$LASFDE1 # FDE Length $LASFDE1: .4byte $LASFDE1-$Lframe0 # FDE CIE offset .4byte $LFB1 # FDE initial location .4byte $LFE1-$LFB1 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI4-$LFB1 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0x38 .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI6-$LCFI4 .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x10 # $16 .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp) .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x1e # $fp .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x1f # $ra .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) .byte 0x4 # DW_CFA_advance_loc4 .4byte $LCFI7-$LCFI6 .byte 0xc # DW_CFA_def_cfa .uleb128 0x1e .uleb128 0x38 .align 2 $LEFDE1: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/pa/0002755000000000000000000000000011237307543015126 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/pa/ffi.c0000644000000000000000000004075211237307543016044 0ustar /* ----------------------------------------------------------------------- ffi.c - (c) 2003-2004 Randolph Chung HPPA Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include #define ROUND_UP(v, a) (((size_t)(v) + (a) - 1) & ~((a) - 1)) #define ROUND_DOWN(v, a) (((size_t)(v) - (a) + 1) & ~((a) - 1)) #define MIN_STACK_SIZE 64 #define FIRST_ARG_SLOT 9 #define DEBUG_LEVEL 0 #define fldw(addr, fpreg) asm volatile ("fldw 0(%0), %%" #fpreg "L" : : "r"(addr) : #fpreg) #define fstw(fpreg, addr) asm volatile ("fstw %%" #fpreg "L, 0(%0)" : : "r"(addr)) #define fldd(addr, fpreg) asm volatile ("fldd 0(%0), %%" #fpreg : : "r"(addr) : #fpreg) #define fstd(fpreg, addr) asm volatile ("fstd %%" #fpreg "L, 0(%0)" : : "r"(addr)) #define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0) static inline int ffi_struct_type(ffi_type *t) { size_t sz = t->size; /* Small structure results are passed in registers, larger ones are passed by pointer. */ if (sz <= 1) return FFI_TYPE_UINT8; else if (sz == 2) return FFI_TYPE_UINT16; else if (sz == 3) return FFI_TYPE_SMALL_STRUCT3; else if (sz == 4) return FFI_TYPE_UINT32; else if (sz == 5) return FFI_TYPE_SMALL_STRUCT5; else if (sz == 6) return FFI_TYPE_SMALL_STRUCT6; else if (sz == 7) return FFI_TYPE_SMALL_STRUCT7; else if (sz <= 8) return FFI_TYPE_UINT64; else return FFI_TYPE_STRUCT; /* else, we pass it by pointer. */ } /* PA has a downward growing stack, which looks like this: Offset [ Variable args ] SP = (4*(n+9)) arg word N ... SP-52 arg word 4 [ Fixed args ] SP-48 arg word 3 SP-44 arg word 2 SP-40 arg word 1 SP-36 arg word 0 [ Frame marker ] ... SP-20 RP SP-4 previous SP First 4 non-FP 32-bit args are passed in gr26, gr25, gr24 and gr23 First 2 non-FP 64-bit args are passed in register pairs, starting on an even numbered register (i.e. r26/r25 and r24+r23) First 4 FP 32-bit arguments are passed in fr4L, fr5L, fr6L and fr7L First 2 FP 64-bit arguments are passed in fr5 and fr7 The rest are passed on the stack starting at SP-52, but 64-bit arguments need to be aligned to an 8-byte boundary This means we can have holes either in the register allocation, or in the stack. */ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments The following code will put everything into the stack frame (which was allocated by the asm routine), and on return the asm routine will load the arguments that should be passed by register into the appropriate registers NOTE: We load floating point args in this function... that means we assume gcc will not mess with fp regs in here. */ /*@-exportheader@*/ void ffi_prep_args_LINUX(UINT32 *stack, extended_cif *ecif, unsigned bytes) /*@=exportheader@*/ { register unsigned int i; register ffi_type **p_arg; register void **p_argv; unsigned int slot = FIRST_ARG_SLOT - 1; char *dest_cpy; debug(1, "%s: stack = %p, ecif = %p, bytes = %u\n", __FUNCTION__, stack, ecif, bytes); p_arg = ecif->cif->arg_types; p_argv = ecif->avalue; for (i = 0; i < ecif->cif->nargs; i++) { int type = (*p_arg)->type; switch (type) { case FFI_TYPE_SINT8: slot++; *(SINT32 *)(stack - slot) = *(SINT8 *)(*p_argv); break; case FFI_TYPE_UINT8: slot++; *(UINT32 *)(stack - slot) = *(UINT8 *)(*p_argv); break; case FFI_TYPE_SINT16: slot++; *(SINT32 *)(stack - slot) = *(SINT16 *)(*p_argv); break; case FFI_TYPE_UINT16: slot++; *(UINT32 *)(stack - slot) = *(UINT16 *)(*p_argv); break; case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: case FFI_TYPE_POINTER: slot++; debug(3, "Storing UINT32 %u in slot %u\n", *(UINT32 *)(*p_argv), slot); *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: slot += 2; if (slot & 1) slot++; *(UINT32 *)(stack - slot) = (*(UINT64 *)(*p_argv)) >> 32; *(UINT32 *)(stack - slot + 1) = (*(UINT64 *)(*p_argv)) & 0xffffffffUL; break; case FFI_TYPE_FLOAT: /* First 4 args go in fr4L - fr7L */ slot++; switch (slot - FIRST_ARG_SLOT) { case 0: fldw(*p_argv, fr4); break; case 1: fldw(*p_argv, fr5); break; case 2: fldw(*p_argv, fr6); break; case 3: fldw(*p_argv, fr7); break; default: /* Other ones are just passed on the stack. */ debug(3, "Storing UINT32(float) in slot %u\n", slot); *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); break; } break; case FFI_TYPE_DOUBLE: slot += 2; if (slot & 1) slot++; switch (slot - FIRST_ARG_SLOT + 1) { /* First 2 args go in fr5, fr7 */ case 2: fldd(*p_argv, fr5); break; case 4: fldd(*p_argv, fr7); break; default: debug(3, "Storing UINT64(double) at slot %u\n", slot); *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv); break; } break; case FFI_TYPE_STRUCT: /* Structs smaller or equal than 4 bytes are passed in one register. Structs smaller or equal 8 bytes are passed in two registers. Larger structures are passed by pointer. */ if((*p_arg)->size <= 4) { slot++; dest_cpy = (char *)(stack - slot); dest_cpy += 4 - (*p_arg)->size; memcpy((char *)dest_cpy, (char *)*p_argv, (*p_arg)->size); } else if ((*p_arg)->size <= 8) { slot += 2; if (slot & 1) slot++; dest_cpy = (char *)(stack - slot); dest_cpy += 8 - (*p_arg)->size; memcpy((char *)dest_cpy, (char *)*p_argv, (*p_arg)->size); } else { slot++; *(UINT32 *)(stack - slot) = (UINT32)(*p_argv); } break; default: FFI_ASSERT(0); } p_arg++; p_argv++; } /* Make sure we didn't mess up and scribble on the stack. */ { int n; debug(5, "Stack setup:\n"); for (n = 0; n < (bytes + 3) / 4; n++) { if ((n%4) == 0) { debug(5, "\n%08x: ", (unsigned int)(stack - n)); } debug(5, "%08x ", *(stack - n)); } debug(5, "\n"); } FFI_ASSERT(slot * 4 <= bytes); return; } static void ffi_size_stack_LINUX(ffi_cif *cif) { ffi_type **ptr; int i; int z = 0; /* # stack slots */ for (ptr = cif->arg_types, i = 0; i < cif->nargs; ptr++, i++) { int type = (*ptr)->type; switch (type) { case FFI_TYPE_DOUBLE: case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: z += 2 + (z & 1); /* must start on even regs, so we may waste one */ break; case FFI_TYPE_STRUCT: z += 1; /* pass by ptr, callee will copy */ break; default: /* <= 32-bit values */ z++; } } /* We can fit up to 6 args in the default 64-byte stack frame, if we need more, we need more stack. */ if (z <= 6) cif->bytes = MIN_STACK_SIZE; /* min stack size */ else cif->bytes = 64 + ROUND_UP((z - 6) * sizeof(UINT32), MIN_STACK_SIZE); debug(3, "Calculated stack size is %u bytes\n", cif->bytes); } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_STRUCT: /* For the return type we have to check the size of the structures. If the size is smaller or equal 4 bytes, the result is given back in one register. If the size is smaller or equal 8 bytes than we return the result in two registers. But if the size is bigger than 8 bytes, we work with pointers. */ cif->flags = ffi_struct_type(cif->rtype); break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: cif->flags = FFI_TYPE_UINT64; break; default: cif->flags = FFI_TYPE_INT; break; } /* Lucky us, because of the unique PA ABI we get to do our own stack sizing. */ switch (cif->abi) { case FFI_LINUX: ffi_size_stack_LINUX(cif); break; default: FFI_ASSERT(0); break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_LINUX(void (*)(UINT32 *, extended_cif *, unsigned), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return value address then we need to make one. */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_LINUX: /*@-usedef@*/ debug(2, "Calling ffi_call_LINUX: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn); ffi_call_LINUX(ffi_prep_args_LINUX, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } } #if FFI_CLOSURES /* This is more-or-less an inverse of ffi_call -- we have arguments on the stack, and we need to fill them into a cif structure and invoke the user function. This really ought to be in asm to make sure the compiler doesn't do things we don't expect. */ UINT32 ffi_closure_inner_LINUX(ffi_closure *closure, UINT32 *stack) { ffi_cif *cif; void **avalue; void *rvalue; UINT32 ret[2]; /* function can return up to 64-bits in registers */ ffi_type **p_arg; char *tmp; int i, avn, slot = FIRST_ARG_SLOT - 1; register UINT32 r28 asm("r28"); cif = closure->cif; /* If returning via structure, callee will write to our pointer. */ if (cif->flags == FFI_TYPE_STRUCT) rvalue = (void *)r28; else rvalue = &ret[0]; avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG); avn = cif->nargs; p_arg = cif->arg_types; for (i = 0; i < avn; i++) { int type = (*p_arg)->type; switch (type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_POINTER: slot++; avalue[i] = (char *)(stack - slot) + sizeof(UINT32) - (*p_arg)->size; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: slot += 2; if (slot & 1) slot++; avalue[i] = (void *)(stack - slot); break; case FFI_TYPE_FLOAT: slot++; switch (slot - FIRST_ARG_SLOT) { case 0: fstw(fr4, (void *)(stack - slot)); break; case 1: fstw(fr5, (void *)(stack - slot)); break; case 2: fstw(fr6, (void *)(stack - slot)); break; case 3: fstw(fr7, (void *)(stack - slot)); break; } avalue[i] = (void *)(stack - slot); break; case FFI_TYPE_DOUBLE: slot += 2; if (slot & 1) slot++; switch (slot - FIRST_ARG_SLOT + 1) { case 2: fstd(fr5, (void *)(stack - slot)); break; case 4: fstd(fr7, (void *)(stack - slot)); break; } avalue[i] = (void *)(stack - slot); break; case FFI_TYPE_STRUCT: /* Structs smaller or equal than 4 bytes are passed in one register. Structs smaller or equal 8 bytes are passed in two registers. Larger structures are passed by pointer. */ if((*p_arg)->size <= 4) { slot++; avalue[i] = (void *)(stack - slot) + sizeof(UINT32) - (*p_arg)->size; } else if ((*p_arg)->size <= 8) { slot += 2; if (slot & 1) slot++; avalue[i] = (void *)(stack - slot) + sizeof(UINT64) - (*p_arg)->size; } else { slot++; avalue[i] = (void *) *(stack - slot); } break; default: FFI_ASSERT(0); } p_arg++; } /* Invoke the closure. */ (closure->fun) (cif, rvalue, avalue, closure->user_data); debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", ret[0], ret[1]); /* Store the result */ switch (cif->flags) { case FFI_TYPE_UINT8: *(stack - FIRST_ARG_SLOT) = (UINT8)(ret[0] >> 24); break; case FFI_TYPE_SINT8: *(stack - FIRST_ARG_SLOT) = (SINT8)(ret[0] >> 24); break; case FFI_TYPE_UINT16: *(stack - FIRST_ARG_SLOT) = (UINT16)(ret[0] >> 16); break; case FFI_TYPE_SINT16: *(stack - FIRST_ARG_SLOT) = (SINT16)(ret[0] >> 16); break; case FFI_TYPE_INT: case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: *(stack - FIRST_ARG_SLOT) = ret[0]; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: *(stack - FIRST_ARG_SLOT) = ret[0]; *(stack - FIRST_ARG_SLOT - 1) = ret[1]; break; case FFI_TYPE_DOUBLE: fldd(rvalue, fr4); break; case FFI_TYPE_FLOAT: fldw(rvalue, fr4); break; case FFI_TYPE_STRUCT: /* Don't need a return value, done by caller. */ break; case FFI_TYPE_SMALL_STRUCT3: tmp = (void*)(stack - FIRST_ARG_SLOT); tmp += 4 - cif->rtype->size; memcpy((void*)tmp, &ret[0], cif->rtype->size); break; case FFI_TYPE_SMALL_STRUCT5: case FFI_TYPE_SMALL_STRUCT6: case FFI_TYPE_SMALL_STRUCT7: { unsigned int ret2[2]; int off; /* Right justify ret[0] and ret[1] */ switch (cif->flags) { case FFI_TYPE_SMALL_STRUCT5: off = 3; break; case FFI_TYPE_SMALL_STRUCT6: off = 2; break; case FFI_TYPE_SMALL_STRUCT7: off = 1; break; default: off = 0; break; } memset (ret2, 0, sizeof (ret2)); memcpy ((char *)ret2 + off, ret, 8 - off); *(stack - FIRST_ARG_SLOT) = ret2[0]; *(stack - FIRST_ARG_SLOT - 1) = ret2[1]; } break; case FFI_TYPE_POINTER: case FFI_TYPE_VOID: break; default: debug(0, "assert with cif->flags: %d\n",cif->flags); FFI_ASSERT(0); break; } return FFI_OK; } /* Fill in a closure to refer to the specified fun and user_data. cif specifies the argument and result types for fun. The cif must already be prep'ed. */ void ffi_closure_LINUX(void); ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data) { UINT32 *tramp = (UINT32 *)(closure->tramp); FFI_ASSERT (cif->abi == FFI_LINUX); /* Make a small trampoline that will branch to our handler function. Use PC-relative addressing. */ tramp[0] = 0xeaa00000; /* b,l .+8, %r21 ; %r21 <- pc+8 */ tramp[1] = 0xd6a01c1e; /* depi 0,31,2, %r21 ; mask priv bits */ tramp[2] = 0x4aa10028; /* ldw 20(%r21), %r1 ; load plabel */ tramp[3] = 0x36b53ff1; /* ldo -8(%r21), %r21 ; get closure addr */ tramp[4] = 0x0c201096; /* ldw 0(%r1), %r22 ; address of handler */ tramp[5] = 0xeac0c000; /* bv %r0(%r22) ; branch to handler */ tramp[6] = 0x0c281093; /* ldw 4(%r1), %r19 ; GP of handler */ tramp[7] = ((UINT32)(ffi_closure_LINUX) & ~2); /* Flush d/icache -- have to flush up 2 two lines because of alignment. */ asm volatile ( "fdc 0(%0)\n" "fdc %1(%0)\n" "fic 0(%%sr4, %0)\n" "fic %1(%%sr4, %0)\n" "sync\n" : : "r"((unsigned long)tramp & ~31), "r"(32 /* stride */)); closure->cif = cif; closure->user_data = user_data; closure->fun = fun; return FFI_OK; } #endif gauche-c-wrapper-0.6.1.orig/libffi/src/pa/ffitarget.h0000644000000000000000000000373411237307543017257 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for hppa. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- System specific configurations ----------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, #ifdef PA FFI_LINUX, FFI_DEFAULT_ABI = FFI_LINUX, #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_NATIVE_RAW_API 0 #define FFI_TRAMPOLINE_SIZE 32 #define FFI_TYPE_SMALL_STRUCT3 -1 #define FFI_TYPE_SMALL_STRUCT5 -2 #define FFI_TYPE_SMALL_STRUCT6 -3 #define FFI_TYPE_SMALL_STRUCT7 -4 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/pa/linux.S0000644000000000000000000001760211237307543016415 0ustar /* ----------------------------------------------------------------------- linux.S - (c) 2003-2004 Randolph Chung HPPA Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include .text .level 1.1 .align 4 /* void ffi_call_LINUX(void (*)(char *, extended_cif *), extended_cif *ecif, unsigned bytes, unsigned flags, unsigned *rvalue, void (*fn)()); */ .export ffi_call_LINUX,code .import ffi_prep_args_LINUX,code .type ffi_call_LINUX, @function .LFB1: ffi_call_LINUX: .proc .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 .entry stw %rp, -20(%sp) copy %r3, %r1 .LCFI11: copy %sp, %r3 .LCFI12: /* Setup the stack for calling prep_args... We want the stack to look like this: [ Previous stack ] <- %r3 [ 64-bytes register save area ] <- %r4 [ Stack space for actual call, passed as ] <- %arg0 [ arg0 to ffi_prep_args_LINUX ] [ Stack for calling prep_args ] <- %sp */ stwm %r1, 64(%sp) stw %r4, 12(%r3) .LCFI13: copy %sp, %r4 addl %arg2, %r4, %arg0 /* arg stack */ stw %arg3, -48(%r3) /* save flags; we need it later */ /* Call prep_args: %arg0(stack) -- set up above %arg1(ecif) -- same as incoming param %arg2(bytes) -- same as incoming param */ bl ffi_prep_args_LINUX,%r2 ldo 64(%arg0), %sp ldo -64(%sp), %sp /* now %sp should point where %arg0 was pointing. */ /* Load the arguments that should be passed in registers The fp args were loaded by the prep_args function. */ ldw -36(%sp), %arg0 ldw -40(%sp), %arg1 ldw -44(%sp), %arg2 ldw -48(%sp), %arg3 /* in case the function is going to return a structure we need to give it a place to put the result. */ ldw -52(%r3), %ret0 /* %ret0 <- rvalue */ ldw -56(%r3), %r22 /* %r22 <- function to call */ bl $$dyncall, %r31 /* Call the user function */ copy %r31, %rp /* Prepare to store the result; we need to recover flags and rvalue. */ ldw -48(%r3), %r21 /* r21 <- flags */ ldw -52(%r3), %r20 /* r20 <- rvalue */ /* Store the result according to the return type. */ checksmst3: comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, checksmst567 /* 3-byte structs are returned in ret0 as ??xxyyzz. Shift left 8 bits to write to the result structure. */ zdep %ret0, 23, 24, %r22 b done stw %r22, 0(%r20) checksmst567: /* 5-7 byte values are returned right justified: ret0 ret1 5: ??????aa bbccddee 6: ????aabb ccddeeff 7: ??aabbcc ddeeffgg To store this in the result, write the first 4 bytes into a temp register using shrpw (t1 = aabbccdd), followed by a rotation of ret1: ret0 ret1 ret1 5: ??????aa bbccddee -> eebbccdd (rotate 8) 6: ????aabb ccddeeff -> eeffccdd (rotate 16) 7: ??aabbcc ddeeffgg -> eeffggdd (rotate 24) then we write (t1, ret1) into the result. */ addi,<> -FFI_TYPE_SMALL_STRUCT5,%r21,%r0 ldi 8, %r22 addi,<> -FFI_TYPE_SMALL_STRUCT6,%r21,%r0 ldi 16, %r22 addi,<> -FFI_TYPE_SMALL_STRUCT7,%r21,%r0 ldi 24, %r22 /* This relies on all the FFI_TYPE_*_STRUCT* defines being <0 */ cmpib,<=,n 0, %r21, checkint8 mtsar %r22 shrpw %ret0, %ret1, %sar, %ret0 /* ret0 = aabbccdd */ shrpw %ret1, %ret1, %sar, %ret1 /* rotate ret1 */ stw %ret0, 0(%r20) b done stw %ret1, 4(%r20) checkint8: comib,<>,n FFI_TYPE_UINT8, %r21, checkint16 b done stb %ret0, 0(%r20) checkint16: comib,<>,n FFI_TYPE_UINT16, %r21, checkint32 b done sth %ret0, 0(%r20) checkint32: comib,<>,n FFI_TYPE_UINT32, %r21, checkint b done stw %ret0, 0(%r20) checkint: comib,<>,n FFI_TYPE_INT, %r21, checkll b done stw %ret0, 0(%r20) checkll: comib,<>,n FFI_TYPE_UINT64, %r21, checkdbl stw %ret0, 0(%r20) b done stw %ret1, 4(%r20) checkdbl: comib,<>,n FFI_TYPE_DOUBLE, %r21, checkfloat b done fstd %fr4,0(%r20) checkfloat: comib,<>,n FFI_TYPE_FLOAT, %r21, done fstw %fr4L,0(%r20) /* structure returns are either handled by one of the INT/UINT64 cases above, or, if passed by pointer, is handled by the callee. */ done: /* all done, return */ copy %r4, %sp /* pop arg stack */ ldw 12(%r3), %r4 ldwm -64(%sp), %r3 /* .. and pop stack */ ldw -20(%sp), %rp bv %r0(%rp) nop .exit .procend .LFE1: /* void ffi_closure_LINUX(void); Called with closure argument in %r21 */ .export ffi_closure_LINUX,code .import ffi_closure_inner_LINUX,code .type ffi_closure_LINUX, @function .LFB2: ffi_closure_LINUX: .proc .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 .entry stw %rp, -20(%sp) .LCFI20: copy %r3, %r1 .LCFI21: copy %sp, %r3 .LCFI22: stwm %r1, 64(%sp) /* Put arguments onto the stack and call ffi_closure_inner. */ stw %arg0, -36(%r3) stw %arg1, -40(%r3) stw %arg2, -44(%r3) stw %arg3, -48(%r3) copy %r21, %arg0 bl ffi_closure_inner_LINUX, %r2 copy %r3, %arg1 ldwm -64(%sp), %r3 ldw -20(%sp), %rp ldw -36(%sp), %ret0 bv %r0(%r2) ldw -40(%sp), %ret1 .exit .procend .LFE2: .section ".eh_frame",EH_FRAME_FLAGS,@progbits .Lframe1: .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry .LSCIE1: .word 0x0 ;# CIE Identifier Tag .byte 0x1 ;# CIE Version .ascii "\0" ;# CIE Augmentation .uleb128 0x1 ;# CIE Code Alignment Factor .sleb128 4 ;# CIE Data Alignment Factor .byte 0x2 ;# CIE RA Column .byte 0xc ;# DW_CFA_def_cfa .uleb128 0x1e .uleb128 0x0 .align 4 .LECIE1: .LSFDE1: .word .LEFDE1-.LASFDE1 ;# FDE Length .LASFDE1: .word .LASFDE1-.Lframe1 ;# FDE CIE offset .word .LFB1 ;# FDE initial location .word .LFE1-.LFB1 ;# FDE address range .byte 0x4 ;# DW_CFA_advance_loc4 .word .LCFI11-.LFB1 .byte 0x83 ;# DW_CFA_offset, column 0x3 .uleb128 0x0 .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] .uleb128 0x2 .sleb128 -5 .byte 0x4 ;# DW_CFA_advance_loc4 .word .LCFI12-.LCFI11 .byte 0xd ;# DW_CFA_def_cfa_register = r3 .uleb128 0x3 .byte 0x4 ;# DW_CFA_advance_loc4 .word .LCFI13-.LCFI12 .byte 0x84 ;# DW_CFA_offset, column 0x4 .uleb128 0x3 .align 4 .LEFDE1: .LSFDE2: .word .LEFDE2-.LASFDE2 ;# FDE Length .LASFDE2: .word .LASFDE2-.Lframe1 ;# FDE CIE offset .word .LFB2 ;# FDE initial location .word .LFE2-.LFB2 ;# FDE address range .byte 0x4 ;# DW_CFA_advance_loc4 .word .LCFI21-.LFB2 .byte 0x83 ;# DW_CFA_offset, column 0x3 .uleb128 0x0 .byte 0x11 ;# DW_CFA_offset_extended_sf .uleb128 0x2 .sleb128 -5 .byte 0x4 ;# DW_CFA_advance_loc4 .word .LCFI12-.LCFI11 .byte 0xd ;# DW_CFA_def_cfa_register = r3 .uleb128 0x3 .align 4 .LEFDE2: gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/0002755000000000000000000000000011237307543016205 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/aix.S0000644000000000000000000001123311237307543017110 0ustar /* ----------------------------------------------------------------------- aix.S - Copyright (c) 2002 Free Software Foundation, Inc. based on darwin.S by John Hornkvist PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ .set r0,0 .set r1,1 .set r2,2 .set r3,3 .set r4,4 .set r5,5 .set r6,6 .set r7,7 .set r8,8 .set r9,9 .set r10,10 .set r11,11 .set r12,12 .set r13,13 .set r14,14 .set r15,15 .set r16,16 .set r17,17 .set r18,18 .set r19,19 .set r20,20 .set r21,21 .set r22,22 .set r23,23 .set r24,24 .set r25,25 .set r26,26 .set r27,27 .set r28,28 .set r29,29 .set r30,30 .set r31,31 .set f0,0 .set f1,1 .set f2,2 .set f3,3 .set f4,4 .set f5,5 .set f6,6 .set f7,7 .set f8,8 .set f9,9 .set f10,10 .set f11,11 .set f12,12 .set f13,13 .set f14,14 .set f15,15 .set f16,16 .set f17,17 .set f18,18 .set f19,19 .set f20,20 .set f21,21 #define LIBFFI_ASM #include #include #define JUMPTARGET(name) name #define L(x) x .file "aix.S" .toc .csect .text[PR] .align 2 .globl ffi_prep_args .csect .text[PR] .align 2 .globl ffi_call_AIX .globl .ffi_call_AIX .csect ffi_call_AIX[DS] ffi_call_AIX: .long .ffi_call_AIX, TOC[tc0], 0 .csect .text[PR] .ffi_call_AIX: mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... /* Save the old stack pointer as AP. */ mr r8,r1 /* Allocate the stack space we need. */ stwux r1,r1,r4 /* Save registers we use. */ mflr r9 stw r28,-16(r8) stw r29,-12(r8) stw r30, -8(r8) stw r31, -4(r8) stw r9, 8(r8) stw r2, 20(r1) /* Save arguments over call... */ mr r31,r5 /* flags, */ mr r30,r6 /* rvalue, */ mr r29,r7 /* function address, */ mr r28,r8 /* our AP. */ /* Call ffi_prep_args. */ mr r4,r1 li r9,0 lwz r2,4(r12) lwz r12,0(r12) mtctr r12 // r12 holds address of _ffi_prep_args bctrl lwz r2,20(r1) /* Now do the call. */ lwz r12,0(r29) /* Set up cr1 with bits 4-7 of the flags. */ mtcrf 0x40,r31 stw r2,20(r1) mtctr r12 lwz r2,4(r29) /* Load all those argument registers. */ // We have set up a nice stack frame, just load it into registers. lwz r3, 20+(1*4)(r1) lwz r4, 20+(2*4)(r1) lwz r5, 20+(3*4)(r1) lwz r6, 20+(4*4)(r1) nop lwz r7, 20+(5*4)(r1) lwz r8, 20+(6*4)(r1) lwz r9, 20+(7*4)(r1) lwz r10,20+(8*4)(r1) L1: /* Load all the FP registers. */ bf 6,L2 // 2f + 0x18 lfd f1,-16-(13*8)(r28) lfd f2,-16-(12*8)(r28) lfd f3,-16-(11*8)(r28) lfd f4,-16-(10*8)(r28) nop lfd f5,-16-(9*8)(r28) lfd f6,-16-(8*8)(r28) lfd f7,-16-(7*8)(r28) lfd f8,-16-(6*8)(r28) nop lfd f9,-16-(5*8)(r28) lfd f10,-16-(4*8)(r28) lfd f11,-16-(3*8)(r28) lfd f12,-16-(2*8)(r28) nop lfd f13,-16-(1*8)(r28) L2: /* Make the call. */ bctrl lwz r2,20(r1) /* Now, deal with the return value. */ mtcrf 0x01,r31 bt 30,L(done_return_value) bt 29,L(fp_return_value) stw r3,0(r30) bf 28,L(done_return_value) stw r4,4(r30) /* Fall through... */ L(done_return_value): /* Restore the registers we used and return. */ lwz r9, 8(r28) lwz r31, -4(r28) mtlr r9 lwz r30, -8(r28) lwz r29,-12(r28) lwz r28,-16(r28) lwz r1,0(r1) blr L(fp_return_value): bf 28,L(float_return_value) stfd f1,0(r30) b L(done_return_value) L(float_return_value): stfs f1,0(r30) b L(done_return_value) .long 0 .byte 0,0,0,1,128,4,0,0 //END(ffi_call_AIX) .csect .text[PR] .align 2 .globl ffi_call_DARWIN .globl .ffi_call_DARWIN .csect ffi_call_DARWIN[DS] ffi_call_DARWIN: .long .ffi_call_DARWIN, TOC[tc0], 0 .csect .text[PR] .ffi_call_DARWIN: blr .long 0 .byte 0,0,0,0,0,0,0,0 //END(ffi_call_DARWIN) gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/aix_closure.S0000644000000000000000000001275511237307543020656 0ustar /* ----------------------------------------------------------------------- aix_closure.S - Copyright (c) 2002 2003 Free Software Foundation, Inc. based on darwin_closure.S PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ .set r0,0 .set r1,1 .set r2,2 .set r3,3 .set r4,4 .set r5,5 .set r6,6 .set r7,7 .set r8,8 .set r9,9 .set r10,10 .set r11,11 .set r12,12 .set r13,13 .set r14,14 .set r15,15 .set r16,16 .set r17,17 .set r18,18 .set r19,19 .set r20,20 .set r21,21 .set r22,22 .set r23,23 .set r24,24 .set r25,25 .set r26,26 .set r27,27 .set r28,28 .set r29,29 .set r30,30 .set r31,31 .set f0,0 .set f1,1 .set f2,2 .set f3,3 .set f4,4 .set f5,5 .set f6,6 .set f7,7 .set f8,8 .set f9,9 .set f10,10 .set f11,11 .set f12,12 .set f13,13 .set f14,14 .set f15,15 .set f16,16 .set f17,17 .set f18,18 .set f19,19 .set f20,20 .set f21,21 #define LIBFFI_ASM #define JUMPTARGET(name) name #define L(x) x .file "aix_closure.S" .toc LC..60: .tc L..60[TC],L..60 .csect .text[PR] .align 2 .csect .text[PR] .align 2 .globl ffi_closure_ASM .globl .ffi_closure_ASM .csect ffi_closure_ASM[DS] ffi_closure_ASM: .long .ffi_closure_ASM, TOC[tc0], 0 .csect .text[PR] .ffi_closure_ASM: mflr r0 /* extract return address */ stw r0, 8(r1) /* save the return address */ /* 24 Bytes (Linkage Area) */ /* 32 Bytes (params) */ /* 104 Bytes (13*8 from FPR) */ /* 8 Bytes (result) */ /* 168 Bytes */ stwu r1,-176(r1) /* skip over caller save area keep stack aligned to 16 */ /* we want to build up an area for the parameters passed */ /* in registers (both floating point and integer) */ /* we store gpr 3 to gpr 10 (aligned to 4) in the parents outgoing area */ stw r3, 200(r1) stw r4, 204(r1) stw r5, 208(r1) stw r6, 212(r1) stw r7, 216(r1) stw r8, 220(r1) stw r9, 224(r1) stw r10, 228(r1) /* next save fpr 1 to fpr 13 (aligned to 8) */ stfd f1, 56(r1) stfd f2, 64(r1) stfd f3, 72(r1) stfd f4, 80(r1) stfd f5, 88(r1) stfd f6, 96(r1) stfd f7, 104(r1) stfd f8, 112(r1) stfd f9, 120(r1) stfd f10, 128(r1) stfd f11, 136(r1) stfd f12, 144(r1) stfd f13, 152(r1) /* set up registers for the routine that actually does the work */ /* get the context pointer from the trampoline */ mr r3,r11 /* now load up the pointer to the result storage */ addi r4,r1,160 /* now load up the pointer to the saved gpr registers */ addi r5,r1,200 /* now load up the pointer to the saved fpr registers */ addi r6,r1,56 /* make the call */ bl .ffi_closure_helper_DARWIN nop /* now r3 contains the return type */ /* so use it to look up in a table */ /* so we know how to deal with each type */ /* look up the proper starting point in table */ /* by using return type as offset */ addi r5,r1,160 /* get pointer to results area */ lwz r4,LC..60(2) /* get address of jump table */ slwi r3,r3,2 /* now multiply return type by 4 */ lwzx r3,r4,r3 /* get the contents of that table value */ add r3,r3,r4 /* add contents of table to table address */ mtctr r3 bctr /* jump to it */ L..60: .long L..44-L..60 /* FFI_TYPE_VOID */ .long L..50-L..60 /* FFI_TYPE_INT */ .long L..47-L..60 /* FFI_TYPE_FLOAT */ .long L..46-L..60 /* FFI_TYPE_DOUBLE */ .long L..46-L..60 /* FFI_TYPE_LONGDOUBLE */ .long L..56-L..60 /* FFI_TYPE_UINT8 */ .long L..55-L..60 /* FFI_TYPE_SINT8 */ .long L..58-L..60 /* FFI_TYPE_UINT16 */ .long L..57-L..60 /* FFI_TYPE_SINT16 */ .long L..50-L..60 /* FFI_TYPE_UINT32 */ .long L..50-L..60 /* FFI_TYPE_SINT32 */ .long L..48-L..60 /* FFI_TYPE_UINT64 */ .long L..48-L..60 /* FFI_TYPE_SINT64 */ .long L..44-L..60 /* FFI_TYPE_STRUCT */ .long L..50-L..60 /* FFI_TYPE_POINTER */ /* case double */ L..46: lfd f1,0(r5) b L..44 /* case float */ L..47: lfs f1,0(r5) b L..44 /* case long long */ L..48: lwz r3,0(r5) lwz r4,4(r5) b L..44 /* case default / int32 / pointer */ L..50: lwz r3,0(r5) b L..44 /* case signed int8 */ L..55: addi r5,r5,3 lbz r3,0(r5) slwi r3,r3,24 srawi r3,r3,24 b L..44 /* case unsigned int8 */ L..56: addi r5,r5,3 lbz r3,0(r5) b L..44 /* case signed int16 */ L..57: addi r5,r5,2 lhz r3,0(r5) extsh r3,r3 b L..44 /* case unsigned int16 */ L..58: addi r5,r5,2 lhz r3,0(r5) /* case void / done */ L..44: addi r1,r1,176 /* restore stack pointer */ lwz r0,8(r1) /* get return address */ mtlr r0 /* reset link register */ blr /* END(ffi_closure_ASM) */ gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/asm.h0000644000000000000000000001032611237307543017136 0ustar /* ----------------------------------------------------------------------- asm.h - Copyright (c) 1998 Geoffrey Keating PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define ASM_GLOBAL_DIRECTIVE .globl #define C_SYMBOL_NAME(name) name /* Macro for a label. */ #ifdef __STDC__ #define C_LABEL(name) name##: #else #define C_LABEL(name) name/**/: #endif /* This seems to always be the case on PPC. */ #define ALIGNARG(log2) log2 /* For ELF we need the `.type' directive to make shared libs work right. */ #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; #define ASM_SIZE_DIRECTIVE(name) .size name,.-name /* If compiled for profiling, call `_mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on a the return address being on the stack to locate our caller and so it can restore it; so store one just for its benefit. */ #ifdef PIC #define CALL_MCOUNT \ .pushsection; \ .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ stw %r0,4(%r1); \ bl _GLOBAL_OFFSET_TABLE_@local-4; \ mflr %r11; \ lwz %r0,0b@got(%r11); \ bl JUMPTARGET(_mcount); #else /* PIC */ #define CALL_MCOUNT \ .section ".data"; \ .align ALIGNARG(2); \ 0:.long 0; \ .previous; \ mflr %r0; \ lis %r11,0b@ha; \ stw %r0,4(%r1); \ addi %r0,%r11,0b@l; \ bl JUMPTARGET(_mcount); #endif /* PIC */ #else /* PROF */ #define CALL_MCOUNT /* Do nothing. */ #endif /* PROF */ #define ENTRY(name) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(2); \ C_LABEL(name) \ CALL_MCOUNT #define EALIGN_W_0 /* No words to insert. */ #define EALIGN_W_1 nop #define EALIGN_W_2 nop;nop #define EALIGN_W_3 nop;nop;nop #define EALIGN_W_4 EALIGN_W_3;nop #define EALIGN_W_5 EALIGN_W_4;nop #define EALIGN_W_6 EALIGN_W_5;nop #define EALIGN_W_7 EALIGN_W_6;nop /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes past a 2^align boundary. */ #ifdef PROF #define EALIGN(name, alignt, words) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(2); \ C_LABEL(name) \ CALL_MCOUNT \ b 0f; \ .align ALIGNARG(alignt); \ EALIGN_W_##words; \ 0: #else /* PROF */ #define EALIGN(name, alignt, words) \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ .align ALIGNARG(alignt); \ EALIGN_W_##words; \ C_LABEL(name) #endif #define END(name) \ ASM_SIZE_DIRECTIVE(name) #ifdef PIC #define JUMPTARGET(name) name##@plt #else #define JUMPTARGET(name) name #endif /* Local labels stripped out by the linker. */ #define L(x) .L##x gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/darwin.S0000644000000000000000000001373011237307543017617 0ustar /* ----------------------------------------------------------------------- darwin.S - Copyright (c) 2000 John Hornkvist Copyright (c) 2004 Free Software Foundation, Inc. PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #if defined(__ppc64__) #define MODE_CHOICE(x, y) y #else #define MODE_CHOICE(x, y) x #endif #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ #define LIBFFI_ASM #include #include #define JUMPTARGET(name) name #define L(x) x .text .align 2 .globl _ffi_prep_args .text .align 2 .globl _ffi_call_DARWIN .text .align 2 _ffi_call_DARWIN: LFB0: mr r12,r8 /* We only need r12 until the call, so it doesn't have to be saved. */ LFB1: /* Save the old stack pointer as AP. */ mr r8,r1 LCFI0: /* Allocate the stack space we need. */ stwux r1,r1,r4 /* Save registers we use. */ mflr r9 stw r28,-16(r8) stw r29,-12(r8) stw r30,-8(r8) stw r31,-4(r8) stw r9,8(r8) stw r2,20(r1) LCFI1: /* Save arguments over call. */ mr r31,r5 /* flags, */ mr r30,r6 /* rvalue, */ mr r29,r7 /* function address, */ mr r28,r8 /* our AP. */ LCFI2: /* Call ffi_prep_args. */ mr r4,r1 li r9,0 mtctr r12 /* r12 holds address of _ffi_prep_args. */ bctrl lwz r2,20(r1) /* Now do the call. Set up cr1 with bits 4-7 of the flags. */ mtcrf 0x40,r31 /* Get the address to call into CTR. */ mtctr r29 /* Load all those argument registers. We have set up a nice stack frame, just load it into registers. */ lwz r3,20+(1*4)(r1) lwz r4,20+(2*4)(r1) lwz r5,20+(3*4)(r1) lwz r6,20+(4*4)(r1) nop lwz r7,20+(5*4)(r1) lwz r8,20+(6*4)(r1) lwz r9,20+(7*4)(r1) lwz r10,20+(8*4)(r1) L1: /* Load all the FP registers. */ bf 6,L2 /* No floats to load. */ lfd f1,-16-(13*8)(r28) lfd f2,-16-(12*8)(r28) lfd f3,-16-(11*8)(r28) lfd f4,-16-(10*8)(r28) nop lfd f5,-16-(9*8)(r28) lfd f6,-16-(8*8)(r28) lfd f7,-16-(7*8)(r28) lfd f8,-16-(6*8)(r28) nop lfd f9,-16-(5*8)(r28) lfd f10,-16-(4*8)(r28) lfd f11,-16-(3*8)(r28) lfd f12,-16-(2*8)(r28) nop lfd f13,-16-(1*8)(r28) L2: mr r12,r29 /* Put the target address in r12 as specified. */ mtctr r12 nop nop /* Make the call. */ bctrl /* Now, deal with the return value. */ mtcrf 0x01,r31 bt 30,L(done_return_value) bt 29,L(fp_return_value) stw r3,0(r30) bf 28,L(done_return_value) stw r4,4(r30) /* Fall through. */ L(done_return_value): /* Restore the registers we used and return. */ lwz r9,8(r28) lwz r31,-4(r28) mtlr r9 lwz r30,-8(r28) lwz r29,-12(r28) lwz r28,-16(r28) lwz r1,0(r1) blr L(fp_return_value): /* Do we have long double to store? */ bf 31,L(fd_return_value) stfd f1,0(r30) stfd f2,8(r30) b L(done_return_value) L(fd_return_value): /* Do we have double to store? */ bf 28,L(float_return_value) stfd f1,0(r30) b L(done_return_value) L(float_return_value): /* We only have a float to store. */ stfs f1,0(r30) b L(done_return_value) LFE1: /* END(_ffi_call_DARWIN) */ /* Provide a null definition of _ffi_call_AIX. */ .text .align 2 .globl _ffi_call_AIX .text .align 2 _ffi_call_AIX: blr /* END(_ffi_call_AIX) */ .data .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 ; Length of Common Information Entry LSCIE1: .long 0x0 ; CIE Identifier Tag .byte 0x1 ; CIE Version .ascii "zR\0" ; CIE Augmentation .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor .byte 0x41 ; CIE RA Column .byte 0x1 ; uleb128 0x1; Augmentation size .byte 0x90 ; FDE Encoding (indirect pcrel) .byte 0xc ; DW_CFA_def_cfa .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 .align LOG2_GPR_BYTES LECIE1: .globl _ffi_call_DARWIN.eh _ffi_call_DARWIN.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 .long L$set$1 ; FDE Length LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset .g_long LLFB0$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB0 .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$4,LCFI0-LFB1 .long L$set$4 .byte 0xd ; DW_CFA_def_cfa_register .byte 0x08 ; uleb128 0x08 .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$5,LCFI1-LCFI0 .long L$set$5 .byte 0x11 ; DW_CFA_offset_extended_sf .byte 0x41 ; uleb128 0x41 .byte 0x7e ; sleb128 -2 .byte 0x9f ; DW_CFA_offset, column 0x1f .byte 0x1 ; uleb128 0x1 .byte 0x9e ; DW_CFA_offset, column 0x1e .byte 0x2 ; uleb128 0x2 .byte 0x9d ; DW_CFA_offset, column 0x1d .byte 0x3 ; uleb128 0x3 .byte 0x9c ; DW_CFA_offset, column 0x1c .byte 0x4 ; uleb128 0x4 .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$6,LCFI2-LCFI1 .long L$set$6 .byte 0xd ; DW_CFA_def_cfa_register .byte 0x1c ; uleb128 0x1c .align LOG2_GPR_BYTES LEFDE1: .data .align LOG2_GPR_BYTES LLFB0$non_lazy_ptr: .g_long LFB0 gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/darwin_closure.S0000644000000000000000000001611311237307543021351 0ustar /* ----------------------------------------------------------------------- darwin_closure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. based on ppc_closure.S PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #define L(x) x #if defined(__ppc64__) #define MODE_CHOICE(x, y) y #else #define MODE_CHOICE(x, y) x #endif #define lgu MODE_CHOICE(lwzu, ldu) #define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ #define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ .file "darwin_closure.S" .text .align LOG2_GPR_BYTES .globl _ffi_closure_ASM .text .align LOG2_GPR_BYTES _ffi_closure_ASM: LFB1: mflr r0 /* extract return address */ stw r0,8(r1) /* save the return address */ LCFI0: /* 24 Bytes (Linkage Area) 32 Bytes (outgoing parameter area, always reserved) 104 Bytes (13*8 from FPR) 16 Bytes (result) 176 Bytes */ stwu r1,-176(r1) /* skip over caller save area keep stack aligned to 16. */ LCFI1: /* We want to build up an area for the parameters passed in registers. (both floating point and integer) */ /* We store gpr 3 to gpr 10 (aligned to 4) in the parents outgoing area. */ stw r3,200(r1) stw r4,204(r1) stw r5,208(r1) stw r6,212(r1) stw r7,216(r1) stw r8,220(r1) stw r9,224(r1) stw r10,228(r1) /* We save fpr 1 to fpr 13. (aligned to 8) */ stfd f1,56(r1) stfd f2,64(r1) stfd f3,72(r1) stfd f4,80(r1) stfd f5,88(r1) stfd f6,96(r1) stfd f7,104(r1) stfd f8,112(r1) stfd f9,120(r1) stfd f10,128(r1) stfd f11,136(r1) stfd f12,144(r1) stfd f13,152(r1) /* Set up registers for the routine that actually does the work get the context pointer from the trampoline. */ mr r3,r11 /* Now load up the pointer to the result storage. */ addi r4,r1,160 /* Now load up the pointer to the saved gpr registers. */ addi r5,r1,200 /* Now load up the pointer to the saved fpr registers. */ addi r6,r1,56 /* Make the call. */ bl Lffi_closure_helper_DARWIN$stub /* Now r3 contains the return type so use it to look up in a table so we know how to deal with each type. */ /* Look up the proper starting point in table by using return type as offset. */ addi r5,r1,160 /* Get pointer to results area. */ bl Lget_ret_type0_addr /* Get pointer to Lret_type0 into LR. */ mflr r4 /* Move to r4. */ slwi r3,r3,4 /* Now multiply return type by 16. */ add r3,r3,r4 /* Add contents of table to table address. */ mtctr r3 bctr /* Jump to it. */ LFE1: /* Each of the ret_typeX code fragments has to be exactly 16 bytes long (4 instructions). For cache effectiveness we align to a 16 byte boundary first. */ .align 4 nop nop nop Lget_ret_type0_addr: blrl /* case FFI_TYPE_VOID */ Lret_type0: b Lfinish nop nop nop /* case FFI_TYPE_INT */ Lret_type1: lwz r3,0(r5) b Lfinish nop nop /* case FFI_TYPE_FLOAT */ Lret_type2: lfs f1,0(r5) b Lfinish nop nop /* case FFI_TYPE_DOUBLE */ Lret_type3: lfd f1,0(r5) b Lfinish nop nop /* case FFI_TYPE_LONGDOUBLE */ Lret_type4: lfd f1,0(r5) lfd f2,8(r5) b Lfinish nop /* case FFI_TYPE_UINT8 */ Lret_type5: lbz r3,3(r5) b Lfinish nop nop /* case FFI_TYPE_SINT8 */ Lret_type6: lbz r3,3(r5) extsb r3,r3 b Lfinish nop /* case FFI_TYPE_UINT16 */ Lret_type7: lhz r3,2(r5) b Lfinish nop nop /* case FFI_TYPE_SINT16 */ Lret_type8: lha r3,2(r5) b Lfinish nop nop /* case FFI_TYPE_UINT32 */ Lret_type9: lwz r3,0(r5) b Lfinish nop nop /* case FFI_TYPE_SINT32 */ Lret_type10: lwz r3,0(r5) b Lfinish nop nop /* case FFI_TYPE_UINT64 */ Lret_type11: lwz r3,0(r5) lwz r4,4(r5) b Lfinish nop /* case FFI_TYPE_SINT64 */ Lret_type12: lwz r3,0(r5) lwz r4,4(r5) b Lfinish nop /* case FFI_TYPE_STRUCT */ Lret_type13: b Lfinish nop nop nop /* case FFI_TYPE_POINTER */ Lret_type14: lwz r3,0(r5) b Lfinish nop nop /* case done */ Lfinish: addi r1,r1,176 /* Restore stack pointer. */ lwz r0,8(r1) /* Get return address. */ mtlr r0 /* Reset link register. */ blr /* END(ffi_closure_ASM) */ .data .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 ; Length of Common Information Entry LSCIE1: .long 0x0 ; CIE Identifier Tag .byte 0x1 ; CIE Version .ascii "zR\0" ; CIE Augmentation .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor .byte 0x41 ; CIE RA Column .byte 0x1 ; uleb128 0x1; Augmentation size .byte 0x90 ; FDE Encoding (indirect pcrel) .byte 0xc ; DW_CFA_def_cfa .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 .align LOG2_GPR_BYTES LECIE1: .globl _ffi_closure_ASM.eh _ffi_closure_ASM.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 .long L$set$1 ; FDE Length LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset .g_long LLFB1$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB1 .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$3,LCFI1-LCFI0 .long L$set$3 .byte 0xe ; DW_CFA_def_cfa_offset .byte 176,1 ; uleb128 176 .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$4,LCFI0-LFB1 .long L$set$4 .byte 0x11 ; DW_CFA_offset_extended_sf .byte 0x41 ; uleb128 0x41 .byte 0x7e ; sleb128 -2 .align LOG2_GPR_BYTES LEFDE1: .data .align LOG2_GPR_BYTES LDFCM0: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 .align LOG2_GPR_BYTES Lffi_closure_helper_DARWIN$stub: #if 1 .indirect_symbol _ffi_closure_helper_DARWIN mflr r0 bcl 20,31,LO$ffi_closure_helper_DARWIN LO$ffi_closure_helper_DARWIN: mflr r11 addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN) mtlr r0 lgu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11) mtctr r12 bctr .lazy_symbol_pointer L_ffi_closure_helper_DARWIN$lazy_ptr: .indirect_symbol _ffi_closure_helper_DARWIN .g_long dyld_stub_binding_helper #endif .data .align LOG2_GPR_BYTES LLFB1$non_lazy_ptr: .g_long LFB1 gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/ffi.c0000644000000000000000000007735011237307543017127 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating PowerPC Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include extern void ffi_closure_SYSV(void); extern void FFI_HIDDEN ffi_closure_LINUX64(void); enum { /* The assembly depends on these exact flags. */ FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */ FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */ FLAG_RETURNS_FP = 1 << (31-29), FLAG_RETURNS_64BITS = 1 << (31-28), FLAG_RETURNS_128BITS = 1 << (31-27), FLAG_ARG_NEEDS_COPY = 1 << (31- 7), FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), FLAG_RETVAL_REFERENCE = 1 << (31- 4) }; /* About the SYSV ABI. */ enum { NUM_GPR_ARG_REGISTERS = 8, NUM_FPR_ARG_REGISTERS = 8 }; enum { ASM_NEEDS_REGISTERS = 4 }; /* ffi_prep_args_SYSV is called by the assembly routine once stack space has been allocated for the function's arguments. The stack layout we want looks like this: | Return address from ffi_call_SYSV 4bytes | higher addresses |--------------------------------------------| | Previous backchain pointer 4 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*4 | | ffi_call_SYSV |--------------------------------------------| | | GPR registers r3-r10 8*4 | | ffi_call_SYSV |--------------------------------------------| | | FPR registers f1-f8 (optional) 8*8 | | |--------------------------------------------| | stack | | Space for copied structures | | grows | |--------------------------------------------| | down V | Parameters that didn't fit in registers | | |--------------------------------------------| | lower addresses | Space for callee's LR 4 | | |--------------------------------------------| | stack pointer here | Current backchain pointer 4 |-/ during |--------------------------------------------| <<< ffi_call_SYSV */ /*@-exportheader@*/ void ffi_prep_args_SYSV(extended_cif *ecif, unsigned *const stack) /*@=exportheader@*/ { const unsigned bytes = ecif->cif->bytes; const unsigned flags = ecif->cif->flags; /* 'stacktop' points at the previous backchain pointer. */ unsigned *const stacktop = stack + (bytes / sizeof(unsigned)); /* 'gpr_base' points at the space for gpr3, and grows upwards as we use GPR registers. */ unsigned *gpr_base = stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS; int intarg_count = 0; /* 'fpr_base' points at the space for fpr1, and grows upwards as we use FPR registers. */ double *fpr_base = (double *)gpr_base - NUM_FPR_ARG_REGISTERS; int fparg_count = 0; /* 'copy_space' grows down as we put structures in it. It should stay 16-byte aligned. */ char *copy_space = ((flags & FLAG_FP_ARGUMENTS) ? (char *)fpr_base : (char *)gpr_base); /* 'next_arg' grows up as we put parameters in it. */ unsigned *next_arg = stack + 2; int i; ffi_type **ptr; double double_tmp; void **p_argv; size_t struct_copy_size; unsigned gprvalue; /* Check that everything starts aligned properly. */ FFI_ASSERT(((unsigned)(char *)stack & 0xF) == 0); FFI_ASSERT(((unsigned)(char *)copy_space & 0xF) == 0); FFI_ASSERT(((unsigned)(char *)stacktop & 0xF) == 0); FFI_ASSERT((bytes & 0xF) == 0); FFI_ASSERT(copy_space >= (char *)next_arg); /* Deal with return values that are actually pass-by-reference. */ if (flags & FLAG_RETVAL_REFERENCE) { *gpr_base++ = (unsigned long)(char *)ecif->rvalue; intarg_count++; } /* Now for the arguments. */ p_argv = ecif->avalue; for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; i > 0; i--, ptr++, p_argv++) { switch ((*ptr)->type) { case FFI_TYPE_FLOAT: double_tmp = *(float *)*p_argv; if (fparg_count >= NUM_FPR_ARG_REGISTERS) { *(float *)next_arg = (float)double_tmp; next_arg += 1; } else *fpr_base++ = double_tmp; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; case FFI_TYPE_DOUBLE: double_tmp = *(double *)*p_argv; if (fparg_count >= NUM_FPR_ARG_REGISTERS) { if (intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count % 2 != 0) { intarg_count++; next_arg++; } *(double *)next_arg = double_tmp; next_arg += 2; } else *fpr_base++ = double_tmp; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: if (intarg_count == NUM_GPR_ARG_REGISTERS-1) intarg_count++; if (intarg_count >= NUM_GPR_ARG_REGISTERS) { if (intarg_count%2 != 0) { intarg_count++; next_arg++; } *(long long *)next_arg = *(long long *)*p_argv; next_arg += 2; } else { /* whoops: abi states only certain register pairs * can be used for passing long long int * specifically (r3,r4), (r5,r6), (r7,r8), * (r9,r10) and if next arg is long long but * not correct starting register of pair then skip * until the proper starting register */ if (intarg_count%2 != 0) { intarg_count ++; gpr_base++; } *(long long *)gpr_base = *(long long *)*p_argv; gpr_base += 2; } intarg_count += 2; break; case FFI_TYPE_STRUCT: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif struct_copy_size = ((*ptr)->size + 15) & ~0xF; copy_space -= struct_copy_size; memcpy(copy_space, (char *)*p_argv, (*ptr)->size); gprvalue = (unsigned long)copy_space; FFI_ASSERT(copy_space > (char *)next_arg); FFI_ASSERT(flags & FLAG_ARG_NEEDS_COPY); goto putgpr; case FFI_TYPE_UINT8: gprvalue = *(unsigned char *)*p_argv; goto putgpr; case FFI_TYPE_SINT8: gprvalue = *(signed char *)*p_argv; goto putgpr; case FFI_TYPE_UINT16: gprvalue = *(unsigned short *)*p_argv; goto putgpr; case FFI_TYPE_SINT16: gprvalue = *(signed short *)*p_argv; goto putgpr; case FFI_TYPE_INT: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: case FFI_TYPE_POINTER: gprvalue = *(unsigned *)*p_argv; putgpr: if (intarg_count >= NUM_GPR_ARG_REGISTERS) *next_arg++ = gprvalue; else *gpr_base++ = gprvalue; intarg_count++; break; } } /* Check that we didn't overrun the stack... */ FFI_ASSERT(copy_space >= (char *)next_arg); FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS); FFI_ASSERT((unsigned *)fpr_base <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); } /* About the LINUX64 ABI. */ enum { NUM_GPR_ARG_REGISTERS64 = 8, NUM_FPR_ARG_REGISTERS64 = 13 }; enum { ASM_NEEDS_REGISTERS64 = 4 }; /* ffi_prep_args64 is called by the assembly routine once stack space has been allocated for the function's arguments. The stack layout we want looks like this: | Ret addr from ffi_call_LINUX64 8bytes | higher addresses |--------------------------------------------| | CR save area 8bytes | |--------------------------------------------| | Previous backchain pointer 8 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*8 | | ffi_call_LINUX64 |--------------------------------------------| | | GPR registers r3-r10 8*8 | | |--------------------------------------------| | | FPR registers f1-f13 (optional) 13*8 | | |--------------------------------------------| | | Parameter save area | | |--------------------------------------------| | | TOC save area 8 | | |--------------------------------------------| | stack | | Linker doubleword 8 | | grows | |--------------------------------------------| | down V | Compiler doubleword 8 | | |--------------------------------------------| | lower addresses | Space for callee's LR 8 | | |--------------------------------------------| | | CR save area 8 | | |--------------------------------------------| | stack pointer here | Current backchain pointer 8 |-/ during |--------------------------------------------| <<< ffi_call_LINUX64 */ /*@-exportheader@*/ void FFI_HIDDEN ffi_prep_args64(extended_cif *ecif, unsigned long *const stack) /*@=exportheader@*/ { const unsigned long bytes = ecif->cif->bytes; const unsigned long flags = ecif->cif->flags; /* 'stacktop' points at the previous backchain pointer. */ unsigned long *const stacktop = stack + (bytes / sizeof(unsigned long)); /* 'next_arg' points at the space for gpr3, and grows upwards as we use GPR registers, then continues at rest. */ unsigned long *const gpr_base = stacktop - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64; unsigned long *const gpr_end = gpr_base + NUM_GPR_ARG_REGISTERS64; unsigned long *const rest = stack + 6 + NUM_GPR_ARG_REGISTERS64; unsigned long *next_arg = gpr_base; /* 'fpr_base' points at the space for fpr3, and grows upwards as we use FPR registers. */ double *fpr_base = (double *)gpr_base - NUM_FPR_ARG_REGISTERS64; int fparg_count = 0; int i, words; ffi_type **ptr; double double_tmp; void **p_argv; unsigned long gprvalue; /* Check that everything starts aligned properly. */ FFI_ASSERT(((unsigned long)(char *)stack & 0xF) == 0); FFI_ASSERT(((unsigned long)(char *)stacktop & 0xF) == 0); FFI_ASSERT((bytes & 0xF) == 0); /* Deal with return values that are actually pass-by-reference. */ if (flags & FLAG_RETVAL_REFERENCE) *next_arg++ = (unsigned long)(char *)ecif->rvalue; /* Now for the arguments. */ p_argv = ecif->avalue; for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; i > 0; i--, ptr++, p_argv++) { switch ((*ptr)->type) { case FFI_TYPE_FLOAT: double_tmp = *(float *)*p_argv; *(float *)next_arg = (float)double_tmp; if (++next_arg == gpr_end) next_arg = rest; if (fparg_count < NUM_FPR_ARG_REGISTERS64) *fpr_base++ = double_tmp; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; case FFI_TYPE_DOUBLE: double_tmp = *(double *)*p_argv; *(double *)next_arg = double_tmp; if (++next_arg == gpr_end) next_arg = rest; if (fparg_count < NUM_FPR_ARG_REGISTERS64) *fpr_base++ = double_tmp; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: double_tmp = ((double *) *p_argv)[0]; *(double *) next_arg = double_tmp; if (++next_arg == gpr_end) next_arg = rest; if (fparg_count < NUM_FPR_ARG_REGISTERS64) *fpr_base++ = double_tmp; fparg_count++; double_tmp = ((double *) *p_argv)[1]; *(double *) next_arg = double_tmp; if (++next_arg == gpr_end) next_arg = rest; if (fparg_count < NUM_FPR_ARG_REGISTERS64) *fpr_base++ = double_tmp; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; #endif case FFI_TYPE_STRUCT: words = ((*ptr)->size + 7) / 8; if (next_arg >= gpr_base && next_arg + words > gpr_end) { size_t first = (char *) gpr_end - (char *) next_arg; memcpy((char *) next_arg, (char *) *p_argv, first); memcpy((char *) rest, (char *) *p_argv + first, (*ptr)->size - first); next_arg = (unsigned long *) ((char *) rest + words * 8 - first); } else { char *where = (char *) next_arg; /* Structures with size less than eight bytes are passed left-padded. */ if ((*ptr)->size < 8) where += 8 - (*ptr)->size; memcpy (where, (char *) *p_argv, (*ptr)->size); next_arg += words; if (next_arg == gpr_end) next_arg = rest; } break; case FFI_TYPE_UINT8: gprvalue = *(unsigned char *)*p_argv; goto putgpr; case FFI_TYPE_SINT8: gprvalue = *(signed char *)*p_argv; goto putgpr; case FFI_TYPE_UINT16: gprvalue = *(unsigned short *)*p_argv; goto putgpr; case FFI_TYPE_SINT16: gprvalue = *(signed short *)*p_argv; goto putgpr; case FFI_TYPE_UINT32: gprvalue = *(unsigned int *)*p_argv; goto putgpr; case FFI_TYPE_INT: case FFI_TYPE_SINT32: gprvalue = *(signed int *)*p_argv; goto putgpr; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_POINTER: gprvalue = *(unsigned long *)*p_argv; putgpr: *next_arg++ = gprvalue; if (next_arg == gpr_end) next_arg = rest; break; } } FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || (next_arg >= gpr_base && next_arg <= gpr_base + 4)); } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* All this is for the SYSV and LINUX64 ABI. */ int i; ffi_type **ptr; unsigned bytes; int fparg_count = 0, intarg_count = 0; unsigned flags = 0; unsigned struct_copy_size = 0; unsigned type = cif->rtype->type; unsigned size = cif->rtype->size; if (cif->abi != FFI_LINUX64) { /* All the machine-independent calculation of cif->bytes will be wrong. Redo the calculation for SYSV. */ /* Space for the frame pointer, callee's LR, and the asm's temp regs. */ bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof(int); /* Space for the GPR registers. */ bytes += NUM_GPR_ARG_REGISTERS * sizeof(int); } else { /* 64-bit ABI. */ /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp regs. */ bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof(long); /* Space for the mandatory parm save area and general registers. */ bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof(long); #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE if (type == FFI_TYPE_LONGDOUBLE) type = FFI_TYPE_DOUBLE; #endif } /* Return value handling. The rules for SYSV are as follows: - 32-bit (or less) integer values are returned in gpr3; - Structures of size <= 4 bytes also returned in gpr3; - 64-bit integer values and structures between 5 and 8 bytes are returned in gpr3 and gpr4; - Single/double FP values are returned in fpr1; - Larger structures and long double (if not equivalent to double) values are allocated space and a pointer is passed as the first argument. For LINUX64: - integer values in gpr3; - Structures/Unions by reference; - Single/double FP values in fpr1, long double in fpr1,fpr2. */ switch (type) { case FFI_TYPE_DOUBLE: flags |= FLAG_RETURNS_64BITS; /* Fall through. */ case FFI_TYPE_FLOAT: flags |= FLAG_RETURNS_FP; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: flags |= FLAG_RETURNS_64BITS; break; case FFI_TYPE_STRUCT: if (cif->abi == FFI_SYSV) { /* The final SYSV ABI says that structures smaller or equal 8 bytes are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them in memory. */ /* Treat structs with size <= 8 bytes. */ if (size <= 8) { flags |= FLAG_RETURNS_SMST; /* These structs are returned in r3. We pack the type and the precalculated shift value (needed in the sysv.S) into flags. The same applies for the structs returned in r3/r4. */ if (size <= 4) { flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 1 ) | (8 * (4 - size) << 4); break; } /* These structs are returned in r3 and r4. See above. */ if (size <= 8) { flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 2 ) | (8 * (8 - size) << 4); break; } } } /* else fall through. */ #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: if (type == FFI_TYPE_LONGDOUBLE && cif->abi == FFI_LINUX64) { flags |= FLAG_RETURNS_128BITS; flags |= FLAG_RETURNS_FP; break; } #endif intarg_count++; flags |= FLAG_RETVAL_REFERENCE; /* Fall through. */ case FFI_TYPE_VOID: flags |= FLAG_RETURNS_NOTHING; break; default: /* Returns 32-bit integer, or similar. Nothing to do here. */ break; } if (cif->abi != FFI_LINUX64) /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest goes on the stack. Structures and long doubles (if not equivalent to double) are passed as a pointer to a copy of the structure. Stuff on the stack needs to keep proper alignment. */ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { switch ((*ptr)->type) { case FFI_TYPE_FLOAT: fparg_count++; /* floating singles are not 8-aligned on stack */ break; case FFI_TYPE_DOUBLE: fparg_count++; /* If this FP arg is going on the stack, it must be 8-byte-aligned. */ if (fparg_count > NUM_FPR_ARG_REGISTERS && intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count % 2 != 0) intarg_count++; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: /* 'long long' arguments are passed as two words, but either both words must fit in registers or both go on the stack. If they go on the stack, they must be 8-byte-aligned. Also, only certain register pairs can be used for passing long long int -- specifically (r3,r4), (r5,r6), (r7,r8), (r9,r10). */ if (intarg_count == NUM_GPR_ARG_REGISTERS-1 || intarg_count%2 != 0) intarg_count++; intarg_count += 2; break; case FFI_TYPE_STRUCT: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif /* We must allocate space for a copy of these to enforce pass-by-value. Pad the space up to a multiple of 16 bytes (the maximum alignment required for anything under the SYSV ABI). */ struct_copy_size += ((*ptr)->size + 15) & ~0xF; /* Fall through (allocate space for the pointer). */ default: /* Everything else is passed as a 4-byte word in a GPR, either the object itself or a pointer to it. */ intarg_count++; break; } } else for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { switch ((*ptr)->type) { #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: fparg_count += 2; intarg_count += 2; break; #endif case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: fparg_count++; intarg_count++; break; case FFI_TYPE_STRUCT: intarg_count += ((*ptr)->size + 7) / 8; break; default: /* Everything else is passed as a 8-byte word in a GPR, either the object itself or a pointer to it. */ intarg_count++; break; } } if (fparg_count != 0) flags |= FLAG_FP_ARGUMENTS; if (intarg_count > 4) flags |= FLAG_4_GPR_ARGUMENTS; if (struct_copy_size != 0) flags |= FLAG_ARG_NEEDS_COPY; if (cif->abi != FFI_LINUX64) { /* Space for the FPR registers, if needed. */ if (fparg_count != 0) bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); /* Stack space. */ if (intarg_count > NUM_GPR_ARG_REGISTERS) bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof(int); if (fparg_count > NUM_FPR_ARG_REGISTERS) bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof(double); } else { /* Space for the FPR registers, if needed. */ if (fparg_count != 0) bytes += NUM_FPR_ARG_REGISTERS64 * sizeof(double); /* Stack space. */ if (intarg_count > NUM_GPR_ARG_REGISTERS64) bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof(long); } /* The stack space allocated needs to be a multiple of 16 bytes. */ bytes = (bytes + 15) & ~0xF; /* Add in the space for the copied structures. */ bytes += struct_copy_size; cif->flags = flags; cif->bytes = bytes; return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(/*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); extern void FFI_HIDDEN ffi_call_LINUX64(/*@out@*/ extended_cif *, unsigned long, unsigned long, /*@out@*/ unsigned long *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { #ifndef POWERPC64 case FFI_SYSV: case FFI_GCC_SYSV: /*@-usedef@*/ ffi_call_SYSV(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #else case FFI_LINUX64: /*@-usedef@*/ ffi_call_LINUX64(&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #endif default: FFI_ASSERT(0); break; } } #ifndef POWERPC64 static void flush_icache(char *, int); #define MIN_CACHE_LINE_SIZE 8 static void flush_icache(char * addr1, int size) { int i; char * addr; for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) { addr = addr1 + i; __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" : : "r"(addr) : "memory"); } addr = addr1 + size - 1; __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" "sync;" "isync;" : : "r"(addr) : "memory"); } #endif ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { #ifdef POWERPC64 void **tramp = (void **) &closure->tramp[0]; FFI_ASSERT (cif->abi == FFI_LINUX64); /* Copy function address and TOC from ffi_closure_LINUX64. */ memcpy (tramp, (char *) ffi_closure_LINUX64, 16); tramp[2] = (void *) closure; #else unsigned int *tramp; FFI_ASSERT (cif->abi == FFI_GCC_SYSV || cif->abi == FFI_SYSV); tramp = (unsigned int *) &closure->tramp[0]; tramp[0] = 0x7c0802a6; /* mflr r0 */ tramp[1] = 0x4800000d; /* bl 10 */ tramp[4] = 0x7d6802a6; /* mflr r11 */ tramp[5] = 0x7c0803a6; /* mtlr r0 */ tramp[6] = 0x800b0000; /* lwz r0,0(r11) */ tramp[7] = 0x816b0004; /* lwz r11,4(r11) */ tramp[8] = 0x7c0903a6; /* mtctr r0 */ tramp[9] = 0x4e800420; /* bctr */ *(void **) &tramp[2] = (void *)ffi_closure_SYSV; /* function */ *(void **) &tramp[3] = (void *)closure; /* context */ /* Flush the icache. */ flush_icache(&closure->tramp[0],FFI_TRAMPOLINE_SIZE); #endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; return FFI_OK; } typedef union { float f; double d; } ffi_dblfl; int ffi_closure_helper_SYSV (ffi_closure*, void*, unsigned long*, ffi_dblfl*, unsigned long*); /* Basically the trampoline invokes ffi_closure_SYSV, and on * entry, r11 holds the address of the closure. * After storing the registers that could possibly contain * parameters to be passed into the stack frame and setting * up space for a return value, ffi_closure_SYSV invokes the * following helper function to do most of the work */ int ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue, unsigned long * pgr, ffi_dblfl * pfr, unsigned long * pst) { /* rvalue is the pointer to space for return value in closure assembly */ /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */ /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */ /* pst is the pointer to outgoing parameter stack in original caller */ void ** avalue; ffi_type ** arg_types; long i, avn; long nf; /* number of floating registers already used */ long ng; /* number of general registers already used */ ffi_cif * cif; double temp; unsigned size; cif = closure->cif; avalue = alloca(cif->nargs * sizeof(void *)); size = cif->rtype->size; nf = 0; ng = 0; /* Copy the caller's structure return value address so that the closure returns the data directly to the caller. For FFI_SYSV the result is passed in r3/r4 if the struct size is less or equal 8 bytes. */ if (cif->rtype->type == FFI_TYPE_STRUCT) { if (!((cif->abi == FFI_SYSV) && (size <= 8))) { rvalue = (void *) *pgr; ng++; pgr++; } } i = 0; avn = cif->nargs; arg_types = cif->arg_types; /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) { switch (arg_types[i]->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: /* there are 8 gpr registers used to pass values */ if (ng < 8) { avalue[i] = (((char *)pgr)+3); ng++; pgr++; } else { avalue[i] = (((char *)pst)+3); pst++; } break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: /* there are 8 gpr registers used to pass values */ if (ng < 8) { avalue[i] = (((char *)pgr)+2); ng++; pgr++; } else { avalue[i] = (((char *)pst)+2); pst++; } break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_POINTER: /* there are 8 gpr registers used to pass values */ if (ng < 8) { avalue[i] = pgr; ng++; pgr++; } else { avalue[i] = pst; pst++; } break; case FFI_TYPE_STRUCT: /* Structs are passed by reference. The address will appear in a gpr if it is one of the first 8 arguments. */ if (ng < 8) { avalue[i] = (void *) *pgr; ng++; pgr++; } else { avalue[i] = (void *) *pst; pst++; } break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: /* passing long long ints are complex, they must * be passed in suitable register pairs such as * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) * and if the entire pair aren't available then the outgoing * parameter stack is used for both but an alignment of 8 * must will be kept. So we must either look in pgr * or pst to find the correct address for this type * of parameter. */ if (ng < 7) { if (ng & 0x01) { /* skip r4, r6, r8 as starting points */ ng++; pgr++; } avalue[i] = pgr; ng+=2; pgr+=2; } else { if (((long)pst) & 4) pst++; avalue[i] = pst; pst+=2; } break; case FFI_TYPE_FLOAT: /* unfortunately float values are stored as doubles * in the ffi_closure_SYSV code (since we don't check * the type in that routine). */ /* there are 8 64bit floating point registers */ if (nf < 8) { temp = pfr->d; pfr->f = (float)temp; avalue[i] = pfr; nf++; pfr++; } else { /* FIXME? here we are really changing the values * stored in the original calling routines outgoing * parameter stack. This is probably a really * naughty thing to do but... */ avalue[i] = pst; nf++; pst+=1; } break; case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ /* there are 8 64bit floating point registers */ if (nf < 8) { avalue[i] = pfr; nf++; pfr++; } else { if (((long)pst) & 4) pst++; avalue[i] = pst; nf++; pst+=2; } break; default: FFI_ASSERT(0); } i++; } (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_SYSV how to perform return type promotions. Because the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4 we have to tell ffi_closure_SYSV how to treat them. */ if (cif->abi == FFI_SYSV && cif->rtype->type == FFI_TYPE_STRUCT && size <= 8) return FFI_SYSV_TYPE_SMALL_STRUCT + size; return cif->rtype->type; } int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure*, void*, unsigned long*, ffi_dblfl*); int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue, unsigned long *pst, ffi_dblfl *pfr) { /* rvalue is the pointer to space for return value in closure assembly */ /* pst is the pointer to parameter save area (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */ /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */ void **avalue; ffi_type **arg_types; long i, avn; ffi_cif *cif; ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; cif = closure->cif; avalue = alloca (cif->nargs * sizeof (void *)); /* Copy the caller's structure return value address so that the closure returns the data directly to the caller. */ if (cif->rtype->type == FFI_TYPE_STRUCT) { rvalue = (void *) *pst; pst++; } i = 0; avn = cif->nargs; arg_types = cif->arg_types; /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) { switch (arg_types[i]->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = (char *) pst + 7; pst++; break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = (char *) pst + 6; pst++; break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: avalue[i] = (char *) pst + 4; pst++; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: case FFI_TYPE_POINTER: avalue[i] = pst; pst++; break; case FFI_TYPE_STRUCT: /* Structures with size less than eight bytes are passed left-padded. */ if (arg_types[i]->size < 8) avalue[i] = (char *) pst + 8 - arg_types[i]->size; else avalue[i] = pst; pst += (arg_types[i]->size + 7) / 8; break; case FFI_TYPE_FLOAT: /* unfortunately float values are stored as doubles * in the ffi_closure_LINUX64 code (since we don't check * the type in that routine). */ /* there are 13 64bit floating point registers */ if (pfr < end_pfr) { double temp = pfr->d; pfr->f = (float) temp; avalue[i] = pfr; pfr++; } else avalue[i] = pst; pst++; break; case FFI_TYPE_DOUBLE: /* On the outgoing stack all values are aligned to 8 */ /* there are 13 64bit floating point registers */ if (pfr < end_pfr) { avalue[i] = pfr; pfr++; } else avalue[i] = pst; pst++; break; #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: if (pfr + 1 < end_pfr) { avalue[i] = pfr; pfr += 2; } else { if (pfr < end_pfr) { /* Passed partly in f13 and partly on the stack. Move it all to the stack. */ *pst = *(unsigned long *) pfr; pfr++; } avalue[i] = pst; } pst += 2; break; #endif default: FFI_ASSERT(0); } i++; } (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_LINUX64 how to perform return type promotions. */ return cif->rtype->type; } gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/ffi_darwin.c0000644000000000000000000005346711237307543020476 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1998 Geoffrey Keating PowerPC Foreign Function Interface Darwin ABI support (c) 2001 John Hornkvist AIX ABI support (c) 2002 Free Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include extern void ffi_closure_ASM(void); enum { /* The assembly depends on these exact flags. */ FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */ FLAG_RETURNS_FP = 1 << (31-29), FLAG_RETURNS_64BITS = 1 << (31-28), FLAG_RETURNS_128BITS = 1 << (31-31), FLAG_ARG_NEEDS_COPY = 1 << (31- 7), FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), FLAG_RETVAL_REFERENCE = 1 << (31- 4) }; /* About the DARWIN ABI. */ enum { NUM_GPR_ARG_REGISTERS = 8, NUM_FPR_ARG_REGISTERS = 13 }; enum { ASM_NEEDS_REGISTERS = 4 }; /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments. The stack layout we want looks like this: | Return address from ffi_call_DARWIN | higher addresses |--------------------------------------------| | Previous backchain pointer 4 | stack pointer here |--------------------------------------------|<+ <<< on entry to | Saved r28-r31 4*4 | | ffi_call_DARWIN |--------------------------------------------| | | Parameters (at least 8*4=32) | | |--------------------------------------------| | | Space for GPR2 4 | | |--------------------------------------------| | stack | | Reserved 2*4 | | grows | |--------------------------------------------| | down V | Space for callee's LR 4 | | |--------------------------------------------| | lower addresses | Saved CR 4 | | |--------------------------------------------| | stack pointer here | Current backchain pointer 4 |-/ during |--------------------------------------------| <<< ffi_call_DARWIN */ /*@-exportheader@*/ void ffi_prep_args(extended_cif *ecif, unsigned *const stack) /*@=exportheader@*/ { const unsigned bytes = ecif->cif->bytes; const unsigned flags = ecif->cif->flags; /* 'stacktop' points at the previous backchain pointer. */ unsigned *const stacktop = stack + (bytes / sizeof(unsigned)); /* 'fpr_base' points at the space for fpr1, and grows upwards as we use FPR registers. */ double *fpr_base = (double*) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS; int fparg_count = 0; /* 'next_arg' grows up as we put parameters in it. */ unsigned *next_arg = stack + 6; /* 6 reserved positions. */ int i = ecif->cif->nargs; double double_tmp; void **p_argv = ecif->avalue; unsigned gprvalue; ffi_type** ptr = ecif->cif->arg_types; char *dest_cpy; unsigned size_al = 0; /* Check that everything starts aligned properly. */ FFI_ASSERT(((unsigned)(char *)stack & 0xF) == 0); FFI_ASSERT(((unsigned)(char *)stacktop & 0xF) == 0); FFI_ASSERT((bytes & 0xF) == 0); /* Deal with return values that are actually pass-by-reference. Rule: Return values are referenced by r3, so r4 is the first parameter. */ if (flags & FLAG_RETVAL_REFERENCE) *next_arg++ = (unsigned)(char *)ecif->rvalue; /* Now for the arguments. */ for (; i > 0; i--, ptr++, p_argv++) { switch ((*ptr)->type) { /* If a floating-point parameter appears before all of the general- purpose registers are filled, the corresponding GPRs that match the size of the floating-point parameter are skipped. */ case FFI_TYPE_FLOAT: double_tmp = *(float *)*p_argv; *(double *)next_arg = double_tmp; if (fparg_count < NUM_FPR_ARG_REGISTERS) *fpr_base++ = double_tmp; next_arg++; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; case FFI_TYPE_DOUBLE: double_tmp = *(double *)*p_argv; *(double *)next_arg = double_tmp; if (fparg_count < NUM_FPR_ARG_REGISTERS) *fpr_base++ = double_tmp; next_arg += 2; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: double_tmp = ((double *)*p_argv)[0]; *(double *)next_arg = double_tmp; if (fparg_count < NUM_FPR_ARG_REGISTERS) *fpr_base++ = double_tmp; next_arg += 2; fparg_count++; double_tmp = ((double *)*p_argv)[1]; *(double *)next_arg = double_tmp; if (fparg_count < NUM_FPR_ARG_REGISTERS) *fpr_base++ = double_tmp; next_arg += 2; fparg_count++; FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); break; #endif case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: *(long long *)next_arg = *(long long *)*p_argv; next_arg+=2; break; case FFI_TYPE_UINT8: gprvalue = *(unsigned char *)*p_argv; goto putgpr; case FFI_TYPE_SINT8: gprvalue = *(signed char *)*p_argv; goto putgpr; case FFI_TYPE_UINT16: gprvalue = *(unsigned short *)*p_argv; goto putgpr; case FFI_TYPE_SINT16: gprvalue = *(signed short *)*p_argv; goto putgpr; case FFI_TYPE_STRUCT: dest_cpy = (char *) next_arg; /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, SI 4 bytes) are aligned as if they were those modes. Structures with 3 byte in size are padded upwards. */ size_al = (*ptr)->size; /* If the first member of the struct is a double, then align the struct to double-word. Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */ if ((*ptr)->elements[0]->type == 3) size_al = ALIGN((*ptr)->size, 8); if (size_al < 3 && ecif->cif->abi == FFI_DARWIN) dest_cpy += 4 - size_al; memcpy((char *)dest_cpy, (char *)*p_argv, size_al); next_arg += (size_al + 3) / 4; break; case FFI_TYPE_INT: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: case FFI_TYPE_POINTER: gprvalue = *(unsigned *)*p_argv; putgpr: *next_arg++ = gprvalue; break; default: break; } } /* Check that we didn't overrun the stack... */ //FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS); //FFI_ASSERT((unsigned *)fpr_base // <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); //FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* All this is for the DARWIN ABI. */ int i; ffi_type **ptr; unsigned bytes; int fparg_count = 0, intarg_count = 0; unsigned flags = 0; unsigned size_al = 0; /* All the machine-independent calculation of cif->bytes will be wrong. Redo the calculation for DARWIN. */ /* Space for the frame pointer, callee's LR, CR, etc, and for the asm's temp regs. */ bytes = (6 + ASM_NEEDS_REGISTERS) * sizeof(long); /* Return value handling. The rules are as follows: - 32-bit (or less) integer values are returned in gpr3; - Structures of size <= 4 bytes also returned in gpr3; - 64-bit integer values and structures between 5 and 8 bytes are returned in gpr3 and gpr4; - Single/double FP values are returned in fpr1; - Long double FP (if not equivalent to double) values are returned in fpr1 and fpr2; - Larger structures values are allocated space and a pointer is passed as the first argument. */ switch (cif->rtype->type) { #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: flags |= FLAG_RETURNS_128BITS; flags |= FLAG_RETURNS_FP; break; #endif case FFI_TYPE_DOUBLE: flags |= FLAG_RETURNS_64BITS; /* Fall through. */ case FFI_TYPE_FLOAT: flags |= FLAG_RETURNS_FP; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: flags |= FLAG_RETURNS_64BITS; break; case FFI_TYPE_STRUCT: flags |= FLAG_RETVAL_REFERENCE; flags |= FLAG_RETURNS_NOTHING; intarg_count++; break; case FFI_TYPE_VOID: flags |= FLAG_RETURNS_NOTHING; break; default: /* Returns 32-bit integer, or similar. Nothing to do here. */ break; } /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest goes on the stack. Structures are passed as a pointer to a copy of the structure. Stuff on the stack needs to keep proper alignment. */ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { switch ((*ptr)->type) { case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: fparg_count++; /* If this FP arg is going on the stack, it must be 8-byte-aligned. */ if (fparg_count > NUM_FPR_ARG_REGISTERS && intarg_count%2 != 0) intarg_count++; break; #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: fparg_count += 2; /* If this FP arg is going on the stack, it must be 8-byte-aligned. */ if (fparg_count > NUM_FPR_ARG_REGISTERS && intarg_count%2 != 0) intarg_count++; intarg_count +=2; break; #endif case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: /* 'long long' arguments are passed as two words, but either both words must fit in registers or both go on the stack. If they go on the stack, they must be 8-byte-aligned. */ if (intarg_count == NUM_GPR_ARG_REGISTERS-1 || (intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count%2 != 0)) intarg_count++; intarg_count += 2; break; case FFI_TYPE_STRUCT: size_al = (*ptr)->size; /* If the first member of the struct is a double, then align the struct to double-word. Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */ if ((*ptr)->elements[0]->type == 3) size_al = ALIGN((*ptr)->size, 8); intarg_count += (size_al + 3) / 4; break; default: /* Everything else is passed as a 4-byte word in a GPR, either the object itself or a pointer to it. */ intarg_count++; break; } } if (fparg_count != 0) flags |= FLAG_FP_ARGUMENTS; /* Space for the FPR registers, if needed. */ if (fparg_count != 0) bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); /* Stack space. */ if ((intarg_count + 2 * fparg_count) > NUM_GPR_ARG_REGISTERS) bytes += (intarg_count + 2 * fparg_count) * sizeof(long); else bytes += NUM_GPR_ARG_REGISTERS * sizeof(long); /* The stack space allocated needs to be a multiple of 16 bytes. */ bytes = (bytes + 15) & ~0xF; cif->flags = flags; cif->bytes = bytes; return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_AIX(/*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)(), void (*fn2)()); extern void ffi_call_DARWIN(/*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)(), void (*fn2)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return value address then we need to make one. */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_AIX: /*@-usedef@*/ ffi_call_AIX(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn, ffi_prep_args); /*@=usedef@*/ break; case FFI_DARWIN: /*@-usedef@*/ ffi_call_DARWIN(&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn, ffi_prep_args); /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } } static void flush_icache(char *); static void flush_range(char *, int); /* The layout of a function descriptor. A C function pointer really points to one of these. */ typedef struct aix_fd_struct { void *code_pointer; void *toc; } aix_fd; /* here I'd like to add the stack frame layout we use in darwin_closure.S and aix_clsoure.S SP previous -> +---------------------------------------+ <--- child frame | back chain to caller 4 | +---------------------------------------+ 4 | saved CR 4 | +---------------------------------------+ 8 | saved LR 4 | +---------------------------------------+ 12 | reserved for compilers 4 | +---------------------------------------+ 16 | reserved for binders 4 | +---------------------------------------+ 20 | saved TOC pointer 4 | +---------------------------------------+ 24 | always reserved 8*4=32 (previous GPRs)| | according to the linkage convention | | from AIX | +---------------------------------------+ 56 | our FPR area 13*8=104 | | f1 | | . | | f13 | +---------------------------------------+ 160 | result area 8 | +---------------------------------------+ 168 | alignement to the next multiple of 16 | SP current --> +---------------------------------------+ 176 <- parent frame | back chain to caller 4 | +---------------------------------------+ 180 | saved CR 4 | +---------------------------------------+ 184 | saved LR 4 | +---------------------------------------+ 188 | reserved for compilers 4 | +---------------------------------------+ 192 | reserved for binders 4 | +---------------------------------------+ 196 | saved TOC pointer 4 | +---------------------------------------+ 200 | always reserved 8*4=32 we store our | | GPRs here | | r3 | | . | | r10 | +---------------------------------------+ 232 | overflow part | +---------------------------------------+ xxx | ???? | +---------------------------------------+ xxx */ ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp; struct ffi_aix_trampoline_struct *tramp_aix; aix_fd *fd; switch (cif->abi) { case FFI_DARWIN: FFI_ASSERT (cif->abi == FFI_DARWIN); tramp = (unsigned int *) &closure->tramp[0]; tramp[0] = 0x7c0802a6; /* mflr r0 */ tramp[1] = 0x429f000d; /* bcl- 20,4*cr7+so,0x10 */ tramp[4] = 0x7d6802a6; /* mflr r11 */ tramp[5] = 0x818b0000; /* lwz r12,0(r11) function address */ tramp[6] = 0x7c0803a6; /* mtlr r0 */ tramp[7] = 0x7d8903a6; /* mtctr r12 */ tramp[8] = 0x816b0004; /* lwz r11,4(r11) static chain */ tramp[9] = 0x4e800420; /* bctr */ tramp[2] = (unsigned long) ffi_closure_ASM; /* function */ tramp[3] = (unsigned long) closure; /* context */ closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* Flush the icache. Only necessary on Darwin. */ flush_range(&closure->tramp[0],FFI_TRAMPOLINE_SIZE); break; case FFI_AIX: tramp_aix = (struct ffi_aix_trampoline_struct *) (closure->tramp); fd = (aix_fd *)(void *)ffi_closure_ASM; FFI_ASSERT (cif->abi == FFI_AIX); tramp_aix->code_pointer = fd->code_pointer; tramp_aix->toc = fd->toc; tramp_aix->static_chain = closure; closure->cif = cif; closure->fun = fun; closure->user_data = user_data; default: FFI_ASSERT(0); break; } return FFI_OK; } static void flush_icache(char *addr) { #ifndef _AIX __asm__ volatile ( "dcbf 0,%0\n" "\tsync\n" "\ticbi 0,%0\n" "\tsync\n" "\tisync" : : "r"(addr) : "memory"); #endif } static void flush_range(char * addr1, int size) { #define MIN_LINE_SIZE 32 int i; for (i = 0; i < size; i += MIN_LINE_SIZE) flush_icache(addr1+i); flush_icache(addr1+size-1); } typedef union { float f; double d; } ffi_dblfl; int ffi_closure_helper_DARWIN (ffi_closure*, void*, unsigned long*, ffi_dblfl*); /* Basically the trampoline invokes ffi_closure_ASM, and on entry, r11 holds the address of the closure. After storing the registers that could possibly contain parameters to be passed into the stack frame and setting up space for a return value, ffi_closure_ASM invokes the following helper function to do most of the work. */ int ffi_closure_helper_DARWIN (ffi_closure* closure, void * rvalue, unsigned long * pgr, ffi_dblfl * pfr) { /* rvalue is the pointer to space for return value in closure assembly pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */ typedef double ldbits[2]; union ldu { ldbits lb; long double ld; }; void ** avalue; ffi_type ** arg_types; long i, avn; long nf; /* number of floating registers already used. */ long ng; /* number of general registers already used. */ ffi_cif * cif; double temp; unsigned size_al; union ldu temp_ld; cif = closure->cif; avalue = alloca(cif->nargs * sizeof(void *)); nf = 0; ng = 0; /* Copy the caller's structure return value address so that the closure returns the data directly to the caller. */ if (cif->rtype->type == FFI_TYPE_STRUCT) { rvalue = (void *) *pgr; pgr++; ng++; } i = 0; avn = cif->nargs; arg_types = cif->arg_types; /* Grab the addresses of the arguments from the stack frame. */ while (i < avn) { switch (arg_types[i]->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = (char *) pgr + 3; ng++; pgr++; break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = (char *) pgr + 2; ng++; pgr++; break; case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_POINTER: avalue[i] = pgr; ng++; pgr++; break; case FFI_TYPE_STRUCT: /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, SI 4 bytes) are aligned as if they were those modes. */ size_al = arg_types[i]->size; /* If the first member of the struct is a double, then align the struct to double-word. Type 3 is defined in include/ffi.h. #define FFI_TYPE_DOUBLE 3. */ if (arg_types[i]->elements[0]->type == 3) size_al = ALIGN(arg_types[i]->size, 8); if (size_al < 3 && cif->abi == FFI_DARWIN) avalue[i] = (void*) pgr + 4 - size_al; else avalue[i] = (void*) pgr; ng += (size_al + 3) / 4; pgr += (size_al + 3) / 4; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: /* Long long ints are passed in two gpr's. */ avalue[i] = pgr; ng += 2; pgr += 2; break; case FFI_TYPE_FLOAT: /* A float value consumes a GPR. There are 13 64bit floating point registers. */ if (nf < NUM_FPR_ARG_REGISTERS) { temp = pfr->d; pfr->f = (float)temp; avalue[i] = pfr; pfr++; } else { avalue[i] = pgr; } nf++; ng++; pgr++; break; case FFI_TYPE_DOUBLE: /* A double value consumes two GPRs. There are 13 64bit floating point registers. */ if (nf < NUM_FPR_ARG_REGISTERS) { avalue[i] = pfr; pfr++; } else { avalue[i] = pgr; } nf++; ng += 2; pgr += 2; break; #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: /* A long double value consumes four GPRs and two FPRs. There are 13 64bit floating point registers. */ if (nf < NUM_FPR_ARG_REGISTERS - 1) { avalue[i] = pfr; pfr += 2; } /* Here we have the situation where one part of the long double is stored in fpr13 and the other part is already on the stack. We use a union to pass the long double to avalue[i]. */ else if (nf == NUM_FPR_ARG_REGISTERS - 1) { memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits)); memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits)); avalue[i] = &temp_ld.ld; } else { avalue[i] = pgr; } nf += 2; ng += 4; pgr += 4; break; #endif default: FFI_ASSERT(0); } i++; } (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_ASM to perform return type promotions. */ return cif->rtype->type; } gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/ffitarget.h0000644000000000000000000000537611237307543020342 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for PowerPC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- System specific configurations ----------------------------------- */ #if defined (POWERPC) && defined (__powerpc64__) #define POWERPC64 #endif #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, #ifdef POWERPC FFI_SYSV, FFI_GCC_SYSV, FFI_LINUX64, # ifdef POWERPC64 FFI_DEFAULT_ABI = FFI_LINUX64, # else FFI_DEFAULT_ABI = FFI_GCC_SYSV, # endif #endif #ifdef POWERPC_AIX FFI_AIX, FFI_DARWIN, FFI_DEFAULT_ABI = FFI_AIX, #endif #ifdef POWERPC_DARWIN FFI_AIX, FFI_DARWIN, FFI_DEFAULT_ABI = FFI_DARWIN, #endif #ifdef POWERPC_FREEBSD FFI_SYSV, FFI_GCC_SYSV, FFI_LINUX64, FFI_DEFAULT_ABI = FFI_SYSV, #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_NATIVE_RAW_API 0 /* Needed for FFI_SYSV small structure returns. */ #define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST) #if defined(POWERPC64) || defined(POWERPC_AIX) #define FFI_TRAMPOLINE_SIZE 24 #else /* POWERPC || POWERPC_AIX */ #define FFI_TRAMPOLINE_SIZE 40 #endif #ifndef LIBFFI_ASM #if defined(POWERPC_DARWIN) || defined(POWERPC_AIX) struct ffi_aix_trampoline_struct { void * code_pointer; /* Pointer to ffi_closure_ASM */ void * toc; /* TOC */ void * static_chain; /* Pointer to closure */ }; #endif #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/linux64.S0000644000000000000000000001120711237307543017641 0ustar /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 2003 Jakub Jelinek PowerPC64 Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef __powerpc64__ .hidden ffi_call_LINUX64, .ffi_call_LINUX64 .globl ffi_call_LINUX64, .ffi_call_LINUX64 .section ".opd","aw" .align 3 ffi_call_LINUX64: .quad .ffi_call_LINUX64,.TOC.@tocbase,0 .size ffi_call_LINUX64,24 .type .ffi_call_LINUX64,@function .text .ffi_call_LINUX64: .LFB1: mflr %r0 std %r28, -32(%r1) std %r29, -24(%r1) std %r30, -16(%r1) std %r31, -8(%r1) std %r0, 16(%r1) mr %r28, %r1 /* our AP. */ stdux %r1, %r1, %r4 .LCFI0: mr %r31, %r5 /* flags, */ mr %r30, %r6 /* rvalue, */ mr %r29, %r7 /* function address. */ std %r2, 40(%r1) /* Call ffi_prep_args64. */ mr %r4, %r1 bl .ffi_prep_args64 ld %r0, 0(%r29) ld %r2, 8(%r29) ld %r11, 16(%r29) /* Now do the call. */ /* Set up cr1 with bits 4-7 of the flags. */ mtcrf 0x40, %r31 /* Get the address to call into CTR. */ mtctr %r0 /* Load all those argument registers. */ ld %r3, -32-(8*8)(%r28) ld %r4, -32-(7*8)(%r28) ld %r5, -32-(6*8)(%r28) ld %r6, -32-(5*8)(%r28) bf- 5, 1f ld %r7, -32-(4*8)(%r28) ld %r8, -32-(3*8)(%r28) ld %r9, -32-(2*8)(%r28) ld %r10, -32-(1*8)(%r28) 1: /* Load all the FP registers. */ bf- 6, 2f lfd %f1, -32-(21*8)(%r28) lfd %f2, -32-(20*8)(%r28) lfd %f3, -32-(19*8)(%r28) lfd %f4, -32-(18*8)(%r28) lfd %f5, -32-(17*8)(%r28) lfd %f6, -32-(16*8)(%r28) lfd %f7, -32-(15*8)(%r28) lfd %f8, -32-(14*8)(%r28) lfd %f9, -32-(13*8)(%r28) lfd %f10, -32-(12*8)(%r28) lfd %f11, -32-(11*8)(%r28) lfd %f12, -32-(10*8)(%r28) lfd %f13, -32-(9*8)(%r28) 2: /* Make the call. */ bctrl /* Now, deal with the return value. */ mtcrf 0x01, %r31 bt- 30, .Ldone_return_value bt- 29, .Lfp_return_value std %r3, 0(%r30) /* Fall through... */ .Ldone_return_value: /* Restore the registers we used and return. */ ld %r2, 40(%r1) mr %r1, %r28 ld %r0, 16(%r28) ld %r28, -32(%r1) mtlr %r0 ld %r29, -24(%r1) ld %r30, -16(%r1) ld %r31, -8(%r1) blr .Lfp_return_value: bt 27, .Lfd_return_value bf 28, .Lfloat_return_value stfd %f1, 0(%r30) b .Ldone_return_value .Lfd_return_value: stfd %f1, 0(%r30) stfd %f2, 8(%r30) b .Ldone_return_value .Lfloat_return_value: stfs %f1, 0(%r30) b .Ldone_return_value .LFE1: .long 0 .byte 0,12,0,1,128,4,0,0 .size .ffi_call_LINUX64,.-.ffi_call_LINUX64 .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry .LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .uleb128 0x1 # CIE Code Alignment Factor .sleb128 -8 # CIE Data Alignment Factor .byte 0x41 # CIE RA Column .uleb128 0x1 # Augmentation size .byte 0x14 # FDE Encoding (pcrel udata8) .byte 0xc # DW_CFA_def_cfa .uleb128 0x1 .uleb128 0x0 .align 3 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 # FDE Length .LASFDE1: .4byte .LASFDE1-.Lframe1 # FDE CIE offset .8byte .LFB1-. # FDE initial location .8byte .LFE1-.LFB1 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x2 # DW_CFA_advance_loc1 .byte .LCFI0-.LFB1 .byte 0xd # DW_CFA_def_cfa_register .uleb128 0x1c .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x41 .sleb128 -2 .byte 0x9f # DW_CFA_offset, column 0x1f .uleb128 0x1 .byte 0x9e # DW_CFA_offset, column 0x1e .uleb128 0x2 .byte 0x9d # DW_CFA_offset, column 0x1d .uleb128 0x3 .byte 0x9c # DW_CFA_offset, column 0x1c .uleb128 0x4 .align 3 .LEFDE1: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/linux64_closure.S0000644000000000000000000001052711237307543021401 0ustar #define LIBFFI_ASM #include #include .file "linux64_closure.S" #ifdef __powerpc64__ FFI_HIDDEN (ffi_closure_LINUX64) FFI_HIDDEN (.ffi_closure_LINUX64) .globl ffi_closure_LINUX64, .ffi_closure_LINUX64 .section ".opd","aw" .align 3 ffi_closure_LINUX64: .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 .size ffi_closure_LINUX64,24 .type .ffi_closure_LINUX64,@function .text .ffi_closure_LINUX64: .LFB1: # save general regs into parm save area std %r3, 48(%r1) std %r4, 56(%r1) std %r5, 64(%r1) std %r6, 72(%r1) mflr %r0 std %r7, 80(%r1) std %r8, 88(%r1) std %r9, 96(%r1) std %r10, 104(%r1) std %r0, 16(%r1) # mandatory 48 bytes special reg save area + 64 bytes parm save area # + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 stdu %r1, -240(%r1) .LCFI0: # next save fpr 1 to fpr 13 stfd %f1, 128+(0*8)(%r1) stfd %f2, 128+(1*8)(%r1) stfd %f3, 128+(2*8)(%r1) stfd %f4, 128+(3*8)(%r1) stfd %f5, 128+(4*8)(%r1) stfd %f6, 128+(5*8)(%r1) stfd %f7, 128+(6*8)(%r1) stfd %f8, 128+(7*8)(%r1) stfd %f9, 128+(8*8)(%r1) stfd %f10, 128+(9*8)(%r1) stfd %f11, 128+(10*8)(%r1) stfd %f12, 128+(11*8)(%r1) stfd %f13, 128+(12*8)(%r1) # set up registers for the routine that actually does the work # get the context pointer from the trampoline mr %r3, %r11 # now load up the pointer to the result storage addi %r4, %r1, 112 # now load up the pointer to the parameter save area # in the previous frame addi %r5, %r1, 240 + 48 # now load up the pointer to the saved fpr registers */ addi %r6, %r1, 128 # make the call bl .ffi_closure_helper_LINUX64 .Lret: # now r3 contains the return type # so use it to look up in a table # so we know how to deal with each type # look up the proper starting point in table # by using return type as offset mflr %r4 # move address of .Lret to r4 sldi %r3, %r3, 4 # now multiply return type by 16 addi %r4, %r4, .Lret_type0 - .Lret ld %r0, 240+16(%r1) add %r3, %r3, %r4 # add contents of table to table address mtctr %r3 bctr # jump to it # Each of the ret_typeX code fragments has to be exactly 16 bytes long # (4 instructions). For cache effectiveness we align to a 16 byte boundary # first. .align 4 .Lret_type0: # case FFI_TYPE_VOID mtlr %r0 addi %r1, %r1, 240 blr nop # case FFI_TYPE_INT lwa %r3, 112+4(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_FLOAT lfs %f1, 112+0(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_DOUBLE lfd %f1, 112+0(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_LONGDOUBLE lfd %f1, 112+0(%r1) mtlr %r0 lfd %f2, 112+8(%r1) b .Lfinish # case FFI_TYPE_UINT8 lbz %r3, 112+7(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_SINT8 lbz %r3, 112+7(%r1) extsb %r3,%r3 mtlr %r0 b .Lfinish # case FFI_TYPE_UINT16 lhz %r3, 112+6(%r1) mtlr %r0 .Lfinish: addi %r1, %r1, 240 blr # case FFI_TYPE_SINT16 lha %r3, 112+6(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_UINT32 lwz %r3, 112+4(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_SINT32 lwa %r3, 112+4(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_UINT64 ld %r3, 112+0(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_SINT64 ld %r3, 112+0(%r1) mtlr %r0 addi %r1, %r1, 240 blr # case FFI_TYPE_STRUCT mtlr %r0 addi %r1, %r1, 240 blr nop # case FFI_TYPE_POINTER ld %r3, 112+0(%r1) mtlr %r0 addi %r1, %r1, 240 blr # esac .LFE1: .long 0 .byte 0,12,0,1,128,0,0,0 .size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64 .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry .LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .uleb128 0x1 # CIE Code Alignment Factor .sleb128 -8 # CIE Data Alignment Factor .byte 0x41 # CIE RA Column .uleb128 0x1 # Augmentation size .byte 0x14 # FDE Encoding (pcrel udata8) .byte 0xc # DW_CFA_def_cfa .uleb128 0x1 .uleb128 0x0 .align 3 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 # FDE Length .LASFDE1: .4byte .LASFDE1-.Lframe1 # FDE CIE offset .8byte .LFB1-. # FDE initial location .8byte .LFE1-.LFB1 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x2 # DW_CFA_advance_loc1 .byte .LCFI0-.LFB1 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 240 .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x41 .sleb128 -2 .align 3 .LEFDE1: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/ppc_closure.S0000644000000000000000000001327311237307543020653 0ustar #define LIBFFI_ASM #include #include #include .file "ppc_closure.S" #ifndef __powerpc64__ ENTRY(ffi_closure_SYSV) .LFB1: stwu %r1,-144(%r1) .LCFI0: mflr %r0 .LCFI1: stw %r0,148(%r1) # we want to build up an areas for the parameters passed # in registers (both floating point and integer) # so first save gpr 3 to gpr 10 (aligned to 4) stw %r3, 16(%r1) stw %r4, 20(%r1) stw %r5, 24(%r1) stw %r6, 28(%r1) stw %r7, 32(%r1) stw %r8, 36(%r1) stw %r9, 40(%r1) stw %r10,44(%r1) # next save fpr 1 to fpr 8 (aligned to 8) stfd %f1, 48(%r1) stfd %f2, 56(%r1) stfd %f3, 64(%r1) stfd %f4, 72(%r1) stfd %f5, 80(%r1) stfd %f6, 88(%r1) stfd %f7, 96(%r1) stfd %f8, 104(%r1) # set up registers for the routine that actually does the work # get the context pointer from the trampoline mr %r3,%r11 # now load up the pointer to the result storage addi %r4,%r1,112 # now load up the pointer to the saved gpr registers addi %r5,%r1,16 # now load up the pointer to the saved fpr registers */ addi %r6,%r1,48 # now load up the pointer to the outgoing parameter # stack in the previous frame # i.e. the previous frame pointer + 8 addi %r7,%r1,152 # make the call bl ffi_closure_helper_SYSV@local # now r3 contains the return type # so use it to look up in a table # so we know how to deal with each type # look up the proper starting point in table # by using return type as offset addi %r6,%r1,112 # get pointer to results area bl .Lget_ret_type0_addr # get pointer to .Lret_type0 into LR mflr %r4 # move to r4 slwi %r3,%r3,4 # now multiply return type by 16 add %r3,%r3,%r4 # add contents of table to table address mtctr %r3 bctr # jump to it .LFE1: # Each of the ret_typeX code fragments has to be exactly 16 bytes long # (4 instructions). For cache effectiveness we align to a 16 byte boundary # first. .align 4 nop nop nop .Lget_ret_type0_addr: blrl # case FFI_TYPE_VOID .Lret_type0: b .Lfinish nop nop nop # case FFI_TYPE_INT .Lret_type1: lwz %r3,0(%r6) b .Lfinish nop nop # case FFI_TYPE_FLOAT .Lret_type2: lfs %f1,0(%r6) b .Lfinish nop nop # case FFI_TYPE_DOUBLE .Lret_type3: lfd %f1,0(%r6) b .Lfinish nop nop # case FFI_TYPE_LONGDOUBLE .Lret_type4: lfd %f1,0(%r6) b .Lfinish nop nop # case FFI_TYPE_UINT8 .Lret_type5: lbz %r3,3(%r6) b .Lfinish nop nop # case FFI_TYPE_SINT8 .Lret_type6: lbz %r3,3(%r6) extsb %r3,%r3 b .Lfinish nop # case FFI_TYPE_UINT16 .Lret_type7: lhz %r3,2(%r6) b .Lfinish nop nop # case FFI_TYPE_SINT16 .Lret_type8: lha %r3,2(%r6) b .Lfinish nop nop # case FFI_TYPE_UINT32 .Lret_type9: lwz %r3,0(%r6) b .Lfinish nop nop # case FFI_TYPE_SINT32 .Lret_type10: lwz %r3,0(%r6) b .Lfinish nop nop # case FFI_TYPE_UINT64 .Lret_type11: lwz %r3,0(%r6) lwz %r4,4(%r6) b .Lfinish nop # case FFI_TYPE_SINT64 .Lret_type12: lwz %r3,0(%r6) lwz %r4,4(%r6) b .Lfinish nop # case FFI_TYPE_STRUCT .Lret_type13: b .Lfinish nop nop nop # case FFI_TYPE_POINTER .Lret_type14: lwz %r3,0(%r6) b .Lfinish nop nop # The return types below are only used when the ABI type is FFI_SYSV. # case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct. .Lret_type15: # fall through. lbz %r3,0(%r6) b .Lfinish nop nop # case FFI_SYSV_TYPE_SMALL_STRUCT + 2. Two byte struct. .Lret_type16: # fall through. lhz %r3,0(%r6) b .Lfinish nop nop # case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct. .Lret_type17: # fall through. lwz %r3,0(%r6) srwi %r3,%r3,8 b .Lfinish nop # case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct. .Lret_type18: # this one handles the structs from above too. lwz %r3,0(%r6) b .Lfinish nop nop # case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct. .Lret_type19: # fall through. lwz %r3,0(%r6) lwz %r4,4(%r6) li %r5,24 b .Lstruct567 # case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct. .Lret_type20: # fall through. lwz %r3,0(%r6) lwz %r4,4(%r6) li %r5,16 b .Lstruct567 # case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct. .Lret_type21: # fall through. lwz %r3,0(%r6) lwz %r4,4(%r6) li %r5,8 b .Lstruct567 # case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct. .Lret_type22: # this one handles the above unhandled structs. lwz %r3,0(%r6) lwz %r4,4(%r6) b .Lfinish nop # case done .Lfinish: lwz %r0,148(%r1) mtlr %r0 addi %r1,%r1,144 blr .Lstruct567: subfic %r0,%r5,32 srw %r4,%r4,%r5 slw %r0,%r3,%r0 srw %r3,%r3,%r5 or %r4,%r0,%r4 b .Lfinish END(ffi_closure_SYSV) .section ".eh_frame",EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry .LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version #if defined _RELOCATABLE || defined __PIC__ .ascii "zR\0" # CIE Augmentation #else .ascii "\0" # CIE Augmentation #endif .uleb128 0x1 # CIE Code Alignment Factor .sleb128 -4 # CIE Data Alignment Factor .byte 0x41 # CIE RA Column #if defined _RELOCATABLE || defined __PIC__ .uleb128 0x1 # Augmentation size .byte 0x1b # FDE Encoding (pcrel sdata4) #endif .byte 0xc # DW_CFA_def_cfa .uleb128 0x1 .uleb128 0x0 .align 2 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 # FDE Length .LASFDE1: .4byte .LASFDE1-.Lframe1 # FDE CIE offset #if defined _RELOCATABLE || defined __PIC__ .4byte .LFB1-. # FDE initial location #else .4byte .LFB1 # FDE initial location #endif .4byte .LFE1-.LFB1 # FDE address range #if defined _RELOCATABLE || defined __PIC__ .uleb128 0x0 # Augmentation size #endif .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI0-.LFB1 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 144 .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI1-.LCFI0 .byte 0x11 # DW_CFA_offset_extended_sf .uleb128 0x41 .sleb128 -1 .align 2 .LEFDE1: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/powerpc/sysv.S0000644000000000000000000001366711237307543017350 0ustar /* ----------------------------------------------------------------------- sysv.h - Copyright (c) 1998 Geoffrey Keating PowerPC Assembly glue. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #include #ifndef __powerpc64__ .globl ffi_prep_args_SYSV ENTRY(ffi_call_SYSV) .LFB1: /* Save the old stack pointer as AP. */ mr %r8,%r1 .LCFI0: /* Allocate the stack space we need. */ stwux %r1,%r1,%r4 /* Save registers we use. */ mflr %r9 stw %r28,-16(%r8) .LCFI1: stw %r29,-12(%r8) .LCFI2: stw %r30, -8(%r8) .LCFI3: stw %r31, -4(%r8) .LCFI4: stw %r9, 4(%r8) .LCFI5: /* Save arguments over call... */ mr %r31,%r5 /* flags, */ mr %r30,%r6 /* rvalue, */ mr %r29,%r7 /* function address, */ mr %r28,%r8 /* our AP. */ .LCFI6: /* Call ffi_prep_args_SYSV. */ mr %r4,%r1 bl ffi_prep_args_SYSV@local /* Now do the call. */ /* Set up cr1 with bits 4-7 of the flags. */ mtcrf 0x40,%r31 /* Get the address to call into CTR. */ mtctr %r29 /* Load all those argument registers. */ lwz %r3,-16-(8*4)(%r28) lwz %r4,-16-(7*4)(%r28) lwz %r5,-16-(6*4)(%r28) lwz %r6,-16-(5*4)(%r28) bf- 5,1f nop lwz %r7,-16-(4*4)(%r28) lwz %r8,-16-(3*4)(%r28) lwz %r9,-16-(2*4)(%r28) lwz %r10,-16-(1*4)(%r28) nop 1: /* Load all the FP registers. */ bf- 6,2f lfd %f1,-16-(8*4)-(8*8)(%r28) lfd %f2,-16-(8*4)-(7*8)(%r28) lfd %f3,-16-(8*4)-(6*8)(%r28) lfd %f4,-16-(8*4)-(5*8)(%r28) nop lfd %f5,-16-(8*4)-(4*8)(%r28) lfd %f6,-16-(8*4)-(3*8)(%r28) lfd %f7,-16-(8*4)-(2*8)(%r28) lfd %f8,-16-(8*4)-(1*8)(%r28) 2: /* Make the call. */ bctrl /* Now, deal with the return value. */ mtcrf 0x01,%r31 bt- 31,L(small_struct_return_value) bt- 30,L(done_return_value) bt- 29,L(fp_return_value) stw %r3,0(%r30) bf+ 28,L(done_return_value) stw %r4,4(%r30) /* Fall through... */ L(done_return_value): /* Restore the registers we used and return. */ lwz %r9, 4(%r28) lwz %r31, -4(%r28) mtlr %r9 lwz %r30, -8(%r28) lwz %r29,-12(%r28) lwz %r28,-16(%r28) lwz %r1,0(%r1) blr L(fp_return_value): bf 28,L(float_return_value) stfd %f1,0(%r30) b L(done_return_value) L(float_return_value): stfs %f1,0(%r30) b L(done_return_value) L(small_struct_return_value): mtcrf 0x10,%r31 /* cr3 */ bt- 15,L(smst_one_register) mtcrf 0x08,%r31 /* cr4 */ bt- 16,L(smst_two_register) b L(done_return_value) L(smst_one_register): rlwinm %r5,%r31,5+23,32-5,31 /* Extract the value to shift. */ slw %r3,%r3,%r5 stw %r3,0(%r30) b L(done_return_value) L(smst_two_register): rlwinm %r5,%r31,5+23,32-5,31 /* Extract the value to shift. */ cmpwi %r5,0 subfic %r9,%r5,32 slw %r29,%r3,%r5 srw %r9,%r4,%r9 beq- L(smst_8byte) or %r3,%r9,%r29 slw %r4,%r4,%r5 L(smst_8byte): stw %r3,0(%r30) stw %r4,4(%r30) b L(done_return_value) .LFE1: END(ffi_call_SYSV) .section ".eh_frame",EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ .LSCIE1: .4byte 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ #if defined _RELOCATABLE || defined __PIC__ .ascii "zR\0" /* CIE Augmentation */ #else .ascii "\0" /* CIE Augmentation */ #endif .uleb128 0x1 /* CIE Code Alignment Factor */ .sleb128 -4 /* CIE Data Alignment Factor */ .byte 0x41 /* CIE RA Column */ #if defined _RELOCATABLE || defined __PIC__ .uleb128 0x1 /* Augmentation size */ .byte 0x1b /* FDE Encoding (pcrel sdata4) */ #endif .byte 0xc /* DW_CFA_def_cfa */ .uleb128 0x1 .uleb128 0x0 .align 2 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 /* FDE Length */ .LASFDE1: .4byte .LASFDE1-.Lframe1 /* FDE CIE offset */ #if defined _RELOCATABLE || defined __PIC__ .4byte .LFB1-. /* FDE initial location */ #else .4byte .LFB1 /* FDE initial location */ #endif .4byte .LFE1-.LFB1 /* FDE address range */ #if defined _RELOCATABLE || defined __PIC__ .uleb128 0x0 /* Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI0-.LFB1 .byte 0xd /* DW_CFA_def_cfa_register */ .uleb128 0x08 .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI5-.LCFI0 .byte 0x11 /* DW_CFA_offset_extended_sf */ .uleb128 0x41 .sleb128 -1 .byte 0x9f /* DW_CFA_offset, column 0x1f */ .uleb128 0x1 .byte 0x9e /* DW_CFA_offset, column 0x1e */ .uleb128 0x2 .byte 0x9d /* DW_CFA_offset, column 0x1d */ .uleb128 0x3 .byte 0x9c /* DW_CFA_offset, column 0x1c */ .uleb128 0x4 .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI6-.LCFI5 .byte 0xd /* DW_CFA_def_cfa_register */ .uleb128 0x1c .align 2 .LEFDE1: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/prep_cif.c0000644000000000000000000001670511237307543016470 0ustar /* ----------------------------------------------------------------------- prep_cif.c - Copyright (c) 1996, 1998 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include /* Round up to FFI_SIZEOF_ARG. */ #define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG) /* Perform machine independent initialization of aggregate type specifications. */ static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg) { ffi_type **ptr; FFI_ASSERT(arg != NULL); /*@-usedef@*/ FFI_ASSERT(arg->elements != NULL); FFI_ASSERT(arg->size == 0); FFI_ASSERT(arg->alignment == 0); ptr = &(arg->elements[0]); while ((*ptr) != NULL) { if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; /* Perform a sanity check on the argument type */ FFI_ASSERT_VALID_TYPE(*ptr); arg->size = ALIGN(arg->size, (*ptr)->alignment); arg->size += (*ptr)->size; arg->alignment = (arg->alignment > (*ptr)->alignment) ? arg->alignment : (*ptr)->alignment; ptr++; } /* Structure size includes tail padding. This is important for structures that fit in one register on ABIs like the PowerPC64 Linux ABI that right justify small structs in a register. It's also needed for nested structure layout, for example struct A { long a; char b; }; struct B { struct A x; char y; }; should find y at an offset of 2*sizeof(long) and result in a total size of 3*sizeof(long). */ arg->size = ALIGN (arg->size, arg->alignment); if (arg->size == 0) return FFI_BAD_TYPEDEF; else return FFI_OK; /*@=usedef@*/ } #if defined X86_WIN32 || defined X86_DARWIN || defined X86_FREEBSD static int is_result_on_stack_sub(ffi_type *rtype) { ffi_type *elem; int i; for (i = 0; rtype->elements[i] != NULL; ++i) { ffi_type *elem = rtype->elements[i]; if (elem->type == FFI_TYPE_STRUCT) { if (is_result_on_stack_sub(elem)) return 1; } else { int size = 0; switch (elem->type) { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: size = ffi_type_uint8.size; break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: size = ffi_type_sint16.size; break; case FFI_TYPE_INT: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: size = ffi_type_uint32.size; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: size = ffi_type_uint64.size; break; case FFI_TYPE_POINTER: size = ffi_type_pointer.size; break; case FFI_TYPE_FLOAT: size = ffi_type_float.size; break; case FFI_TYPE_DOUBLE: size = ffi_type_double.size; break; case FFI_TYPE_LONGDOUBLE: size = ffi_type_longdouble.size; break; } if (size < elem->size) return 1; } } return 0; } static int is_result_on_stack(ffi_type *rtype) { if (rtype->size > 8) return 1; if (rtype->type == FFI_TYPE_STRUCT) return is_result_on_stack_sub(rtype); else return 0; } #endif #ifndef __CRIS__ /* The CRIS ABI specifies structure elements to have byte alignment only, so it completely overrides this functions, which assumes "natural" alignment and padding. */ /* Perform machine independent ffi_cif preparation, then call machine dependent routine. */ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, ffi_abi abi, unsigned int nargs, /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, /*@dependent@*/ ffi_type **atypes) { unsigned bytes = 0; unsigned int i; ffi_type **ptr; FFI_ASSERT(cif != NULL); FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI)); cif->abi = abi; cif->arg_types = atypes; cif->nargs = nargs; cif->rtype = rtype; cif->flags = 0; /* Initialize the return type if necessary */ /*@-usedef@*/ if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK)) return FFI_BAD_TYPEDEF; /*@=usedef@*/ /* Perform a sanity check on the return type */ FFI_ASSERT_VALID_TYPE(cif->rtype); /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ #if !defined M68K && !defined __x86_64__ && !defined S390 && !defined PA /* Make space for the return structure pointer */ if (cif->rtype->type == FFI_TYPE_STRUCT #ifdef SPARC && (cif->abi != FFI_V9 || cif->rtype->size > 32) #elif defined X86_WIN32 || defined X86_DARWIN || defined X86_FREEBSD && is_result_on_stack(cif->rtype) #endif ) bytes = STACK_ARG_SIZE(sizeof(void*)); #endif for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { /* Initialize any uninitialized aggregate type definitions */ if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; /* Perform a sanity check on the argument type, do this check after the initialization. */ FFI_ASSERT_VALID_TYPE(*ptr); #if !defined __x86_64__ && !defined S390 && !defined PA && !defined X86_DARWIN && !defined X86_FREEBSD && !defined X86_WIN32 #ifdef SPARC if (((*ptr)->type == FFI_TYPE_STRUCT && ((*ptr)->size > 16 || cif->abi != FFI_V9)) || ((*ptr)->type == FFI_TYPE_LONGDOUBLE && cif->abi != FFI_V9)) bytes += sizeof(void*); else #endif { /* Add any padding if necessary */ if (((*ptr)->alignment - 1) & bytes) bytes = ALIGN(bytes, (*ptr)->alignment); bytes += STACK_ARG_SIZE((*ptr)->size); } #else { int align = (*ptr)->alignment; if (align < 4) align = 4; if ((align - 1) & bytes) bytes = ALIGN(bytes, align); bytes += STACK_ARG_SIZE((*ptr)->size); } #endif } #if defined X86_WIN32 || defined X86_DARWIN || defined X86_FREEBSD cif->bytes = ((bytes + 15) & ~0xf) + 8; if (is_result_on_stack(cif->rtype)) { cif->flags = FFI_TYPE_STRUCT; } else { cif->flags = FFI_TYPE_SINT64; /* same as int64 type */ } #else cif->bytes = bytes; #endif /* Perform machine dependent cif processing */ return ffi_prep_cif_machdep(cif); } #endif /* not __CRIS__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/raw_api.c0000644000000000000000000001327211237307543016317 0ustar /* ----------------------------------------------------------------------- raw_api.c - Copyright (c) 1999 Red Hat, Inc. Author: Kresten Krab Thorup $Id $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ /* This file defines generic functions for use with the raw api. */ #include #include #if !FFI_NO_RAW_API size_t ffi_raw_size (ffi_cif *cif) { size_t result = 0; int i; ffi_type **at = cif->arg_types; for (i = cif->nargs-1; i >= 0; i--, at++) { #if !FFI_NO_STRUCTS if ((*at)->type == FFI_TYPE_STRUCT) result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG); else #endif result += ALIGN ((*at)->size, FFI_SIZEOF_ARG); } return result; } void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) { unsigned i; ffi_type **tp = cif->arg_types; #if WORDS_BIGENDIAN for (i = 0; i < cif->nargs; i++, tp++, args++) { switch ((*tp)->type) { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1); break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2); break; #if FFI_SIZEOF_ARG >= 4 case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4); break; #endif #if !FFI_NO_STRUCTS case FFI_TYPE_STRUCT: *args = (raw++)->ptr; break; #endif case FFI_TYPE_POINTER: *args = (void*) &(raw++)->ptr; break; default: *args = raw; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } #else /* WORDS_BIGENDIAN */ #if !PDP /* then assume little endian */ for (i = 0; i < cif->nargs; i++, tp++, args++) { #if !FFI_NO_STRUCTS if ((*tp)->type == FFI_TYPE_STRUCT) { *args = (raw++)->ptr; } else #endif { *args = (void*) raw; raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); } } #else #error "pdp endian not supported" #endif /* ! PDP */ #endif /* WORDS_BIGENDIAN */ } void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) { unsigned i; ffi_type **tp = cif->arg_types; for (i = 0; i < cif->nargs; i++, tp++, args++) { switch ((*tp)->type) { case FFI_TYPE_UINT8: (raw++)->uint = *(UINT8*) (*args); break; case FFI_TYPE_SINT8: (raw++)->sint = *(SINT8*) (*args); break; case FFI_TYPE_UINT16: (raw++)->uint = *(UINT16*) (*args); break; case FFI_TYPE_SINT16: (raw++)->sint = *(SINT16*) (*args); break; #if FFI_SIZEOF_ARG >= 4 case FFI_TYPE_UINT32: (raw++)->uint = *(UINT32*) (*args); break; case FFI_TYPE_SINT32: (raw++)->sint = *(SINT32*) (*args); break; #endif #if !FFI_NO_STRUCTS case FFI_TYPE_STRUCT: (raw++)->ptr = *args; break; #endif case FFI_TYPE_POINTER: (raw++)->ptr = **(void***) args; break; default: memcpy ((void*) raw->data, (void*)*args, (*tp)->size); raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } } #if !FFI_NATIVE_RAW_API /* This is a generic definition of ffi_raw_call, to be used if the * native system does not provide a machine-specific implementation. * Having this, allows code to be written for the raw API, without * the need for system-specific code to handle input in that format; * these following couple of functions will handle the translation forth * and back automatically. */ void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ ffi_raw *raw) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ffi_raw_to_ptrarray (cif, raw, avalue); ffi_call (cif, fn, rvalue, avalue); } #if FFI_CLOSURES /* base system provides closures */ static void ffi_translate_args (ffi_cif *cif, void *rvalue, void **avalue, void *user_data) { ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif)); ffi_raw_closure *cl = (ffi_raw_closure*)user_data; ffi_ptrarray_to_raw (cif, avalue, raw); (*cl->fun) (cif, rvalue, raw, cl->user_data); } /* Again, here is the generic version of ffi_prep_raw_closure, which * will install an intermediate "hub" for translation of arguments from * the pointer-array format, to the raw format */ ffi_status ffi_prep_raw_closure (ffi_raw_closure* cl, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data) { ffi_status status; status = ffi_prep_closure ((ffi_closure*) cl, cif, &ffi_translate_args, (void*)cl); if (status == FFI_OK) { cl->fun = fun; cl->user_data = user_data; } return status; } #endif /* FFI_CLOSURES */ #endif /* !FFI_NATIVE_RAW_API */ #endif /* !FFI_NO_RAW_API */ gauche-c-wrapper-0.6.1.orig/libffi/src/s390/0002755000000000000000000000000011237307543015224 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/s390/ffi.c0000644000000000000000000005313511237307543016141 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2000 Software AG S390 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ /*====================================================================*/ /* Includes */ /* -------- */ /*====================================================================*/ #include #include #include #include /*====================== End of Includes =============================*/ /*====================================================================*/ /* Defines */ /* ------- */ /*====================================================================*/ /* Maximum number of GPRs available for argument passing. */ #define MAX_GPRARGS 5 /* Maximum number of FPRs available for argument passing. */ #ifdef __s390x__ #define MAX_FPRARGS 4 #else #define MAX_FPRARGS 2 #endif /* Round to multiple of 16. */ #define ROUND_SIZE(size) (((size) + 15) & ~15) /* If these values change, sysv.S must be adapted! */ #define FFI390_RET_VOID 0 #define FFI390_RET_STRUCT 1 #define FFI390_RET_FLOAT 2 #define FFI390_RET_DOUBLE 3 #define FFI390_RET_INT32 4 #define FFI390_RET_INT64 5 /*===================== End of Defines ===============================*/ /*====================================================================*/ /* Prototypes */ /* ---------- */ /*====================================================================*/ static void ffi_prep_args (unsigned char *, extended_cif *); void #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) __attribute__ ((visibility ("hidden"))) #endif ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, unsigned long long *, unsigned long *); /*====================== End of Prototypes ===========================*/ /*====================================================================*/ /* Externals */ /* --------- */ /*====================================================================*/ extern void ffi_call_SYSV(unsigned, extended_cif *, void (*)(unsigned char *, extended_cif *), unsigned, void *, void (*fn)()); extern void ffi_closure_SYSV(void); /*====================== End of Externals ============================*/ /*====================================================================*/ /* */ /* Name - ffi_check_struct_type. */ /* */ /* Function - Determine if a structure can be passed within a */ /* general purpose or floating point register. */ /* */ /*====================================================================*/ static int ffi_check_struct_type (ffi_type *arg) { size_t size = arg->size; /* If the struct has just one element, look at that element to find out whether to consider the struct as floating point. */ while (arg->type == FFI_TYPE_STRUCT && arg->elements[0] && !arg->elements[1]) arg = arg->elements[0]; /* Structs of size 1, 2, 4, and 8 are passed in registers, just like the corresponding int/float types. */ switch (size) { case 1: return FFI_TYPE_UINT8; case 2: return FFI_TYPE_UINT16; case 4: if (arg->type == FFI_TYPE_FLOAT) return FFI_TYPE_FLOAT; else return FFI_TYPE_UINT32; case 8: if (arg->type == FFI_TYPE_DOUBLE) return FFI_TYPE_DOUBLE; else return FFI_TYPE_UINT64; default: break; } /* Other structs are passed via a pointer to the data. */ return FFI_TYPE_POINTER; } /*======================== End of Routine ============================*/ /*====================================================================*/ /* */ /* Name - ffi_prep_args. */ /* */ /* Function - Prepare parameters for call to function. */ /* */ /* ffi_prep_args is called by the assembly routine once stack space */ /* has been allocated for the function's arguments. */ /* */ /*====================================================================*/ static void ffi_prep_args (unsigned char *stack, extended_cif *ecif) { /* The stack space will be filled with those areas: FPR argument register save area (highest addresses) GPR argument register save area temporary struct copies overflow argument area (lowest addresses) We set up the following pointers: p_fpr: bottom of the FPR area (growing upwards) p_gpr: bottom of the GPR area (growing upwards) p_ov: bottom of the overflow area (growing upwards) p_struct: top of the struct copy area (growing downwards) All areas are kept aligned to twice the word size. */ int gpr_off = ecif->cif->bytes; int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); unsigned char *p_struct = (unsigned char *)p_gpr; unsigned long *p_ov = (unsigned long *)stack; int n_fpr = 0; int n_gpr = 0; int n_ov = 0; ffi_type **ptr; void **p_argv = ecif->avalue; int i; /* If we returning a structure then we set the first parameter register to the address of where we are returning this structure. */ if (ecif->cif->flags == FFI390_RET_STRUCT) p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; /* Now for the arguments. */ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; i > 0; i--, ptr++, p_argv++) { void *arg = *p_argv; int type = (*ptr)->type; /* Check how a structure type is passed. */ if (type == FFI_TYPE_STRUCT) { type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, copy the data. */ if (type == FFI_TYPE_POINTER) { p_struct -= ROUND_SIZE ((*ptr)->size); memcpy (p_struct, (char *)arg, (*ptr)->size); arg = &p_struct; } } /* Now handle all primitive int/pointer/float data types. */ switch (type) { case FFI_TYPE_DOUBLE: if (n_fpr < MAX_FPRARGS) p_fpr[n_fpr++] = *(unsigned long long *) arg; else #ifdef __s390x__ p_ov[n_ov++] = *(unsigned long *) arg; #else p_ov[n_ov++] = ((unsigned long *) arg)[0], p_ov[n_ov++] = ((unsigned long *) arg)[1]; #endif break; case FFI_TYPE_FLOAT: if (n_fpr < MAX_FPRARGS) p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; else p_ov[n_ov++] = *(unsigned int *) arg; break; case FFI_TYPE_POINTER: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = (unsigned long)*(unsigned char **) arg; else p_ov[n_ov++] = (unsigned long)*(unsigned char **) arg; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: #ifdef __s390x__ if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(unsigned long *) arg; else p_ov[n_ov++] = *(unsigned long *) arg; #else if (n_gpr == MAX_GPRARGS-1) n_gpr = MAX_GPRARGS; if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = ((unsigned long *) arg)[0], p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; else p_ov[n_ov++] = ((unsigned long *) arg)[0], p_ov[n_ov++] = ((unsigned long *) arg)[1]; #endif break; case FFI_TYPE_UINT32: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(unsigned int *) arg; else p_ov[n_ov++] = *(unsigned int *) arg; break; case FFI_TYPE_INT: case FFI_TYPE_SINT32: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(signed int *) arg; else p_ov[n_ov++] = *(signed int *) arg; break; case FFI_TYPE_UINT16: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(unsigned short *) arg; else p_ov[n_ov++] = *(unsigned short *) arg; break; case FFI_TYPE_SINT16: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(signed short *) arg; else p_ov[n_ov++] = *(signed short *) arg; break; case FFI_TYPE_UINT8: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(unsigned char *) arg; else p_ov[n_ov++] = *(unsigned char *) arg; break; case FFI_TYPE_SINT8: if (n_gpr < MAX_GPRARGS) p_gpr[n_gpr++] = *(signed char *) arg; else p_ov[n_ov++] = *(signed char *) arg; break; default: FFI_ASSERT (0); break; } } } /*======================== End of Routine ============================*/ /*====================================================================*/ /* */ /* Name - ffi_prep_cif_machdep. */ /* */ /* Function - Perform machine dependent CIF processing. */ /* */ /*====================================================================*/ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { size_t struct_size = 0; int n_gpr = 0; int n_fpr = 0; int n_ov = 0; ffi_type **ptr; int i; /* Determine return value handling. */ switch (cif->rtype->type) { /* Void is easy. */ case FFI_TYPE_VOID: cif->flags = FFI390_RET_VOID; break; /* Structures are returned via a hidden pointer. */ case FFI_TYPE_STRUCT: cif->flags = FFI390_RET_STRUCT; n_gpr++; /* We need one GPR to pass the pointer. */ break; /* Floating point values are returned in fpr 0. */ case FFI_TYPE_FLOAT: cif->flags = FFI390_RET_FLOAT; break; case FFI_TYPE_DOUBLE: cif->flags = FFI390_RET_DOUBLE; break; /* Integer values are returned in gpr 2 (and gpr 3 for 64-bit values on 31-bit machines). */ case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: cif->flags = FFI390_RET_INT64; break; case FFI_TYPE_POINTER: case FFI_TYPE_INT: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: /* These are to be extended to word size. */ #ifdef __s390x__ cif->flags = FFI390_RET_INT64; #else cif->flags = FFI390_RET_INT32; #endif break; default: FFI_ASSERT (0); break; } /* Now for the arguments. */ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { int type = (*ptr)->type; /* Check how a structure type is passed. */ if (type == FFI_TYPE_STRUCT) { type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, we must reserve space to copy its data for proper call-by-value semantics. */ if (type == FFI_TYPE_POINTER) struct_size += ROUND_SIZE ((*ptr)->size); } /* Now handle all primitive int/float data types. */ switch (type) { /* The first MAX_FPRARGS floating point arguments go in FPRs, the rest overflow to the stack. */ case FFI_TYPE_DOUBLE: if (n_fpr < MAX_FPRARGS) n_fpr++; else n_ov += sizeof (double) / sizeof (long); break; case FFI_TYPE_FLOAT: if (n_fpr < MAX_FPRARGS) n_fpr++; else n_ov++; break; /* On 31-bit machines, 64-bit integers are passed in GPR pairs, if one is still available, or else on the stack. If only one register is free, skip the register (it won't be used for any subsequent argument either). */ #ifndef __s390x__ case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: if (n_gpr == MAX_GPRARGS-1) n_gpr = MAX_GPRARGS; if (n_gpr < MAX_GPRARGS) n_gpr += 2; else n_ov += 2; break; #endif /* Everything else is passed in GPRs (until MAX_GPRARGS have been used) or overflows to the stack. */ default: if (n_gpr < MAX_GPRARGS) n_gpr++; else n_ov++; break; } } /* Total stack space as required for overflow arguments and temporary structure copies. */ cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; return FFI_OK; } /*======================== End of Routine ============================*/ /*====================================================================*/ /* */ /* Name - ffi_call. */ /* */ /* Function - Call the FFI routine. */ /* */ /*====================================================================*/ void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { int ret_type = cif->flags; extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; ecif.rvalue = rvalue; /* If we don't have a return value, we need to fake one. */ if (rvalue == NULL) { if (ret_type == FFI390_RET_STRUCT) ecif.rvalue = alloca (cif->rtype->size); else ret_type = FFI390_RET_VOID; } switch (cif->abi) { case FFI_SYSV: ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, ret_type, ecif.rvalue, fn); break; default: FFI_ASSERT (0); break; } } /*======================== End of Routine ============================*/ /*====================================================================*/ /* */ /* Name - ffi_closure_helper_SYSV. */ /* */ /* Function - Call a FFI closure target function. */ /* */ /*====================================================================*/ void ffi_closure_helper_SYSV (ffi_closure *closure, unsigned long *p_gpr, unsigned long long *p_fpr, unsigned long *p_ov) { unsigned long long ret_buffer; void *rvalue = &ret_buffer; void **avalue; void **p_arg; int n_gpr = 0; int n_fpr = 0; int n_ov = 0; ffi_type **ptr; int i; /* Allocate buffer for argument list pointers. */ p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); /* If we returning a structure, pass the structure address directly to the target function. Otherwise, have the target function store the return value to the GPR save area. */ if (closure->cif->flags == FFI390_RET_STRUCT) rvalue = (void *) p_gpr[n_gpr++]; /* Now for the arguments. */ for (ptr = closure->cif->arg_types, i = closure->cif->nargs; i > 0; i--, p_arg++, ptr++) { int deref_struct_pointer = 0; int type = (*ptr)->type; /* Check how a structure type is passed. */ if (type == FFI_TYPE_STRUCT) { type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, remember to retrieve the pointer later. */ if (type == FFI_TYPE_POINTER) deref_struct_pointer = 1; } /* Pointers are passed like UINTs of the same size. */ if (type == FFI_TYPE_POINTER) #ifdef __s390x__ type = FFI_TYPE_UINT64; #else type = FFI_TYPE_UINT32; #endif /* Now handle all primitive int/float data types. */ switch (type) { case FFI_TYPE_DOUBLE: if (n_fpr < MAX_FPRARGS) *p_arg = &p_fpr[n_fpr++]; else *p_arg = &p_ov[n_ov], n_ov += sizeof (double) / sizeof (long); break; case FFI_TYPE_FLOAT: if (n_fpr < MAX_FPRARGS) *p_arg = &p_fpr[n_fpr++]; else *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; break; case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: #ifdef __s390x__ if (n_gpr < MAX_GPRARGS) *p_arg = &p_gpr[n_gpr++]; else *p_arg = &p_ov[n_ov++]; #else if (n_gpr == MAX_GPRARGS-1) n_gpr = MAX_GPRARGS; if (n_gpr < MAX_GPRARGS) *p_arg = &p_gpr[n_gpr], n_gpr += 2; else *p_arg = &p_ov[n_ov], n_ov += 2; #endif break; case FFI_TYPE_INT: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: if (n_gpr < MAX_GPRARGS) *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; else *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: if (n_gpr < MAX_GPRARGS) *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; else *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; break; case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: if (n_gpr < MAX_GPRARGS) *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; else *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; break; default: FFI_ASSERT (0); break; } /* If this is a struct passed via pointer, we need to actually retrieve that pointer. */ if (deref_struct_pointer) *p_arg = *(void **)*p_arg; } /* Call the target function. */ (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); /* Convert the return value. */ switch (closure->cif->rtype->type) { /* Void is easy, and so is struct. */ case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: break; /* Floating point values are returned in fpr 0. */ case FFI_TYPE_FLOAT: p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; break; case FFI_TYPE_DOUBLE: p_fpr[0] = *(unsigned long long *) rvalue; break; /* Integer values are returned in gpr 2 (and gpr 3 for 64-bit values on 31-bit machines). */ case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: #ifdef __s390x__ p_gpr[0] = *(unsigned long *) rvalue; #else p_gpr[0] = ((unsigned long *) rvalue)[0], p_gpr[1] = ((unsigned long *) rvalue)[1]; #endif break; case FFI_TYPE_POINTER: case FFI_TYPE_UINT32: case FFI_TYPE_UINT16: case FFI_TYPE_UINT8: p_gpr[0] = *(unsigned long *) rvalue; break; case FFI_TYPE_INT: case FFI_TYPE_SINT32: case FFI_TYPE_SINT16: case FFI_TYPE_SINT8: p_gpr[0] = *(signed long *) rvalue; break; default: FFI_ASSERT (0); break; } } /*======================== End of Routine ============================*/ /*====================================================================*/ /* */ /* Name - ffi_prep_closure. */ /* */ /* Function - Prepare a FFI closure. */ /* */ /*====================================================================*/ ffi_status ffi_prep_closure (ffi_closure *closure, ffi_cif *cif, void (*fun) (ffi_cif *, void *, void **, void *), void *user_data) { FFI_ASSERT (cif->abi == FFI_SYSV); #ifndef __s390x__ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ *(short *)&closure->tramp [4] = 0x1006; *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ *(long *)&closure->tramp [8] = (long)closure; *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; #else *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ *(short *)&closure->tramp [4] = 0x100e; *(short *)&closure->tramp [6] = 0x0004; *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ *(long *)&closure->tramp[16] = (long)closure; *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; #endif closure->cif = cif; closure->user_data = user_data; closure->fun = fun; return FFI_OK; } /*======================== End of Routine ============================*/ gauche-c-wrapper-0.6.1.orig/libffi/src/s390/ffitarget.h0000644000000000000000000000364611237307543017357 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for S390. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H #if defined (__s390x__) #define S390X #endif /* ---- System specific configurations ----------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #ifdef S390X #define FFI_TRAMPOLINE_SIZE 32 #else #define FFI_TRAMPOLINE_SIZE 16 #endif #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/s390/sysv.S0000644000000000000000000002461111237307543016356 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2000 Software AG S390 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifndef __s390x__ .text # r2: cif->bytes # r3: &ecif # r4: ffi_prep_args # r5: ret_type # r6: ecif.rvalue # ov: fn # This assumes we are using gas. .globl ffi_call_SYSV .type ffi_call_SYSV,%function ffi_call_SYSV: .LFB1: stm %r6,%r15,24(%r15) # Save registers .LCFI0: basr %r13,0 # Set up base register .Lbase: lr %r11,%r15 # Set up frame pointer .LCFI1: sr %r15,%r2 ahi %r15,-96-48 # Allocate stack lr %r8,%r6 # Save ecif.rvalue sr %r9,%r9 ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address l %r7,96(%r11) # Load function address st %r11,0(%r15) # Set up back chain ahi %r11,-48 # Register save area .LCFI2: la %r2,96(%r15) # Save area # r3 already holds &ecif basr %r14,%r4 # Call ffi_prep_args lm %r2,%r6,0(%r11) # Load arguments ld %f0,32(%r11) ld %f2,40(%r11) la %r14,0(%r13,%r9) # Set return address br %r7 # ... and call function .LretNone: # Return void l %r4,48+56(%r11) lm %r6,%r15,48+24(%r11) br %r4 .LretFloat: l %r4,48+56(%r11) ste %f0,0(%r8) # Return float lm %r6,%r15,48+24(%r11) br %r4 .LretDouble: l %r4,48+56(%r11) std %f0,0(%r8) # Return double lm %r6,%r15,48+24(%r11) br %r4 .LretInt32: l %r4,48+56(%r11) st %r2,0(%r8) # Return int lm %r6,%r15,48+24(%r11) br %r4 .LretInt64: l %r4,48+56(%r11) stm %r2,%r3,0(%r8) # Return long long lm %r6,%r15,48+24(%r11) br %r4 .Ltable: .byte .LretNone-.Lbase # FFI390_RET_VOID .byte .LretNone-.Lbase # FFI390_RET_STRUCT .byte .LretFloat-.Lbase # FFI390_RET_FLOAT .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE .byte .LretInt32-.Lbase # FFI390_RET_INT32 .byte .LretInt64-.Lbase # FFI390_RET_INT64 .LFE1: .ffi_call_SYSV_end: .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV .globl ffi_closure_SYSV .type ffi_closure_SYSV,%function ffi_closure_SYSV: .LFB2: stm %r12,%r15,48(%r15) # Save registers .LCFI10: basr %r13,0 # Set up base register .Lcbase: stm %r2,%r6,8(%r15) # Save arguments std %f0,64(%r15) std %f2,72(%r15) lr %r1,%r15 # Set up stack frame ahi %r15,-96 .LCFI11: l %r12,.Lchelper-.Lcbase(%r13) # Get helper function lr %r2,%r0 # Closure la %r3,8(%r1) # GPRs la %r4,64(%r1) # FPRs la %r5,96(%r1) # Overflow st %r1,0(%r15) # Set up back chain bas %r14,0(%r12,%r13) # Call helper l %r4,96+56(%r15) ld %f0,96+64(%r15) # Load return registers lm %r2,%r3,96+8(%r15) lm %r12,%r15,96+48(%r15) br %r4 .align 4 .Lchelper: .long ffi_closure_helper_SYSV-.Lcbase .LFE2: .ffi_closure_SYSV_end: .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry .LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .uleb128 0x1 # CIE Code Alignment Factor .sleb128 -4 # CIE Data Alignment Factor .byte 0xe # CIE RA Column .uleb128 0x1 # Augmentation size .byte 0x1b # FDE Encoding (pcrel sdata4) .byte 0xc # DW_CFA_def_cfa .uleb128 0xf .uleb128 0x60 .align 4 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 # FDE Length .LASFDE1: .4byte .LASFDE1-.Lframe1 # FDE CIE offset .4byte .LFB1-. # FDE initial location .4byte .LFE1-.LFB1 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI0-.LFB1 .byte 0x8f # DW_CFA_offset, column 0xf .uleb128 0x9 .byte 0x8e # DW_CFA_offset, column 0xe .uleb128 0xa .byte 0x8d # DW_CFA_offset, column 0xd .uleb128 0xb .byte 0x8c # DW_CFA_offset, column 0xc .uleb128 0xc .byte 0x8b # DW_CFA_offset, column 0xb .uleb128 0xd .byte 0x8a # DW_CFA_offset, column 0xa .uleb128 0xe .byte 0x89 # DW_CFA_offset, column 0x9 .uleb128 0xf .byte 0x88 # DW_CFA_offset, column 0x8 .uleb128 0x10 .byte 0x87 # DW_CFA_offset, column 0x7 .uleb128 0x11 .byte 0x86 # DW_CFA_offset, column 0x6 .uleb128 0x12 .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI1-.LCFI0 .byte 0xd # DW_CFA_def_cfa_register .uleb128 0xb .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI2-.LCFI1 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0x90 .align 4 .LEFDE1: .LSFDE2: .4byte .LEFDE2-.LASFDE2 # FDE Length .LASFDE2: .4byte .LASFDE2-.Lframe1 # FDE CIE offset .4byte .LFB2-. # FDE initial location .4byte .LFE2-.LFB2 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI10-.LFB2 .byte 0x8f # DW_CFA_offset, column 0xf .uleb128 0x9 .byte 0x8e # DW_CFA_offset, column 0xe .uleb128 0xa .byte 0x8d # DW_CFA_offset, column 0xd .uleb128 0xb .byte 0x8c # DW_CFA_offset, column 0xc .uleb128 0xc .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI11-.LCFI10 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0xc0 .align 4 .LEFDE2: #else .text # r2: cif->bytes # r3: &ecif # r4: ffi_prep_args # r5: ret_type # r6: ecif.rvalue # ov: fn # This assumes we are using gas. .globl ffi_call_SYSV .type ffi_call_SYSV,%function ffi_call_SYSV: .LFB1: stmg %r6,%r15,48(%r15) # Save registers .LCFI0: larl %r13,.Lbase # Set up base register lgr %r11,%r15 # Set up frame pointer .LCFI1: sgr %r15,%r2 aghi %r15,-160-80 # Allocate stack lgr %r8,%r6 # Save ecif.rvalue llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address lg %r7,160(%r11) # Load function address stg %r11,0(%r15) # Set up back chain aghi %r11,-80 # Register save area .LCFI2: la %r2,160(%r15) # Save area # r3 already holds &ecif basr %r14,%r4 # Call ffi_prep_args lmg %r2,%r6,0(%r11) # Load arguments ld %f0,48(%r11) ld %f2,56(%r11) ld %f4,64(%r11) ld %f6,72(%r11) la %r14,0(%r13,%r9) # Set return address br %r7 # ... and call function .Lbase: .LretNone: # Return void lg %r4,80+112(%r11) lmg %r6,%r15,80+48(%r11) br %r4 .LretFloat: lg %r4,80+112(%r11) ste %f0,0(%r8) # Return float lmg %r6,%r15,80+48(%r11) br %r4 .LretDouble: lg %r4,80+112(%r11) std %f0,0(%r8) # Return double lmg %r6,%r15,80+48(%r11) br %r4 .LretInt32: lg %r4,80+112(%r11) st %r2,0(%r8) # Return int lmg %r6,%r15,80+48(%r11) br %r4 .LretInt64: lg %r4,80+112(%r11) stg %r2,0(%r8) # Return long lmg %r6,%r15,80+48(%r11) br %r4 .Ltable: .byte .LretNone-.Lbase # FFI390_RET_VOID .byte .LretNone-.Lbase # FFI390_RET_STRUCT .byte .LretFloat-.Lbase # FFI390_RET_FLOAT .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE .byte .LretInt32-.Lbase # FFI390_RET_INT32 .byte .LretInt64-.Lbase # FFI390_RET_INT64 .LFE1: .ffi_call_SYSV_end: .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV .globl ffi_closure_SYSV .type ffi_closure_SYSV,%function ffi_closure_SYSV: .LFB2: stmg %r14,%r15,112(%r15) # Save registers .LCFI10: stmg %r2,%r6,16(%r15) # Save arguments std %f0,128(%r15) std %f2,136(%r15) std %f4,144(%r15) std %f6,152(%r15) lgr %r1,%r15 # Set up stack frame aghi %r15,-160 .LCFI11: lgr %r2,%r0 # Closure la %r3,16(%r1) # GPRs la %r4,128(%r1) # FPRs la %r5,160(%r1) # Overflow stg %r1,0(%r15) # Set up back chain brasl %r14,ffi_closure_helper_SYSV # Call helper lg %r14,160+112(%r15) ld %f0,160+128(%r15) # Load return registers lg %r2,160+16(%r15) la %r15,160(%r15) br %r14 .LFE2: .ffi_closure_SYSV_end: .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry .LSCIE1: .4byte 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .uleb128 0x1 # CIE Code Alignment Factor .sleb128 -8 # CIE Data Alignment Factor .byte 0xe # CIE RA Column .uleb128 0x1 # Augmentation size .byte 0x1b # FDE Encoding (pcrel sdata4) .byte 0xc # DW_CFA_def_cfa .uleb128 0xf .uleb128 0xa0 .align 8 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 # FDE Length .LASFDE1: .4byte .LASFDE1-.Lframe1 # FDE CIE offset .4byte .LFB1-. # FDE initial location .4byte .LFE1-.LFB1 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI0-.LFB1 .byte 0x8f # DW_CFA_offset, column 0xf .uleb128 0x5 .byte 0x8e # DW_CFA_offset, column 0xe .uleb128 0x6 .byte 0x8d # DW_CFA_offset, column 0xd .uleb128 0x7 .byte 0x8c # DW_CFA_offset, column 0xc .uleb128 0x8 .byte 0x8b # DW_CFA_offset, column 0xb .uleb128 0x9 .byte 0x8a # DW_CFA_offset, column 0xa .uleb128 0xa .byte 0x89 # DW_CFA_offset, column 0x9 .uleb128 0xb .byte 0x88 # DW_CFA_offset, column 0x8 .uleb128 0xc .byte 0x87 # DW_CFA_offset, column 0x7 .uleb128 0xd .byte 0x86 # DW_CFA_offset, column 0x6 .uleb128 0xe .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI1-.LCFI0 .byte 0xd # DW_CFA_def_cfa_register .uleb128 0xb .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI2-.LCFI1 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0xf0 .align 8 .LEFDE1: .LSFDE2: .4byte .LEFDE2-.LASFDE2 # FDE Length .LASFDE2: .4byte .LASFDE2-.Lframe1 # FDE CIE offset .4byte .LFB2-. # FDE initial location .4byte .LFE2-.LFB2 # FDE address range .uleb128 0x0 # Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI10-.LFB2 .byte 0x8f # DW_CFA_offset, column 0xf .uleb128 0x5 .byte 0x8e # DW_CFA_offset, column 0xe .uleb128 0x6 .byte 0x4 # DW_CFA_advance_loc4 .4byte .LCFI11-.LCFI10 .byte 0xe # DW_CFA_def_cfa_offset .uleb128 0x140 .align 8 .LEFDE2: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/sh/0002755000000000000000000000000011237307543015140 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/sh/ffi.c0000644000000000000000000003607711237307543016063 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2002, 2003, 2004, 2005 Kaz Kojima SuperH Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #define NGREGARG 4 #if defined(__SH4__) #define NFREGARG 8 #endif #if defined(__HITACHI__) #define STRUCT_VALUE_ADDRESS_WITH_ARG 1 #else #define STRUCT_VALUE_ADDRESS_WITH_ARG 0 #endif /* If the structure has essentialy an unique element, return its type. */ static int simple_type (ffi_type *arg) { if (arg->type != FFI_TYPE_STRUCT) return arg->type; else if (arg->elements[1]) return FFI_TYPE_STRUCT; return simple_type (arg->elements[0]); } static int return_type (ffi_type *arg) { unsigned short type; if (arg->type != FFI_TYPE_STRUCT) return arg->type; type = simple_type (arg->elements[0]); if (! arg->elements[1]) { switch (type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: return FFI_TYPE_INT; default: return type; } } /* gcc uses r0/r1 pair for some kind of structures. */ if (arg->size <= 2 * sizeof (int)) { int i = 0; ffi_type *e; while ((e = arg->elements[i++])) { type = simple_type (e); switch (type) { case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_INT: case FFI_TYPE_FLOAT: return FFI_TYPE_UINT64; default: break; } } } return FFI_TYPE_STRUCT; } /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { register unsigned int i; register int tmp; register unsigned int avn; register void **p_argv; register char *argp; register ffi_type **p_arg; int greg, ireg; #if defined(__SH4__) int freg = 0; #endif tmp = 0; argp = stack; if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) { *(void **) argp = ecif->rvalue; argp += 4; ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; } else ireg = 0; /* Set arguments for registers. */ greg = ireg; avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) { size_t z; z = (*p_arg)->size; if (z < sizeof(int)) { if (greg++ >= NGREGARG) continue; z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_STRUCT: *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); break; default: FFI_ASSERT(0); } argp += z; } else if (z == sizeof(int)) { #if defined(__SH4__) if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (freg++ >= NFREGARG) continue; } else #endif { if (greg++ >= NGREGARG) continue; } *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); argp += z; } #if defined(__SH4__) else if ((*p_arg)->type == FFI_TYPE_DOUBLE) { if (freg + 1 >= NFREGARG) continue; freg = (freg + 1) & ~1; freg += 2; memcpy (argp, *p_argv, z); argp += z; } #endif else { int n = (z + sizeof (int) - 1) / sizeof (int); #if defined(__SH4__) if (greg + n - 1 >= NGREGARG) continue; #else if (greg >= NGREGARG) continue; #endif greg += n; memcpy (argp, *p_argv, z); argp += n * sizeof (int); } } /* Set arguments on stack. */ greg = ireg; #if defined(__SH4__) freg = 0; #endif p_argv = ecif->avalue; for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) { size_t z; z = (*p_arg)->size; if (z < sizeof(int)) { if (greg++ < NGREGARG) continue; z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_STRUCT: *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); break; default: FFI_ASSERT(0); } argp += z; } else if (z == sizeof(int)) { #if defined(__SH4__) if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (freg++ < NFREGARG) continue; } else #endif { if (greg++ < NGREGARG) continue; } *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); argp += z; } #if defined(__SH4__) else if ((*p_arg)->type == FFI_TYPE_DOUBLE) { if (freg + 1 < NFREGARG) { freg = (freg + 1) & ~1; freg += 2; continue; } memcpy (argp, *p_argv, z); argp += z; } #endif else { int n = (z + sizeof (int) - 1) / sizeof (int); if (greg + n - 1 < NGREGARG) { greg += n; continue; } #if (! defined(__SH4__)) else if (greg < NGREGARG) { greg = NGREGARG; continue; } #endif memcpy (argp, *p_argv, z); argp += n * sizeof (int); } } return; } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { int i, j; int size, type; int n, m; int greg; #if defined(__SH4__) int freg = 0; #endif cif->flags = 0; greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; #if defined(__SH4__) for (i = j = 0; i < cif->nargs && j < 12; i++) { type = (cif->arg_types)[i]->type; switch (type) { case FFI_TYPE_FLOAT: if (freg >= NFREGARG) continue; freg++; cif->flags += ((cif->arg_types)[i]->type) << (2 * j); j++; break; case FFI_TYPE_DOUBLE: if ((freg + 1) >= NFREGARG) continue; freg = (freg + 1) & ~1; freg += 2; cif->flags += ((cif->arg_types)[i]->type) << (2 * j); j++; break; default: size = (cif->arg_types)[i]->size; n = (size + sizeof (int) - 1) / sizeof (int); if (greg + n - 1 >= NGREGARG) continue; greg += n; for (m = 0; m < n; m++) cif->flags += FFI_TYPE_INT << (2 * j++); break; } } #else for (i = j = 0; i < cif->nargs && j < 4; i++) { size = (cif->arg_types)[i]->size; n = (size + sizeof (int) - 1) / sizeof (int); if (greg >= NGREGARG) continue; else if (greg + n - 1 >= NGREGARG) n = NGREGARG - greg; greg += n; for (m = 0; m < n; m++) cif->flags += FFI_TYPE_INT << (2 * j++); } #endif /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_STRUCT: cif->flags += (unsigned) (return_type (cif->rtype)) << 24; break; case FFI_TYPE_VOID: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags += (unsigned) cif->rtype->type << 24; break; default: cif->flags += FFI_TYPE_INT << 24; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; UINT64 trvalue; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if (cif->rtype->type == FFI_TYPE_STRUCT && return_type (cif->rtype) != FFI_TYPE_STRUCT) ecif.rvalue = &trvalue; else if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } if (rvalue && cif->rtype->type == FFI_TYPE_STRUCT && return_type (cif->rtype) != FFI_TYPE_STRUCT) memcpy (rvalue, &trvalue, cif->rtype->size); } extern void ffi_closure_SYSV (void); #if defined(__SH4__) extern void __ic_invalidate (void *line); #endif ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp; unsigned short insn; FFI_ASSERT (cif->abi == FFI_GCC_SYSV); tramp = (unsigned int *) &closure->tramp[0]; /* Set T bit if the function returns a struct pointed with R2. */ insn = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 0x0018 /* sett */ : 0x0008 /* clrt */); #ifdef __LITTLE_ENDIAN__ tramp[0] = 0xd301d102; tramp[1] = 0x0000412b | (insn << 16); #else tramp[0] = 0xd102d301; tramp[1] = 0x412b0000 | insn; #endif *(void **) &tramp[2] = (void *)closure; /* ctx */ *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ closure->cif = cif; closure->fun = fun; closure->user_data = user_data; #if defined(__SH4__) /* Flush the icache. */ __ic_invalidate(&closure->tramp[0]); #endif return FFI_OK; } /* Basically the trampoline invokes ffi_closure_SYSV, and on * entry, r3 holds the address of the closure. * After storing the registers that could possibly contain * parameters to be passed into the stack frame and setting * up space for a return value, ffi_closure_SYSV invokes the * following helper function to do most of the work. */ #ifdef __LITTLE_ENDIAN__ #define OFS_INT8 0 #define OFS_INT16 0 #else #define OFS_INT8 3 #define OFS_INT16 2 #endif int ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, unsigned long *pgr, unsigned long *pfr, unsigned long *pst) { void **avalue; ffi_type **p_arg; int i, avn; int ireg, greg = 0; #if defined(__SH4__) int freg = 0; #endif ffi_cif *cif; double temp; cif = closure->cif; avalue = alloca(cif->nargs * sizeof(void *)); /* Copy the caller's structure return value address so that the closure returns the data directly to the caller. */ if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG) { rvalue = *pgr++; ireg = 1; } else ireg = 0; cif = closure->cif; greg = ireg; avn = cif->nargs; /* Grab the addresses of the arguments from the stack frame. */ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) { size_t z; z = (*p_arg)->size; if (z < sizeof(int)) { if (greg++ >= NGREGARG) continue; z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = (((char *)pgr) + OFS_INT8); break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = (((char *)pgr) + OFS_INT16); break; case FFI_TYPE_STRUCT: avalue[i] = pgr; break; default: FFI_ASSERT(0); } pgr++; } else if (z == sizeof(int)) { #if defined(__SH4__) if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (freg++ >= NFREGARG) continue; avalue[i] = pfr; pfr++; } else #endif { if (greg++ >= NGREGARG) continue; avalue[i] = pgr; pgr++; } } #if defined(__SH4__) else if ((*p_arg)->type == FFI_TYPE_DOUBLE) { if (freg + 1 >= NFREGARG) continue; freg = (freg + 1) & ~1; freg += 2; avalue[i] = pfr; pfr += 2; } #endif else { int n = (z + sizeof (int) - 1) / sizeof (int); #if defined(__SH4__) if (greg + n - 1 >= NGREGARG) continue; #else if (greg >= NGREGARG) continue; #endif greg += n; avalue[i] = pgr; pgr += n; } } greg = ireg; #if defined(__SH4__) freg = 0; #endif for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) { size_t z; z = (*p_arg)->size; if (z < sizeof(int)) { if (greg++ < NGREGARG) continue; z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: avalue[i] = (((char *)pst) + OFS_INT8); break; case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: avalue[i] = (((char *)pst) + OFS_INT16); break; case FFI_TYPE_STRUCT: avalue[i] = pst; break; default: FFI_ASSERT(0); } pst++; } else if (z == sizeof(int)) { #if defined(__SH4__) if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (freg++ < NFREGARG) continue; } else #endif { if (greg++ < NGREGARG) continue; } avalue[i] = pst; pst++; } #if defined(__SH4__) else if ((*p_arg)->type == FFI_TYPE_DOUBLE) { if (freg + 1 < NFREGARG) { freg = (freg + 1) & ~1; freg += 2; continue; } avalue[i] = pst; pst += 2; } #endif else { int n = (z + sizeof (int) - 1) / sizeof (int); if (greg + n - 1 < NGREGARG) { greg += n; continue; } #if (! defined(__SH4__)) else if (greg < NGREGARG) { greg += n; pst += greg - NGREGARG; continue; } #endif avalue[i] = pst; pst += n; } } (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_SYSV how to perform return type promotions. */ return return_type (cif->rtype); } gauche-c-wrapper-0.6.1.orig/libffi/src/sh/ffitarget.h0000644000000000000000000000336111237307543017265 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for SuperH. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- Generic type definitions ----------------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 16 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/sh/sysv.S0000644000000000000000000003434711237307543016301 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2002, 2003, 2004 Kaz Kojima SuperH Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef HAVE_MACHINE_ASM_H #include #else /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): #endif #if defined(__HITACHI__) #define STRUCT_VALUE_ADDRESS_WITH_ARG 1 #else #define STRUCT_VALUE_ADDRESS_WITH_ARG 0 #endif .text # r4: ffi_prep_args # r5: &ecif # r6: bytes # r7: flags # sp+0: rvalue # sp+4: fn # This assumes we are using gas. ENTRY(ffi_call_SYSV) # Save registers .LFB1: mov.l r8,@-r15 .LCFI0: mov.l r9,@-r15 .LCFI1: mov.l r10,@-r15 .LCFI2: mov.l r12,@-r15 .LCFI3: mov.l r14,@-r15 .LCFI4: sts.l pr,@-r15 .LCFI5: mov r15,r14 .LCFI6: #if defined(__SH4__) mov r6,r8 mov r7,r9 sub r6,r15 add #-16,r15 mov #~7,r0 and r0,r15 mov r4,r0 jsr @r0 mov r15,r4 mov r9,r1 shlr8 r9 shlr8 r9 shlr8 r9 mov #FFI_TYPE_STRUCT,r2 cmp/eq r2,r9 bf 1f #if STRUCT_VALUE_ADDRESS_WITH_ARG mov.l @r15+,r4 bra 2f mov #5,r2 #else mov.l @r15+,r10 #endif 1: mov #4,r2 2: mov #4,r3 L_pass: cmp/pl r8 bf L_call_it mov r1,r0 and #3,r0 L_pass_d: cmp/eq #FFI_TYPE_DOUBLE,r0 bf L_pass_f mov r3,r0 and #1,r0 tst r0,r0 bt 1f add #1,r3 1: mov #12,r0 cmp/hs r0,r3 bt/s 3f shlr2 r1 bsr L_pop_d nop 3: add #2,r3 bra L_pass add #-8,r8 L_pop_d: mov r3,r0 add r0,r0 add r3,r0 add #-12,r0 braf r0 nop #ifdef __LITTLE_ENDIAN__ fmov.s @r15+,fr5 rts fmov.s @r15+,fr4 fmov.s @r15+,fr7 rts fmov.s @r15+,fr6 fmov.s @r15+,fr9 rts fmov.s @r15+,fr8 fmov.s @r15+,fr11 rts fmov.s @r15+,fr10 #else fmov.s @r15+,fr4 rts fmov.s @r15+,fr5 fmov.s @r15+,fr6 rts fmov.s @r15+,fr7 fmov.s @r15+,fr8 rts fmov.s @r15+,fr9 fmov.s @r15+,fr10 rts fmov.s @r15+,fr11 #endif L_pass_f: cmp/eq #FFI_TYPE_FLOAT,r0 bf L_pass_i mov #12,r0 cmp/hs r0,r3 bt/s 2f shlr2 r1 bsr L_pop_f nop 2: add #1,r3 bra L_pass add #-4,r8 L_pop_f: mov r3,r0 shll2 r0 add #-16,r0 braf r0 nop #ifdef __LITTLE_ENDIAN__ rts fmov.s @r15+,fr5 rts fmov.s @r15+,fr4 rts fmov.s @r15+,fr7 rts fmov.s @r15+,fr6 rts fmov.s @r15+,fr9 rts fmov.s @r15+,fr8 rts fmov.s @r15+,fr11 rts fmov.s @r15+,fr10 #else rts fmov.s @r15+,fr4 rts fmov.s @r15+,fr5 rts fmov.s @r15+,fr6 rts fmov.s @r15+,fr7 rts fmov.s @r15+,fr8 rts fmov.s @r15+,fr9 rts fmov.s @r15+,fr10 rts fmov.s @r15+,fr11 #endif L_pass_i: cmp/eq #FFI_TYPE_INT,r0 bf L_call_it mov #8,r0 cmp/hs r0,r2 bt/s 2f shlr2 r1 bsr L_pop_i nop 2: add #1,r2 bra L_pass add #-4,r8 L_pop_i: mov r2,r0 shll2 r0 add #-16,r0 braf r0 nop rts mov.l @r15+,r4 rts mov.l @r15+,r5 rts mov.l @r15+,r6 rts mov.l @r15+,r7 L_call_it: # call function #if (! STRUCT_VALUE_ADDRESS_WITH_ARG) mov r10, r2 #endif mov.l @(28,r14),r1 jsr @r1 nop L_ret_d: mov #FFI_TYPE_DOUBLE,r2 cmp/eq r2,r9 bf L_ret_ll mov.l @(24,r14),r1 #ifdef __LITTLE_ENDIAN__ fmov.s fr1,@r1 add #4,r1 bra L_epilogue fmov.s fr0,@r1 #else fmov.s fr0,@r1 add #4,r1 bra L_epilogue fmov.s fr1,@r1 #endif L_ret_ll: mov #FFI_TYPE_SINT64,r2 cmp/eq r2,r9 bt/s 1f mov #FFI_TYPE_UINT64,r2 cmp/eq r2,r9 bf L_ret_f 1: mov.l @(24,r14),r2 mov.l r0,@r2 bra L_epilogue mov.l r1,@(4,r2) L_ret_f: mov #FFI_TYPE_FLOAT,r2 cmp/eq r2,r9 bf L_ret_i mov.l @(24,r14),r1 bra L_epilogue fmov.s fr0,@r1 L_ret_i: mov #FFI_TYPE_INT,r2 cmp/eq r2,r9 bf L_epilogue mov.l @(24,r14),r1 bra L_epilogue mov.l r0,@r1 L_epilogue: # Remove the space we pushed for the args mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 mov.l @r15+,r12 mov.l @r15+,r10 mov.l @r15+,r9 rts mov.l @r15+,r8 #else mov r6,r8 mov r7,r9 sub r6,r15 add #-16,r15 mov #~7,r0 and r0,r15 mov r4,r0 jsr @r0 mov r15,r4 mov r9,r3 shlr8 r9 shlr8 r9 shlr8 r9 mov #FFI_TYPE_STRUCT,r2 cmp/eq r2,r9 bf 1f #if STRUCT_VALUE_ADDRESS_WITH_ARG mov.l @r15+,r4 bra 2f mov #5,r2 #else mov.l @r15+,r10 #endif 1: mov #4,r2 2: L_pass: cmp/pl r8 bf L_call_it mov r3,r0 and #3,r0 L_pass_d: cmp/eq #FFI_TYPE_DOUBLE,r0 bf L_pass_i mov r15,r0 and #7,r0 tst r0,r0 bt 1f add #4,r15 1: mov #8,r0 cmp/hs r0,r2 bt/s 2f shlr2 r3 bsr L_pop_d nop 2: add #2,r2 bra L_pass add #-8,r8 L_pop_d: mov r2,r0 add r0,r0 add r2,r0 add #-12,r0 add r0,r0 braf r0 nop mov.l @r15+,r4 rts mov.l @r15+,r5 mov.l @r15+,r5 rts mov.l @r15+,r6 mov.l @r15+,r6 rts mov.l @r15+,r7 rts mov.l @r15+,r7 L_pass_i: cmp/eq #FFI_TYPE_INT,r0 bf L_call_it mov #8,r0 cmp/hs r0,r2 bt/s 2f shlr2 r3 bsr L_pop_i nop 2: add #1,r2 bra L_pass add #-4,r8 L_pop_i: mov r2,r0 shll2 r0 add #-16,r0 braf r0 nop rts mov.l @r15+,r4 rts mov.l @r15+,r5 rts mov.l @r15+,r6 rts mov.l @r15+,r7 L_call_it: # call function #if (! STRUCT_VALUE_ADDRESS_WITH_ARG) mov r10, r2 #endif mov.l @(28,r14),r1 jsr @r1 nop L_ret_d: mov #FFI_TYPE_DOUBLE,r2 cmp/eq r2,r9 bf L_ret_ll mov.l @(24,r14),r2 mov.l r0,@r2 bra L_epilogue mov.l r1,@(4,r2) L_ret_ll: mov #FFI_TYPE_SINT64,r2 cmp/eq r2,r9 bt/s 1f mov #FFI_TYPE_UINT64,r2 cmp/eq r2,r9 bf L_ret_i 1: mov.l @(24,r14),r2 mov.l r0,@r2 bra L_epilogue mov.l r1,@(4,r2) L_ret_i: mov #FFI_TYPE_FLOAT,r2 cmp/eq r2,r9 bt 1f mov #FFI_TYPE_INT,r2 cmp/eq r2,r9 bf L_epilogue 1: mov.l @(24,r14),r1 bra L_epilogue mov.l r0,@r1 L_epilogue: # Remove the space we pushed for the args mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 mov.l @r15+,r12 mov.l @r15+,r10 mov.l @r15+,r9 rts mov.l @r15+,r8 #endif .LFE1: .ffi_call_SYSV_end: .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) .globl ffi_closure_helper_SYSV ENTRY(ffi_closure_SYSV) .LFB2: mov.l r7,@-r15 .LCFI7: mov.l r6,@-r15 .LCFI8: mov.l r5,@-r15 .LCFI9: mov.l r4,@-r15 .LCFIA: mov.l r14,@-r15 .LCFIB: sts.l pr,@-r15 /* Stack layout: xx bytes (on stack parameters) 16 bytes (register parameters) 4 bytes (saved frame pointer) 4 bytes (saved return address) 32 bytes (floating register parameters, SH-4 only) 8 bytes (result) 4 bytes (pad) 4 bytes (5th arg) <- new stack pointer */ .LCFIC: #if defined(__SH4__) add #-48,r15 #else add #-16,r15 #endif .LCFID: mov r15,r14 .LCFIE: #if defined(__SH4__) mov r14,r1 add #48,r1 #ifdef __LITTLE_ENDIAN__ fmov.s fr10,@-r1 fmov.s fr11,@-r1 fmov.s fr8,@-r1 fmov.s fr9,@-r1 fmov.s fr6,@-r1 fmov.s fr7,@-r1 fmov.s fr4,@-r1 fmov.s fr5,@-r1 #else fmov.s fr11,@-r1 fmov.s fr10,@-r1 fmov.s fr9,@-r1 fmov.s fr8,@-r1 fmov.s fr7,@-r1 fmov.s fr6,@-r1 fmov.s fr5,@-r1 fmov.s fr4,@-r1 #endif mov r1,r7 mov r14,r6 add #56,r6 #else mov r14,r6 add #24,r6 #endif bt/s 10f mov r2, r5 mov r14,r1 add #8,r1 mov r1,r5 10: mov r14,r1 #if defined(__SH4__) add #72,r1 #else add #40,r1 #endif mov.l r1,@r14 #ifdef PIC mov.l L_got,r1 mova L_got,r0 add r0,r1 mov.l L_helper,r0 add r1,r0 #else mov.l L_helper,r0 #endif jsr @r0 mov r3,r4 shll r0 mov r0,r1 mova L_table,r0 add r1,r0 mov.w @r0,r0 mov r14,r2 braf r0 add #8,r2 0: .align 2 #ifdef PIC L_got: .long _GLOBAL_OFFSET_TABLE_ L_helper: .long ffi_closure_helper_SYSV@GOTOFF #else L_helper: .long ffi_closure_helper_SYSV #endif L_table: .short L_case_v - 0b /* FFI_TYPE_VOID */ .short L_case_i - 0b /* FFI_TYPE_INT */ #if defined(__SH4__) .short L_case_f - 0b /* FFI_TYPE_FLOAT */ .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ #else .short L_case_i - 0b /* FFI_TYPE_FLOAT */ .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ #endif .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ .short L_case_q - 0b /* FFI_TYPE_SINT8 */ .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ .short L_case_h - 0b /* FFI_TYPE_SINT16 */ .short L_case_i - 0b /* FFI_TYPE_UINT32 */ .short L_case_i - 0b /* FFI_TYPE_SINT32 */ .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ .short L_case_v - 0b /* FFI_TYPE_STRUCT */ .short L_case_i - 0b /* FFI_TYPE_POINTER */ #if defined(__SH4__) L_case_d: #ifdef __LITTLE_ENDIAN__ fmov.s @r2+,fr1 bra L_case_v fmov.s @r2,fr0 #else fmov.s @r2+,fr0 bra L_case_v fmov.s @r2,fr1 #endif L_case_f: bra L_case_v fmov.s @r2,fr0 #endif L_case_ll: mov.l @r2+,r0 bra L_case_v mov.l @r2,r1 L_case_i: bra L_case_v mov.l @r2,r0 L_case_q: #ifdef __LITTLE_ENDIAN__ #else add #3,r2 #endif bra L_case_v mov.b @r2,r0 L_case_uq: #ifdef __LITTLE_ENDIAN__ #else add #3,r2 #endif mov.b @r2,r0 bra L_case_v extu.b r0,r0 L_case_h: #ifdef __LITTLE_ENDIAN__ #else add #2,r2 #endif bra L_case_v mov.w @r2,r0 L_case_uh: #ifdef __LITTLE_ENDIAN__ #else add #2,r2 #endif mov.w @r2,r0 extu.w r0,r0 /* fall through */ L_case_v: #if defined(__SH4__) add #48,r15 #else add #16,r15 #endif lds.l @r15+,pr mov.l @r15+,r14 rts add #16,r15 .LFE2: .ffi_closure_SYSV_end: .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) .section ".eh_frame","aw",@progbits __FRAME_BEGIN__: .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ .LSCIE1: .4byte 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ #ifdef PIC .ascii "zR\0" /* CIE Augmentation */ #else .byte 0x0 /* CIE Augmentation */ #endif .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ .byte 0x11 /* CIE RA Column */ #ifdef PIC .uleb128 0x1 /* Augmentation size */ .byte 0x10 /* FDE Encoding (pcrel) */ #endif .byte 0xc /* DW_CFA_def_cfa */ .byte 0xf /* uleb128 0xf */ .byte 0x0 /* uleb128 0x0 */ .align 2 .LECIE1: .LSFDE1: .4byte .LEFDE1-.LASFDE1 /* FDE Length */ .LASFDE1: .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ #ifdef PIC .4byte .LFB1-. /* FDE initial location */ #else .4byte .LFB1 /* FDE initial location */ #endif .4byte .LFE1-.LFB1 /* FDE address range */ #ifdef PIC .uleb128 0x0 /* Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI0-.LFB1 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x4 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI1-.LCFI0 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI2-.LCFI1 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0xc /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI3-.LCFI2 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x10 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI4-.LCFI3 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x14 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI5-.LCFI4 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x18 /* uleb128 0x4 */ .byte 0x91 /* DW_CFA_offset, column 0x11 */ .byte 0x6 /* uleb128 0x6 */ .byte 0x8e /* DW_CFA_offset, column 0xe */ .byte 0x5 /* uleb128 0x5 */ .byte 0x8c /* DW_CFA_offset, column 0xc */ .byte 0x4 /* uleb128 0x4 */ .byte 0x8a /* DW_CFA_offset, column 0xa */ .byte 0x3 /* uleb128 0x3 */ .byte 0x89 /* DW_CFA_offset, column 0x9 */ .byte 0x2 /* uleb128 0x2 */ .byte 0x88 /* DW_CFA_offset, column 0x8 */ .byte 0x1 /* uleb128 0x1 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI6-.LCFI5 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0xe /* uleb128 0xe */ .align 2 .LEFDE1: .LSFDE3: .4byte .LEFDE3-.LASFDE3 /* FDE Length */ .LASFDE3: .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ #ifdef PIC .4byte .LFB2-. /* FDE initial location */ #else .4byte .LFB2 /* FDE initial location */ #endif .4byte .LFE2-.LFB2 /* FDE address range */ #ifdef PIC .uleb128 0x0 /* Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI7-.LFB2 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x4 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI8-.LCFI7 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI9-.LCFI8 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0xc /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFIA-.LCFI9 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x10 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFIB-.LCFIA .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x14 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFIC-.LCFIB .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x18 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFID-.LCFIC .byte 0xe /* DW_CFA_def_cfa_offset */ #if defined(__SH4__) .byte 24+48 /* uleb128 24+48 */ #else .byte 24+16 /* uleb128 24+16 */ #endif .byte 0x91 /* DW_CFA_offset, column 0x11 */ .byte 0x6 /* uleb128 0x6 */ .byte 0x8e /* DW_CFA_offset, column 0xe */ .byte 0x5 /* uleb128 0x5 */ .byte 0x8b /* DW_CFA_offset, column 0xb */ .byte 0x4 /* uleb128 0x4 */ .byte 0x8a /* DW_CFA_offset, column 0xa */ .byte 0x3 /* uleb128 0x3 */ .byte 0x89 /* DW_CFA_offset, column 0x9 */ .byte 0x2 /* uleb128 0x2 */ .byte 0x88 /* DW_CFA_offset, column 0x8 */ .byte 0x1 /* uleb128 0x1 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFIE-.LCFID .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0xe /* uleb128 0xe */ .align 2 .LEFDE3: gauche-c-wrapper-0.6.1.orig/libffi/src/sh64/0002755000000000000000000000000011237307543015312 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/sh64/ffi.c0000644000000000000000000002536711237307543016235 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2003, 2004 Kaz Kojima SuperH SHmedia Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #define NGREGARG 8 #define NFREGARG 12 static int return_type (ffi_type *arg) { if (arg->type != FFI_TYPE_STRUCT) return arg->type; /* gcc uses r2 if the result can be packed in on register. */ if (arg->size <= sizeof (UINT8)) return FFI_TYPE_UINT8; else if (arg->size <= sizeof (UINT16)) return FFI_TYPE_UINT16; else if (arg->size <= sizeof (UINT32)) return FFI_TYPE_UINT32; else if (arg->size <= sizeof (UINT64)) return FFI_TYPE_UINT64; return FFI_TYPE_STRUCT; } /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { register unsigned int i; register unsigned int avn; register void **p_argv; register char *argp; register ffi_type **p_arg; argp = stack; if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) { *(void **) argp = ecif->rvalue; argp += sizeof (UINT64); } avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) { size_t z; int align; z = (*p_arg)->size; align = (*p_arg)->alignment; if (z < sizeof (UINT32)) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(SINT64 *) argp = (SINT64) *(SINT8 *)(*p_argv); break; case FFI_TYPE_UINT8: *(UINT64 *) argp = (UINT64) *(UINT8 *)(*p_argv); break; case FFI_TYPE_SINT16: *(SINT64 *) argp = (SINT64) *(SINT16 *)(*p_argv); break; case FFI_TYPE_UINT16: *(UINT64 *) argp = (UINT64) *(UINT16 *)(*p_argv); break; case FFI_TYPE_STRUCT: memcpy (argp, *p_argv, z); break; default: FFI_ASSERT(0); } argp += sizeof (UINT64); } else if (z == sizeof (UINT32) && align == sizeof (UINT32)) { switch ((*p_arg)->type) { case FFI_TYPE_INT: case FFI_TYPE_SINT32: *(SINT64 *) argp = (SINT64) *(SINT32 *) (*p_argv); break; case FFI_TYPE_FLOAT: case FFI_TYPE_POINTER: case FFI_TYPE_UINT32: case FFI_TYPE_STRUCT: *(UINT64 *) argp = (UINT64) *(UINT32 *) (*p_argv); break; default: FFI_ASSERT(0); break; } argp += sizeof (UINT64); } else if (z == sizeof (UINT64) && align == sizeof (UINT64) && ((int) *p_argv & (sizeof (UINT64) - 1)) == 0) { *(UINT64 *) argp = *(UINT64 *) (*p_argv); argp += sizeof (UINT64); } else { int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); memcpy (argp, *p_argv, z); argp += n * sizeof (UINT64); } } return; } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { int i, j; int size, type; int n, m; int greg; int freg; greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0); freg = 0; cif->flags2 = 0; for (i = j = 0; i < cif->nargs; i++) { type = (cif->arg_types)[i]->type; switch (type) { case FFI_TYPE_FLOAT: greg++; cif->bytes += sizeof (UINT64) - sizeof (float); if (freg >= NFREGARG - 1) continue; freg++; cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); break; case FFI_TYPE_DOUBLE: if (greg++ >= NGREGARG && (freg + 1) >= NFREGARG) continue; if ((freg + 1) < NFREGARG) { freg = (freg + 1) & ~1; freg += 2; cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); } else cif->flags2 += FFI_TYPE_INT << (2 * j++); break; default: size = (cif->arg_types)[i]->size; if (size < sizeof (UINT64)) cif->bytes += sizeof (UINT64) - size; n = (size + sizeof (UINT64) - 1) / sizeof (UINT64); if (greg >= NGREGARG) continue; else if (greg + n - 1 >= NGREGARG) greg = NGREGARG; else greg += n; for (m = 0; m < n; m++) cif->flags2 += FFI_TYPE_INT << (2 * j++); break; } } /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_STRUCT: cif->flags = return_type (cif->rtype); break; case FFI_TYPE_VOID: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: cif->flags = cif->rtype->type; break; default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, long long, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; UINT64 trvalue; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if (cif->rtype->type == FFI_TYPE_STRUCT && return_type (cif->rtype) != FFI_TYPE_STRUCT) ecif.rvalue = &trvalue; else if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->flags2, ecif.rvalue, fn); /*@=usedef@*/ break; default: FFI_ASSERT(0); break; } if (rvalue && cif->rtype->type == FFI_TYPE_STRUCT && return_type (cif->rtype) != FFI_TYPE_STRUCT) memcpy (rvalue, &trvalue, cif->rtype->size); } extern void ffi_closure_SYSV (void); extern void __ic_invalidate (void *line); ffi_status ffi_prep_closure (ffi_closure *closure, ffi_cif *cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp; FFI_ASSERT (cif->abi == FFI_GCC_SYSV); tramp = (unsigned int *) &closure->tramp[0]; /* Since ffi_closure is an aligned object, the ffi trampoline is called as an SHcompact code. Sigh. SHcompact part: mova @(1,pc),r0; add #1,r0; jmp @r0; nop; SHmedia part: movi fnaddr >> 16,r1; shori fnaddr,r1; ptabs/l r1,tr0 movi cxt >> 16,r1; shori cxt,r1; blink tr0,r63 */ #ifdef __LITTLE_ENDIAN__ tramp[0] = 0x7001c701; tramp[1] = 0x0009402b; #else tramp[0] = 0xc7017001; tramp[1] = 0x402b0009; #endif tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10; tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10; tramp[4] = 0x6bf10600; tramp[5] = 0xcc000010 | (((UINT32) closure) >> 16) << 10; tramp[6] = 0xc8000010 | (((UINT32) closure) & 0xffff) << 10; tramp[7] = 0x4401fff0; closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* Flush the icache. */ asm volatile ("ocbwb %0,0; synco; icbi %0,0; synci" : : "r" (tramp)); return FFI_OK; } /* Basically the trampoline invokes ffi_closure_SYSV, and on * entry, r3 holds the address of the closure. * After storing the registers that could possibly contain * parameters to be passed into the stack frame and setting * up space for a return value, ffi_closure_SYSV invokes the * following helper function to do most of the work. */ int ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue, UINT64 *pgr, UINT64 *pfr, UINT64 *pst) { void **avalue; ffi_type **p_arg; int i, avn; int greg, freg; ffi_cif *cif; cif = closure->cif; avalue = alloca (cif->nargs * sizeof (void *)); /* Copy the caller's structure return value address so that the closure returns the data directly to the caller. */ if (return_type (cif->rtype) == FFI_TYPE_STRUCT) { rvalue = *pgr; greg = 1; } else greg = 0; freg = 0; cif = closure->cif; avn = cif->nargs; /* Grab the addresses of the arguments from the stack frame. */ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) { size_t z; void *p; z = (*p_arg)->size; if (z < sizeof (UINT32)) { p = pgr + greg++; switch ((*p_arg)->type) { case FFI_TYPE_SINT8: case FFI_TYPE_UINT8: case FFI_TYPE_SINT16: case FFI_TYPE_UINT16: case FFI_TYPE_STRUCT: #ifdef __LITTLE_ENDIAN__ avalue[i] = p; #else avalue[i] = ((char *) p) + sizeof (UINT32) - z; #endif break; default: FFI_ASSERT(0); } } else if (z == sizeof (UINT32)) { if ((*p_arg)->type == FFI_TYPE_FLOAT) { if (freg < NFREGARG - 1) #ifdef __LITTLE_ENDIAN__ avalue[i] = (UINT32 *) pfr + (1 ^ freg++); #else avalue[i] = (UINT32 *) pfr + freg++; #endif else #ifdef __LITTLE_ENDIAN__ avalue[i] = pgr + greg; #else avalue[i] = (UINT32 *) (pgr + greg) + 1; #endif } else #ifdef __LITTLE_ENDIAN__ avalue[i] = pgr + greg; #else avalue[i] = (UINT32 *) (pgr + greg) + 1; #endif greg++; } else if ((*p_arg)->type == FFI_TYPE_DOUBLE) { if (freg + 1 >= NFREGARG) avalue[i] = pgr + greg; else { freg = (freg + 1) & ~1; avalue[i] = pfr + (freg >> 1); freg += 2; } greg++; } else { int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); avalue[i] = pgr + greg; greg += n; } } (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_SYSV how to perform return type promotions. */ return return_type (cif->rtype); } gauche-c-wrapper-0.6.1.orig/libffi/src/sh64/ffitarget.h0000644000000000000000000000357111237307543017442 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for SuperH - SHmedia. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- Generic type definitions ----------------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #define FFI_EXTRA_CIF_FIELDS long long flags2 #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_TRAMPOLINE_SIZE 32 #define FFI_NATIVE_RAW_API 0 #endif gauche-c-wrapper-0.6.1.orig/libffi/src/sh64/sysv.S0000644000000000000000000002624611237307543016452 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 2003, 2004 Kaz Kojima SuperH SHmedia Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef HAVE_MACHINE_ASM_H #include #else /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): #endif #ifdef __LITTLE_ENDIAN__ #define OFS_FLT 0 #else #define OFS_FLT 4 #endif .section .text..SHmedia32,"ax" # r2: ffi_prep_args # r3: &ecif # r4: bytes # r5: flags # r6: flags2 # r7: rvalue # r8: fn # This assumes we are using gas. .align 5 ENTRY(ffi_call_SYSV) # Save registers .LFB1: addi.l r15, -48, r15 .LCFI0: st.q r15, 40, r32 st.q r15, 32, r31 st.q r15, 24, r30 st.q r15, 16, r29 st.q r15, 8, r28 st.l r15, 4, r18 st.l r15, 0, r14 .LCFI1: add.l r15, r63, r14 .LCFI2: # add r4, r63, r28 add r5, r63, r29 add r6, r63, r30 add r7, r63, r31 add r8, r63, r32 addi r4, (64 + 7), r4 andi r4, ~7, r4 sub.l r15, r4, r15 ptabs/l r2, tr0 add r15, r63, r2 blink tr0, r18 addi r15, 64, r22 movi 0, r0 movi 0, r1 pt/l 1f, tr1 bnei/l r29, FFI_TYPE_STRUCT, tr1 ld.l r15, 0, r19 addi r15, 8, r15 addi r0, 1, r0 1: .L_pass: andi r30, 3, r20 shlri r30, 2, r30 pt/l .L_call_it, tr0 pt/l .L_pass_i, tr1 pt/l .L_pass_f, tr2 beqi/l r20, FFI_TYPE_VOID, tr0 beqi/l r20, FFI_TYPE_INT, tr1 beqi/l r20, FFI_TYPE_FLOAT, tr2 .L_pass_d: addi r0, 1, r0 addi r1, 1, r1 andi r1, ~1, r1 pt/l 3f, tr0 movi 12, r20 bge/l r1, r20, tr0 pt/l .L_pop_d, tr1 pt/l 2f, tr0 blink tr1, r63 2: addi.l r15, 8, r15 3: pt/l .L_pass, tr0 addi r1, 2, r1 blink tr0, r63 .L_pop_d: pt/l .L_pop_d_tbl, tr1 gettr tr1, r20 shlli r1, 2, r21 add r20, r21, r20 ptabs/l r20, tr1 blink tr1, r63 .L_pop_d_tbl: fld.d r15, 0, dr0 blink tr0, r63 fld.d r15, 0, dr2 blink tr0, r63 fld.d r15, 0, dr4 blink tr0, r63 fld.d r15, 0, dr6 blink tr0, r63 fld.d r15, 0, dr8 blink tr0, r63 fld.d r15, 0, dr10 blink tr0, r63 .L_pass_f: addi r0, 1, r0 pt/l 3f, tr0 movi 12, r20 bge/l r1, r20, tr0 pt/l .L_pop_f, tr1 pt/l 2f, tr0 blink tr1, r63 2: addi.l r15, 8, r15 3: pt/l .L_pass, tr0 addi r1, 1, r1 blink tr0, r63 .L_pop_f: pt/l .L_pop_f_tbl, tr1 gettr tr1, r20 shlli r1, 3, r21 add r20, r21, r20 ptabs/l r20, tr1 blink tr1, r63 .L_pop_f_tbl: fld.s r15, OFS_FLT, fr0 blink tr0, r63 fld.s r15, OFS_FLT, fr1 blink tr0, r63 fld.s r15, OFS_FLT, fr2 blink tr0, r63 fld.s r15, OFS_FLT, fr3 blink tr0, r63 fld.s r15, OFS_FLT, fr4 blink tr0, r63 fld.s r15, OFS_FLT, fr5 blink tr0, r63 fld.s r15, OFS_FLT, fr6 blink tr0, r63 fld.s r15, OFS_FLT, fr7 blink tr0, r63 fld.s r15, OFS_FLT, fr8 blink tr0, r63 fld.s r15, OFS_FLT, fr9 blink tr0, r63 fld.s r15, OFS_FLT, fr10 blink tr0, r63 fld.s r15, OFS_FLT, fr11 blink tr0, r63 .L_pass_i: pt/l 3f, tr0 movi 8, r20 bge/l r0, r20, tr0 pt/l .L_pop_i, tr1 pt/l 2f, tr0 blink tr1, r63 2: addi.l r15, 8, r15 3: pt/l .L_pass, tr0 addi r0, 1, r0 blink tr0, r63 .L_pop_i: pt/l .L_pop_i_tbl, tr1 gettr tr1, r20 shlli r0, 3, r21 add r20, r21, r20 ptabs/l r20, tr1 blink tr1, r63 .L_pop_i_tbl: ld.q r15, 0, r2 blink tr0, r63 ld.q r15, 0, r3 blink tr0, r63 ld.q r15, 0, r4 blink tr0, r63 ld.q r15, 0, r5 blink tr0, r63 ld.q r15, 0, r6 blink tr0, r63 ld.q r15, 0, r7 blink tr0, r63 ld.q r15, 0, r8 blink tr0, r63 ld.q r15, 0, r9 blink tr0, r63 .L_call_it: # call function pt/l 1f, tr1 bnei/l r29, FFI_TYPE_STRUCT, tr1 add r19, r63, r2 1: add r22, r63, r15 ptabs/l r32, tr0 blink tr0, r18 pt/l .L_ret_i, tr0 pt/l .L_ret_ll, tr1 pt/l .L_ret_d, tr2 pt/l .L_ret_f, tr3 pt/l .L_epilogue, tr4 beqi/l r29, FFI_TYPE_INT, tr0 beqi/l r29, FFI_TYPE_UINT32, tr0 beqi/l r29, FFI_TYPE_SINT64, tr1 beqi/l r29, FFI_TYPE_UINT64, tr1 beqi/l r29, FFI_TYPE_DOUBLE, tr2 beqi/l r29, FFI_TYPE_FLOAT, tr3 pt/l .L_ret_q, tr0 pt/l .L_ret_h, tr1 beqi/l r29, FFI_TYPE_UINT8, tr0 beqi/l r29, FFI_TYPE_UINT16, tr1 blink tr4, r63 .L_ret_d: fst.d r31, 0, dr0 blink tr4, r63 .L_ret_ll: st.q r31, 0, r2 blink tr4, r63 .L_ret_f: fst.s r31, OFS_FLT, fr0 blink tr4, r63 .L_ret_q: st.b r31, 0, r2 blink tr4, r63 .L_ret_h: st.w r31, 0, r2 blink tr4, r63 .L_ret_i: st.l r31, 0, r2 # Fall .L_epilogue: # Remove the space we pushed for the args add r14, r63, r15 ld.l r15, 0, r14 ld.l r15, 4, r18 ld.q r15, 8, r28 ld.q r15, 16, r29 ld.q r15, 24, r30 ld.q r15, 32, r31 ld.q r15, 40, r32 addi.l r15, 48, r15 ptabs r18, tr0 blink tr0, r63 .LFE1: .ffi_call_SYSV_end: .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) .align 5 ENTRY(ffi_closure_SYSV) .LFB2: addi.l r15, -136, r15 .LCFI3: st.l r15, 12, r18 st.l r15, 8, r14 st.l r15, 4, r12 .LCFI4: add r15, r63, r14 .LCFI5: /* Stack layout: ... 64 bytes (register parameters) 48 bytes (floating register parameters) 8 bytes (result) 4 bytes (r18) 4 bytes (r14) 4 bytes (r12) 4 bytes (for align) <- new stack pointer */ fst.d r14, 24, dr0 fst.d r14, 32, dr2 fst.d r14, 40, dr4 fst.d r14, 48, dr6 fst.d r14, 56, dr8 fst.d r14, 64, dr10 st.q r14, 72, r2 st.q r14, 80, r3 st.q r14, 88, r4 st.q r14, 96, r5 st.q r14, 104, r6 st.q r14, 112, r7 st.q r14, 120, r8 st.q r14, 128, r9 add r1, r63, r2 addi r14, 16, r3 addi r14, 72, r4 addi r14, 24, r5 addi r14, 136, r6 #ifdef PIC movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12 shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12 .LPCS0: ptrel/u r12, tr0 movi ((ffi_closure_helper_SYSV@GOTPLT) & 65535), r1 gettr tr0, r12 ldx.l r1, r12, r1 ptabs r1, tr0 #else pt/l ffi_closure_helper_SYSV, tr0 #endif blink tr0, r18 shlli r2, 1, r1 movi (((datalabel .L_table) >> 16) & 65535), r2 shori ((datalabel .L_table) & 65535), r2 ldx.w r2, r1, r1 add r1, r2, r1 pt/l .L_case_v, tr1 ptabs r1, tr0 blink tr0, r63 .align 2 .L_table: .word .L_case_v - datalabel .L_table /* FFI_TYPE_VOID */ .word .L_case_i - datalabel .L_table /* FFI_TYPE_INT */ .word .L_case_f - datalabel .L_table /* FFI_TYPE_FLOAT */ .word .L_case_d - datalabel .L_table /* FFI_TYPE_DOUBLE */ .word .L_case_d - datalabel .L_table /* FFI_TYPE_LONGDOUBLE */ .word .L_case_uq - datalabel .L_table /* FFI_TYPE_UINT8 */ .word .L_case_q - datalabel .L_table /* FFI_TYPE_SINT8 */ .word .L_case_uh - datalabel .L_table /* FFI_TYPE_UINT16 */ .word .L_case_h - datalabel .L_table /* FFI_TYPE_SINT16 */ .word .L_case_i - datalabel .L_table /* FFI_TYPE_UINT32 */ .word .L_case_i - datalabel .L_table /* FFI_TYPE_SINT32 */ .word .L_case_ll - datalabel .L_table /* FFI_TYPE_UINT64 */ .word .L_case_ll - datalabel .L_table /* FFI_TYPE_SINT64 */ .word .L_case_v - datalabel .L_table /* FFI_TYPE_STRUCT */ .word .L_case_i - datalabel .L_table /* FFI_TYPE_POINTER */ .align 2 .L_case_d: fld.d r14, 16, dr0 blink tr1, r63 .L_case_f: fld.s r14, 16, fr0 blink tr1, r63 .L_case_ll: ld.q r14, 16, r2 blink tr1, r63 .L_case_i: ld.l r14, 16, r2 blink tr1, r63 .L_case_q: ld.b r14, 16, r2 blink tr1, r63 .L_case_uq: ld.ub r14, 16, r2 blink tr1, r63 .L_case_h: ld.w r14, 16, r2 blink tr1, r63 .L_case_uh: ld.uw r14, 16, r2 blink tr1, r63 .L_case_v: add.l r14, r63, r15 ld.l r15, 4, r12 ld.l r15, 8, r14 ld.l r15, 12, r18 addi.l r15, 136, r15 ptabs r18, tr0 blink tr0, r63 .LFE2: .ffi_closure_SYSV_end: .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) .section ".eh_frame","aw",@progbits __FRAME_BEGIN__: .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ .LSCIE1: .4byte 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ #ifdef PIC .ascii "zR\0" /* CIE Augmentation */ #else .byte 0x0 /* CIE Augmentation */ #endif .uleb128 0x1 /* CIE Code Alignment Factor */ .sleb128 -4 /* CIE Data Alignment Factor */ .byte 0x12 /* CIE RA Column */ #ifdef PIC .uleb128 0x1 /* Augmentation size */ .byte 0x10 /* FDE Encoding (pcrel) */ #endif .byte 0xc /* DW_CFA_def_cfa */ .uleb128 0xf .uleb128 0x0 .align 2 .LECIE1: .LSFDE1: .4byte datalabel .LEFDE1-datalabel .LASFDE1 /* FDE Length */ .LASFDE1: .4byte datalabel .LASFDE1-datalabel __FRAME_BEGIN__ #ifdef PIC .4byte .LFB1-. /* FDE initial location */ #else .4byte .LFB1 /* FDE initial location */ #endif .4byte datalabel .LFE1-datalabel .LFB1 /* FDE address range */ #ifdef PIC .uleb128 0x0 /* Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI0-datalabel .LFB1 .byte 0xe /* DW_CFA_def_cfa_offset */ .uleb128 0x30 .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI1-datalabel .LCFI0 .byte 0x8e /* DW_CFA_offset, column 0xe */ .uleb128 0xc .byte 0x92 /* DW_CFA_offset, column 0x12 */ .uleb128 0xb .byte 0x9c /* DW_CFA_offset, column 0x1c */ .uleb128 0xa .byte 0x9d /* DW_CFA_offset, column 0x1d */ .uleb128 0x8 .byte 0x9e /* DW_CFA_offset, column 0x1e */ .uleb128 0x6 .byte 0x9f /* DW_CFA_offset, column 0x1f */ .uleb128 0x4 .byte 0xa0 /* DW_CFA_offset, column 0x20 */ .uleb128 0x2 .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI2-datalabel .LCFI1 .byte 0xd /* DW_CFA_def_cfa_register */ .uleb128 0xe .align 2 .LEFDE1: .LSFDE3: .4byte datalabel .LEFDE3-datalabel .LASFDE3 /* FDE Length */ .LASFDE3: .4byte datalabel .LASFDE3-datalabel __FRAME_BEGIN__ #ifdef PIC .4byte .LFB2-. /* FDE initial location */ #else .4byte .LFB2 /* FDE initial location */ #endif .4byte datalabel .LFE2-datalabel .LFB2 /* FDE address range */ #ifdef PIC .uleb128 0x0 /* Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI3-datalabel .LFB2 .byte 0xe /* DW_CFA_def_cfa_offset */ .uleb128 0x88 .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI4-datalabel .LCFI3 .byte 0x8c /* DW_CFA_offset, column 0xc */ .uleb128 0x21 .byte 0x8e /* DW_CFA_offset, column 0xe */ .uleb128 0x20 .byte 0x92 /* DW_CFA_offset, column 0x12 */ .uleb128 0x1f .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte datalabel .LCFI5-datalabel .LCFI4 .byte 0xd /* DW_CFA_def_cfa_register */ .uleb128 0xe .align 2 .LEFDE3: gauche-c-wrapper-0.6.1.orig/libffi/src/sparc/0002755000000000000000000000000011237307543015636 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/sparc/ffi.c0000644000000000000000000003561711237307543016560 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1996, 2003, 2004 Red Hat, Inc. SPARC Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ void ffi_prep_args_v8(char *stack, extended_cif *ecif) { int i; void **p_argv; char *argp; ffi_type **p_arg; /* Skip 16 words for the window save area */ argp = stack + 16*sizeof(int); /* This should only really be done when we are returning a structure, however, it's faster just to do it all the time... if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) */ *(int *) argp = (long)ecif->rvalue; /* And 1 word for the structure return value. */ argp += sizeof(int); #ifdef USING_PURIFY /* Purify will probably complain in our assembly routine, unless we zero out this memory. */ ((int*)argp)[0] = 0; ((int*)argp)[1] = 0; ((int*)argp)[2] = 0; ((int*)argp)[3] = 0; ((int*)argp)[4] = 0; ((int*)argp)[5] = 0; #endif p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) { size_t z; if ((*p_arg)->type == FFI_TYPE_STRUCT #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || (*p_arg)->type == FFI_TYPE_LONGDOUBLE #endif ) { *(unsigned int *) argp = (unsigned long)(* p_argv); z = sizeof(int); } else { z = (*p_arg)->size; if (z < sizeof(int)) { z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = *(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = *(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = *(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = *(UINT16 *)(* p_argv); break; default: FFI_ASSERT(0); } } else { memcpy(argp, *p_argv, z); } } p_argv++; argp += z; } return; } int ffi_prep_args_v9(char *stack, extended_cif *ecif) { int i, ret = 0; int tmp; void **p_argv; char *argp; ffi_type **p_arg; tmp = 0; /* Skip 16 words for the window save area */ argp = stack + 16*sizeof(long long); #ifdef USING_PURIFY /* Purify will probably complain in our assembly routine, unless we zero out this memory. */ ((long long*)argp)[0] = 0; ((long long*)argp)[1] = 0; ((long long*)argp)[2] = 0; ((long long*)argp)[3] = 0; ((long long*)argp)[4] = 0; ((long long*)argp)[5] = 0; #endif p_argv = ecif->avalue; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 32) { *(unsigned long long *) argp = (unsigned long)ecif->rvalue; argp += sizeof(long long); tmp = 1; } for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; i++, p_arg++) { size_t z; z = (*p_arg)->size; switch ((*p_arg)->type) { case FFI_TYPE_STRUCT: if (z > 16) { /* For structures larger than 16 bytes we pass reference. */ *(unsigned long long *) argp = (unsigned long)* p_argv; argp += sizeof(long long); tmp++; p_argv++; continue; } /* FALLTHROUGH */ case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif ret = 1; /* We should promote into FP regs as well as integer. */ break; } if (z < sizeof(long long)) { switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed long long *) argp = *(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned long long *) argp = *(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed long long *) argp = *(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned long long *) argp = *(UINT16 *)(* p_argv); break; case FFI_TYPE_SINT32: *(signed long long *) argp = *(SINT32 *)(* p_argv); break; case FFI_TYPE_UINT32: *(unsigned long long *) argp = *(UINT32 *)(* p_argv); break; case FFI_TYPE_FLOAT: *(float *) (argp + 4) = *(FLOAT32 *)(* p_argv); /* Right justify */ break; case FFI_TYPE_STRUCT: memcpy(argp, *p_argv, z); break; default: FFI_ASSERT(0); } z = sizeof(long long); tmp++; } else if (z == sizeof(long long)) { memcpy(argp, *p_argv, z); z = sizeof(long long); tmp++; } else { if ((tmp & 1) && (*p_arg)->alignment > 8) { tmp++; argp += sizeof(long long); } memcpy(argp, *p_argv, z); z = 2 * sizeof(long long); tmp += 2; } p_argv++; argp += z; } return ret; } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { int wordsize; if (cif->abi != FFI_V9) { wordsize = 4; /* If we are returning a struct, this will already have been added. Otherwise we need to add it because it's always got to be there! */ if (cif->rtype->type != FFI_TYPE_STRUCT) cif->bytes += wordsize; /* sparc call frames require that space is allocated for 6 args, even if they aren't used. Make that space if necessary. */ if (cif->bytes < 4*6+4) cif->bytes = 4*6+4; } else { wordsize = 8; /* sparc call frames require that space is allocated for 6 args, even if they aren't used. Make that space if necessary. */ if (cif->bytes < 8*6) cif->bytes = 8*6; } /* Adjust cif->bytes. to include 16 words for the window save area, and maybe the struct/union return pointer area, */ cif->bytes += 16 * wordsize; /* The stack must be 2 word aligned, so round bytes up appropriately. */ cif->bytes = ALIGN(cif->bytes, 2 * wordsize); /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif cif->flags = cif->rtype->type; break; case FFI_TYPE_STRUCT: if (cif->abi == FFI_V9 && cif->rtype->size > 32) cif->flags = FFI_TYPE_VOID; else cif->flags = FFI_TYPE_STRUCT; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: if (cif->abi != FFI_V9) { cif->flags = FFI_TYPE_SINT64; break; } /* FALLTHROUGH */ default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } int ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *flt) { ffi_type **ptr = &arg->elements[0]; while (*ptr != NULL) { if (off & ((*ptr)->alignment - 1)) off = ALIGN(off, (*ptr)->alignment); switch ((*ptr)->type) { case FFI_TYPE_STRUCT: off = ffi_v9_layout_struct(*ptr, off, ret, intg, flt); off = ALIGN(off, FFI_SIZEOF_ARG); break; case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif memmove(ret + off, flt + off, (*ptr)->size); off += (*ptr)->size; break; default: memmove(ret + off, intg + off, (*ptr)->size); off += (*ptr)->size; break; } ptr++; } return off; } #ifdef SPARC64 extern int ffi_call_v9(void *, extended_cif *, unsigned, unsigned, unsigned *, void (*fn)()); #else extern int ffi_call_v8(void *, extended_cif *, unsigned, unsigned, unsigned *, void (*fn)()); #endif void ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { extended_cif ecif; void *rval = rvalue; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ ecif.rvalue = rvalue; if (cif->rtype->type == FFI_TYPE_STRUCT) { if (cif->rtype->size <= 32) rval = alloca(64); else { rval = NULL; if (rvalue == NULL) ecif.rvalue = alloca(cif->rtype->size); } } switch (cif->abi) { case FFI_V8: #ifdef SPARC64 /* We don't yet support calling 32bit code from 64bit */ FFI_ASSERT(0); #else ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes, cif->flags, rvalue, fn); #endif break; case FFI_V9: #ifdef SPARC64 ffi_call_v9(ffi_prep_args_v9, &ecif, cif->bytes, cif->flags, rval, fn); if (rvalue && rval && cif->rtype->type == FFI_TYPE_STRUCT) ffi_v9_layout_struct(cif->rtype, 0, (char *)rvalue, (char *)rval, ((char *)rval)+32); #else /* And vice versa */ FFI_ASSERT(0); #endif break; default: FFI_ASSERT(0); break; } } #ifdef SPARC64 extern void ffi_closure_v9(void); #else extern void ffi_closure_v8(void); #endif ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { unsigned int *tramp = (unsigned int *) &closure->tramp[0]; unsigned long fn; #ifdef SPARC64 /* Trampoline address is equal to the closure address. We take advantage of that to reduce the trampoline size by 8 bytes. */ FFI_ASSERT (cif->abi == FFI_V9); fn = (unsigned long) ffi_closure_v9; tramp[0] = 0x83414000; /* rd %pc, %g1 */ tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ tramp[2] = 0x81c14000; /* jmp %g5 */ tramp[3] = 0x01000000; /* nop */ *((unsigned long *) &tramp[4]) = fn; #else unsigned long ctx = (unsigned long) closure; FFI_ASSERT (cif->abi == FFI_V8); fn = (unsigned long) ffi_closure_v8; tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ #endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ #ifdef SPARC64 asm volatile ("flush %0" : : "r" (closure) : "memory"); asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); #else asm volatile ("iflush %0" : : "r" (closure) : "memory"); asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); #endif return FFI_OK; } int ffi_closure_sparc_inner_v8(ffi_closure *closure, void *rvalue, unsigned long *gpr, unsigned long *scratch) { ffi_cif *cif; ffi_type **arg_types; void **avalue; int i, argn; cif = closure->cif; arg_types = cif->arg_types; avalue = alloca(cif->nargs * sizeof(void *)); /* Copy the caller's structure return address so that the closure returns the data directly to the caller. */ if (cif->flags == FFI_TYPE_STRUCT #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || cif->flags == FFI_TYPE_LONGDOUBLE #endif ) rvalue = (void *) gpr[0]; /* Always skip the structure return address. */ argn = 1; /* Grab the addresses of the arguments from the stack frame. */ for (i = 0; i < cif->nargs; i++) { if (arg_types[i]->type == FFI_TYPE_STRUCT #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || arg_types[i]->type == FFI_TYPE_LONGDOUBLE #endif ) { /* Straight copy of invisible reference. */ avalue[i] = (void *)gpr[argn++]; } else if ((arg_types[i]->type == FFI_TYPE_DOUBLE || arg_types[i]->type == FFI_TYPE_SINT64 || arg_types[i]->type == FFI_TYPE_UINT64) /* gpr is 8-byte aligned. */ && (argn % 2) != 0) { /* Align on a 8-byte boundary. */ scratch[0] = gpr[argn]; scratch[1] = gpr[argn+1]; avalue[i] = scratch; scratch -= 2; argn += 2; } else { /* Always right-justify. */ argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; } } /* Invoke the closure. */ (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_sparc how to perform return type promotions. */ return cif->rtype->type; } int ffi_closure_sparc_inner_v9(ffi_closure *closure, void *rvalue, unsigned long *gpr, double *fpr) { ffi_cif *cif; ffi_type **arg_types; void **avalue; int i, argn, fp_slot_max; cif = closure->cif; arg_types = cif->arg_types; avalue = alloca(cif->nargs * sizeof(void *)); /* Copy the caller's structure return address so that the closure returns the data directly to the caller. */ if (cif->flags == FFI_TYPE_VOID && cif->rtype->type == FFI_TYPE_STRUCT) { rvalue = (void *) gpr[0]; /* Skip the structure return address. */ argn = 1; } else argn = 0; fp_slot_max = 16 - argn; /* Grab the addresses of the arguments from the stack frame. */ for (i = 0; i < cif->nargs; i++) { if (arg_types[i]->type == FFI_TYPE_STRUCT) { if (arg_types[i]->size > 16) { /* Straight copy of invisible reference. */ avalue[i] = (void *)gpr[argn++]; } else { /* Left-justify. */ ffi_v9_layout_struct(arg_types[i], 0, (char *) &gpr[argn], (char *) &gpr[argn], (char *) &fpr[argn]); avalue[i] = &gpr[argn]; argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; } } else { /* Right-justify. */ argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; if (i < fp_slot_max && (arg_types[i]->type == FFI_TYPE_FLOAT || arg_types[i]->type == FFI_TYPE_DOUBLE #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || arg_types[i]->type == FFI_TYPE_LONGDOUBLE #endif )) avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; else avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; } } /* Invoke the closure. */ (closure->fun) (cif, rvalue, avalue, closure->user_data); /* Tell ffi_closure_sparc how to perform return type promotions. */ return cif->rtype->type; } gauche-c-wrapper-0.6.1.orig/libffi/src/sparc/ffitarget.h0000644000000000000000000000401511237307543017760 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for SPARC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- System specific configurations ----------------------------------- */ #if defined(__arch64__) || defined(__sparcv9) #define SPARC64 #endif #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_V8, FFI_V8PLUS, FFI_V9, #ifdef SPARC64 FFI_DEFAULT_ABI = FFI_V9, #else FFI_DEFAULT_ABI = FFI_V8, #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #define FFI_NATIVE_RAW_API 0 #ifdef SPARC64 #define FFI_TRAMPOLINE_SIZE 24 #else #define FFI_TRAMPOLINE_SIZE 16 #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/src/sparc/v8.S0000644000000000000000000001416011237307543016317 0ustar /* ----------------------------------------------------------------------- v8.S - Copyright (c) 1996, 1997, 2003, 2004 Red Hat, Inc. SPARC Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #define STACKFRAME 96 /* Minimum stack framesize for SPARC */ #define ARGS (64+4) /* Offset of register area in frame */ .text .align 8 .globl ffi_call_v8 .globl _ffi_call_v8 ffi_call_v8: _ffi_call_v8: .LLFB1: save %sp, -STACKFRAME, %sp .LLCFI0: sub %sp, %i2, %sp ! alloca() space in stack for frame to set up add %sp, STACKFRAME, %l0 ! %l0 has start of ! frame to set up mov %l0, %o0 ! call routine to set up frame call %i0 mov %i1, %o1 ! (delay) ld [%l0+ARGS], %o0 ! call foreign function ld [%l0+ARGS+4], %o1 ld [%l0+ARGS+8], %o2 ld [%l0+ARGS+12], %o3 ld [%l0+ARGS+16], %o4 ld [%l0+ARGS+20], %o5 call %i5 mov %l0, %sp ! (delay) switch to frame nop ! STRUCT returning functions skip 12 instead of 8 bytes ! If the return value pointer is NULL, assume no return value. tst %i4 bz done nop cmp %i3, FFI_TYPE_INT be,a done st %o0, [%i4] ! (delay) cmp %i3, FFI_TYPE_FLOAT be,a done st %f0, [%i4+0] ! (delay) cmp %i3, FFI_TYPE_SINT64 be longlong cmp %i3, FFI_TYPE_DOUBLE bne done nop st %f0, [%i4+0] st %f1, [%i4+4] done: ret restore longlong: st %o0, [%i4+0] st %o1, [%i4+4] ret restore .LLFE1: .ffi_call_v8_end: .size ffi_call_v8,.ffi_call_v8_end-ffi_call_v8 #undef STACKFRAME #define STACKFRAME 104 /* 16*4 register window + 1*4 struct return + 6*4 args backing store + 3*4 locals */ /* ffi_closure_v8(...) Receives the closure argument in %g2. */ .text .align 8 .globl ffi_closure_v8 ffi_closure_v8: #ifdef HAVE_AS_REGISTER_PSEUDO_OP .register %g2, #scratch #endif .LLFB2: ! Reserve frame space for all arguments in case ! we need to align them on a 8-byte boundary. ld [%g2+FFI_TRAMPOLINE_SIZE], %g1 ld [%g1+4], %g1 sll %g1, 3, %g1 add %g1, STACKFRAME, %g1 ! %g1 == STACKFRAME + 8*nargs neg %g1 save %sp, %g1, %sp .LLCFI1: ! Store all of the potential argument registers in va_list format. st %i0, [%fp+68+0] st %i1, [%fp+68+4] st %i2, [%fp+68+8] st %i3, [%fp+68+12] st %i4, [%fp+68+16] st %i5, [%fp+68+20] ! Call ffi_closure_sparc_inner to do the bulk of the work. mov %g2, %o0 add %fp, -8, %o1 add %fp, 64, %o2 call ffi_closure_sparc_inner_v8 add %fp, -16, %o3 ! Load up the return value in the proper type. ! See ffi_prep_cif_machdep for the list of cases. cmp %o0, FFI_TYPE_VOID be done1 cmp %o0, FFI_TYPE_INT be integer cmp %o0, FFI_TYPE_FLOAT be,a done1 ld [%fp-8], %f0 cmp %o0, FFI_TYPE_DOUBLE be,a done1 ldd [%fp-8], %f0 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE cmp %o0, FFI_TYPE_LONGDOUBLE be done2 #endif cmp %o0, FFI_TYPE_STRUCT be done2 ! FFI_TYPE_SINT64 ! FFI_TYPE_UINT64 ld [%fp-4], %i1 integer: ld [%fp-8], %i0 done1: jmp %i7+8 restore done2: ! Skip 'unimp'. jmp %i7+12 restore .LLFE2: .ffi_closure_v8_end: .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 #ifdef SPARC64 #define WS 8 #define nword xword #define uanword uaxword #else #define WS 4 #define nword long #define uanword uaword #endif #ifdef HAVE_RO_EH_FRAME .section ".eh_frame",#alloc #else .section ".eh_frame",#alloc,#write #endif .LLframe1: .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry .LLSCIE1: .uaword 0x0 ! CIE Identifier Tag .byte 0x1 ! CIE Version .ascii "zR\0" ! CIE Augmentation .byte 0x1 ! uleb128 0x1; CIE Code Alignment Factor .byte 0x80-WS ! sleb128 -WS; CIE Data Alignment Factor .byte 0xf ! CIE RA Column .byte 0x1 ! uleb128 0x1; Augmentation size #ifdef HAVE_AS_SPARC_UA_PCREL .byte 0x1b ! FDE Encoding (pcrel sdata4) #else .byte 0x50 ! FDE Encoding (aligned absolute) #endif .byte 0xc ! DW_CFA_def_cfa .byte 0xe ! uleb128 0xe .byte 0x0 ! uleb128 0x0 .align WS .LLECIE1: .LLSFDE1: .uaword .LLEFDE1-.LLASFDE1 ! FDE Length .LLASFDE1: .uaword .LLASFDE1-.LLframe1 ! FDE CIE offset #ifdef HAVE_AS_SPARC_UA_PCREL .uaword %r_disp32(.LLFB1) .uaword .LLFE1-.LLFB1 ! FDE address range #else .align WS .nword .LLFB1 .uanword .LLFE1-.LLFB1 ! FDE address range #endif .byte 0x0 ! uleb128 0x0; Augmentation size .byte 0x4 ! DW_CFA_advance_loc4 .uaword .LLCFI0-.LLFB1 .byte 0xd ! DW_CFA_def_cfa_register .byte 0x1e ! uleb128 0x1e .byte 0x2d ! DW_CFA_GNU_window_save .byte 0x9 ! DW_CFA_register .byte 0xf ! uleb128 0xf .byte 0x1f ! uleb128 0x1f .align WS .LLEFDE1: .LLSFDE2: .uaword .LLEFDE2-.LLASFDE2 ! FDE Length .LLASFDE2: .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset #ifdef HAVE_AS_SPARC_UA_PCREL .uaword %r_disp32(.LLFB2) .uaword .LLFE2-.LLFB2 ! FDE address range #else .align WS .nword .LLFB2 .uanword .LLFE2-.LLFB2 ! FDE address range #endif .byte 0x0 ! uleb128 0x0; Augmentation size .byte 0x4 ! DW_CFA_advance_loc4 .uaword .LLCFI1-.LLFB2 .byte 0xd ! DW_CFA_def_cfa_register .byte 0x1e ! uleb128 0x1e .byte 0x2d ! DW_CFA_GNU_window_save .byte 0x9 ! DW_CFA_register .byte 0xf ! uleb128 0xf .byte 0x1f ! uleb128 0x1f .align WS .LLEFDE2: gauche-c-wrapper-0.6.1.orig/libffi/src/sparc/v9.S0000644000000000000000000001622511237307543016324 0ustar /* ----------------------------------------------------------------------- v9.S - Copyright (c) 2000, 2003, 2004 Red Hat, Inc. SPARC 64-bit Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include #ifdef SPARC64 /* Only compile this in for 64bit builds, because otherwise the object file will have inproper architecture due to used instructions. */ #define STACKFRAME 128 /* Minimum stack framesize for SPARC */ #define STACK_BIAS 2047 #define ARGS (128) /* Offset of register area in frame */ .text .align 8 .globl ffi_call_v9 .globl _ffi_call_v9 ffi_call_v9: _ffi_call_v9: .LLFB1: save %sp, -STACKFRAME, %sp .LLCFI0: sub %sp, %i2, %sp ! alloca() space in stack for frame to set up add %sp, STACKFRAME+STACK_BIAS, %l0 ! %l0 has start of ! frame to set up mov %l0, %o0 ! call routine to set up frame call %i0 mov %i1, %o1 ! (delay) brz,pt %o0, 1f ldx [%l0+ARGS], %o0 ! call foreign function ldd [%l0+ARGS], %f0 ldd [%l0+ARGS+8], %f2 ldd [%l0+ARGS+16], %f4 ldd [%l0+ARGS+24], %f6 ldd [%l0+ARGS+32], %f8 ldd [%l0+ARGS+40], %f10 ldd [%l0+ARGS+48], %f12 ldd [%l0+ARGS+56], %f14 ldd [%l0+ARGS+64], %f16 ldd [%l0+ARGS+72], %f18 ldd [%l0+ARGS+80], %f20 ldd [%l0+ARGS+88], %f22 ldd [%l0+ARGS+96], %f24 ldd [%l0+ARGS+104], %f26 ldd [%l0+ARGS+112], %f28 ldd [%l0+ARGS+120], %f30 1: ldx [%l0+ARGS+8], %o1 ldx [%l0+ARGS+16], %o2 ldx [%l0+ARGS+24], %o3 ldx [%l0+ARGS+32], %o4 ldx [%l0+ARGS+40], %o5 call %i5 sub %l0, STACK_BIAS, %sp ! (delay) switch to frame ! If the return value pointer is NULL, assume no return value. brz,pn %i4, done nop cmp %i3, FFI_TYPE_INT be,a,pt %icc, done stx %o0, [%i4+0] ! (delay) cmp %i3, FFI_TYPE_FLOAT be,a,pn %icc, done st %f0, [%i4+0] ! (delay) cmp %i3, FFI_TYPE_DOUBLE be,a,pn %icc, done std %f0, [%i4+0] ! (delay) cmp %i3, FFI_TYPE_STRUCT be,pn %icc, dostruct cmp %i3, FFI_TYPE_LONGDOUBLE bne,pt %icc, done nop std %f0, [%i4+0] std %f2, [%i4+8] done: ret restore dostruct: /* This will not work correctly for unions. */ stx %o0, [%i4+0] stx %o1, [%i4+8] stx %o2, [%i4+16] stx %o3, [%i4+24] std %f0, [%i4+32] std %f2, [%i4+40] std %f4, [%i4+48] std %f6, [%i4+56] ret restore .LLFE1: .ffi_call_v9_end: .size ffi_call_v9,.ffi_call_v9_end-ffi_call_v9 #undef STACKFRAME #define STACKFRAME 336 /* 16*8 register window + 6*8 args backing store + 20*8 locals */ #define FP %fp+STACK_BIAS /* ffi_closure_v9(...) Receives the closure argument in %g1. */ .text .align 8 .globl ffi_closure_v9 ffi_closure_v9: .LLFB2: save %sp, -STACKFRAME, %sp .LLCFI1: ! Store all of the potential argument registers in va_list format. stx %i0, [FP+128+0] stx %i1, [FP+128+8] stx %i2, [FP+128+16] stx %i3, [FP+128+24] stx %i4, [FP+128+32] stx %i5, [FP+128+40] ! Store possible floating point argument registers too. std %f0, [FP-128] std %f2, [FP-120] std %f4, [FP-112] std %f6, [FP-104] std %f8, [FP-96] std %f10, [FP-88] std %f12, [FP-80] std %f14, [FP-72] std %f16, [FP-64] std %f18, [FP-56] std %f20, [FP-48] std %f22, [FP-40] std %f24, [FP-32] std %f26, [FP-24] std %f28, [FP-16] std %f30, [FP-8] ! Call ffi_closure_sparc_inner to do the bulk of the work. mov %g1, %o0 add %fp, STACK_BIAS-160, %o1 add %fp, STACK_BIAS+128, %o2 call ffi_closure_sparc_inner_v9 add %fp, STACK_BIAS-128, %o3 ! Load up the return value in the proper type. ! See ffi_prep_cif_machdep for the list of cases. cmp %o0, FFI_TYPE_VOID be,pn %icc, done1 cmp %o0, FFI_TYPE_INT be,pn %icc, integer cmp %o0, FFI_TYPE_FLOAT be,a,pn %icc, done1 ld [FP-160], %f0 cmp %o0, FFI_TYPE_DOUBLE be,a,pn %icc, done1 ldd [FP-160], %f0 #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE cmp %o0, FFI_TYPE_LONGDOUBLE be,a,pn %icc, longdouble1 ldd [FP-160], %f0 #endif ! FFI_TYPE_STRUCT ldx [FP-152], %i1 ldx [FP-144], %i2 ldx [FP-136], %i3 ldd [FP-160], %f0 ldd [FP-152], %f2 ldd [FP-144], %f4 ldd [FP-136], %f6 integer: ldx [FP-160], %i0 done1: ret restore #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE longdouble1: ldd [FP-152], %f2 ret restore #endif .LLFE2: .ffi_closure_v9_end: .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 #ifdef HAVE_RO_EH_FRAME .section ".eh_frame",#alloc #else .section ".eh_frame",#alloc,#write #endif .LLframe1: .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry .LLSCIE1: .uaword 0x0 ! CIE Identifier Tag .byte 0x1 ! CIE Version .ascii "zR\0" ! CIE Augmentation .byte 0x1 ! uleb128 0x1; CIE Code Alignment Factor .byte 0x78 ! sleb128 -8; CIE Data Alignment Factor .byte 0xf ! CIE RA Column .byte 0x1 ! uleb128 0x1; Augmentation size #ifdef HAVE_AS_SPARC_UA_PCREL .byte 0x1b ! FDE Encoding (pcrel sdata4) #else .byte 0x50 ! FDE Encoding (aligned absolute) #endif .byte 0xc ! DW_CFA_def_cfa .byte 0xe ! uleb128 0xe .byte 0xff,0xf ! uleb128 0x7ff .align 8 .LLECIE1: .LLSFDE1: .uaword .LLEFDE1-.LLASFDE1 ! FDE Length .LLASFDE1: .uaword .LLASFDE1-.LLframe1 ! FDE CIE offset #ifdef HAVE_AS_SPARC_UA_PCREL .uaword %r_disp32(.LLFB1) .uaword .LLFE1-.LLFB1 ! FDE address range #else .align 8 .xword .LLFB1 .uaxword .LLFE1-.LLFB1 ! FDE address range #endif .byte 0x0 ! uleb128 0x0; Augmentation size .byte 0x4 ! DW_CFA_advance_loc4 .uaword .LLCFI0-.LLFB1 .byte 0xd ! DW_CFA_def_cfa_register .byte 0x1e ! uleb128 0x1e .byte 0x2d ! DW_CFA_GNU_window_save .byte 0x9 ! DW_CFA_register .byte 0xf ! uleb128 0xf .byte 0x1f ! uleb128 0x1f .align 8 .LLEFDE1: .LLSFDE2: .uaword .LLEFDE2-.LLASFDE2 ! FDE Length .LLASFDE2: .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset #ifdef HAVE_AS_SPARC_UA_PCREL .uaword %r_disp32(.LLFB2) .uaword .LLFE2-.LLFB2 ! FDE address range #else .align 8 .xword .LLFB2 .uaxword .LLFE2-.LLFB2 ! FDE address range #endif .byte 0x0 ! uleb128 0x0; Augmentation size .byte 0x4 ! DW_CFA_advance_loc4 .uaword .LLCFI1-.LLFB2 .byte 0xd ! DW_CFA_def_cfa_register .byte 0x1e ! uleb128 0x1e .byte 0x2d ! DW_CFA_GNU_window_save .byte 0x9 ! DW_CFA_register .byte 0xf ! uleb128 0xf .byte 0x1f ! uleb128 0x1f .align 8 .LLEFDE2: #endif gauche-c-wrapper-0.6.1.orig/libffi/src/types.c0000644000000000000000000000436311237307543016042 0ustar /* ----------------------------------------------------------------------- types.c - Copyright (c) 1996, 1998 Red Hat, Inc. Predefined ffi_types needed by libffi. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include /* Type definitions */ #define FFI_TYPEDEF(name, type, id) \ struct struct_align_##name { \ char c; \ type x; \ }; \ ffi_type ffi_type_##name = { \ sizeof(type), \ offsetof(struct struct_align_##name, x), \ id, NULL \ } /* Size and alignment are fake here. They must not be 0. */ ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID, NULL }; FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8); FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8); FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16); FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16); FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32); FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32); FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64); FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64); FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER); FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT); FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE); FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE); gauche-c-wrapper-0.6.1.orig/libffi/src/x86/0002755000000000000000000000000011237307543015153 5ustar gauche-c-wrapper-0.6.1.orig/libffi/src/x86/darwin.S0000644000000000000000000002270611237307543016570 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc. X86 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef __x86_64__ #define LIBFFI_ASM #include #include .text .globl _ffi_prep_args .align 4 .globl _ffi_call_SYSV #if 0 .type ffi_call_SYSV,@function #endif _ffi_call_SYSV: .LFB1: pushl %ebp .LCFI0: movl %esp,%ebp .LCFI1: /* Make room for all of the new args. */ movl 16(%ebp),%ecx subl %ecx,%esp movl %esp,%eax /* Place all of the ffi_prep_args in position */ pushl 12(%ebp) pushl %eax call *8(%ebp) /* Return stack to previous state and call the function */ addl $8,%esp call *28(%ebp) /* Remove the space we pushed for the args */ movl 16(%ebp),%ecx addl %ecx,%esp /* Load %ecx with the return type code */ movl 20(%ebp),%ecx /* If the return value pointer is NULL, assume no return value. */ cmpl $0,24(%ebp) jne retint /* Even if there is no space for the return value, we are obliged to handle floating-point values. */ cmpl $FFI_TYPE_FLOAT,%ecx jne noretval fstp %st(0) jmp epilogue retint: cmpl $FFI_TYPE_INT,%ecx jne retfloat /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx movl %eax,0(%ecx) jmp epilogue retfloat: cmpl $FFI_TYPE_FLOAT,%ecx jne retdouble /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstps (%ecx) jmp epilogue retdouble: cmpl $FFI_TYPE_DOUBLE,%ecx jne retlongdouble /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstpl (%ecx) jmp epilogue retlongdouble: cmpl $FFI_TYPE_LONGDOUBLE,%ecx jne retint64 /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstpt (%ecx) jmp epilogue retint64: cmpl $FFI_TYPE_SINT64,%ecx jne retstruct /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx movl %eax,0(%ecx) movl %edx,4(%ecx) retstruct: /* Nothing to do! */ noretval: epilogue: movl %ebp,%esp popl %ebp ret .LFE1: .ffi_call_SYSV_end: #if 0 .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV #endif .align 4 FFI_HIDDEN (_ffi_closure_SYSV) .globl _ffi_closure_SYSV #if 0 .type ffi_closure_SYSV, @function #endif _ffi_closure_SYSV: .LFB2: pushl %ebp .LCFI2: movl %esp, %ebp .LCFI3: subl $40, %esp leal -24(%ebp), %edx movl %edx, -12(%ebp) /* resp */ leal 8(%ebp), %edx movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ leal -12(%ebp), %edx movl %edx, (%esp) /* &resp */ #if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__ call ffi_closure_SYSV_inner #else call L_ffi_closure_SYSV_inner$stub #endif movl -12(%ebp), %ecx cmpl $FFI_TYPE_INT, %eax je .Lcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lcls_retllong .Lcls_epilogue: movl %ebp, %esp popl %ebp ret .Lcls_retint: movl (%ecx), %eax jmp .Lcls_epilogue .Lcls_retfloat: flds (%ecx) jmp .Lcls_epilogue .Lcls_retdouble: fldl (%ecx) jmp .Lcls_epilogue .Lcls_retldouble: fldt (%ecx) jmp .Lcls_epilogue .Lcls_retllong: movl (%ecx), %eax movl 4(%ecx), %edx jmp .Lcls_epilogue .LFE2: #if 0 .size ffi_closure_SYSV, .-ffi_closure_SYSV #endif #if !FFI_NO_RAW_API #define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3) #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) #define CIF_FLAGS_OFFSET 20 .align 4 FFI_HIDDEN (_ffi_closure_raw_SYSV) .globl _ffi_closure_raw_SYSV #if 0 .type ffi_closure_raw_SYSV, @function #endif _ffi_closure_raw_SYSV: .LFB3: pushl %ebp .LCFI4: movl %esp, %ebp .LCFI5: pushl %esi .LCFI6: subl $36, %esp movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ movl %edx, 12(%esp) /* user_data */ leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */ movl %edx, 8(%esp) /* raw_args */ leal -24(%ebp), %edx movl %edx, 4(%esp) /* &res */ movl %esi, (%esp) /* cif */ call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */ movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */ cmpl $FFI_TYPE_INT, %eax je .Lrcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lrcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lrcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lrcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lrcls_retllong .Lrcls_epilogue: addl $36, %esp popl %esi popl %ebp ret .Lrcls_retint: movl -24(%ebp), %eax jmp .Lrcls_epilogue .Lrcls_retfloat: flds -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retdouble: fldl -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retldouble: fldt -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retllong: movl -24(%ebp), %eax movl -20(%ebp), %edx jmp .Lrcls_epilogue .LFE3: #if 0 .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV #endif #endif .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5 L_ffi_closure_SYSV_inner$stub: .indirect_symbol _ffi_closure_SYSV_inner hlt hlt hlt hlt hlt #if 0 .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */ .LSCIE1: .long 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ #ifdef __PIC__ .ascii "zR\0" /* CIE Augmentation */ #else .ascii "\0" /* CIE Augmentation */ #endif .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */ .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */ .byte 0x8 /* CIE RA Column */ #ifdef __PIC__ .byte 0x1 /* .uleb128 0x1; Augmentation size */ .byte 0x1b /* FDE Encoding (pcrel sdata4) */ #endif .byte 0xc /* DW_CFA_def_cfa */ .byte 0x4 /* .uleb128 0x4 */ .byte 0x4 /* .uleb128 0x4 */ .byte 0x88 /* DW_CFA_offset, column 0x8 */ .byte 0x1 /* .uleb128 0x1 */ .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 /* FDE Length */ .LASFDE1: .long .LASFDE1-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB1-. /* FDE initial location */ #else .long .LFB1 /* FDE initial location */ #endif .long .LFE1-.LFB1 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI0-.LFB1 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI1-.LCFI0 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ .align 4 .LEFDE1: .LSFDE2: .long .LEFDE2-.LASFDE2 /* FDE Length */ .LASFDE2: .long .LASFDE2-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB2-. /* FDE initial location */ #else .long .LFB2 #endif .long .LFE2-.LFB2 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI2-.LFB2 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI3-.LCFI2 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ #if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI7-.LCFI3 .byte 0x83 /* DW_CFA_offset, column 0x3 */ .byte 0xa /* .uleb128 0xa */ #endif .align 4 .LEFDE2: #if !FFI_NO_RAW_API .LSFDE3: .long .LEFDE3-.LASFDE3 /* FDE Length */ .LASFDE3: .long .LASFDE3-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB3-. /* FDE initial location */ #else .long .LFB3 #endif .long .LFE3-.LFB3 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI4-.LFB3 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI5-.LCFI4 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI6-.LCFI5 .byte 0x86 /* DW_CFA_offset, column 0x6 */ .byte 0x3 /* .uleb128 0x3 */ .align 4 .LEFDE3: #endif #endif #endif /* ifndef __x86_64__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/x86/ffi.c0000644000000000000000000002720711237307543016071 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. Copyright (c) 2002 Ranjit Mathew Copyright (c) 2002 Bo Thorsen Copyright (c) 2002 Roger Sayle x86 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef __x86_64__ #include #include #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ { register unsigned int i; register void **p_argv; register char *argp; register ffi_type **p_arg; argp = stack; if (ecif->cif->flags == FFI_TYPE_STRUCT) { *(void **) argp = ecif->rvalue; argp += 4; } p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++) { size_t z; /* Align if necessary */ if ((sizeof(int) - 1) & (unsigned) argp) argp = (char *) ALIGN(argp, sizeof(int)); z = (*p_arg)->size; if (z < sizeof(int)) { z = sizeof(int); switch ((*p_arg)->type) { case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; case FFI_TYPE_SINT32: *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv); break; case FFI_TYPE_UINT32: *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); break; case FFI_TYPE_STRUCT: *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); break; default: FFI_ASSERT(0); } } else { memcpy(argp, *p_argv, z); } p_argv++; argp += z; } argp = (char*) (((int)argp + 15) & ~0xf); return; } /* Perform machine dependent cif processing */ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: #if !defined(X86_WIN32) && !defined(X86_DARWIN) && !defined(X86_FREEBSD) case FFI_TYPE_STRUCT: #endif case FFI_TYPE_SINT64: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: case FFI_TYPE_LONGDOUBLE: cif->flags = (unsigned) cif->rtype->type; break; case FFI_TYPE_UINT64: cif->flags = FFI_TYPE_SINT64; break; #if 0 case FFI_TYPE_STRUCT: if (cif->rtype->size == 1) { cif->flags = FFI_TYPE_SINT8; /* same as char size */ } else if (cif->rtype->size == 2) { cif->flags = FFI_TYPE_SINT16; /* same as short size */ } else if (cif->rtype->size == 4) { cif->flags = FFI_TYPE_INT; /* same as int type */ } else if (cif->rtype->size == 8) { cif->flags = FFI_TYPE_SINT64; /* same as int64 type */ } else { cif->flags = FFI_TYPE_STRUCT; } break; #elif defined(X86_WIN32) || defined(X86_DARWIN) || defined(X86_FREEBSD) case FFI_TYPE_STRUCT: /* cif->flags is already set in ffi_prep_cif */ break; #endif default: cif->flags = FFI_TYPE_INT; break; } return FFI_OK; } /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ #ifdef X86_WIN32 /*@-declundef@*/ /*@-exportheader@*/ extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ #endif /* X86_WIN32 */ void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ void **avalue) { extended_cif ecif; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #ifdef X86_WIN32 case FFI_STDCALL: /*@-usedef@*/ ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #endif /* X86_WIN32 */ default: FFI_ASSERT(0); break; } } /** private members **/ static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, void** args, ffi_cif* cif); void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *) __attribute__ ((regparm(1))); unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *) __attribute__ ((regparm(1))); void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *) __attribute__ ((regparm(1))); /* This function is jumped to by the trampoline */ unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (closure, respp, args) ffi_closure *closure; void **respp; void *args; { // our various things... ffi_cif *cif; void **arg_area; cif = closure->cif; arg_area = (void**) alloca (cif->nargs * sizeof (void*)); /* this call will initialize ARG_AREA, such that each * element in that array points to the corresponding * value on the stack; and if the function returns * a structure, it will re-set RESP to point to the * structure return address. */ ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); (closure->fun) (cif, *respp, arg_area, closure->user_data); return cif->flags; } /*@-exportheader@*/ static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue, ffi_cif *cif) /*@=exportheader@*/ { register unsigned int i; register void **p_argv; register char *argp; register ffi_type **p_arg; argp = stack; if ( cif->flags == FFI_TYPE_STRUCT ) { *rvalue = *(void **) argp; argp += 4; } p_argv = avalue; for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) { size_t z; /* Align if necessary */ if ((sizeof(int) - 1) & (unsigned) argp) { argp = (char *) ALIGN(argp, sizeof(int)); } z = (*p_arg)->size; /* because we're little endian, this is what it turns into. */ *p_argv = (void*) argp; p_argv++; argp += z; } return; } /* How to make a trampoline. Derived from gcc/config/i386/i386.c. */ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ unsigned int __fun = (unsigned int)(FUN); \ unsigned int __ctx = (unsigned int)(CTX); \ unsigned int __dis = __fun - ((unsigned int) __tramp + FFI_TRAMPOLINE_SIZE); \ *(unsigned char*) &__tramp[0] = 0xb8; \ *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \ *(unsigned char *) &__tramp[5] = 0xe9; \ *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \ }) /* the cif must already be prep'ed */ ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data) { FFI_ASSERT (cif->abi == FFI_SYSV); FFI_INIT_TRAMPOLINE (&closure->tramp[0], \ &ffi_closure_SYSV, \ (void*)closure); closure->cif = cif; closure->user_data = user_data; closure->fun = fun; return FFI_OK; } /* ------- Native raw API support -------------------------------- */ #if !FFI_NO_RAW_API ffi_status ffi_prep_raw_closure (ffi_raw_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data) { int i; FFI_ASSERT (cif->abi == FFI_SYSV); // we currently don't support certain kinds of arguments for raw // closures. This should be implemented by a separate assembly language // routine, since it would require argument processing, something we // don't do now for performance. for (i = cif->nargs-1; i >= 0; i--) { FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT); FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE); } FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV, (void*)closure); closure->cif = cif; closure->user_data = user_data; closure->fun = fun; return FFI_OK; } static void ffi_prep_args_raw(char *stack, extended_cif *ecif) { memcpy (stack, ecif->avalue, ecif->cif->bytes); } /* we borrow this routine from libffi (it must be changed, though, to * actually call the function passed in the first argument. as of * libffi-1.20, this is not the case.) */ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); #ifdef X86_WIN32 extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), /*@out@*/ extended_cif *, unsigned, unsigned, /*@out@*/ unsigned *, void (*fn)()); #endif /* X86_WIN32 */ void ffi_raw_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, /*@dependent@*/ ffi_raw *fake_avalue) { extended_cif ecif; void **avalue = (void **)fake_avalue; ecif.cif = cif; ecif.avalue = avalue; /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { /*@-sysunrecog@*/ ecif.rvalue = alloca(cif->rtype->size); /*@=sysunrecog@*/ } else ecif.rvalue = rvalue; switch (cif->abi) { case FFI_SYSV: /*@-usedef@*/ ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #ifdef X86_WIN32 case FFI_STDCALL: /*@-usedef@*/ ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; #endif /* X86_WIN32 */ default: FFI_ASSERT(0); break; } } #endif #endif /* __x86_64__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/x86/ffi64.c0000644000000000000000000003726311237307543016246 0ustar /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2002 Bo Thorsen x86-64 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #include #include #include #include #ifdef __x86_64__ #define MAX_GPR_REGS 6 #define MAX_SSE_REGS 8 struct register_args { /* Registers for argument passing. */ UINT64 gpr[MAX_GPR_REGS]; __int128_t sse[MAX_SSE_REGS]; }; extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, void *raddr, void (*fnaddr)(), unsigned ssecount); /* All reference to register classes here is identical to the code in gcc/config/i386/i386.c. Do *not* change one without the other. */ /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception of SSESF, SSEDF classes, that are basically SSE class, just gcc will use SF or DFmode move instead of DImode to avoid reformating penalties. Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves whenever possible (upper half does contain padding). */ enum x86_64_reg_class { X86_64_NO_CLASS, X86_64_INTEGER_CLASS, X86_64_INTEGERSI_CLASS, X86_64_SSE_CLASS, X86_64_SSESF_CLASS, X86_64_SSEDF_CLASS, X86_64_SSEUP_CLASS, X86_64_X87_CLASS, X86_64_X87UP_CLASS, X86_64_COMPLEX_X87_CLASS, X86_64_MEMORY_CLASS }; #define MAX_CLASSES 4 #define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS) /* x86-64 register passing implementation. See x86-64 ABI for details. Goal of this code is to classify each 8bytes of incoming argument by the register class and assign registers accordingly. */ /* Return the union class of CLASS1 and CLASS2. See the x86-64 PS ABI for details. */ static enum x86_64_reg_class merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) { /* Rule #1: If both classes are equal, this is the resulting class. */ if (class1 == class2) return class1; /* Rule #2: If one of the classes is NO_CLASS, the resulting class is the other class. */ if (class1 == X86_64_NO_CLASS) return class2; if (class2 == X86_64_NO_CLASS) return class1; /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) return X86_64_MEMORY_CLASS; /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) return X86_64_INTEGERSI_CLASS; if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) return X86_64_INTEGER_CLASS; /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class, MEMORY is used. */ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS || class1 == X86_64_COMPLEX_X87_CLASS || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS || class2 == X86_64_COMPLEX_X87_CLASS) return X86_64_MEMORY_CLASS; /* Rule #6: Otherwise class SSE is used. */ return X86_64_SSE_CLASS; } /* Classify the argument of type TYPE and mode MODE. CLASSES will be filled by the register class used to pass each word of the operand. The number of words is returned. In case the parameter should be passed in memory, 0 is returned. As a special case for zero sized containers, classes[0] will be NO_CLASS and 1 is returned. See the x86-64 PS ABI for details. */ static int classify_argument (ffi_type *type, enum x86_64_reg_class classes[], size_t byte_offset) { switch (type->type) { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: case FFI_TYPE_UINT32: case FFI_TYPE_SINT32: case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_POINTER: if (byte_offset + type->size <= 4) classes[0] = X86_64_INTEGERSI_CLASS; else classes[0] = X86_64_INTEGER_CLASS; return 1; case FFI_TYPE_FLOAT: if (byte_offset == 0) classes[0] = X86_64_SSESF_CLASS; else classes[0] = X86_64_SSE_CLASS; return 1; case FFI_TYPE_DOUBLE: classes[0] = X86_64_SSEDF_CLASS; return 1; case FFI_TYPE_LONGDOUBLE: classes[0] = X86_64_X87_CLASS; classes[1] = X86_64_X87UP_CLASS; return 2; case FFI_TYPE_STRUCT: { const int UNITS_PER_WORD = 8; int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ffi_type **ptr; int i; enum x86_64_reg_class subclasses[MAX_CLASSES]; /* If the struct is larger than 16 bytes, pass it on the stack. */ if (type->size > 16) return 0; for (i = 0; i < words; i++) classes[i] = X86_64_NO_CLASS; /* Merge the fields of structure. */ for (ptr = type->elements; *ptr != NULL; ptr++) { int num; byte_offset = ALIGN (byte_offset, (*ptr)->alignment); num = classify_argument (*ptr, subclasses, byte_offset % 8); if (num == 0) return 0; for (i = 0; i < num; i++) { int pos = byte_offset / 8; classes[i + pos] = merge_classes (subclasses[i], classes[i + pos]); } byte_offset += (*ptr)->size; } /* Final merger cleanup. */ for (i = 0; i < words; i++) { /* If one class is MEMORY, everything should be passed in memory. */ if (classes[i] == X86_64_MEMORY_CLASS) return 0; /* The X86_64_SSEUP_CLASS should be always preceded by X86_64_SSE_CLASS. */ if (classes[i] == X86_64_SSEUP_CLASS && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) classes[i] = X86_64_SSE_CLASS; /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ if (classes[i] == X86_64_X87UP_CLASS && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) classes[i] = X86_64_SSE_CLASS; } return words; } default: FFI_ASSERT(0); } return 0; /* Never reached. */ } /* Examine the argument and return set number of register required in each class. Return zero iff parameter should be passed in memory, otherwise the number of registers. */ static int examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES], _Bool in_return, int *pngpr, int *pnsse) { int i, n, ngpr, nsse; n = classify_argument (type, classes, 0); if (n == 0) return 0; ngpr = nsse = 0; for (i = 0; i < n; ++i) switch (classes[i]) { case X86_64_INTEGER_CLASS: case X86_64_INTEGERSI_CLASS: ngpr++; break; case X86_64_SSE_CLASS: case X86_64_SSESF_CLASS: case X86_64_SSEDF_CLASS: nsse++; break; case X86_64_NO_CLASS: case X86_64_SSEUP_CLASS: break; case X86_64_X87_CLASS: case X86_64_X87UP_CLASS: case X86_64_COMPLEX_X87_CLASS: return in_return != 0; default: abort (); } *pngpr = ngpr; *pnsse = nsse; return n; } /* Perform machine dependent cif processing. */ ffi_status ffi_prep_cif_machdep (ffi_cif *cif) { int gprcount, ssecount, i, avn, n, ngpr, nsse, flags; enum x86_64_reg_class classes[MAX_CLASSES]; size_t bytes; gprcount = ssecount = 0; flags = cif->rtype->type; if (flags != FFI_TYPE_VOID) { n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); if (n == 0) { /* The return value is passed in memory. A pointer to that memory is the first argument. Allocate a register for it. */ gprcount++; /* We don't have to do anything in asm for the return. */ flags = FFI_TYPE_VOID; } else if (flags == FFI_TYPE_STRUCT) { /* Mark which registers the result appears in. */ _Bool sse0 = SSE_CLASS_P (classes[0]); _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]); if (sse0 && !sse1) flags |= 1 << 8; else if (!sse0 && sse1) flags |= 1 << 9; else if (sse0 && sse1) flags |= 1 << 10; /* Mark the true size of the structure. */ flags |= cif->rtype->size << 12; } } /* Go over all arguments and determine the way they should be passed. If it's in a register and there is space for it, let that be so. If not, add it's size to the stack byte count. */ for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++) { if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0 || gprcount + ngpr > MAX_GPR_REGS || ssecount + nsse > MAX_SSE_REGS) { long align = cif->arg_types[i]->alignment; if (align < 8) align = 8; bytes = ALIGN(bytes, align); bytes += cif->arg_types[i]->size; } else { gprcount += ngpr; ssecount += nsse; } } if (ssecount) flags |= 1 << 11; cif->flags = flags; cif->bytes = bytes; return FFI_OK; } void ffi_call (ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) { enum x86_64_reg_class classes[MAX_CLASSES]; char *stack, *argp; ffi_type **arg_types; int gprcount, ssecount, ngpr, nsse, i, avn; _Bool ret_in_memory; struct register_args *reg_args; /* Can't call 32-bit mode from 64-bit mode. */ FFI_ASSERT (cif->abi == FFI_UNIX64); /* If the return value is a struct and we don't have a return value address then we need to make one. Note the setting of flags to VOID above in ffi_prep_cif_machdep. */ ret_in_memory = (cif->rtype->type == FFI_TYPE_STRUCT && (cif->flags & 0xff) == FFI_TYPE_VOID); if (rvalue == NULL && ret_in_memory) rvalue = alloca (cif->rtype->size); /* Allocate the space for the arguments, plus 4 words of temp space. */ stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8); reg_args = (struct register_args *) stack; argp = stack + sizeof (struct register_args); gprcount = ssecount = 0; /* If the return value is passed in memory, add the pointer as the first integer argument. */ if (ret_in_memory) reg_args->gpr[gprcount++] = (long) rvalue; avn = cif->nargs; arg_types = cif->arg_types; for (i = 0; i < avn; ++i) { size_t size = arg_types[i]->size; int n; n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); if (n == 0 || gprcount + ngpr > MAX_GPR_REGS || ssecount + nsse > MAX_SSE_REGS) { long align = arg_types[i]->alignment; /* Stack arguments are *always* at least 8 byte aligned. */ if (align < 8) align = 8; /* Pass this argument in memory. */ argp = (void *) ALIGN (argp, align); memcpy (argp, avalue[i], size); argp += size; } else { /* The argument is passed entirely in registers. */ char *a = (char *) avalue[i]; int j; for (j = 0; j < n; j++, a += 8, size -= 8) { switch (classes[j]) { case X86_64_INTEGER_CLASS: case X86_64_INTEGERSI_CLASS: reg_args->gpr[gprcount] = 0; memcpy (®_args->gpr[gprcount], a, size < 8 ? size : 8); gprcount++; break; case X86_64_SSE_CLASS: case X86_64_SSEDF_CLASS: reg_args->sse[ssecount++] = *(UINT64 *) a; break; case X86_64_SSESF_CLASS: reg_args->sse[ssecount++] = *(UINT32 *) a; break; default: abort(); } } } } ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args), cif->flags, rvalue, fn, ssecount); } extern void ffi_closure_unix64(void); ffi_status ffi_prep_closure (ffi_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*), void *user_data) { volatile unsigned short *tramp; tramp = (volatile unsigned short *) &closure->tramp[0]; tramp[0] = 0xbb49; /* mov , %r11 */ *(void * volatile *) &tramp[1] = ffi_closure_unix64; tramp[5] = 0xba49; /* mov , %r10 */ *(void * volatile *) &tramp[6] = closure; /* Set the carry bit iff the function uses any sse registers. This is clc or stc, together with the first byte of the jmp. */ tramp[10] = cif->flags & (1 << 11) ? 0x49f9 : 0x49f8; tramp[11] = 0xe3ff; /* jmp *%r11 */ closure->cif = cif; closure->fun = fun; closure->user_data = user_data; return FFI_OK; } int ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue, struct register_args *reg_args, char *argp) { ffi_cif *cif; void **avalue; ffi_type **arg_types; long i, avn; int gprcount, ssecount, ngpr, nsse; int ret; cif = closure->cif; avalue = alloca(cif->nargs * sizeof(void *)); gprcount = ssecount = 0; ret = cif->rtype->type; if (ret != FFI_TYPE_VOID) { enum x86_64_reg_class classes[MAX_CLASSES]; int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); if (n == 0) { /* The return value goes in memory. Arrange for the closure return value to go directly back to the original caller. */ rvalue = (void *) reg_args->gpr[gprcount++]; /* We don't have to do anything in asm for the return. */ ret = FFI_TYPE_VOID; } else if (ret == FFI_TYPE_STRUCT && n == 2) { /* Mark which register the second word of the structure goes in. */ _Bool sse0 = SSE_CLASS_P (classes[0]); _Bool sse1 = SSE_CLASS_P (classes[1]); if (!sse0 && sse1) ret |= 1 << 8; else if (sse0 && !sse1) ret |= 1 << 9; } } avn = cif->nargs; arg_types = cif->arg_types; for (i = 0; i < avn; ++i) { enum x86_64_reg_class classes[MAX_CLASSES]; int n; n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); if (n == 0 || gprcount + ngpr > MAX_GPR_REGS || ssecount + nsse > MAX_SSE_REGS) { long align = arg_types[i]->alignment; /* Stack arguments are *always* at least 8 byte aligned. */ if (align < 8) align = 8; /* Pass this argument in memory. */ argp = (void *) ALIGN (argp, align); avalue[i] = argp; argp += arg_types[i]->size; } /* If the argument is in a single register, or two consecutive registers, then we can use that address directly. */ else if (n == 1 || (n == 2 && SSE_CLASS_P (classes[0]) == SSE_CLASS_P (classes[1]))) { /* The argument is in a single register. */ if (SSE_CLASS_P (classes[0])) { avalue[i] = ®_args->sse[ssecount]; ssecount += n; } else { avalue[i] = ®_args->gpr[gprcount]; gprcount += n; } } /* Otherwise, allocate space to make them consecutive. */ else { char *a = alloca (16); int j; avalue[i] = a; for (j = 0; j < n; j++, a += 8) { if (SSE_CLASS_P (classes[j])) memcpy (a, ®_args->sse[ssecount++], 8); else memcpy (a, ®_args->gpr[gprcount++], 8); } } } /* Invoke the closure. */ closure->fun (cif, rvalue, avalue, closure->user_data); /* Tell assembly how to perform return type promotions. */ return ret; } #endif /* __x86_64__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/x86/ffitarget.h0000644000000000000000000000502411237307543017276 0ustar /* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Target configuration macros for x86 and x86-64. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef LIBFFI_TARGET_H #define LIBFFI_TARGET_H /* ---- System specific configurations ----------------------------------- */ #if defined (X86_64) && defined (__i386__) #undef X86_64 #define X86 #endif /* ---- Generic type definitions ----------------------------------------- */ #ifndef LIBFFI_ASM typedef unsigned long ffi_arg; typedef signed long ffi_sarg; typedef enum ffi_abi { FFI_FIRST_ABI = 0, /* ---- Intel x86 Win32 ---------- */ #ifdef X86_WIN32 FFI_SYSV, FFI_STDCALL, /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV, #endif /* ---- Intel x86 and AMD x86-64 - */ #if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) FFI_SYSV, FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ #ifdef __i386__ FFI_DEFAULT_ABI = FFI_SYSV, #else FFI_DEFAULT_ABI = FFI_UNIX64, #endif #endif FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 } ffi_abi; #endif /* ---- Definitions for closures ----------------------------------------- */ #define FFI_CLOSURES 1 #ifdef X86_64 #define FFI_TRAMPOLINE_SIZE 24 #define FFI_NATIVE_RAW_API 0 #else #define FFI_TRAMPOLINE_SIZE 10 #define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ #endif #endif gauche-c-wrapper-0.6.1.orig/libffi/src/x86/sysv.S0000644000000000000000000002230411237307543016302 0ustar /* ----------------------------------------------------------------------- sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc. X86 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifndef __x86_64__ #define LIBFFI_ASM #include #include .text .globl ffi_prep_args .align 4 .globl ffi_call_SYSV .type ffi_call_SYSV,@function ffi_call_SYSV: .LFB1: pushl %ebp .LCFI0: movl %esp,%ebp .LCFI1: /* Make room for all of the new args. */ movl 16(%ebp),%ecx subl %ecx,%esp movl %esp,%eax /* Place all of the ffi_prep_args in position */ pushl 12(%ebp) pushl %eax call *8(%ebp) /* Return stack to previous state and call the function */ addl $8,%esp call *28(%ebp) /* Remove the space we pushed for the args */ movl 16(%ebp),%ecx addl %ecx,%esp /* Load %ecx with the return type code */ movl 20(%ebp),%ecx /* If the return value pointer is NULL, assume no return value. */ cmpl $0,24(%ebp) jne retint /* Even if there is no space for the return value, we are obliged to handle floating-point values. */ cmpl $FFI_TYPE_FLOAT,%ecx jne noretval fstp %st(0) jmp epilogue retint: cmpl $FFI_TYPE_INT,%ecx jne retfloat /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx movl %eax,0(%ecx) jmp epilogue retfloat: cmpl $FFI_TYPE_FLOAT,%ecx jne retdouble /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstps (%ecx) jmp epilogue retdouble: cmpl $FFI_TYPE_DOUBLE,%ecx jne retlongdouble /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstpl (%ecx) jmp epilogue retlongdouble: cmpl $FFI_TYPE_LONGDOUBLE,%ecx jne retint64 /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx fstpt (%ecx) jmp epilogue retint64: cmpl $FFI_TYPE_SINT64,%ecx jne retstruct /* Load %ecx with the pointer to storage for the return value */ movl 24(%ebp),%ecx movl %eax,0(%ecx) movl %edx,4(%ecx) retstruct: /* Nothing to do! */ noretval: epilogue: movl %ebp,%esp popl %ebp ret .LFE1: .ffi_call_SYSV_end: .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV .align 4 FFI_HIDDEN (ffi_closure_SYSV) .globl ffi_closure_SYSV .type ffi_closure_SYSV, @function ffi_closure_SYSV: .LFB2: pushl %ebp .LCFI2: movl %esp, %ebp .LCFI3: subl $40, %esp leal -24(%ebp), %edx movl %edx, -12(%ebp) /* resp */ leal 8(%ebp), %edx movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ leal -12(%ebp), %edx movl %edx, (%esp) /* &resp */ #if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__ call ffi_closure_SYSV_inner #else movl %ebx, 8(%esp) .LCFI7: call 1f 1: popl %ebx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx call ffi_closure_SYSV_inner@PLT movl 8(%esp), %ebx #endif movl -12(%ebp), %ecx cmpl $FFI_TYPE_INT, %eax je .Lcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lcls_retllong .Lcls_epilogue: movl %ebp, %esp popl %ebp ret .Lcls_retint: movl (%ecx), %eax jmp .Lcls_epilogue .Lcls_retfloat: flds (%ecx) jmp .Lcls_epilogue .Lcls_retdouble: fldl (%ecx) jmp .Lcls_epilogue .Lcls_retldouble: fldt (%ecx) jmp .Lcls_epilogue .Lcls_retllong: movl (%ecx), %eax movl 4(%ecx), %edx jmp .Lcls_epilogue .LFE2: .size ffi_closure_SYSV, .-ffi_closure_SYSV #if !FFI_NO_RAW_API #define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3) #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) #define CIF_FLAGS_OFFSET 20 .align 4 FFI_HIDDEN (ffi_closure_raw_SYSV) .globl ffi_closure_raw_SYSV .type ffi_closure_raw_SYSV, @function ffi_closure_raw_SYSV: .LFB3: pushl %ebp .LCFI4: movl %esp, %ebp .LCFI5: pushl %esi .LCFI6: subl $36, %esp movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ movl %edx, 12(%esp) /* user_data */ leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */ movl %edx, 8(%esp) /* raw_args */ leal -24(%ebp), %edx movl %edx, 4(%esp) /* &res */ movl %esi, (%esp) /* cif */ call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */ movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */ cmpl $FFI_TYPE_INT, %eax je .Lrcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lrcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lrcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lrcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lrcls_retllong .Lrcls_epilogue: addl $36, %esp popl %esi popl %ebp ret .Lrcls_retint: movl -24(%ebp), %eax jmp .Lrcls_epilogue .Lrcls_retfloat: flds -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retdouble: fldl -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retldouble: fldt -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retllong: movl -24(%ebp), %eax movl -20(%ebp), %edx jmp .Lrcls_epilogue .LFE3: .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV #endif .section .eh_frame,EH_FRAME_FLAGS,@progbits .Lframe1: .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */ .LSCIE1: .long 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ #ifdef __PIC__ .ascii "zR\0" /* CIE Augmentation */ #else .ascii "\0" /* CIE Augmentation */ #endif .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */ .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */ .byte 0x8 /* CIE RA Column */ #ifdef __PIC__ .byte 0x1 /* .uleb128 0x1; Augmentation size */ .byte 0x1b /* FDE Encoding (pcrel sdata4) */ #endif .byte 0xc /* DW_CFA_def_cfa */ .byte 0x4 /* .uleb128 0x4 */ .byte 0x4 /* .uleb128 0x4 */ .byte 0x88 /* DW_CFA_offset, column 0x8 */ .byte 0x1 /* .uleb128 0x1 */ .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 /* FDE Length */ .LASFDE1: .long .LASFDE1-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB1-. /* FDE initial location */ #else .long .LFB1 /* FDE initial location */ #endif .long .LFE1-.LFB1 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI0-.LFB1 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI1-.LCFI0 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ .align 4 .LEFDE1: .LSFDE2: .long .LEFDE2-.LASFDE2 /* FDE Length */ .LASFDE2: .long .LASFDE2-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB2-. /* FDE initial location */ #else .long .LFB2 #endif .long .LFE2-.LFB2 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI2-.LFB2 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI3-.LCFI2 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ #if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI7-.LCFI3 .byte 0x83 /* DW_CFA_offset, column 0x3 */ .byte 0xa /* .uleb128 0xa */ #endif .align 4 .LEFDE2: #if !FFI_NO_RAW_API .LSFDE3: .long .LEFDE3-.LASFDE3 /* FDE Length */ .LASFDE3: .long .LASFDE3-.Lframe1 /* FDE CIE offset */ #ifdef __PIC__ .long .LFB3-. /* FDE initial location */ #else .long .LFB3 #endif .long .LFE3-.LFB3 /* FDE address range */ #ifdef __PIC__ .byte 0x0 /* .uleb128 0x0; Augmentation size */ #endif .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI4-.LFB3 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 /* .uleb128 0x8 */ .byte 0x85 /* DW_CFA_offset, column 0x5 */ .byte 0x2 /* .uleb128 0x2 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI5-.LCFI4 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0x5 /* .uleb128 0x5 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LCFI6-.LCFI5 .byte 0x86 /* DW_CFA_offset, column 0x6 */ .byte 0x3 /* .uleb128 0x3 */ .align 4 .LEFDE3: #endif #endif /* ifndef __x86_64__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/x86/unix64.S0000644000000000000000000002555211237307543016443 0ustar /* ----------------------------------------------------------------------- unix64.S - Copyright (c) 2002 Bo Thorsen x86-64 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #ifdef __x86_64__ #define LIBFFI_ASM #include #include .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, void *raddr, void (*fnaddr)()); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also deallocate some of the stack that has been alloca'd. */ .align 2 .globl ffi_call_unix64 .type ffi_call_unix64,@function ffi_call_unix64: .LUW0: movq (%rsp), %r10 /* Load return address. */ leaq (%rdi, %rsi), %rax /* Find local stack base. */ movq %rdx, (%rax) /* Save flags. */ movq %rcx, 8(%rax) /* Save raddr. */ movq %rbp, 16(%rax) /* Save old frame pointer. */ movq %r10, 24(%rax) /* Relocate return address. */ movq %rax, %rbp /* Finalize local stack frame. */ .LUW1: movq %rdi, %r10 /* Save a copy of the register area. */ movq %r8, %r11 /* Save a copy of the target fn. */ movl %r9d, %eax /* Set number of SSE registers. */ /* Load up all argument registers. */ movq (%r10), %rdi movq 8(%r10), %rsi movq 16(%r10), %rdx movq 24(%r10), %rcx movq 32(%r10), %r8 movq 40(%r10), %r9 testl %eax, %eax jnz .Lload_sse .Lret_from_load_sse: /* Deallocate the reg arg area. */ leaq 176(%r10), %rsp /* Call the user function. */ call *%r11 /* Deallocate stack arg area; local stack frame in redzone. */ leaq 24(%rbp), %rsp movq 0(%rbp), %rcx /* Reload flags. */ movq 8(%rbp), %rdi /* Reload raddr. */ movq 16(%rbp), %rbp /* Reload old frame pointer. */ .LUW2: /* The first byte of the flags contains the FFI_TYPE. */ movzbl %cl, %r10d leaq .Lstore_table(%rip), %r11 movslq (%r11, %r10, 4), %r10 addq %r11, %r10 jmp *%r10 .section .rodata .Lstore_table: .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */ .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */ .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */ .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */ .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */ .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */ .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */ .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */ .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */ .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */ .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */ .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */ .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */ .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */ .text .align 2 .Lst_void: ret .align 2 .Lst_uint8: movzbq %al, %rax movq %rax, (%rdi) ret .align 2 .Lst_sint8: movsbq %al, %rax movq %rax, (%rdi) ret .align 2 .Lst_uint16: movzwq %ax, %rax movq %rax, (%rdi) .align 2 .Lst_sint16: movswq %ax, %rax movq %rax, (%rdi) ret .align 2 .Lst_uint32: movl %eax, %eax movq %rax, (%rdi) .align 2 .Lst_sint32: cltq movq %rax, (%rdi) ret .align 2 .Lst_int64: movq %rax, (%rdi) ret .align 2 .Lst_float: movss %xmm0, (%rdi) ret .align 2 .Lst_double: movsd %xmm0, (%rdi) ret .Lst_ldouble: fstpt (%rdi) ret .align 2 .Lst_struct: leaq -20(%rsp), %rsi /* Scratch area in redzone. */ /* We have to locate the values now, and since we don't want to write too much data into the user's return value, we spill the value to a 16 byte scratch area first. Bits 8, 9, and 10 control where the values are located. Only one of the three bits will be set; see ffi_prep_cif_machdep for the pattern. */ movd %xmm0, %r10 movd %xmm1, %r11 testl $0x100, %ecx cmovnz %rax, %rdx cmovnz %r10, %rax testl $0x200, %ecx cmovnz %r10, %rdx testl $0x400, %ecx cmovnz %r10, %rax cmovnz %r11, %rdx movq %rax, (%rsi) movq %rdx, 8(%rsi) /* Bits 12-31 contain the true size of the structure. Copy from the scratch area to the true destination. */ shrl $12, %ecx rep movsb ret /* Many times we can avoid loading any SSE registers at all. It's not worth an indirect jump to load the exact set of SSE registers needed; zero or all is a good compromise. */ .align 2 .LUW3: .Lload_sse: movdqa 48(%r10), %xmm0 movdqa 64(%r10), %xmm1 movdqa 80(%r10), %xmm2 movdqa 96(%r10), %xmm3 movdqa 112(%r10), %xmm4 movdqa 128(%r10), %xmm5 movdqa 144(%r10), %xmm6 movdqa 160(%r10), %xmm7 jmp .Lret_from_load_sse .LUW4: .size ffi_call_unix64,.-ffi_call_unix64 .align 2 .globl ffi_closure_unix64 .type ffi_closure_unix64,@function ffi_closure_unix64: .LUW5: /* The carry flag is set by the trampoline iff SSE registers are used. Don't clobber it before the branch instruction. */ leaq -200(%rsp), %rsp .LUW6: movq %rdi, (%rsp) movq %rsi, 8(%rsp) movq %rdx, 16(%rsp) movq %rcx, 24(%rsp) movq %r8, 32(%rsp) movq %r9, 40(%rsp) jc .Lsave_sse .Lret_from_save_sse: movq %r10, %rdi leaq 176(%rsp), %rsi movq %rsp, %rdx leaq 208(%rsp), %rcx call ffi_closure_unix64_inner@PLT /* Deallocate stack frame early; return value is now in redzone. */ addq $200, %rsp .LUW7: /* The first byte of the return value contains the FFI_TYPE. */ movzbl %al, %r10d leaq .Lload_table(%rip), %r11 movslq (%r11, %r10, 4), %r10 addq %r11, %r10 jmp *%r10 .section .rodata .Lload_table: .long .Lld_void-.Lload_table /* FFI_TYPE_VOID */ .long .Lld_int32-.Lload_table /* FFI_TYPE_INT */ .long .Lld_float-.Lload_table /* FFI_TYPE_FLOAT */ .long .Lld_double-.Lload_table /* FFI_TYPE_DOUBLE */ .long .Lld_ldouble-.Lload_table /* FFI_TYPE_LONGDOUBLE */ .long .Lld_int8-.Lload_table /* FFI_TYPE_UINT8 */ .long .Lld_int8-.Lload_table /* FFI_TYPE_SINT8 */ .long .Lld_int16-.Lload_table /* FFI_TYPE_UINT16 */ .long .Lld_int16-.Lload_table /* FFI_TYPE_SINT16 */ .long .Lld_int32-.Lload_table /* FFI_TYPE_UINT32 */ .long .Lld_int32-.Lload_table /* FFI_TYPE_SINT32 */ .long .Lld_int64-.Lload_table /* FFI_TYPE_UINT64 */ .long .Lld_int64-.Lload_table /* FFI_TYPE_SINT64 */ .long .Lld_struct-.Lload_table /* FFI_TYPE_STRUCT */ .long .Lld_int64-.Lload_table /* FFI_TYPE_POINTER */ .text .align 2 .Lld_void: ret .align 2 .Lld_int8: movzbl -24(%rsp), %eax ret .align 2 .Lld_int16: movzwl -24(%rsp), %eax ret .align 2 .Lld_int32: movl -24(%rsp), %eax ret .align 2 .Lld_int64: movq -24(%rsp), %rax ret .align 2 .Lld_float: movss -24(%rsp), %xmm0 ret .align 2 .Lld_double: movsd -24(%rsp), %xmm0 ret .align 2 .Lld_ldouble: fldt -24(%rsp) ret .align 2 .Lld_struct: /* There are four possibilities here, %rax/%rdx, %xmm0/%rax, %rax/%xmm0, %xmm0/%xmm1. We collapse two by always loading both rdx and xmm1 with the second word. For the remaining, bit 8 set means xmm0 gets the second word, and bit 9 means that rax gets the second word. */ movq -24(%rsp), %rcx movq -16(%rsp), %rdx movq -16(%rsp), %xmm1 testl $0x100, %eax cmovnz %rdx, %rcx movd %rcx, %xmm0 testl $0x200, %eax movq -24(%rsp), %rax cmovnz %rdx, %rax ret /* See the comment above .Lload_sse; the same logic applies here. */ .align 2 .LUW8: .Lsave_sse: movdqa %xmm0, 48(%rsp) movdqa %xmm1, 64(%rsp) movdqa %xmm2, 80(%rsp) movdqa %xmm3, 96(%rsp) movdqa %xmm4, 112(%rsp) movdqa %xmm5, 128(%rsp) movdqa %xmm6, 144(%rsp) movdqa %xmm7, 160(%rsp) jmp .Lret_from_save_sse .LUW9: .size ffi_closure_unix64,.-ffi_closure_unix64 .section .eh_frame,"a",@progbits .Lframe1: .long .LECIE1-.LSCIE1 /* CIE Length */ .LSCIE1: .long 0 /* CIE Identifier Tag */ .byte 1 /* CIE Version */ .ascii "zR\0" /* CIE Augmentation */ .uleb128 1 /* CIE Code Alignment Factor */ .sleb128 -8 /* CIE Data Alignment Factor */ .byte 0x10 /* CIE RA Column */ .uleb128 1 /* Augmentation size */ .byte 0x1b /* FDE Encoding (pcrel sdata4) */ .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */ .uleb128 7 .uleb128 8 .byte 0x80+16 /* DW_CFA_offset, %rip offset 1*-8 */ .uleb128 1 .align 8 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 /* FDE Length */ .LASFDE1: .long .LASFDE1-.Lframe1 /* FDE CIE offset */ .long .LUW0-. /* FDE initial location */ .long .LUW4-.LUW0 /* FDE address range */ .uleb128 0x0 /* Augmentation size */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW1-.LUW0 /* New stack frame based off rbp. This is a itty bit of unwind trickery in that the CFA *has* changed. There is no easy way to describe it correctly on entry to the function. Fortunately, it doesn't matter too much since at all points we can correctly unwind back to ffi_call. Note that the location to which we moved the return address is (the new) CFA-8, so from the perspective of the unwind info, it hasn't moved. */ .byte 0xc /* DW_CFA_def_cfa, %rbp offset 32 */ .uleb128 6 .uleb128 32 .byte 0x80+6 /* DW_CFA_offset, %rbp offset 2*-8 */ .uleb128 2 .byte 0xa /* DW_CFA_remember_state */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW2-.LUW1 .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */ .uleb128 7 .uleb128 8 .byte 0xc0+6 /* DW_CFA_restore, %rbp */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW3-.LUW2 .byte 0xb /* DW_CFA_restore_state */ .align 8 .LEFDE1: .LSFDE3: .long .LEFDE3-.LASFDE3 /* FDE Length */ .LASFDE3: .long .LASFDE3-.Lframe1 /* FDE CIE offset */ .long .LUW5-. /* FDE initial location */ .long .LUW9-.LUW5 /* FDE address range */ .uleb128 0x0 /* Augmentation size */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW6-.LUW5 .byte 0xe /* DW_CFA_def_cfa_offset */ .uleb128 208 .byte 0xa /* DW_CFA_remember_state */ .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW7-.LUW6 .byte 0xe /* DW_CFA_def_cfa_offset */ .uleb128 8 .byte 0x4 /* DW_CFA_advance_loc4 */ .long .LUW8-.LUW7 .byte 0xb /* DW_CFA_restore_state */ .align 8 .LEFDE3: #endif /* __x86_64__ */ gauche-c-wrapper-0.6.1.orig/libffi/src/x86/win32.S0000644000000000000000000002307711237307543016250 0ustar /* ----------------------------------------------------------------------- win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. Copyright (c) 2001 John Beniton Copyright (c) 2002 Ranjit Mathew X86 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ #define LIBFFI_ASM #include #include .text .globl ffi_prep_args # This assumes we are using gas. .balign 16 .globl _ffi_call_SYSV _ffi_call_SYSV: pushl %ebp movl %esp,%ebp # Make room for all of the new args. movl 16(%ebp),%ecx subl %ecx,%esp movl %esp,%eax # Place all of the ffi_prep_args in position pushl 12(%ebp) pushl %eax call *8(%ebp) # Return stack to previous state and call the function addl $8,%esp # FIXME: Align the stack to a 128-bit boundary to avoid # potential performance hits. call *28(%ebp) # Remove the space we pushed for the args movl 16(%ebp),%ecx addl %ecx,%esp # Load %ecx with the return type code movl 20(%ebp),%ecx # If the return value pointer is NULL, assume no return value. cmpl $0,24(%ebp) jne retint # Even if there is no space for the return value, we are # obliged to handle floating-point values. cmpl $FFI_TYPE_FLOAT,%ecx jne noretval fstp %st(0) jmp epilogue retint: cmpl $FFI_TYPE_INT,%ecx jne retfloat # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movl %eax,0(%ecx) jmp epilogue retfloat: cmpl $FFI_TYPE_FLOAT,%ecx jne retdouble # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstps (%ecx) jmp epilogue retdouble: cmpl $FFI_TYPE_DOUBLE,%ecx jne retlongdouble # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstpl (%ecx) jmp epilogue retlongdouble: cmpl $FFI_TYPE_LONGDOUBLE,%ecx jne retint64 # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstpt (%ecx) jmp epilogue retint64: cmpl $FFI_TYPE_SINT64,%ecx jne retstruct1b # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movl %eax,0(%ecx) movl %edx,4(%ecx) retstruct1b: cmpl $FFI_TYPE_SINT8,%ecx jne retstruct2b # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movb %al,0(%ecx) jmp epilogue retstruct2b: cmpl $FFI_TYPE_SINT16,%ecx jne retstruct # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movw %ax,0(%ecx) jmp epilogue retstruct: # Nothing to do! noretval: epilogue: movl %ebp,%esp popl %ebp ret .ffi_call_SYSV_end: # This assumes we are using gas. .balign 16 .globl _ffi_call_STDCALL _ffi_call_STDCALL: pushl %ebp movl %esp,%ebp # Make room for all of the new args. movl 16(%ebp),%ecx subl %ecx,%esp movl %esp,%eax # Place all of the ffi_prep_args in position pushl 12(%ebp) pushl %eax call *8(%ebp) # Return stack to previous state and call the function addl $8,%esp # FIXME: Align the stack to a 128-bit boundary to avoid # potential performance hits. call *28(%ebp) # stdcall functions pop arguments off the stack themselves # Load %ecx with the return type code movl 20(%ebp),%ecx # If the return value pointer is NULL, assume no return value. cmpl $0,24(%ebp) jne sc_retint # Even if there is no space for the return value, we are # obliged to handle floating-point values. cmpl $FFI_TYPE_FLOAT,%ecx jne sc_noretval fstp %st(0) jmp sc_epilogue sc_retint: cmpl $FFI_TYPE_INT,%ecx jne sc_retfloat # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movl %eax,0(%ecx) jmp sc_epilogue sc_retfloat: cmpl $FFI_TYPE_FLOAT,%ecx jne sc_retdouble # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstps (%ecx) jmp sc_epilogue sc_retdouble: cmpl $FFI_TYPE_DOUBLE,%ecx jne sc_retlongdouble # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstpl (%ecx) jmp sc_epilogue sc_retlongdouble: cmpl $FFI_TYPE_LONGDOUBLE,%ecx jne sc_retint64 # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx fstpt (%ecx) jmp sc_epilogue sc_retint64: cmpl $FFI_TYPE_SINT64,%ecx jne sc_retstruct1b # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movl %eax,0(%ecx) movl %edx,4(%ecx) sc_retstruct1b: cmpl $FFI_TYPE_SINT8,%ecx jne sc_retstruct2b # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movb %al,0(%ecx) jmp sc_epilogue sc_retstruct2b: cmpl $FFI_TYPE_SINT16,%ecx jne sc_retstruct # Load %ecx with the pointer to storage for the return value movl 24(%ebp),%ecx movw %ax,0(%ecx) jmp sc_epilogue sc_retstruct: # Nothing to do! sc_noretval: sc_epilogue: movl %ebp,%esp popl %ebp ret .ffi_call_STDCALL_end: .globl _ffi_closure_SYSV _ffi_closure_SYSV: pushl %ebp movl %esp, %ebp subl $40, %esp leal -24(%ebp), %edx movl %edx, -12(%ebp) /* resp */ leal 8(%ebp), %edx movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ leal -12(%ebp), %edx movl %edx, (%esp) /* &resp */ call _ffi_closure_SYSV_inner movl -12(%ebp), %ecx cmpl $FFI_TYPE_INT, %eax je .Lcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lcls_retllong cmpl $FFI_TYPE_SINT8, %eax /* 1-byte struct */ je .Lcls_retstruct1 cmpl $FFI_TYPE_SINT16, %eax /* 2-bytes struct */ je .Lcls_retstruct2 .Lcls_epilogue: movl %ebp, %esp popl %ebp ret .Lcls_retint: movl (%ecx), %eax jmp .Lcls_epilogue .Lcls_retfloat: flds (%ecx) jmp .Lcls_epilogue .Lcls_retdouble: fldl (%ecx) jmp .Lcls_epilogue .Lcls_retldouble: fldt (%ecx) jmp .Lcls_epilogue .Lcls_retllong: movl (%ecx), %eax movl 4(%ecx), %edx jmp .Lcls_epilogue .Lcls_retstruct1: movsbl (%ecx), %eax jmp .Lcls_epilogue .Lcls_retstruct2: movswl (%ecx), %eax jmp .Lcls_epilogue .ffi_closure_SYSV_end: #if !FFI_NO_RAW_API #define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3) #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) #define CIF_FLAGS_OFFSET 20 .balign 16 .globl _ffi_closure_raw_SYSV _ffi_closure_raw_SYSV: pushl %ebp movl %esp, %ebp pushl %esi subl $36, %esp movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ movl %edx, 12(%esp) /* user_data */ leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */ movl %edx, 8(%esp) /* raw_args */ leal -24(%ebp), %edx movl %edx, 4(%esp) /* &res */ movl %esi, (%esp) /* cif */ call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */ movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */ cmpl $FFI_TYPE_INT, %eax je .Lrcls_retint cmpl $FFI_TYPE_FLOAT, %eax je .Lrcls_retfloat cmpl $FFI_TYPE_DOUBLE, %eax je .Lrcls_retdouble cmpl $FFI_TYPE_LONGDOUBLE, %eax je .Lrcls_retldouble cmpl $FFI_TYPE_SINT64, %eax je .Lrcls_retllong .Lrcls_epilogue: addl $36, %esp popl %esi popl %ebp ret .Lrcls_retint: movl -24(%ebp), %eax jmp .Lrcls_epilogue .Lrcls_retfloat: flds -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retdouble: fldl -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retldouble: fldt -24(%ebp) jmp .Lrcls_epilogue .Lrcls_retllong: movl -24(%ebp), %eax movl -20(%ebp), %edx jmp .Lrcls_epilogue .ffi_closure_raw_SYSV_end: #endif gauche-c-wrapper-0.6.1.orig/libffi/testsuite/0002755000000000000000000000000011237307544015771 5ustar gauche-c-wrapper-0.6.1.orig/libffi/testsuite/config/0002755000000000000000000000000011237307543017235 5ustar gauche-c-wrapper-0.6.1.orig/libffi/testsuite/config/default.exp0000644000000000000000000000003011237307543021366 0ustar load_lib "standard.exp" gauche-c-wrapper-0.6.1.orig/libffi/testsuite/lib/0002755000000000000000000000000011237307544016537 5ustar gauche-c-wrapper-0.6.1.orig/libffi/testsuite/lib/libffi-dg.exp0000644000000000000000000002125211237307544021100 0ustar # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # 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. proc load_gcc_lib { filename } { global srcdir load_file $srcdir/../../gcc/testsuite/lib/$filename } load_lib dg.exp load_lib libgloss.exp load_gcc_lib target-libpath.exp load_gcc_lib wrapper.exp # Define libffi callbacks for dg.exp. proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } { # To get all \n in dg-output test strings to match printf output # in a system that outputs it as \015\012 (i.e. not just \012), we # need to change all \n into \r?\n. As there is no dejagnu flag # or hook to do that, we simply change the text being tested. # Unfortunately, we have to know that the variable is called # dg-output-text and lives in the caller of libffi-dg-test, which # is two calls up. Overriding proc dg-output would be longer and # would necessarily have the same assumption. upvar 2 dg-output-text output_match if { [llength $output_match] > 1 } { regsub -all "\n" [lindex $output_match 1] "\r?\n" x set output_match [lreplace $output_match 1 1 $x] } # Set up the compiler flags, based on what we're going to do. set options [list] switch $do_what { "compile" { set compile_type "assembly" set output_file "[file rootname [file tail $prog]].s" } "link" { set compile_type "executable" set output_file "[file rootname [file tail $prog]].exe" # The following line is needed for targets like the i960 where # the default output file is b.out. Sigh. } "run" { set compile_type "executable" # FIXME: "./" is to cope with "." not being in $PATH. # Should this be handled elsewhere? # YES. set output_file "./[file rootname [file tail $prog]].exe" # This is the only place where we care if an executable was # created or not. If it was, dg.exp will try to run it. remote_file build delete $output_file; } default { perror "$do_what: not a valid dg-do keyword" return "" } } if { $extra_tool_flags != "" } { lappend options "additional_flags=$extra_tool_flags" } set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options]; return [list $comp_output $output_file] } proc libffi-dg-test { prog do_what extra_tool_flags } { return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags] } proc libffi-init { args } { global gluefile wrap_flags; global srcdir global blddirffi global objdir global blddircxx global TOOL_OPTIONS global tool global libffi_include global libffi_link_flags global tool_root_dir global ld_library_path set blddirffi [lookfor_file [get_multilibs] libffi] verbose "libffi $blddirffi" set blddircxx [lookfor_file [get_multilibs] libstdc++-v3] verbose "libstdc++ $blddircxx" set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { set gccdir [file dirname $gccdir] } verbose "gccdir $gccdir" set ld_library_path "." append ld_library_path ":${gccdir}" set compiler "${gccdir}/xgcc" if { [is_remote host] == 0 && [which $compiler] != 0 } { foreach i "[exec $compiler --print-multi-lib]" { set mldir "" regexp -- "\[a-z0-9=/\.-\]*;" $i mldir set mldir [string trimright $mldir "\;@"] if { "$mldir" == "." } { continue } if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } { append ld_library_path ":${gccdir}/${mldir}" } } } # add the library path for libffi. append ld_library_path ":${blddirffi}/.libs" # add the library path for libstdc++ as well. append ld_library_path ":${blddircxx}/src/.libs" verbose "ld_library_path: $ld_library_path" # Point to the Libffi headers in libffi. set libffi_include "${blddirffi}/include" verbose "libffi_include $libffi_include" set libffi_dir "${blddirffi}/.libs" verbose "libffi_dir $libffi_dir" if { $libffi_dir != "" } { set libffi_dir [file dirname ${libffi_dir}] set libffi_link_flags "-L${libffi_dir}/.libs" lappend libffi_link_flags "-L${blddircxx}/src/.libs" } set_ld_library_path_env_vars libffi_maybe_build_wrapper "${objdir}/testglue.o" } proc libffi_exit { } { global gluefile; if [info exists gluefile] { file_on_build delete $gluefile; unset gluefile; } } proc libffi_target_compile { source dest type options } { global gluefile wrap_flags; global srcdir global blddirffi global TOOL_OPTIONS global libffi_link_flags global libffi_include global target_triplet if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { lappend options "libs=${gluefile}" lappend options "ldflags=$wrap_flags" } # TOOL_OPTIONS must come first, so that it doesn't override testcase # specific options. if [info exists TOOL_OPTIONS] { lappend options [concat "additional_flags=$TOOL_OPTIONS" $options]; } # search for ffi_mips.h in srcdir, too lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.." lappend options "additional_flags=${libffi_link_flags}" # If you're building the compiler with --prefix set to a place # where it's not yet installed, then the linker won't be able to # find the libgcc used by libffi.dylib. We could pass the # -dylib_file option, but that's complicated, and it's much easier # to just make the linker find libgcc using -L options. if { [string match "*-*-darwin*" $target_triplet] } { lappend options "libs= -shared-libgcc" } lappend options "libs= -lffi" verbose "options: $options" return [target_compile $source $dest $type $options] } # Utility routines. # # search_for -- looks for a string match in a file # proc search_for { file pattern } { set fd [open $file r] while { [gets $fd cur_line]>=0 } { if [string match "*$pattern*" $cur_line] then { close $fd return 1 } } close $fd return 0 } # Modified dg-runtest that can cycle through a list of optimization options # as c-torture does. proc libffi-dg-runtest { testcases default-extra-flags } { global runtests foreach test $testcases { # If we're only testing specific files and this isn't one of # them, skip it. if ![runtest_file_p $runtests $test] { continue } # Look for a loop within the source code - if we don't find one, # don't pass -funroll[-all]-loops. global torture_with_loops torture_without_loops if [expr [search_for $test "for*("]+[search_for $test "while*("]] { set option_list $torture_with_loops } else { set option_list $torture_without_loops } set nshort [file tail [file dirname $test]]/[file tail $test] foreach flags $option_list { verbose "Testing $nshort, $flags" 1 dg-test $test $flags ${default-extra-flags} } } } # Like check_conditional_xfail, but callable from a dg test. proc dg-xfail-if { args } { set args [lreplace $args 0 0] set selector "target [join [lindex $args 1]]" if { [dg-process-target $selector] == "S" } { global compiler_conditional_xfail_data set compiler_conditional_xfail_data $args } } # We need to make sure that additional_files and additional_sources # are both cleared out after every test. It is not enough to clear # them out *before* the next test run because gcc-target-compile gets # run directly from some .exp files (outside of any test). (Those # uses should eventually be eliminated.) # Because the DG framework doesn't provide a hook that is run at the # end of a test, we must replace dg-test with a wrapper. if { [info procs saved-dg-test] == [list] } { rename dg-test saved-dg-test proc dg-test { args } { global additional_files global additional_sources global errorInfo if { [ catch { eval saved-dg-test $args } errmsg ] } { set saved_info $errorInfo set additional_files "" set additional_sources "" error $errmsg $saved_info } set additional_files "" set additional_sources "" } } # Local Variables: # tcl-indent-level:4 # End: gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/0002755000000000000000000000000011237307544020136 5ustar gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/call.exp0000644000000000000000000000176011237307544021571 0ustar # Copyright (C) 2003 Free Software Foundation, Inc. # 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. # libffi testsuite that uses the 'dg.exp' driver. load_lib libffi-dg.exp dg-init libffi-init global srcdir subdir dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "" dg-finish # Local Variables: # tcl-indent-level:4 # End: gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn0.c0000644000000000000000000000576711237307544022536 0ustar /* Area: closure_call Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) + (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] + (int)(*(signed short *)args[4]) + (int)(*(unsigned long long *)args[5]) + (int)*(int *)args[6] + (int)(*(int *)args[7]) + (int)(*(double *)args[8]) + (int)*(int *)args[9] + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + (int)*(int *)args[12] + (int)(*(int *)args[13]) + (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]), (int)(*(unsigned long long *)args[2]), (int)*(int *)args[3], (int)(*(signed short *)args[4]), (int)(*(unsigned long long *)args[5]), (int)*(int *)args[6], (int)(*(int *)args[7]), (int)(*(double *)args[8]), (int)*(int *)args[9], (int)(*(int *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(int *)args[14]),*(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long, int, signed short, unsigned long long, int, int, double, int, int, float, int, int, int, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_uint64; cl_arg_types[1] = &ffi_type_uint; cl_arg_types[2] = &ffi_type_uint64; cl_arg_types[3] = &ffi_type_uint; cl_arg_types[4] = &ffi_type_sshort; cl_arg_types[5] = &ffi_type_uint64; cl_arg_types[6] = &ffi_type_uint; cl_arg_types[7] = &ffi_type_uint; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_uint; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_uint; cl_arg_types[14] = &ffi_type_uint; cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type0)pcl)) (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13, 19, 21, 1); /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn1.c0000644000000000000000000000561611237307544022530 0ustar /* Area: closure_call. Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn1(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(float *)args[0] +(int)(*(float *)args[1]) + (int)(*(float *)args[2]) + (int)*(float *)args[3] + (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + (int)*(float *)args[6] + (int)(*(int *)args[7]) + (int)(*(double*)args[8]) + (int)*(int *)args[9] + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + (int)*(int *)args[12] + (int)(*(int *)args[13]) + (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(float *)args[0], (int)(*(float *)args[1]), (int)(*(float *)args[2]), (int)*(float *)args[3], (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), (int)*(float *)args[6], (int)(*(int *)args[7]), (int)(*(double *)args[8]), (int)*(int *)args[9], (int)(*(int *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type1)(float, float, float, float, signed short, float, float, int, double, int, int, float, int, int, int, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_float; cl_arg_types[1] = &ffi_type_float; cl_arg_types[2] = &ffi_type_float; cl_arg_types[3] = &ffi_type_float; cl_arg_types[4] = &ffi_type_sshort; cl_arg_types[5] = &ffi_type_float; cl_arg_types[6] = &ffi_type_float; cl_arg_types[7] = &ffi_type_uint; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_uint; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_uint; cl_arg_types[14] = &ffi_type_uint; cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type1)pcl)) (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, 19, 21, 1); /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn2.c0000644000000000000000000000564111237307544022527 0ustar /* Area: closure_call Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn2(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(double *)args[0] +(int)(*(double *)args[1]) + (int)(*(double *)args[2]) + (int)*(double *)args[3] + (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) + (int)*(double *)args[6] + (int)(*(int *)args[7]) + (int)(*(double *)args[8]) + (int)*(int *)args[9] + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + (int)*(int *)args[12] + (int)(*(float *)args[13]) + (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(double *)args[0], (int)(*(double *)args[1]), (int)(*(double *)args[2]), (int)*(double *)args[3], (int)(*(signed short *)args[4]), (int)(*(double *)args[5]), (int)*(double *)args[6], (int)(*(int *)args[7]), (int)(*(double*)args[8]), (int)*(int *)args[9], (int)(*(int *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(float *)args[13]), (int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type2)(double, double, double, double, signed short, double, double, int, double, int, int, float, int, float, int, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_double; cl_arg_types[1] = &ffi_type_double; cl_arg_types[2] = &ffi_type_double; cl_arg_types[3] = &ffi_type_double; cl_arg_types[4] = &ffi_type_sshort; cl_arg_types[5] = &ffi_type_double; cl_arg_types[6] = &ffi_type_double; cl_arg_types[7] = &ffi_type_uint; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_uint; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_float; cl_arg_types[14] = &ffi_type_uint; cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn2, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type2)pcl)) (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13, 19.0, 21, 1); /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn3.c0000644000000000000000000000566411237307544022535 0ustar /* Area: closure_call Purpose: Check multiple values passing from different type. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn3(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(float *)args[0] +(int)(*(float *)args[1]) + (int)(*(float *)args[2]) + (int)*(float *)args[3] + (int)(*(float *)args[4]) + (int)(*(float *)args[5]) + (int)*(float *)args[6] + (int)(*(float *)args[7]) + (int)(*(double *)args[8]) + (int)*(int *)args[9] + (int)(*(float *)args[10]) + (int)(*(float *)args[11]) + (int)*(int *)args[12] + (int)(*(float *)args[13]) + (int)(*(float *)args[14]) + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(float *)args[0], (int)(*(float *)args[1]), (int)(*(float *)args[2]), (int)*(float *)args[3], (int)(*(float *)args[4]), (int)(*(float *)args[5]), (int)*(float *)args[6], (int)(*(float *)args[7]), (int)(*(double *)args[8]), (int)*(int *)args[9], (int)(*(float *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(float *)args[13]), (int)(*(float *)args[14]), *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type3)(float, float, float, float, float, float, float, float, double, int, float, float, int, float, float, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_float; cl_arg_types[1] = &ffi_type_float; cl_arg_types[2] = &ffi_type_float; cl_arg_types[3] = &ffi_type_float; cl_arg_types[4] = &ffi_type_float; cl_arg_types[5] = &ffi_type_float; cl_arg_types[6] = &ffi_type_float; cl_arg_types[7] = &ffi_type_float; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_float; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_float; cl_arg_types[14] = &ffi_type_float; cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn3, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type3)pcl)) (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13, 19.19, 21.21, 1); /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */ printf("res: %d\n",res); /* { dg-output "\nres: 135" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn4.c0000644000000000000000000000603211237307544022524 0ustar /* Area: closure_call Purpose: Check multiple long long values passing. Also, exceed the limit of gpr and fpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20031026 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] + (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] + (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] + (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] + (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] + (int)*(unsigned long long *)args[10] + (int)*(unsigned long long *)args[11] + (int)*(unsigned long long *)args[12] + (int)*(unsigned long long *)args[13] + (int)*(unsigned long long *)args[14] + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(unsigned long long *)args[0], (int)*(unsigned long long *)args[1], (int)*(unsigned long long *)args[2], (int)*(unsigned long long *)args[3], (int)*(unsigned long long *)args[4], (int)*(unsigned long long *)args[5], (int)*(unsigned long long *)args[6], (int)*(unsigned long long *)args[7], (int)*(unsigned long long *)args[8], (int)*(unsigned long long *)args[9], (int)*(unsigned long long *)args[10], (int)*(unsigned long long *)args[11], (int)*(unsigned long long *)args[12], (int)*(unsigned long long *)args[13], (int)*(unsigned long long *)args[14], *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type0)(unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int i, res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif for (i = 0; i < 15; i++) { cl_arg_types[i] = &ffi_type_uint64; } cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type0)pcl)) (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL, 13LL, 19LL, 21LL, 1); /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/closure_fn5.c0000644000000000000000000000611311237307544022525 0ustar /* Area: closure_call Purpose: Check multiple long long values passing. Exceed the limit of gpr registers on PowerPC Darwin. Limitations: none. PR: none. Originator: 20031026 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] + (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] + (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] + (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] + (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] + (int)*(int *)args[10] + (int)*(unsigned long long *)args[11] + (int)*(unsigned long long *)args[12] + (int)*(unsigned long long *)args[13] + (int)*(unsigned long long *)args[14] + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(unsigned long long *)args[0], (int)*(unsigned long long *)args[1], (int)*(unsigned long long *)args[2], (int)*(unsigned long long *)args[3], (int)*(unsigned long long *)args[4], (int)*(unsigned long long *)args[5], (int)*(unsigned long long *)args[6], (int)*(unsigned long long *)args[7], (int)*(unsigned long long *)args[8], (int)*(unsigned long long *)args[9], (int)*(int *)args[10], (int)*(unsigned long long *)args[11], (int)*(unsigned long long *)args[12], (int)*(unsigned long long *)args[13], (int)*(unsigned long long *)args[14], *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg *)resp); } typedef int (*closure_test_type0)(unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, unsigned long long, int, unsigned long long, unsigned long long, unsigned long long, unsigned long long, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int i, res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif for (i = 0; i < 10; i++) { cl_arg_types[i] = &ffi_type_uint64; } cl_arg_types[10] = &ffi_type_uint; for (i = 11; i < 15; i++) { cl_arg_types[i] = &ffi_type_uint64; } cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn5, (void *) 3 /* userdata */) == FFI_OK); res = (*((closure_test_type0)pcl)) (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL, 13LL, 19LL, 21LL, 1); /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_12byte.c0000644000000000000000000000511211237307544022246 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_12byte { int a; int b; int c; } cls_struct_12byte; cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1, struct cls_struct_12byte b2) { struct cls_struct_12byte result; result.a = b1.a + b2.a; result.b = b1.b + b2.b; result.c = b1.c + b2.c; printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, result.a, result.b, result.c); return result; } static void cls_struct_12byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_12byte b1, b2; b1 = *(struct cls_struct_12byte*)(args[0]); b2 = *(struct cls_struct_12byte*)(args[1]); *(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_12byte h_dbl = { 7, 4, 9 }; struct cls_struct_12byte j_dbl = { 1, 5, 3 }; struct cls_struct_12byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_uint32; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &h_dbl; args_dbl[1] = &j_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl); /* { dg-output "7 4 9 1 5 3: 8 9 12" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 9 12" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_12byte_gn, NULL) == FFI_OK); res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(pcl))(h_dbl, j_dbl); /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 9 12" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_16byte.c0000644000000000000000000000520211237307544022252 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_16byte { int a; double b; int c; } cls_struct_16byte; cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1, struct cls_struct_16byte b2) { struct cls_struct_16byte result; result.a = b1.a + b2.a; result.b = b1.b + b2.b; result.c = b1.c + b2.c; printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, result.a, result.b, result.c); return result; } static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_16byte b1, b2; b1 = *(struct cls_struct_16byte*)(args[0]); b2 = *(struct cls_struct_16byte*)(args[1]); *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_16byte h_dbl = { 7, 8.0, 9 }; struct cls_struct_16byte j_dbl = { 1, 9.0, 3 }; struct cls_struct_16byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &h_dbl; args_dbl[1] = &j_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl); /* { dg-output "7 8 9 1 9 3: 8 17 12" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 17 12" } */ res_dbl.a = 0; res_dbl.b = 0.0; res_dbl.c = 0; CHECK(ffi_prep_closure(pcl, &cif, cls_struct_16byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(pcl))(h_dbl, j_dbl); /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 17 12" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_18byte.c0000644000000000000000000000546511237307544022267 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Double alignment check on darwin. Limitations: none. PR: none. Originator: 20030915 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_18byte { double a; unsigned char b; unsigned char c; double d; } cls_struct_18byte; cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1, struct cls_struct_18byte a2) { struct cls_struct_18byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_18byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_18byte a1, a2; a1 = *(struct cls_struct_18byte*)(args[0]); a2 = *(struct cls_struct_18byte*)(args[1]); *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 }; struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 }; struct cls_struct_18byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_double; cls_struct_fields[4] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl); /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 5 252 250 8" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_18byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 5 252 250 8" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_19byte.c0000644000000000000000000000576711237307544022275 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Double alignment check on darwin. Limitations: none. PR: none. Originator: 20030915 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_19byte { double a; unsigned char b; unsigned char c; double d; unsigned char e; } cls_struct_19byte; cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1, struct cls_struct_19byte a2) { struct cls_struct_19byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; result.e = a1.e + a2.e; printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n", a1.a, a1.b, a1.c, a1.d, a1.e, a2.a, a2.b, a2.c, a2.d, a2.e, result.a, result.b, result.c, result.d, result.e); return result; } static void cls_struct_19byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_19byte a1, a2; a1 = *(struct cls_struct_19byte*)(args[0]); a2 = *(struct cls_struct_19byte*)(args[1]); *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[6]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 }; struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 }; struct cls_struct_19byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_double; cls_struct_fields[4] = &ffi_type_uchar; cls_struct_fields[5] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl); /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 5 252 250 8 239" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_19byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 5 252 250 8 239" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_1_1byte.c0000644000000000000000000000453511237307544022414 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Limitations: none. PR: none. Originator: 20030902 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_1_1byte { unsigned char a; } cls_struct_1_1byte; cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1, struct cls_struct_1_1byte a2) { struct cls_struct_1_1byte result; result.a = a1.a + a2.a; printf("%d %d: %d\n", a1.a, a2.a, result.a); return result; } static void cls_struct_1_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_1_1byte a1, a2; a1 = *(struct cls_struct_1_1byte*)(args[0]); a2 = *(struct cls_struct_1_1byte*)(args[1]); *(cls_struct_1_1byte*)resp = cls_struct_1_1byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[2]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_1_1byte g_dbl = { 12 }; struct cls_struct_1_1byte f_dbl = { 178 }; struct cls_struct_1_1byte res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl); /* { dg-output "12 178: 190" } */ printf("res: %d\n", res_dbl.a); /* { dg-output "\nres: 190" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_1_1byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 178: 190" } */ printf("res: %d\n", res_dbl.a); /* { dg-output "\nres: 190" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_20byte.c0000644000000000000000000000511611237307544022251 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_20byte { double a; double b; int c; } cls_struct_20byte; cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2) { struct cls_struct_20byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_20byte a1, a2; a1 = *(struct cls_struct_20byte*)(args[0]); a2 = *(struct cls_struct_20byte*)(args[1]); *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 }; struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 }; struct cls_struct_20byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl); /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_20byte1.c0000644000000000000000000000511611237307544022332 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_20byte { int a; double b; double c; } cls_struct_20byte; cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2) { struct cls_struct_20byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_20byte a1, a2; a1 = *(struct cls_struct_20byte*)(args[0]); a2 = *(struct cls_struct_20byte*)(args[1]); *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 }; struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 }; struct cls_struct_20byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_double; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl); /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_24byte.c0000644000000000000000000000663311237307544022262 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_24byte { double a; double b; int c; float d; } cls_struct_24byte; cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0, struct cls_struct_24byte b1, struct cls_struct_24byte b2, struct cls_struct_24byte b3) { struct cls_struct_24byte result; result.a = b0.a + b1.a + b2.a + b3.a; result.b = b0.b + b1.b + b2.b + b3.b; result.c = b0.c + b1.c + b2.c + b3.c; result.d = b0.d + b1.d + b2.d + b3.d; printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n", b0.a, b0.b, b0.c, b0.d, b1.a, b1.b, b1.c, b1.d, b2.a, b2.b, b2.c, b2.d, b3.a, b3.b, b3.c, b2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_24byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_24byte b0, b1, b2, b3; b0 = *(struct cls_struct_24byte*)(args[0]); b1 = *(struct cls_struct_24byte*)(args[1]); b2 = *(struct cls_struct_24byte*)(args[2]); b3 = *(struct cls_struct_24byte*)(args[3]); *(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 }; struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 }; struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 }; struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 }; struct cls_struct_24byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = &ffi_type_float; cls_struct_fields[4] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = &cls_struct_type; dbl_arg_types[3] = &cls_struct_type; dbl_arg_types[4] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = &h_dbl; args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl); /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_24byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte, cls_struct_24byte, cls_struct_24byte, cls_struct_24byte)) (pcl))(e_dbl, f_dbl, g_dbl, h_dbl); /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_2byte.c0000644000000000000000000000474211237307544022175 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_2byte { unsigned char a; unsigned char b; } cls_struct_2byte; cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1, struct cls_struct_2byte a2) { struct cls_struct_2byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } static void cls_struct_2byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_2byte a1, a2; a1 = *(struct cls_struct_2byte*)(args[0]); a2 = *(struct cls_struct_2byte*)(args[1]); *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_2byte g_dbl = { 12, 127 }; struct cls_struct_2byte f_dbl = { 1, 13 }; struct cls_struct_2byte res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl); /* { dg-output "12 127 1 13: 13 140" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_2byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 127 1 13: 13 140" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_3_1byte.c0000644000000000000000000000532311237307544022412 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Limitations: none. PR: none. Originator: 20030902 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_3_1byte { unsigned char a; unsigned char b; unsigned char c; } cls_struct_3_1byte; cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1, struct cls_struct_3_1byte a2) { struct cls_struct_3_1byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_3_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_3_1byte a1, a2; a1 = *(struct cls_struct_3_1byte*)(args[0]); a2 = *(struct cls_struct_3_1byte*)(args[1]); *(cls_struct_3_1byte*)resp = cls_struct_3_1byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_3_1byte g_dbl = { 12, 13, 14 }; struct cls_struct_3_1byte f_dbl = { 178, 179, 180 }; struct cls_struct_3_1byte res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl); /* { dg-output "12 13 14 178 179 180: 190 192 194" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 190 192 194" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3_1byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 190 192 194" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_3byte1.c0000644000000000000000000000476711237307544022266 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_3byte { unsigned short a; unsigned char b; } cls_struct_3byte; cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1, struct cls_struct_3byte a2) { struct cls_struct_3byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } static void cls_struct_3byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_3byte a1, a2; a1 = *(struct cls_struct_3byte*)(args[0]); a2 = *(struct cls_struct_3byte*)(args[1]); *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_3byte g_dbl = { 12, 119 }; struct cls_struct_3byte f_dbl = { 1, 15 }; struct cls_struct_3byte res_dbl; cls_struct_fields[0] = &ffi_type_ushort; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl); /* { dg-output "12 119 1 15: 13 134" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 119 1 15: 13 134" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_3byte2.c0000644000000000000000000000503411237307544022253 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_3byte_1 { unsigned char a; unsigned short b; } cls_struct_3byte_1; cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1, struct cls_struct_3byte_1 a2) { struct cls_struct_3byte_1 result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } static void cls_struct_3byte_gn1(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_3byte_1 a1, a2; a1 = *(struct cls_struct_3byte_1*)(args[0]); a2 = *(struct cls_struct_3byte_1*)(args[1]); *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_3byte_1 g_dbl = { 15, 125 }; struct cls_struct_3byte_1 f_dbl = { 9, 19 }; struct cls_struct_3byte_1 res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl); /* { dg-output "15 125 9 19: 24 144" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn1, NULL) == FFI_OK); res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(pcl))(g_dbl, f_dbl); /* { dg-output "\n15 125 9 19: 24 144" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_4_1byte.c0000644000000000000000000000561411237307544022416 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Especially with small structures which may fit in one register. Depending on the ABI. Limitations: none. PR: none. Originator: 20030902 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_4_1byte { unsigned char a; unsigned char b; unsigned char c; unsigned char d; } cls_struct_4_1byte; cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1, struct cls_struct_4_1byte a2) { struct cls_struct_4_1byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_4_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_4_1byte a1, a2; a1 = *(struct cls_struct_4_1byte*)(args[0]); a2 = *(struct cls_struct_4_1byte*)(args[1]); *(cls_struct_4_1byte*)resp = cls_struct_4_1byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 }; struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 }; struct cls_struct_4_1byte res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_uchar; cls_struct_fields[4] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl); /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 190 192 194 196" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4_1byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 190 192 194 196" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_4byte.c0000644000000000000000000000470511237307544022176 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_4byte { unsigned short a; unsigned short b; } cls_struct_4byte; cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1, struct cls_struct_4byte a2) { struct cls_struct_4byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } static void cls_struct_4byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_4byte a1, a2; a1 = *(struct cls_struct_4byte*)(args[0]); a2 = *(struct cls_struct_4byte*)(args[1]); *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_4byte g_dbl = { 127, 120 }; struct cls_struct_4byte f_dbl = { 12, 128 }; struct cls_struct_4byte res_dbl; cls_struct_fields[0] = &ffi_type_ushort; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 12 128: 139 248" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 12 128: 139 248" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_5_1_byte.c0000644000000000000000000000606011237307544022552 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20050708 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_5byte { unsigned char a; unsigned char b; unsigned char c; unsigned char d; unsigned char e; } cls_struct_5byte; cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, struct cls_struct_5byte a2) { struct cls_struct_5byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; result.e = a1.e + a2.e; printf("%d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a1.e, a2.a, a2.b, a2.c, a2.d, a2.e, result.a, result.b, result.c, result.d, result.e); return result; } static void cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_5byte a1, a2; a1 = *(struct cls_struct_5byte*)(args[0]); a2 = *(struct cls_struct_5byte*)(args[1]); *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[6]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 }; struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 }; struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 }; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_uchar; cls_struct_fields[4] = &ffi_type_uchar; cls_struct_fields[5] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */ printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 139 248 10 6 8" } */ res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; res_dbl.d = 0; res_dbl.e = 0; CHECK(ffi_prep_closure(pcl, &cif, cls_struct_5byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */ printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 139 248 10 6 8" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_5byte.c0000644000000000000000000000526611237307544022202 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_5byte { unsigned short a; unsigned short b; unsigned char c; } cls_struct_5byte; cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, struct cls_struct_5byte a2) { struct cls_struct_5byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_5byte a1, a2; a1 = *(struct cls_struct_5byte*)(args[0]); a2 = *(struct cls_struct_5byte*)(args[1]); *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_5byte g_dbl = { 127, 120, 1 }; struct cls_struct_5byte f_dbl = { 12, 128, 9 }; struct cls_struct_5byte res_dbl = { 0, 0, 0 }; cls_struct_fields[0] = &ffi_type_ushort; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 12 128 9: 139 248 10" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; CHECK(ffi_prep_closure(pcl, &cif, cls_struct_5byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_64byte.c0000644000000000000000000000766111237307544022270 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check bigger struct which overlaps the gp and fp register count on Darwin/AIX/ppc64. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_64byte { double a; double b; double c; double d; double e; double f; double g; double h; } cls_struct_64byte; cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0, struct cls_struct_64byte b1, struct cls_struct_64byte b2, struct cls_struct_64byte b3) { struct cls_struct_64byte result; result.a = b0.a + b1.a + b2.a + b3.a; result.b = b0.b + b1.b + b2.b + b3.b; result.c = b0.c + b1.c + b2.c + b3.c; result.d = b0.d + b1.d + b2.d + b3.d; result.e = b0.e + b1.e + b2.e + b3.e; result.f = b0.f + b1.f + b2.f + b3.f; result.g = b0.g + b1.g + b2.g + b3.g; result.h = b0.h + b1.h + b2.h + b3.h; printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c, result.d, result.e, result.f, result.g, result.h); return result; } static void cls_struct_64byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_64byte b0, b1, b2, b3; b0 = *(struct cls_struct_64byte*)(args[0]); b1 = *(struct cls_struct_64byte*)(args[1]); b2 = *(struct cls_struct_64byte*)(args[2]); b3 = *(struct cls_struct_64byte*)(args[3]); *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[9]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 }; struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 }; struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 }; struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 }; struct cls_struct_64byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_double; cls_struct_fields[3] = &ffi_type_double; cls_struct_fields[4] = &ffi_type_double; cls_struct_fields[5] = &ffi_type_double; cls_struct_fields[6] = &ffi_type_double; cls_struct_fields[7] = &ffi_type_double; cls_struct_fields[8] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = &cls_struct_type; dbl_arg_types[3] = &cls_struct_type; dbl_arg_types[4] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = &h_dbl; args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl); /* { dg-output "22 15 17 25 6 13 19 18" } */ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_64byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte, cls_struct_64byte, cls_struct_64byte, cls_struct_64byte)) (pcl))(e_dbl, f_dbl, g_dbl, h_dbl); /* { dg-output "\n22 15 17 25 6 13 19 18" } */ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_6_1_byte.c0000644000000000000000000000636011237307544022556 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20050708 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_6byte { unsigned char a; unsigned char b; unsigned char c; unsigned char d; unsigned char e; unsigned char f; } cls_struct_6byte; cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, struct cls_struct_6byte a2) { struct cls_struct_6byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; result.e = a1.e + a2.e; result.f = a1.f + a2.f; printf("%d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, result.a, result.b, result.c, result.d, result.e, result.f); return result; } static void cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_6byte a1, a2; a1 = *(struct cls_struct_6byte*)(args[0]); a2 = *(struct cls_struct_6byte*)(args[1]); *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[7]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 }; struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 }; struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 }; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_uchar; cls_struct_fields[4] = &ffi_type_uchar; cls_struct_fields[5] = &ffi_type_uchar; cls_struct_fields[6] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */ printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f); /* { dg-output "\nres: 139 248 10 6 8 10" } */ res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; res_dbl.d = 0; res_dbl.e = 0; res_dbl.f = 0; CHECK(ffi_prep_closure(pcl, &cif, cls_struct_6byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */ printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f); /* { dg-output "\nres: 139 248 10 6 8 10" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_6byte.c0000644000000000000000000000546111237307544022200 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_6byte { unsigned short a; unsigned short b; unsigned char c; unsigned char d; } cls_struct_6byte; cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, struct cls_struct_6byte a2) { struct cls_struct_6byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_6byte a1, a2; a1 = *(struct cls_struct_6byte*)(args[0]); a2 = *(struct cls_struct_6byte*)(args[1]); *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 }; struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 }; struct cls_struct_6byte res_dbl; cls_struct_fields[0] = &ffi_type_ushort; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_uchar; cls_struct_fields[4] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 255" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_6byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 255" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_7_1_byte.c0000644000000000000000000000666011237307544022562 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20050708 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_7byte { unsigned char a; unsigned char b; unsigned char c; unsigned char d; unsigned char e; unsigned char f; unsigned char g; } cls_struct_7byte; cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, struct cls_struct_7byte a2) { struct cls_struct_7byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; result.e = a1.e + a2.e; result.f = a1.f + a2.f; result.g = a1.g + a2.g; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, result.a, result.b, result.c, result.d, result.e, result.f, result.g); return result; } static void cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_7byte a1, a2; a1 = *(struct cls_struct_7byte*)(args[0]); a2 = *(struct cls_struct_7byte*)(args[1]); *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[8]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 }; struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 }; struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 }; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_uchar; cls_struct_fields[4] = &ffi_type_uchar; cls_struct_fields[5] = &ffi_type_uchar; cls_struct_fields[6] = &ffi_type_uchar; cls_struct_fields[7] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */ printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ res_dbl.a = 0; res_dbl.b = 0; res_dbl.c = 0; res_dbl.d = 0; res_dbl.e = 0; res_dbl.f = 0; res_dbl.g = 0; CHECK(ffi_prep_closure(pcl, &cif, cls_struct_7byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */ printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_7byte.c0000644000000000000000000000546211237307544022202 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_7byte { unsigned short a; unsigned short b; unsigned char c; unsigned short d; } cls_struct_7byte; cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, struct cls_struct_7byte a2) { struct cls_struct_7byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; result.d = a1.d + a2.d; printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); return result; } static void cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_7byte a1, a2; a1 = *(struct cls_struct_7byte*)(args[0]); a2 = *(struct cls_struct_7byte*)(args[1]); *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 }; struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 }; struct cls_struct_7byte res_dbl; cls_struct_fields[0] = &ffi_type_ushort; cls_struct_fields[1] = &ffi_type_ushort; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = &ffi_type_ushort; cls_struct_fields[4] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl); /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 509" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_7byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 509" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_8byte.c0000644000000000000000000000461511237307544022202 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Check overlapping. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_8byte { int a; float b; } cls_struct_8byte; cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1, struct cls_struct_8byte a2) { struct cls_struct_8byte result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); return result; } static void cls_struct_8byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_8byte a1, a2; a1 = *(struct cls_struct_8byte*)(args[0]); a2 = *(struct cls_struct_8byte*)(args[1]); *(cls_struct_8byte*)resp = cls_struct_8byte_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_8byte g_dbl = { 1, 2.0 }; struct cls_struct_8byte f_dbl = { 4, 5.0 }; struct cls_struct_8byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_float; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl); /* { dg-output "1 2 4 5: 5 7" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 5 7" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_8byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(pcl))(g_dbl, f_dbl); /* { dg-output "\n1 2 4 5: 5 7" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 5 7" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_9byte1.c0000644000000000000000000000477111237307544022267 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Darwin/AIX do double-word alignment of the struct if the first element is a double. Check that it does not here. Limitations: none. PR: none. Originator: 20030914 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_9byte { int a; double b; } cls_struct_9byte; cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, struct cls_struct_9byte b2) { struct cls_struct_9byte result; result.a = b1.a + b2.a; result.b = b1.b + b2.b; printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b, result.a, result.b); return result; } static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_9byte b1, b2; b1 = *(struct cls_struct_9byte*)(args[0]); b2 = *(struct cls_struct_9byte*)(args[1]); *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[3]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_9byte h_dbl = { 7, 8.0}; struct cls_struct_9byte j_dbl = { 1, 9.0}; struct cls_struct_9byte res_dbl; cls_struct_fields[0] = &ffi_type_uint32; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &h_dbl; args_dbl[1] = &j_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl); /* { dg-output "7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl); /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_9byte2.c0000644000000000000000000000476611237307544022274 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Depending on the ABI. Darwin/AIX do double-word alignment of the struct if the first element is a double. Check that it does here. Limitations: none. PR: none. Originator: 20030914 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_9byte { double a; int b; } cls_struct_9byte; cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, struct cls_struct_9byte b2) { struct cls_struct_9byte result; result.a = b1.a + b2.a; result.b = b1.b + b2.b; printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b, result.a, result.b); return result; } static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_9byte b1, b2; b1 = *(struct cls_struct_9byte*)(args[0]); b2 = *(struct cls_struct_9byte*)(args[1]); *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[3]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_9byte h_dbl = { 7.0, 8}; struct cls_struct_9byte j_dbl = { 1.0, 9}; struct cls_struct_9byte res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_uint32; cls_struct_fields[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &h_dbl; args_dbl[1] = &j_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl); /* { dg-output "7 8 1 9: 8 17" } */ printf("res: %g %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl); /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %g %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_double.c0000644000000000000000000000506611237307544023574 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of double. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; double b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_double; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_float.c0000644000000000000000000000513311237307544023422 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of float. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; float b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_float; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_longdouble.c0000644000000000000000000000515511237307544024453 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of long double. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; long double b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_longdouble; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_pointer.c0000644000000000000000000000521111237307544023772 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of pointer. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; void *b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = (void *)((size_t)a1.b + (size_t)a2.b); result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, (size_t)a1.b, a1.c, a2.a, (size_t)a2.b, a2.c, result.a, (size_t)result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, (void *)4951, 127 }; struct cls_struct_align f_dbl = { 1, (void *)9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_pointer; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_sint16.c0000644000000000000000000000507411237307544023445 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of sint16. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; signed short b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_sint16; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_sint32.c0000644000000000000000000000507211237307544023441 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of sint32. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; signed int b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_sint32; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_sint64.c0000644000000000000000000000511211237307544023441 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of sint64. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; signed long long b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %lld %d %d %lld %d: %d %lld %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_sint64; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_uint16.c0000644000000000000000000000507611237307543023450 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of uint16. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; unsigned short b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uint16; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_uint32.c0000644000000000000000000000507411237307544023445 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of uint32. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; unsigned int b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uint32; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_align_uint64.c0000644000000000000000000000511411237307544023445 0ustar /* Area: ffi_call, closure_call Purpose: Check structure alignment of uint64. Limitations: none. PR: none. Originator: 20031203 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; unsigned long long b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %lld %d %d %lld %d: %d %lld %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_uint64; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_double.c0000644000000000000000000000223611237307544022416 0ustar /* Area: closure_call Purpose: Check return value double. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_double_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(double *)resp = *(double *)args[0]; printf("%f: %f\n",*(double *)args[0], *(double *)resp); } typedef double (*cls_ret_double)(double); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; double res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_double; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_double, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_double_fn, NULL) == FFI_OK); res = (*((cls_ret_double)pcl))(21474.789); /* { dg-output "21474.789000: 21474.789000" } */ printf("res: %.6f\n", res); /* { dg-output "\nres: 21474.789000" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_float.c0000644000000000000000000000221511237307544022246 0ustar /* Area: closure_call Purpose: Check return value float. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_float_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(float *)resp = *(float *)args[0]; printf("%g: %g\n",*(float *)args[0], *(float *)resp); } typedef float (*cls_ret_float)(float); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; float res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_float; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_float, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_float_fn, NULL) == FFI_OK); res = ((((cls_ret_float)pcl)(-2122.12))); /* { dg-output "\\-2122.12: \\-2122.12" } */ printf("res: %.6f\n", res); /* { dg-output "\nres: \-2122.120117" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_schar.c0000644000000000000000000000330411237307544023453 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple signed char values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" signed char test_func_fn(signed char a1, signed char a2) { signed char result; result = a1 + a2; printf("%d %d: %d\n", a1, a2, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { signed char a1, a2; a1 = *(signed char *)avals[0]; a2 = *(signed char *)avals[1]; *(ffi_arg *)rval = test_func_fn(a1, a2); } typedef signed char (*test_type)(signed char, signed char); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[3]; ffi_type * cl_arg_types[3]; ffi_arg res_call; signed char a, b, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 2; b = 125; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = NULL; cl_arg_types[0] = &ffi_type_schar; cl_arg_types[1] = &ffi_type_schar; cl_arg_types[2] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_schar, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "2 125: 127" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 127" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(2, 125); /* { dg-output "\n2 125: 127" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 127" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_sshort.c0000644000000000000000000000335111237307544023677 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple signed short values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" signed short test_func_fn(signed short a1, signed short a2) { signed short result; result = a1 + a2; printf("%d %d: %d\n", a1, a2, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { signed short a1, a2; a1 = *(signed short *)avals[0]; a2 = *(signed short *)avals[1]; *(ffi_arg *)rval = test_func_fn(a1, a2); } typedef signed short (*test_type)(signed short, signed short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[3]; ffi_type * cl_arg_types[3]; ffi_arg res_call; unsigned short a, b, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 2; b = 32765; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = NULL; cl_arg_types[0] = &ffi_type_sshort; cl_arg_types[1] = &ffi_type_sshort; cl_arg_types[2] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sshort, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "2 32765: 32767" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 32767" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(2, 32765); /* { dg-output "\n2 32765: 32767" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32767" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_sshortchar.c0000644000000000000000000000414311237307544024535 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple signed short/char values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" signed short test_func_fn(signed char a1, signed short a2, signed char a3, signed short a4) { signed short result; result = a1 + a2 + a3 + a4; printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { signed char a1, a3; signed short a2, a4; a1 = *(signed char *)avals[0]; a2 = *(signed short *)avals[1]; a3 = *(signed char *)avals[2]; a4 = *(signed short *)avals[3]; *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); } typedef signed short (*test_type)(signed char, signed short, signed char, signed short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[5]; ffi_type * cl_arg_types[5]; ffi_arg res_call; signed char a, c; signed short b, d, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 1; b = 32765; c = 127; d = -128; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = &c; args_dbl[3] = &d; args_dbl[4] = NULL; cl_arg_types[0] = &ffi_type_schar; cl_arg_types[1] = &ffi_type_sshort; cl_arg_types[2] = &ffi_type_schar; cl_arg_types[3] = &ffi_type_sshort; cl_arg_types[4] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &ffi_type_sshort, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "1 32765 127 -128: 32765" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 32765" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(1, 32765, 127, -128); /* { dg-output "\n1 32765 127 -128: 32765" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32765" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_uchar.c0000644000000000000000000000442211237307544023457 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple unsigned char values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" unsigned char test_func_fn(unsigned char a1, unsigned char a2, unsigned char a3, unsigned char a4) { unsigned char result; result = a1 + a2 + a3 + a4; printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { unsigned char a1, a2, a3, a4; a1 = *(unsigned char *)avals[0]; a2 = *(unsigned char *)avals[1]; a3 = *(unsigned char *)avals[2]; a4 = *(unsigned char *)avals[3]; *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); } typedef unsigned char (*test_type)(unsigned char, unsigned char, unsigned char, unsigned char); void test_func(ffi_cif *cif, void *rval, void **avals, void *data) { printf("%d %d %d %d\n", *(unsigned char *)avals[0], *(unsigned char *)avals[1], *(unsigned char *)avals[2], *(unsigned char *)avals[3]); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[5]; ffi_type * cl_arg_types[5]; ffi_arg res_call; unsigned char a, b, c, d, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 1; b = 2; c = 127; d = 125; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = &c; args_dbl[3] = &d; args_dbl[4] = NULL; cl_arg_types[0] = &ffi_type_uchar; cl_arg_types[1] = &ffi_type_uchar; cl_arg_types[2] = &ffi_type_uchar; cl_arg_types[3] = &ffi_type_uchar; cl_arg_types[4] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &ffi_type_uchar, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "1 2 127 125: 255" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 255" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(1, 2, 127, 125); /* { dg-output "\n1 2 127 125: 255" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 255" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_ushort.c0000644000000000000000000000337711237307543023710 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple unsigned short values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" unsigned short test_func_fn(unsigned short a1, unsigned short a2) { unsigned short result; result = a1 + a2; printf("%d %d: %d\n", a1, a2, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { unsigned short a1, a2; a1 = *(unsigned short *)avals[0]; a2 = *(unsigned short *)avals[1]; *(ffi_arg *)rval = test_func_fn(a1, a2); } typedef unsigned short (*test_type)(unsigned short, unsigned short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[3]; ffi_type * cl_arg_types[3]; ffi_arg res_call; unsigned short a, b, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 2; b = 32765; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = NULL; cl_arg_types[0] = &ffi_type_ushort; cl_arg_types[1] = &ffi_type_ushort; cl_arg_types[2] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_ushort, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "2 32765: 32767" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 32767" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(2, 32765); /* { dg-output "\n2 32765: 32767" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32767" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_multi_ushortchar.c0000644000000000000000000000416211237307544024540 0ustar /* Area: ffi_call, closure_call Purpose: Check passing of multiple unsigned short/char values. Limitations: none. PR: PR13221. Originator: 20031129 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" unsigned short test_func_fn(unsigned char a1, unsigned short a2, unsigned char a3, unsigned short a4) { unsigned short result; result = a1 + a2 + a3 + a4; printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); return result; } static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data) { unsigned char a1, a3; unsigned short a2, a4; a1 = *(unsigned char *)avals[0]; a2 = *(unsigned short *)avals[1]; a3 = *(unsigned char *)avals[2]; a4 = *(unsigned short *)avals[3]; *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4); } typedef unsigned short (*test_type)(unsigned char, unsigned short, unsigned char, unsigned short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void * args_dbl[5]; ffi_type * cl_arg_types[5]; ffi_arg res_call; unsigned char a, c; unsigned short b, d, res_closure; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif a = 1; b = 2; c = 127; d = 128; args_dbl[0] = &a; args_dbl[1] = &b; args_dbl[2] = &c; args_dbl[3] = &d; args_dbl[4] = NULL; cl_arg_types[0] = &ffi_type_uchar; cl_arg_types[1] = &ffi_type_ushort; cl_arg_types[2] = &ffi_type_uchar; cl_arg_types[3] = &ffi_type_ushort; cl_arg_types[4] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &ffi_type_ushort, cl_arg_types) == FFI_OK); ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl); /* { dg-output "1 2 127 128: 258" } */ printf("res: %d\n", res_call); /* { dg-output "\nres: 258" } */ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK); res_closure = (*((test_type)pcl))(1, 2, 127, 128); /* { dg-output "\n1 2 127 128: 258" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 258" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_schar.c0000644000000000000000000000220711237307544022242 0ustar /* Area: closure_call Purpose: Check return value schar. Limitations: none. PR: none. Originator: 20031108 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_schar_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = *(signed char *)args[0]; printf("%d: %d\n",*(signed char *)args[0], *(ffi_arg*)resp); } typedef signed char (*cls_ret_schar)(signed char); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; signed char res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_schar; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_schar, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_schar_fn, NULL) == FFI_OK); res = (*((cls_ret_schar)pcl))(127); /* { dg-output "127: 127" } */ printf("res: %d\n", res); /* { dg-output "\nres: 127" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_sint.c0000644000000000000000000000221011237307544022111 0ustar /* Area: closure_call Purpose: Check return value sint32. Limitations: none. PR: none. Originator: 20031108 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_sint_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = *(signed int *)args[0]; printf("%d: %d\n",*(signed int *)args[0], *(ffi_arg*)resp); } typedef signed int (*cls_ret_sint)(signed int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; signed int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_sint32; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint32, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sint_fn, NULL) == FFI_OK); res = (*((cls_ret_sint)pcl))(65534); /* { dg-output "65534: 65534" } */ printf("res: %d\n",res); /* { dg-output "\nres: 65534" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_sshort.c0000644000000000000000000000222211237307544022461 0ustar /* Area: closure_call Purpose: Check return value sshort. Limitations: none. PR: none. Originator: 20031108 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_sshort_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = *(signed short *)args[0]; printf("%d: %d\n",*(signed short *)args[0], *(ffi_arg*)resp); } typedef signed short (*cls_ret_sshort)(signed short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; signed short res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_sint16; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint16, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sshort_fn, NULL) == FFI_OK); res = (*((cls_ret_sshort)pcl))(255); /* { dg-output "255: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_uchar.c0000644000000000000000000000222011237307544022237 0ustar /* Area: closure_call Purpose: Check return value uchar. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_uchar_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = *(unsigned char *)args[0]; printf("%d: %d\n",*(unsigned char *)args[0], *(ffi_arg*)resp); } typedef unsigned char (*cls_ret_uchar)(unsigned char); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; unsigned char res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_uchar; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uchar, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uchar_fn, NULL) == FFI_OK); res = (*((cls_ret_uchar)pcl))(127); /* { dg-output "127: 127" } */ printf("res: %d\n",res); /* { dg-output "\nres: 127" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_uint.c0000644000000000000000000000225411237307544022123 0ustar /* Area: closure_call Purpose: Check return value uint. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_uint_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg *)resp = *(unsigned int *)args[0]; printf("%d: %d\n",*(unsigned int *)args[0], *(ffi_arg *)resp); } typedef unsigned int (*cls_ret_uint)(unsigned int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; unsigned int res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_uint32; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint32, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uint_fn, NULL) == FFI_OK); res = (*((cls_ret_uint)pcl))(2147483647); /* { dg-output "2147483647: 2147483647" } */ printf("res: %d\n",res); /* { dg-output "\nres: 2147483647" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_ulonglong.c0000644000000000000000000000266511237307544023156 0ustar /* Area: closure_call Purpose: Check return value long long. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_ulonglong_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(unsigned long long *)resp= *(unsigned long long *)args[0]; printf("%llu: %llu\n",*(unsigned long long *)args[0], *(unsigned long long *)resp); } typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; unsigned long long res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_uint64; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uint64, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ulonglong_fn, NULL) == FFI_OK); res = (*((cls_ret_ulonglong)pcl))(214LL); /* { dg-output "214: 214" } */ printf("res: %lld\n", res); /* { dg-output "\nres: 214" } */ res = (*((cls_ret_ulonglong)pcl))(9223372035854775808LL); /* { dg-output "\n9223372035854775808: 9223372035854775808" } */ printf("res: %lld\n", res); /* { dg-output "\nres: 9223372035854775808" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/cls_ushort.c0000644000000000000000000000225211237307544022466 0ustar /* Area: closure_call Purpose: Check return value ushort. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" static void cls_ret_ushort_fn(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = *(unsigned short *)args[0]; printf("%d: %d\n",*(unsigned short *)args[0], *(ffi_arg*)resp); } typedef unsigned short (*cls_ret_ushort)(unsigned short); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[2]; unsigned short res; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cl_arg_types[0] = &ffi_type_ushort; cl_arg_types[1] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_ushort, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ushort_fn, NULL) == FFI_OK); res = (*((cls_ret_ushort)pcl))(65535); /* { dg-output "65535: 65535" } */ printf("res: %d\n",res); /* { dg-output "\nres: 65535" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/ffitest.h0000644000000000000000000000260011237307544021747 0ustar #include #include #include #include #include #include "fficonfig.h" #define MAX_ARGS 256 #define CHECK(x) !(x) ? abort() : 0 /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a file open. */ #ifdef HAVE_MMAP_ANON # undef HAVE_MMAP_DEV_ZERO # include # ifndef MAP_FAILED # define MAP_FAILED -1 # endif # if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) # define MAP_ANONYMOUS MAP_ANON # endif # define USING_MMAP #endif #ifdef HAVE_MMAP_DEV_ZERO # include # ifndef MAP_FAILED # define MAP_FAILED -1 # endif # define USING_MMAP #endif #ifdef USING_MMAP static inline void * allocate_mmap (size_t size) { void *page; #if defined (HAVE_MMAP_DEV_ZERO) static int dev_zero_fd = -1; #endif #ifdef HAVE_MMAP_DEV_ZERO if (dev_zero_fd == -1) { dev_zero_fd = open ("/dev/zero", O_RDONLY); if (dev_zero_fd == -1) { perror ("open /dev/zero: %m"); exit (1); } } #endif #ifdef HAVE_MMAP_ANON page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); #endif #ifdef HAVE_MMAP_DEV_ZERO page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero_fd, 0); #endif if (page == (void *) MAP_FAILED) { perror ("virtual memory exhausted"); exit (1); } return page; } #endif gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/float.c0000644000000000000000000000223311237307544021405 0ustar /* Area: ffi_call Purpose: Check return value float. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static int floating(int a, float b, double c, long double d, int e) { int i; i = (int) ((float)a/b + ((float)c/(float)d)); return i; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; float f; signed int si1; double d; long double ld; signed int si2; args[0] = &ffi_type_sint; values[0] = &si1; args[1] = &ffi_type_float; values[1] = &f; args[2] = &ffi_type_double; values[2] = &d; args[3] = &ffi_type_longdouble; values[3] = &ld; args[4] = &ffi_type_sint; values[4] = &si2; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 5, &ffi_type_sint, args) == FFI_OK); si1 = 6; f = 3.14159; d = (double)1.0/(double)3.0; ld = 2.71828182846L; si2 = 10; floating (si1, f, d, ld, si2); ffi_call(&cif, FFI_FN(floating), &rint, values); printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2)); CHECK(rint == floating(si1, f, d, ld, si2)); exit (0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/float1.c0000644000000000000000000000213311237307544021465 0ustar /* Area: ffi_call Purpose: Check return value double. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include "float.h" typedef union { double d; unsigned char c[sizeof (double)]; } value_type; #define CANARY 0xba static double dblit(float f) { return f/3.0; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; float f; value_type result[2]; int i; args[0] = &ffi_type_float; values[0] = &f; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_double, args) == FFI_OK); f = 3.14159; /* Put a canary in the return array. This is a regression test for a buffer overrun. */ memset(result[1].c, CANARY, sizeof (double)); ffi_call(&cif, FFI_FN(dblit), &result[0].d, values); /* These are not always the same!! Check for a reasonable delta */ CHECK(result[0].d - dblit(f) < DBL_EPSILON); /* Check the canary. */ for (i = 0; i < sizeof (double); ++i) CHECK(result[1].c[i] == CANARY); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/float2.c0000644000000000000000000000257111237307544021474 0ustar /* Area: ffi_call Purpose: Check return value long double. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include "float.h" static long double ldblit(float f) { return (long double) (((long double) f)/ (long double) 3.0); } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; float f; long double ld; args[0] = &ffi_type_float; values[0] = &f; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_longdouble, args) == FFI_OK); f = 3.14159; #if 1 /* This is ifdef'd out for now. long double support under SunOS/gcc is pretty much non-existent. You'll get the odd bus error in library routines like printf(). */ printf ("%Lf\n", ldblit(f)); #endif ld = 666; ffi_call(&cif, FFI_FN(ldblit), &ld, values); #if 1 /* This is ifdef'd out for now. long double support under SunOS/gcc is pretty much non-existent. You'll get the odd bus error in library routines like printf(). */ printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON); #endif /* These are not always the same!! Check for a reasonable delta */ /*@-realcompare@*/ if (ld - ldblit(f) < LDBL_EPSILON) /*@=realcompare@*/ puts("long double return value tests ok!"); else CHECK(0); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/float3.c0000644000000000000000000000264411237307544021476 0ustar /* Area: ffi_call Purpose: Check float arguments with different orders. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include "float.h" static double floating_1(float a, double b, long double c) { return (double) a + b + (double) c; } static double floating_2(long double a, double b, float c) { return (double) a + b + (double) c; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; double rd; float f; double d; long double ld; args[0] = &ffi_type_float; values[0] = &f; args[1] = &ffi_type_double; values[1] = &d; args[2] = &ffi_type_longdouble; values[2] = &ld; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_double, args) == FFI_OK); f = 3.14159; d = (double)1.0/(double)3.0; ld = 2.71828182846L; floating_1 (f, d, ld); ffi_call(&cif, FFI_FN(floating_1), &rd, values); CHECK(rd - floating_1(f, d, ld) < DBL_EPSILON); args[0] = &ffi_type_longdouble; values[0] = &ld; args[1] = &ffi_type_double; values[1] = &d; args[2] = &ffi_type_float; values[2] = &f; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_double, args) == FFI_OK); floating_2 (ld, d, f); ffi_call(&cif, FFI_FN(floating_2), &rd, values); CHECK(rd - floating_2(ld, d, f) < DBL_EPSILON); exit (0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/many.c0000644000000000000000000000252611237307544021251 0ustar /* Area: ffi_call Purpose: Check return value float, with many arguments Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" #include static float many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) { #if 0 printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, (double) f6, (double) f7, (double) f8, (double) f9, (double) f10, (double) f11, (double) f12, (double) f13); #endif return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); } int main (void) { ffi_cif cif; ffi_type *args[13]; void *values[13]; float fa[13]; float f, ff; int i; for (i = 0; i < 13; i++) { args[i] = &ffi_type_float; values[i] = &fa[i]; fa[i] = (float) i; } /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, &ffi_type_float, args) == FFI_OK); ffi_call(&cif, FFI_FN(many), &f, values); ff = many(fa[0], fa[1], fa[2], fa[3], fa[4], fa[5], fa[6], fa[7], fa[8], fa[9], fa[10],fa[11],fa[12]); if (f - ff < FLT_EPSILON) exit(0); else abort(); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/many_win32.c0000644000000000000000000000242211237307544022266 0ustar /* Area: ffi_call Purpose: Check stdcall many call on X86_WIN32 systems. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ #include "ffitest.h" #include static float __attribute__((stdcall)) stdcall_many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) { return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); } int main (void) { ffi_cif cif; ffi_type *args[13]; void *values[13]; float fa[13]; float f, ff; unsigned long ul; for (ul = 0; ul < 13; ul++) { args[ul] = &ffi_type_float; values[ul] = &fa[ul]; fa[ul] = (float) ul; } /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13, &ffi_type_float, args) == FFI_OK); ff = stdcall_many(fa[0], fa[1], fa[2], fa[3], fa[4], fa[5], fa[6], fa[7], fa[8], fa[9], fa[10], fa[11], fa[12]); ffi_call(&cif, FFI_FN(stdcall_many), &f, values); if (f - ff < FLT_EPSILON) printf("stdcall many arg tests ok!\n"); else CHECK(0); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/negint.c0000644000000000000000000000170311237307544021565 0ustar /* Area: ffi_call Purpose: Check that negative integers are passed correctly. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ /* { dg-options -O2 } */ #include "ffitest.h" static int checking(int a, short b, signed char c) { int i; return (a < 0 && b < 0 && c < 0); } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; signed int si; signed short ss; signed char sc; args[0] = &ffi_type_sint; values[0] = &si; args[1] = &ffi_type_sshort; values[1] = &ss; args[2] = &ffi_type_schar; values[2] = ≻ /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_sint, args) == FFI_OK); si = -6; ss = -12; sc = -1; checking (si, ss, sc); ffi_call(&cif, FFI_FN(checking), &rint, values); printf ("%d vs %d\n", (int)rint, checking (si, ss, sc)); CHECK(rint != 0); exit (0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/nested_struct.c0000644000000000000000000001127211237307544023171 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Contains structs as parameter of the struct itself. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_16byte1 { double a; float b; int c; } cls_struct_16byte1; typedef struct cls_struct_16byte2 { int ii; double dd; float ff; } cls_struct_16byte2; typedef struct cls_struct_combined { cls_struct_16byte1 d; cls_struct_16byte2 e; } cls_struct_combined; cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, struct cls_struct_16byte2 b1, struct cls_struct_combined b2) { struct cls_struct_combined result; result.d.a = b0.a + b1.dd + b2.d.a; result.d.b = b0.b + b1.ff + b2.d.b; result.d.c = b0.c + b1.ii + b2.d.c; result.e.ii = b0.c + b1.ii + b2.e.ii; result.e.dd = b0.a + b1.dd + b2.e.dd; result.e.ff = b0.b + b1.ff + b2.e.ff; printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n", b0.a, b0.b, b0.c, b1.ii, b1.dd, b1.ff, b2.d.a, b2.d.b, b2.d.c, b2.e.ii, b2.e.dd, b2.e.ff, result.d.a, result.d.b, result.d.c, result.e.ii, result.e.dd, result.e.ff); return result; } static void cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_16byte1 b0; struct cls_struct_16byte2 b1; struct cls_struct_combined b2; b0 = *(struct cls_struct_16byte1*)(args[0]); b1 = *(struct cls_struct_16byte2*)(args[1]); b2 = *(struct cls_struct_combined*)(args[2]); *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type* cls_struct_fields1[5]; ffi_type* cls_struct_fields2[5]; ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; cls_struct_type1.size = 0; cls_struct_type1.alignment = 0; cls_struct_type1.type = FFI_TYPE_STRUCT; cls_struct_type1.elements = cls_struct_fields1; cls_struct_type2.size = 0; cls_struct_type2.alignment = 0; cls_struct_type2.type = FFI_TYPE_STRUCT; cls_struct_type2.elements = cls_struct_fields2; struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6}; struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0}; struct cls_struct_combined g_dbl = {{4.0, 5.0, 6}, {3, 1.0, 8.0}}; struct cls_struct_combined res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_float; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = NULL; cls_struct_fields1[0] = &ffi_type_uint32; cls_struct_fields1[1] = &ffi_type_double; cls_struct_fields1[2] = &ffi_type_float; cls_struct_fields1[3] = NULL; cls_struct_fields2[0] = &cls_struct_type; cls_struct_fields2[1] = &cls_struct_type1; cls_struct_fields2[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type1; dbl_arg_types[2] = &cls_struct_type2; dbl_arg_types[3] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = NULL; ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl); /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); CHECK(ffi_prep_closure(pcl, &cif, cls_struct_combined_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1, cls_struct_16byte2, cls_struct_combined)) (pcl))(e_dbl, f_dbl, g_dbl); /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/nested_struct1.c0000644000000000000000000001201311237307544023244 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Contains structs as parameter of the struct itself. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct cls_struct_16byte1 { double a; float b; int c; } cls_struct_16byte1; typedef struct cls_struct_16byte2 { int ii; double dd; float ff; } cls_struct_16byte2; typedef struct cls_struct_combined { cls_struct_16byte1 d; cls_struct_16byte2 e; } cls_struct_combined; cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, struct cls_struct_16byte2 b1, struct cls_struct_combined b2, struct cls_struct_16byte1 b3) { struct cls_struct_combined result; result.d.a = b0.a + b1.dd + b2.d.a; result.d.b = b0.b + b1.ff + b2.d.b; result.d.c = b0.c + b1.ii + b2.d.c; result.e.ii = b0.c + b1.ii + b2.e.ii; result.e.dd = b0.a + b1.dd + b2.e.dd; result.e.ff = b0.b + b1.ff + b2.e.ff; printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n", b0.a, b0.b, b0.c, b1.ii, b1.dd, b1.ff, b2.d.a, b2.d.b, b2.d.c, b2.e.ii, b2.e.dd, b2.e.ff, b3.a, b3.b, b3.c, result.d.a, result.d.b, result.d.c, result.e.ii, result.e.dd, result.e.ff); return result; } static void cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct cls_struct_16byte1 b0; struct cls_struct_16byte2 b1; struct cls_struct_combined b2; struct cls_struct_16byte1 b3; b0 = *(struct cls_struct_16byte1*)(args[0]); b1 = *(struct cls_struct_16byte2*)(args[1]); b2 = *(struct cls_struct_combined*)(args[2]); b3 = *(struct cls_struct_16byte1*)(args[3]); *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[5]; ffi_type* cls_struct_fields[5]; ffi_type* cls_struct_fields1[5]; ffi_type* cls_struct_fields2[5]; ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2; ffi_type* dbl_arg_types[5]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; cls_struct_type1.size = 0; cls_struct_type1.alignment = 0; cls_struct_type1.type = FFI_TYPE_STRUCT; cls_struct_type1.elements = cls_struct_fields1; cls_struct_type2.size = 0; cls_struct_type2.alignment = 0; cls_struct_type2.type = FFI_TYPE_STRUCT; cls_struct_type2.elements = cls_struct_fields2; struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6}; struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0}; struct cls_struct_combined g_dbl = {{4.0, 5.0, 6}, {3, 1.0, 8.0}}; struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4}; struct cls_struct_combined res_dbl; cls_struct_fields[0] = &ffi_type_double; cls_struct_fields[1] = &ffi_type_float; cls_struct_fields[2] = &ffi_type_uint32; cls_struct_fields[3] = NULL; cls_struct_fields1[0] = &ffi_type_uint32; cls_struct_fields1[1] = &ffi_type_double; cls_struct_fields1[2] = &ffi_type_float; cls_struct_fields1[3] = NULL; cls_struct_fields2[0] = &cls_struct_type; cls_struct_fields2[1] = &cls_struct_type1; cls_struct_fields2[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type1; dbl_arg_types[2] = &cls_struct_type2; dbl_arg_types[3] = &cls_struct_type; dbl_arg_types[4] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = &g_dbl; args_dbl[3] = &h_dbl; args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl); /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); CHECK(ffi_prep_closure(pcl, &cif, cls_struct_combined_gn, NULL) == FFI_OK); res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1, cls_struct_16byte2, cls_struct_combined, cls_struct_16byte1)) (pcl))(e_dbl, f_dbl, g_dbl, h_dbl); /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */ CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); // CHECK( 1 == 0); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/nested_struct2.c0000644000000000000000000000600111237307544023245 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Contains structs as parameter of the struct itself. Sample taken from Alan Modras patch to src/prep_cif.c. Limitations: none. PR: none. Originator: 20030911 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" #if LONG_MAX == 2147483647 #define ffi_type_mylong ffi_type_uint32 #else #if LONG_MAX == 9223372036854775807 #define ffi_type_mylong ffi_type_uint64 #else #error "Error, size LONG not defined as expected" #endif #endif typedef struct A { unsigned long a; unsigned char b; } A; typedef struct B { struct A x; unsigned char y; } B; B B_fn(struct A b0, struct B b1) { struct B result; result.x.a = b0.a + b1.x.a; result.x.b = b0.b + b1.x.b + b1.y; result.y = b0.b + b1.x.b; printf("%d %d %d %d %d: %d %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y, result.x.a, result.x.b, result.y); return result; } static void B_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct A b0; struct B b1; b0 = *(struct A*)(args[0]); b1 = *(struct B*)(args[1]); *(B*)resp = B_fn(b0, b1); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[3]; ffi_type* cls_struct_fields1[3]; ffi_type cls_struct_type, cls_struct_type1; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; cls_struct_type1.size = 0; cls_struct_type1.alignment = 0; cls_struct_type1.type = FFI_TYPE_STRUCT; cls_struct_type1.elements = cls_struct_fields1; struct A e_dbl = { 1, 7}; struct B f_dbl = {{12 , 127}, 99}; struct B res_dbl; cls_struct_fields[0] = &ffi_type_mylong; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = NULL; cls_struct_fields1[0] = &cls_struct_type; cls_struct_fields1[1] = &ffi_type_uchar; cls_struct_fields1[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type1; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); /* { dg-output "1 7 12 127 99: 13 233 134" } */ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); CHECK(ffi_prep_closure(pcl, &cif, B_gn, NULL) == FFI_OK); res_dbl = ((B(*)(A, B))(pcl))(e_dbl, f_dbl); /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/nested_struct3.c0000644000000000000000000000547711237307544023266 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Contains structs as parameter of the struct itself. Sample taken from Alan Modras patch to src/prep_cif.c. Limitations: none. PR: none. Originator: 20030911 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct A { unsigned long long a; unsigned char b; } A; typedef struct B { struct A x; unsigned char y; } B; B B_fn(struct A b0, struct B b1) { struct B result; result.x.a = b0.a + b1.x.a; result.x.b = b0.b + b1.x.b + b1.y; result.y = b0.b + b1.x.b; printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b, (int)b1.x.a, b1.x.b, b1.y, (int)result.x.a, result.x.b, result.y); return result; } static void B_gn(ffi_cif* cif, void* resp, void** args, void* userdata) { struct A b0; struct B b1; b0 = *(struct A*)(args[0]); b1 = *(struct B*)(args[1]); *(B*)resp = B_fn(b0, b1); } int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args_dbl[3]; ffi_type* cls_struct_fields[3]; ffi_type* cls_struct_fields1[3]; ffi_type cls_struct_type, cls_struct_type1; ffi_type* dbl_arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; cls_struct_type1.size = 0; cls_struct_type1.alignment = 0; cls_struct_type1.type = FFI_TYPE_STRUCT; cls_struct_type1.elements = cls_struct_fields1; struct A e_dbl = { 1LL, 7}; struct B f_dbl = {{12LL , 127}, 99}; struct B res_dbl; cls_struct_fields[0] = &ffi_type_uint64; cls_struct_fields[1] = &ffi_type_uchar; cls_struct_fields[2] = NULL; cls_struct_fields1[0] = &cls_struct_type; cls_struct_fields1[1] = &ffi_type_uchar; cls_struct_fields1[2] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type1; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, dbl_arg_types) == FFI_OK); args_dbl[0] = &e_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); /* { dg-output "1 7 12 127 99: 13 233 134" } */ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); CHECK(ffi_prep_closure(pcl, &cif, B_gn, NULL) == FFI_OK); res_dbl = ((B(*)(A, B))(pcl))(e_dbl, f_dbl); /* { dg-output "\n1 7 12 127 99: 13 233 134" } */ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a)); CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y)); CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b)); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/problem1.c0000644000000000000000000000457311237307544022032 0ustar /* Area: ffi_call, closure_call Purpose: Check structure passing with different structure size. Limitations: none. PR: none. Originator: 20030828 */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitest.h" typedef struct my_ffi_struct { double a; double b; double c; } my_ffi_struct; my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2) { struct my_ffi_struct result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } void stub(ffi_cif* cif, void* resp, void** args, void* userdata) { struct my_ffi_struct a1; struct my_ffi_struct a2; a1 = *(struct my_ffi_struct*)(args[0]); a2 = *(struct my_ffi_struct*)(args[1]); *(my_ffi_struct *)resp = callee(a1, a2); } int main(void) { ffi_type* my_ffi_struct_fields[4]; ffi_type my_ffi_struct_type; ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; void* args[4]; ffi_type* arg_types[3]; #ifdef USING_MMAP pcl = allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif struct my_ffi_struct g = { 1.0, 2.0, 3.0 }; struct my_ffi_struct f = { 1.0, 2.0, 3.0 }; struct my_ffi_struct res; my_ffi_struct_type.size = 0; my_ffi_struct_type.alignment = 0; my_ffi_struct_type.type = FFI_TYPE_STRUCT; my_ffi_struct_type.elements = my_ffi_struct_fields; my_ffi_struct_fields[0] = &ffi_type_double; my_ffi_struct_fields[1] = &ffi_type_double; my_ffi_struct_fields[2] = &ffi_type_double; my_ffi_struct_fields[3] = NULL; arg_types[0] = &my_ffi_struct_type; arg_types[1] = &my_ffi_struct_type; arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type, arg_types) == FFI_OK); args[0] = &g; args[1] = &f; args[2] = NULL; ffi_call(&cif, FFI_FN(callee), &res, args); /* { dg-output "1 2 3 1 2 3: 2 4 6" } */ printf("res: %g %g %g\n", res.a, res.b, res.c); /* { dg-output "\nres: 2 4 6" } */ CHECK(ffi_prep_closure(pcl, &cif, stub, NULL) == FFI_OK); res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(pcl))(g, f); /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */ printf("res: %g %g %g\n", res.a, res.b, res.c); /* { dg-output "\nres: 2 4 6" } */ exit(0);; } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/promotion.c0000644000000000000000000000257111237307544022333 0ustar /* Area: ffi_call Purpose: Promotion test. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static int promotion(signed char sc, signed short ss, unsigned char uc, unsigned short us) { int r = (int) sc + (int) ss + (int) uc + (int) us; return r; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; signed char sc; unsigned char uc; signed short ss; unsigned short us; unsigned long ul; args[0] = &ffi_type_schar; args[1] = &ffi_type_sshort; args[2] = &ffi_type_uchar; args[3] = &ffi_type_ushort; values[0] = ≻ values[1] = &ss; values[2] = &uc; values[3] = &us; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &ffi_type_sint, args) == FFI_OK); us = 0; ul = 0; for (sc = (signed char) -127; sc <= (signed char) 120; /*@-type@*/ sc += 1 /*@=type@*/) for (ss = -30000; ss <= 30000; ss += 10000) for (uc = (unsigned char) 0; uc <= (unsigned char) 200; /*@-type@*/ uc += 20 /*@=type@*/) for (us = 0; us <= 60000; us += 10000) { ul++; ffi_call(&cif, FFI_FN(promotion), &rint, values); CHECK((int)rint == (signed char) sc + (signed short) ss + (unsigned char) uc + (unsigned short) us); } printf("%lu promotion tests run\n", ul); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/pyobjc-tc.c0000644000000000000000000000460111237307544022173 0ustar /* Area: ffi_call Purpose: Check different structures. Limitations: none. PR: none. Originator: Ronald Oussoren 20030824 */ /* { dg-do run } */ #include "ffitest.h" typedef struct Point { float x; float y; } Point; typedef struct Size { float h; float w; } Size; typedef struct Rect { Point o; Size s; } Rect; int doit(int o, char* s, Point p, Rect r, int last) { printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n", o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last); return 42; } int main(void) { ffi_type point_type; ffi_type size_type; ffi_type rect_type; ffi_cif cif; ffi_type* arglist[6]; void* values[6]; int r; /* * First set up FFI types for the 3 struct types */ point_type.size = 0; /*sizeof(Point);*/ point_type.alignment = 0; /*__alignof__(Point);*/ point_type.type = FFI_TYPE_STRUCT; point_type.elements = malloc(3 * sizeof(ffi_type*)); point_type.elements[0] = &ffi_type_float; point_type.elements[1] = &ffi_type_float; point_type.elements[2] = NULL; size_type.size = 0;/* sizeof(Size);*/ size_type.alignment = 0;/* __alignof__(Size);*/ size_type.type = FFI_TYPE_STRUCT; size_type.elements = malloc(3 * sizeof(ffi_type*)); size_type.elements[0] = &ffi_type_float; size_type.elements[1] = &ffi_type_float; size_type.elements[2] = NULL; rect_type.size = 0;/*sizeof(Rect);*/ rect_type.alignment =0;/* __alignof__(Rect);*/ rect_type.type = FFI_TYPE_STRUCT; rect_type.elements = malloc(3 * sizeof(ffi_type*)); rect_type.elements[0] = &point_type; rect_type.elements[1] = &size_type; rect_type.elements[2] = NULL; /* * Create a CIF */ arglist[0] = &ffi_type_sint; arglist[1] = &ffi_type_pointer; arglist[2] = &point_type; arglist[3] = &rect_type; arglist[4] = &ffi_type_sint; arglist[5] = NULL; r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 5, &ffi_type_sint, arglist); if (r != FFI_OK) { abort(); } /* And call the function through the CIF */ { Point p = { 1.0, 2.0 }; Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } }; int o = 0; int l = 42; char* m = "myMethod"; ffi_arg result; values[0] = &o; values[1] = &m; values[2] = &p; values[3] = &r; values[4] = &l; values[5] = NULL; printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n", o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l); ffi_call(&cif, FFI_FN(doit), &result, values); printf ("The result is %d\n", result); } exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/return_ll.c0000644000000000000000000000152511237307544022311 0ustar /* Area: ffi_call Purpose: Check return value long long. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static long long return_ll(long long ll) { return ll; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; long long rlonglong; long long ll; args[0] = &ffi_type_sint64; values[0] = ≪ /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint64, args) == FFI_OK); for (ll = 0LL; ll < 100LL; ll++) { ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); CHECK(rlonglong == ll); } for (ll = 55555555555000LL; ll < 55555555555100LL; ll++) { ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); CHECK(rlonglong == ll); } exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/return_ll1.c0000644000000000000000000000173111237307544022371 0ustar /* Area: ffi_call Purpose: Check if long long are passed in the corresponding regs on ppc. Limitations: none. PR: 20104. Originator: 20050222 */ /* { dg-do run } */ #include "ffitest.h" static long long return_ll(int ll0, long long ll1, int ll2) { return ll0 + ll1 + ll2; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; long long rlonglong; long long ll1; unsigned ll0, ll2; args[0] = &ffi_type_uint32; args[1] = &ffi_type_sint64; args[2] = &ffi_type_uint32; values[0] = &ll0; values[1] = &ll1; values[2] = &ll2; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_sint64, args) == FFI_OK); ll0 = 11111111; ll1 = 11111111111000LL; ll2 = 11111111; ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); printf("res: %lld, %lld\n", rlonglong, ll0 + ll1 + ll2); /* { dg-output "res: 11111133333222, 11111133333222" } */ exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/return_sc.c0000644000000000000000000000132311237307544022303 0ustar /* Area: ffi_call Purpose: Check return value signed char. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static signed char return_sc(signed char sc) { return sc; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; signed char sc; args[0] = &ffi_type_schar; values[0] = ≻ /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_schar, args) == FFI_OK); for (sc = (signed char) -127; sc < (signed char) 127; sc++) { ffi_call(&cif, FFI_FN(return_sc), &rint, values); CHECK(rint == (ffi_arg) sc); } exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/return_uc.c0000644000000000000000000000135111237307543022305 0ustar /* Area: ffi_call Purpose: Check return value unsigned char. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static unsigned char return_uc(unsigned char uc) { return uc; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; unsigned char uc; args[0] = &ffi_type_uchar; values[0] = &uc; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_uchar, args) == FFI_OK); for (uc = (unsigned char) '\x00'; uc < (unsigned char) '\xff'; uc++) { ffi_call(&cif, FFI_FN(return_uc), &rint, values); CHECK(rint == (signed int) uc); } exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/strlen.c0000644000000000000000000000151411237307544021610 0ustar /* Area: ffi_call Purpose: Check strlen function call. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" static size_t my_strlen(char *s) { return (strlen(s)); } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; char *s; args[0] = &ffi_type_pointer; values[0] = (void*) &s; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK); s = "a"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 1); s = "1234567"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 7); s = "1234567890123456789012345"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 25); exit (0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/strlen_win32.c0000644000000000000000000000174511237307544022640 0ustar /* Area: ffi_call Purpose: Check stdcall strlen call on X86_WIN32 systems. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ #include "ffitest.h" static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s) { return (strlen(s)); } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_arg rint; char *s; args[0] = &ffi_type_pointer; values[0] = (void*) &s; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1, &ffi_type_sint, args) == FFI_OK); s = "a"; ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); CHECK(rint == 1); s = "1234567"; ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); CHECK(rint == 7); s = "1234567890123456789012345"; ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); CHECK(rint == 25); printf("stdcall strlen tests passed\n"); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct1.c0000644000000000000000000000257411237307543021714 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { unsigned char uc; double d; unsigned int ui; } test_structure_1; static test_structure_1 struct1(test_structure_1 ts) { /*@-type@*/ ts.uc++; /*@=type@*/ ts.d--; ts.ui++; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts1_type; ffi_type *ts1_type_elements[4]; ts1_type.size = 0; ts1_type.alignment = 0; ts1_type.type = FFI_TYPE_STRUCT; ts1_type.elements = ts1_type_elements; ts1_type_elements[0] = &ffi_type_uchar; ts1_type_elements[1] = &ffi_type_double; ts1_type_elements[2] = &ffi_type_uint; ts1_type_elements[3] = NULL; test_structure_1 ts1_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_1 *ts1_result = (test_structure_1 *) malloc (sizeof(test_structure_1)); args[0] = &ts1_type; values[0] = &ts1_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts1_type, args) == FFI_OK); ts1_arg.uc = '\x01'; ts1_arg.d = 3.14159; ts1_arg.ui = 555; ffi_call(&cif, FFI_FN(struct1), ts1_result, values); CHECK(ts1_result->ui == 556); CHECK(ts1_result->d == 3.14159 - 1); free (ts1_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct2.c0000644000000000000000000000260611237307544021712 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { double d1; double d2; } test_structure_2; static test_structure_2 struct2(test_structure_2 ts) { ts.d1--; ts.d2--; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; test_structure_2 ts2_arg; ffi_type ts2_type; ffi_type *ts2_type_elements[3]; ts2_type.size = 0; ts2_type.alignment = 0; ts2_type.type = FFI_TYPE_STRUCT; ts2_type.elements = ts2_type_elements; ts2_type_elements[0] = &ffi_type_double; ts2_type_elements[1] = &ffi_type_double; ts2_type_elements[2] = NULL; /* This is a hack to get a properly aligned result buffer */ test_structure_2 *ts2_result = (test_structure_2 *) malloc (sizeof(test_structure_2)); args[0] = &ts2_type; values[0] = &ts2_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK); ts2_arg.d1 = 5.55; ts2_arg.d2 = 6.66; printf ("%g\n", ts2_arg.d1); printf ("%g\n", ts2_arg.d2); ffi_call(&cif, FFI_FN(struct2), ts2_result, values); printf ("%g\n", ts2_result->d1); printf ("%g\n", ts2_result->d2); CHECK(ts2_result->d1 == 5.55 - 1); CHECK(ts2_result->d2 == 6.66 - 1); free (ts2_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct3.c0000644000000000000000000000230411237307544021706 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { int si; } test_structure_3; static test_structure_3 struct3(test_structure_3 ts) { ts.si = -(ts.si*2); return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; int compare_value; ffi_type ts3_type; ffi_type *ts3_type_elements[2]; ts3_type.size = 0; ts3_type.alignment = 0; ts3_type.type = FFI_TYPE_STRUCT; ts3_type.elements = ts3_type_elements; ts3_type_elements[0] = &ffi_type_sint; ts3_type_elements[1] = NULL; test_structure_3 ts3_arg; test_structure_3 *ts3_result = (test_structure_3 *) malloc (sizeof(test_structure_3)); args[0] = &ts3_type; values[0] = &ts3_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts3_type, args) == FFI_OK); ts3_arg.si = -123; compare_value = ts3_arg.si; ffi_call(&cif, FFI_FN(struct3), ts3_result, values); printf ("%d %d\n", ts3_result->si, -(compare_value*2)); CHECK(ts3_result->si == -(compare_value*2)); free (ts3_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct4.c0000644000000000000000000000247211237307544021715 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { unsigned ui1; unsigned ui2; unsigned ui3; } test_structure_4; static test_structure_4 struct4(test_structure_4 ts) { ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts4_type; ffi_type *ts4_type_elements[4]; ts4_type.size = 0; ts4_type.alignment = 0; ts4_type.type = FFI_TYPE_STRUCT; test_structure_4 ts4_arg; ts4_type.elements = ts4_type_elements; ts4_type_elements[0] = &ffi_type_uint; ts4_type_elements[1] = &ffi_type_uint; ts4_type_elements[2] = &ffi_type_uint; ts4_type_elements[3] = NULL; /* This is a hack to get a properly aligned result buffer */ test_structure_4 *ts4_result = (test_structure_4 *) malloc (sizeof(test_structure_4)); args[0] = &ts4_type; values[0] = &ts4_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK); ts4_arg.ui1 = 2; ts4_arg.ui2 = 3; ts4_arg.ui3 = 4; ffi_call (&cif, FFI_FN(struct4), ts4_result, values); CHECK(ts4_result->ui3 == 2U * 3U * 4U); free (ts4_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct5.c0000644000000000000000000000256611237307544021722 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { char c1; char c2; } test_structure_5; static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2) { ts1.c1 += ts2.c1; ts1.c2 -= ts2.c2; return ts1; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts5_type; ffi_type *ts5_type_elements[3]; ts5_type.size = 0; ts5_type.alignment = 0; ts5_type.type = FFI_TYPE_STRUCT; ts5_type.elements = ts5_type_elements; ts5_type_elements[0] = &ffi_type_schar; ts5_type_elements[1] = &ffi_type_schar; ts5_type_elements[2] = NULL; test_structure_5 ts5_arg1, ts5_arg2; /* This is a hack to get a properly aligned result buffer */ test_structure_5 *ts5_result = (test_structure_5 *) malloc (sizeof(test_structure_5)); args[0] = &ts5_type; args[1] = &ts5_type; values[0] = &ts5_arg1; values[1] = &ts5_arg2; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK); ts5_arg1.c1 = 2; ts5_arg1.c2 = 6; ts5_arg2.c1 = 5; ts5_arg2.c2 = 3; ffi_call (&cif, FFI_FN(struct5), ts5_result, values); CHECK(ts5_result->c1 == 7); CHECK(ts5_result->c2 == 3); free (ts5_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct6.c0000644000000000000000000000247211237307544021717 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { float f; double d; } test_structure_6; static test_structure_6 struct6 (test_structure_6 ts) { ts.f += 1; ts.d += 1; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts6_type; ffi_type *ts6_type_elements[3]; ts6_type.size = 0; ts6_type.alignment = 0; ts6_type.type = FFI_TYPE_STRUCT; ts6_type.elements = ts6_type_elements; ts6_type_elements[0] = &ffi_type_float; ts6_type_elements[1] = &ffi_type_double; ts6_type_elements[2] = NULL; test_structure_6 ts6_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_6 *ts6_result = (test_structure_6 *) malloc (sizeof(test_structure_6)); args[0] = &ts6_type; values[0] = &ts6_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK); ts6_arg.f = 5.55f; ts6_arg.d = 6.66; printf ("%g\n", ts6_arg.f); printf ("%g\n", ts6_arg.d); ffi_call(&cif, FFI_FN(struct6), ts6_result, values); CHECK(ts6_result->f == 5.55f + 1); CHECK(ts6_result->d == 6.66 + 1); free (ts6_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct7.c0000644000000000000000000000310511237307544021712 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { float f1; float f2; double d; } test_structure_7; static test_structure_7 struct7 (test_structure_7 ts) { ts.f1 += 1; ts.f2 += 1; ts.d += 1; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts7_type; ffi_type *ts7_type_elements[4]; ts7_type.size = 0; ts7_type.alignment = 0; ts7_type.type = FFI_TYPE_STRUCT; ts7_type.elements = ts7_type_elements; ts7_type_elements[0] = &ffi_type_float; ts7_type_elements[1] = &ffi_type_float; ts7_type_elements[2] = &ffi_type_double; ts7_type_elements[3] = NULL; test_structure_7 ts7_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_7 *ts7_result = (test_structure_7 *) malloc (sizeof(test_structure_7)); args[0] = &ts7_type; values[0] = &ts7_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK); ts7_arg.f1 = 5.55f; ts7_arg.f2 = 55.5f; ts7_arg.d = 6.66; printf ("%g\n", ts7_arg.f1); printf ("%g\n", ts7_arg.f2); printf ("%g\n", ts7_arg.d); ffi_call(&cif, FFI_FN(struct7), ts7_result, values); printf ("%g\n", ts7_result->f1); printf ("%g\n", ts7_result->f2); printf ("%g\n", ts7_result->d); CHECK(ts7_result->f1 == 5.55f + 1); CHECK(ts7_result->f2 == 55.5f + 1); CHECK(ts7_result->d == 6.66 + 1); free (ts7_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct8.c0000644000000000000000000000342011237307544021713 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { float f1; float f2; float f3; float f4; } test_structure_8; static test_structure_8 struct8 (test_structure_8 ts) { ts.f1 += 1; ts.f2 += 1; ts.f3 += 1; ts.f4 += 1; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts8_type; ffi_type *ts8_type_elements[5]; ts8_type.size = 0; ts8_type.alignment = 0; ts8_type.type = FFI_TYPE_STRUCT; ts8_type.elements = ts8_type_elements; ts8_type_elements[0] = &ffi_type_float; ts8_type_elements[1] = &ffi_type_float; ts8_type_elements[2] = &ffi_type_float; ts8_type_elements[3] = &ffi_type_float; ts8_type_elements[4] = NULL; test_structure_8 ts8_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_8 *ts8_result = (test_structure_8 *) malloc (sizeof(test_structure_8)); args[0] = &ts8_type; values[0] = &ts8_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK); ts8_arg.f1 = 5.55f; ts8_arg.f2 = 55.5f; ts8_arg.f3 = -5.55f; ts8_arg.f4 = -55.5f; printf ("%g\n", ts8_arg.f1); printf ("%g\n", ts8_arg.f2); printf ("%g\n", ts8_arg.f3); printf ("%g\n", ts8_arg.f4); ffi_call(&cif, FFI_FN(struct8), ts8_result, values); printf ("%g\n", ts8_result->f1); printf ("%g\n", ts8_result->f2); printf ("%g\n", ts8_result->f3); printf ("%g\n", ts8_result->f4); CHECK(ts8_result->f1 == 5.55f + 1); CHECK(ts8_result->f2 == 55.5f + 1); CHECK(ts8_result->f3 == -5.55f + 1); CHECK(ts8_result->f4 == -55.5f + 1); free (ts8_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.call/struct9.c0000644000000000000000000000256211237307544021722 0ustar /* Area: ffi_call Purpose: Check structures. Limitations: none. PR: none. Originator: From the original ffitest.c */ /* { dg-do run } */ #include "ffitest.h" typedef struct { float f; int i; } test_structure_9; static test_structure_9 struct9 (test_structure_9 ts) { ts.f += 1; ts.i += 1; return ts; } int main (void) { ffi_cif cif; ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; ffi_type ts9_type; ffi_type *ts9_type_elements[3]; ts9_type.size = 0; ts9_type.alignment = 0; ts9_type.type = FFI_TYPE_STRUCT; ts9_type.elements = ts9_type_elements; ts9_type_elements[0] = &ffi_type_float; ts9_type_elements[1] = &ffi_type_sint; ts9_type_elements[2] = NULL; test_structure_9 ts9_arg; /* This is a hack to get a properly aligned result buffer */ test_structure_9 *ts9_result = (test_structure_9 *) malloc (sizeof(test_structure_9)); args[0] = &ts9_type; values[0] = &ts9_arg; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK); ts9_arg.f = 5.55f; ts9_arg.i = 5; printf ("%g\n", ts9_arg.f); printf ("%d\n", ts9_arg.i); ffi_call(&cif, FFI_FN(struct9), ts9_result, values); printf ("%g\n", ts9_result->f); printf ("%d\n", ts9_result->i); CHECK(ts9_result->f == 5.55f + 1); CHECK(ts9_result->i == 5 + 1); free (ts9_result); exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.special/0002755000000000000000000000000011237307544020643 5ustar gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.special/ffitestcxx.h0000644000000000000000000000255211237307544023205 0ustar #include #include #include #include #include "fficonfig.h" #define MAX_ARGS 256 #define CHECK(x) (!(x) ? abort() : (void)0) /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a file open. */ #ifdef HAVE_MMAP_ANON # undef HAVE_MMAP_DEV_ZERO # include # ifndef MAP_FAILED # define MAP_FAILED -1 # endif # if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) # define MAP_ANONYMOUS MAP_ANON # endif # define USING_MMAP #endif #ifdef HAVE_MMAP_DEV_ZERO # include # ifndef MAP_FAILED # define MAP_FAILED -1 # endif # define USING_MMAP #endif #ifdef USING_MMAP static inline void * allocate_mmap (size_t size) { void *page; #if defined (HAVE_MMAP_DEV_ZERO) static int dev_zero_fd = -1; #endif #ifdef HAVE_MMAP_DEV_ZERO if (dev_zero_fd == -1) { dev_zero_fd = open ("/dev/zero", O_RDONLY); if (dev_zero_fd == -1) { perror ("open /dev/zero: %m"); exit (1); } } #endif #ifdef HAVE_MMAP_ANON page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); #endif #ifdef HAVE_MMAP_DEV_ZERO page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero_fd, 0); #endif if (page == MAP_FAILED) { perror ("virtual memory exhausted"); exit (1); } return page; } #endif gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.special/special.exp0000644000000000000000000000206511237307544023002 0ustar # Copyright (C) 2003 Free Software Foundation, Inc. # 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. # libffi testsuite that uses the 'dg.exp' driver. load_lib libffi-dg.exp dg-init libffi-init global srcdir subdir global cxx_options set cxx_options " -shared-libgcc -lstdc++" dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "" dg-finish # Local Variables: # tcl-indent-level:4 # End: gauche-c-wrapper-0.6.1.orig/libffi/testsuite/libffi.special/unwindtest.cc0000644000000000000000000000720211237307544023355 0ustar /* Area: ffi_closure, unwind info Purpose: Check if the unwind information is passed correctly. Limitations: none. PR: none. Originator: Jeff Sturm */ /* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */ #include "ffitestcxx.h" void closure_test_fn(ffi_cif* cif, void* resp, void** args, void* userdata) { throw 9; } typedef void (*closure_test_type)(); void closure_test_fn1(ffi_cif* cif,void* resp,void** args, void* userdata) { *(ffi_arg*)resp = (int)*(float *)args[0] +(int)(*(float *)args[1]) + (int)(*(float *)args[2]) + (int)*(float *)args[3] + (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + (int)*(float *)args[6] + (int)(*(int *)args[7]) + (int)(*(double*)args[8]) + (int)*(int *)args[9] + (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + (int)*(int *)args[12] + (int)(*(int *)args[13]) + (int)(*(int *)args[14]) + *(int *)args[15] + (int)(long)userdata; printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", (int)*(float *)args[0], (int)(*(float *)args[1]), (int)(*(float *)args[2]), (int)*(float *)args[3], (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), (int)*(float *)args[6], (int)(*(int *)args[7]), (int)(*(double *)args[8]), (int)*(int *)args[9], (int)(*(int *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(int *)args[14]), *(int *)args[15], (int)(long)userdata, (int)*(ffi_arg*)resp); throw (int)*(ffi_arg*)resp; } typedef int (*closure_test_type1)(float, float, float, float, signed short, float, float, int, double, int, int, float, int, int, int, int); int main (void) { ffi_cif cif; #ifndef USING_MMAP static ffi_closure cl; #endif ffi_closure *pcl; ffi_type * cl_arg_types[17]; int res; #ifdef USING_MMAP pcl = (ffi_closure *) allocate_mmap (sizeof(ffi_closure)); #else pcl = &cl; #endif { cl_arg_types[1] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn, NULL) == FFI_OK); try { (*((closure_test_type)(pcl)))(); } catch (int exception_code) { CHECK(exception_code == 9); } printf("part one OK\n"); /* { dg-output "part one OK" } */ } { cl_arg_types[0] = &ffi_type_float; cl_arg_types[1] = &ffi_type_float; cl_arg_types[2] = &ffi_type_float; cl_arg_types[3] = &ffi_type_float; cl_arg_types[4] = &ffi_type_sshort; cl_arg_types[5] = &ffi_type_float; cl_arg_types[6] = &ffi_type_float; cl_arg_types[7] = &ffi_type_uint; cl_arg_types[8] = &ffi_type_double; cl_arg_types[9] = &ffi_type_uint; cl_arg_types[10] = &ffi_type_uint; cl_arg_types[11] = &ffi_type_float; cl_arg_types[12] = &ffi_type_uint; cl_arg_types[13] = &ffi_type_uint; cl_arg_types[14] = &ffi_type_uint; cl_arg_types[15] = &ffi_type_uint; cl_arg_types[16] = NULL; /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, &ffi_type_sint, cl_arg_types) == FFI_OK); CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1, (void *) 3 /* userdata */) == FFI_OK); try { (*((closure_test_type1)pcl)) (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, 19, 21, 1); /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ } catch (int exception_code) { CHECK(exception_code == 255); } printf("part two OK\n"); /* { dg-output "\npart two OK" } */ } exit(0); } gauche-c-wrapper-0.6.1.orig/libffi/testsuite/Makefile.am0000644000000000000000000000075311237307544020030 0ustar ## Process this file with automake to produce Makefile.in. AUTOMAKE_OPTIONS = foreign dejagnu # Setup the testing framework, if you have one EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ echo $(top_builddir)/../expect/expect ; \ else echo expect ; fi` RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` AM_RUNTESTFLAGS = CLEANFILES = *.exe core* *.log *.sum gauche-c-wrapper-0.6.1.orig/libffi/testsuite/Makefile.in0000644000000000000000000001767211237307544020051 0ustar # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AM_RUNTESTFLAGS = AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CFLAGS = @CFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ multi_basedir = @multi_basedir@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ AUTOMAKE_OPTIONS = foreign dejagnu # Setup the testing framework, if you have one EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ echo $(top_builddir)/../expect/expect ; \ else echo expect ; fi` RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ else echo runtest; fi` CLEANFILES = *.exe core* *.log *.sum subdir = testsuite mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/fficonfig.h CONFIG_CLEAN_FILES = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign testsuite/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: RUNTESTFLAGS = DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir check-DEJAGNU: site.exp srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ EXPECT=$(EXPECT); export EXPECT; \ runtest=$(RUNTEST); \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ l='$(DEJATOOL)'; for tool in $$l; do \ $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ done; \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi site.exp: Makefile @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp @echo 'set tool $(DEJATOOL)' >>site.tmp @echo 'set srcdir $(srcdir)' >>site.tmp @echo "set objdir `pwd`" >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp @echo 'set host_alias "$(host_alias)"' >>site.tmp @echo 'set host_triplet $(host_triplet)' >>site.tmp @echo 'set target_alias "$(target_alias)"' >>site.tmp @echo 'set target_triplet $(target_triplet)' >>site.tmp @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp distclean-DEJAGNU: -rm -f site.exp site.bak DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-DEJAGNU distclean-generic \ distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ clean-libtool distclean distclean-DEJAGNU distclean-generic \ distclean-libtool distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gauche-c-wrapper-0.6.1.orig/Makefile.in0000644000000000000000000000373111237307544014554 0ustar # # $Id: Makefile.in 546 2008-05-11 00:24:56Z naoki $ # # General info SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ datarootdir = @datarootdir@ srcdir = @srcdir@ VPATH = $(srcdir) # These may be overridden by make invocators DESTDIR = GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@ INSTALL = @GAUCHE_INSTALL@ # Other parameters SOEXT = @SOEXT@ OBJEXT = @OBJEXT@ EXEEXT = @EXEEXT@ # Module-specific stuff PACKAGE = c-wrapper GENERATED = CONFIG_GENERATED = Makefile config.cache config.log config.status \ configure.lineno autom4te*.cache $(PACKAGE).gpd GAUCHE_PKGINCDIR = @GAUCHE_PKGINCDIR@ GAUCHE_PKGLIBDIR = @GAUCHE_PKGLIBDIR@ GAUCHE_PKGARCHDIR = @GAUCHE_PKGARCHDIR@ all : cd src; $(MAKE) all cd lib; $(MAKE) all cd objc; $(MAKE) all cd doc; $(MAKE) all check : all cd testsuite; $(MAKE) check install : all cd src; $(MAKE) install cd lib; $(MAKE) install cd objc; $(MAKE) install cd doc; $(MAKE) install $(INSTALL) -m 444 -T $(DESTDIR)$(GAUCHE_PKGLIBDIR)/.packages $(PACKAGE).gpd uninstall : cd objc; $(MAKE) uninstall cd src; $(MAKE) uninstall cd lib; $(MAKE) uninstall cd doc; $(MAKE) uninstall $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGLIBDIR)/.packages $(PACKAGE).gpd clean : cd src; $(MAKE) clean cd lib; $(MAKE) clean cd objc; $(MAKE) clean cd doc; $(MAKE) clean cd testsuite; $(MAKE) clean rm -rf core $(TARGET) $(GENERATED) *~ so_locations distclean : clean cd src; $(MAKE) distclean cd lib; $(MAKE) distclean cd objc; $(MAKE) distclean cd doc; $(MAKE) distclean cd testsuite; $(MAKE) distclean rm -rf $(CONFIG_GENERATED) maintainer-clean : clean cd src; $(MAKE) maintainer-clean cd lib; $(MAKE) maintainer-clean cd objc; $(MAKE) maintainer-clean cd doc; $(MAKE) maintainer-clean cd testsuite; $(MAKE) maintainer-clean rm -rf $(CONFIG_GENERATED) configure VERSION DIST_EXCLUDE_X gauche-c-wrapper-0.6.1.orig/objc/0002755000000000000000000000000011237307565013425 5ustar gauche-c-wrapper-0.6.1.orig/objc/c-wrapper/0002755000000000000000000000000011237307544015322 5ustar gauche-c-wrapper-0.6.1.orig/objc/c-wrapper/objc-ffi.scm0000644000000000000000000003013711237307544017507 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; objc-ffi.scm ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; $Id: $ ;; (define-module c-wrapper.objc-ffi (use c-wrapper) (use file.util) (use srfi-1) (extend c-wrapper.c-ffi) (c-load '("stdlib.h" "objc/objc-runtime.h" "objc/objc-class.h") :libs "-lobjc" :module #f :import '(id SEL objc_lookUpClass objc_class objc_addClass objc_method objc_method_list objc_super sel_registerName Class CLS_CLASS CLS_META class_addMethods nil malloc) :compiled-lib "objc-ffilib") (export @ @selector c-load-framework objc-lookup-class objc-register-method objc-add-method make-super ) ) (select-module c-wrapper.objc-ffi) (with-module c-wrapper.c-ffi (set! %c-load-framework (lambda (name) (or (and-let* ((filename (find-file-in-paths name :paths (map (cut string-append <> name ".framework/") (list (build-path (sys-getenv "HOME") "Library/Frameworks/") "/Library/Frameworks/" "/System/Library/Frameworks/")) :pred file-is-readable?))) (c-load-library filename)) (errorf "framework ~a is not found" name))))) (define c-load-framework (with-module c-wrapper.objc-ffi %c-load-framework)) (define method-pool (make-hash-table 'string=?)) (define ivar-pool (make-hash-table 'equal?)) (define (@ str) (objc-string str) ) (define (@selector name) (sel_registerName (x->string name))) (define (encode-objc-type c-type) (format "~a~a" (cond ((equal? c-type ) "c") ((equal? c-type ) "i") ((equal? c-type ) "s") ((equal? c-type ) "l") ((equal? c-type ) "q") ((equal? c-type ) "C") ((equal? c-type ) "I") ((equal? c-type ) "S") ((equal? c-type ) "L") ((equal? c-type ) "Q") ((equal? c-type ) "f") ((equal? c-type ) "d") ((equal? c-type ) "v") ((equal? c-type ) "@") ((equal? c-type ) "#") ((equal? c-type ) ":") ((is-a? c-type ) (format "[~a]" (encode-objc-type (element-type-of c-type)))) ((is-a? c-type ) (format "{~a}" (string-append (map (lambda (alist) (format "~a=~a" (car alist) (encode-objc-type (cdr alist)))) (decl-alist-of c-type))))) ((is-a? c-type ) (format "(~a)" (string-append (map (lambda (alist) (format "~a" (encode-objc-type (cdr alist)))) (decl-alist-of c-type))))) ((bit-field? c-type) "b") ((is-a? c-type ) (format "^~a" (encode-objc-type (orig-c-type-of c-type)))) (else "?")) (cond ((bit-field? c-type) (bits-of c-type)) (else (c-sizeof c-type))))) (define (objc-lookup-class name) (objc_lookUpClass (symbol->string name))) (define (objc-register-method name type-list) (hash-table-put! method-pool name type-list)) (define (nil? x) (eq? (ref x) nil)) (define (objc-make-class name super-class-ptr) (unless (nil? (objc-lookup-class name)) (errorf "Objective-C class '~a' is already exists." name)) (let ((root-class-ptr (do ((class-ptr super-class-ptr (ref (deref class-ptr) 'super_class))) ((nil? (ref (deref class-ptr) 'super_class)) class-ptr))) (new-class (deref (cast (malloc (c-sizeof (c-struct 'objc_class)))))) (meta-class (deref (cast (malloc (c-sizeof (c-struct 'objc_class))))))) (set! (ref new-class 'isa) (ptr meta-class)) (set! (ref new-class 'info) CLS_CLASS) (set! (ref meta-class 'info) CLS_META) (set! (ref new-class 'name) (symbol->string name)) (set! (ref meta-class 'name) (symbol->string name)) (set! (ref new-class 'methodLists) (make-null-ptr)) (set! (ref meta-class 'methodLists) (make-null-ptr)) (set! (ref new-class 'super_class) super-class-ptr) (set! (ref meta-class 'super_class) (ref (deref super-class-ptr) 'isa)) (set! (ref meta-class 'isa) (ref (deref root-class-ptr) 'isa)) (set! (ref new-class 'instance_size) (ref (deref super-class-ptr) 'instance_size)) (set! (ref meta-class 'instance_size) (ref (deref (ref meta-class 'super_class)) 'instance_size)) (objc_addClass (ptr new-class)) new-class)) (define (objc-add-method class method-name ret-type arg-types proc) (let ((selector (@selector method-name)) (method (make (c-struct 'objc_method))) (method-list (make (c-struct 'objc_method_list)))) (set! (ref method 'method_name) selector) (set! (ref method 'method_types) (apply string-append (map encode-objc-type (list* ret-type arg-types)))) (set! (ref method 'method_imp) (cast (c-func-ptr ret-type (list* arg-types)) proc)) (set! (ref method-list 'method_count) 1) (set! (ref (ref method-list 'method_list) 0) method) (class_addMethods class (ptr method-list)))) (define (needs-objc_msgSend_stret? ret-type) (define (composite-type? ret-type) (or (is-a? ret-type ) (is-a? ret-type ))) (if (big-endian?) ;; Mac on PPC (composite-type? ret-type) ;; Mac on Intel (cond ((not (composite-type? ret-type)) #f) ((< 8 (c-sizeof ret-type)) #t) (else (let loop ((composite-type ret-type)) (find (lambda (type) (cond ((composite-type? type) (loop type)) ((and (is-a? type ) (< 1 (size-of type))) #t) (else #f))) (map cdr (decl-alist-of composite-type)))))))) (define (%objc-msg-send obj super? selector-name . args) (or (and-let* ((lst (hash-table-get method-pool selector-name))) (let* ((ret-type (car lst)) (arg-types (cdr lst)) (send (if (needs-objc_msgSend_stret? ret-type) (lambda (obj selector . args) (let ((retval (make ret-type))) (apply (make-c-func-vaargs (if super? 'objc_msgSendSuper_stret 'objc_msgSend_stret) (append (list (ptr ) (if super? (ptr (c-struct 'objc_super)) ) ) arg-types)) (ptr retval) obj selector args) retval)) (make-c-func-vaargs (if super? 'objc_msgSendSuper 'objc_msgSend) ret-type (append (list (if super? (ptr (c-struct 'objc_super)) ) ) arg-types)))) (sel (@selector selector-name))) (if (null-ptr? sel) (errorf "selector ~a is not found." selector-name) (apply send obj sel args)))) (errorf "selector ~a is not found." selector-name))) (define (args->selector-name args) (string-append (string-join (map x->string (filter (lambda (elem) (or (symbol? elem) (keyword? elem))) args)) ":") (if (= (length args) 1) "" ":"))) (define (filter-args args) (remove (lambda (elem) (or (symbol? elem) (keyword? elem))) args)) (define-method object-apply ((obj ) . rest) (apply %objc-msg-send obj #f (args->selector-name rest) (filter-args rest))) (define-method object-apply ((obj (ptr (c-struct 'objc_super))) . rest) (apply %objc-msg-send obj #t (args->selector-name rest) (filter-args rest))) (define (make-super class obj) (let ((data (make (c-struct 'objc_super)))) (set! (ref data 'receiver) obj) (set! (ref data 'class) (ref (deref (cast (ptr (c-struct 'objc_class)) class)) 'super_class)) (ptr data))) (provide "c-wrapper/objc-ffi") ;; end of file gauche-c-wrapper-0.6.1.orig/objc/Makefile.in0000644000000000000000000000337211237307544015472 0ustar # # $Id: Makefile.in 360 2006-12-21 15:30:12Z naoki $ # # General info SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ datarootdir = @datarootdir@ srcdir = @srcdir@ VPATH = $(srcdir) # These may be overridden by make invocators DESTDIR = GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@ INSTALL = @GAUCHE_INSTALL@ CPPFLAGS = -DGAUCHE_API_0_8_8 @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ # Other parameters SOEXT = @SOEXT@ OBJEXT = @OBJEXT@ EXEEXT = @EXEEXT@ # Module-specific stuff ARCHFILES = @OBJC_ENABLE_TRUE@ARCHFILES += objc-ffilib.$(SOEXT) SCMFILES = @OBJC_ENABLE_TRUE@SCMFILES += objc-wrapper.scm c-wrapper/objc-ffi.scm HEADERS = TARGET = $(ARCHFILES) GENERATED = @OBJC_ENABLE_TRUE@GENERATED += objc-ffilib.stub objc-ffilib_head.c objc-ffilib_tail.c CONFIG_GENERATED = Makefile GAUCHE_PKGINCDIR = @GAUCHE_PKGINCDIR@ GAUCHE_PKGLIBDIR = @GAUCHE_PKGLIBDIR@ GAUCHE_PKGARCHDIR = @GAUCHE_PKGARCHDIR@ all : $(TARGET) objc-ffilib.$(SOEXT): ./c-wrapper/objc-ffi.scm $(GOSH) -I../lib -I../src cwcompile --verbose $^ install : all $(INSTALL) -m 444 -T $(DESTDIR)$(GAUCHE_PKGINCDIR) $(HEADERS) $(INSTALL) -m 555 -T $(DESTDIR)$(GAUCHE_PKGARCHDIR) $(ARCHFILES) $(INSTALL) -m 444 -T $(DESTDIR)$(GAUCHE_PKGLIBDIR) $(SCMFILES) uninstall : $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGINCDIR) $(HEADERS) $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGARCHDIR) $(ARCHFILES) $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGLIBDIR) $(SCMFILES) clean : rm -rf core $(TARGET) $(GENERATED) *.o *~ so_locations distclean : clean rm -rf $(CONFIG_GENERATED) maintainer-clean : clean rm -rf $(CONFIG_GENERATED) gauche-c-wrapper-0.6.1.orig/objc/objc-wrapper.scm0000644000000000000000000000575511237307544016533 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; objc-wrapper.scm - A generic wrapper for Objective-C libraries ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: $ (define-module objc-wrapper (use util.match) (extend c-wrapper c-wrapper.objc-ffi) (export define-objc-class define-objc-method) ) (select-module objc-wrapper) (define-syntax define-objc-class (syntax-rules () ((_ class super-class) (define class (cast (ptr (objc-make-class 'class (cast super-class)))))))) (define-macro (define-objc-method class ret-type lst . body) (receive (method-name arg-types arg-vars) (let loop ((rest lst) (name-parts '()) (arg-types '()) (arg-vars '())) (match rest (() (values (string-append (string-join (reverse name-parts) ":") (if (< 1 (length name-parts)) ":" "")) (reverse arg-types) (reverse arg-vars))) ((('quote x) _ ...) (loop (cdr rest) (cons (x->string x) name-parts) arg-types arg-vars)) (((? keyword? x) _ ...) (loop (cdr rest) (cons (x->string x) name-parts) arg-types arg-vars)) (((? symbol? x) _ ...) (loop (cdr rest) name-parts (cons ' arg-types) (cons x arg-vars))) (((var type) _ ...) (loop (cdr rest) name-parts (cons type arg-types) (cons var arg-vars))) (else (errorf "Invalid arg spec ~s" lst)))) (let ((sel (gensym))) `(begin (objc-add-method ,class ,method-name ,ret-type (list ,@arg-types) (lambda (self ,sel ,@arg-vars) (let ((super (make-super ,class self))) ,@body))) (objc-register-method ,method-name (list ,ret-type ,@arg-types)))))) (provide "objc-wrapper") gauche-c-wrapper-0.6.1.orig/README0000644000000000000000000000144511237307544013367 0ustar This is c-wrapper, a generic wrapper for C libraries. Requirements ------------ - Gauche 0.8.6 or later Install ------- To install, you can use gauche-package. % gauche-package install <<>> Or expand this tarball, configure and make (use GNU make). % ./configure % make % make install Included Libraries ------------------ c-wrapper includes the external libraries below. - libffi (from GCC 4.0.2) (http://gcc.gnu.org/) - lang.tool (c-grammar.scm, c-lex.scm) in Gauche Garbage Collection (http://homepage.mac.com/skimu/ggc/) - Dominique Boucher's Lalr (lalr-gauche.scm) (http://www.iro.umontreal.ca/~boucherd/Lalr/documentation/lalr.html) License ------- c-wrapper's license is MIT License, but the libraries (libffi, lang.tool, lalr) obey their own license. gauche-c-wrapper-0.6.1.orig/src/0002755000000000000000000000000011237307565013277 5ustar gauche-c-wrapper-0.6.1.orig/src/c-ffi.c0000644000000000000000000007224111237307542014426 0ustar /** * c-ffi.c * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: c-ffi.c 652 2009-08-04 15:44:27Z naoki $ */ #include "c-ffi.h" #define FFI_ERROR_CHECK(x) \ do { \ ffi_status _status = x; \ switch (_status) { \ case FFI_OK: \ /* DO NOTHING */ \ break; \ case FFI_BAD_TYPEDEF: \ Scm_Error("One of the ffi_type objects that ffi_prep_cif came across is bad at line %S in %S", SCM_MAKE_INT(__LINE__), SCM_MAKE_STR_IMMUTABLE(__FILE__)); \ break; \ case FFI_BAD_ABI: \ Scm_Error("FFI_BAD_ABI error has occurred at line %S in %S", SCM_MAKE_INT(__LINE__), SCM_MAKE_STR_IMMUTABLE(__FILE__)); \ break; \ default: \ Scm_Error("unknown error (ffi_status = %S) has occurred at line %S in %S", SCM_MAKE_INT(_status), SCM_MAKE_INT(__LINE__), SCM_MAKE_STR_IMMUTABLE(__FILE__)); \ break; \ } \ } while (0) ScmObj Scm_GetUnsignedFFIType(int size) { ffi_type *type; switch (size) { case 1: type = &ffi_type_uint8; break; case 2: type = &ffi_type_uint16; break; case 4: type = &ffi_type_uint32; break; case 8: type = &ffi_type_uint64; break; default: Scm_Error("unsupported type: ~S", size); break; } SCM_RETURN(SCM_MAKE_FFI_TYPE(type)); } ScmObj Scm_GetSignedFFIType(int size) { ffi_type *type; switch (size) { case 1: type = &ffi_type_sint8; break; case 2: type = &ffi_type_sint16; break; case 4: type = &ffi_type_sint32; break; case 8: type = &ffi_type_sint64; break; default: Scm_Error("unsupported type: ~S", size); break; } SCM_RETURN(SCM_MAKE_FFI_TYPE(type)); } static ScmObj Scm_PointerBufferOf(ScmObj ptrObj) { static ScmObj buffer_of_proc = SCM_FALSE; ScmObj uvec; if (SCM_FALSEP(buffer_of_proc)) { buffer_of_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "buffer-of"); } SCM_RETURN(Scm_ApplyRec1(buffer_of_proc, ptrObj)); } static void Scm_PointerSet(ScmObj ptrObj, void *ptr) { ScmObj uvec = Scm_PointerBufferOf(ptrObj); memcpy(SCM_UVECTOR_ELEMENTS(uvec), &ptr, sizeof(void*)); } void *Scm_PointerGet(ScmObj ptrObj) { ScmObj uvec = Scm_PointerBufferOf(ptrObj); void *ptr; memcpy(&ptr, SCM_UVECTOR_ELEMENTS(uvec), sizeof(void*)); return ptr; } ScmObj Scm_PtrClass(ScmObj cTypeClass) { static ScmObj ptr_proc = SCM_FALSE; if (SCM_FALSEP(ptr_proc)) { ptr_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "ptr"); } SCM_RETURN(Scm_ApplyRec1(ptr_proc, cTypeClass)); } ScmObj Scm_BufferOf(ScmObj ptrObj) { static ScmObj bufferof_proc = SCM_FALSE; if (SCM_FALSEP(bufferof_proc)) { bufferof_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "buffer-of"); } SCM_RETURN(Scm_ApplyRec1(bufferof_proc, ptrObj)); } ScmObj Scm_GetVoidPtrClass() { static ScmObj voidptr_class = SCM_FALSE; if (SCM_FALSEP(voidptr_class)) { voidptr_class = PTR_CLASS(SCM_SYMBOL_VALUE(MODULE_NAME, "")); } SCM_RETURN(voidptr_class); } ScmObj Scm_MakePointer(ScmObj klass, void *ptr) { static ScmObj make_proc = SCM_FALSE; ScmObj ptrObj; ScmObj buf; if (SCM_FALSEP(make_proc)) { make_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "make"); } /* A () (ptr A) () +----------+ +------+ +----------+ +---------------+ |elements --->| data | |elements --->|pointer of data| +----------+ +--^---+ +----------+ +-------|-------+ +------------------------------+ In this case, (ptr A) can be a dangling pointer when A is GCed and elements of (ptr A) are allocated with SCM_NEW_ATOMIC2. So we need to use SCM_NEW2 to allocate elements of (ptr A). */ buf = Scm_MakeU8VectorFromArrayShared(sizeof(void*), SCM_NEW2(void*, sizeof(void*))); ptrObj = Scm_ApplyRec3(make_proc, klass, SCM_MAKE_KEYWORD("buffer"), buf); Scm_PointerSet(ptrObj, ptr); SCM_RETURN(ptrObj); } DEFINE_PREDICATE(PtrP, "") DEFINE_PREDICATE(BasicPtrP, "") ScmObj Scm_Deref_uvector(ScmObj ptrObj, ScmObj size) { ScmObj buf; unsigned char *p; p = (unsigned char*)POINTER_DATA(ptrObj); buf = Scm_MakeU8VectorFromArrayShared(Scm_GetInteger(size), p); if (p == NULL) { SCM_UVECTOR_ELEMENTS(buf) = p; } SCM_RETURN(buf); } ScmObj Scm_Deref(ScmObj ptrObj) { static ScmObj orig_c_type_of_proc = SCM_FALSE; static ScmObj make_proc = SCM_FALSE; static ScmObj csizeof_proc = SCM_FALSE; ScmObj klass; ScmObj size; ScmObj obj; if (SCM_FALSEP(orig_c_type_of_proc)) { orig_c_type_of_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "orig-c-type-of"); make_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "make"); csizeof_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "c-sizeof"); } klass = Scm_ApplyRec1(orig_c_type_of_proc, SCM_OBJ(SCM_CLASS_OF(ptrObj))); size = Scm_ApplyRec1(csizeof_proc, klass); obj = Scm_ApplyRec3(make_proc, klass, SCM_MAKE_KEYWORD("buffer"), Scm_Deref_uvector(ptrObj, size)); SCM_RETURN(obj); } ScmObj Scm_MakeFFIType(ffi_type *data) { ScmFFIType *z = SCM_NEW(ScmFFIType); SCM_SET_CLASS(z, SCM_CLASS_FFI_TYPE); z->data = data; SCM_RETURN(SCM_OBJ(z)); } ScmObj Scm_MakeFFICif(ffi_cif *data) { ScmFFICif *z = SCM_NEW(ScmFFICif); SCM_SET_CLASS(z, SCM_CLASS_FFI_CIF); z->data = data; SCM_RETURN(SCM_OBJ(z)); } ScmObj Scm_MakeFFIArrayType(ffi_type *elem_type, long size) { ffi_type *array_type = SCM_NEW(ffi_type); #if defined __x86_64__ ffi_type *follow_elem_type = SCM_NEW(ffi_type); long i; memcpy(follow_elem_type, elem_type, sizeof(ffi_type)); follow_elem_type->alignment = 1; array_type->size = elem_type->size * size; array_type->alignment = elem_type->alignment; array_type->type = FFI_TYPE_STRUCT; array_type->elements = SCM_NEW_ARRAY(ffi_type*, size + 1); for (i = 0; i < size; ++i) { if (i == 0) { array_type->elements[i] = elem_type; } else { array_type->elements[i] = follow_elem_type; } } array_type->elements[size] = NULL; #else array_type->size = elem_type->size * size; array_type->alignment = elem_type->alignment; array_type->type = elem_type->type; array_type->elements = elem_type->elements; #endif SCM_RETURN(SCM_MAKE_FFI_TYPE(array_type)); } ScmObj Scm_MakeFFIStructType(ScmObj elem_list) { ffi_type *struct_type = SCM_NEW(ffi_type); ffi_cif dummy_cif; ScmObj p; int i = 0; if (Scm_Length(elem_list) == 0) { Scm_Error("can't define zero-member struct"); } struct_type->size = 0; struct_type->alignment = 0; struct_type->type = FFI_TYPE_STRUCT; struct_type->elements = SCM_NEW_ARRAY(ffi_type*, Scm_Length(elem_list) + 1); SCM_FOR_EACH(p, elem_list) { if (!SCM_FFI_TYPEP(SCM_CAR(p))) { Scm_Error(" required, but got %S", SCM_CAR(p)); } struct_type->elements[i] = SCM_FFI_TYPE_DATA(SCM_CAR(p)); ++i; } struct_type->elements[i] = NULL; /* initialize aggregate */ ffi_prep_cif(&dummy_cif, FFI_DEFAULT_ABI, 0, struct_type, NULL); SCM_RETURN(SCM_MAKE_FFI_TYPE(struct_type)); } ScmObj Scm_FFIPrepCIF(ffi_type *rtype, ScmObj arglist) { ffi_cif *cif = SCM_NEW(ffi_cif); int nargs = Scm_Length(arglist); ffi_type **atypes = SCM_NEW_ARRAY(ffi_type*, nargs); int i = 0; ffi_status status; ScmObj p; SCM_FOR_EACH(p, arglist) { atypes[i] = SCM_FFI_TYPE_DATA(SCM_CAR(p)); ++i; } status = ffi_prep_cif(cif, FFI_DEFAULT_ABI, nargs, rtype, atypes); SCM_RETURN(Scm_Values2(SCM_MAKE_INT(status), SCM_MAKE_FFI_CIF(cif))); } STATIC_DEFINE_PREDICATE(ctype_p, "") STATIC_DEFINE_PREDICATE(cchar_p, "") STATIC_DEFINE_PREDICATE(cuchar_p, "") STATIC_DEFINE_PREDICATE(cshort_p, "") STATIC_DEFINE_PREDICATE(cushort_p, "") STATIC_DEFINE_PREDICATE(cfloat_p, "") STATIC_DEFINE_PREDICATE(cpromise_p, "") static ffi_type *ffi_type_of(ScmObj ctype) { static ScmObj slot = SCM_FALSE; ScmClass *klass; ScmObj p; ScmSlotAccessor *sa; if (SCM_FALSEP(slot)) { slot = SCM_INTERN("ffi-type"); } klass = SCM_CLASS_OF(ctype); p = Scm_Assq(slot, klass->accessors); if (!SCM_PAIRP(p)) { Scm_Error(" required, but got %S", ctype); } else if (!SCM_XTYPEP(SCM_CDR(p), SCM_CLASS_SLOT_ACCESSOR)) { Scm_Error("slot accessor information of class %S, slot %S is screwed up.", SCM_OBJ(klass), slot); } sa = SCM_SLOT_ACCESSOR(SCM_CDR(p)); if (0 <= sa->slotNumber) { return SCM_FFI_TYPE_DATA(Scm_InstanceSlotRef(ctype, sa->slotNumber)); } else { Scm_Error("wrong slot number: %d", sa->slotNumber); } } static void *basic_cast_arg(ffi_type *ftype, ScmObj arg) { void *avalue = NULL; #define SET_CAST_VALUE(avalue, type, func, v) \ if (SCM_INTP(v)) { \ avalue = SCM_MALLOC(sizeof(type)); \ *((type*) avalue) = (type) SCM_INT_VALUE(v); \ } else if (SCM_NUMBERP(v)) { \ avalue = SCM_MALLOC(sizeof(type)); \ *((type*) avalue) = (type) func(v); \ } switch (ftype->type) { case FFI_TYPE_INT: SET_CAST_VALUE(avalue, int, Scm_GetInteger, arg); break; case FFI_TYPE_UINT8: SET_CAST_VALUE(avalue, uint8_t, Scm_GetIntegerU, arg); break; case FFI_TYPE_SINT8: SET_CAST_VALUE(avalue, int8_t, Scm_GetInteger, arg); break; case FFI_TYPE_UINT16: SET_CAST_VALUE(avalue, uint16_t, Scm_GetIntegerU, arg); break; case FFI_TYPE_SINT16: SET_CAST_VALUE(avalue, int16_t, Scm_GetInteger, arg); break; case FFI_TYPE_UINT32: SET_CAST_VALUE(avalue, uint32_t, Scm_GetIntegerU, arg); break; case FFI_TYPE_SINT32: SET_CAST_VALUE(avalue, int32_t, Scm_GetInteger, arg); break; case FFI_TYPE_UINT64: SET_CAST_VALUE(avalue, uint64_t, Scm_GetIntegerU64, arg); break; case FFI_TYPE_SINT64: SET_CAST_VALUE(avalue, int64_t, Scm_GetInteger64, arg); break; case FFI_TYPE_FLOAT: SET_CAST_VALUE(avalue, float, Scm_GetDouble, arg); break; case FFI_TYPE_DOUBLE: SET_CAST_VALUE(avalue, double, Scm_GetDouble, arg); break; case FFI_TYPE_POINTER: if (SCM_STRINGP(arg)) { avalue = SCM_MALLOC(sizeof(void*)); *((void**) avalue) = (void*) Scm_GetString(SCM_STRING(arg)); } else if (SCM_FOREIGN_POINTER_P(arg)) { avalue = SCM_MALLOC(sizeof(void*)); *((void**) avalue) = SCM_FOREIGN_POINTER_REF(void*, arg); } break; default: /* DO NOTHING */ break; } return avalue; } static void *cast_arg(ffi_type *ftype, ScmObj ctype, ScmObj arg) { static ScmObj cast_method = SCM_FALSE; void *avalue = NULL; ScmObj casted_arg; switch (ftype->type) { case FFI_TYPE_INT: /* FALLTHROUGH */ case FFI_TYPE_UINT8: /* FALLTHROUGH */ case FFI_TYPE_SINT8: /* FALLTHROUGH */ case FFI_TYPE_UINT16: /* FALLTHROUGH */ case FFI_TYPE_SINT16: /* FALLTHROUGH */ case FFI_TYPE_UINT32: /* FALLTHROUGH */ case FFI_TYPE_SINT32: /* FALLTHROUGH */ case FFI_TYPE_UINT64: /* FALLTHROUGH */ case FFI_TYPE_SINT64: /* FALLTHROUGH */ case FFI_TYPE_FLOAT: /* FALLTHROUGH */ case FFI_TYPE_DOUBLE: /* FALLTHROUGH */ case FFI_TYPE_POINTER: avalue = basic_cast_arg(ftype, arg); if (avalue != NULL) { break; } /* FALLTHROUGH */ case FFI_TYPE_STRUCT: /* FALLTHROUGH */ default: casted_arg = arg; if (!SCM_ISA(arg, SCM_CLASS(ctype))) { if (SCM_FALSEP(cast_method)) { cast_method = SCM_SYMBOL_VALUE(MODULE_NAME, "cast"); } casted_arg = Scm_ApplyRec2(cast_method, ctype, arg); } avalue = SCM_UVECTOR_ELEMENTS(Scm_BufferOf(casted_arg)); } return avalue; } static ScmObj cforce(ScmObj arg) { static ScmObj cforce_proc = SCM_FALSE; if (SCM_FALSEP(cforce_proc)) { cforce_proc = SCM_SYMBOL_VALUE(MODULE_NAME, "c-force"); } SCM_RETURN(Scm_ApplyRec1(cforce_proc, arg)); } static void *promote_arg(ScmObj arg, ffi_type **promoted_type) { void *avalue = NULL; #define SET_PROMOTE_VALUE(avalue, type, uvectype) \ avalue = SCM_MALLOC((*promoted_type)->size); \ *((type*) avalue) = (type) SCM_##uvectype##_ELEMENTS(Scm_BufferOf(arg))[0]; \ *promoted_type = NULL; if (SCM_INTEGERP(arg)) { int oor = TRUE; if (!(Scm_GetInteger32Clamp(arg, SCM_CLAMP_NONE, &oor), oor)) { *promoted_type = &ffi_type_sint32; avalue = basic_cast_arg(*promoted_type, arg); } else if (!(Scm_GetIntegerU32Clamp(arg, SCM_CLAMP_NONE, &oor), oor)) { *promoted_type = &ffi_type_uint32; avalue = basic_cast_arg(*promoted_type, arg); } else if (!(Scm_GetInteger64Clamp(arg, SCM_CLAMP_NONE, &oor), oor)) { *promoted_type = &ffi_type_sint64; avalue = basic_cast_arg(*promoted_type, arg); } else if (!(Scm_GetIntegerU64Clamp(arg, SCM_CLAMP_NONE, &oor), oor)) { *promoted_type = &ffi_type_uint64; avalue = basic_cast_arg(*promoted_type, arg); } } else if (SCM_REALP(arg)) { *promoted_type = &ffi_type_double; avalue = basic_cast_arg(*promoted_type, arg); } else if (SCM_STRINGP(arg) || SCM_FOREIGN_POINTER_P(arg)) { *promoted_type = &ffi_type_pointer; avalue = basic_cast_arg(*promoted_type, arg); } else if (cchar_p(arg)) { *promoted_type = &ffi_type_sint32; SET_PROMOTE_VALUE(avalue, int32_t, S8VECTOR); } else if (cuchar_p(arg)) { *promoted_type = &ffi_type_sint32; SET_PROMOTE_VALUE(avalue, int32_t, U8VECTOR); } else if (cshort_p(arg)) { *promoted_type = &ffi_type_sint32; SET_PROMOTE_VALUE(avalue, int32_t, S16VECTOR); } else if (cushort_p(arg)) { *promoted_type = &ffi_type_sint32; SET_PROMOTE_VALUE(avalue, int32_t, U16VECTOR); } else if (cfloat_p(arg)) { *promoted_type = &ffi_type_double; SET_PROMOTE_VALUE(avalue, double, F32VECTOR); } else if (cpromise_p(arg)) { avalue = promote_arg(cforce(arg), promoted_type); } else if (ctype_p(arg)) { *promoted_type = ffi_type_of(SCM_OBJ(SCM_CLASS_OF(arg))); avalue = SCM_UVECTOR_ELEMENTS(Scm_BufferOf(arg)); } if (*promoted_type == NULL) { Scm_Error("can't pass %S as va_arg", arg); } assert(avalue != NULL); return avalue; } ScmObj ConvertScmObj(ffi_type *ftype, ScmObj ctype, void *rvalue) { static ScmObj make_method = SCM_FALSE; #define SCM_CAST_VALUE(func, type, v) (func(*((type*)v))) switch (ftype->type) { case FFI_TYPE_INT: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeInteger, int, rvalue)); case FFI_TYPE_UINT8: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeIntegerU, uint8_t, rvalue)); case FFI_TYPE_SINT8: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeInteger, int8_t, rvalue)); case FFI_TYPE_UINT16: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeIntegerU, uint16_t, rvalue)); case FFI_TYPE_SINT16: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeInteger, int16_t, rvalue)); case FFI_TYPE_UINT32: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeIntegerU, uint32_t, rvalue)); case FFI_TYPE_SINT32: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeInteger, int32_t, rvalue)); case FFI_TYPE_UINT64: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeIntegerU64, uint64_t, rvalue)); case FFI_TYPE_SINT64: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeInteger64, int64_t, rvalue)); case FFI_TYPE_FLOAT: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeFlonum, float, rvalue)); case FFI_TYPE_DOUBLE: SCM_RETURN(SCM_CAST_VALUE(Scm_MakeFlonum, double, rvalue)); case FFI_TYPE_VOID: SCM_RETURN(SCM_UNDEFINED); case FFI_TYPE_POINTER: /* FALLTHROUGH */ case FFI_TYPE_STRUCT: /* FALLTHROUGH */ default: if (SCM_FALSEP(make_method)) { make_method = SCM_SYMBOL_VALUE(MODULE_NAME, "make"); } SCM_RETURN(Scm_ApplyRec3(make_method, ctype, SCM_MAKE_KEYWORD("buffer"), Scm_MakeU8VectorFromArrayShared(ftype->size, rvalue))); } /* NOTREACHED */ SCM_RETURN(SCM_UNDEFINED); } #if defined(GAUCHE_WINDOWS) || defined(__CYGWIN__) static void *lookup_symbol(const char *sym) { void *addr; HANDLE hProcess; HMODULE *lphModules; DWORD needed; int i = 0; hProcess = GetCurrentProcess(); if (!EnumProcessModules(hProcess, NULL, 0, &needed)) { Scm_Error("EnumProcessModules failed (1st call).\n"); } lphModules = SCM_MALLOC(needed); if (!EnumProcessModules(hProcess, lphModules, needed, &needed)) { Scm_Error("EnumProcessModules failed (2nd call).\n"); } addr = NULL; for (i = 0; i < needed/sizeof(HMODULE); ++i) { addr = GetProcAddress(lphModules[i], sym); CloseHandle(lphModules[i]); if (addr != NULL) { break; } } CloseHandle(hProcess); return addr; } #else static void *lookup_symbol(const char *sym) { return dlsym(RTLD_DEFAULT, sym); } #endif static ScmObj c_subr_proc(ScmObj *args, int argc, void *data) { CSubrInfo *c_subr_info = data; ffi_cif *cif; ffi_type **atypes = NULL; void **avalues; void *rvalue; int i = 0; ScmObj *passed_args; ScmObj p; int nargs; ffi_cif vaarg_cif; assert(c_subr_info->cif->nargs == argc || (c_subr_info->cif->nargs + 1) == argc); if (c_subr_info->fn == NULL) { void *fn = lookup_symbol(Scm_GetStringConst(SCM_SYMBOL_NAME(c_subr_info->identifier))); if (fn == NULL) { Scm_Error("function %S is not found.", c_subr_info->identifier); } c_subr_info->fn = fn; } if (c_subr_info->cif->nargs == argc) { nargs = argc; } else { assert(SCM_LISTP(args[argc - 1])); nargs = argc - 1 + Scm_Length(args[argc - 1]); } avalues = SCM_NEW_ARRAY(void*, nargs); passed_args = SCM_NEW_ARRAY(ScmObj, nargs); for (i = 0; i < c_subr_info->cif->nargs; ++i) { passed_args[i] = args[i]; } if (c_subr_info->cif->nargs < argc) { SCM_FOR_EACH(p, args[argc - 1]) { passed_args[i] = SCM_CAR(p); ++i; } } for (i = 0; i < c_subr_info->cif->nargs; ++i) { avalues[i] = cast_arg(c_subr_info->cif->arg_types[i], Scm_VectorRef(SCM_VECTOR(c_subr_info->arg_types), i, SCM_UNBOUND), passed_args[i]); } /* We need to make new ffi_cif if optional arguments are exists. */ if (c_subr_info->cif->nargs < nargs) { atypes = SCM_NEW_ARRAY(ffi_type*, nargs); memcpy(atypes, c_subr_info->cif->arg_types, sizeof(ffi_type*) * c_subr_info->cif->nargs); for (i = c_subr_info->cif->nargs; i < nargs; ++i) { avalues[i] = promote_arg(passed_args[i], &atypes[i]); } cif = &vaarg_cif; FFI_ERROR_CHECK(ffi_prep_cif(cif, c_subr_info->cif->abi, nargs, c_subr_info->cif->rtype, atypes)); } else { cif = c_subr_info->cif; } rvalue = SCM_MALLOC(cif->rtype->size); TRY { if (cif->rtype->size < sizeof(ffi_arg)) { ffi_arg result; ffi_call(cif, FFI_FN(c_subr_info->fn), &result, avalues); #ifdef WORDS_BIGENDIAN if (cif->rtype->type == FFI_TYPE_STRUCT) { memcpy(rvalue, &result, cif->rtype->size); } else { memcpy(rvalue, ((void*) &result) + sizeof(result) - cif->rtype->size, cif->rtype->size); } #else memcpy(rvalue, &result, cif->rtype->size); #endif } else { ffi_call(cif, FFI_FN(c_subr_info->fn), rvalue, avalues); } } CATCH(e) { THROW_EXCEPTION(e); } SCM_RETURN(ConvertScmObj(cif->rtype, c_subr_info->ret_type, rvalue)); } ScmObj Scm_MakeCSubr(ScmObj fnptr, ScmObj ret_type, ScmObj arglist, ScmObj optional_p, ScmObj identifier) { CSubrInfo *c_subr_info = SCM_NEW(CSubrInfo); int nargs = Scm_Length(arglist); ffi_type **atypes = SCM_NEW_ARRAY(ffi_type*, nargs); ffi_type *rtype = ffi_type_of(ret_type); ScmObj arg_types = Scm_MakeVector(nargs, SCM_UNBOUND); int i = 0; ScmObj p; ffi_status status; if (SCM_FALSEP(fnptr) && !SCM_SYMBOLP(identifier)) { Scm_Error(" required, but got %S", identifier); } /* make ffi_cif */ i = 0; SCM_FOR_EACH(p, arglist) { atypes[i] = ffi_type_of(SCM_CAR(p)); Scm_VectorSet(SCM_VECTOR(arg_types), i, SCM_CAR(p)); ++i; } c_subr_info->cif = SCM_NEW(ffi_cif); FFI_ERROR_CHECK(ffi_prep_cif(c_subr_info->cif, FFI_DEFAULT_ABI, nargs, rtype, atypes)); if (SCM_FALSEP(fnptr)) { c_subr_info->fn = NULL; } else { c_subr_info->fn = POINTER_DATA(fnptr); } c_subr_info->identifier = identifier; c_subr_info->arg_types = arg_types; c_subr_info->ret_type = ret_type; SCM_RETURN(Scm_MakeSubr(c_subr_proc, c_subr_info, nargs, SCM_TRUEP(optional_p), identifier)); } ScmObj Scm_FFICall(ffi_cif *cif, ScmObj fnptr, ScmObj rvalueptr, ScmObj arglist) { int nargs = Scm_Length(arglist); void **avalues = SCM_NEW_ARRAY(void*, nargs); void *fn; void *rvalue; int i = 0; ScmObj p; if (BASIC_POINTERP(fnptr)) { fn = POINTER_DATA(fnptr); } else { Scm_Error(" required, but got %S", fnptr); } if (POINTERP(rvalueptr)) { rvalue = POINTER_DATA(rvalueptr); } else { Scm_Error(" required, but got %S", rvalueptr); } SCM_FOR_EACH(p, arglist) { if (!SCM_UVECTORP(SCM_CAR(p))) { Scm_Error(" required, but got %S", SCM_CAR(p)); } avalues[i] = SCM_UVECTOR_ELEMENTS(SCM_CAR(p)); ++i; } TRY { if (cif->rtype->size < sizeof(ffi_arg)) { ffi_arg result; ffi_call(cif, FFI_FN(fn), &result, avalues); #ifdef WORDS_BIGENDIAN if (cif->rtype->type == FFI_TYPE_STRUCT) { memcpy(rvalue, &result, cif->rtype->size); } else { memcpy(rvalue, ((void*) &result) + sizeof(result) - cif->rtype->size, cif->rtype->size); } #else memcpy(rvalue, &result, cif->rtype->size); #endif } else { ffi_call(cif, FFI_FN(fn), rvalue, avalues); } } CATCH(e) { THROW_EXCEPTION(e); } SCM_RETURN(SCM_UNDEFINED); } static void closure_func(ffi_cif *cif, void *rvalue, void **avalues, void *data) { ScmObj proc = SCM_OBJ(data); ScmObj arglist = SCM_NIL; void *proc_result_ptr; int i; for (i = 0; i < cif->nargs; ++i) { arglist = Scm_Cons(MAKE_VOID_POINTER(avalues[i]), arglist); } arglist = Scm_Reverse(arglist); proc_result_ptr = POINTER_DATA(Scm_ApplyRec(proc, arglist)); if (cif->rtype->size < sizeof(ffi_arg)) { memset(rvalue, 0, sizeof(ffi_arg)); #ifdef WORDS_BIGENDIAN if (cif->rtype->type == FFI_TYPE_STRUCT) { memcpy(rvalue, proc_result_ptr, cif->rtype->size); } else { memcpy(rvalue + sizeof(ffi_arg) - cif->rtype->size, proc_result_ptr, cif->rtype->size); } #else memcpy(rvalue, proc_result_ptr, cif->rtype->size); #endif } else { memcpy(rvalue, proc_result_ptr, cif->rtype->size); } } static void finalize_FFIClosure(ScmObj obj, void *data) { ScmFFIClosure *z = SCM_FFI_CLOSURE(obj); if (z->data) { closure_free(z->data); z->data = NULL; } } ScmObj Scm_MakeFFIClosure(ffi_closure *data) { ScmFFIClosure *z = SCM_NEW(ScmFFIClosure); SCM_SET_CLASS(z, SCM_CLASS_FFI_CLOSURE); Scm_RegisterFinalizer(SCM_OBJ(z), finalize_FFIClosure, NULL); z->data = data; SCM_RETURN(SCM_OBJ(z)); } ScmObj Scm_FFIPrepClosure(ffi_cif *cif, ScmProcedure *proc) { ffi_closure *closure = closure_alloc(); ffi_status status = ffi_prep_closure(closure, cif, closure_func, (void*) proc); SCM_RETURN(Scm_Values2(SCM_MAKE_INT(status), Scm_MakeFFIClosure(closure))); } ScmObj FFI_dlopen(const char *path) { #if defined(GAUCHE_WINDOWS) void *handle = (void*)LoadLibrary(SCM_MBS2WCS(path)); #else void *handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL); #endif if (handle) { SCM_RETURN(MAKE_VOID_POINTER(handle)); } else { SCM_RETURN(SCM_FALSE); } } ScmObj FFI_dlsym(const char *symbol) { void *ptr = lookup_symbol(symbol); if (ptr) { SCM_RETURN(MAKE_VOID_POINTER(ptr)); } else { SCM_RETURN(SCM_FALSE); } } ScmObj FFI_dlerror() { #if defined(GAUCHE_WINDOWS) char buf[80]; sprintf(buf, "rror code %d", GetLastError()); SCM_RETURN(SCM_MAKE_STR_COPYING(buf)); #else const char *errmsg = dlerror(); if (errmsg) { SCM_RETURN(SCM_MAKE_STR_IMMUTABLE(errmsg)); } else { SCM_RETURN(SCM_FALSE); } #endif } ScmObj FFI_dlclose(ScmObj handle) { #if defined(GAUCHE_WINDOWS) (void)FreeLibrary((HMODULE) POINTER_DATA(handle)); SCM_RETURN(SCM_MAKE_INT(0)); #else SCM_RETURN(SCM_MAKE_INT(dlclose(POINTER_DATA(handle)))); #endif } ScmObj Scm_CStructSymbol(ScmObj tagname) { const char *tagname_str; char *struct_symbol_str; int tagname_len; if (!SCM_SYMBOLP(tagname)) { Scm_Error(" required, but got %S", tagname); } tagname_str = Scm_GetStringConst(SCM_SYMBOL_NAME(tagname)); tagname_len = strlen(tagname_str); struct_symbol_str = SCM_NEW_ARRAY(char, tagname_len + 12); snprintf(struct_symbol_str, tagname_len + 12, "", tagname_str); SCM_RETURN(SCM_INTERN(struct_symbol_str)); } ScmObj Scm_CUnionSymbol(ScmObj tagname) { const char *tagname_str; char *union_symbol_str; int tagname_len; if (!SCM_SYMBOLP(tagname)) { Scm_Error(" required, but got %S", tagname); } tagname_str = Scm_GetStringConst(SCM_SYMBOL_NAME(tagname)); tagname_len = strlen(tagname_str); union_symbol_str = SCM_NEW_ARRAY(char, tagname_len + 11); snprintf(union_symbol_str, tagname_len + 12, "", tagname_str); SCM_RETURN(SCM_INTERN(union_symbol_str)); } /* * Module initialization function. */ extern void Scm_Init_c_ffilib(ScmModule*); #ifdef __OBJC__ extern void Scm_Init_ObjCError(ScmModule*); #endif ScmObj Scm_Init_c_ffi(void) { ScmModule *mod; /* Register this DSO to Gauche */ SCM_INIT_EXTENSION(c_ffi); /* Create the module if it doesn't exist yet. */ mod = SCM_MODULE(SCM_FIND_MODULE(MODULE_NAME, TRUE)); /* Register stub-generated procedures */ Scm_Init_c_ffilib(mod); #ifdef __OBJC__ Scm_Init_ObjCError(mod); #endif } gauche-c-wrapper-0.6.1.orig/src/c-ffi.h0000644000000000000000000001647611237307542014443 0ustar /** * ffi.h * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: c-ffi.h 654 2009-08-08 07:48:23Z naoki $ */ /* Prologue */ #ifndef GAUCHE_CWRAPPER_FFI_H #define GAUCHE_CWRAPPER_FFI_H #include #include #include #include #include #include #include #include #if defined(GAUCHE_WINDOWS) || defined(__CYGWIN__) #include #include #endif #include #include "closure_alloc.h" #ifdef __OBJC__ #import #import "ObjCError.h" #if defined GAUCHE_CHAR_ENCODING_EUC_JP #define OBJC_STRING_ENCODING NSJapaneseEUCStringEncoding #elif defined GAUCHE_CHAR_ENCODING_SJIS #define OBJC_STRING_ENCODING NSShiftJISStringEncoding #else #define OBJC_STRING_ENCODING NSUTF8StringEncoding #endif #define TRY @try #define CATCH(e) @catch(NSException *e) #define THROW_EXCEPTION(e) \ do { \ ScmObj name = \ SCM_MAKE_STR_IMMUTABLE([[e name] cStringUsingEncoding: OBJC_STRING_ENCODING]); \ ScmObj reason = \ SCM_MAKE_STR_IMMUTABLE([[e reason] cStringUsingEncoding: OBJC_STRING_ENCODING]); \ ScmObj objcerr = Scm_MakeObjCError(name, reason); \ Scm_Raise(objcerr); \ } while (0) #else #define TRY #define CATCH(e) #define THROW_EXCEPTION(e) #endif SCM_DECL_BEGIN #define MODULE_NAME "c-wrapper.c-ffi" #define DEFINE_PREDICATE(pred, class_name) \ int pred(ScmObj obj) \ { \ ScmClass *klass = NULL; \ if (!klass) { \ klass = SCM_CLASS(SCM_SYMBOL_VALUE(MODULE_NAME, class_name)); \ } \ return SCM_ISA(obj, klass); \ } #define STATIC_DEFINE_PREDICATE(pred, class_name) \ static int pred(ScmObj obj) \ { \ ScmClass *klass = NULL; \ if (!klass) { \ klass = SCM_CLASS(SCM_SYMBOL_VALUE(MODULE_NAME, class_name)); \ } \ return SCM_ISA(obj, klass); \ } /* pointer */ #define POINTER_DATA(x) Scm_PointerGet(x) #define MAKE_VOID_POINTER(ptr) Scm_MakePointer(VOID_PTR_CLASS, (void*) ptr) #define MAKE_POINTER(klass,ptr) Scm_MakePointer(klass, (void*) ptr) #define BUFFER_OF(ptr) Scm_BufferOf(ptr) #define PTR_CLASS(cTypeClass) Scm_PtrClass(SCM_OBJ(cTypeClass)) #define BASIC_POINTERP(obj) BasicPtrP(obj) #define POINTERP(obj) PtrP(obj) #define VOID_PTR_CLASS Scm_GetVoidPtrClass() extern ScmObj Scm_MakePointer(ScmObj klass, void *ptr); extern void *Scm_PointerGet(ScmObj ptrObj); extern ScmObj Scm_Deref_uvector(ScmObj ptrObj, ScmObj size); extern ScmObj Scm_Deref(ScmObj ptrObj); extern ScmObj Scm_GetVoidPtrClass(); extern ScmObj Scm_BufferOf(ScmObj ptrObj); extern ScmObj Scm_PtrClass(ScmObj cTypeClass); extern int PtrP(ScmObj obj); extern int BasicPtrP(ScmObj obj); /* ffi_type */ typedef struct ScmFFITypeRec { SCM_HEADER; ffi_type *data; } ScmFFIType; SCM_CLASS_DECL(Scm_FFITypeClass); #define SCM_CLASS_FFI_TYPE (&Scm_FFITypeClass) #define SCM_FFI_TYPE(obj) ((ScmFFIType*)(obj)) #define SCM_FFI_TYPEP(obj) SCM_XTYPEP(obj, SCM_CLASS_FFI_TYPE) #define SCM_FFI_TYPE_DATA(obj) (SCM_FFI_TYPE(obj)->data) #define SCM_MAKE_FFI_TYPE(data) (Scm_MakeFFIType(data)) extern ScmObj Scm_GetUnsignedFFIType(int size); extern ScmObj Scm_GetSignedFFIType(int size); extern ScmObj Scm_MakeFFIType(ffi_type *data); extern ScmObj Scm_MakeFFIArrayType(ffi_type *elem_type, long size); extern ScmObj Scm_MakeFFIStructType(ScmObj elem_list); /* ffi_cif */ typedef struct ScmFFICifRec { SCM_HEADER; ffi_cif *data; } ScmFFICif; SCM_CLASS_DECL(Scm_FFICifClass); #define SCM_CLASS_FFI_CIF (&Scm_FFICifClass) #define SCM_FFI_CIF(obj) ((ScmFFICif*)(obj)) #define SCM_FFI_CIFP(obj) SCM_XTYPEP(obj, SCM_CLASS_FFI_CIF) #define SCM_FFI_CIF_DATA(obj) (SCM_FFI_CIF(obj)->data) #define SCM_MAKE_FFI_CIF(data) (Scm_MakeFFICif(data)) extern ScmObj Scm_MakeFFICif(ffi_cif *data); /* ffi_closure */ typedef struct ScmFFIClosureRec { SCM_HEADER; ffi_closure *data; } ScmFFIClosure; SCM_CLASS_DECL(Scm_FFIClosureClass); #define SCM_CLASS_FFI_CLOSURE (&Scm_FFIClosureClass) #define SCM_FFI_CLOSURE(obj) ((ScmFFIClosure*)(obj)) #define SCM_FFI_CLOSUREP(obj) SCM_XTYPEP(obj, SCM_CLASS_FFI_CLOSURE) #define SCM_FFI_CLOSURE_DATA(obj) (SCM_FFI_CLOSURE(obj)->data) #define SCM_MAKE_FFI_CLOSURE(data) (Scm_MakeFFIClosure(data)) /* C subr */ typedef struct CSubrInfoRec { ffi_cif *cif; void *fn; ScmObj identifier; ScmObj arg_types; ScmObj ret_type; } CSubrInfo; /* functions */ extern ScmObj Scm_FFIPrepCIF(ffi_type *rtype, ScmObj arglist); extern ScmObj Scm_FFICall(ffi_cif *cif, ScmObj fnptr, ScmObj rvalueptr, ScmObj arglist); extern ScmObj Scm_FFIPrepClosure(ffi_cif *cif, ScmProcedure *proc); extern ScmObj Scm_MakeCSubr(ScmObj fnptr, ScmObj ret_type, ScmObj arg_types, ScmObj optional_p, ScmObj info); extern ScmObj ConvertScmObj(ffi_type *ftype, ScmObj ctype, void *rvalue); extern ScmObj FFI_dlopen(const char *path); extern ScmObj FFI_dlsym(const char *symbol); extern ScmObj FFI_dlerror(); extern ScmObj FFI_dlclose(ScmObj handle); extern ScmObj Scm_CStructSymbol(ScmObj tagname); extern ScmObj Scm_CUnionSymbol(ScmObj tagname); /* BoehmGC 7.1 defines dlopen as GC_dlopen, but its header files doesn't have a prototype of GC_dlopen. */ extern void* GC_dlopen(const char *path, int mode); /* Epilogue */ SCM_DECL_END #endif /* GAUCHE_CWRAPPER_FFI_H */ gauche-c-wrapper-0.6.1.orig/src/c-ffilib.stub0000644000000000000000000001673211237307542015653 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; ffilib.stub ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: c-ffilib.stub 631 2009-06-16 06:37:09Z naoki $ " #include \"c-ffi.h\" " (define-enum FFI_OK) (define-enum FFI_BAD_TYPEDEF) (define-enum FFI_BAD_ABI) (define-type "ffi_type*" ; c-type "ffi_type" ; description "SCM_FFI_TYPEP" ; c-predicate "SCM_FFI_TYPE_DATA" ; unboxer "SCM_MAKE_FFI_TYPE" ; boxer ) (define-type "ffi_cif*" ; c-type "ffi_cif" ; description "SCM_FFI_CIFP" ; c-predicate "SCM_FFI_CIF_DATA" ; unboxer "SCM_MAKE_FFI_CIF" ; boxer ) (define-type "ffi_closure*" ; c-type "ffi_closure" ; description "SCM_FFI_CLOSUREP" ; c-predicate "SCM_FFI_CLOSURE_DATA" ; unboxer "SCM_MAKE_FFI_CLOSURE" ; boxer ) (define-type "ScmUVector*" #f "SCM_UVECTORP" "SCM_UVECTOR") (define-cclass :built-in "ScmFFIType*" "Scm_FFITypeClass" () ((size :type ) (alignment :type ) (type :type ))) (define-cclass :built-in "ScmFFICif*" "Scm_FFICifClass" () ()) (define-cclass :built-in "ScmFFIClosure*" "Scm_FFIClosureClass" () ()) (define-cproc ffi-type-void () (code "SCM_RETURN(SCM_MAKE_FFI_TYPE(&ffi_type_void));")) (define-cproc ffi-type-float () (code "SCM_RETURN(SCM_MAKE_FFI_TYPE(&ffi_type_float));")) (define-cproc ffi-type-double () (code "SCM_RETURN(SCM_MAKE_FFI_TYPE(&ffi_type_double));")) (define-cproc ffi-type-longdouble () (code "SCM_RETURN(SCM_MAKE_FFI_TYPE(&ffi_type_longdouble));")) (define-cproc ffi-type-pointer () (code "SCM_RETURN(SCM_MAKE_FFI_TYPE(&ffi_type_pointer));")) (define-cproc ffi-type-uchar () (code "SCM_RETURN(Scm_GetUnsignedFFIType(sizeof(unsigned char)));")) (define-cproc ffi-type-schar () (code "SCM_RETURN(Scm_GetSignedFFIType(sizeof(signed char)));")) (define-cproc ffi-type-ushort () (code "SCM_RETURN(Scm_GetUnsignedFFIType(sizeof(unsigned short)));")) (define-cproc ffi-type-sshort () (code "SCM_RETURN(Scm_GetSignedFFIType(sizeof(signed short)));")) (define-cproc ffi-type-uint () (code "SCM_RETURN(Scm_GetUnsignedFFIType(sizeof(unsigned int)));")) (define-cproc ffi-type-sint () (code "SCM_RETURN(Scm_GetSignedFFIType(sizeof(signed int)));")) (define-cproc ffi-type-ulong () (code "SCM_RETURN(Scm_GetUnsignedFFIType(sizeof(unsigned long)));")) (define-cproc ffi-type-slong () (code "SCM_RETURN(Scm_GetSignedFFIType(sizeof(signed long)));")) (define-cproc ffi-type-ulonglong () (code "SCM_RETURN(Scm_GetUnsignedFFIType(sizeof(unsigned long long)));")) (define-cproc ffi-type-slonglong () (code "SCM_RETURN(Scm_GetSignedFFIType(sizeof(signed long long)));")) (define-cproc ffi-prep-cif (rtype:: arglist::) (call "Scm_FFIPrepCIF")) (define-cproc make-ffi-array-type (type:: size::) (call "Scm_MakeFFIArrayType")) (define-cproc make-ffi-struct-type (elementlist::) (call "Scm_MakeFFIStructType")) (define-cproc make-c-subr (fnptr ret_type arglist optional_p info) (call "Scm_MakeCSubr")) (define-cproc ffi-call (cif:: fnPtrObj rvaluePtrObj avalues::) (call "Scm_FFICall")) (define-cproc ffi-prep-closure (cif:: proc::) (call "Scm_FFIPrepClosure")) (define-cproc ffi-closure (closure::) (code "SCM_RETURN(MAKE_VOID_POINTER(closure));")) ;; ;; pointer ;; (define-cproc make-u8vector-nonatomic (size::) (code "unsigned char *p = SCM_NEW2(unsigned char*, size);" "SCM_RETURN(Scm_MakeU8VectorFromArrayShared(size, p));")) (define-cproc null-ptr? (ptr) (code "SCM_RETURN(SCM_MAKE_BOOL(BASIC_POINTERP(ptr) && POINTER_DATA(ptr) == NULL));")) (define-cproc %ptr (obj) (code "SCM_RETURN(MAKE_POINTER(PTR_CLASS(SCM_CLASS_OF(obj)), SCM_UVECTOR_ELEMENTS(BUFFER_OF(obj))));")) (define-cproc %ptr-uvector (ptrClass uvec::) (code "SCM_RETURN(MAKE_POINTER(ptrClass, SCM_UVECTOR_ELEMENTS(uvec)));")) (define-cproc %deref (ptrObj) (call "Scm_Deref")) (define-cproc %deref-uvector (ptrObj size) (call "Scm_Deref_uvector")) (define-cproc ptr->string (ptrObj) (code "SCM_RETURN(SCM_MAKE_STR_COPYING((const char*) POINTER_DATA(ptrObj)));")) (define-cproc %expand-u8vector (buf:: size::) (code "SCM_RETURN(Scm_MakeU8VectorFromArrayShared(size, SCM_U8VECTOR_ELEMENTS(buf)));")) (define-cproc make-null-ptr () (code "SCM_RETURN(MAKE_VOID_POINTER(NULL));")) " static void finalize_pointer(ScmObj obj, void *data) { static ScmObj finalizeof_proc = SCM_FALSE; ScmObj finalize_proc; if (SCM_FALSEP(finalizeof_proc)) { finalizeof_proc = SCM_SYMBOL_VALUE(MODULE_NAME, \"finalizer-of\"); } finalize_proc = Scm_ApplyRec(finalizeof_proc, SCM_LIST1(obj)); if (!SCM_FALSEP(finalize_proc)) { Scm_ApplyRec(finalize_proc, SCM_LIST1(obj)); } Scm_UnregisterFinalizer(obj); } " (define-cproc %register-finalizer! (ptrobj) "if (!POINTERP(ptrobj)) { Scm_Error(\" required, but got %S\", ptrobj); } Scm_RegisterFinalizer(ptrobj, finalize_pointer, NULL); SCM_RETURN(SCM_UNDEFINED);") (define-cproc %unregister-finalizer! (ptrobj) "if (!POINTERP(ptrobj)) { Scm_Error(\" required, but got %S\", ptrobj); } Scm_UnregisterFinalizer(ptrobj); SCM_RETURN(SCM_UNDEFINED);") (define-cproc foreign-pointer->c-ptr (ptrClass fptr::) (code "SCM_RETURN(MAKE_POINTER(ptrClass, fptr->ptr));")) ;; ;; dlopen, dlsym, dlclose ;; (define-cproc dlopen (path::) (call "FFI_dlopen")) (define-cproc dlsym (symbol::) (call "FFI_dlsym")) (define-cproc dlerror () (call "FFI_dlerror")) (define-cproc dlclose (handle) (call "FFI_dlclose")) ;; ;; others ;; (define-cproc big-endian? () (code "#ifdef WORDS_BIGENDIAN" "SCM_RETURN(SCM_TRUE);" "#else" "SCM_RETURN(SCM_FALSE);" "#endif")) (define-cproc objc-string (ptrClass str::) (code "#ifdef __OBJC__" "NSString *nsstr = [NSString stringWithCString:str encoding:OBJC_STRING_ENCODING];" "SCM_RETURN(MAKE_POINTER(ptrClass, nsstr));" "#else" "Scm_Error(\"Unsupported operation 'objc-string'\");" "#endif")) (define-cproc c-struct-symbol (tagname) (call "Scm_CStructSymbol")) (define-cproc c-union-symbol (tagname) (call "Scm_CUnionSymbol")) ;; Local variables: ;; mode: scheme ;; end: gauche-c-wrapper-0.6.1.orig/src/c-grammar.scm0000644000000000000000000005512211237307542015647 0ustar (lalr-parser (expect: 4) (output: c-grammar "c-wrapper/c-grammar.yy.scm") ; (out-table: "c-gram.out") (ID ;; For scheme SEMICOLON ; ;; COMMA=, LCBRA={ RCBRA=} LSBRA=[ RSBRA=] ;; LPAREN=( RPAREN=) OR=| DOT=. COMMA LCBRA RCBRA LSBRA RSBRA LPAREN RPAREN OR DOT COLON ~ ! + - * / ^ & % = ? < > IDENTIFIER CONSTANT STRING SIZEOF PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN TYPENAME TYPEDEF EXTERN STATIC AUTO REGISTER INLINE RESTRICT SIGNED UNSIGNED CONST VOLATILE STRUCT UNION ENUM ELLIPSIS RANGE CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN ASM UNKNOWN EXTENSION AT_INTERFACE AT_IMPLEMENTATION AT_END AT_SELECTOR AT_DEFS AT_ENCODE AT_PUBLIC AT_PRIVATE AT_PROTECTED AT_PROTOCOL AT_CLASS AT_ALIAS AT_THROW AT_TRY AT_CATCH AT_FINALLY AT_SYNCHRONIZED AT_PROPERTY AT_SYNTHESIZE AT_DYNAMIC AT_OPTIONAL AT_REQUIRED OBJC_STRING START_MACRO ) (program () (file) (START_MACRO statement_list) : (%MACRO-BODY $2) ) (file (external_definition) (file external_definition) ) (external_definition (maybe_extension function_definition) : (all-referenced-info-clear!) (maybe_extension asm_definition) : (all-referenced-info-clear!) (maybe_extension external_declaration) : (all-referenced-info-clear!) (objc_definition) : (all-referenced-info-clear!) ) (function_definition (declarator function_body) : (emit-define-inline '(int) $1 $2) (declaration_specifiers declarator function_body) : (emit-define-inline $1 $2 $3) ) (function_body (compound_statement) : (%FUNCTION-BODY $1) (declaration_list compound_statement) : #f ;; TODO: support K&R style ) (external_declaration (declaration_specifiers SEMICOLON) : (external-declaration $1 (list (null-declarator))) (declaration_specifiers init_declarator_list SEMICOLON) : (external-declaration $1 $2) ) (declaration (declaration_specifiers SEMICOLON) : (declaration $1 '()) (declaration_specifiers init_declarator_list SEMICOLON) : (declaration $1 $2) (extension declaration) : $2 ) (declaration_specifiers (storage_class_specifier) (storage_class_specifier declaration_specifiers) : (%APPEND $1 $2) (type_specifier) : $1 (type_specifier declaration_specifiers) : (%APPEND $1 $2) ) (init_declarator_list (init_declarator) : (%LIST (compose-variable-attribute $1)) (init_declarator_list COMMA init_declarator) : (%ADD-LIST $1 (compose-variable-attribute $3)) ) (init_declarator (declarator maybe_asm = initializer) : (%COMPOSE-DECLARATOR $1 (init-value-declarator $4)) (declarator maybe_asm) : $1 ) (storage_class_specifier (TYPEDEF) : '(TYPEDEF) (EXTERN) : '() (STATIC) : '() (AUTO) : '() (INLINE) : '() ) (type_specifier (TYPENAME) : (%TYPENAME $1) (SIGNED) : '(SIGNED) (UNSIGNED) : '(UNSIGNED) (CONST) : '() (REGISTER) : '() (VOLATILE) : '() (struct_or_union_specifier) : (%STRUCT-OR-UNION-SPECIFIER $1) (enum_specifier) : (%ENUM-SPECIFIER $1) (RESTRICT) : '() (TYPENAME objc_non_empty_protocol_references) : (%TYPENAME $1) (objc_non_empty_protocol_references) : '(id) ) (primary_expr (identifier) : (%IDENTIFIER $1) (CONSTANT) : $1 (STRING) : $1 (OBJC_STRING) : (%OBJC-STRING $1) (LPAREN expr RPAREN) : (%EXPR-IN-PARENS $2) (LPAREN compound_statement RPAREN) : (%COMPOUND-STATEMENT $2) (LPAREN type_name RPAREN LCBRA initializer_list RCBRA) : #f (objc_message_expr) : $1 (objc_selector_expr) : $1 (objc_protocol_expr) : #f (objc_encode_expr) : #f ) (postfix_expr (primary_expr) : $1 (postfix_expr LSBRA expr RSBRA) : (%REF-ARRAY $1 $3) (postfix_expr LPAREN RPAREN) : (%FUNCALL $1 '()) (postfix_expr LPAREN argument_expr_list RPAREN) : (%FUNCALL $1 $3) (postfix_expr DOT identifier) : (%DOT-REF $1 $3) (postfix_expr PTR_OP identifier) : (%PTR-REF $1 $3) (postfix_expr INC_OP) : (%POST-INC $1) (postfix_expr DEC_OP) : (%POST-DEC $1) ) (argument_expr_list (assignment_expr) : (%LIST $1) (argument_expr_list COMMA assignment_expr) : (%ADD-LIST $1 $3) ) (unary_expr (postfix_expr) : $1 (INC_OP unary_expr) : (%PRE-INC $2) (DEC_OP unary_expr) : (%PRE-DEC $2) (unary_operator cast_expr) : (%UNARY $1 $2) (SIZEOF unary_expr) : (%SIZEOF-EXPR $2) (SIZEOF LPAREN type_name RPAREN) : (%SIZEOF-TYPE $3) (extension cast_expr) : $2 ) (unary_operator (&) : '& (*) : '* (+) : '+ (-) : '- (~) : '~ (!) : '! ) (cast_expr (unary_expr) : $1 (LPAREN type_name RPAREN cast_expr) : (%CAST $2 $4) ) (multiplicative_expr (cast_expr) : $1 (multiplicative_expr * cast_expr) : (%MUL $1 $3) (multiplicative_expr / cast_expr) : (%DIV $1 $3) (multiplicative_expr % cast_expr) : (%MOD $1 $3) ) (additive_expr (multiplicative_expr) : $1 (additive_expr + multiplicative_expr) : (%ADD $1 $3) (additive_expr - multiplicative_expr) : (%SUB $1 $3) ) (shift_expr (additive_expr) : $1 (shift_expr LEFT_OP additive_expr) : (%SHIFT-LEFT $1 $3) (shift_expr RIGHT_OP additive_expr) : (%SHIFT-RIGHT $1 $3) ) (relational_expr (shift_expr) : $1 (relational_expr < shift_expr) : (%LT $1 $3) (relational_expr > shift_expr) : (%GT $1 $3) (relational_expr LE_OP shift_expr) : (%LE $1 $3) (relational_expr GE_OP shift_expr) : (%GE $1 $3) ) (equality_expr (relational_expr) : $1 (equality_expr EQ_OP relational_expr) : (%EQ $1 $3) (equality_expr NE_OP relational_expr) : (%NE $1 $3) ) (and_expr (equality_expr) : $1 (and_expr & equality_expr) : (%BIT-AND $1 $3) ) (exclusive_or_expr (and_expr) : $1 (exclusive_or_expr ^ and_expr) : (%BIT-XOR $1 $3) ) (inclusive_or_expr (exclusive_or_expr) : $1 (inclusive_or_expr OR exclusive_or_expr) : (%BIT-OR $1 $3) ) (logical_and_expr (inclusive_or_expr) : $1 (logical_and_expr AND_OP inclusive_or_expr) : (%LOG-AND $1 $3) ) (logical_or_expr (logical_and_expr) : $1 (logical_or_expr OR_OP logical_and_expr) : (%LOG-OR $1 $3) ) (conditional_expr (logical_or_expr) : $1 (logical_or_expr ? logical_or_expr COLON conditional_expr) : (%IF $1 $3 $5) ) (assignment_expr (conditional_expr) : $1 (unary_expr = assignment_expr) : (%ASSIGN $1 $3) (unary_expr MUL_ASSIGN assignment_expr) : (%ASSIGN $1 (%MUL $1 $3)) (unary_expr DIV_ASSIGN assignment_expr) : (%ASSIGN $1 (%DIV $1 $3)) (unary_expr MOD_ASSIGN assignment_expr) : (%ASSIGN $1 (%MOD $1 $3)) (unary_expr ADD_ASSIGN assignment_expr) : (%ASSIGN $1 (%ADD $1 $3)) (unary_expr SUB_ASSIGN assignment_expr) : (%ASSIGN $1 (%SUB $1 $3)) (unary_expr LEFT_ASSIGN assignment_expr) : (%ASSIGN $1 (%SHIFT-LEFT $1 $3)) (unary_expr RIGHT_ASSIGN assignment_expr) : (%ASSIGN $1 (%SHIFT-RIGHT $1 $3)) (unary_expr AND_ASSIGN assignment_expr) : (%ASSIGN $1 (%BIT-AND $1 $3)) (unary_expr XOR_ASSIGN assignment_expr) : (%ASSIGN $1 (%BIT-XOR $1 $3)) (unary_expr OR_ASSIGN assignment_expr) : (%ASSIGN $1 (%BIT-OR $1 $3)) ) (expr (assignment_expr) : $1 (expr COMMA assignment_expr) : (%CONCAT-EXPR $1 $3) ) (constant_expr (conditional_expr) : $1 ) (struct_or_union_specifier (struct_or_union identifier LCBRA struct_declaration_list RCBRA) : (decl-struct-or-union $1 $2 $4) (struct_or_union LCBRA struct_declaration_list RCBRA) : (decl-struct-or-union $1 #f $3) (struct_or_union identifier) : (decl-struct-or-union $1 $2 #f) ) (struct_or_union (STRUCT) : 'STRUCT (UNION) : 'UNION ) (struct_declaration_list (struct_declaration) : $1 (struct_declaration_list struct_declaration) : (%APPEND $1 $2) ) (struct_declaration (type_specifier_list struct_declarator_list SEMICOLON) : (begin (parser-attribute-clear!) (make-type-decl-list $1 $2)) (extension type_specifier_list struct_declarator_list SEMICOLON) : (begin (parser-attribute-clear!) (make-type-decl-list $2 $3)) (struct_or_union_specifier SEMICOLON) : (begin (parser-attribute-clear!) (make-type-decl-list (%LIST $1) (list (identifier-declarator (gensym "%unnamed"))))) (extension struct_or_union_specifier SEMICOLON) : (begin (parser-attribute-clear!) (make-type-decl-list (%LIST $2) (list (identifier-declarator (gensym "%unnamed"))))) (AT_DEFS LPAREN TYPENAME RPAREN) : '() ) (struct_declarator_list (struct_declarator) : (%LIST (compose-variable-attribute $1)) (struct_declarator_list COMMA struct_declarator) : (%ADD-LIST $1 (compose-variable-attribute $3)) ) (struct_declarator (declarator) : $1 (COLON constant_expr) : (bit-field-declarator $2) (declarator COLON constant_expr) : (%COMPOSE-DECLARATOR (bit-field-declarator $3) $1) ) (enum_specifier (ENUM LCBRA enumerator_list RCBRA) : (decl-enum #f $3) (ENUM LCBRA enumerator_list COMMA RCBRA) : (decl-enum #f $3) (ENUM identifier LCBRA enumerator_list RCBRA) : (decl-enum $2 $4) (ENUM identifier LCBRA enumerator_list COMMA RCBRA) : (decl-enum $2 $4) (ENUM identifier) : (decl-enum $2 '()) ) (enumerator_list (enumerator) : (%LIST $1) (enumerator_list COMMA enumerator) : (%ADD-LIST $1 $3) ) (enumerator (identifier) : (decl-enumerator $1 #f) (identifier = constant_expr) : (decl-enumerator $1 $3) ) (declarator (declarator2) : $1 (pointer declarator2) : (%COMPOSE-DECLARATOR $2 $1) ) (declarator2 (identifier) : (identifier-declarator $1) (LPAREN declarator RPAREN) : $2 (declarator2 LSBRA RSBRA) : (%COMPOSE-DECLARATOR (array-declarator #f) $1) (declarator2 LSBRA array_qualifier_list RSBRA) : (%COMPOSE-DECLARATOR (array-declarator #f) $1) (declarator2 LSBRA array_size_expr RSBRA) : (%COMPOSE-DECLARATOR (array-declarator $3) $1) (declarator2 LSBRA array_qualifier_list array_size_expr RSBRA) : (%COMPOSE-DECLARATOR (array-declarator $4) $1) (declarator2 LPAREN RPAREN) : (%COMPOSE-DECLARATOR $1 (func-declarator '())) (declarator2 LPAREN parameter_type_list RPAREN) : (%COMPOSE-DECLARATOR $1 $3) (declarator2 LPAREN parameter_identifier_list RPAREN) : $1 ;; not supported ) (pointer (*) : (ptr-declarator) (* type_specifier_list) : (ptr-declarator) (* pointer) : (%COMPOSE-DECLARATOR (ptr-declarator) $2) (* type_specifier_list pointer) : (%COMPOSE-DECLARATOR (ptr-declarator) $3) ) (type_specifier_list (type_specifier) : $1 (type_specifier_list type_specifier) : (%APPEND $1 $2) ) (parameter_identifier_list (identifier_list) (identifier_list COMMA ELLIPSIS) ) (identifier_list (identifier) : (%LIST $1) (identifier_list COMMA identifier) : (%ADD-LIST $1 $3) ) (parameter_type_list (parameter_list) : (func-declarator $1) (parameter_list COMMA ELLIPSIS) : (func-vaargs-declarator $1) ) (parameter_list (parameter_declaration) : (%LIST $1) (parameter_list COMMA parameter_declaration) : (%ADD-LIST $1 $3) ) (parameter_declaration (type_specifier_list declarator) : (parameter-declaration (make-type-decl $1 (compose-variable-attribute $2))) (type_name) : $1 ) (type_name (type_specifier_list) : (make-type-decl $1 (null-declarator)) (type_specifier_list abstract_declarator) : (make-type-decl $1 $2) ) (abstract_declarator (pointer) : $1 (abstract_declarator2) : $1 (pointer abstract_declarator2) : (%COMPOSE-DECLARATOR $2 $1) ) (abstract_declarator2 (LPAREN abstract_declarator RPAREN) : $2 (LSBRA RSBRA) : (ptr-declarator) (LSBRA array_qualifier_list RSBRA) : (ptr-declarator) (LSBRA array_size_expr RSBRA) : (array-declarator $2) (LSBRA array_qualifier_list array_size_expr RSBRA) : (array-declarator $3) (abstract_declarator2 LSBRA RSBRA) : (%COMPOSE-DECLARATOR (ptr-declarator) $1) (abstract_declarator2 LSBRA array_qualifier_list RSBRA) : (%COMPOSE-DECLARATOR (ptr-declarator) $1) (abstract_declarator2 LSBRA array_size_expr RSBRA) : (%COMPOSE-DECLARATOR (array-declarator $3) $1) (abstract_declarator2 LSBRA array_qualifier_list array_size_expr RSBRA) : (%COMPOSE-DECLARATOR (array-declarator $4) $1) (LPAREN RPAREN) : (func-declarator '()) (LPAREN parameter_type_list RPAREN) : $2 (abstract_declarator2 LPAREN RPAREN) : (%COMPOSE-DECLARATOR $1 (func-declarator '())) (abstract_declarator2 LPAREN parameter_type_list RPAREN) : (%COMPOSE-DECLARATOR $1 $3) ) (initializer (assignment_expr) : $1 (LCBRA initializer_list RCBRA) : #f (LCBRA initializer_list COMMA RCBRA) : #f ) (initializer_list (initializer) (initializer_list COMMA initializer) ) (statement (labeled_statement) : #f (compound_statement) : $1 (expression_statement) : $1 (selection_statement) : $1 (iteration_statement) : $1 (jump_statement) : $1 (asm_statement) : #f (objc_statement) : #f ) (objc_statement (AT_THROW expr SEMICOLON) (AT_THROW SEMICOLON) (objc_try_catch_statement) (AT_SYNCHRONIZED LPAREN expr RPAREN compound_statement) ) (objc_catch_prefix (AT_CATCH LPAREN identifier RPAREN) ) (objc_catch_clause (objc_catch_prefix compound_statement) ) (objc_opt_catch_list () (objc_opt_catch_list objc_catch_clause) ) (objc_try_catch_clause (AT_TRY compound_statement objc_opt_catch_list) ) (objc_finally_clause (AT_FINALLY compound_statement) ) (objc_try_catch_statement (objc_try_catch_clause) (objc_try_catch_clause objc_finally_clause) ) (labeled_statement (identifier COLON statement) (CASE constant_expr COLON statement) (DEFAULT COLON statement) ) (compound_statement (LCBRA RCBRA) : (%COMPOUND-STATEMENT '(0)) (LCBRA statement_list RCBRA) : (%COMPOUND-STATEMENT $2) (LCBRA declaration_list RCBRA) : (%COMPOUND-STATEMENT '(0)) (LCBRA declaration_list statement_list RCBRA) : (%COMPOUND-STATEMENT-WITH-DECLARATION $2 $3) (error RCBRA) : #f ) (declaration_list (declaration) : $1 (declaration_list declaration) : (%APPEND $1 $2) ) (statement_list (statement) : (%LIST $1) (statement_list statement) : (%ADD-LIST $1 $2) ) (expression_statement (SEMICOLON) : 0 (expr SEMICOLON) : $1 (error SEMICOLON) : #f ) (selection_statement (IF LPAREN expr RPAREN statement) : (%IF $3 $5 0) (IF LPAREN expr RPAREN statement ELSE statement) : (%IF $3 $5 $7) (SWITCH LPAREN expr RPAREN statement) : #f ) (iteration_statement (WHILE LPAREN expr RPAREN statement) : (%WHILE $3 $5) (DO statement WHILE LPAREN expr RPAREN SEMICOLON) : (%DO-WHILE $5 $2) (FOR LPAREN SEMICOLON SEMICOLON RPAREN statement) : (%FOR 0 1 0 $6) (FOR LPAREN SEMICOLON SEMICOLON expr RPAREN statement) : (%FOR 0 1 $5 $7) (FOR LPAREN SEMICOLON expr SEMICOLON RPAREN statement) : (%FOR 0 $4 0 $7) (FOR LPAREN SEMICOLON expr SEMICOLON expr RPAREN statement) : (%FOR 0 $4 $6 $8) (FOR LPAREN expr SEMICOLON SEMICOLON RPAREN statement) : (%FOR $3 1 0 $7) (FOR LPAREN expr SEMICOLON SEMICOLON expr RPAREN statement) : (%FOR $3 1 $6 $8) (FOR LPAREN expr SEMICOLON expr SEMICOLON RPAREN statement) : (%FOR $3 $5 0 $8) (FOR LPAREN expr SEMICOLON expr SEMICOLON expr RPAREN statement) : (%FOR $3 $5 $7 $9) ) (jump_statement (GOTO identifier SEMICOLON) : #f (CONTINUE SEMICOLON) : (%CONTINUE) (BREAK SEMICOLON) : (%BREAK) (RETURN SEMICOLON) : (%RETURN 0) (RETURN expr SEMICOLON) : (%RETURN $2) ) (identifier (IDENTIFIER) : $1 ) ;; ;; asm ;; (maybe_asm () (asm_expr) ) (asm_expr (ASM LPAREN string_list RPAREN) ) (asm_statement (ASM LPAREN asm_argument RPAREN SEMICOLON) (ASM type_qualifier LPAREN asm_argument RPAREN SEMICOLON) ) (type_qualifier (CONST) (VOLATILE) (RESTRICT) ) (array_qualifier (STATIC) (RESTRICT) (CONST) (VOLATILE) ) (array_qualifier_list (array_qualifier) (array_qualifier_list array_qualifier) ) (array_size_expr (assignment_expr) : $1 (*) : #f ) (asm_argument (string_list) (string_list COLON asm_operands) (string_list COLON asm_operands COLON asm_operands) (string_list COLON asm_operands COLON asm_operands COLON asm_clobbers) ) (string_list (STRING) (string_list STRING) ) (asm_operands () (asm_operands2) ) (asm_operands2 (asm_operand) (asm_operands2 COMMA asm_operand) ) (asm_operand (STRING LPAREN expr RPAREN) (LSBRA identifier RSBRA STRING LPAREN expr RPAREN) ) (asm_clobbers (STRING) (asm_clobbers COMMA STRING) ) (asm_definition (asm_expr SEMICOLON) ) ;; ;; extension ;; (maybe_extension () (extension) ) (extension (EXTENSION) ) ;; Objective-C (objc_definition (objc_class_definition) (objc_class_declaration) (objc_alias_declaration) (objc_protocol_definition) (objc_method_definition) ) (classname (identifier) : $1 (TYPENAME) : $1 ) (classname_list (classname) : (%LIST $1) (classname_list COMMA classname) : (%ADD-LIST $1 $3) ) (objc_class_declaration (AT_CLASS classname_list SEMICOLON) : (emit-define-objc-class $2) ) (objc_alias_declaration (AT_ALIAS identifier identifier SEMICOLON) : #f ) (objc_superclass (COLON classname) () ) (objc_class_ivars (LCBRA objc_ivar_declaration_list RCBRA) () ) (objc_class_definition (objc_interface_head objc_superclass objc_protocol_references objc_class_ivars objc_method_prototype_list AT_END) (AT_IMPLEMENTATION classname objc_superclass objc_class_ivars) (objc_interface_head LPAREN classname RPAREN objc_protocol_references objc_method_prototype_list AT_END) (AT_IMPLEMENTATION classname LPAREN identifier RPAREN) ) (objc_interface_head (AT_INTERFACE classname) : (emit-define-objc-class (%LIST $2)) ) (objc_protocol_definition (AT_PROTOCOL identifier objc_protocol_references objc_method_prototype_list AT_END) (AT_PROTOCOL identifier_list SEMICOLON) ) (objc_protocol_references () (objc_non_empty_protocol_references) ) (objc_non_empty_protocol_references (< classname_list >) ) (objc_ivar_declaration_list (objc_ivar_declaration_list objc_visibility_spec objc_ivar_declarations) (objc_ivar_declarations) ) (objc_visibility_spec (AT_PRIVATE) (AT_PROTECTED) (AT_PUBLIC) ) (objc_ivar_declarations () (objc_ivar_declarations objc_ivar_declaration SEMICOLON) (objc_ivar_declarations SEMICOLON) ) (objc_ivar_declaration (declaration_specifiers objc_ivars) ) (objc_ivars () (objc_ivar_declarator) (objc_ivars COMMA objc_ivar_declarator) ) (objc_ivar_declarator (declarator) (declarator COLON assignment_expr) (COLON assignment_expr) ) (objc_method_type (+) (-) ) (objc_method_definition (objc_method_type objc_method_declaration optarglist compound_statement) ) (objc_method_prototype_list () (objc_method_prototype_list objc_method_prototype) (objc_method_prototype_list external_declaration) (objc_method_prototype_list objc_property) (objc_method_prototype_list AT_OPTIONAL) (objc_method_prototype_list AT_REQUIRED) ) (objc_method_prototype (objc_method_type objc_method_declaration SEMICOLON) : (begin (parser-attribute-clear!) (apply emit-objc-method $2)) ) (objc_property (AT_PROPERTY LPAREN property_attribute_list RPAREN declaration) (AT_PROPERTY declaration) (AT_SYNTHESIZE init_declarator_list SEMICOLON) (AT_DYNAMIC init_declarator_list SEMICOLON) ) (property_attribute_list () (identifier) (property_attribute_list COMMA identifier) ) (objc_protocol_qualifier () (identifier) ) (objc_method_declaration (LPAREN objc_protocol_qualifier type_name RPAREN unary_selector) : (decl-objc-method $3 $5) (unary_selector) : (decl-objc-method (var-id) $1) (LPAREN objc_protocol_qualifier type_name RPAREN keyword_selector optparmlist) : (decl-objc-method $3 $5) (keyword_selector optparmlist) : (decl-objc-method (var-id) $1) ) (optarglist () (SEMICOLON myxdecls) ) (myxdecls () (mydecls) ) (error_statement (error SEMICOLON) : #f ) (mydecls (mydecl) (error_statement) (mydecls mydecl) (mydecl error_statement) ) (mydecl (declaration_specifiers parameter_list SEMICOLON) (declaration_specifiers SEMICOLON) ) (optparmlist () (COMMA ELLIPSIS) (COMMA parameter_list) ) (unary_selector (selector) : (decl-keyword $1) ) (keyword_selector (keyword_declarator) : (combine-decl-keyword $1) (keyword_selector keyword_declarator) : (combine-decl-keyword $1 $2) ) (selector (identifier) : $1 (TYPENAME) : $1 (reserved_words) : $1 ) (reserved_words (ENUM) (STRUCT) (UNION) (IF) (ELSE) (WHILE) (DO) (FOR) (SWITCH) (CASE) (DEFAULT) (BREAK) (CONTINUE) (RETURN) (GOTO) (ASM) (SIZEOF) ) ;; ignore variable attributes in Obj-C (keyword_declarator (selector COLON LPAREN objc_protocol_qualifier type_name RPAREN identifier) : (begin (parser-attribute-clear!) (decl-keyword $1 $5)) (selector COLON identifier) : (begin (parser-attribute-clear!) (decl-keyword $1 (var-id))) (COLON LPAREN objc_protocol_qualifier type_name RPAREN identifier) : (begin (parser-attribute-clear!) (decl-keyword "" $4)) (COLON identifier) : (begin (parser-attribute-clear!) (decl-keyword "" (var-id))) ) (message_args (selector) : (%QUOTE $1) (keyword_arg_list) : $1 ) (keyword_arg_list (keyword_arg) : $1 (keyword_arg_list keyword_arg) : (%APPEND $1 $2) ) (keyword_arg (selector COLON expr) : (%KEYWORD-ARG $1 $3) (COLON expr) : (%KEYWORD-ARG-WITHOUT-SELECTOR $2) ) (receiver (expr) : $1 (TYPENAME) : $1 ) (objc_message_expr (LSBRA receiver message_args RSBRA) : (%OBJC-MESSAGE-EXPR $2 $3) ) (selector_arg (selector) : (x->string $1) (keyword_name_list) : (string-join (map x->string $1) ":") ) (keyword_name_list (keyword_name) : (%LIST $1) (keyword_name_list keyword_name) : (%ADD-LIST $1 $2) ) (keyword_name (selector COLON) : $1 (COLON) : : ) (objc_selector_expr (AT_SELECTOR LPAREN selector_arg RPAREN) : (%SELECTOR $3) ) (objc_protocol_expr (AT_PROTOCOL LPAREN identifier RPAREN) ) (objc_encode_expr (AT_ENCODE LPAREN TYPENAME RPAREN) ) ;; ;; ;; ;; attribute ;; ;; ;; (maybe_attribute ;; () ;; (attributes) ;; ) ;; (attributes ;; (attribute) ;; (attributes attribute) ;; ) ;; (attribute ;; (ATTRIBUTE LPAREN LPAREN attribute_list RPAREN RPAREN) ;; ) ;; (attribute_list ;; (attribute2) ;; (attribute_list COMMA attribute2) ;; ) ;; (attribute2 ;; () ;; (attribute_word) ;; (attribute_word LPAREN IDENTIFIER RPAREN) ;; (attribute_word LPAREN IDENTIFIER COMMA expr RPAREN) ;; (attribute_word LPAREN RPAREN) ;; (attribute_word LPAREN expr RPAREN) ;; ) ;; (attribute_word ;; (identifier) ;; (storage_class_specifier) ;; (TYPENAME) ;; (type_qualifier) ;; ) ) gauche-c-wrapper-0.6.1.orig/src/c-grammar.y0000644000000000000000000035443411237307542015345 0ustar %{ #define YYSTYPE ScmObj static ScmObj token_table = SCM_UNBOUND; static ScmObj name_347 = SCM_UNBOUND; static ScmObj name_345 = SCM_UNBOUND; static ScmObj name_340 = SCM_UNBOUND; static ScmObj name_339 = SCM_UNBOUND; static ScmObj name_338 = SCM_UNBOUND; static ScmObj name_336 = SCM_UNBOUND; static ScmObj name_334 = SCM_UNBOUND; static ScmObj name_330 = SCM_UNBOUND; static ScmObj name_328 = SCM_UNBOUND; static ScmObj name_323 = SCM_UNBOUND; static ScmObj name_320 = SCM_UNBOUND; static ScmObj name_312 = SCM_UNBOUND; static ScmObj name_310 = SCM_UNBOUND; static ScmObj name_305 = SCM_UNBOUND; static ScmObj name_303 = SCM_UNBOUND; static ScmObj name_301 = SCM_UNBOUND; static ScmObj name_300 = SCM_UNBOUND; static ScmObj name_287 = SCM_UNBOUND; static ScmObj name_285 = SCM_UNBOUND; static ScmObj name_283 = SCM_UNBOUND; static ScmObj name_273 = SCM_UNBOUND; static ScmObj name_271 = SCM_UNBOUND; static ScmObj name_269 = SCM_UNBOUND; static ScmObj name_256 = SCM_UNBOUND; static ScmObj name_252 = SCM_UNBOUND; static ScmObj name_195 = SCM_UNBOUND; static ScmObj name_187 = SCM_UNBOUND; static ScmObj name_178 = SCM_UNBOUND; static ScmObj name_177 = SCM_UNBOUND; static ScmObj name_174 = SCM_UNBOUND; static ScmObj name_166 = SCM_UNBOUND; static ScmObj name_163 = SCM_UNBOUND; static ScmObj name_150 = SCM_UNBOUND; static ScmObj name_147 = SCM_UNBOUND; static ScmObj name_144 = SCM_UNBOUND; static ScmObj name_141 = SCM_UNBOUND; static ScmObj name_138 = SCM_UNBOUND; static ScmObj name_135 = SCM_UNBOUND; static ScmObj name_132 = SCM_UNBOUND; static ScmObj name_129 = SCM_UNBOUND; static ScmObj name_127 = SCM_UNBOUND; static ScmObj name_124 = SCM_UNBOUND; static ScmObj name_122 = SCM_UNBOUND; static ScmObj name_120 = SCM_UNBOUND; static ScmObj name_118 = SCM_UNBOUND; static ScmObj name_115 = SCM_UNBOUND; static ScmObj name_113 = SCM_UNBOUND; static ScmObj name_110 = SCM_UNBOUND; static ScmObj name_108 = SCM_UNBOUND; static ScmObj name_105 = SCM_UNBOUND; static ScmObj name_103 = SCM_UNBOUND; static ScmObj name_101 = SCM_UNBOUND; static ScmObj name_98 = SCM_UNBOUND; static ScmObj name_88 = SCM_UNBOUND; static ScmObj name_86 = SCM_UNBOUND; static ScmObj name_84 = SCM_UNBOUND; static ScmObj name_82 = SCM_UNBOUND; static ScmObj name_80 = SCM_UNBOUND; static ScmObj name_75 = SCM_UNBOUND; static ScmObj name_73 = SCM_UNBOUND; static ScmObj name_71 = SCM_UNBOUND; static ScmObj name_69 = SCM_UNBOUND; static ScmObj name_66 = SCM_UNBOUND; static ScmObj name_64 = SCM_UNBOUND; static ScmObj name_56 = SCM_UNBOUND; static ScmObj name_54 = SCM_UNBOUND; static ScmObj name_52 = SCM_UNBOUND; static ScmObj name_48 = SCM_UNBOUND; static ScmObj name_46 = SCM_UNBOUND; static ScmObj name_42 = SCM_UNBOUND; static ScmObj name_40 = SCM_UNBOUND; static ScmObj name_35 = SCM_UNBOUND; static ScmObj name_33 = SCM_UNBOUND; static ScmObj name_26 = SCM_UNBOUND; static ScmObj name_15 = SCM_UNBOUND; static ScmObj name_10 = SCM_UNBOUND; static ScmObj name_7 = SCM_UNBOUND; static ScmObj name_1 = SCM_UNBOUND; static ScmObj token_sym_START_MACRO = SCM_UNBOUND; static ScmObj token_sym_OBJC_STRING = SCM_UNBOUND; static ScmObj token_sym_AT_REQUIRED = SCM_UNBOUND; static ScmObj token_sym_AT_OPTIONAL = SCM_UNBOUND; static ScmObj token_sym_AT_DYNAMIC = SCM_UNBOUND; static ScmObj token_sym_AT_SYNTHESIZE = SCM_UNBOUND; static ScmObj token_sym_AT_PROPERTY = SCM_UNBOUND; static ScmObj token_sym_AT_SYNCHRONIZED = SCM_UNBOUND; static ScmObj token_sym_AT_FINALLY = SCM_UNBOUND; static ScmObj token_sym_AT_CATCH = SCM_UNBOUND; static ScmObj token_sym_AT_TRY = SCM_UNBOUND; static ScmObj token_sym_AT_THROW = SCM_UNBOUND; static ScmObj token_sym_AT_ALIAS = SCM_UNBOUND; static ScmObj token_sym_AT_CLASS = SCM_UNBOUND; static ScmObj token_sym_AT_PROTOCOL = SCM_UNBOUND; static ScmObj token_sym_AT_PROTECTED = SCM_UNBOUND; static ScmObj token_sym_AT_PRIVATE = SCM_UNBOUND; static ScmObj token_sym_AT_PUBLIC = SCM_UNBOUND; static ScmObj token_sym_AT_ENCODE = SCM_UNBOUND; static ScmObj token_sym_AT_DEFS = SCM_UNBOUND; static ScmObj token_sym_AT_SELECTOR = SCM_UNBOUND; static ScmObj token_sym_AT_END = SCM_UNBOUND; static ScmObj token_sym_AT_IMPLEMENTATION = SCM_UNBOUND; static ScmObj token_sym_AT_INTERFACE = SCM_UNBOUND; static ScmObj token_sym_EXTENSION = SCM_UNBOUND; static ScmObj token_sym_UNKNOWN = SCM_UNBOUND; static ScmObj token_sym_ASM = SCM_UNBOUND; static ScmObj token_sym_RETURN = SCM_UNBOUND; static ScmObj token_sym_BREAK = SCM_UNBOUND; static ScmObj token_sym_CONTINUE = SCM_UNBOUND; static ScmObj token_sym_GOTO = SCM_UNBOUND; static ScmObj token_sym_FOR = SCM_UNBOUND; static ScmObj token_sym_DO = SCM_UNBOUND; static ScmObj token_sym_WHILE = SCM_UNBOUND; static ScmObj token_sym_SWITCH = SCM_UNBOUND; static ScmObj token_sym_ELSE = SCM_UNBOUND; static ScmObj token_sym_IF = SCM_UNBOUND; static ScmObj token_sym_DEFAULT = SCM_UNBOUND; static ScmObj token_sym_CASE = SCM_UNBOUND; static ScmObj token_sym_RANGE = SCM_UNBOUND; static ScmObj token_sym_ELLIPSIS = SCM_UNBOUND; static ScmObj token_sym_ENUM = SCM_UNBOUND; static ScmObj token_sym_UNION = SCM_UNBOUND; static ScmObj token_sym_STRUCT = SCM_UNBOUND; static ScmObj token_sym_VOLATILE = SCM_UNBOUND; static ScmObj token_sym_CONST = SCM_UNBOUND; static ScmObj token_sym_UNSIGNED = SCM_UNBOUND; static ScmObj token_sym_SIGNED = SCM_UNBOUND; static ScmObj token_sym_RESTRICT = SCM_UNBOUND; static ScmObj token_sym_INLINE = SCM_UNBOUND; static ScmObj token_sym_REGISTER = SCM_UNBOUND; static ScmObj token_sym_AUTO = SCM_UNBOUND; static ScmObj token_sym_STATIC = SCM_UNBOUND; static ScmObj token_sym_EXTERN = SCM_UNBOUND; static ScmObj token_sym_TYPEDEF = SCM_UNBOUND; static ScmObj token_sym_TYPENAME = SCM_UNBOUND; static ScmObj token_sym_OR_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_XOR_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_AND_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_RIGHT_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_LEFT_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_SUB_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_ADD_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_MOD_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_DIV_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_MUL_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_OR_OP = SCM_UNBOUND; static ScmObj token_sym_AND_OP = SCM_UNBOUND; static ScmObj token_sym_NE_OP = SCM_UNBOUND; static ScmObj token_sym_EQ_OP = SCM_UNBOUND; static ScmObj token_sym_GE_OP = SCM_UNBOUND; static ScmObj token_sym_LE_OP = SCM_UNBOUND; static ScmObj token_sym_RIGHT_OP = SCM_UNBOUND; static ScmObj token_sym_LEFT_OP = SCM_UNBOUND; static ScmObj token_sym_DEC_OP = SCM_UNBOUND; static ScmObj token_sym_INC_OP = SCM_UNBOUND; static ScmObj token_sym_PTR_OP = SCM_UNBOUND; static ScmObj token_sym_SIZEOF = SCM_UNBOUND; static ScmObj token_sym_STRING = SCM_UNBOUND; static ScmObj token_sym_CONSTANT = SCM_UNBOUND; static ScmObj token_sym_IDENTIFIER = SCM_UNBOUND; static ScmObj token_sym__GT = SCM_UNBOUND; static ScmObj token_sym__LT = SCM_UNBOUND; static ScmObj token_sym_P = SCM_UNBOUND; static ScmObj token_sym__3d = SCM_UNBOUND; static ScmObj token_sym__25 = SCM_UNBOUND; static ScmObj token_sym__26 = SCM_UNBOUND; static ScmObj token_sym__5e = SCM_UNBOUND; static ScmObj token_sym__2f = SCM_UNBOUND; static ScmObj token_sym__2a = SCM_UNBOUND; static ScmObj token_sym__ = SCM_UNBOUND; static ScmObj token_sym__2b = SCM_UNBOUND; static ScmObj token_sym_X = SCM_UNBOUND; static ScmObj token_sym__7e = SCM_UNBOUND; static ScmObj token_sym_COLON = SCM_UNBOUND; static ScmObj token_sym_DOT = SCM_UNBOUND; static ScmObj token_sym_OR = SCM_UNBOUND; static ScmObj token_sym_RPAREN = SCM_UNBOUND; static ScmObj token_sym_LPAREN = SCM_UNBOUND; static ScmObj token_sym_RSBRA = SCM_UNBOUND; static ScmObj token_sym_LSBRA = SCM_UNBOUND; static ScmObj token_sym_RCBRA = SCM_UNBOUND; static ScmObj token_sym_LCBRA = SCM_UNBOUND; static ScmObj token_sym_COMMA = SCM_UNBOUND; static ScmObj token_sym_SEMICOLON = SCM_UNBOUND; #ifdef USE_PROFILER static long long _profile_name_39_count = 0; static long long _profile_name_39_time = 0; static long long _profile_yylex_count = 0; static long long _profile_yylex_time = 0; static long long _profile_name_250_count = 0; static long long _profile_name_250_time = 0; static long long _profile_name_251_count = 0; static long long _profile_name_251_time = 0; static long long _profile_name_130_count = 0; static long long _profile_name_130_time = 0; static long long _profile_name_131_count = 0; static long long _profile_name_131_time = 0; static long long _profile_name_253_count = 0; static long long _profile_name_253_time = 0; static long long _profile_name_254_count = 0; static long long _profile_name_254_time = 0; static long long _profile_name_133_count = 0; static long long _profile_name_133_time = 0; static long long _profile_name_255_count = 0; static long long _profile_name_255_time = 0; static long long _profile_name_134_count = 0; static long long _profile_name_134_time = 0; static long long _profile_name_257_count = 0; static long long _profile_name_257_time = 0; static long long _profile_name_136_count = 0; static long long _profile_name_136_time = 0; static long long _profile_name_258_count = 0; static long long _profile_name_258_time = 0; static long long _profile_name_137_count = 0; static long long _profile_name_137_time = 0; static long long _profile_name_259_count = 0; static long long _profile_name_259_time = 0; static long long _profile_name_139_count = 0; static long long _profile_name_139_time = 0; static long long _profile_name_41_count = 0; static long long _profile_name_41_time = 0; static long long _profile_name_43_count = 0; static long long _profile_name_43_time = 0; static long long _profile_name_44_count = 0; static long long _profile_name_44_time = 0; static long long _profile_name_45_count = 0; static long long _profile_name_45_time = 0; static long long _profile_name_47_count = 0; static long long _profile_name_47_time = 0; static long long _profile_name_49_count = 0; static long long _profile_name_49_time = 0; static long long _profile_name_260_count = 0; static long long _profile_name_260_time = 0; static long long _profile_name_261_count = 0; static long long _profile_name_261_time = 0; static long long _profile_name_140_count = 0; static long long _profile_name_140_time = 0; static long long _profile_name_262_count = 0; static long long _profile_name_262_time = 0; static long long _profile_name_263_count = 0; static long long _profile_name_263_time = 0; static long long _profile_name_142_count = 0; static long long _profile_name_142_time = 0; static long long _profile_name_264_count = 0; static long long _profile_name_264_time = 0; static long long _profile_name_143_count = 0; static long long _profile_name_143_time = 0; static long long _profile_name_265_count = 0; static long long _profile_name_265_time = 0; static long long _profile_name_266_count = 0; static long long _profile_name_266_time = 0; static long long _profile_name_145_count = 0; static long long _profile_name_145_time = 0; static long long _profile_name_267_count = 0; static long long _profile_name_267_time = 0; static long long _profile_name_146_count = 0; static long long _profile_name_146_time = 0; static long long _profile_name_268_count = 0; static long long _profile_name_268_time = 0; static long long _profile_name_302_count = 0; static long long _profile_name_302_time = 0; static long long _profile_name_148_count = 0; static long long _profile_name_148_time = 0; static long long _profile_name_149_count = 0; static long long _profile_name_149_time = 0; static long long _profile_name_304_count = 0; static long long _profile_name_304_time = 0; static long long _profile_name_306_count = 0; static long long _profile_name_306_time = 0; static long long _profile_name_307_count = 0; static long long _profile_name_307_time = 0; static long long _profile_name_308_count = 0; static long long _profile_name_308_time = 0; static long long _profile_name_309_count = 0; static long long _profile_name_309_time = 0; static long long _profile_name_50_count = 0; static long long _profile_name_50_time = 0; static long long _profile_name_51_count = 0; static long long _profile_name_51_time = 0; static long long _profile_name_53_count = 0; static long long _profile_name_53_time = 0; static long long _profile_name_55_count = 0; static long long _profile_name_55_time = 0; static long long _profile_name_57_count = 0; static long long _profile_name_57_time = 0; static long long _profile_name_58_count = 0; static long long _profile_name_58_time = 0; static long long _profile_name_59_count = 0; static long long _profile_name_59_time = 0; static long long _profile_name_2_count = 0; static long long _profile_name_2_time = 0; static long long _profile_name_3_count = 0; static long long _profile_name_3_time = 0; static long long _profile_name_4_count = 0; static long long _profile_name_4_time = 0; static long long _profile_name_5_count = 0; static long long _profile_name_5_time = 0; static long long _profile_name_6_count = 0; static long long _profile_name_6_time = 0; static long long _profile_name_270_count = 0; static long long _profile_name_270_time = 0; static long long _profile_name_8_count = 0; static long long _profile_name_8_time = 0; static long long _profile_name_272_count = 0; static long long _profile_name_272_time = 0; static long long _profile_name_9_count = 0; static long long _profile_name_9_time = 0; static long long _profile_name_151_count = 0; static long long _profile_name_151_time = 0; static long long _profile_name_152_count = 0; static long long _profile_name_152_time = 0; static long long _profile_name_274_count = 0; static long long _profile_name_274_time = 0; static long long _profile_name_153_count = 0; static long long _profile_name_153_time = 0; static long long _profile_name_275_count = 0; static long long _profile_name_275_time = 0; static long long _profile_name_154_count = 0; static long long _profile_name_154_time = 0; static long long _profile_name_276_count = 0; static long long _profile_name_276_time = 0; static long long _profile_name_155_count = 0; static long long _profile_name_155_time = 0; static long long _profile_name_277_count = 0; static long long _profile_name_277_time = 0; static long long _profile_name_156_count = 0; static long long _profile_name_156_time = 0; static long long _profile_name_311_count = 0; static long long _profile_name_311_time = 0; static long long _profile_name_278_count = 0; static long long _profile_name_278_time = 0; static long long _profile_name_157_count = 0; static long long _profile_name_157_time = 0; static long long _profile_name_279_count = 0; static long long _profile_name_279_time = 0; static long long _profile_name_158_count = 0; static long long _profile_name_158_time = 0; static long long _profile_name_313_count = 0; static long long _profile_name_313_time = 0; static long long _profile_name_159_count = 0; static long long _profile_name_159_time = 0; static long long _profile_name_314_count = 0; static long long _profile_name_314_time = 0; static long long _profile_name_315_count = 0; static long long _profile_name_315_time = 0; static long long _profile_name_316_count = 0; static long long _profile_name_316_time = 0; static long long _profile_name_317_count = 0; static long long _profile_name_317_time = 0; static long long _profile_name_318_count = 0; static long long _profile_name_318_time = 0; static long long _profile_name_319_count = 0; static long long _profile_name_319_time = 0; static long long _profile_name_60_count = 0; static long long _profile_name_60_time = 0; static long long _profile_name_61_count = 0; static long long _profile_name_61_time = 0; static long long _profile_name_62_count = 0; static long long _profile_name_62_time = 0; static long long _profile_name_63_count = 0; static long long _profile_name_63_time = 0; static long long _profile_name_65_count = 0; static long long _profile_name_65_time = 0; static long long _profile_name_67_count = 0; static long long _profile_name_67_time = 0; static long long _profile_name_68_count = 0; static long long _profile_name_68_time = 0; static long long _profile_name_280_count = 0; static long long _profile_name_280_time = 0; static long long _profile_name_281_count = 0; static long long _profile_name_281_time = 0; static long long _profile_name_160_count = 0; static long long _profile_name_160_time = 0; static long long _profile_name_282_count = 0; static long long _profile_name_282_time = 0; static long long _profile_name_161_count = 0; static long long _profile_name_161_time = 0; static long long _profile_name_162_count = 0; static long long _profile_name_162_time = 0; static long long _profile_name_284_count = 0; static long long _profile_name_284_time = 0; static long long _profile_name_164_count = 0; static long long _profile_name_164_time = 0; static long long _profile_name_286_count = 0; static long long _profile_name_286_time = 0; static long long _profile_name_165_count = 0; static long long _profile_name_165_time = 0; static long long _profile_name_321_count = 0; static long long _profile_name_321_time = 0; static long long _profile_name_288_count = 0; static long long _profile_name_288_time = 0; static long long _profile_name_167_count = 0; static long long _profile_name_167_time = 0; static long long _profile_name_200_count = 0; static long long _profile_name_200_time = 0; static long long _profile_name_322_count = 0; static long long _profile_name_322_time = 0; static long long _profile_name_289_count = 0; static long long _profile_name_289_time = 0; static long long _profile_name_168_count = 0; static long long _profile_name_168_time = 0; static long long _profile_name_201_count = 0; static long long _profile_name_201_time = 0; static long long _profile_name_169_count = 0; static long long _profile_name_169_time = 0; static long long _profile_name_202_count = 0; static long long _profile_name_202_time = 0; static long long _profile_name_324_count = 0; static long long _profile_name_324_time = 0; static long long _profile_name_203_count = 0; static long long _profile_name_203_time = 0; static long long _profile_name_325_count = 0; static long long _profile_name_325_time = 0; static long long _profile_name_204_count = 0; static long long _profile_name_204_time = 0; static long long _profile_name_326_count = 0; static long long _profile_name_326_time = 0; static long long _profile_name_205_count = 0; static long long _profile_name_205_time = 0; static long long _profile_name_327_count = 0; static long long _profile_name_327_time = 0; static long long _profile_name_206_count = 0; static long long _profile_name_206_time = 0; static long long _profile_name_207_count = 0; static long long _profile_name_207_time = 0; static long long _profile_name_329_count = 0; static long long _profile_name_329_time = 0; static long long _profile_name_70_count = 0; static long long _profile_name_70_time = 0; static long long _profile_name_208_count = 0; static long long _profile_name_208_time = 0; static long long _profile_name_209_count = 0; static long long _profile_name_209_time = 0; static long long _profile_name_72_count = 0; static long long _profile_name_72_time = 0; static long long _profile_name_74_count = 0; static long long _profile_name_74_time = 0; static long long _profile_name_76_count = 0; static long long _profile_name_76_time = 0; static long long _profile_name_77_count = 0; static long long _profile_name_77_time = 0; static long long _profile_name_78_count = 0; static long long _profile_name_78_time = 0; static long long _profile_name_79_count = 0; static long long _profile_name_79_time = 0; static long long _profile_name_290_count = 0; static long long _profile_name_290_time = 0; static long long _profile_name_291_count = 0; static long long _profile_name_291_time = 0; static long long _profile_name_170_count = 0; static long long _profile_name_170_time = 0; static long long _profile_name_292_count = 0; static long long _profile_name_292_time = 0; static long long _profile_name_171_count = 0; static long long _profile_name_171_time = 0; static long long _profile_name_293_count = 0; static long long _profile_name_293_time = 0; static long long _profile_name_172_count = 0; static long long _profile_name_172_time = 0; static long long _profile_name_294_count = 0; static long long _profile_name_294_time = 0; static long long _profile_name_173_count = 0; static long long _profile_name_173_time = 0; static long long _profile_name_295_count = 0; static long long _profile_name_295_time = 0; static long long _profile_c_scan_count = 0; static long long _profile_c_scan_time = 0; static long long _profile_name_296_count = 0; static long long _profile_name_296_time = 0; static long long _profile_name_175_count = 0; static long long _profile_name_175_time = 0; static long long _profile_name_297_count = 0; static long long _profile_name_297_time = 0; static long long _profile_name_176_count = 0; static long long _profile_name_176_time = 0; static long long _profile_name_331_count = 0; static long long _profile_name_331_time = 0; static long long _profile_name_298_count = 0; static long long _profile_name_298_time = 0; static long long _profile_name_210_count = 0; static long long _profile_name_210_time = 0; static long long _profile_name_332_count = 0; static long long _profile_name_332_time = 0; static long long _profile_name_299_count = 0; static long long _profile_name_299_time = 0; static long long _profile_name_211_count = 0; static long long _profile_name_211_time = 0; static long long _profile_name_333_count = 0; static long long _profile_name_333_time = 0; static long long _profile_name_179_count = 0; static long long _profile_name_179_time = 0; static long long _profile_name_212_count = 0; static long long _profile_name_212_time = 0; static long long _profile_name_213_count = 0; static long long _profile_name_213_time = 0; static long long _profile_name_335_count = 0; static long long _profile_name_335_time = 0; static long long _profile_name_214_count = 0; static long long _profile_name_214_time = 0; static long long _profile_name_215_count = 0; static long long _profile_name_215_time = 0; static long long _profile_name_337_count = 0; static long long _profile_name_337_time = 0; static long long _profile_name_216_count = 0; static long long _profile_name_216_time = 0; static long long _profile_name_217_count = 0; static long long _profile_name_217_time = 0; static long long _profile_name_218_count = 0; static long long _profile_name_218_time = 0; static long long _profile_name_81_count = 0; static long long _profile_name_81_time = 0; static long long _profile_name_219_count = 0; static long long _profile_name_219_time = 0; static long long _profile_name_83_count = 0; static long long _profile_name_83_time = 0; static long long _profile_name_85_count = 0; static long long _profile_name_85_time = 0; static long long _profile_name_87_count = 0; static long long _profile_name_87_time = 0; static long long _profile_name_89_count = 0; static long long _profile_name_89_time = 0; static long long _profile_name_180_count = 0; static long long _profile_name_180_time = 0; static long long _profile_name_181_count = 0; static long long _profile_name_181_time = 0; static long long _profile_name_182_count = 0; static long long _profile_name_182_time = 0; static long long _profile_name_183_count = 0; static long long _profile_name_183_time = 0; static long long _profile_name_184_count = 0; static long long _profile_name_184_time = 0; static long long _profile_name_185_count = 0; static long long _profile_name_185_time = 0; static long long _profile_name_186_count = 0; static long long _profile_name_186_time = 0; static long long _profile_name_341_count = 0; static long long _profile_name_341_time = 0; static long long _profile_name_220_count = 0; static long long _profile_name_220_time = 0; static long long _profile_name_342_count = 0; static long long _profile_name_342_time = 0; static long long _profile_name_100_count = 0; static long long _profile_name_100_time = 0; static long long _profile_name_188_count = 0; static long long _profile_name_188_time = 0; static long long _profile_name_221_count = 0; static long long _profile_name_221_time = 0; static long long _profile_name_343_count = 0; static long long _profile_name_343_time = 0; static long long _profile_name_189_count = 0; static long long _profile_name_189_time = 0; static long long _profile_name_222_count = 0; static long long _profile_name_222_time = 0; static long long _profile_name_344_count = 0; static long long _profile_name_344_time = 0; static long long _profile_name_102_count = 0; static long long _profile_name_102_time = 0; static long long _profile_name_223_count = 0; static long long _profile_name_223_time = 0; static long long _profile_name_224_count = 0; static long long _profile_name_224_time = 0; static long long _profile_name_346_count = 0; static long long _profile_name_346_time = 0; static long long _profile_name_104_count = 0; static long long _profile_name_104_time = 0; static long long _profile_name_225_count = 0; static long long _profile_name_225_time = 0; static long long _profile_name_226_count = 0; static long long _profile_name_226_time = 0; static long long _profile_name_348_count = 0; static long long _profile_name_348_time = 0; static long long _profile_name_106_count = 0; static long long _profile_name_106_time = 0; static long long _profile_name_227_count = 0; static long long _profile_name_227_time = 0; static long long _profile_name_90_count = 0; static long long _profile_name_90_time = 0; static long long _profile_name_107_count = 0; static long long _profile_name_107_time = 0; static long long _profile_name_228_count = 0; static long long _profile_name_228_time = 0; static long long _profile_name_91_count = 0; static long long _profile_name_91_time = 0; static long long _profile_name_229_count = 0; static long long _profile_name_229_time = 0; static long long _profile_name_92_count = 0; static long long _profile_name_92_time = 0; static long long _profile_name_109_count = 0; static long long _profile_name_109_time = 0; static long long _profile_name_93_count = 0; static long long _profile_name_93_time = 0; static long long _profile_name_94_count = 0; static long long _profile_name_94_time = 0; static long long _profile_name_95_count = 0; static long long _profile_name_95_time = 0; static long long _profile_name_96_count = 0; static long long _profile_name_96_time = 0; static long long _profile_name_97_count = 0; static long long _profile_name_97_time = 0; static long long _profile_name_11_count = 0; static long long _profile_name_11_time = 0; static long long _profile_name_99_count = 0; static long long _profile_name_99_time = 0; static long long _profile_name_12_count = 0; static long long _profile_name_12_time = 0; static long long _profile_name_13_count = 0; static long long _profile_name_13_time = 0; static long long _profile_name_14_count = 0; static long long _profile_name_14_time = 0; static long long _profile_name_16_count = 0; static long long _profile_name_16_time = 0; static long long _profile_name_17_count = 0; static long long _profile_name_17_time = 0; static long long _profile_name_18_count = 0; static long long _profile_name_18_time = 0; static long long _profile_name_190_count = 0; static long long _profile_name_190_time = 0; static long long _profile_name_19_count = 0; static long long _profile_name_19_time = 0; static long long _profile_name_191_count = 0; static long long _profile_name_191_time = 0; static long long _profile_name_192_count = 0; static long long _profile_name_192_time = 0; static long long _profile_name_193_count = 0; static long long _profile_name_193_time = 0; static long long _profile_name_194_count = 0; static long long _profile_name_194_time = 0; static long long _profile_name_196_count = 0; static long long _profile_name_196_time = 0; static long long _profile_name_197_count = 0; static long long _profile_name_197_time = 0; static long long _profile_name_230_count = 0; static long long _profile_name_230_time = 0; static long long _profile_name_198_count = 0; static long long _profile_name_198_time = 0; static long long _profile_name_231_count = 0; static long long _profile_name_231_time = 0; static long long _profile_name_111_count = 0; static long long _profile_name_111_time = 0; static long long _profile_name_199_count = 0; static long long _profile_name_199_time = 0; static long long _profile_name_232_count = 0; static long long _profile_name_232_time = 0; static long long _profile_name_112_count = 0; static long long _profile_name_112_time = 0; static long long _profile_name_233_count = 0; static long long _profile_name_233_time = 0; static long long _profile_name_234_count = 0; static long long _profile_name_234_time = 0; static long long _profile_name_114_count = 0; static long long _profile_name_114_time = 0; static long long _profile_name_235_count = 0; static long long _profile_name_235_time = 0; static long long _profile_name_236_count = 0; static long long _profile_name_236_time = 0; static long long _profile_name_116_count = 0; static long long _profile_name_116_time = 0; static long long _profile_name_237_count = 0; static long long _profile_name_237_time = 0; static long long _profile_name_117_count = 0; static long long _profile_name_117_time = 0; static long long _profile_name_238_count = 0; static long long _profile_name_238_time = 0; static long long _profile_name_239_count = 0; static long long _profile_name_239_time = 0; static long long _profile_name_119_count = 0; static long long _profile_name_119_time = 0; static long long _profile_name_20_count = 0; static long long _profile_name_20_time = 0; static long long _profile_name_21_count = 0; static long long _profile_name_21_time = 0; static long long _profile_name_22_count = 0; static long long _profile_name_22_time = 0; static long long _profile_name_23_count = 0; static long long _profile_name_23_time = 0; static long long _profile_name_24_count = 0; static long long _profile_name_24_time = 0; static long long _profile_name_25_count = 0; static long long _profile_name_25_time = 0; static long long _profile_name_27_count = 0; static long long _profile_name_27_time = 0; static long long _profile_name_28_count = 0; static long long _profile_name_28_time = 0; static long long _profile_name_29_count = 0; static long long _profile_name_29_time = 0; static long long _profile_name_240_count = 0; static long long _profile_name_240_time = 0; static long long _profile_name_241_count = 0; static long long _profile_name_241_time = 0; static long long _profile_name_121_count = 0; static long long _profile_name_121_time = 0; static long long _profile_name_242_count = 0; static long long _profile_name_242_time = 0; static long long _profile_name_243_count = 0; static long long _profile_name_243_time = 0; static long long _profile_name_123_count = 0; static long long _profile_name_123_time = 0; static long long _profile_name_244_count = 0; static long long _profile_name_244_time = 0; static long long _profile_name_245_count = 0; static long long _profile_name_245_time = 0; static long long _profile_name_246_count = 0; static long long _profile_name_246_time = 0; static long long _profile_name_125_count = 0; static long long _profile_name_125_time = 0; static long long _profile_name_247_count = 0; static long long _profile_name_247_time = 0; static long long _profile_name_126_count = 0; static long long _profile_name_126_time = 0; static long long _profile_name_248_count = 0; static long long _profile_name_248_time = 0; static long long _profile_name_249_count = 0; static long long _profile_name_249_time = 0; static long long _profile_name_128_count = 0; static long long _profile_name_128_time = 0; static long long _profile_name_30_count = 0; static long long _profile_name_30_time = 0; static long long _profile_name_31_count = 0; static long long _profile_name_31_time = 0; static long long _profile_name_32_count = 0; static long long _profile_name_32_time = 0; static long long _profile_name_34_count = 0; static long long _profile_name_34_time = 0; static long long _profile_name_36_count = 0; static long long _profile_name_36_time = 0; static long long _profile_name_37_count = 0; static long long _profile_name_37_time = 0; static long long _profile_name_38_count = 0; static long long _profile_name_38_time = 0; #endif %} %token SEMICOLON %token COMMA %token LCBRA %token RCBRA %token LSBRA %token RSBRA %token LPAREN %token RPAREN %token OR %token DOT %token COLON %token _7e %token X %token _2b %token _ %token _2a %token _2f %token _5e %token _26 %token _25 %token _3d %token P %token _LT %token _GT %token IDENTIFIER %token CONSTANT %token STRING %token SIZEOF %token PTR_OP %token INC_OP %token DEC_OP %token LEFT_OP %token RIGHT_OP %token LE_OP %token GE_OP %token EQ_OP %token NE_OP %token AND_OP %token OR_OP %token MUL_ASSIGN %token DIV_ASSIGN %token MOD_ASSIGN %token ADD_ASSIGN %token SUB_ASSIGN %token LEFT_ASSIGN %token RIGHT_ASSIGN %token AND_ASSIGN %token XOR_ASSIGN %token OR_ASSIGN %token TYPENAME %token TYPEDEF %token EXTERN %token STATIC %token AUTO %token REGISTER %token INLINE %token RESTRICT %token SIGNED %token UNSIGNED %token CONST %token VOLATILE %token STRUCT %token UNION %token ENUM %token ELLIPSIS %token RANGE %token CASE %token DEFAULT %token IF %token ELSE %token SWITCH %token WHILE %token DO %token FOR %token GOTO %token CONTINUE %token BREAK %token RETURN %token ASM %token UNKNOWN %token EXTENSION %token AT_INTERFACE %token AT_IMPLEMENTATION %token AT_END %token AT_SELECTOR %token AT_DEFS %token AT_ENCODE %token AT_PUBLIC %token AT_PRIVATE %token AT_PROTECTED %token AT_PROTOCOL %token AT_CLASS %token AT_ALIAS %token AT_THROW %token AT_TRY %token AT_CATCH %token AT_FINALLY %token AT_SYNCHRONIZED %token AT_PROPERTY %token AT_SYNTHESIZE %token AT_DYNAMIC %token AT_OPTIONAL %token AT_REQUIRED %token OBJC_STRING %token START_MACRO %% program : | file | START_MACRO statement_list { START_PROFILE(name_2) $$ = Scm_ApplyRec1(name_1, $2); END_PROFILE(name_2) } ; file : external_definition | file external_definition ; external_definition : maybe_extension function_definition { START_PROFILE(name_3) $$ = Scm_AllReferencedInfoClear(); END_PROFILE(name_3) } | maybe_extension asm_definition { START_PROFILE(name_4) $$ = Scm_AllReferencedInfoClear(); END_PROFILE(name_4) } | maybe_extension external_declaration { START_PROFILE(name_5) $$ = Scm_AllReferencedInfoClear(); END_PROFILE(name_5) } | objc_definition { START_PROFILE(name_6) $$ = Scm_AllReferencedInfoClear(); END_PROFILE(name_6) } ; function_definition : declarator function_body { START_PROFILE(name_8) $$ = Scm_EmitDefineInline(name_7,$1,$2); END_PROFILE(name_8) } | declaration_specifiers declarator function_body { START_PROFILE(name_9) $$ = Scm_EmitDefineInline($1,$2,$3); END_PROFILE(name_9) } ; function_body : compound_statement { START_PROFILE(name_11) $$ = Scm_ApplyRec1(name_10, $1); END_PROFILE(name_11) } | declaration_list compound_statement { START_PROFILE(name_12) $$ = SCM_FALSE; END_PROFILE(name_12) } ; external_declaration : declaration_specifiers SEMICOLON { START_PROFILE(name_13) $$ = Scm_ExternalDeclaration($1,SCM_LIST1(Scm_NullDeclarator())); END_PROFILE(name_13) } | declaration_specifiers init_declarator_list SEMICOLON { START_PROFILE(name_14) $$ = Scm_ExternalDeclaration($1,$2); END_PROFILE(name_14) } ; declaration : declaration_specifiers SEMICOLON { START_PROFILE(name_16) $$ = Scm_Declaration($1,name_15); END_PROFILE(name_16) } | declaration_specifiers init_declarator_list SEMICOLON { START_PROFILE(name_17) $$ = Scm_Declaration($1,$2); END_PROFILE(name_17) } | extension declaration { START_PROFILE(name_18) $$ = $2; END_PROFILE(name_18) } ; declaration_specifiers : storage_class_specifier | storage_class_specifier declaration_specifiers { START_PROFILE(name_19) $$ = CParser_Append($1,$2); END_PROFILE(name_19) } | type_specifier { START_PROFILE(name_20) $$ = $1; END_PROFILE(name_20) } | type_specifier declaration_specifiers { START_PROFILE(name_21) $$ = CParser_Append($1,$2); END_PROFILE(name_21) } ; init_declarator_list : init_declarator { START_PROFILE(name_22) $$ = CParser_List(Scm_ComposeVariableAttribute($1)); END_PROFILE(name_22) } | init_declarator_list COMMA init_declarator { START_PROFILE(name_23) $$ = CParser_AddList($1,Scm_ComposeVariableAttribute($3)); END_PROFILE(name_23) } ; init_declarator : declarator maybe_asm _3d initializer { START_PROFILE(name_24) $$ = Scm_ComposeDeclarator($1,Scm_InitValueDeclarator($4)); END_PROFILE(name_24) } | declarator maybe_asm { START_PROFILE(name_25) $$ = $1; END_PROFILE(name_25) } ; storage_class_specifier : TYPEDEF { START_PROFILE(name_27) $$ = name_26; END_PROFILE(name_27) } | EXTERN { START_PROFILE(name_28) $$ = name_15; END_PROFILE(name_28) } | STATIC { START_PROFILE(name_29) $$ = name_15; END_PROFILE(name_29) } | AUTO { START_PROFILE(name_30) $$ = name_15; END_PROFILE(name_30) } | INLINE { START_PROFILE(name_31) $$ = name_15; END_PROFILE(name_31) } ; type_specifier : TYPENAME { START_PROFILE(name_32) $$ = CParser_Typename($1); END_PROFILE(name_32) } | SIGNED { START_PROFILE(name_34) $$ = name_33; END_PROFILE(name_34) } | UNSIGNED { START_PROFILE(name_36) $$ = name_35; END_PROFILE(name_36) } | CONST { START_PROFILE(name_37) $$ = name_15; END_PROFILE(name_37) } | REGISTER { START_PROFILE(name_38) $$ = name_15; END_PROFILE(name_38) } | VOLATILE { START_PROFILE(name_39) $$ = name_15; END_PROFILE(name_39) } | struct_or_union_specifier { START_PROFILE(name_41) $$ = Scm_ApplyRec1(name_40, $1); END_PROFILE(name_41) } | enum_specifier { START_PROFILE(name_43) $$ = Scm_ApplyRec1(name_42, $1); END_PROFILE(name_43) } | RESTRICT { START_PROFILE(name_44) $$ = name_15; END_PROFILE(name_44) } | TYPENAME objc_non_empty_protocol_references { START_PROFILE(name_45) $$ = CParser_Typename($1); END_PROFILE(name_45) } | objc_non_empty_protocol_references { START_PROFILE(name_47) $$ = name_46; END_PROFILE(name_47) } ; primary_expr : identifier { START_PROFILE(name_49) $$ = Scm_ApplyRec1(name_48, $1); END_PROFILE(name_49) } | CONSTANT { START_PROFILE(name_50) $$ = $1; END_PROFILE(name_50) } | STRING { START_PROFILE(name_51) $$ = $1; END_PROFILE(name_51) } | OBJC_STRING { START_PROFILE(name_53) $$ = Scm_ApplyRec1(name_52, $1); END_PROFILE(name_53) } | LPAREN expr RPAREN { START_PROFILE(name_55) $$ = Scm_ApplyRec1(name_54, $2); END_PROFILE(name_55) } | LPAREN compound_statement RPAREN { START_PROFILE(name_57) $$ = Scm_ApplyRec1(name_56, $2); END_PROFILE(name_57) } | LPAREN type_name RPAREN LCBRA initializer_list RCBRA { START_PROFILE(name_58) $$ = SCM_FALSE; END_PROFILE(name_58) } | objc_message_expr { START_PROFILE(name_59) $$ = $1; END_PROFILE(name_59) } | objc_selector_expr { START_PROFILE(name_60) $$ = $1; END_PROFILE(name_60) } | objc_protocol_expr { START_PROFILE(name_61) $$ = SCM_FALSE; END_PROFILE(name_61) } | objc_encode_expr { START_PROFILE(name_62) $$ = SCM_FALSE; END_PROFILE(name_62) } ; postfix_expr : primary_expr { START_PROFILE(name_63) $$ = $1; END_PROFILE(name_63) } | postfix_expr LSBRA expr RSBRA { START_PROFILE(name_65) $$ = Scm_ApplyRec2(name_64, $1, $3); END_PROFILE(name_65) } | postfix_expr LPAREN RPAREN { START_PROFILE(name_67) $$ = Scm_ApplyRec2(name_66, $1, name_15); END_PROFILE(name_67) } | postfix_expr LPAREN argument_expr_list RPAREN { START_PROFILE(name_68) $$ = Scm_ApplyRec2(name_66, $1, $3); END_PROFILE(name_68) } | postfix_expr DOT identifier { START_PROFILE(name_70) $$ = Scm_ApplyRec2(name_69, $1, $3); END_PROFILE(name_70) } | postfix_expr PTR_OP identifier { START_PROFILE(name_72) $$ = Scm_ApplyRec2(name_71, $1, $3); END_PROFILE(name_72) } | postfix_expr INC_OP { START_PROFILE(name_74) $$ = Scm_ApplyRec1(name_73, $1); END_PROFILE(name_74) } | postfix_expr DEC_OP { START_PROFILE(name_76) $$ = Scm_ApplyRec1(name_75, $1); END_PROFILE(name_76) } ; argument_expr_list : assignment_expr { START_PROFILE(name_77) $$ = CParser_List($1); END_PROFILE(name_77) } | argument_expr_list COMMA assignment_expr { START_PROFILE(name_78) $$ = CParser_AddList($1,$3); END_PROFILE(name_78) } ; unary_expr : postfix_expr { START_PROFILE(name_79) $$ = $1; END_PROFILE(name_79) } | INC_OP unary_expr { START_PROFILE(name_81) $$ = Scm_ApplyRec1(name_80, $2); END_PROFILE(name_81) } | DEC_OP unary_expr { START_PROFILE(name_83) $$ = Scm_ApplyRec1(name_82, $2); END_PROFILE(name_83) } | unary_operator cast_expr { START_PROFILE(name_85) $$ = Scm_ApplyRec2(name_84, $1, $2); END_PROFILE(name_85) } | SIZEOF unary_expr { START_PROFILE(name_87) $$ = Scm_ApplyRec1(name_86, $2); END_PROFILE(name_87) } | SIZEOF LPAREN type_name RPAREN { START_PROFILE(name_89) $$ = Scm_ApplyRec1(name_88, $3); END_PROFILE(name_89) } | extension cast_expr { START_PROFILE(name_90) $$ = $2; END_PROFILE(name_90) } ; unary_operator : _26 { START_PROFILE(name_91) $$ = token_sym__26; END_PROFILE(name_91) } | _2a { START_PROFILE(name_92) $$ = token_sym__2a; END_PROFILE(name_92) } | _2b { START_PROFILE(name_93) $$ = token_sym__2b; END_PROFILE(name_93) } | _ { START_PROFILE(name_94) $$ = token_sym__; END_PROFILE(name_94) } | _7e { START_PROFILE(name_95) $$ = token_sym__7e; END_PROFILE(name_95) } | X { START_PROFILE(name_96) $$ = token_sym_X; END_PROFILE(name_96) } ; cast_expr : unary_expr { START_PROFILE(name_97) $$ = $1; END_PROFILE(name_97) } | LPAREN type_name RPAREN cast_expr { START_PROFILE(name_99) $$ = Scm_ApplyRec2(name_98, $2, $4); END_PROFILE(name_99) } ; multiplicative_expr : cast_expr { START_PROFILE(name_100) $$ = $1; END_PROFILE(name_100) } | multiplicative_expr _2a cast_expr { START_PROFILE(name_102) $$ = Scm_ApplyRec2(name_101, $1, $3); END_PROFILE(name_102) } | multiplicative_expr _2f cast_expr { START_PROFILE(name_104) $$ = Scm_ApplyRec2(name_103, $1, $3); END_PROFILE(name_104) } | multiplicative_expr _25 cast_expr { START_PROFILE(name_106) $$ = Scm_ApplyRec2(name_105, $1, $3); END_PROFILE(name_106) } ; additive_expr : multiplicative_expr { START_PROFILE(name_107) $$ = $1; END_PROFILE(name_107) } | additive_expr _2b multiplicative_expr { START_PROFILE(name_109) $$ = Scm_ApplyRec2(name_108, $1, $3); END_PROFILE(name_109) } | additive_expr _ multiplicative_expr { START_PROFILE(name_111) $$ = Scm_ApplyRec2(name_110, $1, $3); END_PROFILE(name_111) } ; shift_expr : additive_expr { START_PROFILE(name_112) $$ = $1; END_PROFILE(name_112) } | shift_expr LEFT_OP additive_expr { START_PROFILE(name_114) $$ = Scm_ApplyRec2(name_113, $1, $3); END_PROFILE(name_114) } | shift_expr RIGHT_OP additive_expr { START_PROFILE(name_116) $$ = Scm_ApplyRec2(name_115, $1, $3); END_PROFILE(name_116) } ; relational_expr : shift_expr { START_PROFILE(name_117) $$ = $1; END_PROFILE(name_117) } | relational_expr _LT shift_expr { START_PROFILE(name_119) $$ = Scm_ApplyRec2(name_118, $1, $3); END_PROFILE(name_119) } | relational_expr _GT shift_expr { START_PROFILE(name_121) $$ = Scm_ApplyRec2(name_120, $1, $3); END_PROFILE(name_121) } | relational_expr LE_OP shift_expr { START_PROFILE(name_123) $$ = Scm_ApplyRec2(name_122, $1, $3); END_PROFILE(name_123) } | relational_expr GE_OP shift_expr { START_PROFILE(name_125) $$ = Scm_ApplyRec2(name_124, $1, $3); END_PROFILE(name_125) } ; equality_expr : relational_expr { START_PROFILE(name_126) $$ = $1; END_PROFILE(name_126) } | equality_expr EQ_OP relational_expr { START_PROFILE(name_128) $$ = Scm_ApplyRec2(name_127, $1, $3); END_PROFILE(name_128) } | equality_expr NE_OP relational_expr { START_PROFILE(name_130) $$ = Scm_ApplyRec2(name_129, $1, $3); END_PROFILE(name_130) } ; and_expr : equality_expr { START_PROFILE(name_131) $$ = $1; END_PROFILE(name_131) } | and_expr _26 equality_expr { START_PROFILE(name_133) $$ = Scm_ApplyRec2(name_132, $1, $3); END_PROFILE(name_133) } ; exclusive_or_expr : and_expr { START_PROFILE(name_134) $$ = $1; END_PROFILE(name_134) } | exclusive_or_expr _5e and_expr { START_PROFILE(name_136) $$ = Scm_ApplyRec2(name_135, $1, $3); END_PROFILE(name_136) } ; inclusive_or_expr : exclusive_or_expr { START_PROFILE(name_137) $$ = $1; END_PROFILE(name_137) } | inclusive_or_expr OR exclusive_or_expr { START_PROFILE(name_139) $$ = Scm_ApplyRec2(name_138, $1, $3); END_PROFILE(name_139) } ; logical_and_expr : inclusive_or_expr { START_PROFILE(name_140) $$ = $1; END_PROFILE(name_140) } | logical_and_expr AND_OP inclusive_or_expr { START_PROFILE(name_142) $$ = Scm_ApplyRec2(name_141, $1, $3); END_PROFILE(name_142) } ; logical_or_expr : logical_and_expr { START_PROFILE(name_143) $$ = $1; END_PROFILE(name_143) } | logical_or_expr OR_OP logical_and_expr { START_PROFILE(name_145) $$ = Scm_ApplyRec2(name_144, $1, $3); END_PROFILE(name_145) } ; conditional_expr : logical_or_expr { START_PROFILE(name_146) $$ = $1; END_PROFILE(name_146) } | logical_or_expr P logical_or_expr COLON conditional_expr { START_PROFILE(name_148) $$ = Scm_ApplyRec3(name_147, $1, $3, $5); END_PROFILE(name_148) } ; assignment_expr : conditional_expr { START_PROFILE(name_149) $$ = $1; END_PROFILE(name_149) } | unary_expr _3d assignment_expr { START_PROFILE(name_151) $$ = Scm_ApplyRec2(name_150, $1, $3); END_PROFILE(name_151) } | unary_expr MUL_ASSIGN assignment_expr { START_PROFILE(name_152) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_101, $1, $3)); END_PROFILE(name_152) } | unary_expr DIV_ASSIGN assignment_expr { START_PROFILE(name_153) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_103, $1, $3)); END_PROFILE(name_153) } | unary_expr MOD_ASSIGN assignment_expr { START_PROFILE(name_154) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_105, $1, $3)); END_PROFILE(name_154) } | unary_expr ADD_ASSIGN assignment_expr { START_PROFILE(name_155) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_108, $1, $3)); END_PROFILE(name_155) } | unary_expr SUB_ASSIGN assignment_expr { START_PROFILE(name_156) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_110, $1, $3)); END_PROFILE(name_156) } | unary_expr LEFT_ASSIGN assignment_expr { START_PROFILE(name_157) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_113, $1, $3)); END_PROFILE(name_157) } | unary_expr RIGHT_ASSIGN assignment_expr { START_PROFILE(name_158) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_115, $1, $3)); END_PROFILE(name_158) } | unary_expr AND_ASSIGN assignment_expr { START_PROFILE(name_159) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_132, $1, $3)); END_PROFILE(name_159) } | unary_expr XOR_ASSIGN assignment_expr { START_PROFILE(name_160) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_135, $1, $3)); END_PROFILE(name_160) } | unary_expr OR_ASSIGN assignment_expr { START_PROFILE(name_161) $$ = Scm_ApplyRec2(name_150, $1, Scm_ApplyRec2(name_138, $1, $3)); END_PROFILE(name_161) } ; expr : assignment_expr { START_PROFILE(name_162) $$ = $1; END_PROFILE(name_162) } | expr COMMA assignment_expr { START_PROFILE(name_164) $$ = Scm_ApplyRec2(name_163, $1, $3); END_PROFILE(name_164) } ; constant_expr : conditional_expr { START_PROFILE(name_165) $$ = $1; END_PROFILE(name_165) } ; struct_or_union_specifier : struct_or_union identifier LCBRA struct_declaration_list RCBRA { START_PROFILE(name_167) $$ = Scm_ApplyRec3(name_166, $1, $2, $4); END_PROFILE(name_167) } | struct_or_union LCBRA struct_declaration_list RCBRA { START_PROFILE(name_168) $$ = Scm_ApplyRec3(name_166, $1, SCM_FALSE, $3); END_PROFILE(name_168) } | struct_or_union identifier { START_PROFILE(name_169) $$ = Scm_ApplyRec3(name_166, $1, $2, SCM_FALSE); END_PROFILE(name_169) } ; struct_or_union : STRUCT { START_PROFILE(name_170) $$ = token_sym_STRUCT; END_PROFILE(name_170) } | UNION { START_PROFILE(name_171) $$ = token_sym_UNION; END_PROFILE(name_171) } ; struct_declaration_list : struct_declaration { START_PROFILE(name_172) $$ = $1; END_PROFILE(name_172) } | struct_declaration_list struct_declaration { START_PROFILE(name_173) $$ = CParser_Append($1,$2); END_PROFILE(name_173) } ; struct_declaration : type_specifier_list struct_declarator_list SEMICOLON { START_PROFILE(name_175) Scm_ApplyRec0(name_174); $$ = Scm_MakeTypeDeclList($1,$2); END_PROFILE(name_175) } | extension type_specifier_list struct_declarator_list SEMICOLON { START_PROFILE(name_176) Scm_ApplyRec0(name_174); $$ = Scm_MakeTypeDeclList($2,$3); END_PROFILE(name_176) } | struct_or_union_specifier SEMICOLON { START_PROFILE(name_179) Scm_ApplyRec0(name_174); $$ = Scm_MakeTypeDeclList(CParser_List($1),SCM_LIST1(Scm_IdentifierDeclarator(Scm_ApplyRec1(name_177, name_178)))); END_PROFILE(name_179) } | extension struct_or_union_specifier SEMICOLON { START_PROFILE(name_180) Scm_ApplyRec0(name_174); $$ = Scm_MakeTypeDeclList(CParser_List($2),SCM_LIST1(Scm_IdentifierDeclarator(Scm_ApplyRec1(name_177, name_178)))); END_PROFILE(name_180) } | AT_DEFS LPAREN TYPENAME RPAREN { START_PROFILE(name_181) $$ = name_15; END_PROFILE(name_181) } ; struct_declarator_list : struct_declarator { START_PROFILE(name_182) $$ = CParser_List(Scm_ComposeVariableAttribute($1)); END_PROFILE(name_182) } | struct_declarator_list COMMA struct_declarator { START_PROFILE(name_183) $$ = CParser_AddList($1,Scm_ComposeVariableAttribute($3)); END_PROFILE(name_183) } ; struct_declarator : declarator { START_PROFILE(name_184) $$ = $1; END_PROFILE(name_184) } | COLON constant_expr { START_PROFILE(name_185) $$ = Scm_BitFieldDeclarator($2); END_PROFILE(name_185) } | declarator COLON constant_expr { START_PROFILE(name_186) $$ = Scm_ComposeDeclarator(Scm_BitFieldDeclarator($3),$1); END_PROFILE(name_186) } ; enum_specifier : ENUM LCBRA enumerator_list RCBRA { START_PROFILE(name_188) $$ = Scm_ApplyRec2(name_187, SCM_FALSE, $3); END_PROFILE(name_188) } | ENUM LCBRA enumerator_list COMMA RCBRA { START_PROFILE(name_189) $$ = Scm_ApplyRec2(name_187, SCM_FALSE, $3); END_PROFILE(name_189) } | ENUM identifier LCBRA enumerator_list RCBRA { START_PROFILE(name_190) $$ = Scm_ApplyRec2(name_187, $2, $4); END_PROFILE(name_190) } | ENUM identifier LCBRA enumerator_list COMMA RCBRA { START_PROFILE(name_191) $$ = Scm_ApplyRec2(name_187, $2, $4); END_PROFILE(name_191) } | ENUM identifier { START_PROFILE(name_192) $$ = Scm_ApplyRec2(name_187, $2, name_15); END_PROFILE(name_192) } ; enumerator_list : enumerator { START_PROFILE(name_193) $$ = CParser_List($1); END_PROFILE(name_193) } | enumerator_list COMMA enumerator { START_PROFILE(name_194) $$ = CParser_AddList($1,$3); END_PROFILE(name_194) } ; enumerator : identifier { START_PROFILE(name_196) $$ = Scm_ApplyRec2(name_195, $1, SCM_FALSE); END_PROFILE(name_196) } | identifier _3d constant_expr { START_PROFILE(name_197) $$ = Scm_ApplyRec2(name_195, $1, $3); END_PROFILE(name_197) } ; declarator : declarator2 { START_PROFILE(name_198) $$ = $1; END_PROFILE(name_198) } | pointer declarator2 { START_PROFILE(name_199) $$ = Scm_ComposeDeclarator($2,$1); END_PROFILE(name_199) } ; declarator2 : identifier { START_PROFILE(name_200) $$ = Scm_IdentifierDeclarator($1); END_PROFILE(name_200) } | LPAREN declarator RPAREN { START_PROFILE(name_201) $$ = $2; END_PROFILE(name_201) } | declarator2 LSBRA RSBRA { START_PROFILE(name_202) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator(SCM_FALSE),$1); END_PROFILE(name_202) } | declarator2 LSBRA array_qualifier_list RSBRA { START_PROFILE(name_203) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator(SCM_FALSE),$1); END_PROFILE(name_203) } | declarator2 LSBRA array_size_expr RSBRA { START_PROFILE(name_204) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator($3),$1); END_PROFILE(name_204) } | declarator2 LSBRA array_qualifier_list array_size_expr RSBRA { START_PROFILE(name_205) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator($4),$1); END_PROFILE(name_205) } | declarator2 LPAREN RPAREN { START_PROFILE(name_206) $$ = Scm_ComposeDeclarator($1,Scm_FuncDeclarator(name_15)); END_PROFILE(name_206) } | declarator2 LPAREN parameter_type_list RPAREN { START_PROFILE(name_207) $$ = Scm_ComposeDeclarator($1,$3); END_PROFILE(name_207) } | declarator2 LPAREN parameter_identifier_list RPAREN { START_PROFILE(name_208) $$ = $1; END_PROFILE(name_208) } ; pointer : _2a { START_PROFILE(name_209) $$ = Scm_PtrDeclarator(); END_PROFILE(name_209) } | _2a type_specifier_list { START_PROFILE(name_210) $$ = Scm_PtrDeclarator(); END_PROFILE(name_210) } | _2a pointer { START_PROFILE(name_211) $$ = Scm_ComposeDeclarator(Scm_PtrDeclarator(),$2); END_PROFILE(name_211) } | _2a type_specifier_list pointer { START_PROFILE(name_212) $$ = Scm_ComposeDeclarator(Scm_PtrDeclarator(),$3); END_PROFILE(name_212) } ; type_specifier_list : type_specifier { START_PROFILE(name_213) $$ = $1; END_PROFILE(name_213) } | type_specifier_list type_specifier { START_PROFILE(name_214) $$ = CParser_Append($1,$2); END_PROFILE(name_214) } ; parameter_identifier_list : identifier_list | identifier_list COMMA ELLIPSIS ; identifier_list : identifier { START_PROFILE(name_215) $$ = CParser_List($1); END_PROFILE(name_215) } | identifier_list COMMA identifier { START_PROFILE(name_216) $$ = CParser_AddList($1,$3); END_PROFILE(name_216) } ; parameter_type_list : parameter_list { START_PROFILE(name_217) $$ = Scm_FuncDeclarator($1); END_PROFILE(name_217) } | parameter_list COMMA ELLIPSIS { START_PROFILE(name_218) $$ = Scm_FuncVaargsDeclarator($1); END_PROFILE(name_218) } ; parameter_list : parameter_declaration { START_PROFILE(name_219) $$ = CParser_List($1); END_PROFILE(name_219) } | parameter_list COMMA parameter_declaration { START_PROFILE(name_220) $$ = CParser_AddList($1,$3); END_PROFILE(name_220) } ; parameter_declaration : type_specifier_list declarator { START_PROFILE(name_221) $$ = Scm_ParameterDeclaration(Scm_MakeTypeDecl($1,Scm_ComposeVariableAttribute($2))); END_PROFILE(name_221) } | type_name { START_PROFILE(name_222) $$ = $1; END_PROFILE(name_222) } ; type_name : type_specifier_list { START_PROFILE(name_223) $$ = Scm_MakeTypeDecl($1,Scm_NullDeclarator()); END_PROFILE(name_223) } | type_specifier_list abstract_declarator { START_PROFILE(name_224) $$ = Scm_MakeTypeDecl($1,$2); END_PROFILE(name_224) } ; abstract_declarator : pointer { START_PROFILE(name_225) $$ = $1; END_PROFILE(name_225) } | abstract_declarator2 { START_PROFILE(name_226) $$ = $1; END_PROFILE(name_226) } | pointer abstract_declarator2 { START_PROFILE(name_227) $$ = Scm_ComposeDeclarator($2,$1); END_PROFILE(name_227) } ; abstract_declarator2 : LPAREN abstract_declarator RPAREN { START_PROFILE(name_228) $$ = $2; END_PROFILE(name_228) } | LSBRA RSBRA { START_PROFILE(name_229) $$ = Scm_PtrDeclarator(); END_PROFILE(name_229) } | LSBRA array_qualifier_list RSBRA { START_PROFILE(name_230) $$ = Scm_PtrDeclarator(); END_PROFILE(name_230) } | LSBRA array_size_expr RSBRA { START_PROFILE(name_231) $$ = Scm_ArrayDeclarator($2); END_PROFILE(name_231) } | LSBRA array_qualifier_list array_size_expr RSBRA { START_PROFILE(name_232) $$ = Scm_ArrayDeclarator($3); END_PROFILE(name_232) } | abstract_declarator2 LSBRA RSBRA { START_PROFILE(name_233) $$ = Scm_ComposeDeclarator(Scm_PtrDeclarator(),$1); END_PROFILE(name_233) } | abstract_declarator2 LSBRA array_qualifier_list RSBRA { START_PROFILE(name_234) $$ = Scm_ComposeDeclarator(Scm_PtrDeclarator(),$1); END_PROFILE(name_234) } | abstract_declarator2 LSBRA array_size_expr RSBRA { START_PROFILE(name_235) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator($3),$1); END_PROFILE(name_235) } | abstract_declarator2 LSBRA array_qualifier_list array_size_expr RSBRA { START_PROFILE(name_236) $$ = Scm_ComposeDeclarator(Scm_ArrayDeclarator($4),$1); END_PROFILE(name_236) } | LPAREN RPAREN { START_PROFILE(name_237) $$ = Scm_FuncDeclarator(name_15); END_PROFILE(name_237) } | LPAREN parameter_type_list RPAREN { START_PROFILE(name_238) $$ = $2; END_PROFILE(name_238) } | abstract_declarator2 LPAREN RPAREN { START_PROFILE(name_239) $$ = Scm_ComposeDeclarator($1,Scm_FuncDeclarator(name_15)); END_PROFILE(name_239) } | abstract_declarator2 LPAREN parameter_type_list RPAREN { START_PROFILE(name_240) $$ = Scm_ComposeDeclarator($1,$3); END_PROFILE(name_240) } ; initializer : assignment_expr { START_PROFILE(name_241) $$ = $1; END_PROFILE(name_241) } | LCBRA initializer_list RCBRA { START_PROFILE(name_242) $$ = SCM_FALSE; END_PROFILE(name_242) } | LCBRA initializer_list COMMA RCBRA { START_PROFILE(name_243) $$ = SCM_FALSE; END_PROFILE(name_243) } ; initializer_list : initializer | initializer_list COMMA initializer ; statement : labeled_statement { START_PROFILE(name_244) $$ = SCM_FALSE; END_PROFILE(name_244) } | compound_statement { START_PROFILE(name_245) $$ = $1; END_PROFILE(name_245) } | expression_statement { START_PROFILE(name_246) $$ = $1; END_PROFILE(name_246) } | selection_statement { START_PROFILE(name_247) $$ = $1; END_PROFILE(name_247) } | iteration_statement { START_PROFILE(name_248) $$ = $1; END_PROFILE(name_248) } | jump_statement { START_PROFILE(name_249) $$ = $1; END_PROFILE(name_249) } | asm_statement { START_PROFILE(name_250) $$ = SCM_FALSE; END_PROFILE(name_250) } | objc_statement { START_PROFILE(name_251) $$ = SCM_FALSE; END_PROFILE(name_251) } ; objc_statement : AT_THROW expr SEMICOLON | AT_THROW SEMICOLON | objc_try_catch_statement | AT_SYNCHRONIZED LPAREN expr RPAREN compound_statement ; objc_catch_prefix : AT_CATCH LPAREN identifier RPAREN ; objc_catch_clause : objc_catch_prefix compound_statement ; objc_opt_catch_list : | objc_opt_catch_list objc_catch_clause ; objc_try_catch_clause : AT_TRY compound_statement objc_opt_catch_list ; objc_finally_clause : AT_FINALLY compound_statement ; objc_try_catch_statement : objc_try_catch_clause | objc_try_catch_clause objc_finally_clause ; labeled_statement : identifier COLON statement | CASE constant_expr COLON statement | DEFAULT COLON statement ; compound_statement : LCBRA RCBRA { START_PROFILE(name_253) $$ = Scm_ApplyRec1(name_56, name_252); END_PROFILE(name_253) } | LCBRA statement_list RCBRA { START_PROFILE(name_254) $$ = Scm_ApplyRec1(name_56, $2); END_PROFILE(name_254) } | LCBRA declaration_list RCBRA { START_PROFILE(name_255) $$ = Scm_ApplyRec1(name_56, name_252); END_PROFILE(name_255) } | LCBRA declaration_list statement_list RCBRA { START_PROFILE(name_257) $$ = Scm_ApplyRec2(name_256, $2, $3); END_PROFILE(name_257) } | error RCBRA { START_PROFILE(name_258) $$ = SCM_FALSE; END_PROFILE(name_258) } ; declaration_list : declaration { START_PROFILE(name_259) $$ = $1; END_PROFILE(name_259) } | declaration_list declaration { START_PROFILE(name_260) $$ = CParser_Append($1,$2); END_PROFILE(name_260) } ; statement_list : statement { START_PROFILE(name_261) $$ = CParser_List($1); END_PROFILE(name_261) } | statement_list statement { START_PROFILE(name_262) $$ = CParser_AddList($1,$2); END_PROFILE(name_262) } ; expression_statement : SEMICOLON { START_PROFILE(name_263) $$ = SCM_MAKE_INT(0); END_PROFILE(name_263) } | expr SEMICOLON { START_PROFILE(name_264) $$ = $1; END_PROFILE(name_264) } | error SEMICOLON { START_PROFILE(name_265) $$ = SCM_FALSE; END_PROFILE(name_265) } ; selection_statement : IF LPAREN expr RPAREN statement { START_PROFILE(name_266) $$ = Scm_ApplyRec3(name_147, $3, $5, SCM_MAKE_INT(0)); END_PROFILE(name_266) } | IF LPAREN expr RPAREN statement ELSE statement { START_PROFILE(name_267) $$ = Scm_ApplyRec3(name_147, $3, $5, $7); END_PROFILE(name_267) } | SWITCH LPAREN expr RPAREN statement { START_PROFILE(name_268) $$ = SCM_FALSE; END_PROFILE(name_268) } ; iteration_statement : WHILE LPAREN expr RPAREN statement { START_PROFILE(name_270) $$ = Scm_ApplyRec2(name_269, $3, $5); END_PROFILE(name_270) } | DO statement WHILE LPAREN expr RPAREN SEMICOLON { START_PROFILE(name_272) $$ = Scm_ApplyRec2(name_271, $5, $2); END_PROFILE(name_272) } | FOR LPAREN SEMICOLON SEMICOLON RPAREN statement { START_PROFILE(name_274) $$ = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), SCM_MAKE_INT(1), SCM_MAKE_INT(0), $6); END_PROFILE(name_274) } | FOR LPAREN SEMICOLON SEMICOLON expr RPAREN statement { START_PROFILE(name_275) $$ = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), SCM_MAKE_INT(1), $5, $7); END_PROFILE(name_275) } | FOR LPAREN SEMICOLON expr SEMICOLON RPAREN statement { START_PROFILE(name_276) $$ = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), $4, SCM_MAKE_INT(0), $7); END_PROFILE(name_276) } | FOR LPAREN SEMICOLON expr SEMICOLON expr RPAREN statement { START_PROFILE(name_277) $$ = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), $4, $6, $8); END_PROFILE(name_277) } | FOR LPAREN expr SEMICOLON SEMICOLON RPAREN statement { START_PROFILE(name_278) $$ = Scm_ApplyRec4(name_273, $3, SCM_MAKE_INT(1), SCM_MAKE_INT(0), $7); END_PROFILE(name_278) } | FOR LPAREN expr SEMICOLON SEMICOLON expr RPAREN statement { START_PROFILE(name_279) $$ = Scm_ApplyRec4(name_273, $3, SCM_MAKE_INT(1), $6, $8); END_PROFILE(name_279) } | FOR LPAREN expr SEMICOLON expr SEMICOLON RPAREN statement { START_PROFILE(name_280) $$ = Scm_ApplyRec4(name_273, $3, $5, SCM_MAKE_INT(0), $8); END_PROFILE(name_280) } | FOR LPAREN expr SEMICOLON expr SEMICOLON expr RPAREN statement { START_PROFILE(name_281) $$ = Scm_ApplyRec4(name_273, $3, $5, $7, $9); END_PROFILE(name_281) } ; jump_statement : GOTO identifier SEMICOLON { START_PROFILE(name_282) $$ = SCM_FALSE; END_PROFILE(name_282) } | CONTINUE SEMICOLON { START_PROFILE(name_284) $$ = Scm_ApplyRec0(name_283); END_PROFILE(name_284) } | BREAK SEMICOLON { START_PROFILE(name_286) $$ = Scm_ApplyRec0(name_285); END_PROFILE(name_286) } | RETURN SEMICOLON { START_PROFILE(name_288) $$ = Scm_ApplyRec1(name_287, SCM_MAKE_INT(0)); END_PROFILE(name_288) } | RETURN expr SEMICOLON { START_PROFILE(name_289) $$ = Scm_ApplyRec1(name_287, $2); END_PROFILE(name_289) } ; identifier : IDENTIFIER { START_PROFILE(name_290) $$ = $1; END_PROFILE(name_290) } ; maybe_asm : | asm_expr ; asm_expr : ASM LPAREN string_list RPAREN ; asm_statement : ASM LPAREN asm_argument RPAREN SEMICOLON | ASM type_qualifier LPAREN asm_argument RPAREN SEMICOLON ; type_qualifier : CONST | VOLATILE | RESTRICT ; array_qualifier : STATIC | RESTRICT | CONST | VOLATILE ; array_qualifier_list : array_qualifier | array_qualifier_list array_qualifier ; array_size_expr : assignment_expr { START_PROFILE(name_291) $$ = $1; END_PROFILE(name_291) } | _2a { START_PROFILE(name_292) $$ = SCM_FALSE; END_PROFILE(name_292) } ; asm_argument : string_list | string_list COLON asm_operands | string_list COLON asm_operands COLON asm_operands | string_list COLON asm_operands COLON asm_operands COLON asm_clobbers ; string_list : STRING | string_list STRING ; asm_operands : | asm_operands2 ; asm_operands2 : asm_operand | asm_operands2 COMMA asm_operand ; asm_operand : STRING LPAREN expr RPAREN | LSBRA identifier RSBRA STRING LPAREN expr RPAREN ; asm_clobbers : STRING | asm_clobbers COMMA STRING ; asm_definition : asm_expr SEMICOLON ; maybe_extension : | extension ; extension : EXTENSION ; objc_definition : objc_class_definition | objc_class_declaration | objc_alias_declaration | objc_protocol_definition | objc_method_definition ; classname : identifier { START_PROFILE(name_293) $$ = $1; END_PROFILE(name_293) } | TYPENAME { START_PROFILE(name_294) $$ = $1; END_PROFILE(name_294) } ; classname_list : classname { START_PROFILE(name_295) $$ = CParser_List($1); END_PROFILE(name_295) } | classname_list COMMA classname { START_PROFILE(name_296) $$ = CParser_AddList($1,$3); END_PROFILE(name_296) } ; objc_class_declaration : AT_CLASS classname_list SEMICOLON { START_PROFILE(name_297) $$ = Scm_EmitDefineObjcClass($2); END_PROFILE(name_297) } ; objc_alias_declaration : AT_ALIAS identifier identifier SEMICOLON { START_PROFILE(name_298) $$ = SCM_FALSE; END_PROFILE(name_298) } ; objc_superclass : COLON classname | ; objc_class_ivars : LCBRA objc_ivar_declaration_list RCBRA | ; objc_class_definition : objc_interface_head objc_superclass objc_protocol_references objc_class_ivars objc_method_prototype_list AT_END | AT_IMPLEMENTATION classname objc_superclass objc_class_ivars | objc_interface_head LPAREN classname RPAREN objc_protocol_references objc_method_prototype_list AT_END | AT_IMPLEMENTATION classname LPAREN identifier RPAREN ; objc_interface_head : AT_INTERFACE classname { START_PROFILE(name_299) $$ = Scm_EmitDefineObjcClass(CParser_List($2)); END_PROFILE(name_299) } ; objc_protocol_definition : AT_PROTOCOL identifier objc_protocol_references objc_method_prototype_list AT_END | AT_PROTOCOL identifier_list SEMICOLON ; objc_protocol_references : | objc_non_empty_protocol_references ; objc_non_empty_protocol_references : _LT classname_list _GT ; objc_ivar_declaration_list : objc_ivar_declaration_list objc_visibility_spec objc_ivar_declarations | objc_ivar_declarations ; objc_visibility_spec : AT_PRIVATE | AT_PROTECTED | AT_PUBLIC ; objc_ivar_declarations : | objc_ivar_declarations objc_ivar_declaration SEMICOLON | objc_ivar_declarations SEMICOLON ; objc_ivar_declaration : declaration_specifiers objc_ivars ; objc_ivars : | objc_ivar_declarator | objc_ivars COMMA objc_ivar_declarator ; objc_ivar_declarator : declarator | declarator COLON assignment_expr | COLON assignment_expr ; objc_method_type : _2b | _ ; objc_method_definition : objc_method_type objc_method_declaration optarglist compound_statement ; objc_method_prototype_list : | objc_method_prototype_list objc_method_prototype | objc_method_prototype_list external_declaration | objc_method_prototype_list objc_property | objc_method_prototype_list AT_OPTIONAL | objc_method_prototype_list AT_REQUIRED ; objc_method_prototype : objc_method_type objc_method_declaration SEMICOLON { START_PROFILE(name_302) Scm_ApplyRec0(name_174); $$ = Scm_ApplyRec2(name_300, name_301, $2); END_PROFILE(name_302) } ; objc_property : AT_PROPERTY LPAREN property_attribute_list RPAREN declaration | AT_PROPERTY declaration | AT_SYNTHESIZE init_declarator_list SEMICOLON | AT_DYNAMIC init_declarator_list SEMICOLON ; property_attribute_list : | identifier | property_attribute_list COMMA identifier ; objc_protocol_qualifier : | identifier ; objc_method_declaration : LPAREN objc_protocol_qualifier type_name RPAREN unary_selector { START_PROFILE(name_304) $$ = Scm_ApplyRec2(name_303, $3, $5); END_PROFILE(name_304) } | unary_selector { START_PROFILE(name_306) $$ = Scm_ApplyRec2(name_303, Scm_ApplyRec0(name_305), $1); END_PROFILE(name_306) } | LPAREN objc_protocol_qualifier type_name RPAREN keyword_selector optparmlist { START_PROFILE(name_307) $$ = Scm_ApplyRec2(name_303, $3, $5); END_PROFILE(name_307) } | keyword_selector optparmlist { START_PROFILE(name_308) $$ = Scm_ApplyRec2(name_303, Scm_ApplyRec0(name_305), $1); END_PROFILE(name_308) } ; optarglist : | SEMICOLON myxdecls ; myxdecls : | mydecls ; error_statement : error SEMICOLON { START_PROFILE(name_309) $$ = SCM_FALSE; END_PROFILE(name_309) } ; mydecls : mydecl | error_statement | mydecls mydecl | mydecl error_statement ; mydecl : declaration_specifiers parameter_list SEMICOLON | declaration_specifiers SEMICOLON ; optparmlist : | COMMA ELLIPSIS | COMMA parameter_list ; unary_selector : selector { START_PROFILE(name_311) $$ = Scm_ApplyRec1(name_310, $1); END_PROFILE(name_311) } ; keyword_selector : keyword_declarator { START_PROFILE(name_313) $$ = Scm_ApplyRec1(name_312, $1); END_PROFILE(name_313) } | keyword_selector keyword_declarator { START_PROFILE(name_314) $$ = Scm_ApplyRec2(name_312, $1, $2); END_PROFILE(name_314) } ; selector : identifier { START_PROFILE(name_315) $$ = $1; END_PROFILE(name_315) } | TYPENAME { START_PROFILE(name_316) $$ = $1; END_PROFILE(name_316) } | reserved_words { START_PROFILE(name_317) $$ = $1; END_PROFILE(name_317) } ; reserved_words : ENUM | STRUCT | UNION | IF | ELSE | WHILE | DO | FOR | SWITCH | CASE | DEFAULT | BREAK | CONTINUE | RETURN | GOTO | ASM | SIZEOF ; keyword_declarator : selector COLON LPAREN objc_protocol_qualifier type_name RPAREN identifier { START_PROFILE(name_318) Scm_ApplyRec0(name_174); $$ = Scm_ApplyRec2(name_310, $1, $5); END_PROFILE(name_318) } | selector COLON identifier { START_PROFILE(name_319) Scm_ApplyRec0(name_174); $$ = Scm_ApplyRec2(name_310, $1, Scm_ApplyRec0(name_305)); END_PROFILE(name_319) } | COLON LPAREN objc_protocol_qualifier type_name RPAREN identifier { START_PROFILE(name_321) Scm_ApplyRec0(name_174); $$ = Scm_ApplyRec2(name_310, name_320, $4); END_PROFILE(name_321) } | COLON identifier { START_PROFILE(name_322) Scm_ApplyRec0(name_174); $$ = Scm_ApplyRec2(name_310, name_320, Scm_ApplyRec0(name_305)); END_PROFILE(name_322) } ; message_args : selector { START_PROFILE(name_324) $$ = Scm_ApplyRec1(name_323, $1); END_PROFILE(name_324) } | keyword_arg_list { START_PROFILE(name_325) $$ = $1; END_PROFILE(name_325) } ; keyword_arg_list : keyword_arg { START_PROFILE(name_326) $$ = $1; END_PROFILE(name_326) } | keyword_arg_list keyword_arg { START_PROFILE(name_327) $$ = CParser_Append($1,$2); END_PROFILE(name_327) } ; keyword_arg : selector COLON expr { START_PROFILE(name_329) $$ = Scm_ApplyRec2(name_328, $1, $3); END_PROFILE(name_329) } | COLON expr { START_PROFILE(name_331) $$ = Scm_ApplyRec1(name_330, $2); END_PROFILE(name_331) } ; receiver : expr { START_PROFILE(name_332) $$ = $1; END_PROFILE(name_332) } | TYPENAME { START_PROFILE(name_333) $$ = $1; END_PROFILE(name_333) } ; objc_message_expr : LSBRA receiver message_args RSBRA { START_PROFILE(name_335) $$ = Scm_ApplyRec2(name_334, $2, $3); END_PROFILE(name_335) } ; selector_arg : selector { START_PROFILE(name_337) $$ = Scm_ApplyRec1(name_336, $1); END_PROFILE(name_337) } | keyword_name_list { START_PROFILE(name_341) $$ = Scm_ApplyRec2(name_338, Scm_ApplyRec2(name_339, name_336, $1), name_340); END_PROFILE(name_341) } ; keyword_name_list : keyword_name { START_PROFILE(name_342) $$ = CParser_List($1); END_PROFILE(name_342) } | keyword_name_list keyword_name { START_PROFILE(name_343) $$ = CParser_AddList($1,$2); END_PROFILE(name_343) } ; keyword_name : selector COLON { START_PROFILE(name_344) $$ = $1; END_PROFILE(name_344) } | COLON { START_PROFILE(name_346) $$ = name_345; END_PROFILE(name_346) } ; objc_selector_expr : AT_SELECTOR LPAREN selector_arg RPAREN { START_PROFILE(name_348) $$ = Scm_ApplyRec1(name_347, $3); END_PROFILE(name_348) } ; objc_protocol_expr : AT_PROTOCOL LPAREN identifier RPAREN ; objc_encode_expr : AT_ENCODE LPAREN TYPENAME RPAREN ; %% #ifdef USE_PROFILER static void show_profile_result() { fprintf(stderr, "---\n"); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_39_count, _profile_name_39_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(yylex)", _profile_yylex_count, _profile_yylex_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_250_count, _profile_name_250_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_251_count, _profile_name_251_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%NE $1 $3)", _profile_name_130_count, _profile_name_130_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_131_count, _profile_name_131_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT '(0))", _profile_name_253_count, _profile_name_253_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT $2)", _profile_name_254_count, _profile_name_254_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-AND $1 $3)", _profile_name_133_count, _profile_name_133_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT '(0))", _profile_name_255_count, _profile_name_255_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_134_count, _profile_name_134_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT-WITH-DECLARATION $2 $3)", _profile_name_257_count, _profile_name_257_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-XOR $1 $3)", _profile_name_136_count, _profile_name_136_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_258_count, _profile_name_258_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_137_count, _profile_name_137_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_259_count, _profile_name_259_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-OR $1 $3)", _profile_name_139_count, _profile_name_139_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%STRUCT-OR-UNION-SPECIFIER $1)", _profile_name_41_count, _profile_name_41_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ENUM-SPECIFIER $1)", _profile_name_43_count, _profile_name_43_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_44_count, _profile_name_44_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%TYPENAME $1)", _profile_name_45_count, _profile_name_45_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(id)", _profile_name_47_count, _profile_name_47_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IDENTIFIER $1)", _profile_name_49_count, _profile_name_49_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_260_count, _profile_name_260_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_261_count, _profile_name_261_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_140_count, _profile_name_140_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $2)", _profile_name_262_count, _profile_name_262_time); fprintf(stderr, "%s\t%lld\t%lld\n", "0", _profile_name_263_count, _profile_name_263_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LOG-AND $1 $3)", _profile_name_142_count, _profile_name_142_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_264_count, _profile_name_264_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_143_count, _profile_name_143_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_265_count, _profile_name_265_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $3 $5 0)", _profile_name_266_count, _profile_name_266_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LOG-OR $1 $3)", _profile_name_145_count, _profile_name_145_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $3 $5 $7)", _profile_name_267_count, _profile_name_267_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_146_count, _profile_name_146_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_268_count, _profile_name_268_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (apply emit-objc-method $2))", _profile_name_302_count, _profile_name_302_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $1 $3 $5)", _profile_name_148_count, _profile_name_148_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_149_count, _profile_name_149_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method $3 $5)", _profile_name_304_count, _profile_name_304_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method (var-id) $1)", _profile_name_306_count, _profile_name_306_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method $3 $5)", _profile_name_307_count, _profile_name_307_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method (var-id) $1)", _profile_name_308_count, _profile_name_308_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_309_count, _profile_name_309_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_50_count, _profile_name_50_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_51_count, _profile_name_51_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%OBJC-STRING $1)", _profile_name_53_count, _profile_name_53_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%EXPR-IN-PARENS $2)", _profile_name_55_count, _profile_name_55_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT $2)", _profile_name_57_count, _profile_name_57_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_58_count, _profile_name_58_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_59_count, _profile_name_59_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MACRO-BODY $2)", _profile_name_2_count, _profile_name_2_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_3_count, _profile_name_3_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_4_count, _profile_name_4_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_5_count, _profile_name_5_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_6_count, _profile_name_6_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%WHILE $3 $5)", _profile_name_270_count, _profile_name_270_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-inline '(int) $1 $2)", _profile_name_8_count, _profile_name_8_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DO-WHILE $5 $2)", _profile_name_272_count, _profile_name_272_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-inline $1 $2 $3)", _profile_name_9_count, _profile_name_9_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 $3)", _profile_name_151_count, _profile_name_151_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%MUL $1 $3))", _profile_name_152_count, _profile_name_152_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 1 0 $6)", _profile_name_274_count, _profile_name_274_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%DIV $1 $3))", _profile_name_153_count, _profile_name_153_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 1 $5 $7)", _profile_name_275_count, _profile_name_275_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%MOD $1 $3))", _profile_name_154_count, _profile_name_154_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 $4 0 $7)", _profile_name_276_count, _profile_name_276_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%ADD $1 $3))", _profile_name_155_count, _profile_name_155_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 $4 $6 $8)", _profile_name_277_count, _profile_name_277_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SUB $1 $3))", _profile_name_156_count, _profile_name_156_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-keyword $1)", _profile_name_311_count, _profile_name_311_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 1 0 $7)", _profile_name_278_count, _profile_name_278_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SHIFT-LEFT $1 $3))", _profile_name_157_count, _profile_name_157_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 1 $6 $8)", _profile_name_279_count, _profile_name_279_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SHIFT-RIGHT $1 $3))", _profile_name_158_count, _profile_name_158_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(combine-decl-keyword $1)", _profile_name_313_count, _profile_name_313_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-AND $1 $3))", _profile_name_159_count, _profile_name_159_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(combine-decl-keyword $1 $2)", _profile_name_314_count, _profile_name_314_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_315_count, _profile_name_315_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_316_count, _profile_name_316_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_317_count, _profile_name_317_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $1 $5))", _profile_name_318_count, _profile_name_318_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $1 (var-id)))", _profile_name_319_count, _profile_name_319_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_60_count, _profile_name_60_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_61_count, _profile_name_61_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_62_count, _profile_name_62_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_63_count, _profile_name_63_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%REF-ARRAY $1 $3)", _profile_name_65_count, _profile_name_65_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCALL $1 '())", _profile_name_67_count, _profile_name_67_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCALL $1 $3)", _profile_name_68_count, _profile_name_68_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 $5 0 $8)", _profile_name_280_count, _profile_name_280_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 $5 $7 $9)", _profile_name_281_count, _profile_name_281_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-XOR $1 $3))", _profile_name_160_count, _profile_name_160_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_282_count, _profile_name_282_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-OR $1 $3))", _profile_name_161_count, _profile_name_161_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_162_count, _profile_name_162_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CONTINUE)", _profile_name_284_count, _profile_name_284_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CONCAT-EXPR $1 $3)", _profile_name_164_count, _profile_name_164_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BREAK)", _profile_name_286_count, _profile_name_286_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_165_count, _profile_name_165_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $4))", _profile_name_321_count, _profile_name_321_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%RETURN 0)", _profile_name_288_count, _profile_name_288_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 $2 $4)", _profile_name_167_count, _profile_name_167_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(identifier-declarator $1)", _profile_name_200_count, _profile_name_200_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword (var-id)))", _profile_name_322_count, _profile_name_322_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%RETURN $2)", _profile_name_289_count, _profile_name_289_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 #f $3)", _profile_name_168_count, _profile_name_168_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_201_count, _profile_name_201_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 $2 #f)", _profile_name_169_count, _profile_name_169_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator #f) $1)", _profile_name_202_count, _profile_name_202_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%QUOTE $1)", _profile_name_324_count, _profile_name_324_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator #f) $1)", _profile_name_203_count, _profile_name_203_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_325_count, _profile_name_325_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $3) $1)", _profile_name_204_count, _profile_name_204_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_326_count, _profile_name_326_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $4) $1)", _profile_name_205_count, _profile_name_205_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_327_count, _profile_name_327_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (func-declarator '()))", _profile_name_206_count, _profile_name_206_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 $3)", _profile_name_207_count, _profile_name_207_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%KEYWORD-ARG $1 $3)", _profile_name_329_count, _profile_name_329_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DOT-REF $1 $3)", _profile_name_70_count, _profile_name_70_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_208_count, _profile_name_208_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_209_count, _profile_name_209_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PTR-REF $1 $3)", _profile_name_72_count, _profile_name_72_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%POST-INC $1)", _profile_name_74_count, _profile_name_74_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%POST-DEC $1)", _profile_name_76_count, _profile_name_76_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_77_count, _profile_name_77_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_78_count, _profile_name_78_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_79_count, _profile_name_79_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_290_count, _profile_name_290_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_291_count, _profile_name_291_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'STRUCT", _profile_name_170_count, _profile_name_170_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_292_count, _profile_name_292_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'UNION", _profile_name_171_count, _profile_name_171_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_293_count, _profile_name_293_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_172_count, _profile_name_172_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_294_count, _profile_name_294_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_173_count, _profile_name_173_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_295_count, _profile_name_295_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(c_scan)", _profile_c_scan_count, _profile_c_scan_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_296_count, _profile_name_296_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list $1 $2))", _profile_name_175_count, _profile_name_175_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-objc-class $2)", _profile_name_297_count, _profile_name_297_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list $2 $3))", _profile_name_176_count, _profile_name_176_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%KEYWORD-ARG-WITHOUT-SELECTOR $2)", _profile_name_331_count, _profile_name_331_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_298_count, _profile_name_298_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_210_count, _profile_name_210_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_332_count, _profile_name_332_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-objc-class (%LIST $2))", _profile_name_299_count, _profile_name_299_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $2)", _profile_name_211_count, _profile_name_211_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_333_count, _profile_name_333_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list (%LIST $1) (list (identifier-declarator (gensym %unnamed)))))", _profile_name_179_count, _profile_name_179_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $3)", _profile_name_212_count, _profile_name_212_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_213_count, _profile_name_213_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%OBJC-MESSAGE-EXPR $2 $3)", _profile_name_335_count, _profile_name_335_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_214_count, _profile_name_214_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_215_count, _profile_name_215_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(x->string $1)", _profile_name_337_count, _profile_name_337_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_216_count, _profile_name_216_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-declarator $1)", _profile_name_217_count, _profile_name_217_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-vaargs-declarator $1)", _profile_name_218_count, _profile_name_218_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PRE-INC $2)", _profile_name_81_count, _profile_name_81_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_219_count, _profile_name_219_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PRE-DEC $2)", _profile_name_83_count, _profile_name_83_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%UNARY $1 $2)", _profile_name_85_count, _profile_name_85_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SIZEOF-EXPR $2)", _profile_name_87_count, _profile_name_87_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SIZEOF-TYPE $3)", _profile_name_89_count, _profile_name_89_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list (%LIST $2) (list (identifier-declarator (gensym %unnamed)))))", _profile_name_180_count, _profile_name_180_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_181_count, _profile_name_181_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST (compose-variable-attribute $1))", _profile_name_182_count, _profile_name_182_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 (compose-variable-attribute $3))", _profile_name_183_count, _profile_name_183_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_184_count, _profile_name_184_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(bit-field-declarator $2)", _profile_name_185_count, _profile_name_185_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (bit-field-declarator $3) $1)", _profile_name_186_count, _profile_name_186_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(string-join (map x->string $1) :)", _profile_name_341_count, _profile_name_341_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_220_count, _profile_name_220_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_342_count, _profile_name_342_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_100_count, _profile_name_100_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum #f $3)", _profile_name_188_count, _profile_name_188_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(parameter-declaration (make-type-decl $1 (compose-variable-attribute $2)))", _profile_name_221_count, _profile_name_221_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $2)", _profile_name_343_count, _profile_name_343_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum #f $3)", _profile_name_189_count, _profile_name_189_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_222_count, _profile_name_222_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_344_count, _profile_name_344_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MUL $1 $3)", _profile_name_102_count, _profile_name_102_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(make-type-decl $1 (null-declarator))", _profile_name_223_count, _profile_name_223_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(make-type-decl $1 $2)", _profile_name_224_count, _profile_name_224_time); fprintf(stderr, "%s\t%lld\t%lld\n", "", _profile_name_346_count, _profile_name_346_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DIV $1 $3)", _profile_name_104_count, _profile_name_104_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_225_count, _profile_name_225_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_226_count, _profile_name_226_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SELECTOR $3)", _profile_name_348_count, _profile_name_348_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MOD $1 $3)", _profile_name_106_count, _profile_name_106_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $2 $1)", _profile_name_227_count, _profile_name_227_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_90_count, _profile_name_90_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_107_count, _profile_name_107_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_228_count, _profile_name_228_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'&", _profile_name_91_count, _profile_name_91_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_229_count, _profile_name_229_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'*", _profile_name_92_count, _profile_name_92_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD $1 $3)", _profile_name_109_count, _profile_name_109_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'+", _profile_name_93_count, _profile_name_93_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'-", _profile_name_94_count, _profile_name_94_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'~", _profile_name_95_count, _profile_name_95_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'!", _profile_name_96_count, _profile_name_96_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_97_count, _profile_name_97_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCTION-BODY $1)", _profile_name_11_count, _profile_name_11_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CAST $2 $4)", _profile_name_99_count, _profile_name_99_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_12_count, _profile_name_12_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(external-declaration $1 (list (null-declarator)))", _profile_name_13_count, _profile_name_13_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(external-declaration $1 $2)", _profile_name_14_count, _profile_name_14_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(declaration $1 '())", _profile_name_16_count, _profile_name_16_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(declaration $1 $2)", _profile_name_17_count, _profile_name_17_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_18_count, _profile_name_18_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 $4)", _profile_name_190_count, _profile_name_190_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_19_count, _profile_name_19_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 $4)", _profile_name_191_count, _profile_name_191_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 '())", _profile_name_192_count, _profile_name_192_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_193_count, _profile_name_193_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_194_count, _profile_name_194_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enumerator $1 #f)", _profile_name_196_count, _profile_name_196_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enumerator $1 $3)", _profile_name_197_count, _profile_name_197_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_230_count, _profile_name_230_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_198_count, _profile_name_198_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(array-declarator $2)", _profile_name_231_count, _profile_name_231_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SUB $1 $3)", _profile_name_111_count, _profile_name_111_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $2 $1)", _profile_name_199_count, _profile_name_199_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(array-declarator $3)", _profile_name_232_count, _profile_name_232_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_112_count, _profile_name_112_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $1)", _profile_name_233_count, _profile_name_233_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $1)", _profile_name_234_count, _profile_name_234_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SHIFT-LEFT $1 $3)", _profile_name_114_count, _profile_name_114_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $3) $1)", _profile_name_235_count, _profile_name_235_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $4) $1)", _profile_name_236_count, _profile_name_236_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SHIFT-RIGHT $1 $3)", _profile_name_116_count, _profile_name_116_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-declarator '())", _profile_name_237_count, _profile_name_237_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_117_count, _profile_name_117_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_238_count, _profile_name_238_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (func-declarator '()))", _profile_name_239_count, _profile_name_239_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LT $1 $3)", _profile_name_119_count, _profile_name_119_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_20_count, _profile_name_20_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_21_count, _profile_name_21_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST (compose-variable-attribute $1))", _profile_name_22_count, _profile_name_22_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 (compose-variable-attribute $3))", _profile_name_23_count, _profile_name_23_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (init-value-declarator $4))", _profile_name_24_count, _profile_name_24_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_25_count, _profile_name_25_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(TYPEDEF)", _profile_name_27_count, _profile_name_27_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_28_count, _profile_name_28_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_29_count, _profile_name_29_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 $3)", _profile_name_240_count, _profile_name_240_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_241_count, _profile_name_241_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%GT $1 $3)", _profile_name_121_count, _profile_name_121_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_242_count, _profile_name_242_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_243_count, _profile_name_243_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LE $1 $3)", _profile_name_123_count, _profile_name_123_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_244_count, _profile_name_244_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_245_count, _profile_name_245_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_246_count, _profile_name_246_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%GE $1 $3)", _profile_name_125_count, _profile_name_125_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_247_count, _profile_name_247_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_126_count, _profile_name_126_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_248_count, _profile_name_248_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_249_count, _profile_name_249_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%EQ $1 $3)", _profile_name_128_count, _profile_name_128_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_30_count, _profile_name_30_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_31_count, _profile_name_31_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%TYPENAME $1)", _profile_name_32_count, _profile_name_32_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(SIGNED)", _profile_name_34_count, _profile_name_34_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(UNSIGNED)", _profile_name_36_count, _profile_name_36_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_37_count, _profile_name_37_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_38_count, _profile_name_38_time); } #endif void init_parser() { if (!SCM_UNBOUNDP(token_table)) { /* already initialized */ return; } name_347 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SELECTOR"); name_345 = SCM_MAKE_KEYWORD(""); name_340 = SCM_MAKE_STR_IMMUTABLE(":"); name_339 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "map"); name_338 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "string-join"); name_336 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "x->string"); name_334 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%OBJC-MESSAGE-EXPR"); name_330 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%KEYWORD-ARG-WITHOUT-SELECTOR"); name_328 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%KEYWORD-ARG"); name_323 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%QUOTE"); name_320 = SCM_MAKE_STR_IMMUTABLE(""); name_312 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "combine-decl-keyword"); name_310 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-keyword"); name_305 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "var-id"); name_303 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-objc-method"); name_301 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "emit-objc-method"); name_300 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "apply"); name_287 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%RETURN"); name_285 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BREAK"); name_283 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CONTINUE"); name_273 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FOR"); name_271 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DO-WHILE"); name_269 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%WHILE"); name_256 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%COMPOUND-STATEMENT-WITH-DECLARATION"); name_252 = SCM_LIST1(SCM_MAKE_INT(0)); name_195 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-enumerator"); name_187 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-enum"); name_178 = SCM_MAKE_STR_IMMUTABLE("%unnamed"); name_177 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "gensym"); name_174 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "parser-attribute-clear!"); name_166 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-struct-or-union"); name_163 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CONCAT-EXPR"); name_150 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ASSIGN"); name_147 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%IF"); name_144 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LOG-OR"); name_141 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LOG-AND"); name_138 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-OR"); name_135 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-XOR"); name_132 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-AND"); name_129 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%NE"); name_127 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%EQ"); name_124 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%GE"); name_122 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LE"); name_120 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%GT"); name_118 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LT"); name_115 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SHIFT-RIGHT"); name_113 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SHIFT-LEFT"); name_110 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SUB"); name_108 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ADD"); name_105 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MOD"); name_103 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DIV"); name_101 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MUL"); name_98 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CAST"); name_88 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SIZEOF-TYPE"); name_86 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SIZEOF-EXPR"); name_84 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%UNARY"); name_82 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PRE-DEC"); name_80 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PRE-INC"); name_75 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%POST-DEC"); name_73 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%POST-INC"); name_71 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PTR-REF"); name_69 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DOT-REF"); name_66 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FUNCALL"); name_64 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%REF-ARRAY"); name_56 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%COMPOUND-STATEMENT"); name_54 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%EXPR-IN-PARENS"); name_52 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%OBJC-STRING"); name_48 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%IDENTIFIER"); name_46 = SCM_LIST1(SCM_INTERN("id")); name_42 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ENUM-SPECIFIER"); name_40 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%STRUCT-OR-UNION-SPECIFIER"); name_35 = SCM_LIST1(SCM_INTERN("UNSIGNED")); name_33 = SCM_LIST1(SCM_INTERN("SIGNED")); name_26 = SCM_LIST1(SCM_INTERN("TYPEDEF")); name_15 = SCM_NIL; name_10 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FUNCTION-BODY"); name_7 = SCM_LIST1(SCM_INTERN("int")); name_1 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MACRO-BODY"); token_sym_START_MACRO = SCM_INTERN("START_MACRO"); token_sym_OBJC_STRING = SCM_INTERN("OBJC_STRING"); token_sym_AT_REQUIRED = SCM_INTERN("AT_REQUIRED"); token_sym_AT_OPTIONAL = SCM_INTERN("AT_OPTIONAL"); token_sym_AT_DYNAMIC = SCM_INTERN("AT_DYNAMIC"); token_sym_AT_SYNTHESIZE = SCM_INTERN("AT_SYNTHESIZE"); token_sym_AT_PROPERTY = SCM_INTERN("AT_PROPERTY"); token_sym_AT_SYNCHRONIZED = SCM_INTERN("AT_SYNCHRONIZED"); token_sym_AT_FINALLY = SCM_INTERN("AT_FINALLY"); token_sym_AT_CATCH = SCM_INTERN("AT_CATCH"); token_sym_AT_TRY = SCM_INTERN("AT_TRY"); token_sym_AT_THROW = SCM_INTERN("AT_THROW"); token_sym_AT_ALIAS = SCM_INTERN("AT_ALIAS"); token_sym_AT_CLASS = SCM_INTERN("AT_CLASS"); token_sym_AT_PROTOCOL = SCM_INTERN("AT_PROTOCOL"); token_sym_AT_PROTECTED = SCM_INTERN("AT_PROTECTED"); token_sym_AT_PRIVATE = SCM_INTERN("AT_PRIVATE"); token_sym_AT_PUBLIC = SCM_INTERN("AT_PUBLIC"); token_sym_AT_ENCODE = SCM_INTERN("AT_ENCODE"); token_sym_AT_DEFS = SCM_INTERN("AT_DEFS"); token_sym_AT_SELECTOR = SCM_INTERN("AT_SELECTOR"); token_sym_AT_END = SCM_INTERN("AT_END"); token_sym_AT_IMPLEMENTATION = SCM_INTERN("AT_IMPLEMENTATION"); token_sym_AT_INTERFACE = SCM_INTERN("AT_INTERFACE"); token_sym_EXTENSION = SCM_INTERN("EXTENSION"); token_sym_UNKNOWN = SCM_INTERN("UNKNOWN"); token_sym_ASM = SCM_INTERN("ASM"); token_sym_RETURN = SCM_INTERN("RETURN"); token_sym_BREAK = SCM_INTERN("BREAK"); token_sym_CONTINUE = SCM_INTERN("CONTINUE"); token_sym_GOTO = SCM_INTERN("GOTO"); token_sym_FOR = SCM_INTERN("FOR"); token_sym_DO = SCM_INTERN("DO"); token_sym_WHILE = SCM_INTERN("WHILE"); token_sym_SWITCH = SCM_INTERN("SWITCH"); token_sym_ELSE = SCM_INTERN("ELSE"); token_sym_IF = SCM_INTERN("IF"); token_sym_DEFAULT = SCM_INTERN("DEFAULT"); token_sym_CASE = SCM_INTERN("CASE"); token_sym_RANGE = SCM_INTERN("RANGE"); token_sym_ELLIPSIS = SCM_INTERN("ELLIPSIS"); token_sym_ENUM = SCM_INTERN("ENUM"); token_sym_UNION = SCM_INTERN("UNION"); token_sym_STRUCT = SCM_INTERN("STRUCT"); token_sym_VOLATILE = SCM_INTERN("VOLATILE"); token_sym_CONST = SCM_INTERN("CONST"); token_sym_UNSIGNED = SCM_INTERN("UNSIGNED"); token_sym_SIGNED = SCM_INTERN("SIGNED"); token_sym_RESTRICT = SCM_INTERN("RESTRICT"); token_sym_INLINE = SCM_INTERN("INLINE"); token_sym_REGISTER = SCM_INTERN("REGISTER"); token_sym_AUTO = SCM_INTERN("AUTO"); token_sym_STATIC = SCM_INTERN("STATIC"); token_sym_EXTERN = SCM_INTERN("EXTERN"); token_sym_TYPEDEF = SCM_INTERN("TYPEDEF"); token_sym_TYPENAME = SCM_INTERN("TYPENAME"); token_sym_OR_ASSIGN = SCM_INTERN("OR_ASSIGN"); token_sym_XOR_ASSIGN = SCM_INTERN("XOR_ASSIGN"); token_sym_AND_ASSIGN = SCM_INTERN("AND_ASSIGN"); token_sym_RIGHT_ASSIGN = SCM_INTERN("RIGHT_ASSIGN"); token_sym_LEFT_ASSIGN = SCM_INTERN("LEFT_ASSIGN"); token_sym_SUB_ASSIGN = SCM_INTERN("SUB_ASSIGN"); token_sym_ADD_ASSIGN = SCM_INTERN("ADD_ASSIGN"); token_sym_MOD_ASSIGN = SCM_INTERN("MOD_ASSIGN"); token_sym_DIV_ASSIGN = SCM_INTERN("DIV_ASSIGN"); token_sym_MUL_ASSIGN = SCM_INTERN("MUL_ASSIGN"); token_sym_OR_OP = SCM_INTERN("OR_OP"); token_sym_AND_OP = SCM_INTERN("AND_OP"); token_sym_NE_OP = SCM_INTERN("NE_OP"); token_sym_EQ_OP = SCM_INTERN("EQ_OP"); token_sym_GE_OP = SCM_INTERN("GE_OP"); token_sym_LE_OP = SCM_INTERN("LE_OP"); token_sym_RIGHT_OP = SCM_INTERN("RIGHT_OP"); token_sym_LEFT_OP = SCM_INTERN("LEFT_OP"); token_sym_DEC_OP = SCM_INTERN("DEC_OP"); token_sym_INC_OP = SCM_INTERN("INC_OP"); token_sym_PTR_OP = SCM_INTERN("PTR_OP"); token_sym_SIZEOF = SCM_INTERN("SIZEOF"); token_sym_STRING = SCM_INTERN("STRING"); token_sym_CONSTANT = SCM_INTERN("CONSTANT"); token_sym_IDENTIFIER = SCM_INTERN("IDENTIFIER"); token_sym__GT = SCM_INTERN(">"); token_sym__LT = SCM_INTERN("<"); token_sym_P = SCM_INTERN("?"); token_sym__3d = SCM_INTERN("="); token_sym__25 = SCM_INTERN("%"); token_sym__26 = SCM_INTERN("&"); token_sym__5e = SCM_INTERN("^"); token_sym__2f = SCM_INTERN("/"); token_sym__2a = SCM_INTERN("*"); token_sym__ = SCM_INTERN("-"); token_sym__2b = SCM_INTERN("+"); token_sym_X = SCM_INTERN("!"); token_sym__7e = SCM_INTERN("~"); token_sym_COLON = SCM_INTERN("COLON"); token_sym_DOT = SCM_INTERN("DOT"); token_sym_OR = SCM_INTERN("OR"); token_sym_RPAREN = SCM_INTERN("RPAREN"); token_sym_LPAREN = SCM_INTERN("LPAREN"); token_sym_RSBRA = SCM_INTERN("RSBRA"); token_sym_LSBRA = SCM_INTERN("LSBRA"); token_sym_RCBRA = SCM_INTERN("RCBRA"); token_sym_LCBRA = SCM_INTERN("LCBRA"); token_sym_COMMA = SCM_INTERN("COMMA"); token_sym_SEMICOLON = SCM_INTERN("SEMICOLON"); token_table = Scm_MakeHashTableSimple(SCM_HASH_EQ, 105); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_START_MACRO, SCM_MAKE_INT(START_MACRO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OBJC_STRING, SCM_MAKE_INT(OBJC_STRING), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_REQUIRED, SCM_MAKE_INT(AT_REQUIRED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_OPTIONAL, SCM_MAKE_INT(AT_OPTIONAL), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_DYNAMIC, SCM_MAKE_INT(AT_DYNAMIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SYNTHESIZE, SCM_MAKE_INT(AT_SYNTHESIZE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROPERTY, SCM_MAKE_INT(AT_PROPERTY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SYNCHRONIZED, SCM_MAKE_INT(AT_SYNCHRONIZED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_FINALLY, SCM_MAKE_INT(AT_FINALLY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_CATCH, SCM_MAKE_INT(AT_CATCH), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_TRY, SCM_MAKE_INT(AT_TRY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_THROW, SCM_MAKE_INT(AT_THROW), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_ALIAS, SCM_MAKE_INT(AT_ALIAS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_CLASS, SCM_MAKE_INT(AT_CLASS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROTOCOL, SCM_MAKE_INT(AT_PROTOCOL), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROTECTED, SCM_MAKE_INT(AT_PROTECTED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PRIVATE, SCM_MAKE_INT(AT_PRIVATE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PUBLIC, SCM_MAKE_INT(AT_PUBLIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_ENCODE, SCM_MAKE_INT(AT_ENCODE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_DEFS, SCM_MAKE_INT(AT_DEFS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SELECTOR, SCM_MAKE_INT(AT_SELECTOR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_END, SCM_MAKE_INT(AT_END), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_IMPLEMENTATION, SCM_MAKE_INT(AT_IMPLEMENTATION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_INTERFACE, SCM_MAKE_INT(AT_INTERFACE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EXTENSION, SCM_MAKE_INT(EXTENSION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNKNOWN, SCM_MAKE_INT(UNKNOWN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ASM, SCM_MAKE_INT(ASM), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RETURN, SCM_MAKE_INT(RETURN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_BREAK, SCM_MAKE_INT(BREAK), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONTINUE, SCM_MAKE_INT(CONTINUE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_GOTO, SCM_MAKE_INT(GOTO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_FOR, SCM_MAKE_INT(FOR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DO, SCM_MAKE_INT(DO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_WHILE, SCM_MAKE_INT(WHILE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SWITCH, SCM_MAKE_INT(SWITCH), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ELSE, SCM_MAKE_INT(ELSE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_IF, SCM_MAKE_INT(IF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DEFAULT, SCM_MAKE_INT(DEFAULT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CASE, SCM_MAKE_INT(CASE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RANGE, SCM_MAKE_INT(RANGE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ELLIPSIS, SCM_MAKE_INT(ELLIPSIS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ENUM, SCM_MAKE_INT(ENUM), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNION, SCM_MAKE_INT(UNION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STRUCT, SCM_MAKE_INT(STRUCT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_VOLATILE, SCM_MAKE_INT(VOLATILE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONST, SCM_MAKE_INT(CONST), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNSIGNED, SCM_MAKE_INT(UNSIGNED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SIGNED, SCM_MAKE_INT(SIGNED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RESTRICT, SCM_MAKE_INT(RESTRICT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_INLINE, SCM_MAKE_INT(INLINE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_REGISTER, SCM_MAKE_INT(REGISTER), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AUTO, SCM_MAKE_INT(AUTO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STATIC, SCM_MAKE_INT(STATIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EXTERN, SCM_MAKE_INT(EXTERN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_TYPEDEF, SCM_MAKE_INT(TYPEDEF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_TYPENAME, SCM_MAKE_INT(TYPENAME), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR_ASSIGN, SCM_MAKE_INT(OR_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_XOR_ASSIGN, SCM_MAKE_INT(XOR_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AND_ASSIGN, SCM_MAKE_INT(AND_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RIGHT_ASSIGN, SCM_MAKE_INT(RIGHT_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LEFT_ASSIGN, SCM_MAKE_INT(LEFT_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SUB_ASSIGN, SCM_MAKE_INT(SUB_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ADD_ASSIGN, SCM_MAKE_INT(ADD_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_MOD_ASSIGN, SCM_MAKE_INT(MOD_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DIV_ASSIGN, SCM_MAKE_INT(DIV_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_MUL_ASSIGN, SCM_MAKE_INT(MUL_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR_OP, SCM_MAKE_INT(OR_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AND_OP, SCM_MAKE_INT(AND_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_NE_OP, SCM_MAKE_INT(NE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EQ_OP, SCM_MAKE_INT(EQ_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_GE_OP, SCM_MAKE_INT(GE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LE_OP, SCM_MAKE_INT(LE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RIGHT_OP, SCM_MAKE_INT(RIGHT_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LEFT_OP, SCM_MAKE_INT(LEFT_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DEC_OP, SCM_MAKE_INT(DEC_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_INC_OP, SCM_MAKE_INT(INC_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_PTR_OP, SCM_MAKE_INT(PTR_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SIZEOF, SCM_MAKE_INT(SIZEOF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STRING, SCM_MAKE_INT(STRING), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONSTANT, SCM_MAKE_INT(CONSTANT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_IDENTIFIER, SCM_MAKE_INT(IDENTIFIER), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__GT, SCM_MAKE_INT(_GT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__LT, SCM_MAKE_INT(_LT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_P, SCM_MAKE_INT(P), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__3d, SCM_MAKE_INT(_3d), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__25, SCM_MAKE_INT(_25), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__26, SCM_MAKE_INT(_26), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__5e, SCM_MAKE_INT(_5e), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2f, SCM_MAKE_INT(_2f), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2a, SCM_MAKE_INT(_2a), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__, SCM_MAKE_INT(_), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2b, SCM_MAKE_INT(_2b), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_X, SCM_MAKE_INT(X), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__7e, SCM_MAKE_INT(_7e), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_COLON, SCM_MAKE_INT(COLON), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DOT, SCM_MAKE_INT(DOT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR, SCM_MAKE_INT(OR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RPAREN, SCM_MAKE_INT(RPAREN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LPAREN, SCM_MAKE_INT(LPAREN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RSBRA, SCM_MAKE_INT(RSBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LSBRA, SCM_MAKE_INT(LSBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RCBRA, SCM_MAKE_INT(RCBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LCBRA, SCM_MAKE_INT(LCBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_COMMA, SCM_MAKE_INT(COMMA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SEMICOLON, SCM_MAKE_INT(SEMICOLON), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), SCM_INTERN("*eoi*"), SCM_MAKE_INT(0), 0); } gauche-c-wrapper-0.6.1.orig/src/c-lex.c0000644000000000000000000012436011237307542014452 0ustar /** * c-lex.c * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: $ */ #include "c-lex.h" static ScmObj attribute_list = SCM_NIL; static ScmObj input_port = SCM_FALSE; static int is_force_identifier; static int is_start_macro; static int line_number; static int line_position; static const char first_line_buffer[] = {'\0'}; static const char *line_buffer; static ScmObj current_filename; static ScmObj last_token; static ScmObj c_keyword_table; static ScmObj c_operator_table; static ScmObj type_table; static ScmObj typename_list; typedef enum { RADIX_OCTAL, RADIX_DECIMAL, RADIX_HEXADECIMAL, } RadixMode; DEFINE_SYM(U_identifier); DEFINE_SYM(U_attribute); DEFINE_SYM(int); DEFINE_SYM(long); DEFINE_SYM(double); DEFINE_SYM(char); DEFINE_SYM(short); DEFINE_SYM(float); DEFINE_SYM(U_typename); DEFINE_SYM(U_struct); DEFINE_SYM(U_union); DEFINE_SYM(U_at_interface); DEFINE_SYM(eoi); DEFINE_SYM(U_constant); DEFINE_SYM(U_ellipsis); DEFINE_SYM(U_unknown); DEFINE_SYM(U_dot); DEFINE_SYM(U_string); DEFINE_SYM(U_objc_string); DEFINE_SYM(U_comma); DEFINE_SYM(U_colon); DEFINE_SYM(U_semicolon); DEFINE_SYM(U_lparen); DEFINE_SYM(U_rparen); DEFINE_SYM(U_lcbra); DEFINE_SYM(U_rcbra); DEFINE_SYM(U_lsbra); DEFINE_SYM(U_rsbra); DEFINE_SYM(U_or_op); DEFINE_SYM(U_or_assign); DEFINE_SYM(U_or); DEFINE_SYM(U_start_macro); DEFINE_PROC0(parse_attribute, "c-wrapper.c-lex", "parse-attribute"); DEFINE_PROC2(enqueue_macro, "c-wrapper.c-lex", "enqueue-macro!"); static inline ScmObj warning(ScmObj fmt, ScmObj arg_list) { static ScmObj _warning = SCM_UNBOUND; if (SCM_UNBOUNDP(_warning)) { _warning = SCM_SYMBOL_VALUE("c-wrapper.c-lex", "warning"); } SCM_RETURN(Scm_ApplyRec(_warning, arg_list)); } ScmObj Scm_ParserAttributeClear() { attribute_list = SCM_NIL; } ScmObj Scm_ParserAttributeRef() { SCM_RETURN(attribute_list); } ScmObj Scm_ParserAttributeAdd(ScmObj attr) { attribute_list = Scm_Append2(attribute_list, attr); SCM_RETURN(SCM_UNDEFINED); } static void init_c_keyword_table() { const char *tbl[][2] = { {"auto", "AUTO"}, {"break", "BREAK"}, {"case", "CASE"}, {"const", "CONST"}, {"__const", "CONST"}, {"continue", "CONTINUE"}, {"default", "DEFAULT"}, {"do", "DO"}, {"else", "ELSE"}, {"enum", "ENUM"}, {"extern", "EXTERN"}, {"for", "FOR"}, {"goto", "GOTO"}, {"if", "IF"}, {"register", "REGISTER"}, {"return", "RETURN"}, {"signed", "SIGNED"}, {"__signed", "SIGNED"}, {"sizeof", "SIZEOF"}, {"static", "STATIC"}, {"struct", "STRUCT"}, {"switch", "SWITCH"}, {"typedef", "TYPEDEF"}, {"union", "UNION"}, {"unsigned", "UNSIGNED"}, {"__unsigned", "UNSIGNED"}, {"volatile", "VOLATILE"}, {"__volatile", "VOLATILE"}, {"__volatile__", "VOLATILE"}, {"while", "WHILE"}, {"inline", "INLINE"}, {"__inline", "INLINE"}, {"__inline__", "INLINE"}, {"asm", "ASM"}, {"__asm", "ASM"}, {"__asm__", "ASM"}, {"__restrict", "RESTRICT"}, {"__restrict__", "RESTRICT"}, {"__extension__", "EXTENSION"}, {"__attribute__", "ATTRIBUTE"}, {"@interface", "AT_INTERFACE"}, {"@implementation", "AT_IMPLEMENTATION"}, {"@end", "AT_END"}, {"@selector", "AT_SELECTOR"}, {"@defs", "AT_DEFS"}, {"@encode", "AT_ENCODE"}, {"@public", "AT_PUBLIC"}, {"@private", "AT_PRIVATE"}, {"@protected", "AT_PROTECTED"}, {"@protocol", "AT_PROTOCOL"}, {"@class", "AT_CLASS"}, {"@compatibility_alias", "AT_ALIAS"}, {"@throw", "AT_THROW"}, {"@try", "AT_TRY"}, {"@catch", "AT_CATCH"}, {"@finally", "AT_FINALLY"}, {"@synchronized", "AT_SYNCHRONIZED"}, {"@property", "AT_PROPERTY"}, {"@synthesize", "AT_SYNTHESIZE"}, {"@dynamic", "AT_DYNAMIC"}, {"@optional", "AT_OPTIONAL"}, {"@required", "AT_REQUIRED"}, {NULL, NULL}, }; int i; c_keyword_table = Scm_MakeHashTableSimple(SCM_HASH_EQ, 0); for (i = 0; tbl[i][0] != NULL; ++i) { Scm_HashTableSet(SCM_HASH_TABLE(c_keyword_table), SCM_INTERN(tbl[i][0]), SCM_INTERN(tbl[i][1]), 0); } } static void init_c_operator_table() { c_operator_table = Scm_MakeHashTableSimple(SCM_HASH_STRING, 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("auto"), SCM_INTERN("AUTO"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE(">>="), SCM_INTERN("RIGHT_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("<<="), SCM_INTERN("LEFT_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("+="), SCM_INTERN("ADD_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("-="), SCM_INTERN("SUB_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("*="), SCM_INTERN("MUL_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("/="), SCM_INTERN("DIV_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("%="), SCM_INTERN("MOD_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("&="), SCM_INTERN("AND_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("^="), SCM_INTERN("XOR_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("|="), SCM_INTERN("OR_ASSIGN"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE(">>"), SCM_INTERN("RIGHT_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("<<"), SCM_INTERN("LEFT_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE(">"), SCM_INTERN(">"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("<"), SCM_INTERN("<"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("++"), SCM_INTERN("INC_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("--"), SCM_INTERN("DEC_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("->"), SCM_INTERN("PTR_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("&&"), SCM_INTERN("AND_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("||"), SCM_INTERN("OR_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("<="), SCM_INTERN("LE_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE(">="), SCM_INTERN("GE_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("=="), SCM_INTERN("EQ_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("!="), SCM_INTERN("NE_OP"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("*"), SCM_INTERN("*"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("/"), SCM_INTERN("/"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("+"), SCM_INTERN("+"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("-"), SCM_INTERN("-"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("%"), SCM_INTERN("%"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("&"), SCM_INTERN("&"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("|"), SCM_INTERN("OR") , 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("^"), SCM_INTERN("^"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("="), SCM_INTERN("="), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("?"), SCM_INTERN("?"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("!"), SCM_INTERN("!"), 0); Scm_HashTableSet(SCM_HASH_TABLE(c_operator_table), SCM_MAKE_STR_IMMUTABLE("~"), SCM_INTERN("~"), 0); } static void init_type_table() { const char *types[] = { "__builtin_va_list", "char", "short", "int", "long", "float", "double", "void", "_Bool", NULL, }; int i; type_table = Scm_MakeHashTableSimple(SCM_HASH_EQ, 0); for (i = 0; types[i] != NULL; ++i) { Scm_HashTableSet(SCM_HASH_TABLE(type_table), SCM_INTERN(types[i]), SCM_TRUE, 0); } } static int is_type(ScmObj sym) { SCM_RETURN(SCM_BOOL_VALUE(Scm_HashTableRef(SCM_HASH_TABLE(type_table), sym, SCM_FALSE))); } static void install_type(ScmObj sym) { Scm_HashTableSet(SCM_HASH_TABLE(type_table), sym, SCM_TRUE, 0); } ScmObj Scm_InitTypeTable() { init_type_table(); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_InstallType(ScmObj sym) { install_type(sym); SCM_RETURN(SCM_UNDEFINED); } static void buffer_eof() { line_buffer = NULL; } static inline int buffer_eof_p() { return (line_buffer == NULL); } static void buffer_read_line() { ScmObj line_str; if (SCM_FALSEP(input_port)) { buffer_eof(); return; } line_str = Scm_ReadLineUnsafe(SCM_PORT(input_port)); if (SCM_EOFP(line_str)) { input_port = SCM_FALSE; buffer_eof(); return; } line_buffer = Scm_GetStringConst(SCM_STRING(line_str)); line_position = 0; ++line_number; } static inline void buffer_next_char() { if (line_buffer[line_position] == '\0') { buffer_read_line(); } else { ++line_position; } } static inline int buffer_peek_char() { int c; if (buffer_eof_p()) { return -1; } c = ((unsigned char) line_buffer[line_position]); if (c == '\0') { return '\n'; } else { return c; } } static inline int buffer_read_char() { int c = buffer_peek_char(); if (c != -1) { buffer_next_char(); } return c; } ScmObj Scm_BufferReadChar() { int c = buffer_read_char(); if (c == -1) { SCM_RETURN(SCM_EOF); } else { SCM_RETURN(SCM_MAKE_CHAR(c)); } } ScmObj Scm_BufferPeekChar() { int c = buffer_peek_char(); if (c == -1) { SCM_RETURN(SCM_EOF); } else { SCM_RETURN(SCM_MAKE_CHAR(c)); } } ScmObj Scm_BufferNextChar() { buffer_next_char(); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_SetInputPort(ScmObj port) { if ((!SCM_PORTP(port))) { Scm_Error(" required, but got %S", port); } input_port = port; line_buffer = first_line_buffer; line_number = 0; line_position = 0; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_FreeInputPort() { if (SCM_PORTP(input_port)) { input_port = SCM_FALSE; } buffer_eof(); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_SetInputString(ScmString *str) { input_port = SCM_FALSE; line_buffer = Scm_GetStringConst(str); line_position = 0; SCM_RETURN(SCM_UNDEFINED); } static inline ScmObj get_keyword_val(ScmObj sym) { SCM_RETURN(Scm_HashTableRef(SCM_HASH_TABLE(c_keyword_table), sym, SCM_FALSE)); } static inline ScmObj get_operator_val(ScmObj str) { SCM_RETURN(Scm_HashTableRef(SCM_HASH_TABLE(c_operator_table), str, SCM_FALSE)); } ScmObj Scm_GetKeywordVal(ScmObj sym) { SCM_RETURN(get_keyword_val(sym)); } ScmObj Scm_GetOperatorVal(ScmObj sym) { SCM_RETURN(get_operator_val(SCM_OBJ(SCM_SYMBOL_NAME(sym)))); } ScmObj Scm_LineNumberRef() { SCM_RETURN(SCM_MAKE_INT(line_number)); } ScmObj Scm_LineNumberSet(int num) { line_number = num; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_FilenameRef() { SCM_RETURN(current_filename); } ScmObj Scm_FilenameSet(ScmObj filename) { current_filename = filename; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_CurrentLineRef() { if (line_buffer == NULL) { SCM_RETURN(SCM_FALSE); } else { SCM_RETURN(SCM_MAKE_STR_COPYING((char*) line_buffer)); } } ScmObj Scm_LastTokenRef() { SCM_RETURN(last_token); } ScmObj Scm_LastTokenSet(ScmObj token) { last_token = token; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_IsForceIdentifierRef() { SCM_RETURN(SCM_MAKE_BOOL(is_force_identifier)); } ScmObj Scm_IsForceIdentifierSet(ScmObj v) { is_force_identifier = SCM_BOOL_VALUE(v); SCM_RETURN(SCM_UNDEFINED); } /* bit 0: initial identifier char bit 1: identifier char bit 2: operator char */ static unsigned char ctypes[] = { /* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ! " # $ % & ' ( ) * + , - . / */ 0, 4, 0, 0, 3, 4, 4, 0, 0, 0, 4, 4, 0, 4, 0, 4, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 4, 4, 4, 4, /* @ A B C D E F G H I J K L M N O */ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* P Q R S T U V W X Y Z [ \ ] ^ _ */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 4, 3, /* ` a b c d e f g h i j k l m n o */ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* p q r s t u v w x y z { | } ~ del*/ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 4, 0, }; static inline int is_initial_identifier_char(int c) { return (0 <= c && c < 128 && (ctypes[(unsigned char)c]&1)); } static inline int is_identifier_char(int c) { return (0 <= c && c < 128 && (ctypes[(unsigned char)c]&2)); } static inline int is_operator_char(int c) { return (0 <= c && c < 128 && (ctypes[(unsigned char)c]&4)); } static inline int is_hex_digit_char(int c) { return isxdigit(c); } static inline int is_octal_digit_char(int c) { return ('0' <= c && c <= '7'); } ScmObj Scm_CharHexDigit(ScmObj c) { if (!SCM_CHARP(c)) { Scm_Error(" required, but got %S", c); } SCM_RETURN(SCM_MAKE_BOOL(is_hex_digit_char(SCM_CHAR_VALUE(c)))); } ScmObj Scm_CharOctalDigit(ScmObj c) { if (!SCM_CHARP(c)) { Scm_Error(" required, but got %S", c); } SCM_RETURN(SCM_MAKE_BOOL(is_octal_digit_char(SCM_CHAR_VALUE(c)))); } static void skip_spaces() { int c = buffer_peek_char(); while ((c != -1) && isspace(c)) { buffer_next_char(); c = buffer_peek_char(); } } static void skip_line() { buffer_read_line(); } ScmObj Scm_SkipSpaces() { skip_spaces(); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_SkipLine() { skip_line(); SCM_RETURN(SCM_UNDEFINED); } static ScmObj read_identifier(ScmDString *dstr) { int c; ScmObj sym; ScmObj k; c = buffer_peek_char(); while (is_identifier_char(c)) { buffer_next_char(); Scm_DStringPutb(dstr, (char) c); c = buffer_peek_char(); } sym = SCM_INTERN(Scm_DStringGetz(dstr)); if (is_force_identifier) { SCM_RETURN(Scm_Cons(SYM(U_identifier), sym)); } k = get_keyword_val(sym); if (!SCM_FALSEP(k)) { if (SCM_EQ(SYM(U_attribute), k)) { SCM_RETURN(parse_attribute()); } else { SCM_RETURN(k); } } else if (!SCM_FALSEP(Scm_Memq(sym, typename_list))) { SCM_RETURN(Scm_Cons(SYM(U_typename), sym)); } else if (SCM_PAIRP(last_token) && SCM_EQ(SCM_CAR(last_token), SYM(U_typename))) { SCM_RETURN(Scm_Cons(SYM(U_identifier), sym)); } else if (SCM_EQ(last_token, SYM(U_struct)) || SCM_EQ(last_token, SYM(U_union))) { SCM_RETURN(Scm_Cons(SYM(U_identifier), sym)); } else if (SCM_EQ(last_token, SYM(U_at_interface))) { install_type(sym); SCM_RETURN(Scm_Cons(SYM(U_identifier), sym)); } else if (is_type(sym)) { SCM_RETURN(Scm_Cons(SYM(U_typename), sym)); } else { SCM_RETURN(Scm_Cons(SYM(U_identifier), sym)); } } ScmObj Scm_ReadIdentifier(ScmObj l) { ScmDString ds; if ((!SCM_LISTP(l)) || SCM_NULLP(l)) { Scm_Error(" required, but got %S", l); } Scm_DStringInit(&ds); Scm_DStringPutb(&ds, (char) SCM_CHAR_VALUE(SCM_CAR(l))); SCM_RETURN(read_identifier(&ds)); } static ScmObj read_operator(ScmDString *dstr) { int c; ScmObj candidate; ScmObj k; candidate = get_operator_val(Scm_DStringGet(dstr, 0)); c = buffer_peek_char(); Scm_DStringPutb(dstr, (char) c); k = get_operator_val(Scm_DStringGet(dstr, 0)); while (!SCM_FALSEP(k)) { candidate = k; buffer_next_char(); c = buffer_peek_char(); Scm_DStringPutb(dstr, (char) c); k = get_operator_val(Scm_DStringGet(dstr, 0)); } SCM_RETURN(candidate); } ScmObj Scm_ReadOperator(ScmObj c) { ScmDString ds; if ((!SCM_CHARP(c))) { Scm_Error(" required, but got %S", c); } Scm_DStringInit(&ds); Scm_DStringPutb(&ds, (char) SCM_CHAR_VALUE(c)); SCM_RETURN(read_operator(&ds)); } static int hexchar2integer(int c) { static int vals[] = { /* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* ! " # $ % & ' ( ) * + , - . / */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /* @ A B C D E F G H I J K L M N O */ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* P Q R S T U V W X Y Z [ \ ] ^ _ */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* ` a b c d e f g h i j k l m n o */ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* p q r s t u v w x y z { | } ~ del*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; int v = -1; if (0 <= c && c <= 0x7f) { v = vals[c]; } if (0 <= v) { return v; } else { Scm_Error("%S can not be hexchar, there must be a bug in lexer", SCM_MAKE_CHAR(c)); } } static inline int readn(int n, int v0) { int c = buffer_peek_char(); int v = v0; int i; for (i = 0; (i < n) && is_octal_digit_char(c); ++i) { buffer_next_char(); v = v*8 + hexchar2integer(c); c = buffer_peek_char(); } return v; } static inline int readx() { int c = buffer_peek_char(); int v = 0; while (is_hex_digit_char(c)) { buffer_next_char(); v = v*16 + hexchar2integer(c); c = buffer_peek_char(); } return v; } static inline int range_check(int v) { /* CARM: Sec 2.9, p41 */ return (v == 0x24) || (v == 0x40) || (v == 0x60) || !(v < 0xa0) || ((0xd800 <= v) && (v <= 0xdfff)); } static inline int readu() { int c = buffer_peek_char(); int n = 0; int v = 0; while (is_hex_digit_char(c)) { buffer_next_char(); ++n; v = v*16 + hexchar2integer(c); c = buffer_peek_char(); } if ((n != 4) && (n != 8)) { Scm_Error("Universal character name must be 4 or 8 hex-digit"); } if (!range_check(v)) { Scm_Error("\\u%04x is not a valid universal character", v); } return v; } static inline int backslash(int c) { int c1; if (c == '\\') { c = buffer_read_char(); switch (c) { case 'n': return '\n'; case 'x': c1 = buffer_peek_char(); if (is_hex_digit_char(c1)) { return readx(c1); } else { Scm_Error("\\x must be followed by hex-digit, but got '%c'", c1); } case 't': return '\t'; case 'u': case 'U': c1 = buffer_peek_char(); if (is_hex_digit_char(c1)) { return c1; } else { Scm_Error("\\u must be followed by hex-digit, but got '%c'", c1); } case '0':; case '1':; case '2':; case '3':; case '4':; case '5':; case '6':; case '7': return readn(3, hexchar2integer(c)); case '\'':; case '"':; case '\\': return c; case 'p': /* TODO: pascal string */ return c; case 'a': /* BEL */ return 0x07; case 'b': /* BS */ return 0x08; case 'v': /* VT */ return 0x0b; case 'f': /* NP */ return 0x0c; case 'r': /* CR */ return 0x0d; default: if ('a' <= c && c <= 'z') { warning(SCM_MAKE_STR_IMMUTABLE("Unknown lower case escape character is used: ~a"), SCM_LIST1(SCM_MAKE_CHAR(c))); return c; } else if ('A' <= c && c <= 'Z') { warning(SCM_MAKE_STR_IMMUTABLE("No upper case escape character is defined: ~a"), SCM_LIST1(SCM_MAKE_CHAR(c))); return c; } else { return buffer_read_char(c); } } } else { return c; } } static ScmObj read_string_literal() { int c; ScmDString ds; Scm_DStringInit(&ds); c = buffer_read_char(); while (c != '"') { int cc; if (c == -1) { Scm_Error("missing double quote"); } cc = backslash(c); assert(cc >= 0); do { SCM_DSTRING_PUTB(&ds, cc % 256); cc >>= 8; } while (cc != 0); c = buffer_read_char(); } SCM_RETURN(Scm_DStringGet(&ds, 0)); } static ScmObj read_character_constant() { int c; long v = 0; ScmDString ds; Scm_DStringInit(&ds); c = buffer_read_char(); while (c != '\'') { int cc; if (c == -1) { Scm_Error("missing quote"); } cc = backslash(c); assert(cc >= 0); /* Meaning of Multicharacter constant is implementation dependent. Here we implement a convention with left-to-right packing, which is described in CARM pp. 31--32. */ do { v = v * 256 + (cc % 256); cc >>= 8; } while (cc != 0); c = buffer_read_char(); } SCM_RETURN(Scm_MakeInteger(v)); } ScmObj Scm_ReadStringLiteral() { SCM_RETURN(read_string_literal()); } ScmObj Scm_ReadCharacterConstant() { SCM_RETURN(read_character_constant()); } static inline ScmObj rl2n_octal(ScmDString *dstr) { const char *str = Scm_DStringGetz(dstr); char *endptr = NULL; long long v; int i; for (i = 0; str[i] != '\0'; ++i) { if (! ('0' <= str[i] && str[i] <= '7')) { Scm_Error("invalid char '%c' in octal", str[i]); } } v = strtoll(str, &endptr, 0); SCM_RETURN(Scm_MakeInteger64(v)); } static inline ScmObj rl2n_flonum(ScmDString *dstr) { const char *str = Scm_DStringGetz(dstr); char *endptr = NULL; double v; v = strtod(str, &endptr); SCM_RETURN(Scm_MakeFlonum(v)); } static inline ScmObj rl2n(ScmDString *dstr) { const char *str = Scm_DStringGetz(dstr); char *endptr = NULL; long long v; v = strtoll(str, &endptr, 0); SCM_RETURN(Scm_MakeInteger64(v)); } static void skip_integer_suffix_char() { int c = buffer_peek_char(); while (c == 'u' || c == 'U' || c == 'l' || c == 'L') { buffer_next_char(); c = buffer_peek_char(); } } static ScmObj read_expnum(ScmDString *dstr, RadixMode mode) { int c = buffer_peek_char(); if (! (isdigit(c) || (c == '+') || (c == '-'))) { Scm_Error("malformed floating point expression"); } SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); while (1) { c = buffer_peek_char(); if (((mode == RADIX_DECIMAL) && isdigit(c)) || ((mode == RADIX_HEXADECIMAL) && isxdigit(c))) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); continue; } switch (c) { case 'f': case 'F': buffer_next_char(); SCM_RETURN(rl2n_flonum(dstr)); case 'l': case 'L': buffer_next_char(); SCM_RETURN(rl2n_flonum(dstr)); default: SCM_RETURN(rl2n_flonum(dstr)); } } } static ScmObj read_flonum(ScmDString *dstr, RadixMode mode) { int c; while (1) { c = buffer_peek_char(); if (((mode == RADIX_DECIMAL) && isdigit(c)) || ((mode == RADIX_HEXADECIMAL) && isxdigit(c))) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); continue; } if (((mode == RADIX_DECIMAL) && (c == 'e' || c == 'E')) || ((mode == RADIX_HEXADECIMAL) && (c == 'p' || c == 'P'))) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); SCM_RETURN(read_expnum(dstr, mode)); } switch (c) { case 'f': case 'F': buffer_next_char(); SCM_RETURN(rl2n_flonum(dstr)); case 'l': case 'L': if (mode == RADIX_HEXADECIMAL) { Scm_Error("hexadecimal floating constants require an exponent"); } buffer_next_char(); SCM_RETURN(rl2n_flonum(dstr)); default: if (mode == RADIX_HEXADECIMAL) { Scm_Error("hexadecimal floating constants require an exponent"); } SCM_RETURN(rl2n_flonum(dstr)); } } } static ScmObj read_octal_or_flonum(ScmDString *dstr) { int c; while (1) { c = buffer_peek_char(); if (isdigit(c)) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); continue; } switch (c) { case '.': SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); SCM_RETURN(read_flonum(dstr, RADIX_DECIMAL)); case 'e': case 'E': SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); SCM_RETURN(read_expnum(dstr, RADIX_DECIMAL)); case 'U':; case 'u':; case 'L':; case 'l':; buffer_next_char(); skip_integer_suffix_char(); SCM_RETURN(rl2n_octal(dstr)); default: SCM_RETURN(rl2n_octal(dstr)); } } } static ScmObj read_number_constant(ScmDString *dstr, RadixMode mode) { int c; while (1) { c = buffer_peek_char(); if (((mode == RADIX_DECIMAL) && isdigit(c)) || ((mode == RADIX_HEXADECIMAL) && isxdigit(c))) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); continue; } if (((mode == RADIX_DECIMAL) && (c == 'e' || c == 'E')) || ((mode == RADIX_HEXADECIMAL) && (c == 'p' || c == 'P'))) { SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); SCM_RETURN(read_expnum(dstr, mode)); } switch (c) { case '.': SCM_DSTRING_PUTB(dstr, (char) c); buffer_next_char(); SCM_RETURN(read_flonum(dstr, mode)); case 'U':; case 'u':; case 'L':; case 'l':; buffer_next_char(); skip_integer_suffix_char(); SCM_RETURN(rl2n(dstr)); default: SCM_RETURN(rl2n(dstr)); } } } static ScmObj read_decimal(ScmDString *dstr) { SCM_RETURN(read_number_constant(dstr, RADIX_DECIMAL)); } static ScmObj read_hexadecimal(ScmDString *dstr) { SCM_RETURN(read_number_constant(dstr, RADIX_HEXADECIMAL)); } ScmObj Scm_ReadOctalOrFlonum(ScmObj l) { ScmDString ds; if ((!SCM_LISTP(l)) || SCM_NULLP(l)) { Scm_Error(" required, but got %S", l); } Scm_DStringInit(&ds); Scm_DStringPutb(&ds, (char) SCM_CHAR_VALUE(SCM_CAR(l))); SCM_RETURN(read_octal_or_flonum(&ds)); } ScmObj Scm_ReadDecimal(ScmObj l) { ScmDString ds; if ((!SCM_LISTP(l)) || SCM_NULLP(l)) { Scm_Error(" required, but got %S", l); } Scm_DStringInit(&ds); Scm_DStringPutb(&ds, (char) SCM_CHAR_VALUE(SCM_CAR(l))); SCM_RETURN(read_decimal(&ds)); } ScmObj Scm_ReadHexadecimal(ScmObj l) { ScmDString ds; if ((!SCM_LISTP(l)) || SCM_NULLP(l)) { Scm_Error(" required, but got %S", l); } Scm_DStringInit(&ds); Scm_DStringPutb(&ds, (char) SCM_CHAR_VALUE(SCM_CAR(l))); SCM_RETURN(read_hexadecimal(&ds)); } ScmObj Scm_ReadFlonum(ScmObj l, ScmObj ics, int radix, ScmObj ecs) { ScmDString ds; RadixMode mode; if ((!SCM_LISTP(l)) || SCM_NULLP(l)) { Scm_Error(" required, but got %S", l); } if (radix == 10) { mode = RADIX_DECIMAL; } else if (radix == 16) { mode = RADIX_HEXADECIMAL; } else { Scm_Error("invalid radix: %d", radix); } Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) SCM_CHAR_VALUE(SCM_CAR(l))); SCM_RETURN(read_flonum(&ds, mode)); } static void sc_do_sharp_space() { int c; skip_spaces(); c = buffer_read_char(); if (isdigit(c)) { ScmDString ds; ScmObj num; Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); num = read_decimal(&ds); skip_spaces(); c = buffer_read_char(); if (c == '"') { Scm_FilenameSet(read_string_literal()); Scm_LineNumberSet(Scm_GetInteger(num) - 1); } } skip_line(); } static void sc_do_define() { int c; skip_spaces(); c = buffer_read_char(); if (is_initial_identifier_char(c)) { ScmObj name; ScmObj args; ScmDString ds; is_force_identifier = TRUE; Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); name = SCM_CDR(read_identifier(&ds)); args = SCM_FALSE; if (buffer_peek_char() == '(') { buffer_next_char(); args = SCM_NIL; skip_spaces(); c = buffer_read_char(); while (1) { if (c == ')') { args = Scm_Reverse(args); break; } else if (is_initial_identifier_char(c)) { Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); args = Scm_Cons(SCM_CDR(read_identifier(&ds)), args); skip_spaces(); c = buffer_read_char(); continue; } else if (c == ',') { skip_spaces(); c = buffer_read_char(); continue; } else { goto finish; } } } enqueue_macro(name, args); } finish: is_force_identifier = FALSE; skip_line(); } static void do_sharp_command() { if (buffer_peek_char() == ' ') { buffer_next_char(); sc_do_sharp_space(); } else { int c = buffer_peek_char(); ScmDString ds; const char *str; Scm_DStringInit(&ds); while (isalpha(c)) { SCM_DSTRING_PUTB(&ds, (char) c); buffer_next_char(); c = buffer_peek_char(); } str = Scm_DStringGetz(&ds); if (strcmp("define", str) == 0) { sc_do_define(); } else { skip_line(); } } } ScmObj Scm_DoSharpCommand() { do_sharp_command(); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_StartMacroSet() { is_start_macro = TRUE; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_StartMacroReset() { is_start_macro = FALSE; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_CScan() { int c; ScmObj token = SCM_FALSE; if (is_start_macro) { is_start_macro = FALSE; token = SYM(U_start_macro); } else { skip_spaces(); c = buffer_read_char(); } while (SCM_FALSEP(token)) { if (is_initial_identifier_char(c)) { ScmDString ds; if (c == 'L') { int c0 = buffer_peek_char(); if (c0 == '"') { buffer_next_char(); token = Scm_Cons(SYM(U_string), read_string_literal()); break; } else if (c0 == '\'') { buffer_next_char(); token = Scm_Cons(SYM(U_constant), read_character_constant()); break; } } else if (c == '@' && buffer_peek_char() == '"') { buffer_next_char(); token = Scm_Cons(SYM(U_objc_string), read_string_literal()); break; } Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); token = read_identifier(&ds); } else if (c == '(') { token = SYM(U_lparen); } else if (c == ')') { token = SYM(U_rparen); } else if (is_operator_char(c)) { ScmDString ds; Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); token = read_operator(&ds); } else if (c == ';') { token = SYM(U_semicolon); } else if (c == ',') { token = SYM(U_comma); } else if (c == '#') { do_sharp_command(); skip_spaces(); c = buffer_read_char(); } else if (isdigit(c)) { ScmDString ds; if (c == '0') { int c0 = buffer_peek_char(); ScmDString ds; Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, '0'); if (c0 == 'x' || c0 == 'X') { buffer_next_char(); SCM_DSTRING_PUTB(&ds, 'x'); token = Scm_Cons(SYM(U_constant), read_hexadecimal(&ds)); } else { token = Scm_Cons(SYM(U_constant), read_octal_or_flonum(&ds)); } } else { Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); token = Scm_Cons(SYM(U_constant), read_decimal(&ds)); } } else if (c == '{') { token = SYM(U_lcbra); } else if (c == '}') { token = SYM(U_rcbra); } else if (c == ':') { token = SYM(U_colon); } else if (c == '"') { token = Scm_Cons(SYM(U_string), read_string_literal()); } else if (c == '.') { int c0 = buffer_peek_char(); if (c0 == '.') { buffer_next_char(); if (buffer_peek_char() == '.') { buffer_next_char(); token = SYM(U_ellipsis); } else { token = SYM(U_unknown); } } else if (isdigit(c0)) { ScmDString ds; Scm_DStringInit(&ds); SCM_DSTRING_PUTB(&ds, (char) c); token = Scm_Cons(SYM(U_constant), read_flonum(&ds, RADIX_DECIMAL)); } else { token = SYM(U_dot); } } else if (c == '[') { token = SYM(U_lsbra); } else if (c == ']') { token = SYM(U_rsbra); } else if (c == '|') { int c0 = buffer_peek_char(); if (c0 == '|') { buffer_next_char(); token = SYM(U_or_op); } else if (c0 == '=') { buffer_next_char(); token = SYM(U_or_assign); } else { token = SYM(U_or); } } else if (c == '\'') { token = Scm_Cons(SYM(U_constant), read_character_constant()); } else if (c == '\n') { skip_spaces(); c = buffer_read_char(); } else if (c == -1) { token = SYM(eoi); } else { warning(SCM_MAKE_STR_IMMUTABLE("illegal character: %S"), SCM_LIST1(SCM_MAKE_CHAR(c))); skip_spaces(); c = buffer_read_char(); } } last_token = token; SCM_RETURN(token); } /* * Module initialization function. */ extern void Scm_Init_c_lexlib(ScmModule*); ScmObj Scm_Init_c_lex(void) { ScmModule *mod; /* Register this DSO to Gauche */ SCM_INIT_EXTENSION(c_lex); /* Create the module if it doesn't exist yet. */ mod = SCM_MODULE(SCM_FIND_MODULE(CLEX_MODULE_NAME, TRUE)); /* Register stub-generated procedures */ Scm_Init_c_lexlib(mod); init_c_keyword_table(); init_c_operator_table(); INIT_SYM(U_identifier, "IDENTIFIER"); INIT_SYM(U_attribute, "ATTRIBUTE"); INIT_SYM(int, "int"); INIT_SYM(long, "long"); INIT_SYM(double, "double"); INIT_SYM(char, "char"); INIT_SYM(short, "short"); INIT_SYM(float, "float"); INIT_SYM(U_typename, "TYPENAME"); INIT_SYM(U_struct, "STRUCT"); INIT_SYM(U_union, "UNION"); INIT_SYM(U_at_interface, "AT_INTERFACE"); INIT_SYM(eoi, "*eoi*"); INIT_SYM(U_constant, "CONSTANT"); INIT_SYM(U_ellipsis, "ELLIPSIS"); INIT_SYM(U_unknown, "UNKNOWN"); INIT_SYM(U_dot, "DOT"); INIT_SYM(U_string, "STRING"); INIT_SYM(U_objc_string, "OBJC_STRING"); INIT_SYM(U_comma, "COMMA"); INIT_SYM(U_colon, "COLON"); INIT_SYM(U_semicolon, "SEMICOLON"); INIT_SYM(U_lparen, "LPAREN"); INIT_SYM(U_rparen, "RPAREN"); INIT_SYM(U_lcbra, "LCBRA"); INIT_SYM(U_rcbra, "RCBRA"); INIT_SYM(U_lsbra, "LSBRA"); INIT_SYM(U_rsbra, "RSBRA"); INIT_SYM(U_or_op, "OR_OP"); INIT_SYM(U_or_assign, "OR_ASSIGN"); INIT_SYM(U_or, "OR"); INIT_SYM(U_start_macro, "START_MACRO"); typename_list = Scm_Cons(SYM(int), SCM_LIST5(SYM(long), SYM(double), SYM(char), SYM(short), SYM(float))); } /* end of file */ gauche-c-wrapper-0.6.1.orig/src/c-lex.h0000644000000000000000000000711111237307542014451 0ustar /** * c-lex.h * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: $ */ /* Prologue */ #ifndef GAUCHE_CWRAPPER_LEX_H #define GAUCHE_CWRAPPER_LEX_H #include #include #include #include #include #include #include #include #include "util.h" SCM_DECL_BEGIN #define CLEX_MODULE_NAME "c-wrapper.c-lex" extern ScmObj Scm_ParserAttributeClear(); extern ScmObj Scm_ParserAttributeRef(); extern ScmObj Scm_ParserAttributeAdd(ScmObj attr); extern ScmObj Scm_BufferReadChar(); extern ScmObj Scm_BufferPeekChar(); extern ScmObj Scm_BufferNextChar(); extern ScmObj Scm_SetInputPort(ScmObj port); extern ScmObj Scm_FreeInputPort(); extern ScmObj Scm_SetInputString(ScmString *str); extern ScmObj Scm_GetKeywordVal(ScmObj sym); extern ScmObj Scm_GetOperatorVal(ScmObj sym); extern ScmObj Scm_InitTypeTable(); extern ScmObj Scm_InstallType(ScmObj sym); extern ScmObj Scm_LineNumberRef(); extern ScmObj Scm_LineNumberSet(int num); extern ScmObj Scm_FilenameRef(); extern ScmObj Scm_FilenameSet(ScmObj filename); extern ScmObj Scm_CurrentLineRef(); extern ScmObj Scm_CharHexDigit(ScmObj c); extern ScmObj Scm_CharOctalDigit(ScmObj c); extern ScmObj Scm_SkipSpaces(); extern ScmObj Scm_SkipLine(); extern ScmObj Scm_LastTokenRef(); extern ScmObj Scm_LastTokenSet(ScmObj token); extern ScmObj Scm_IsForceIdentifierRef(); extern ScmObj Scm_IsForceIdentifierSet(ScmObj v); extern ScmObj Scm_ReadIdentifier(ScmObj l); extern ScmObj Scm_ReadOperator(ScmObj c); extern ScmObj Scm_ReadStringLiteral(); extern ScmObj Scm_ReadCharacterConstant(); extern ScmObj Scm_ReadOctalOrFlonum(ScmObj l); extern ScmObj Scm_ReadDecimal(ScmObj l); extern ScmObj Scm_ReadHexadecimal(ScmObj l); extern ScmObj Scm_ReadFlonum(ScmObj l, ScmObj ics, int radix, ScmObj ecs); extern ScmObj Scm_DoSharpCommand(); extern ScmObj Scm_CScan(); extern ScmObj Scm_StartMacroSet(); extern ScmObj Scm_StartMacroReset(); /* Epilogue */ SCM_DECL_END #endif /* GAUCHE_CWRAPPER_LEX_H */ /* end of file */ gauche-c-wrapper-0.6.1.orig/src/c-lexlib.stub0000644000000000000000000001052411237307542015670 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; c-lexlib.stub ;; ;; Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; " #include \"c-lex.h\" " ;; ;; strtoll, strtod ;; (define-cproc strtoll (nptr::) (code "char *endptr = NULL;" "long long v = strtoll(nptr, &endptr, 0);" "if (nptr == endptr) {" " SCM_RETURN(SCM_FALSE);" "} else {" " SCM_RETURN(Scm_MakeInteger64((ScmInt64) v));" "}")) (define-cproc strtod (nptr::) (code "char *endptr = NULL;" "double v = strtod(nptr, &endptr);" "if (nptr == endptr) {" " SCM_RETURN(SCM_FALSE);" "} else {" " SCM_RETURN(Scm_MakeFlonum(v));" "}")) (define-cproc parser-attribute-clear! () (call "Scm_ParserAttributeClear")) (define-cproc parser-attribute () (call "Scm_ParserAttributeRef")) (define-cproc parser-attribute-add! (attr) (call "Scm_ParserAttributeAdd")) (define-cproc buf-read-char () (call "Scm_BufferReadChar")) (define-cproc buf-peek-char () (call "Scm_BufferPeekChar")) (define-cproc buf-next-char () (call "Scm_BufferNextChar")) (define-cproc set-input-port! (port) (call "Scm_SetInputPort")) (define-cproc free-input-port! () (call "Scm_FreeInputPort")) (define-cproc set-input-string! (str::) (call "Scm_SetInputString")) (define-cproc get-keyword-val (sym) (call "Scm_GetKeywordVal")) (define-cproc get-operator-val (sym) (call "Scm_GetOperatorVal")) (define-cproc lineno () (call "Scm_LineNumberRef")) (define-cproc lineno-set! (num::) (call "Scm_LineNumberSet")) (define-cproc filename () (call "Scm_FilenameRef")) (define-cproc filename-set! (filename) (call "Scm_FilenameSet")) (define-cproc current-line () (call "Scm_CurrentLineRef")) (define-cproc char-hex-digit? (c) (call "Scm_CharHexDigit")) (define-cproc char-octal-digit? (c) (call "Scm_CharOctalDigit")) (define-cproc skip-spaces () (call "Scm_SkipSpaces")) (define-cproc skip-line () (call "Scm_SkipLine")) (define-cproc last-token () (call "Scm_LastTokenRef")) (define-cproc last-token-set! (token) (call "Scm_LastTokenSet")) (define-cproc force-identifier? () (call "Scm_IsForceIdentifierRef")) (define-cproc force-identifier-set! (v) (call "Scm_IsForceIdentifierSet")) (define-cproc init-type-table () (call "Scm_InitTypeTable")) (define-cproc install-type (sym) (call "Scm_InstallType")) (define-cproc read-identifier (l) (call "Scm_ReadIdentifier")) (define-cproc read-operator (c) (call "Scm_ReadOperator")) (define-cproc read-string-literal () (call "Scm_ReadStringLiteral")) (define-cproc read-character-constant () (call "Scm_ReadCharacterConstant")) (define-cproc read-octal-or-flonum (l) (call "Scm_ReadOctalOrFlonum")) (define-cproc read-decimal (l) (call "Scm_ReadDecimal")) (define-cproc read-hexadecimal (l) (call "Scm_ReadHexadecimal")) (define-cproc read-flonum (l ics radix:: ecs) (call "Scm_ReadFlonum")) (define-cproc do-sharp-command () (call "Scm_DoSharpCommand")) (define-cproc c-scan () (call "Scm_CScan")) (define-cproc start-macro-set! () (call "Scm_StartMacroSet")) (define-cproc start-macro-reset! () (call "Scm_StartMacroReset")) ;; Local variables: ;; mode: scheme ;; end: gauche-c-wrapper-0.6.1.orig/src/c-parser.c0000644000000000000000000016607511237307542015167 0ustar /** * c-parser.c * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "c-parser.h" /* #define USE_PROFILER */ /* #define USE_EVAL_COUNTER */ #define rdtsc(x) __asm__ __volatile__ ("rdtsc" : "=A" (x)); #ifdef USE_PROFILER #define START_PROFILE(x) long long _profile_start, _profile_end; rdtsc(_profile_start); _profile_##x##_count++; #define END_PROFILE(x) rdtsc(_profile_end); _profile_##x##_time += _profile_end - _profile_start; #else #define START_PROFILE(x) #define END_PROFILE(x) #endif #ifdef USE_EVAL_COUNTER static long alloc_struct_counter = 0; static long init_struct_counter = 0; static long alloc_union_counter = 0; static long init_union_counter = 0; static long define_enum_counter = 0; static long typedef_counter = 0; static long define_inline_counter = 0; static long define_extern_counter = 0; static long alloc_objc_class_counter = 0; static long init_objc_class_counter = 0; static long define_objc_method_counter = 0; static long define_cmacro_counter = 0; static long define_cfunclike_macro_counter = 0; #define TYPE_COUNTUP(type) ++(type##_counter) static void show_eval_counter() { fprintf(stderr, "alloc-struct: %d\n", alloc_struct_counter); fprintf(stderr, "init-struct: %d\n", init_struct_counter); fprintf(stderr, "alloc-union: %d\n", alloc_union_counter); fprintf(stderr, "init-union: %d\n", init_union_counter); fprintf(stderr, "define-enum: %d\n", define_enum_counter); fprintf(stderr, "typedef: %d\n", typedef_counter); fprintf(stderr, "define-inline: %d\n", define_inline_counter); fprintf(stderr, "define-extern: %d\n", define_extern_counter); fprintf(stderr, "alloc-objc-class: %d\n", alloc_objc_class_counter); fprintf(stderr, "init-objc-class: %d\n", init_objc_class_counter); fprintf(stderr, "define-objc-method: %d\n", define_objc_method_counter); fprintf(stderr, "define-cmacro: %d\n", define_cmacro_counter); fprintf(stderr, "define-cfunclike-macro: %d\n", define_cfunclike_macro_counter); } #else #define TYPE_COUNTUP(type) #endif int yyerror(const char *str); int yylex(); #define CHECK_ARG(v) if (SCM_FALSEP(v)) SCM_RETURN(SCM_FALSE) DEFINE_SYM(plus_op); DEFINE_SYM(with_module); DEFINE_SYM(c_wrapper); DEFINE_SYM(c_wrapper_c_ffi); DEFINE_SYM(c_wrapper_objc_ffi); DEFINE_SYM(ptr); DEFINE_SYM(quote); DEFINE_SYM(char); DEFINE_SYM(U_signed); DEFINE_SYM(U_unsigned); DEFINE_SYM(short); DEFINE_SYM(int); DEFINE_SYM(long); DEFINE_SYM(float); DEFINE_SYM(double); DEFINE_SYM(void); DEFINE_SYM(_Bool); DEFINE_SYM(__builtin_va_list); DEFINE_SYM(U_struct); DEFINE_SYM(U_union); DEFINE_SYM(U_enum); DEFINE_SYM(c_char); DEFINE_SYM(c_uchar); DEFINE_SYM(c_short); DEFINE_SYM(c_ushort); DEFINE_SYM(c_int); DEFINE_SYM(c_uint); DEFINE_SYM(c_long); DEFINE_SYM(c_ulong); DEFINE_SYM(c_longlong); DEFINE_SYM(c_ulonglong); DEFINE_SYM(c_float); DEFINE_SYM(c_double); DEFINE_SYM(c_longdouble); DEFINE_SYM(c_void); DEFINE_SYM(c_struct); DEFINE_SYM(c_union); DEFINE_SYM(c_enum); DEFINE_SYM(c_array); DEFINE_SYM(c_func); DEFINE_SYM(c_func_vaargs); DEFINE_SYM(c_func_ptr); DEFINE_SYM(c_func_vaargs_ptr); DEFINE_SYM(c_bit_field); DEFINE_SYM(U_typedef); DEFINE_SYM(cast); DEFINE_SYM(scm_cast); DEFINE_SYM(integer); DEFINE_SYM(list); DEFINE_SYM(cons); DEFINE_SYM(lambda); DEFINE_SYM(args); DEFINE_SYM(apply); DEFINE_SYM(mode); DEFINE_SYM(__mode__); DEFINE_SYM(QI); DEFINE_SYM(__QI__); DEFINE_SYM(HI); DEFINE_SYM(__HI__); DEFINE_SYM(SI); DEFINE_SYM(__SI__); DEFINE_SYM(DI); DEFINE_SYM(__DI__); DEFINE_SYM(SF); DEFINE_SYM(__SF__); DEFINE_SYM(DF); DEFINE_SYM(__DF__); DEFINE_SYM(byte); DEFINE_SYM(__byte__); DEFINE_SYM(word); DEFINE_SYM(__word__); DEFINE_SYM(pointer); DEFINE_SYM(__pointer__); DEFINE_SYM(S_alloc_struct); DEFINE_SYM(S_init_struct); DEFINE_SYM(S_alloc_union); DEFINE_SYM(S_init_union); DEFINE_SYM(S_define_enum); DEFINE_SYM(S_typedef); DEFINE_SYM(S_define_inline); DEFINE_SYM(S_define_extern); DEFINE_SYM(S_alloc_objc_class); DEFINE_SYM(S_init_objc_class); DEFINE_SYM(S_define_objc_method); DEFINE_SYM(S_define_cmacro); DEFINE_SYM(S_define_cfunclike_macro); DEFINE_SYM(S_define); DEFINE_SYM(c_func); DEFINE_SYM(make_c_func); DEFINE_SYM(c_func_vaargs); DEFINE_SYM(make_c_func_vaargs); DEFINE_SYM(make_c_var); DEFINE_SYM(S_identity); DEFINE_SYM(S_define_c_struct); DEFINE_SYM(S_define_c_union); DEFINE_SYM(S_init_c_struct); DEFINE_SYM(S_init_c_union); DEFINE_SYM(objc_object); DEFINE_SYM(objc_lookup_class); DEFINE_SYM(objc_register_method); DEFINE_SYM(c_delay); DEFINE_SYM(c_cast); DEFINE_PROC1(make_define_inline_expr, "c-wrapper.c-parser", "make-define-inline-expr"); DEFINE_PROC0(ffi_sandbox_module, "c-wrapper.c-ffi", "ffi-sandbox-module"); /* parser state */ static ScmObj arg_pool; static ScmObj value_pool; static ScmObj struct_pool; static ScmObj union_pool; static ScmObj referenced_identifier_list; static ScmObj referenced_typename_list; /* macro parser state */ static ScmObj is_use_return; static ScmObj is_use_jump; static ScmObj is_use_iterator; static ScmObj macro_body; static struct DefChunkDictRec { int size; ScmVector *chunk_vector; ScmHashTable *identifier_table; ScmHashTable *typename_table; } defchunk_dict; #define DEFCHUNK_VECTOR_INITIAL_SIZE 1024 #define DEFCHUNK_VECTOR_EXPAND_FACTOR 2 enum { TS_SIGNED = 0, TS_UNSIGNED = 1 << 1, TS_CHAR = 1 << 2, TS_SHORT = 1 << 3, TS_INT = 1 << 4, TS_FLOAT = 1 << 5, TS_DOUBLE = 1 << 6, /* We're interesting the number of 'long' (to distinct 'long' and 'long long'), so ts_long must be last. */ TS_LONG = 1 << 7, }; ScmObj CParser_ctype2class_symbol(ScmObj sym) { static ScmObj lt = SCM_UNBOUND; static ScmObj gt = SCM_UNBOUND; if (SCM_UNBOUNDP(lt)) { lt = SCM_MAKE_STR_IMMUTABLE("<"); gt = SCM_MAKE_STR_IMMUTABLE(">"); } SCM_RETURN(Scm_Intern(SCM_STRING(Scm_StringAppend(SCM_LIST3(lt, SCM_OBJ(SCM_SYMBOL_NAME(sym)), gt))))); } ScmObj CParser_List(ScmObj v) { CHECK_ARG(v); SCM_RETURN(SCM_LIST1(v)); } ScmObj CParser_Append(ScmObj v0, ScmObj v1) { CHECK_ARG(v0); CHECK_ARG(v1); SCM_RETURN(Scm_Append2(v0, v1)); } ScmObj CParser_AddList(ScmObj v0, ScmObj v1) { CHECK_ARG(v0); CHECK_ARG(v1); SCM_RETURN(Scm_Append2(v0, SCM_LIST1(v1))); } ScmObj CParser_Typename(ScmObj v) { CHECK_ARG(v); Scm_ReferencedTypenameListAdd(v); SCM_RETURN(SCM_LIST1(v)); } ScmObj Scm_ArgPoolRef() { SCM_RETURN(arg_pool); } ScmObj Scm_ArgPoolSet(ScmObj lst) { arg_pool = lst; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ArgPoolAdd(ScmObj name) { arg_pool = Scm_Cons(name, arg_pool); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ArgPoolClear() { arg_pool = SCM_NIL; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_InitValuePool() { value_pool = Scm_MakeHashTableSimple(SCM_HASH_EQ, 0); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_RegisterIdentifier(ScmObj name, ScmObj value) { Scm_HashTableSet(SCM_HASH_TABLE(value_pool), name, value, 0); SCM_RETURN(value); } ScmObj Scm_RegisteredIdentifierP(ScmObj name) { if (SCM_FALSEP(Scm_Memq(name, arg_pool))) { if (SCM_UNBOUNDP(Scm_HashTableRef(SCM_HASH_TABLE(value_pool), name, SCM_UNBOUND))) { SCM_RETURN(SCM_FALSE); } else { SCM_RETURN(SCM_TRUE); } } else { SCM_RETURN(SCM_TRUE); } } ScmObj Scm_LookupValue(ScmObj v) { if (SCM_LISTP(v) && SCM_EQ(SCM_CAR(v), SYM(S_identity))) { SCM_RETURN(Scm_HashTableRef(SCM_HASH_TABLE(value_pool), SCM_CADR(v), SCM_FALSE)); } else { SCM_RETURN(v); } } ScmObj Scm_InitStructPool() { struct_pool = Scm_MakeHashTableSimple(SCM_HASH_EQ, 0); SCM_RETURN(SCM_UNDEFINED); } static void struct_pool_add(ScmObj tagname) { Scm_HashTableSet(SCM_HASH_TABLE(struct_pool), tagname, SCM_TRUE, 0); } static int is_struct_pool_exists(ScmObj tagname) { if (SCM_FALSEP(Scm_HashTableRef(SCM_HASH_TABLE(struct_pool), tagname, SCM_FALSE))) { return FALSE; } else { return TRUE; } } ScmObj Scm_InitUnionPool() { union_pool = Scm_MakeHashTableSimple(SCM_HASH_EQ, 0); SCM_RETURN(SCM_UNDEFINED); } static void union_pool_add(ScmObj tagname) { Scm_HashTableSet(SCM_HASH_TABLE(union_pool), tagname, SCM_TRUE, 0); } static int is_union_pool_exists(ScmObj tagname) { if (SCM_FALSEP(Scm_HashTableRef(SCM_HASH_TABLE(union_pool), tagname, SCM_FALSE))) { return FALSE; } else { return TRUE; } } ScmObj Scm_InitMacroParserState() { is_use_return = SCM_FALSE; is_use_jump = SCM_FALSE; is_use_iterator = SCM_FALSE; macro_body = SCM_FALSE; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_UseReturnP() { SCM_RETURN(is_use_return); } ScmObj Scm_UseReturnSet(ScmObj flag) { is_use_return = flag; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_UseJumpP() { SCM_RETURN(is_use_jump); } ScmObj Scm_UseJumpSet(ScmObj flag) { is_use_jump = flag; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_UseIteratorP() { SCM_RETURN(is_use_iterator); } ScmObj Scm_UseIteratorSet(ScmObj flag) { is_use_iterator = flag; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_MacroBodyRef() { SCM_RETURN(macro_body); } ScmObj Scm_MacroBodySet(ScmObj body) { macro_body = body; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ReferencedIdentifierListRef() { SCM_RETURN(referenced_identifier_list); } ScmObj Scm_ReferencedIdentifierListAdd(ScmObj identifier) { referenced_identifier_list = Scm_Cons(identifier, referenced_identifier_list); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ReferencedIdentifierListClear() { referenced_identifier_list = SCM_NIL; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ReferencedTypenameListRef() { SCM_RETURN(referenced_typename_list); } ScmObj Scm_ReferencedTypenameListAdd(ScmObj typename) { referenced_typename_list = Scm_Cons(typename, referenced_typename_list); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_ReferencedTypenameListClear() { referenced_typename_list = SCM_NIL; SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_AllReferencedInfoClear() { Scm_ArgPoolClear(); Scm_ReferencedIdentifierListClear(); Scm_ReferencedTypenameListClear(); SCM_RETURN(SCM_UNDEFINED); } static ScmObj typespec2ctype_nonbasic(ScmObj type_spec_list) { ScmObj car = SCM_CAR(type_spec_list); ScmObj cdr = SCM_CDR(type_spec_list); if (SCM_EQ(car, SYM(void))) { SCM_RETURN(SYM(c_void)); } else if (SCM_EQ(car, SYM(_Bool))) { SCM_RETURN(SYM(c_int)); } else if (SCM_EQ(car, SYM(__builtin_va_list))) { SCM_RETURN(SCM_LIST2(SCM_LIST3(SYM(with_module), SYM(c_wrapper_c_ffi), SYM(ptr)), SYM(c_void))); } else if (SCM_PAIRP(car) && SCM_EQ(SCM_CAR(car), SYM(U_struct))) { ScmObj tagname = SCM_CADR(car); ScmObj elem_alist = SCM_CADR(SCM_CDR(car)); if (SCM_FALSEP(elem_alist)) { Scm_EmitAllocStruct(tagname); } else { Scm_EmitInitStruct(tagname, elem_alist); } /* `(c-struct ',tagname) */ SCM_RETURN(Scm_CStructSymbol(tagname)); } else if (SCM_PAIRP(car) && SCM_EQ(SCM_CAR(car), SYM(U_union))) { ScmObj tagname = SCM_CADR(car); ScmObj elem_alist = SCM_CADR(SCM_CDR(car)); if (SCM_FALSEP(elem_alist)) { Scm_EmitAllocUnion(tagname); } else { Scm_EmitInitUnion(tagname, elem_alist); } /* `(c-union ',tagname) */ SCM_RETURN(Scm_CUnionSymbol(tagname)); } else if (SCM_PAIRP(car) && SCM_EQ(SCM_CAR(car), SYM(U_enum))) { ScmObj tagname = SCM_CADR(car); ScmObj enum_alist = SCM_CADR(SCM_CDR(car)); Scm_EmitDefineEnum(tagname, enum_alist); /* `(c-enum ',tagname) -> */ SCM_RETURN(SYM(c_int)); } else if (SCM_SYMBOLP(car) && SCM_NULLP(cdr)) { SCM_RETURN(CParser_ctype2class_symbol(car)); } SCM_RETURN(SCM_FALSE); } static ScmObj typespec2ctype(ScmObj type_spec_list) { ScmObj pair; int type_spec = 0; CHECK_ARG(type_spec_list); if ((!SCM_PAIRP(type_spec_list)) || SCM_EQ(type_spec_list, SCM_NIL)) { SCM_RETURN(SCM_FALSE); } SCM_FOR_EACH(pair, type_spec_list) { if (SCM_EQ(SYM(U_signed), SCM_CAR(pair))) { type_spec |= TS_SIGNED; } else if (SCM_EQ(SYM(U_unsigned), SCM_CAR(pair))) { type_spec |= TS_UNSIGNED; } else if (SCM_EQ(SYM(char), SCM_CAR(pair))) { type_spec |= TS_CHAR; } else if (SCM_EQ(SYM(short), SCM_CAR(pair))) { type_spec |= TS_SHORT; } else if (SCM_EQ(SYM(int), SCM_CAR(pair))) { type_spec |= TS_INT; } else if (SCM_EQ(SYM(float), SCM_CAR(pair))) { type_spec |= TS_FLOAT; } else if (SCM_EQ(SYM(double), SCM_CAR(pair))) { type_spec |= TS_DOUBLE; } else if (SCM_EQ(SYM(long), SCM_CAR(pair))) { /* We're interesting the number of 'long' to distinct 'long' and 'long long'. */ type_spec += TS_LONG; } else { SCM_RETURN(typespec2ctype_nonbasic(type_spec_list)); } } switch (type_spec) { case TS_SIGNED + TS_CHAR: SCM_RETURN(SYM(c_char)); case TS_UNSIGNED + TS_CHAR: SCM_RETURN(SYM(c_uchar)); case TS_SIGNED + TS_SHORT: case TS_SIGNED + TS_SHORT + TS_INT: SCM_RETURN(SYM(c_short)); case TS_UNSIGNED + TS_SHORT: case TS_UNSIGNED + TS_SHORT + TS_INT: SCM_RETURN(SYM(c_ushort)); case TS_SIGNED: case TS_SIGNED + TS_INT: SCM_RETURN(SYM(c_int)); case TS_UNSIGNED: case TS_UNSIGNED + TS_INT: SCM_RETURN(SYM(c_uint)); case TS_SIGNED + TS_LONG: case TS_SIGNED + TS_LONG + TS_INT: SCM_RETURN(SYM(c_long)); case TS_UNSIGNED + TS_LONG: case TS_UNSIGNED + TS_LONG + TS_INT: SCM_RETURN(SYM(c_ulong)); case TS_SIGNED + TS_LONG + TS_LONG: case TS_SIGNED + TS_LONG + TS_LONG + TS_INT: SCM_RETURN(SYM(c_longlong)); case TS_UNSIGNED + TS_LONG + TS_LONG: case TS_UNSIGNED + TS_LONG + TS_LONG + TS_INT: SCM_RETURN(SYM(c_ulonglong)); case TS_FLOAT: SCM_RETURN(SYM(c_float)); case TS_DOUBLE: SCM_RETURN(SYM(c_double)); case TS_LONG + TS_DOUBLE: SCM_RETURN(SYM(c_longdouble)); default: SCM_RETURN(SCM_FALSE); } } ScmObj Scm_MakeTypeDecl(ScmObj type_spec_list, ScmObj declarator) { ScmObj lst = SCM_NIL; ScmObj pair; ScmObj ctype; DeclaratorProc *func; ScmTypeDecl *z = SCM_NEW(ScmTypeDecl); SCM_SET_CLASS(z, SCM_CLASS_TYPE_DECL); CHECK_ARG(type_spec_list); CHECK_ARG(declarator); if (!SCM_DECLARATORP(declarator)) { Scm_Error(" required, but got %S", declarator); } SCM_FOR_EACH(pair, type_spec_list) { if (SCM_EQ(SCM_CAR(pair), SYM(U_typedef))) { continue; } lst = Scm_Cons(SCM_CAR(pair), lst); } lst = Scm_Reverse(lst); ctype = typespec2ctype(lst); if (SCM_FALSEP(ctype)) { SCM_RETURN(SCM_FALSE); } z->type = ctype; z->name = SCM_FALSE; z->init_value = SCM_FALSE; func = SCM_DECLARATOR(declarator)->func; SCM_RETURN(func(SCM_OBJ(z), SCM_DECLARATOR(declarator)->data)); } static ScmObj compose_declarator(ScmObj type_decl, ScmObj *data) { ScmObj d1 = data[0]; ScmObj d2 = data[1]; DeclaratorProc *func1 = SCM_DECLARATOR(d1)->func; DeclaratorProc *func2 = SCM_DECLARATOR(d2)->func; SCM_RETURN(func1(func2(type_decl, SCM_DECLARATOR(d2)->data), SCM_DECLARATOR(d1)->data)); } ScmObj Scm_ComposeDeclarator(ScmObj d1, ScmObj d2) { ScmDeclarator *z; CHECK_ARG(d1); CHECK_ARG(d2); z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = compose_declarator; z->data[0] = d1; z->data[1] = d2; SCM_RETURN(SCM_OBJ(z)); } static ScmObj identifier_declarator(ScmObj type_decl, ScmObj *data) { SCM_TYPE_DECL_NAME(type_decl) = data[0]; SCM_RETURN(type_decl); } ScmObj Scm_IdentifierDeclarator(ScmObj name) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = identifier_declarator; z->data[0] = name; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } ScmObj Scm_ToInt(ScmObj v) { if (SCM_REALP(v)) { SCM_RETURN(Scm_RoundToExact(v, SCM_ROUND_FLOOR)); } else { SCM_RETURN(SCM_LIST3(SCM_LIST3(SYM(with_module), SYM(c_wrapper_c_ffi), SYM(cast)), SYM(integer), v)); } } static ScmObj array_declarator(ScmObj type_decl, ScmObj *data) { ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); ScmObj size = data[0]; if (!SCM_FALSEP(size)) { size = Scm_ToInt(size); } SCM_TYPE_DECL_CTYPE(type_decl) = SCM_LIST3(SYM(c_array), type, size); SCM_RETURN(type_decl); } ScmObj Scm_ArrayDeclarator(ScmObj size) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = array_declarator; z->data[0] = size; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj func_declarator(ScmObj type_decl, ScmObj *data) { ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); ScmObj name_type_list = SCM_NIL; ScmObj args = data[0]; ScmObj pair; SCM_FOR_EACH(pair, args) { name_type_list = Scm_Cons(SCM_LIST3(SYM(list), SCM_LIST2(SYM(quote), SCM_TYPE_DECL_NAME(SCM_CAR(pair))), SCM_TYPE_DECL_CTYPE(SCM_CAR(pair))), name_type_list); } name_type_list = Scm_Reverse(name_type_list); SCM_TYPE_DECL_CTYPE(type_decl) = SCM_LIST3(SYM(c_func), type, Scm_Cons(SYM(list), name_type_list)); SCM_RETURN(type_decl); } ScmObj Scm_FuncDeclarator(ScmObj args) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = func_declarator; z->data[0] = args; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj func_vaargs_declarator(ScmObj type_decl, ScmObj *data) { ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); ScmObj name_type_list = SCM_NIL; ScmObj args = data[0]; ScmObj pair; SCM_FOR_EACH(pair, args) { name_type_list = Scm_Cons(SCM_LIST3(SYM(list), SCM_LIST2(SYM(quote), SCM_TYPE_DECL_NAME(SCM_CAR(pair))), SCM_TYPE_DECL_CTYPE(SCM_CAR(pair))), name_type_list); } name_type_list = Scm_Reverse(name_type_list); SCM_TYPE_DECL_CTYPE(type_decl) = SCM_LIST3(SYM(c_func_vaargs), type, Scm_Cons(SYM(list), name_type_list)); SCM_RETURN(type_decl); } ScmObj Scm_FuncVaargsDeclarator(ScmObj args) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = func_vaargs_declarator; z->data[0] = args; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj ptr_declarator(ScmObj type_decl, ScmObj *data) { ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); if (SCM_PAIRP(type)) { if (SCM_EQ(SCM_CAR(type), SYM(c_func))) { SCM_SET_CAR(type, SYM(c_func_ptr)); SCM_RETURN(type_decl); } else if (SCM_EQ(SCM_CAR(type), SYM(c_func_vaargs))) { SCM_SET_CAR(type, SYM(c_func_vaargs_ptr)); SCM_RETURN(type_decl); } } SCM_TYPE_DECL_CTYPE(type_decl) = SCM_LIST2(SCM_LIST3(SYM(with_module), SYM(c_wrapper_c_ffi), SYM(ptr)), type); SCM_RETURN(type_decl); } ScmObj Scm_PtrDeclarator() { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = ptr_declarator; z->data[0] = SCM_UNBOUND; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj bit_field_declarator(ScmObj type_decl, ScmObj *data) { static int counter = 0; char numbuf[50]; ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); ScmObj n = data[0]; SCM_TYPE_DECL_CTYPE(type_decl) = SCM_LIST3(SYM(c_bit_field), type, n); if (SCM_FALSEP(SCM_TYPE_DECL_NAME(type_decl))) { int nc = snprintf(numbuf, sizeof(numbuf), "%d", counter++); SCM_TYPE_DECL_NAME(type_decl) = Scm_Intern(SCM_STRING(Scm_StringAppendC(SCM_STRING(SCM_MAKE_STR_IMMUTABLE("%")), numbuf, nc, nc))); } SCM_RETURN(type_decl); } ScmObj Scm_BitFieldDeclarator(ScmObj n) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = bit_field_declarator; z->data[0] = n; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj init_value_declarator(ScmObj type_decl, ScmObj *data) { SCM_TYPE_DECL_INIT_VALUE(type_decl) = data[0]; SCM_RETURN(type_decl); } ScmObj Scm_InitValueDeclarator(ScmObj v) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = init_value_declarator; z->data[0] = v; z->data[1] = SCM_UNBOUND; SCM_RETURN(SCM_OBJ(z)); } static ScmObj null_declarator(ScmObj type_decl, ScmObj *data) { SCM_RETURN(type_decl); } ScmObj Scm_NullDeclarator() { static ScmDeclarator *z = NULL; if (!z) { z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = null_declarator; z->data[0] = SCM_UNBOUND; z->data[1] = SCM_UNBOUND; } SCM_RETURN(SCM_OBJ(z)); } static ScmObj size2mode(int size) { switch (size) { case 1: SCM_RETURN(SYM(QI)); case 2: SCM_RETURN(SYM(HI)); case 4: SCM_RETURN(SYM(SI)); case 8: SCM_RETURN(SYM(DI)); default: Scm_Error("invalid size %S", SCM_MAKE_INT(size)); } /* NOTREACHED */ SCM_RETURN(SCM_FALSE); } static ScmObj compose_variable_attribute(ScmObj type_decl, ScmObj *data) { ScmObj attr_list = data[0]; ScmObj declarator = data[1]; ScmObj type = SCM_TYPE_DECL_CTYPE(type_decl); int unsigned_p = SCM_BOOL_VALUE(Scm_Memq(type, SCM_LIST5(SYM(c_uchar), SYM(c_ushort), SYM(c_uint), SYM(c_ulong), SYM(c_ulonglong)))); ScmObj mode; mode = Scm_Assq(SYM(mode), attr_list); if (SCM_FALSEP(mode)) { mode = Scm_Assq(SYM(__mode__), attr_list); } if (!SCM_FALSEP(mode)) { mode = SCM_CADR(mode); } if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(word), SYM(__word__))))) { int dmy __attribute__((__mode__(__word__))); mode = size2mode(sizeof(dmy)); } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(pointer), SYM(__pointer__))))) { int dmy __attribute__((__mode__(__pointer__))); mode = size2mode(sizeof(dmy)); } if (!SCM_FALSEP(mode)) { if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST4(SYM(QI), SYM(__QI__), SYM(byte), SYM(__byte__))))) { if (unsigned_p) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_uchar); } else { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_char); } } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(HI), SYM(__HI__))))) { if (unsigned_p) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_ushort); } else { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_short); } } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(SI), SYM(__SI__))))) { if (unsigned_p) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_uint); } else { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_int); } } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(DI), SYM(__DI__))))) { if (unsigned_p) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_ulonglong); } else { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_longlong); } } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(SF), SYM(__SF__))))) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_float); } else if (!SCM_FALSEP(Scm_Memq(mode, SCM_LIST2(SYM(DF), SYM(__DF__))))) { SCM_TYPE_DECL_CTYPE(type_decl) = SYM(c_double); } } SCM_RETURN(SCM_DECLARATOR(declarator)->func(type_decl, SCM_DECLARATOR(declarator)->data)); } ScmObj Scm_ComposeVariableAttribute(ScmObj decl) { ScmDeclarator *z = SCM_NEW(ScmDeclarator); SCM_SET_CLASS(z, SCM_CLASS_DECLARATOR); z->func = compose_variable_attribute; z->data[0] = Scm_ParserAttributeRef(); z->data[1] = decl; Scm_ParserAttributeClear(); SCM_RETURN(SCM_OBJ(z)); } ScmObj Scm_MakeTypeDeclList(ScmObj type_spec_list, ScmObj decls) { ScmObj result = SCM_NIL; ScmObj pair; SCM_FOR_EACH(pair, decls) { result = Scm_Cons(Scm_MakeTypeDecl(type_spec_list, SCM_CAR(pair)), result); } SCM_RETURN(Scm_Reverse(result)); } ScmObj Scm_ParameterDeclaration(ScmObj type_decl) { ScmObj type; ScmObj name; CHECK_ARG(type_decl); type = SCM_TYPE_DECL_CTYPE(type_decl); if (SCM_PAIRP(type)) { /* ISO/IEC 9899:1999 6.7.5.3 */ ScmObj car = SCM_CAR(type); if (SCM_EQ(SYM(c_func), car)) { SCM_SET_CAR(type, SYM(c_func_ptr)); } else if (SCM_EQ(SYM(c_func_vaargs), car)) { SCM_SET_CAR(type, SYM(c_func_vaargs_ptr)); } } name = SCM_TYPE_DECL_NAME(type_decl); if (!SCM_FALSEP(name)) { Scm_ArgPoolAdd(name); } SCM_RETURN(type_decl); } ScmObj Scm_Declaration(ScmObj type_spec_list, ScmObj declarator_list) { ScmObj td_list; ScmObj pair; CHECK_ARG(type_spec_list); CHECK_ARG(declarator_list); Scm_ParserAttributeClear(); td_list = Scm_MakeTypeDeclList(type_spec_list, declarator_list); SCM_FOR_EACH(pair, td_list) { Scm_ArgPoolAdd(SCM_TYPE_DECL_NAME(SCM_CAR(pair))); } SCM_RETURN(td_list); } ScmObj Scm_DefChunkDictInit() { defchunk_dict.size = 0; defchunk_dict.chunk_vector = SCM_VECTOR(Scm_MakeVector(DEFCHUNK_VECTOR_INITIAL_SIZE, SCM_UNBOUND)); defchunk_dict.identifier_table = SCM_HASH_TABLE(Scm_MakeHashTableSimple(SCM_HASH_EQ, 0)); defchunk_dict.typename_table = SCM_HASH_TABLE(Scm_MakeHashTableSimple(SCM_HASH_EQUAL, 0)); } static void defchunk_dict_add(ScmObj defchunk) { int len = SCM_VECTOR_SIZE(defchunk_dict.chunk_vector); if (len <= defchunk_dict.size) { defchunk_dict.chunk_vector = SCM_VECTOR(Scm_VectorCopy(defchunk_dict.chunk_vector, 0, defchunk_dict.size * DEFCHUNK_VECTOR_EXPAND_FACTOR, SCM_UNBOUND)); } Scm_VectorSet(defchunk_dict.chunk_vector, defchunk_dict.size, defchunk); ++defchunk_dict.size; } ScmObj Scm_DefChunkDictSetIdentifier(ScmObj identifier, ScmObj defchunk) { ScmObj holder; holder = Scm_HashTableRef(defchunk_dict.identifier_table, identifier, SCM_NIL); holder = Scm_Cons(defchunk, holder); Scm_HashTableSet(defchunk_dict.identifier_table, identifier, holder, 0); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_DefChunkDictSetTypename(ScmObj typename, ScmObj defchunk) { ScmObj holder; holder = Scm_HashTableRef(defchunk_dict.typename_table, typename, SCM_NIL); holder = Scm_Cons(defchunk, holder); Scm_HashTableSet(defchunk_dict.typename_table, typename, holder, 0); SCM_RETURN(SCM_UNDEFINED); } static void defchunk_dict_set_mark(ScmObj defchunk) { ScmObj typename_list = SCM_DEFCHUNK_REFERENCED_TYPENAME_LIST(defchunk); ScmObj identifier_list = SCM_DEFCHUNK_REFERENCED_IDENTIFIER_LIST(defchunk); ScmObj p1, p2; if (SCM_DEFCHUNK_IS_USED(defchunk)) { return; } SCM_DEFCHUNK_SET_USED(defchunk); SCM_FOR_EACH(p1, typename_list) { SCM_FOR_EACH(p2, Scm_HashTableRef(defchunk_dict.typename_table, SCM_CAR(p1), SCM_NIL)) { defchunk_dict_set_mark(SCM_CAR(p2)); } } SCM_FOR_EACH(p1, identifier_list) { SCM_FOR_EACH(p2, Scm_HashTableRef(defchunk_dict.identifier_table, SCM_CAR(p1), SCM_NIL)) { defchunk_dict_set_mark(SCM_CAR(p2)); } } } static ScmObj set_mark_cc(ScmObj result, void **data) { int *pos_ptr = (int*) data[0]; ScmObj proc = SCM_OBJ(data[1]); ScmObj defchunk = SCM_OBJ(data[2]); if (!SCM_FALSEP(result)) { defchunk_dict_set_mark(defchunk); } ++(*pos_ptr); if (*pos_ptr < defchunk_dict.size) { void *new_data[3]; defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, *pos_ptr, SCM_FALSE); new_data[0] = pos_ptr; new_data[1] = proc; new_data[2] = defchunk; Scm_VMPushCC(set_mark_cc, new_data, 3); SCM_RETURN(Scm_VMApply1(proc, defchunk)); } else { SCM_RETURN(SCM_UNDEFINED); } } ScmObj Scm_DefChunkDictSetMark(ScmProcedure *proc) { if (0 < defchunk_dict.size) { int *pos_ptr = SCM_NEW(int); void *data[3]; ScmObj defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, 0, SCM_FALSE); *pos_ptr = 0; data[0] = pos_ptr; data[1] = proc; data[2] = defchunk; Scm_VMPushCC(set_mark_cc, data, 3); SCM_RETURN(Scm_VMApply1(SCM_OBJ(proc), defchunk)); } else { SCM_RETURN(SCM_UNDEFINED); } } static ScmObj defchunk2expr(ScmObj defchunk) { ScmObj type = SCM_DEFCHUNK_TYPE(defchunk); ScmObj expr; if (SCM_EQ(type, SYM(S_alloc_struct))) { TYPE_COUNTUP(alloc_struct); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_init_struct))) { TYPE_COUNTUP(init_struct); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_alloc_union))) { TYPE_COUNTUP(alloc_union); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_init_union))) { TYPE_COUNTUP(init_union); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_define_enum))) { TYPE_COUNTUP(define_enum); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_typedef))) { TYPE_COUNTUP(typedef); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_define_inline))) { TYPE_COUNTUP(define_inline); SCM_RETURN(make_define_inline_expr(defchunk)); } else if (SCM_EQ(type, SYM(S_define_extern))) { TYPE_COUNTUP(define_extern); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_alloc_objc_class))) { TYPE_COUNTUP(alloc_objc_class); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_init_objc_class))) { TYPE_COUNTUP(init_objc_class); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_define_objc_method))) { TYPE_COUNTUP(define_objc_method); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_define_cmacro))) { TYPE_COUNTUP(define_cmacro); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } else if (SCM_EQ(type, SYM(S_define_cfunclike_macro))) { TYPE_COUNTUP(define_cfunclike_macro); SCM_RETURN(SCM_DEFCHUNK_OBJECT(defchunk)); } } static int defchunk_try_eval(ScmObj defchunk, ScmObj module) { ScmObj type; if (SCM_FALSEP(defchunk)) { return FALSE; } type = SCM_DEFCHUNK_TYPE(defchunk); if (SCM_EQ(type, SYM(S_define_enum))) { ScmObj expr = defchunk2expr(defchunk); ScmObj sym = SCM_CADR(expr); ScmObj val = SCM_CAR(SCM_CDDR(expr)); Scm_Define(SCM_MODULE(module), SCM_SYMBOL(sym), val); return TRUE; } else { ScmObj expr = defchunk2expr(defchunk); if (SCM_EQ(SCM_CAR(expr), SYM(S_define))) { ScmObj sym = SCM_CADR(expr); ScmObj val = SCM_CAR(SCM_CDDR(expr)); if (SCM_SYMBOLP(val)) { Scm_Define(SCM_MODULE(module), SCM_SYMBOL(sym), Scm_GlobalVariableRef(SCM_MODULE(module), SCM_SYMBOL(val), FALSE)); return TRUE; } else if (SCM_NUMBERP(val) || SCM_STRINGP(val)) { Scm_Define(SCM_MODULE(module), SCM_SYMBOL(sym), val); return TRUE; } } } return FALSE; } #define CONTINUE_IF_IMMEDIATE_EVAL(defchunk, module_or_proc) \ if (SCM_MODULEP(module_or_proc)) { \ if (defchunk_try_eval(defchunk, module_or_proc)) { \ continue; \ } else { \ break; \ } \ } else { \ break; \ } static ScmObj defchunk_dict_for_each_cc(ScmObj result, void **data) { int *pos_ptr = (int*) data[0]; ScmObj module_or_proc = SCM_OBJ(data[1]); ScmObj all_flag = SCM_OBJ(data[2]); ScmObj defchunk; for (; (*pos_ptr < defchunk_dict.size); ++(*pos_ptr)) { defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, *pos_ptr, SCM_FALSE); if (SCM_FALSEP(all_flag)) { if (SCM_DEFCHUNK_IS_USED(defchunk)) { CONTINUE_IF_IMMEDIATE_EVAL(defchunk, module_or_proc); } else { continue; } } else { CONTINUE_IF_IMMEDIATE_EVAL(defchunk, module_or_proc); } } if (*pos_ptr < defchunk_dict.size) { void *new_data[3]; ScmObj expr; ++(*pos_ptr); new_data[0] = pos_ptr; new_data[1] = module_or_proc; new_data[2] = all_flag; Scm_VMPushCC(defchunk_dict_for_each_cc, new_data, 3); expr = defchunk2expr(defchunk); if (SCM_MODULEP(module_or_proc)) { SCM_RETURN(Scm_VMEval(expr, module_or_proc)); } else { SCM_RETURN(Scm_VMApply1(module_or_proc, expr)); } } else { SCM_RETURN(SCM_UNDEFINED); } } ScmObj Scm_DefChunkDictForEach(ScmObj proc, ScmObj all_flag) { int *pos_ptr = SCM_NEW(int); ScmObj defchunk; ScmObj module_or_proc; if (SCM_FALSEP(proc)) { module_or_proc = ffi_sandbox_module(); } else { module_or_proc = proc; } for (*pos_ptr = 0; (*pos_ptr < defchunk_dict.size); ++(*pos_ptr)) { defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, *pos_ptr, SCM_FALSE); if (SCM_FALSEP(all_flag)) { if (SCM_DEFCHUNK_IS_USED(defchunk)) { CONTINUE_IF_IMMEDIATE_EVAL(defchunk, module_or_proc); } else { continue; } } else { CONTINUE_IF_IMMEDIATE_EVAL(defchunk, module_or_proc); } } if (*pos_ptr < defchunk_dict.size) { void *new_data[3]; ScmObj expr; ++(*pos_ptr); new_data[0] = pos_ptr; new_data[1] = module_or_proc; new_data[2] = all_flag; Scm_VMPushCC(defchunk_dict_for_each_cc, new_data, 3); expr = defchunk2expr(defchunk); if (SCM_MODULEP(module_or_proc)) { SCM_RETURN(Scm_VMEval(expr, module_or_proc)); } else { SCM_RETURN(Scm_VMApply1(module_or_proc, expr)); } } else { SCM_RETURN(SCM_UNDEFINED); } } ScmObj Scm_DefChunkDictAllSymbols() { ScmObj result = SCM_NIL; int i; for (i = 0; i < defchunk_dict.size; ++i) { ScmObj defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, i, SCM_FALSE); ScmObj defchunk_syms = SCM_DEFCHUNK_SYMBOL_LIST(defchunk); ScmObj p; SCM_FOR_EACH(p, defchunk_syms) { ScmObj sym = SCM_CAR(p); result = Scm_Cons(sym, result); } } SCM_RETURN(result); } ScmObj Scm_MakeDefChunk(ScmObj type, ScmObj id, ScmObj sym_list, ScmObj obj) { ScmObj vec = Scm_MakeVector(8, SCM_UNBOUND); SCM_DEFCHUNK_SET_TYPE(vec, type); SCM_DEFCHUNK_SET_UNUSED(vec); SCM_DEFCHUNK_SET_FILENAME(vec, Scm_FilenameRef()); SCM_DEFCHUNK_SET_REFERENCED_TYPENAME_LIST(vec, Scm_ReferencedTypenameListRef()); SCM_DEFCHUNK_SET_REFERENCED_IDENTIFIER_LIST(vec, Scm_ReferencedIdentifierListRef()); SCM_DEFCHUNK_SET_IDENTIFIER(vec, id); SCM_DEFCHUNK_SET_SYMBOL_LIST(vec, sym_list); SCM_DEFCHUNK_SET_OBJECT(vec, obj); defchunk_dict_add(vec); SCM_RETURN(vec); } static ScmObj make_member_alist(ScmObj member_list) { ScmObj p; ScmObj alist = SCM_LIST1(SYM(list)); SCM_FOR_EACH(p, member_list) { ScmObj elem = SCM_CAR(p); alist = Scm_Cons(SCM_LIST3(SYM(cons), SCM_LIST2(SYM(quote), SCM_TYPE_DECL_NAME(elem)), SCM_TYPE_DECL_CTYPE(elem)), alist); } SCM_RETURN(Scm_Reverse(alist)); } ScmObj Scm_EmitAllocStruct(ScmObj tagname) { if (is_struct_pool_exists(tagname)) { SCM_RETURN(SCM_UNDEFINED); } struct_pool_add(tagname); Scm_DefChunkDictSetTypename(tagname, Scm_MakeDefChunk(SYM(S_alloc_struct), tagname, SCM_LIST1(Scm_CStructSymbol(tagname)), SCM_LIST2(SYM(S_define_c_struct), tagname))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitInitStruct(ScmObj tagname, ScmObj member_list) { Scm_EmitAllocStruct(tagname); Scm_DefChunkDictSetTypename(tagname, Scm_MakeDefChunk(SYM(S_init_struct), tagname, SCM_LIST1(Scm_CStructSymbol(tagname)), SCM_LIST3(SYM(S_init_c_struct), Scm_CStructSymbol(tagname), make_member_alist(member_list)))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitAllocUnion(ScmObj tagname) { if (is_union_pool_exists(tagname)) { SCM_RETURN(SCM_UNDEFINED); } union_pool_add(tagname); Scm_DefChunkDictSetTypename(tagname, Scm_MakeDefChunk(SYM(S_alloc_union), tagname, SCM_LIST1(Scm_CUnionSymbol(tagname)), SCM_LIST2(SYM(S_define_c_union), tagname))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitInitUnion(ScmObj tagname, ScmObj member_list) { Scm_EmitAllocUnion(tagname); Scm_DefChunkDictSetTypename(tagname, Scm_MakeDefChunk(SYM(S_init_union), tagname, SCM_LIST1(Scm_CUnionSymbol(tagname)), SCM_LIST3(SYM(S_init_c_union), Scm_CUnionSymbol(tagname), make_member_alist(member_list)))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitDefineEnum(ScmObj tagname, ScmObj enum_alist) { ScmObj prev = SCM_MAKE_INT(-1); ScmObj p; SCM_FOR_EACH(p, enum_alist) { ScmObj identifier = SCM_CAAR(p); ScmObj v = SCM_CDAR(p); if (SCM_FALSEP(v)) { if (SCM_INTP(prev)) { v = SCM_MAKE_INT(SCM_INT_VALUE(prev) + 1); } else { v = SCM_LIST3(SYM(plus_op), SCM_LIST2(SYM(scm_cast), prev), SCM_MAKE_INT(1)); } } Scm_RegisterIdentifier(identifier, v); Scm_DefChunkDictSetIdentifier(identifier, Scm_MakeDefChunk(SYM(S_define_enum), identifier, SCM_LIST1(identifier), SCM_LIST3(SCM_LIST3(SYM(with_module), SYM(c_wrapper), SYM(S_define_enum)), identifier, v))); prev = v; } SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitDefineInline(ScmObj declaration_specifiers, ScmObj declarator, ScmObj function_body) { ScmObj declaration = Scm_MakeTypeDecl(declaration_specifiers, declarator); ScmObj ctype = SCM_TYPE_DECL_CTYPE(declaration); ScmObj identifier = SCM_TYPE_DECL_NAME(declaration); ScmObj vec = Scm_MakeVector(4, SCM_UNBOUND); Scm_VectorSet(SCM_VECTOR(vec), 0, declaration); Scm_VectorSet(SCM_VECTOR(vec), 1, ctype); Scm_VectorSet(SCM_VECTOR(vec), 2, identifier); Scm_VectorSet(SCM_VECTOR(vec), 3, function_body); Scm_DefChunkDictSetIdentifier(identifier, Scm_MakeDefChunk(SYM(S_define_inline), identifier, SCM_LIST1(identifier), vec)); Scm_RegisterIdentifier(identifier, SCM_LIST3(SYM(lambda), SYM(args), SCM_LIST3(SYM(apply), identifier, SYM(args)))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitDefineObjcClass(ScmObj classname_list) { ScmObj p; SCM_FOR_EACH(p, classname_list) { ScmObj classname = SCM_CAR(p); ScmObj sym; if (SCM_FALSEP(classname)) { continue; } Scm_InstallType(classname); sym = CParser_ctype2class_symbol(classname); Scm_DefChunkDictSetTypename(classname, Scm_MakeDefChunk(SYM(S_alloc_objc_class), classname, SCM_LIST1(sym), SCM_LIST3(SYM(S_define), sym, Scm_CStructSymbol(SYM(objc_object))))); Scm_DefChunkDictSetTypename(classname, Scm_MakeDefChunk(SYM(S_init_objc_class), classname, SCM_LIST1(classname), SCM_LIST3(SYM(S_define), classname, SCM_LIST2(SYM(objc_lookup_class), SCM_LIST2(SYM(quote), classname))))); } SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitObjcMethod(ScmObj keywords, ScmObj type_list) { ScmObj name = Scm_StringAppend(keywords); ScmObj lst = SCM_LIST1(SYM(list)); ScmObj p; SCM_FOR_EACH(p, type_list) { lst = Scm_Cons(SCM_TYPE_DECL_CTYPE(SCM_CAR(p)), lst); } lst = Scm_Reverse(lst); Scm_MakeDefChunk(SYM(S_define_objc_method), SCM_FALSE, SCM_NIL, SCM_LIST3(SYM(objc_register_method), name, lst)); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitDefineCmacro(ScmObj name, ScmObj body) { Scm_DefChunkDictSetIdentifier(name, Scm_MakeDefChunk(SYM(S_define_cmacro), name, SCM_LIST1(name), SCM_LIST3(SYM(S_define), name, body))); SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_EmitDefineCfunclikeMacro(ScmObj name, ScmObj args, ScmObj body) { Scm_DefChunkDictSetIdentifier(name, Scm_MakeDefChunk(SYM(S_define_cfunclike_macro), name, SCM_LIST1(name), SCM_LIST4(SCM_LIST3(SYM(with_module), SYM(c_wrapper), SYM(S_define_cfunclike_macro)), name, args, body))); SCM_RETURN(SCM_UNDEFINED); } static void emit_typedef(ScmObj type_decl_list) { ScmObj p; SCM_FOR_EACH(p, type_decl_list) { ScmObj v = SCM_CAR(p); ScmObj ctype = SCM_TYPE_DECL_CTYPE(v); ScmObj new_ctype = SCM_TYPE_DECL_NAME(v); ScmObj sym = CParser_ctype2class_symbol(new_ctype); Scm_DefChunkDictSetTypename(new_ctype, Scm_MakeDefChunk(SYM(S_typedef), new_ctype, SCM_LIST1(sym), SCM_LIST3(SYM(S_define), sym, ctype))); Scm_InstallType(new_ctype); } } static void emit_define_extern(ScmObj declaration) { ScmObj ctype = SCM_TYPE_DECL_CTYPE(declaration); ScmObj identifier = SCM_TYPE_DECL_NAME(declaration); ScmObj fnsym; ScmObj obj; ScmObj defchunk; if (SCM_FALSEP(ctype) || SCM_FALSEP(identifier)) { return; } fnsym = SCM_CAR(ctype); if (SCM_EQ(fnsym, SYM(c_func)) || SCM_EQ(fnsym, SYM(c_func_vaargs))) { ScmObj ret_type = SCM_CADR(ctype); ScmObj arg_types = SCM_LIST1(SYM(list)); ScmObj p; SCM_FOR_EACH(p, SCM_CDR(SCM_CAR(SCM_CDDR(ctype)))) { arg_types = Scm_Cons(SCM_CAR(SCM_CDDR(SCM_CAR(p))), arg_types); } arg_types = Scm_Reverse(arg_types); obj = SCM_LIST4(SCM_EQ(fnsym, SYM(c_func)) ? SYM(make_c_func) : SYM(make_c_func_vaargs), SCM_LIST2(SYM(quote), identifier), ret_type, arg_types); } else { obj = SCM_LIST3(SYM(make_c_var), SCM_LIST2(SYM(quote), identifier), ctype); } defchunk = Scm_MakeDefChunk(SYM(S_define_extern), identifier, SCM_LIST1(identifier), SCM_LIST3(SYM(S_define), identifier, obj)); Scm_DefChunkDictSetIdentifier(identifier, defchunk); Scm_RegisterIdentifier(identifier, obj); } ScmObj Scm_ExternalDeclaration(ScmObj declaration_specifiers, ScmObj init_declarator_list) { ScmObj p; Scm_ParserAttributeClear(); if (SCM_EQ(SCM_CAR(declaration_specifiers), SYM(U_typedef))) { emit_typedef(Scm_MakeTypeDeclList(SCM_CDR(declaration_specifiers), init_declarator_list)); } else { SCM_FOR_EACH(p, init_declarator_list) { ScmObj init_declarator = SCM_CAR(p); ScmObj declaration = Scm_MakeTypeDecl(declaration_specifiers, init_declarator); emit_define_extern(declaration); } } SCM_RETURN(SCM_UNDEFINED); } static void parse_macro_body(ScmObj name, ScmObj args, ScmObj body_str) { static ScmObj terminator = SCM_FALSE; ScmObj body; Scm_InitMacroParserState(); if (SCM_FALSEP(body_str)) { return; } Scm_AllReferencedInfoClear(); if (SCM_FALSEP(args)) { Scm_ArgPoolSet(SCM_NIL); } else { Scm_ArgPoolSet(args); } Scm_StartMacroSet(); Scm_LastTokenSet(SCM_FALSE); if (SCM_FALSEP(terminator)) { terminator = SCM_MAKE_STR_IMMUTABLE(";\n"); } Scm_SetInputString(SCM_STRING(Scm_StringAppend2(SCM_STRING(body_str), SCM_STRING(terminator)))); CGrammar(SCM_FALSE); body = Scm_MacroBodyRef(); if (SCM_FALSEP(body)) { /* DO NOTHING */ } else if ((SCM_FALSEP(Scm_UseIteratorP()) && (!SCM_FALSEP(Scm_UseJumpP()))) || (!SCM_FALSEP(Scm_UseReturnP()))) { /* DO NOTHING */ } else if (SCM_FALSEP(args)) { if (SCM_PAIRP(body) && SCM_PAIRP(SCM_CDR(body)) && SCM_EQ(SYM(scm_cast), SCM_CAR(body)) && SCM_EQ(SCM_CDDR(body), SCM_NIL)) { /* matched ('scm-cast v) */ ScmObj v = SCM_CADR(body); if (!SCM_EQ(name, v)) { /* new_body = `(c-delay (lambda () (c-cast ,v)) ',v)) */ ScmObj new_body = SCM_LIST3(SYM(c_delay), SCM_LIST3(SYM(lambda), SCM_NIL, SCM_LIST2(SYM(c_cast), v)), SCM_LIST2(SYM(quote), v)); Scm_EmitDefineCmacro(name, new_body); } } else if (!SCM_EQ(name, body)) { Scm_EmitDefineCmacro(name, body); } } else { Scm_EmitDefineCfunclikeMacro(name, args, body); } } ScmObj Scm_ParseMacroCode(ScmObj in, ScmObj macro_list) { static ScmObj trigger_line = SCM_FALSE; ScmObj line_str; /* skip the first line '# 1 ""' */ Scm_ReadLineUnsafe(SCM_PORT(in)); if (SCM_FALSEP(trigger_line)) { trigger_line = SCM_MAKE_STR_IMMUTABLE("# 1 \"\""); } while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) { if (Scm_StringEqual(SCM_STRING(trigger_line), SCM_STRING(line_str))) { break; } } while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) { if (SCM_NULLP(macro_list)) { Scm_Error("[bug] lost macro body"); } else { ScmObj pos_name_args = SCM_CDAR(macro_list); macro_list = SCM_CDR(macro_list); Scm_FilenameSet(SCM_CAAR(pos_name_args)); Scm_LineNumberSet(SCM_INT_VALUE(SCM_CDAR(pos_name_args))); parse_macro_body(SCM_CADR(pos_name_args), SCM_CDDR(pos_name_args), line_str); } } SCM_RETURN(SCM_UNDEFINED); } ScmObj Scm_BridgeSymbols(ScmObj module, ScmObj syms, ScmObj hides) { ScmObj ffi_sandbox = ffi_sandbox_module(); if (SCM_FALSEP(syms)) { int i; for (i = 0; i < defchunk_dict.size; ++i) { ScmObj defchunk = Scm_VectorRef(defchunk_dict.chunk_vector, i, SCM_FALSE); ScmObj defchunk_syms = SCM_DEFCHUNK_SYMBOL_LIST(defchunk); ScmObj p; SCM_FOR_EACH(p, defchunk_syms) { ScmObj sym = SCM_CAR(p); if (SCM_FALSEP(Scm_Memq(sym, hides))) { Scm_Define(SCM_MODULE(module), SCM_SYMBOL(sym), Scm_GlobalVariableRef(SCM_MODULE(ffi_sandbox), SCM_SYMBOL(sym), 0)); } } } } else { ScmObj p; SCM_FOR_EACH(p, syms) { ScmObj sym = SCM_CAR(p); if (SCM_FALSEP(Scm_Memq(sym, hides))) { Scm_Define(SCM_MODULE(module), SCM_SYMBOL(sym), Scm_GlobalVariableRef(SCM_MODULE(ffi_sandbox), SCM_SYMBOL(sym), 0)); } } } SCM_RETURN(SCM_UNDEFINED); } /* a workaround for ansidecl.h */ #if defined(CONST) #undef CONST #endif #if defined(SIGNED) #undef SIGNED #endif #if defined(UNSIGNED) #undef UNSIGNED #endif #include "y.tab.c" static ScmObj error_proc = SCM_UNBOUND; int yylex() { ScmObj result; ScmObj token; ScmObj token_value; START_PROFILE(yylex); { START_PROFILE(c_scan); result = Scm_CScan(); END_PROFILE(c_scan); } if (SCM_PAIRP(result)) { token = SCM_CAR(result); yylval = SCM_CDR(result); } else { token = result; yylval = SCM_UNBOUND; } token_value = Scm_HashTableRef(SCM_HASH_TABLE(token_table), token, SCM_UNBOUND); if (SCM_UNBOUNDP(token_value)) { Scm_Error("Invalid token %S", token); } END_PROFILE(yylex); return SCM_INT_VALUE(token_value); } int yyerror(const char *str) { macro_body = SCM_FALSE; if (!SCM_FALSEP(error_proc)) { Scm_ApplyRec(error_proc, SCM_LIST1(SCM_MAKE_STR_IMMUTABLE(str))); } return 0; } ScmObj CGrammar(ScmObj error_reporter) { int result; if (!SCM_PROCEDUREP(error_reporter) && !SCM_FALSEP(error_reporter)) { Scm_Error(" or #f required, but got %S", error_reporter); } error_proc = error_reporter; init_parser(); result = yyparse(); SCM_RETURN(SCM_MAKE_INT(result)); } /* * Module initialization function. */ extern void Scm_Init_c_parserlib(ScmModule*); ScmObj Scm_Init_c_parser(void) { ScmModule *mod; /* Register this DSO to Gauche */ SCM_INIT_EXTENSION(c_parser); /* Create the module if it doesn't exist yet. */ mod = SCM_MODULE(SCM_FIND_MODULE(CPARSER_MODULE_NAME, TRUE)); /* Register stub-generated procedures */ Scm_Init_c_parserlib(mod); INIT_SYM(plus_op, "+"); INIT_SYM(with_module, "with-module"); INIT_SYM(c_wrapper, "c-wrapper"); INIT_SYM(c_wrapper_c_ffi, "c-wrapper.c-ffi"); INIT_SYM(c_wrapper_objc_ffi, "c-wrapper.objc-ffi"); INIT_SYM(ptr, "ptr"); INIT_SYM(quote, "quote"); INIT_SYM(char, "char"); INIT_SYM(U_signed, "SIGNED"); INIT_SYM(U_unsigned, "UNSIGNED"); INIT_SYM(short, "short"); INIT_SYM(int, "int"); INIT_SYM(long, "long"); INIT_SYM(float, "float"); INIT_SYM(double, "double"); INIT_SYM(void, "void"); INIT_SYM(_Bool, "_Bool"); INIT_SYM(__builtin_va_list, "__builtin_va_list"); INIT_SYM(U_struct, "STRUCT"); INIT_SYM(U_union, "UNION"); INIT_SYM(U_enum, "ENUM"); INIT_SYM(c_char, ""); INIT_SYM(c_uchar, ""); INIT_SYM(c_short, ""); INIT_SYM(c_ushort, ""); INIT_SYM(c_int, ""); INIT_SYM(c_uint, ""); INIT_SYM(c_long, ""); INIT_SYM(c_ulong, ""); INIT_SYM(c_longlong, ""); INIT_SYM(c_ulonglong, ""); INIT_SYM(c_float, ""); INIT_SYM(c_double, ""); INIT_SYM(c_longdouble, ""); INIT_SYM(c_void, ""); INIT_SYM(c_struct, "c-struct"); INIT_SYM(c_union, "c-union"); INIT_SYM(c_enum, "c-enum"); INIT_SYM(c_array, "c-array"); INIT_SYM(c_func, "c-func"); INIT_SYM(c_func_vaargs, "c-func-vaargs"); INIT_SYM(c_func_ptr, "c-func-ptr"); INIT_SYM(c_func_vaargs_ptr, "c-func-vaargs-ptr"); INIT_SYM(c_bit_field, "c-bit-field"); INIT_SYM(U_typedef, "TYPEDEF"); INIT_SYM(cast, "cast"); INIT_SYM(scm_cast, "scm-cast"); INIT_SYM(integer, ""); INIT_SYM(list, "list"); INIT_SYM(cons, "cons"); INIT_SYM(lambda, "lambda"); INIT_SYM(args, "args"); INIT_SYM(apply, "apply"); INIT_SYM(mode, "mode"); INIT_SYM(__mode__, "__mode__"); INIT_SYM(QI, "QI"); INIT_SYM(__QI__, "__QI__"); INIT_SYM(HI, "HI"); INIT_SYM(__HI__, "__HI__"); INIT_SYM(SI, "SI"); INIT_SYM(__SI__, "__SI__"); INIT_SYM(DI, "DI"); INIT_SYM(__DI__, "__DI__"); INIT_SYM(SF, "SF"); INIT_SYM(__SF__, "__SF__"); INIT_SYM(DF, "DF"); INIT_SYM(__DF__, "__DF__"); INIT_SYM(byte, "byte"); INIT_SYM(__byte__, "__byte__"); INIT_SYM(word, "word"); INIT_SYM(__word__, "__word__"); INIT_SYM(pointer, "pointer"); INIT_SYM(__pointer__, "__pointer__"); INIT_SYM(S_alloc_struct, "alloc-struct"); INIT_SYM(S_init_struct, "init-struct"); INIT_SYM(S_alloc_union, "alloc-union"); INIT_SYM(S_init_union, "init-union"); INIT_SYM(S_define_enum, "define-enum"); INIT_SYM(S_typedef, "typedef"); INIT_SYM(S_define_inline, "define-inline"); INIT_SYM(S_define_extern, "define-extern"); INIT_SYM(S_alloc_objc_class, "alloc-objc-class"); INIT_SYM(S_init_objc_class, "init-objc-class"); INIT_SYM(S_define_objc_method, "define-objc-method"); INIT_SYM(S_define_cmacro, "define-cmacro"); INIT_SYM(S_define_cfunclike_macro, "define-cfunclike-macro"); INIT_SYM(S_define, "define"); INIT_SYM(c_func, "c-func"); INIT_SYM(make_c_func, "make-c-func"); INIT_SYM(c_func_vaargs, "c-func-vaargs"); INIT_SYM(make_c_func_vaargs, "make-c-func-vaargs"); INIT_SYM(make_c_var, "make-c-var"); INIT_SYM(S_identity, "identity"); INIT_SYM(S_define_c_struct, "define-c-struct"); INIT_SYM(S_define_c_union, "define-c-union"); INIT_SYM(S_init_c_struct, "init-c-struct!"); INIT_SYM(S_init_c_union, "init-c-union!"); INIT_SYM(objc_object, "objc_object"); INIT_SYM(objc_lookup_class, "objc-lookup-class"); INIT_SYM(objc_register_method, "objc-register-method"); INIT_SYM(c_delay, "c-delay"); INIT_SYM(c_cast, "c-cast"); arg_pool = SCM_NIL; value_pool = SCM_FALSE; referenced_identifier_list = SCM_NIL; referenced_typename_list = SCM_NIL; #ifdef USE_PROFILER atexit(show_profile_result); #endif #ifdef USE_EVAL_COUNTER atexit(show_eval_counter); #endif } /* end of file */ gauche-c-wrapper-0.6.1.orig/src/c-parser.h0000644000000000000000000001757011237307542015167 0ustar /** * c-parser.h * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* Prologue */ #ifndef GAUCHE_CWRAPPER_PARSER_H #define GAUCHE_CWRAPPER_PARSER_H #include #include #include "c-lex.h" #include "c-ffi.h" #include "util.h" SCM_DECL_BEGIN #define CPARSER_MODULE_NAME "c-wrapper.c-parser" /* declarator */ typedef ScmObj DeclaratorProc(ScmObj type_decl, ScmObj *data); typedef struct ScmDeclaratorRec { SCM_HEADER; DeclaratorProc *func; ScmObj data[2]; } ScmDeclarator; SCM_CLASS_DECL(Scm_DeclaratorClass); #define SCM_CLASS_DECLARATOR (&Scm_DeclaratorClass) #define SCM_DECLARATOR(obj) ((ScmDeclarator*)obj) #define SCM_DECLARATORP(obj) SCM_XTYPEP(obj, SCM_CLASS_DECLARATOR) /* type-decl */ typedef struct ScmTypeDeclRec { SCM_HEADER; ScmObj type; ScmObj name; ScmObj init_value; } ScmTypeDecl; SCM_CLASS_DECL(Scm_TypeDeclClass); #define SCM_CLASS_TYPE_DECL (&Scm_TypeDeclClass) #define SCM_TYPE_DECL(obj) ((ScmTypeDecl*)obj) #define SCM_TYPE_DECL_P(obj) SCM_XTYPEP(obj, SCM_CLASS_TYPE_DECL) #define SCM_TYPE_DECL_CTYPE(obj) (SCM_TYPE_DECL(obj)->type) #define SCM_TYPE_DECL_NAME(obj) (SCM_TYPE_DECL(obj)->name) #define SCM_TYPE_DECL_INIT_VALUE(obj) (SCM_TYPE_DECL(obj)->init_value) /* DefChunk */ #define SCM_DEFCHUNK_TYPE(obj) Scm_VectorRef(SCM_VECTOR(obj), 0, SCM_FALSE) #define SCM_DEFCHUNK_SET_TYPE(obj, type) Scm_VectorSet(SCM_VECTOR(obj), 0, type) #define SCM_DEFCHUNK_IS_USED(obj) SCM_BOOL_VALUE(Scm_VectorRef(SCM_VECTOR(obj), 1, SCM_FALSE)) #define SCM_DEFCHUNK_SET_USED(obj) Scm_VectorSet(SCM_VECTOR(obj), 1, SCM_TRUE) #define SCM_DEFCHUNK_SET_UNUSED(obj) Scm_VectorSet(SCM_VECTOR(obj), 1, SCM_FALSE) #define SCM_DEFCHUNK_FILENAME(obj) Scm_VectorRef(SCM_VECTOR(obj), 2, SCM_FALSE) #define SCM_DEFCHUNK_SET_FILENAME(obj, filename) Scm_VectorSet(SCM_VECTOR(obj), 2, filename) #define SCM_DEFCHUNK_REFERENCED_TYPENAME_LIST(obj) Scm_VectorRef(SCM_VECTOR(obj), 3, SCM_NIL) #define SCM_DEFCHUNK_SET_REFERENCED_TYPENAME_LIST(obj, list) Scm_VectorSet(SCM_VECTOR(obj), 3, list) #define SCM_DEFCHUNK_REFERENCED_IDENTIFIER_LIST(obj) Scm_VectorRef(SCM_VECTOR(obj), 4, SCM_NIL) #define SCM_DEFCHUNK_SET_REFERENCED_IDENTIFIER_LIST(obj, list) Scm_VectorSet(SCM_VECTOR(obj), 4, list) #define SCM_DEFCHUNK_IDENTIFIER(obj) Scm_VectorRef(SCM_VECTOR(obj), 5, SCM_FALSE) #define SCM_DEFCHUNK_SET_IDENTIFIER(obj, val) Scm_VectorSet(SCM_VECTOR(obj), 5, val) #define SCM_DEFCHUNK_SYMBOL_LIST(obj) Scm_VectorRef(SCM_VECTOR(obj), 6, SCM_FALSE) #define SCM_DEFCHUNK_SET_SYMBOL_LIST(obj, val) Scm_VectorSet(SCM_VECTOR(obj), 6, val) #define SCM_DEFCHUNK_OBJECT(obj) Scm_VectorRef(SCM_VECTOR(obj), 7, SCM_FALSE) #define SCM_DEFCHUNK_SET_OBJECT(obj, val) Scm_VectorSet(SCM_VECTOR(obj), 7, val) extern ScmObj CParser_List(ScmObj v); extern ScmObj CParser_Append(ScmObj v0, ScmObj v1); extern ScmObj CParser_AddList(ScmObj v0, ScmObj v1); extern ScmObj CParser_Typename(ScmObj v); extern ScmObj CParser_ctype2class_symbol(ScmObj sym); extern ScmObj Scm_ArgPoolRef(); extern ScmObj Scm_ArgPoolSet(ScmObj lst); extern ScmObj Scm_ArgPoolAdd(ScmObj name); extern ScmObj Scm_ArgPoolClear(); extern ScmObj Scm_InitValuePool(); extern ScmObj Scm_RegisterIdentifier(ScmObj name, ScmObj value); extern ScmObj Scm_RegisteredIdentifierP(ScmObj name); extern ScmObj Scm_LookupValue(ScmObj v); extern ScmObj Scm_InitStructPool(); extern ScmObj Scm_InitUnionPool(); extern ScmObj Scm_InitMacroParserState(); extern ScmObj Scm_UseReturnP(); extern ScmObj Scm_UseReturnSet(ScmObj flag); extern ScmObj Scm_UseJumpP(); extern ScmObj Scm_UseJumpSet(ScmObj flag); extern ScmObj Scm_UseIteratorP(); extern ScmObj Scm_UseIteratorSet(ScmObj flag); extern ScmObj Scm_MacroBodyRef(); extern ScmObj Scm_MacroBodySet(ScmObj body); extern ScmObj Scm_ReferencedIdentifierListRef(); extern ScmObj Scm_ReferencedIdentifierListAdd(ScmObj identifier); extern ScmObj Scm_ReferencedIdentifierListClear(); extern ScmObj Scm_ReferencedTypenameListRef(); extern ScmObj Scm_ReferencedTypenameListAdd(ScmObj typename); extern ScmObj Scm_ReferencedTypenameListClear(); extern ScmObj Scm_AllReferencedInfoClear(); extern ScmObj Scm_ToInt(ScmObj v); extern ScmObj Scm_MakeTypeDecl(ScmObj type_spec_list, ScmObj declarator); extern ScmObj Scm_ComposeDeclarator(ScmObj d1, ScmObj d2); extern ScmObj Scm_IdentifierDeclarator(ScmObj name); extern ScmObj Scm_ArrayDeclarator(ScmObj size); extern ScmObj Scm_FuncDeclarator(ScmObj args); extern ScmObj Scm_FuncVaargsDeclarator(ScmObj args); extern ScmObj Scm_PtrDeclarator(); extern ScmObj Scm_BitFieldDeclarator(ScmObj n); extern ScmObj Scm_InitValueDeclarator(ScmObj v); extern ScmObj Scm_NullDeclarator(); extern ScmObj Scm_ComposeVariableAttribute(ScmObj decl); extern ScmObj Scm_MakeTypeDeclList(ScmObj type_spec_list, ScmObj decls); extern ScmObj Scm_ParameterDeclaration(ScmObj type_decl); extern ScmObj Scm_Declaration(ScmObj type_spec_list, ScmObj declarator_list); extern ScmObj Scm_DefChunkDictInit(); extern ScmObj Scm_DefChunkDictSetIdentifier(ScmObj identifier, ScmObj defchunk); extern ScmObj Scm_DefChunkDictSetTypename(ScmObj typename, ScmObj defchunk); extern ScmObj Scm_DefChunkDictSetMark(ScmProcedure *proc); extern ScmObj Scm_DefChunkDictForEach(ScmObj module_or_proc, ScmObj all_flag); extern ScmObj Scm_DefChunkDictAllSymbols(); extern ScmObj Scm_MakeDefChunk(ScmObj type, ScmObj id, ScmObj sym, ScmObj obj); extern ScmObj Scm_ExternalDeclaration(ScmObj declaration_specifiers, ScmObj init_declarator_list); extern ScmObj Scm_EmitAllocStruct(ScmObj tagname); extern ScmObj Scm_EmitInitStruct(ScmObj tagname, ScmObj member_list); extern ScmObj Scm_EmitAllocUnion(ScmObj tagname); extern ScmObj Scm_EmitInitUnion(ScmObj tagname, ScmObj member_list); extern ScmObj Scm_EmitDefineEnum(ScmObj tagname, ScmObj enum_alist); extern ScmObj Scm_EmitDefineInline(ScmObj declaration_specifiers, ScmObj declarator, ScmObj function_body); extern ScmObj Scm_EmitDefineObjcClass(ScmObj classname_list); extern ScmObj Scm_EmitObjcMethod(ScmObj keywords, ScmObj type_list); extern ScmObj Scm_EmitDefineCmacro(ScmObj name, ScmObj body); extern ScmObj Scm_EmitDefineCfunclikeMacro(ScmObj name, ScmObj args, ScmObj body); extern ScmObj Scm_ParseMacroCode(ScmObj in, ScmObj macro_list); extern ScmObj Scm_BridgeSymbols(ScmObj module, ScmObj syms, ScmObj hides); extern ScmObj CGrammar(ScmObj error_reporter); /* Epilogue */ SCM_DECL_END #endif /* GAUCHE_CWRAPPER_PARSER_H */ /* end of file */ gauche-c-wrapper-0.6.1.orig/src/c-parserlib.stub0000644000000000000000000002203411237307542016373 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; c-parserlib.stub ;; ;; Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; " #include \"c-parser.h\" " ;; (define-cproc pointer-size () ;; (code "int dmy __attribute__((__mode__(__pointer__)));" ;; "SCM_RETURN(SCM_MAKE_INT(sizeof(dmy)));")) ;; (define-cproc word-size () ;; (code "int dmy __attribute__((__mode__(__word__)));" ;; "SCM_RETURN(SCM_MAKE_INT(sizeof(dmy)));")) (define-cclass :built-in "ScmDeclarator*" "Scm_DeclaratorClass" () ()) (define-cclass :built-in "ScmTypeDecl*" "Scm_TypeDeclClass" () ()) (define-cclass :built-in "ScmStructAllocator*" "Scm_StructAllocatorClass" () ()) (define-cclass :built-in "ScmStructInitializer*" "Scm_StructInitializerClass" () ()) (define-cclass :built-in "ScmUnionAllocator*" "Scm_UnionAllocatorClass" () ()) (define-cclass :built-in "ScmUnionInitializer*" "Scm_UnionInitializerClass" () ()) (define-cclass :built-in "ScmEnumInitializer*" "Scm_EnumInitializerClass" () ()) (define-cclass :built-in "ScmTypedefDefiner*" "Scm_TypedefDefinerClass" () ()) (define-cclass :built-in "ScmInlineFunctionDefiner*" "Scm_InlineFunctionDefinerClass" () ()) (define-cclass :built-in "ScmExternDefiner*" "Scm_ExternDefinerClass" () ()) (define-cclass :built-in "ScmObjCClassDefiner*" "Scm_ObjCClassDefinerClass" () ()) (define-cclass :built-in "ScmObjCMethodDefiner*" "Scm_ObjCMethodDefinerClass" () ()) (define-cclass :built-in "ScmCMacroDefiner*" "Scm_CMacroDefinerClass" () ()) (define-cclass :built-in "ScmFunclikeCMacroDefiner*" "Scm_FunclikeCMacroDefinerClass" () ()) (define-cproc %LIST (v) (call "CParser_List")) (define-cproc %APPEND (v0 v1) (call "CParser_Append")) (define-cproc %ADD-LIST (v0 v1) (call "CParser_AddList")) (define-cproc %TYPENAME (v) (call "CParser_Typename")) (define-cproc c-type->class-symbol (sym) (call "CParser_ctype2class_symbol")) (define-cproc make-type-decl (type_spec_list declarator) (call "Scm_MakeTypeDecl")) (define-cproc name-of (v) (call "SCM_TYPE_DECL_NAME")) (define-cproc set-name! (v name) (code "SCM_TYPE_DECL_NAME(v) = name;" "SCM_RETURN(SCM_UNDEFINED);")) (define-cproc type-of (v) (call "SCM_TYPE_DECL_CTYPE")) (define-cproc set-type! (v type) (code "SCM_TYPE_DECL_CTYPE(v) = type;" "SCM_RETURN(SCM_UNDEFINED);")) (define-cproc value-of (v) (call "SCM_TYPE_DECL_INIT_VALUE")) (define-cproc set-value! (v val) (code "SCM_TYPE_DECL_INIT_VALUE(v) = val;" "SCM_RETURN(SCM_UNDEFINED);")) (define-cproc arg-pool () (call "Scm_ArgPoolRef")) (define-cproc arg-pool-set! (lst) (call "Scm_ArgPoolSet")) (define-cproc arg-pool-add! (name) (call "Scm_ArgPoolAdd")) (define-cproc arg-pool-clear! () (call "Scm_ArgPoolClear")) (define-cproc init-value-pool () (call "Scm_InitValuePool")) (define-cproc register-identifier (name value) (call "Scm_RegisterIdentifier")) (define-cproc registered-identifier? (name) (call "Scm_RegisteredIdentifierP")) (define-cproc c-lookup-value (v) (call "Scm_LookupValue")) (define-cproc init-struct-pool () (call "Scm_InitStructPool")) (define-cproc init-union-pool () (call "Scm_InitUnionPool")) (define-cproc init-macro-parser-state () (call "Scm_InitMacroParserState")) (define-cproc use-return? () (call "Scm_UseReturnP")) (define-cproc use-return-set! (flag) (call "Scm_UseReturnSet")) (define-cproc use-jump? () (call "Scm_UseJumpP")) (define-cproc use-jump-set! (flag) (call "Scm_UseJumpSet")) (define-cproc use-iterator? () (call "Scm_UseIteratorP")) (define-cproc use-iterator-set! (flag) (call "Scm_UseIteratorSet")) (define-cproc macro-body () (call "Scm_MacroBodyRef")) (define-cproc macro-body-set! (body) (call "Scm_MacroBodySet")) (define-cproc referenced-identifier-list () (call "Scm_ReferencedIdentifierListRef")) (define-cproc referenced-identifier-list-add! (identifier) (call "Scm_ReferencedIdentifierListAdd")) (define-cproc referenced-identifier-list-clear! () (call "Scm_ReferencedIdentifierListClear")) (define-cproc referenced-typename-list () (call "Scm_ReferencedTypenameListRef")) (define-cproc referenced-typename-list-add! (typename) (call "Scm_ReferencedTypenameListAdd")) (define-cproc referenced-typename-list-clear! () (call "Scm_ReferencedTypenameListClear")) (define-cproc all-referenced-info-clear! () (call "Scm_AllReferencedInfoClear")) (define-cproc %INT (v) (call "Scm_ToInt")) (define-cproc %COMPOSE-DECLARATOR (d1 d2) (call "Scm_ComposeDeclarator")) (define-cproc identifier-declarator (name) (call "Scm_IdentifierDeclarator")) (define-cproc array-declarator (size) (call "Scm_ArrayDeclarator")) (define-cproc func-declarator (args) (call "Scm_FuncDeclarator")) (define-cproc func-vaargs-declarator (args) (call "Scm_FuncVaargsDeclarator")) (define-cproc ptr-declarator () (call "Scm_PtrDeclarator")) (define-cproc bit-field-declarator (n) (call "Scm_BitFieldDeclarator")) (define-cproc init-value-declarator (v) (call "Scm_InitValueDeclarator")) (define-cproc null-declarator () (call "Scm_NullDeclarator")) (define-cproc compose-variable-attribute (decl) (call "Scm_ComposeVariableAttribute")) (define-cproc make-type-decl-list (type_spec_list decls) (call "Scm_MakeTypeDeclList")) (define-cproc parameter-declaration (type_decl) (call "Scm_ParameterDeclaration")) (define-cproc declaration (type_spec_list declarator_list) (call "Scm_Declaration")) ;;; (define-cproc defchunk-dict-init () (call "Scm_DefChunkDictInit")) (define-cproc defchunk-dict-set-identifier! (identifier defchunk) (call "Scm_DefChunkDictSetIdentifier")) (define-cproc defchunk-dict-set-typename! (typaname defchunk) (call "Scm_DefChunkDictSetTypename")) (define-cproc defchunk-dict-set-mark! (proc::) (call "Scm_DefChunkDictSetMark")) (define-cproc defchunk-dict-for-each (module_or_proc all_flag) (call "Scm_DefChunkDictForEach")) (define-cproc defchunk-dict-all-symbols () (call "Scm_DefChunkDictAllSymbols")) ;;; (define-cproc make-defchunk (type id sym obj) (call "Scm_MakeDefChunk")) (define-cproc defchunk-type (defchunk) (call "SCM_DEFCHUNK_TYPE")) (define-cproc defchunk-filename (defchunk) (call "SCM_DEFCHUNK_FILENAME")) (define-cproc defchunk-identifier (defchunk) (call "SCM_DEFCHUNK_IDENTIFIER")) (define-cproc defchunk-symbol-list (defchunk) (call "SCM_DEFCHUNK_SYMBOL_LIST")) (define-cproc defchunk-object (defchunk) (call "SCM_DEFCHUNK_OBJECT")) ;;; (define-cproc external-declaration (declaration_specifiers init_declarator_list) (call "Scm_ExternalDeclaration")) (define-cproc emit-alloc-struct (tagname) (call "Scm_EmitAllocStruct")) (define-cproc emit-init-struct (tagname member_list) (call "Scm_EmitInitStruct")) (define-cproc emit-alloc-union (tagname) (call "Scm_EmitAllocUnion")) (define-cproc emit-init-union (tagname member_list) (call "Scm_EmitInitUnion")) (define-cproc emit-define-enum (tagname enum_alist) (call "Scm_EmitDefineEnum")) (define-cproc emit-define-inline (declaration_specifiers declarator function_body) (call "Scm_EmitDefineInline")) (define-cproc emit-define-objc-class (classname_list) (call "Scm_EmitDefineObjcClass")) (define-cproc emit-objc-method (keywords type_list) (call "Scm_EmitObjcMethod")) (define-cproc emit-define-cmacro (name body) (call "Scm_EmitDefineCmacro")) (define-cproc emit-define-cfunclike-macro (name args body) (call "Scm_EmitDefineCfunclikeMacro")) (define-cproc parse-macro-code (in macro_list) (call "Scm_ParseMacroCode")) (define-cproc c-grammar (error_reporter) (call "CGrammar")) (define-cproc bridge-symbols (module syms hides) (call "Scm_BridgeSymbols")) ;; Local variables: ;; mode: scheme ;; end: gauche-c-wrapper-0.6.1.orig/src/closure_alloc.c0000644000000000000000000000641611237307542016271 0ustar /** * closure_alloc.c - ffi_closure allocator * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "closure_alloc.h" #define UNIT 8 #define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) #define CLOSURE_SIZE (ALIGN(sizeof(ffi_closure), UNIT)) typedef struct FreeNodeRec { void *start; int n; struct FreeNodeRec *next; } FreeNode; static FreeNode *free_list_start = NULL; static void expand_area() { void *area; FreeNode *node; int page_size = getpagesize(); area = mmap(NULL, page_size, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (area == MAP_FAILED) { perror("mmap"); exit(EXIT_FAILURE); } node = malloc(sizeof(FreeNode)); if (node == NULL) { perror("malloc"); exit(EXIT_FAILURE); } node->start = area; node->n = page_size / CLOSURE_SIZE; node->next = free_list_start; free_list_start = node; } ffi_closure *closure_alloc() { FreeNode *node; ffi_closure *ptr; if (free_list_start == NULL) { expand_area(); } node = free_list_start; ptr = node->start + (node->n - 1)*CLOSURE_SIZE; if (node->n == 1) { free_list_start = node->next; free(node); } else { --(node->n); } return ptr; } void closure_free(ffi_closure *ptr) { FreeNode *node = free_list_start; while (node != NULL) { if ((node->start + node->n*CLOSURE_SIZE) == (void*) ptr) { ++(node->n); return; } } node = malloc(sizeof(FreeNode)); node->start = (void*) ptr; node->n = 1; node->next = free_list_start; free_list_start = node; } /* end of file */ gauche-c-wrapper-0.6.1.orig/src/closure_alloc.h0000644000000000000000000000370711237307542016276 0ustar /** * closure_alloc.h - closure allocator * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef GAUCHE_CWRAPPER_CLOSURE_ALLOC_H #define GAUCHE_CWRAPPER_CLOSURE_ALLOC_H #include #include #include #include #include extern ffi_closure *closure_alloc(); extern void closure_free(ffi_closure *ptr); #endif /* end of file */ gauche-c-wrapper-0.6.1.orig/src/cwcompile.in0000755000000000000000000000555511237307542015617 0ustar #!@GOSH@ ;; -*- coding: utf-8; mode: scheme -*- ;; ;; cwcompile - stub generator for c-wrapper ;; ;; Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated ;; documentation files (the "Software"), to deal in the ;; Software without restriction, including without limitation ;; the rights to use, copy, modify, merge, publish, distribute, ;; sublicense, and/or sell copies of the Software, and to ;; permit persons to whom the Software is furnished to do so, ;; subject to the following conditions: ;; ;; The above copyright notice and this permission notice shall ;; be included in all copies or substantial portions of the ;; Software. ;; ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ;; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ;; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;; ;; $Id: $ (use gauche.parseopt) (use c-wrapper.stubgen) (define (usage progname) (format #t "Usage: ~a [options] ...~%" (sys-basename progname)) (print " Generate .so file from scheme file(s).") (print "") (print "Options:") (print " -v, --verbose : reports commands being executed.") (print " --clean : removes the intermidiate and output files.") (print " --cppflags=CPPFLAGS : extra cpp flags for compile.") (print " --cflags=CFLAGS : extra cc flags for compile.") (print " --ldflags=LDFLAGS : extra ld flags.") (print " --libs=LIBS : extra libraries.") (exit 1)) (define (main args) (let ((prognam (car args))) (let-args (cdr args) ((clean? "clean" #f) (cppflags "cppflags=s" "") (cflags "cflags=s" "") (ldflags "ldflags=s" "") (libs "libs=s" "") (verbose? "v|verbose" #f) (help? "h|help" => (cut usage prognam)) (else (option . _) (format #t "unrecognized option: ~a" option) (usage prognam)) . args) (when (null? args) (usage prognam)) (for-each (lambda (scm-file) (compile-wrapper scm-file (if clean? 'clean 'compile) cflags cppflags ldflags (string-append libs " @CWCOMPILE_DEFAULT_LIBS@") verbose?)) args))) 0) ;; Local variables: ;; mode: scheme ;; end: gauche-c-wrapper-0.6.1.orig/src/genyacc.scm0000644000000000000000000003466611237307542015424 0ustar ;; -*- coding: utf-8; mode: scheme -*- ;; ;; genyacc.scm - Generate YACC source. ;; ;; Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. Neither the name of the authors nor the names of its contributors ;; may be used to endorse or promote products derived from this ;; software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; (use gauche.parseopt) (use util.match) (use srfi-11) (use srfi-1) (use gauche.cgen.unit) (define cfunc-table (make-hash-table)) (define (register-cfunc! scm-name c-name) (hash-table-put! cfunc-table scm-name c-name)) (define (has-cfunc? scm-name) (hash-table-exists? cfunc-table scm-name)) (define (cfunc-name scm-name) (hash-table-get cfunc-table scm-name #f)) (define (use-stub filename) (call-with-input-file filename (lambda (in) (port-for-each (lambda (expr) (match expr (('define-cproc scm-name args ('call c-name)) (register-cfunc! scm-name c-name)) (else #f))) (cut read in))))) (define-class () ((decl-part :init-value '()) (rule-part :init-value '()) (profiler-table :init-value (make-hash-table 'equal?)) (token-list :init-value '()) (object-alist :init-value '()))) (define make-name (let ((counter 0)) (lambda () (inc! counter) #`"name_,counter"))) (define (ccode-list context args) (let ((len (length args))) (case len ((0) "SCM_NIL") ((1) #`"SCM_LIST1(,(scm->c context (ref args 0)))") ((2) #`"SCM_LIST2(,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)))") ((3) #`"SCM_LIST3(,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)))") ((4) #`"SCM_LIST4(,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)),, ,(scm->c context (ref args 3)))") ((5) #`"SCM_LIST5(,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)),, ,(scm->c context (ref args 3)),, ,(scm->c context (ref args 4)))") (else #`"Scm_Cons(,(scm->c context (car args)),, ,(ccode-list context (cdr args)))")))) (define (ccode-eval context expr) (let ((func-name (car expr)) (args (cdr expr))) (case (length args) ((0) #`"Scm_ApplyRec0(,func-name)") ((1) #`"Scm_ApplyRec1(,func-name,, ,(scm->c context (ref args 0)))") ((2) #`"Scm_ApplyRec2(,func-name,, ,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)))") ((3) #`"Scm_ApplyRec3(,func-name,, ,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)))") ((4) #`"Scm_ApplyRec4(,func-name,, ,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)),, ,(scm->c context (ref args 3)))") ((5) #`"Scm_ApplyRec5(,func-name,, ,(scm->c context (ref args 0)),, ,(scm->c context (ref args 1)),, ,(scm->c context (ref args 2)),, ,(scm->c context (ref args 3)),, ,(scm->c context (ref args 4)))") (else #`"Scm_ApplyRec (,func-name,, ,(ccode-list context args))")))) (define (analyze-args scm-code) (define (traverse args code cont) (cond ((null? code) (cont args)) ((pair? code) (let-values (((head rest) (car+cdr code))) (cond ((pair? head) (traverse args head (cut traverse <> rest cont))) ((#/^\$\d+$/ (x->string head)) (traverse (if (memq head args) args (cons head args)) rest cont)) (else (traverse args rest cont))))) (else (traverse args (list code) cont)))) (traverse '() scm-code reverse)) (define (ccode-value-list vals) (define (cconst v) (match v ((? symbol? v) #`"SCM_INTERN(\",v\")") ((? fixnum? v) #`"SCM_MAKE_INT(,v)"))) (let ((len (length vals))) (case len ((0) "SCM_NIL") ((1) #`"SCM_LIST1(,(cconst (ref vals 0)))") ((2) #`"SCM_LIST2(,(cconst (ref vals 0)),, ,(cconst (ref vals 1)))") ((3) #`"SCM_LIST3(,(cconst (ref vals 0)),, ,(cconst (ref vals 1)),, ,(cconst (ref vals 2)))") ((4) #`"SCM_LIST4(,(cconst (ref vals 0)),, ,(cconst (ref vals 1)),, ,(cconst (ref vals 2)),, ,(cconst (ref vals 3)))") ((5) #`"SCM_LIST5(,(cconst (ref vals 0)),, ,(cconst (ref vals 1)),, ,(cconst (ref vals 2)),, ,(cconst (ref vals 3)),, ,(cconst (ref vals 4)))") (else #`"Scm_Cons(,(cconst (car vals)),, ,(ccode-value-list (cdr vals)))")))) (define (yacc-arg? x) (#/^\$\d+$/ (x->string x))) (define (cobj context v) (or (and-let* ((pair (find (lambda (pair) (equal? (cdr pair) v)) (ref context 'object-alist)))) (car pair)) (let ((name (make-name))) (register-object! context name v) name))) (define (register-object! context name v) (push! (ref context 'object-alist) (cons name v))) (define (scm->c context expr) (match expr (() "SCM_NIL") ((? yacc-arg? v) #`",v") (('quote (vals ...)) (cobj context `(quote ,vals))) (('quote sym) (cobj context `(quote ,sym))) (#f "SCM_FALSE") ((? fixnum? x) #`"SCM_MAKE_INT(,x)") (('car v) #`"SCM_CAR(,(scm->c context v))") (('cdr v) #`"SCM_CDR(,(scm->c context v))") (('caar v) #`"SCM_CAAR(,(scm->c context v))") (('cadr v) #`"SCM_CADR(,(scm->c context v))") (('cdar v) #`"SCM_CDAR(,(scm->c context v))") (('cddr v) #`"SCM_CDDR(,(scm->c context v))") (('list vals ...) (ccode-list context vals)) ((? symbol? v) (cobj context v)) ((? keyword? v) (cobj context v)) ((? string? v) (cobj context v)) ((func-name args ...) (if (has-cfunc? func-name) (format "~a(~a)" (cfunc-name func-name) (string-join (map (lambda (arg) (scm->c context arg)) args) ",")) (let ((c-name (cobj context func-name))) (ccode-eval context (cons c-name args))))))) (define (generate-action context action) (define (%generate-ccode expr tail?) (format "~a~a;" (if tail? "$$ = " "") (scm->c context expr))) (let ((ccode (match action (('begin expr ...) (let loop ((rest expr) (body '())) (if (null? rest) (string-join (reverse body) " ") (loop (cdr rest) (cons (%generate-ccode (car rest) (null? (cdr rest))) body))))) (else (%generate-ccode action #t)))) (name (make-name))) (hash-table-put! (ref context 'profiler-table) name action) #`"{ START_PROFILE(,name) ,ccode END_PROFILE(,name) }")) (define (rule-parser context lst) (let loop ((result '()) (rest lst)) (match rest (((elements ...) ': action rest ...) (loop (cons (cons elements (generate-action context action)) result) rest)) (((elements ...) rest ...) (loop (cons (cons elements #f) result) rest)) (() (reverse result))))) (define (token-symbol-cname identifier) (string->symbol #`"token_sym_,(cgen-safe-name-friendly (x->string identifier))")) (define (lalr-parser context lst) (for-each (lambda (sexp) (match sexp (('expect: n) #f) (('output: func filename) #f) (('ID identifiers ...) (for-each (lambda (identifier) (push! (ref context 'decl-part) (format "%token ~a" (cgen-safe-name-friendly (x->string identifier)))) (register-object! context (token-symbol-cname identifier) `(quote ,identifier)) (push! (ref context 'token-list) identifier)) identifiers)) ((rule-name rest ...) (push! (ref context 'rule-part) (with-output-to-string (lambda () (let ((rules (rule-parser context rest))) (format #t "~a~%" (cgen-safe-name-friendly (x->string rule-name))) (fold (lambda (rule separator) (format #t "\t~a ~a ~a~%" separator (string-join (map (lambda (sym) (cgen-safe-name-friendly (x->string sym))) (car rule)) " ") (or (cdr rule) "")) "|") ":" rules) (print ";")))))))) lst)) (define (write-code context ofile) (with-output-to-file ofile (lambda () (print "%{") (print "#define YYSTYPE ScmObj") (print "static ScmObj token_table = SCM_UNBOUND;") (for-each (lambda (name) (print #`"static ScmObj ,name = SCM_UNBOUND;")) (map car (slot-ref context 'object-alist))) (print "#ifdef USE_PROFILER") (for-each (lambda (name) (print #`"static long long _profile_,|name|_count = 0;") (print #`"static long long _profile_,|name|_time = 0;")) (hash-table-keys (slot-ref context 'profiler-table))) (print "#endif") (print "%}") (for-each (lambda (decl) (print decl)) (reverse (slot-ref context 'decl-part))) (print "%%") (for-each (lambda (rule) (print rule)) (reverse (slot-ref context 'rule-part))) (print "%%") (print "#ifdef USE_PROFILER") (print "static void show_profile_result()") (print "{") (print " fprintf(stderr, \"---\\n\");") (hash-table-for-each (slot-ref context 'profiler-table) (lambda (name action) (print #`" fprintf(stderr, \"%s\\t%lld\\t%lld\\n\",, \",|action|\",, _profile_,|name|_count,, _profile_,|name|_time);"))) (print "}") (print "#endif") (print "void init_parser()") (print "{") (print " if (!SCM_UNBOUNDP(token_table)) {") (print " /* already initialized */") (print " return;") (print " }") (for-each (lambda (pair) (let ((init (match (cdr pair) (('quote (vals ...)) (ccode-value-list vals)) (('quote (? symbol? sym)) #`"SCM_INTERN(\",sym\")") ((? keyword? v) #`"SCM_MAKE_KEYWORD(\",v\")") ((? string? str) #`"SCM_MAKE_STR_IMMUTABLE(\",str\")") ((? symbol? sym) #`"SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME,, \",sym\")")))) (print #`" ,(car pair) = ,init;"))) (slot-ref context 'object-alist)) (print #`" token_table = Scm_MakeHashTableSimple(SCM_HASH_EQ, ,(length (slot-ref context 'token-list)));") (for-each (lambda (token) (print #`" Scm_HashTableSet(SCM_HASH_TABLE(token_table),, ,(token-symbol-cname token),, SCM_MAKE_INT(,(cgen-safe-name-friendly (x->string token))),, 0);")) (slot-ref context 'token-list)) (print " Scm_HashTableSet(SCM_HASH_TABLE(token_table), SCM_INTERN(\"*eoi*\"), SCM_MAKE_INT(0), 0);") (print "}") (print "")))) (define (scm->y ifile ofile) (let ((context (make ))) (hash-table-put! (ref context 'profiler-table) "yylex" '(yylex)) (hash-table-put! (ref context 'profiler-table) "c_scan" '(c_scan)) (with-input-from-file ifile (lambda () (port-for-each (lambda (sexp) (match sexp (('lalr-parser rest ...) (lalr-parser context rest)))) read))) (write-code context ofile))) (define (main args) (let-args (cdr args) ((outfile "o|outfile=s") . args) (let* ((ifile (car args)) (ofile (or outfile (if (#/\.scm$/ ifile) (regexp-replace #/\.scm$/ ifile ".y") #`",|ifile|.y")))) (use-stub "./c-parserlib.stub") (use-stub "./c-ffilib.stub") (scm->y ifile ofile))) 0) ;; end of file gauche-c-wrapper-0.6.1.orig/src/Makefile.in0000644000000000000000000000534011237307542015337 0ustar # # $Id: Makefile.in 644 2009-07-13 14:27:00Z naoki $ # # General info SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ datarootdir = @datarootdir@ srcdir = @srcdir@ VPATH = $(srcdir) # These may be overridden by make invocators DESTDIR = GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@ INSTALL = @GAUCHE_INSTALL@ CPPFLAGS = -I./libffi/include -DGAUCHE_API_0_8_8 @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = libffi/.libs/libffi.a @LIBS@ YACC = @YACC@ # Other parameters SOEXT = @SOEXT@ OBJEXT = @OBJEXT@ EXEEXT = @EXEEXT@ # Module-specific stuff PACKAGE = c-wrapper ARCHFILES = c-ffi.$(SOEXT) c-lex.$(SOEXT) c-parser.$(SOEXT) SCMFILES = HEADERS = TARGET = libffi/.libs/libffi.a $(ARCHFILES) GENERATED = libffi CONFIG_GENERATED = libffi/Makefile Makefile cwcompile GAUCHE_PKGINCDIR = @GAUCHE_PKGINCDIR@ GAUCHE_PKGLIBDIR = @GAUCHE_PKGLIBDIR@ GAUCHE_PKGARCHDIR = @GAUCHE_PKGARCHDIR@ ffi_SRCS = c-ffi.c c-ffilib.stub closure_alloc.c @OBJC_ENABLE_TRUE@ffi_SRCS += ObjCError.c clex_SRCS = c-lex.c c-lexlib.stub cparser_SRCS = c-parser.c c-parserlib.stub cparser_LIBS = @CPARSER_LIBS@ all : $(TARGET) libffi/Makefile: mkdir -p libffi cd libffi; ../../libffi/configure --with-pic libffi/.libs/libffi.a: libffi/Makefile cd libffi; $(MAKE) c-ffi.$(SOEXT): $(ffi_SRCS) $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-ffi $(ffi_SRCS) c-lex.$(SOEXT): $(clex_SRCS) $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-lex $(clex_SRCS) c-parser.$(SOEXT): $(cparser_SRCS) y.tab.c $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS) $(cparser_LIBS)" --verbose c-parser $(cparser_SRCS) c-grammar.y: c-grammar.scm genyacc.scm $(GOSH) genyacc.scm --outfile=c-grammar.y $< y.tab.c: c-grammar.y $(YACC) $< install : all $(INSTALL) -m 444 -T $(DESTDIR)$(GAUCHE_PKGINCDIR) $(HEADERS) $(INSTALL) -m 555 -T $(DESTDIR)$(GAUCHE_PKGARCHDIR) $(ARCHFILES) $(INSTALL) -m 555 -T $(DESTDIR)$(bindir) cwcompile uninstall : $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGINCDIR) $(HEADERS) $(INSTALL) -U $(DESTDIR)$(GAUCHE_PKGARCHDIR) $(ARCHFILES) $(INSTALL) -U $(DESTDIR)$(bindir) cwcompile clean : $(GAUCHE_PACKAGE) compile --clean c-ffi $(ffi_SRCS) $(GAUCHE_PACKAGE) compile --clean c-lex $(clex_SRCS) $(GAUCHE_PACKAGE) compile --clean c-parser $(cparser_SRCS) rm -rf core $(TARGET) $(GENERATED) *.o *~ so_locations distclean : clean rm -rf $(CONFIG_GENERATED) maintainer-clean : clean rm -rf $(CONFIG_GENERATED) libffi c-grammar.y y.tab.c gauche-c-wrapper-0.6.1.orig/src/ObjCError.c0000644000000000000000000000564711237307542015277 0ustar /** * ObjCError.m * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: ffi.c 233 2006-05-03 15:58:37Z naoki $ */ #include #include #include #import "ObjCError.h" static ScmObj objc_error_allocate(ScmClass *klass, ScmObj initargs); static void objc_error_print(ScmObj objc_error, ScmPort *port, ScmWriteContext *ctx); static ScmClass *default_cpl[] = { SCM_CLASS_STATIC_PTR(Scm_TopClass), NULL }; SCM_DEFINE_BASE_CLASS(Scm_ObjCErrorClass, ScmObjCError, objc_error_print, NULL, NULL, objc_error_allocate, default_cpl); static ScmObj objc_error_allocate(ScmClass *klass, ScmObj initargs) { ScmObjCError *err = SCM_ALLOCATE(ScmObjCError, klass); SCM_SET_CLASS(err, klass); err->name = SCM_FALSE; err->reason = SCM_FALSE; SCM_RETURN(SCM_OBJ(err)); } static void objc_error_print(ScmObj obj, ScmPort *port, ScmWriteContext *ctx) { Scm_Printf(port, "#" , SCM_OBJC_ERROR(obj)->name, SCM_OBJC_ERROR(obj)->reason); } static ScmObj objc_error_name_get(ScmObjCError *err) { SCM_RETURN(err->name); } static ScmObj objc_error_reason_get(ScmObjCError *err) { SCM_RETURN(err->reason); } static ScmClassStaticSlotSpec objc_error_slots[] = { SCM_CLASS_SLOT_SPEC("name", objc_error_name_get, NULL), SCM_CLASS_SLOT_SPEC("reason", objc_error_reason_get, NULL), { NULL } }; ScmObj Scm_MakeObjCError(ScmObj name, ScmObj reason) { ScmObj e = objc_error_allocate(SCM_CLASS_OBJC_ERROR, SCM_NIL); SCM_OBJC_ERROR(e)->name = name; SCM_OBJC_ERROR(e)->reason = reason; SCM_RETURN(e); } void Scm_Init_ObjCError(ScmModule *mod) { Scm_InitStaticClass(&Scm_ObjCErrorClass, "", mod, objc_error_slots, 0); } gauche-c-wrapper-0.6.1.orig/src/ObjCError.h0000644000000000000000000000311411237307542015267 0ustar /** * ObjCError.h * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: $ */ typedef struct ScmObjCErrorRec { SCM_HEADER; ScmObj name; ScmObj reason; } ScmObjCError; SCM_CLASS_DECL(Scm_ObjCErrorClass); #define SCM_CLASS_OBJC_ERROR (&Scm_ObjCErrorClass) #define SCM_OBJC_ERROR(obj) ((ScmObjCError*)obj) #define SCM_OBJC_ERRORP(obj) SCM_XTYPEP(obj, SCM_CLASS_OBJC_ERROR) ScmObj Scm_MakeObjCError(ScmObj name, ScmObj reason); gauche-c-wrapper-0.6.1.orig/src/util.h0000644000000000000000000001162511237307542014423 0ustar /** * util.h * * Copyright (c) 2009 KOGURO, Naoki (naoki@koguro.net) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the authors nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* Prologue */ #ifndef GAUCHE_CWRAPPER_UTIL_H #define GAUCHE_CWRAPPER_UTIL_H #define SYM(x) sym_##x #define DEFINE_SYM(x) static ScmObj SYM(x) #define INIT_SYM(x, s) SYM(x)=SCM_INTERN(s) #define DEFINE_PROC0(cname, module, name) \ static inline ScmObj cname() \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec0(_proc)); \ } #define DEFINE_PROC1(cname, module, name) \ static inline ScmObj cname(ScmObj v0) \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec1(_proc, v0)); \ } #define DEFINE_PROC2(cname, module, name) \ static inline ScmObj cname(ScmObj v0, ScmObj v1) \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec2(_proc, v0, v1)); \ } #define DEFINE_PROC3(cname, module, name) \ static inline ScmObj cname(ScmObj v0, ScmObj v1, ScmObj v2) \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec3(_proc, v0, v1, v2); \ } #define DEFINE_PROC4(cname, module, name) \ static inline ScmObj cname(ScmObj v0, ScmObj v1, ScmObj v2, ScmObj v3) \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec4(_proc, v0, v1, v2, v3)); \ } #define DEFINE_PROC5(cname, module, name) \ static inline ScmObj cname(ScmObj v0, ScmObj v1, ScmObj v2, ScmObj v3, ScmObj v4) \ { \ static ScmObj _proc = SCM_UNBOUND; \ if (SCM_UNBOUNDP(_proc)) { \ _proc = SCM_SYMBOL_VALUE(module, name); \ } \ SCM_RETURN(Scm_ApplyRec5(_proc, v0, v1, v2, v3, v4)); \ } #endif /* GAUCHE_CWRAPPER_UTIL_H */ /* end of file */ gauche-c-wrapper-0.6.1.orig/src/y.tab.c0000644000000000000000000101300011237307542014444 0ustar /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 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 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 1 "c-grammar.y" #define YYSTYPE ScmObj static ScmObj token_table = SCM_UNBOUND; static ScmObj name_347 = SCM_UNBOUND; static ScmObj name_345 = SCM_UNBOUND; static ScmObj name_340 = SCM_UNBOUND; static ScmObj name_339 = SCM_UNBOUND; static ScmObj name_338 = SCM_UNBOUND; static ScmObj name_336 = SCM_UNBOUND; static ScmObj name_334 = SCM_UNBOUND; static ScmObj name_330 = SCM_UNBOUND; static ScmObj name_328 = SCM_UNBOUND; static ScmObj name_323 = SCM_UNBOUND; static ScmObj name_320 = SCM_UNBOUND; static ScmObj name_312 = SCM_UNBOUND; static ScmObj name_310 = SCM_UNBOUND; static ScmObj name_305 = SCM_UNBOUND; static ScmObj name_303 = SCM_UNBOUND; static ScmObj name_301 = SCM_UNBOUND; static ScmObj name_300 = SCM_UNBOUND; static ScmObj name_287 = SCM_UNBOUND; static ScmObj name_285 = SCM_UNBOUND; static ScmObj name_283 = SCM_UNBOUND; static ScmObj name_273 = SCM_UNBOUND; static ScmObj name_271 = SCM_UNBOUND; static ScmObj name_269 = SCM_UNBOUND; static ScmObj name_256 = SCM_UNBOUND; static ScmObj name_252 = SCM_UNBOUND; static ScmObj name_195 = SCM_UNBOUND; static ScmObj name_187 = SCM_UNBOUND; static ScmObj name_178 = SCM_UNBOUND; static ScmObj name_177 = SCM_UNBOUND; static ScmObj name_174 = SCM_UNBOUND; static ScmObj name_166 = SCM_UNBOUND; static ScmObj name_163 = SCM_UNBOUND; static ScmObj name_150 = SCM_UNBOUND; static ScmObj name_147 = SCM_UNBOUND; static ScmObj name_144 = SCM_UNBOUND; static ScmObj name_141 = SCM_UNBOUND; static ScmObj name_138 = SCM_UNBOUND; static ScmObj name_135 = SCM_UNBOUND; static ScmObj name_132 = SCM_UNBOUND; static ScmObj name_129 = SCM_UNBOUND; static ScmObj name_127 = SCM_UNBOUND; static ScmObj name_124 = SCM_UNBOUND; static ScmObj name_122 = SCM_UNBOUND; static ScmObj name_120 = SCM_UNBOUND; static ScmObj name_118 = SCM_UNBOUND; static ScmObj name_115 = SCM_UNBOUND; static ScmObj name_113 = SCM_UNBOUND; static ScmObj name_110 = SCM_UNBOUND; static ScmObj name_108 = SCM_UNBOUND; static ScmObj name_105 = SCM_UNBOUND; static ScmObj name_103 = SCM_UNBOUND; static ScmObj name_101 = SCM_UNBOUND; static ScmObj name_98 = SCM_UNBOUND; static ScmObj name_88 = SCM_UNBOUND; static ScmObj name_86 = SCM_UNBOUND; static ScmObj name_84 = SCM_UNBOUND; static ScmObj name_82 = SCM_UNBOUND; static ScmObj name_80 = SCM_UNBOUND; static ScmObj name_75 = SCM_UNBOUND; static ScmObj name_73 = SCM_UNBOUND; static ScmObj name_71 = SCM_UNBOUND; static ScmObj name_69 = SCM_UNBOUND; static ScmObj name_66 = SCM_UNBOUND; static ScmObj name_64 = SCM_UNBOUND; static ScmObj name_56 = SCM_UNBOUND; static ScmObj name_54 = SCM_UNBOUND; static ScmObj name_52 = SCM_UNBOUND; static ScmObj name_48 = SCM_UNBOUND; static ScmObj name_46 = SCM_UNBOUND; static ScmObj name_42 = SCM_UNBOUND; static ScmObj name_40 = SCM_UNBOUND; static ScmObj name_35 = SCM_UNBOUND; static ScmObj name_33 = SCM_UNBOUND; static ScmObj name_26 = SCM_UNBOUND; static ScmObj name_15 = SCM_UNBOUND; static ScmObj name_10 = SCM_UNBOUND; static ScmObj name_7 = SCM_UNBOUND; static ScmObj name_1 = SCM_UNBOUND; static ScmObj token_sym_START_MACRO = SCM_UNBOUND; static ScmObj token_sym_OBJC_STRING = SCM_UNBOUND; static ScmObj token_sym_AT_REQUIRED = SCM_UNBOUND; static ScmObj token_sym_AT_OPTIONAL = SCM_UNBOUND; static ScmObj token_sym_AT_DYNAMIC = SCM_UNBOUND; static ScmObj token_sym_AT_SYNTHESIZE = SCM_UNBOUND; static ScmObj token_sym_AT_PROPERTY = SCM_UNBOUND; static ScmObj token_sym_AT_SYNCHRONIZED = SCM_UNBOUND; static ScmObj token_sym_AT_FINALLY = SCM_UNBOUND; static ScmObj token_sym_AT_CATCH = SCM_UNBOUND; static ScmObj token_sym_AT_TRY = SCM_UNBOUND; static ScmObj token_sym_AT_THROW = SCM_UNBOUND; static ScmObj token_sym_AT_ALIAS = SCM_UNBOUND; static ScmObj token_sym_AT_CLASS = SCM_UNBOUND; static ScmObj token_sym_AT_PROTOCOL = SCM_UNBOUND; static ScmObj token_sym_AT_PROTECTED = SCM_UNBOUND; static ScmObj token_sym_AT_PRIVATE = SCM_UNBOUND; static ScmObj token_sym_AT_PUBLIC = SCM_UNBOUND; static ScmObj token_sym_AT_ENCODE = SCM_UNBOUND; static ScmObj token_sym_AT_DEFS = SCM_UNBOUND; static ScmObj token_sym_AT_SELECTOR = SCM_UNBOUND; static ScmObj token_sym_AT_END = SCM_UNBOUND; static ScmObj token_sym_AT_IMPLEMENTATION = SCM_UNBOUND; static ScmObj token_sym_AT_INTERFACE = SCM_UNBOUND; static ScmObj token_sym_EXTENSION = SCM_UNBOUND; static ScmObj token_sym_UNKNOWN = SCM_UNBOUND; static ScmObj token_sym_ASM = SCM_UNBOUND; static ScmObj token_sym_RETURN = SCM_UNBOUND; static ScmObj token_sym_BREAK = SCM_UNBOUND; static ScmObj token_sym_CONTINUE = SCM_UNBOUND; static ScmObj token_sym_GOTO = SCM_UNBOUND; static ScmObj token_sym_FOR = SCM_UNBOUND; static ScmObj token_sym_DO = SCM_UNBOUND; static ScmObj token_sym_WHILE = SCM_UNBOUND; static ScmObj token_sym_SWITCH = SCM_UNBOUND; static ScmObj token_sym_ELSE = SCM_UNBOUND; static ScmObj token_sym_IF = SCM_UNBOUND; static ScmObj token_sym_DEFAULT = SCM_UNBOUND; static ScmObj token_sym_CASE = SCM_UNBOUND; static ScmObj token_sym_RANGE = SCM_UNBOUND; static ScmObj token_sym_ELLIPSIS = SCM_UNBOUND; static ScmObj token_sym_ENUM = SCM_UNBOUND; static ScmObj token_sym_UNION = SCM_UNBOUND; static ScmObj token_sym_STRUCT = SCM_UNBOUND; static ScmObj token_sym_VOLATILE = SCM_UNBOUND; static ScmObj token_sym_CONST = SCM_UNBOUND; static ScmObj token_sym_UNSIGNED = SCM_UNBOUND; static ScmObj token_sym_SIGNED = SCM_UNBOUND; static ScmObj token_sym_RESTRICT = SCM_UNBOUND; static ScmObj token_sym_INLINE = SCM_UNBOUND; static ScmObj token_sym_REGISTER = SCM_UNBOUND; static ScmObj token_sym_AUTO = SCM_UNBOUND; static ScmObj token_sym_STATIC = SCM_UNBOUND; static ScmObj token_sym_EXTERN = SCM_UNBOUND; static ScmObj token_sym_TYPEDEF = SCM_UNBOUND; static ScmObj token_sym_TYPENAME = SCM_UNBOUND; static ScmObj token_sym_OR_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_XOR_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_AND_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_RIGHT_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_LEFT_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_SUB_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_ADD_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_MOD_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_DIV_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_MUL_ASSIGN = SCM_UNBOUND; static ScmObj token_sym_OR_OP = SCM_UNBOUND; static ScmObj token_sym_AND_OP = SCM_UNBOUND; static ScmObj token_sym_NE_OP = SCM_UNBOUND; static ScmObj token_sym_EQ_OP = SCM_UNBOUND; static ScmObj token_sym_GE_OP = SCM_UNBOUND; static ScmObj token_sym_LE_OP = SCM_UNBOUND; static ScmObj token_sym_RIGHT_OP = SCM_UNBOUND; static ScmObj token_sym_LEFT_OP = SCM_UNBOUND; static ScmObj token_sym_DEC_OP = SCM_UNBOUND; static ScmObj token_sym_INC_OP = SCM_UNBOUND; static ScmObj token_sym_PTR_OP = SCM_UNBOUND; static ScmObj token_sym_SIZEOF = SCM_UNBOUND; static ScmObj token_sym_STRING = SCM_UNBOUND; static ScmObj token_sym_CONSTANT = SCM_UNBOUND; static ScmObj token_sym_IDENTIFIER = SCM_UNBOUND; static ScmObj token_sym__GT = SCM_UNBOUND; static ScmObj token_sym__LT = SCM_UNBOUND; static ScmObj token_sym_P = SCM_UNBOUND; static ScmObj token_sym__3d = SCM_UNBOUND; static ScmObj token_sym__25 = SCM_UNBOUND; static ScmObj token_sym__26 = SCM_UNBOUND; static ScmObj token_sym__5e = SCM_UNBOUND; static ScmObj token_sym__2f = SCM_UNBOUND; static ScmObj token_sym__2a = SCM_UNBOUND; static ScmObj token_sym__ = SCM_UNBOUND; static ScmObj token_sym__2b = SCM_UNBOUND; static ScmObj token_sym_X = SCM_UNBOUND; static ScmObj token_sym__7e = SCM_UNBOUND; static ScmObj token_sym_COLON = SCM_UNBOUND; static ScmObj token_sym_DOT = SCM_UNBOUND; static ScmObj token_sym_OR = SCM_UNBOUND; static ScmObj token_sym_RPAREN = SCM_UNBOUND; static ScmObj token_sym_LPAREN = SCM_UNBOUND; static ScmObj token_sym_RSBRA = SCM_UNBOUND; static ScmObj token_sym_LSBRA = SCM_UNBOUND; static ScmObj token_sym_RCBRA = SCM_UNBOUND; static ScmObj token_sym_LCBRA = SCM_UNBOUND; static ScmObj token_sym_COMMA = SCM_UNBOUND; static ScmObj token_sym_SEMICOLON = SCM_UNBOUND; #ifdef USE_PROFILER static long long _profile_name_39_count = 0; static long long _profile_name_39_time = 0; static long long _profile_yylex_count = 0; static long long _profile_yylex_time = 0; static long long _profile_name_250_count = 0; static long long _profile_name_250_time = 0; static long long _profile_name_251_count = 0; static long long _profile_name_251_time = 0; static long long _profile_name_130_count = 0; static long long _profile_name_130_time = 0; static long long _profile_name_131_count = 0; static long long _profile_name_131_time = 0; static long long _profile_name_253_count = 0; static long long _profile_name_253_time = 0; static long long _profile_name_254_count = 0; static long long _profile_name_254_time = 0; static long long _profile_name_133_count = 0; static long long _profile_name_133_time = 0; static long long _profile_name_255_count = 0; static long long _profile_name_255_time = 0; static long long _profile_name_134_count = 0; static long long _profile_name_134_time = 0; static long long _profile_name_257_count = 0; static long long _profile_name_257_time = 0; static long long _profile_name_136_count = 0; static long long _profile_name_136_time = 0; static long long _profile_name_258_count = 0; static long long _profile_name_258_time = 0; static long long _profile_name_137_count = 0; static long long _profile_name_137_time = 0; static long long _profile_name_259_count = 0; static long long _profile_name_259_time = 0; static long long _profile_name_139_count = 0; static long long _profile_name_139_time = 0; static long long _profile_name_41_count = 0; static long long _profile_name_41_time = 0; static long long _profile_name_43_count = 0; static long long _profile_name_43_time = 0; static long long _profile_name_44_count = 0; static long long _profile_name_44_time = 0; static long long _profile_name_45_count = 0; static long long _profile_name_45_time = 0; static long long _profile_name_47_count = 0; static long long _profile_name_47_time = 0; static long long _profile_name_49_count = 0; static long long _profile_name_49_time = 0; static long long _profile_name_260_count = 0; static long long _profile_name_260_time = 0; static long long _profile_name_261_count = 0; static long long _profile_name_261_time = 0; static long long _profile_name_140_count = 0; static long long _profile_name_140_time = 0; static long long _profile_name_262_count = 0; static long long _profile_name_262_time = 0; static long long _profile_name_263_count = 0; static long long _profile_name_263_time = 0; static long long _profile_name_142_count = 0; static long long _profile_name_142_time = 0; static long long _profile_name_264_count = 0; static long long _profile_name_264_time = 0; static long long _profile_name_143_count = 0; static long long _profile_name_143_time = 0; static long long _profile_name_265_count = 0; static long long _profile_name_265_time = 0; static long long _profile_name_266_count = 0; static long long _profile_name_266_time = 0; static long long _profile_name_145_count = 0; static long long _profile_name_145_time = 0; static long long _profile_name_267_count = 0; static long long _profile_name_267_time = 0; static long long _profile_name_146_count = 0; static long long _profile_name_146_time = 0; static long long _profile_name_268_count = 0; static long long _profile_name_268_time = 0; static long long _profile_name_302_count = 0; static long long _profile_name_302_time = 0; static long long _profile_name_148_count = 0; static long long _profile_name_148_time = 0; static long long _profile_name_149_count = 0; static long long _profile_name_149_time = 0; static long long _profile_name_304_count = 0; static long long _profile_name_304_time = 0; static long long _profile_name_306_count = 0; static long long _profile_name_306_time = 0; static long long _profile_name_307_count = 0; static long long _profile_name_307_time = 0; static long long _profile_name_308_count = 0; static long long _profile_name_308_time = 0; static long long _profile_name_309_count = 0; static long long _profile_name_309_time = 0; static long long _profile_name_50_count = 0; static long long _profile_name_50_time = 0; static long long _profile_name_51_count = 0; static long long _profile_name_51_time = 0; static long long _profile_name_53_count = 0; static long long _profile_name_53_time = 0; static long long _profile_name_55_count = 0; static long long _profile_name_55_time = 0; static long long _profile_name_57_count = 0; static long long _profile_name_57_time = 0; static long long _profile_name_58_count = 0; static long long _profile_name_58_time = 0; static long long _profile_name_59_count = 0; static long long _profile_name_59_time = 0; static long long _profile_name_2_count = 0; static long long _profile_name_2_time = 0; static long long _profile_name_3_count = 0; static long long _profile_name_3_time = 0; static long long _profile_name_4_count = 0; static long long _profile_name_4_time = 0; static long long _profile_name_5_count = 0; static long long _profile_name_5_time = 0; static long long _profile_name_6_count = 0; static long long _profile_name_6_time = 0; static long long _profile_name_270_count = 0; static long long _profile_name_270_time = 0; static long long _profile_name_8_count = 0; static long long _profile_name_8_time = 0; static long long _profile_name_272_count = 0; static long long _profile_name_272_time = 0; static long long _profile_name_9_count = 0; static long long _profile_name_9_time = 0; static long long _profile_name_151_count = 0; static long long _profile_name_151_time = 0; static long long _profile_name_152_count = 0; static long long _profile_name_152_time = 0; static long long _profile_name_274_count = 0; static long long _profile_name_274_time = 0; static long long _profile_name_153_count = 0; static long long _profile_name_153_time = 0; static long long _profile_name_275_count = 0; static long long _profile_name_275_time = 0; static long long _profile_name_154_count = 0; static long long _profile_name_154_time = 0; static long long _profile_name_276_count = 0; static long long _profile_name_276_time = 0; static long long _profile_name_155_count = 0; static long long _profile_name_155_time = 0; static long long _profile_name_277_count = 0; static long long _profile_name_277_time = 0; static long long _profile_name_156_count = 0; static long long _profile_name_156_time = 0; static long long _profile_name_311_count = 0; static long long _profile_name_311_time = 0; static long long _profile_name_278_count = 0; static long long _profile_name_278_time = 0; static long long _profile_name_157_count = 0; static long long _profile_name_157_time = 0; static long long _profile_name_279_count = 0; static long long _profile_name_279_time = 0; static long long _profile_name_158_count = 0; static long long _profile_name_158_time = 0; static long long _profile_name_313_count = 0; static long long _profile_name_313_time = 0; static long long _profile_name_159_count = 0; static long long _profile_name_159_time = 0; static long long _profile_name_314_count = 0; static long long _profile_name_314_time = 0; static long long _profile_name_315_count = 0; static long long _profile_name_315_time = 0; static long long _profile_name_316_count = 0; static long long _profile_name_316_time = 0; static long long _profile_name_317_count = 0; static long long _profile_name_317_time = 0; static long long _profile_name_318_count = 0; static long long _profile_name_318_time = 0; static long long _profile_name_319_count = 0; static long long _profile_name_319_time = 0; static long long _profile_name_60_count = 0; static long long _profile_name_60_time = 0; static long long _profile_name_61_count = 0; static long long _profile_name_61_time = 0; static long long _profile_name_62_count = 0; static long long _profile_name_62_time = 0; static long long _profile_name_63_count = 0; static long long _profile_name_63_time = 0; static long long _profile_name_65_count = 0; static long long _profile_name_65_time = 0; static long long _profile_name_67_count = 0; static long long _profile_name_67_time = 0; static long long _profile_name_68_count = 0; static long long _profile_name_68_time = 0; static long long _profile_name_280_count = 0; static long long _profile_name_280_time = 0; static long long _profile_name_281_count = 0; static long long _profile_name_281_time = 0; static long long _profile_name_160_count = 0; static long long _profile_name_160_time = 0; static long long _profile_name_282_count = 0; static long long _profile_name_282_time = 0; static long long _profile_name_161_count = 0; static long long _profile_name_161_time = 0; static long long _profile_name_162_count = 0; static long long _profile_name_162_time = 0; static long long _profile_name_284_count = 0; static long long _profile_name_284_time = 0; static long long _profile_name_164_count = 0; static long long _profile_name_164_time = 0; static long long _profile_name_286_count = 0; static long long _profile_name_286_time = 0; static long long _profile_name_165_count = 0; static long long _profile_name_165_time = 0; static long long _profile_name_321_count = 0; static long long _profile_name_321_time = 0; static long long _profile_name_288_count = 0; static long long _profile_name_288_time = 0; static long long _profile_name_167_count = 0; static long long _profile_name_167_time = 0; static long long _profile_name_200_count = 0; static long long _profile_name_200_time = 0; static long long _profile_name_322_count = 0; static long long _profile_name_322_time = 0; static long long _profile_name_289_count = 0; static long long _profile_name_289_time = 0; static long long _profile_name_168_count = 0; static long long _profile_name_168_time = 0; static long long _profile_name_201_count = 0; static long long _profile_name_201_time = 0; static long long _profile_name_169_count = 0; static long long _profile_name_169_time = 0; static long long _profile_name_202_count = 0; static long long _profile_name_202_time = 0; static long long _profile_name_324_count = 0; static long long _profile_name_324_time = 0; static long long _profile_name_203_count = 0; static long long _profile_name_203_time = 0; static long long _profile_name_325_count = 0; static long long _profile_name_325_time = 0; static long long _profile_name_204_count = 0; static long long _profile_name_204_time = 0; static long long _profile_name_326_count = 0; static long long _profile_name_326_time = 0; static long long _profile_name_205_count = 0; static long long _profile_name_205_time = 0; static long long _profile_name_327_count = 0; static long long _profile_name_327_time = 0; static long long _profile_name_206_count = 0; static long long _profile_name_206_time = 0; static long long _profile_name_207_count = 0; static long long _profile_name_207_time = 0; static long long _profile_name_329_count = 0; static long long _profile_name_329_time = 0; static long long _profile_name_70_count = 0; static long long _profile_name_70_time = 0; static long long _profile_name_208_count = 0; static long long _profile_name_208_time = 0; static long long _profile_name_209_count = 0; static long long _profile_name_209_time = 0; static long long _profile_name_72_count = 0; static long long _profile_name_72_time = 0; static long long _profile_name_74_count = 0; static long long _profile_name_74_time = 0; static long long _profile_name_76_count = 0; static long long _profile_name_76_time = 0; static long long _profile_name_77_count = 0; static long long _profile_name_77_time = 0; static long long _profile_name_78_count = 0; static long long _profile_name_78_time = 0; static long long _profile_name_79_count = 0; static long long _profile_name_79_time = 0; static long long _profile_name_290_count = 0; static long long _profile_name_290_time = 0; static long long _profile_name_291_count = 0; static long long _profile_name_291_time = 0; static long long _profile_name_170_count = 0; static long long _profile_name_170_time = 0; static long long _profile_name_292_count = 0; static long long _profile_name_292_time = 0; static long long _profile_name_171_count = 0; static long long _profile_name_171_time = 0; static long long _profile_name_293_count = 0; static long long _profile_name_293_time = 0; static long long _profile_name_172_count = 0; static long long _profile_name_172_time = 0; static long long _profile_name_294_count = 0; static long long _profile_name_294_time = 0; static long long _profile_name_173_count = 0; static long long _profile_name_173_time = 0; static long long _profile_name_295_count = 0; static long long _profile_name_295_time = 0; static long long _profile_c_scan_count = 0; static long long _profile_c_scan_time = 0; static long long _profile_name_296_count = 0; static long long _profile_name_296_time = 0; static long long _profile_name_175_count = 0; static long long _profile_name_175_time = 0; static long long _profile_name_297_count = 0; static long long _profile_name_297_time = 0; static long long _profile_name_176_count = 0; static long long _profile_name_176_time = 0; static long long _profile_name_331_count = 0; static long long _profile_name_331_time = 0; static long long _profile_name_298_count = 0; static long long _profile_name_298_time = 0; static long long _profile_name_210_count = 0; static long long _profile_name_210_time = 0; static long long _profile_name_332_count = 0; static long long _profile_name_332_time = 0; static long long _profile_name_299_count = 0; static long long _profile_name_299_time = 0; static long long _profile_name_211_count = 0; static long long _profile_name_211_time = 0; static long long _profile_name_333_count = 0; static long long _profile_name_333_time = 0; static long long _profile_name_179_count = 0; static long long _profile_name_179_time = 0; static long long _profile_name_212_count = 0; static long long _profile_name_212_time = 0; static long long _profile_name_213_count = 0; static long long _profile_name_213_time = 0; static long long _profile_name_335_count = 0; static long long _profile_name_335_time = 0; static long long _profile_name_214_count = 0; static long long _profile_name_214_time = 0; static long long _profile_name_215_count = 0; static long long _profile_name_215_time = 0; static long long _profile_name_337_count = 0; static long long _profile_name_337_time = 0; static long long _profile_name_216_count = 0; static long long _profile_name_216_time = 0; static long long _profile_name_217_count = 0; static long long _profile_name_217_time = 0; static long long _profile_name_218_count = 0; static long long _profile_name_218_time = 0; static long long _profile_name_81_count = 0; static long long _profile_name_81_time = 0; static long long _profile_name_219_count = 0; static long long _profile_name_219_time = 0; static long long _profile_name_83_count = 0; static long long _profile_name_83_time = 0; static long long _profile_name_85_count = 0; static long long _profile_name_85_time = 0; static long long _profile_name_87_count = 0; static long long _profile_name_87_time = 0; static long long _profile_name_89_count = 0; static long long _profile_name_89_time = 0; static long long _profile_name_180_count = 0; static long long _profile_name_180_time = 0; static long long _profile_name_181_count = 0; static long long _profile_name_181_time = 0; static long long _profile_name_182_count = 0; static long long _profile_name_182_time = 0; static long long _profile_name_183_count = 0; static long long _profile_name_183_time = 0; static long long _profile_name_184_count = 0; static long long _profile_name_184_time = 0; static long long _profile_name_185_count = 0; static long long _profile_name_185_time = 0; static long long _profile_name_186_count = 0; static long long _profile_name_186_time = 0; static long long _profile_name_341_count = 0; static long long _profile_name_341_time = 0; static long long _profile_name_220_count = 0; static long long _profile_name_220_time = 0; static long long _profile_name_342_count = 0; static long long _profile_name_342_time = 0; static long long _profile_name_100_count = 0; static long long _profile_name_100_time = 0; static long long _profile_name_188_count = 0; static long long _profile_name_188_time = 0; static long long _profile_name_221_count = 0; static long long _profile_name_221_time = 0; static long long _profile_name_343_count = 0; static long long _profile_name_343_time = 0; static long long _profile_name_189_count = 0; static long long _profile_name_189_time = 0; static long long _profile_name_222_count = 0; static long long _profile_name_222_time = 0; static long long _profile_name_344_count = 0; static long long _profile_name_344_time = 0; static long long _profile_name_102_count = 0; static long long _profile_name_102_time = 0; static long long _profile_name_223_count = 0; static long long _profile_name_223_time = 0; static long long _profile_name_224_count = 0; static long long _profile_name_224_time = 0; static long long _profile_name_346_count = 0; static long long _profile_name_346_time = 0; static long long _profile_name_104_count = 0; static long long _profile_name_104_time = 0; static long long _profile_name_225_count = 0; static long long _profile_name_225_time = 0; static long long _profile_name_226_count = 0; static long long _profile_name_226_time = 0; static long long _profile_name_348_count = 0; static long long _profile_name_348_time = 0; static long long _profile_name_106_count = 0; static long long _profile_name_106_time = 0; static long long _profile_name_227_count = 0; static long long _profile_name_227_time = 0; static long long _profile_name_90_count = 0; static long long _profile_name_90_time = 0; static long long _profile_name_107_count = 0; static long long _profile_name_107_time = 0; static long long _profile_name_228_count = 0; static long long _profile_name_228_time = 0; static long long _profile_name_91_count = 0; static long long _profile_name_91_time = 0; static long long _profile_name_229_count = 0; static long long _profile_name_229_time = 0; static long long _profile_name_92_count = 0; static long long _profile_name_92_time = 0; static long long _profile_name_109_count = 0; static long long _profile_name_109_time = 0; static long long _profile_name_93_count = 0; static long long _profile_name_93_time = 0; static long long _profile_name_94_count = 0; static long long _profile_name_94_time = 0; static long long _profile_name_95_count = 0; static long long _profile_name_95_time = 0; static long long _profile_name_96_count = 0; static long long _profile_name_96_time = 0; static long long _profile_name_97_count = 0; static long long _profile_name_97_time = 0; static long long _profile_name_11_count = 0; static long long _profile_name_11_time = 0; static long long _profile_name_99_count = 0; static long long _profile_name_99_time = 0; static long long _profile_name_12_count = 0; static long long _profile_name_12_time = 0; static long long _profile_name_13_count = 0; static long long _profile_name_13_time = 0; static long long _profile_name_14_count = 0; static long long _profile_name_14_time = 0; static long long _profile_name_16_count = 0; static long long _profile_name_16_time = 0; static long long _profile_name_17_count = 0; static long long _profile_name_17_time = 0; static long long _profile_name_18_count = 0; static long long _profile_name_18_time = 0; static long long _profile_name_190_count = 0; static long long _profile_name_190_time = 0; static long long _profile_name_19_count = 0; static long long _profile_name_19_time = 0; static long long _profile_name_191_count = 0; static long long _profile_name_191_time = 0; static long long _profile_name_192_count = 0; static long long _profile_name_192_time = 0; static long long _profile_name_193_count = 0; static long long _profile_name_193_time = 0; static long long _profile_name_194_count = 0; static long long _profile_name_194_time = 0; static long long _profile_name_196_count = 0; static long long _profile_name_196_time = 0; static long long _profile_name_197_count = 0; static long long _profile_name_197_time = 0; static long long _profile_name_230_count = 0; static long long _profile_name_230_time = 0; static long long _profile_name_198_count = 0; static long long _profile_name_198_time = 0; static long long _profile_name_231_count = 0; static long long _profile_name_231_time = 0; static long long _profile_name_111_count = 0; static long long _profile_name_111_time = 0; static long long _profile_name_199_count = 0; static long long _profile_name_199_time = 0; static long long _profile_name_232_count = 0; static long long _profile_name_232_time = 0; static long long _profile_name_112_count = 0; static long long _profile_name_112_time = 0; static long long _profile_name_233_count = 0; static long long _profile_name_233_time = 0; static long long _profile_name_234_count = 0; static long long _profile_name_234_time = 0; static long long _profile_name_114_count = 0; static long long _profile_name_114_time = 0; static long long _profile_name_235_count = 0; static long long _profile_name_235_time = 0; static long long _profile_name_236_count = 0; static long long _profile_name_236_time = 0; static long long _profile_name_116_count = 0; static long long _profile_name_116_time = 0; static long long _profile_name_237_count = 0; static long long _profile_name_237_time = 0; static long long _profile_name_117_count = 0; static long long _profile_name_117_time = 0; static long long _profile_name_238_count = 0; static long long _profile_name_238_time = 0; static long long _profile_name_239_count = 0; static long long _profile_name_239_time = 0; static long long _profile_name_119_count = 0; static long long _profile_name_119_time = 0; static long long _profile_name_20_count = 0; static long long _profile_name_20_time = 0; static long long _profile_name_21_count = 0; static long long _profile_name_21_time = 0; static long long _profile_name_22_count = 0; static long long _profile_name_22_time = 0; static long long _profile_name_23_count = 0; static long long _profile_name_23_time = 0; static long long _profile_name_24_count = 0; static long long _profile_name_24_time = 0; static long long _profile_name_25_count = 0; static long long _profile_name_25_time = 0; static long long _profile_name_27_count = 0; static long long _profile_name_27_time = 0; static long long _profile_name_28_count = 0; static long long _profile_name_28_time = 0; static long long _profile_name_29_count = 0; static long long _profile_name_29_time = 0; static long long _profile_name_240_count = 0; static long long _profile_name_240_time = 0; static long long _profile_name_241_count = 0; static long long _profile_name_241_time = 0; static long long _profile_name_121_count = 0; static long long _profile_name_121_time = 0; static long long _profile_name_242_count = 0; static long long _profile_name_242_time = 0; static long long _profile_name_243_count = 0; static long long _profile_name_243_time = 0; static long long _profile_name_123_count = 0; static long long _profile_name_123_time = 0; static long long _profile_name_244_count = 0; static long long _profile_name_244_time = 0; static long long _profile_name_245_count = 0; static long long _profile_name_245_time = 0; static long long _profile_name_246_count = 0; static long long _profile_name_246_time = 0; static long long _profile_name_125_count = 0; static long long _profile_name_125_time = 0; static long long _profile_name_247_count = 0; static long long _profile_name_247_time = 0; static long long _profile_name_126_count = 0; static long long _profile_name_126_time = 0; static long long _profile_name_248_count = 0; static long long _profile_name_248_time = 0; static long long _profile_name_249_count = 0; static long long _profile_name_249_time = 0; static long long _profile_name_128_count = 0; static long long _profile_name_128_time = 0; static long long _profile_name_30_count = 0; static long long _profile_name_30_time = 0; static long long _profile_name_31_count = 0; static long long _profile_name_31_time = 0; static long long _profile_name_32_count = 0; static long long _profile_name_32_time = 0; static long long _profile_name_34_count = 0; static long long _profile_name_34_time = 0; static long long _profile_name_36_count = 0; static long long _profile_name_36_time = 0; static long long _profile_name_37_count = 0; static long long _profile_name_37_time = 0; static long long _profile_name_38_count = 0; static long long _profile_name_38_time = 0; #endif /* Line 189 of yacc.c */ #line 808 "y.tab.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { SEMICOLON = 258, COMMA = 259, LCBRA = 260, RCBRA = 261, LSBRA = 262, RSBRA = 263, LPAREN = 264, RPAREN = 265, OR = 266, DOT = 267, COLON = 268, _7e = 269, X = 270, _2b = 271, _ = 272, _2a = 273, _2f = 274, _5e = 275, _26 = 276, _25 = 277, _3d = 278, P = 279, _LT = 280, _GT = 281, IDENTIFIER = 282, CONSTANT = 283, STRING = 284, SIZEOF = 285, PTR_OP = 286, INC_OP = 287, DEC_OP = 288, LEFT_OP = 289, RIGHT_OP = 290, LE_OP = 291, GE_OP = 292, EQ_OP = 293, NE_OP = 294, AND_OP = 295, OR_OP = 296, MUL_ASSIGN = 297, DIV_ASSIGN = 298, MOD_ASSIGN = 299, ADD_ASSIGN = 300, SUB_ASSIGN = 301, LEFT_ASSIGN = 302, RIGHT_ASSIGN = 303, AND_ASSIGN = 304, XOR_ASSIGN = 305, OR_ASSIGN = 306, TYPENAME = 307, TYPEDEF = 308, EXTERN = 309, STATIC = 310, AUTO = 311, REGISTER = 312, INLINE = 313, RESTRICT = 314, SIGNED = 315, UNSIGNED = 316, CONST = 317, VOLATILE = 318, STRUCT = 319, UNION = 320, ENUM = 321, ELLIPSIS = 322, RANGE = 323, CASE = 324, DEFAULT = 325, IF = 326, ELSE = 327, SWITCH = 328, WHILE = 329, DO = 330, FOR = 331, GOTO = 332, CONTINUE = 333, BREAK = 334, RETURN = 335, ASM = 336, UNKNOWN = 337, EXTENSION = 338, AT_INTERFACE = 339, AT_IMPLEMENTATION = 340, AT_END = 341, AT_SELECTOR = 342, AT_DEFS = 343, AT_ENCODE = 344, AT_PUBLIC = 345, AT_PRIVATE = 346, AT_PROTECTED = 347, AT_PROTOCOL = 348, AT_CLASS = 349, AT_ALIAS = 350, AT_THROW = 351, AT_TRY = 352, AT_CATCH = 353, AT_FINALLY = 354, AT_SYNCHRONIZED = 355, AT_PROPERTY = 356, AT_SYNTHESIZE = 357, AT_DYNAMIC = 358, AT_OPTIONAL = 359, AT_REQUIRED = 360, OBJC_STRING = 361, START_MACRO = 362 }; #endif /* Tokens. */ #define SEMICOLON 258 #define COMMA 259 #define LCBRA 260 #define RCBRA 261 #define LSBRA 262 #define RSBRA 263 #define LPAREN 264 #define RPAREN 265 #define OR 266 #define DOT 267 #define COLON 268 #define _7e 269 #define X 270 #define _2b 271 #define _ 272 #define _2a 273 #define _2f 274 #define _5e 275 #define _26 276 #define _25 277 #define _3d 278 #define P 279 #define _LT 280 #define _GT 281 #define IDENTIFIER 282 #define CONSTANT 283 #define STRING 284 #define SIZEOF 285 #define PTR_OP 286 #define INC_OP 287 #define DEC_OP 288 #define LEFT_OP 289 #define RIGHT_OP 290 #define LE_OP 291 #define GE_OP 292 #define EQ_OP 293 #define NE_OP 294 #define AND_OP 295 #define OR_OP 296 #define MUL_ASSIGN 297 #define DIV_ASSIGN 298 #define MOD_ASSIGN 299 #define ADD_ASSIGN 300 #define SUB_ASSIGN 301 #define LEFT_ASSIGN 302 #define RIGHT_ASSIGN 303 #define AND_ASSIGN 304 #define XOR_ASSIGN 305 #define OR_ASSIGN 306 #define TYPENAME 307 #define TYPEDEF 308 #define EXTERN 309 #define STATIC 310 #define AUTO 311 #define REGISTER 312 #define INLINE 313 #define RESTRICT 314 #define SIGNED 315 #define UNSIGNED 316 #define CONST 317 #define VOLATILE 318 #define STRUCT 319 #define UNION 320 #define ENUM 321 #define ELLIPSIS 322 #define RANGE 323 #define CASE 324 #define DEFAULT 325 #define IF 326 #define ELSE 327 #define SWITCH 328 #define WHILE 329 #define DO 330 #define FOR 331 #define GOTO 332 #define CONTINUE 333 #define BREAK 334 #define RETURN 335 #define ASM 336 #define UNKNOWN 337 #define EXTENSION 338 #define AT_INTERFACE 339 #define AT_IMPLEMENTATION 340 #define AT_END 341 #define AT_SELECTOR 342 #define AT_DEFS 343 #define AT_ENCODE 344 #define AT_PUBLIC 345 #define AT_PRIVATE 346 #define AT_PROTECTED 347 #define AT_PROTOCOL 348 #define AT_CLASS 349 #define AT_ALIAS 350 #define AT_THROW 351 #define AT_TRY 352 #define AT_CATCH 353 #define AT_FINALLY 354 #define AT_SYNCHRONIZED 355 #define AT_PROPERTY 356 #define AT_SYNTHESIZE 357 #define AT_DYNAMIC 358 #define AT_OPTIONAL 359 #define AT_REQUIRED 360 #define OBJC_STRING 361 #define START_MACRO 362 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 1064 "y.tab.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 104 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 3152 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 108 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 137 /* YYNRULES -- Number of rules. */ #define YYNRULES 410 /* YYNRULES -- Number of states. */ #define YYNSTATES 720 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 362 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 4, 6, 9, 11, 14, 17, 20, 23, 25, 28, 32, 34, 37, 40, 44, 47, 51, 54, 56, 59, 61, 64, 66, 70, 75, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 109, 111, 113, 115, 117, 119, 123, 127, 134, 136, 138, 140, 142, 144, 149, 153, 158, 162, 166, 169, 172, 174, 178, 180, 183, 186, 189, 192, 197, 200, 202, 204, 206, 208, 210, 212, 214, 219, 221, 225, 229, 233, 235, 239, 243, 245, 249, 253, 255, 259, 263, 267, 271, 273, 277, 281, 283, 287, 289, 293, 295, 299, 301, 305, 307, 311, 313, 319, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 365, 367, 371, 373, 379, 384, 387, 389, 391, 393, 396, 400, 405, 408, 412, 417, 419, 423, 425, 428, 432, 437, 443, 449, 456, 459, 461, 465, 467, 471, 473, 476, 478, 482, 486, 491, 496, 502, 506, 511, 516, 518, 521, 524, 528, 530, 533, 535, 539, 541, 545, 547, 551, 553, 557, 560, 562, 564, 567, 569, 571, 574, 578, 581, 585, 589, 594, 598, 603, 608, 614, 617, 621, 625, 630, 632, 636, 641, 643, 647, 649, 651, 653, 655, 657, 659, 661, 663, 667, 670, 672, 678, 683, 686, 687, 690, 694, 697, 699, 702, 706, 711, 715, 718, 722, 726, 731, 734, 736, 739, 741, 744, 746, 749, 752, 758, 766, 772, 778, 786, 793, 801, 809, 818, 826, 835, 844, 854, 858, 861, 864, 867, 871, 873, 874, 876, 881, 887, 894, 896, 898, 900, 902, 904, 906, 908, 910, 913, 915, 917, 919, 923, 929, 937, 939, 942, 943, 945, 947, 951, 956, 964, 966, 970, 973, 974, 976, 978, 980, 982, 984, 986, 988, 990, 992, 994, 998, 1002, 1007, 1010, 1011, 1015, 1016, 1023, 1028, 1036, 1042, 1045, 1051, 1055, 1056, 1058, 1062, 1066, 1068, 1070, 1072, 1074, 1075, 1079, 1082, 1085, 1086, 1088, 1092, 1094, 1098, 1101, 1103, 1105, 1110, 1111, 1114, 1117, 1120, 1123, 1126, 1130, 1136, 1139, 1143, 1147, 1148, 1150, 1154, 1155, 1157, 1163, 1165, 1172, 1175, 1176, 1179, 1180, 1182, 1185, 1187, 1189, 1192, 1195, 1199, 1202, 1203, 1206, 1209, 1211, 1213, 1216, 1218, 1220, 1222, 1224, 1226, 1228, 1230, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250, 1252, 1254, 1256, 1264, 1268, 1275, 1278, 1280, 1282, 1284, 1287, 1291, 1294, 1296, 1298, 1303, 1305, 1307, 1309, 1312, 1315, 1317, 1322, 1327 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { 109, 0, -1, -1, 110, -1, 107, 175, -1, 111, -1, 110, 111, -1, 195, 112, -1, 195, 194, -1, 195, 114, -1, 197, -1, 150, 113, -1, 116, 150, 113, -1, 173, -1, 174, 173, -1, 116, 3, -1, 116, 117, 3, -1, 116, 3, -1, 116, 117, 3, -1, 196, 115, -1, 119, -1, 119, 116, -1, 120, -1, 120, 116, -1, 118, -1, 117, 4, 118, -1, 150, 181, 23, 162, -1, 150, 181, -1, 53, -1, 54, -1, 55, -1, 56, -1, 58, -1, 52, -1, 60, -1, 61, -1, 62, -1, 57, -1, 63, -1, 141, -1, 147, -1, 59, -1, 52, 208, -1, 208, -1, 180, -1, 28, -1, 29, -1, 106, -1, 9, 139, 10, -1, 9, 173, 10, -1, 9, 159, 10, 5, 163, 6, -1, 238, -1, 242, -1, 243, -1, 244, -1, 121, -1, 122, 7, 139, 8, -1, 122, 9, 10, -1, 122, 9, 123, 10, -1, 122, 12, 180, -1, 122, 31, 180, -1, 122, 32, -1, 122, 33, -1, 138, -1, 123, 4, 138, -1, 122, -1, 32, 124, -1, 33, 124, -1, 125, 126, -1, 30, 124, -1, 30, 9, 159, 10, -1, 196, 126, -1, 21, -1, 18, -1, 16, -1, 17, -1, 14, -1, 15, -1, 124, -1, 9, 159, 10, 126, -1, 126, -1, 127, 18, 126, -1, 127, 19, 126, -1, 127, 22, 126, -1, 127, -1, 128, 16, 127, -1, 128, 17, 127, -1, 128, -1, 129, 34, 128, -1, 129, 35, 128, -1, 129, -1, 130, 25, 129, -1, 130, 26, 129, -1, 130, 36, 129, -1, 130, 37, 129, -1, 130, -1, 131, 38, 130, -1, 131, 39, 130, -1, 131, -1, 132, 21, 131, -1, 132, -1, 133, 20, 132, -1, 133, -1, 134, 11, 133, -1, 134, -1, 135, 40, 134, -1, 135, -1, 136, 41, 135, -1, 136, -1, 136, 24, 136, 13, 137, -1, 137, -1, 124, 23, 138, -1, 124, 42, 138, -1, 124, 43, 138, -1, 124, 44, 138, -1, 124, 45, 138, -1, 124, 46, 138, -1, 124, 47, 138, -1, 124, 48, 138, -1, 124, 49, 138, -1, 124, 50, 138, -1, 124, 51, 138, -1, 138, -1, 139, 4, 138, -1, 137, -1, 142, 180, 5, 143, 6, -1, 142, 5, 143, 6, -1, 142, 180, -1, 64, -1, 65, -1, 144, -1, 143, 144, -1, 153, 145, 3, -1, 196, 153, 145, 3, -1, 141, 3, -1, 196, 141, 3, -1, 88, 9, 52, 10, -1, 146, -1, 145, 4, 146, -1, 150, -1, 13, 140, -1, 150, 13, 140, -1, 66, 5, 148, 6, -1, 66, 5, 148, 4, 6, -1, 66, 180, 5, 148, 6, -1, 66, 180, 5, 148, 4, 6, -1, 66, 180, -1, 149, -1, 148, 4, 149, -1, 180, -1, 180, 23, 140, -1, 151, -1, 152, 151, -1, 180, -1, 9, 150, 10, -1, 151, 7, 8, -1, 151, 7, 186, 8, -1, 151, 7, 187, 8, -1, 151, 7, 186, 187, 8, -1, 151, 9, 10, -1, 151, 9, 156, 10, -1, 151, 9, 154, 10, -1, 18, -1, 18, 153, -1, 18, 152, -1, 18, 153, 152, -1, 120, -1, 153, 120, -1, 155, -1, 155, 4, 67, -1, 180, -1, 155, 4, 180, -1, 157, -1, 157, 4, 67, -1, 158, -1, 157, 4, 158, -1, 153, 150, -1, 159, -1, 153, -1, 153, 160, -1, 152, -1, 161, -1, 152, 161, -1, 9, 160, 10, -1, 7, 8, -1, 7, 186, 8, -1, 7, 187, 8, -1, 7, 186, 187, 8, -1, 161, 7, 8, -1, 161, 7, 186, 8, -1, 161, 7, 187, 8, -1, 161, 7, 186, 187, 8, -1, 9, 10, -1, 9, 156, 10, -1, 161, 9, 10, -1, 161, 9, 156, 10, -1, 138, -1, 5, 163, 6, -1, 5, 163, 4, 6, -1, 162, -1, 163, 4, 162, -1, 172, -1, 173, -1, 176, -1, 177, -1, 178, -1, 179, -1, 183, -1, 165, -1, 96, 139, 3, -1, 96, 3, -1, 171, -1, 100, 9, 139, 10, 173, -1, 98, 9, 180, 10, -1, 166, 173, -1, -1, 168, 167, -1, 97, 173, 168, -1, 99, 173, -1, 169, -1, 169, 170, -1, 180, 13, 164, -1, 69, 140, 13, 164, -1, 70, 13, 164, -1, 5, 6, -1, 5, 175, 6, -1, 5, 174, 6, -1, 5, 174, 175, 6, -1, 1, 6, -1, 115, -1, 174, 115, -1, 164, -1, 175, 164, -1, 3, -1, 139, 3, -1, 1, 3, -1, 71, 9, 139, 10, 164, -1, 71, 9, 139, 10, 164, 72, 164, -1, 73, 9, 139, 10, 164, -1, 74, 9, 139, 10, 164, -1, 75, 164, 74, 9, 139, 10, 3, -1, 76, 9, 3, 3, 10, 164, -1, 76, 9, 3, 3, 139, 10, 164, -1, 76, 9, 3, 139, 3, 10, 164, -1, 76, 9, 3, 139, 3, 139, 10, 164, -1, 76, 9, 139, 3, 3, 10, 164, -1, 76, 9, 139, 3, 3, 139, 10, 164, -1, 76, 9, 139, 3, 139, 3, 10, 164, -1, 76, 9, 139, 3, 139, 3, 139, 10, 164, -1, 77, 180, 3, -1, 78, 3, -1, 79, 3, -1, 80, 3, -1, 80, 139, 3, -1, 27, -1, -1, 182, -1, 81, 9, 189, 10, -1, 81, 9, 188, 10, 3, -1, 81, 184, 9, 188, 10, 3, -1, 62, -1, 63, -1, 59, -1, 55, -1, 59, -1, 62, -1, 63, -1, 185, -1, 186, 185, -1, 138, -1, 18, -1, 189, -1, 189, 13, 190, -1, 189, 13, 190, 13, 190, -1, 189, 13, 190, 13, 190, 13, 193, -1, 29, -1, 189, 29, -1, -1, 191, -1, 192, -1, 191, 4, 192, -1, 29, 9, 139, 10, -1, 7, 180, 8, 29, 9, 139, 10, -1, 29, -1, 193, 4, 29, -1, 182, 3, -1, -1, 196, -1, 83, -1, 204, -1, 200, -1, 201, -1, 206, -1, 216, -1, 180, -1, 52, -1, 198, -1, 199, 4, 198, -1, 94, 199, 3, -1, 95, 180, 180, 3, -1, 13, 198, -1, -1, 5, 209, 6, -1, -1, 205, 202, 207, 203, 217, 86, -1, 85, 198, 202, 203, -1, 205, 9, 198, 10, 207, 217, 86, -1, 85, 198, 9, 180, 10, -1, 84, 198, -1, 93, 180, 207, 217, 86, -1, 93, 155, 3, -1, -1, 208, -1, 25, 199, 26, -1, 209, 210, 211, -1, 211, -1, 91, -1, 92, -1, 90, -1, -1, 211, 212, 3, -1, 211, 3, -1, 116, 213, -1, -1, 214, -1, 213, 4, 214, -1, 150, -1, 150, 13, 138, -1, 13, 138, -1, 16, -1, 17, -1, 215, 222, 223, 173, -1, -1, 217, 218, -1, 217, 114, -1, 217, 219, -1, 217, 104, -1, 217, 105, -1, 215, 222, 3, -1, 101, 9, 220, 10, 115, -1, 101, 115, -1, 102, 117, 3, -1, 103, 117, 3, -1, -1, 180, -1, 220, 4, 180, -1, -1, 180, -1, 9, 221, 159, 10, 229, -1, 229, -1, 9, 221, 159, 10, 230, 228, -1, 230, 228, -1, -1, 3, 224, -1, -1, 226, -1, 1, 3, -1, 227, -1, 225, -1, 226, 227, -1, 227, 225, -1, 116, 157, 3, -1, 116, 3, -1, -1, 4, 67, -1, 4, 157, -1, 231, -1, 233, -1, 230, 233, -1, 180, -1, 52, -1, 232, -1, 66, -1, 64, -1, 65, -1, 71, -1, 72, -1, 74, -1, 75, -1, 76, -1, 73, -1, 69, -1, 70, -1, 79, -1, 78, -1, 80, -1, 77, -1, 81, -1, 30, -1, 231, 13, 9, 221, 159, 10, 180, -1, 231, 13, 180, -1, 13, 9, 221, 159, 10, 180, -1, 13, 180, -1, 231, -1, 235, -1, 236, -1, 235, 236, -1, 231, 13, 139, -1, 13, 139, -1, 139, -1, 52, -1, 7, 237, 234, 8, -1, 231, -1, 240, -1, 241, -1, 240, 241, -1, 231, 13, -1, 13, -1, 87, 9, 239, 10, -1, 93, 9, 180, 10, -1, 89, 9, 52, 10, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 840, 840, 842, 843, 847, 848, 852, 853, 854, 855, 859, 860, 864, 865, 869, 870, 874, 875, 876, 880, 881, 882, 883, 887, 888, 892, 893, 897, 898, 899, 900, 901, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 933, 934, 935, 936, 937, 938, 939, 940, 944, 945, 949, 950, 951, 952, 953, 954, 955, 959, 960, 961, 962, 963, 964, 968, 969, 973, 974, 975, 976, 980, 981, 982, 986, 987, 988, 992, 993, 994, 995, 996, 1000, 1001, 1002, 1006, 1007, 1011, 1012, 1016, 1017, 1021, 1022, 1026, 1027, 1031, 1032, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1051, 1052, 1056, 1060, 1061, 1062, 1066, 1067, 1071, 1072, 1076, 1077, 1078, 1079, 1080, 1084, 1085, 1089, 1090, 1091, 1095, 1096, 1097, 1098, 1099, 1103, 1104, 1108, 1109, 1113, 1114, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1130, 1131, 1132, 1133, 1137, 1138, 1142, 1143, 1147, 1148, 1152, 1153, 1157, 1158, 1162, 1163, 1167, 1168, 1172, 1173, 1174, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1194, 1195, 1196, 1200, 1201, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1216, 1217, 1218, 1219, 1223, 1227, 1230, 1232, 1236, 1240, 1244, 1245, 1249, 1250, 1251, 1255, 1256, 1257, 1258, 1259, 1263, 1264, 1268, 1269, 1273, 1274, 1275, 1279, 1280, 1281, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1298, 1299, 1300, 1301, 1302, 1306, 1309, 1311, 1315, 1319, 1320, 1324, 1325, 1326, 1330, 1331, 1332, 1333, 1337, 1338, 1342, 1343, 1347, 1348, 1349, 1350, 1354, 1355, 1358, 1360, 1364, 1365, 1369, 1370, 1374, 1375, 1379, 1382, 1384, 1388, 1392, 1393, 1394, 1395, 1396, 1400, 1401, 1405, 1406, 1410, 1414, 1418, 1419, 1423, 1424, 1428, 1429, 1430, 1431, 1435, 1439, 1440, 1443, 1445, 1449, 1453, 1454, 1458, 1459, 1460, 1463, 1465, 1466, 1470, 1473, 1475, 1476, 1480, 1481, 1482, 1486, 1487, 1491, 1494, 1496, 1497, 1498, 1499, 1500, 1504, 1508, 1509, 1510, 1511, 1514, 1516, 1517, 1520, 1522, 1526, 1527, 1528, 1529, 1532, 1534, 1537, 1539, 1543, 1547, 1548, 1549, 1550, 1554, 1555, 1558, 1560, 1561, 1565, 1569, 1570, 1574, 1575, 1576, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1600, 1601, 1602, 1603, 1607, 1608, 1612, 1613, 1617, 1618, 1622, 1623, 1627, 1631, 1632, 1636, 1637, 1641, 1642, 1646, 1650, 1654 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "SEMICOLON", "COMMA", "LCBRA", "RCBRA", "LSBRA", "RSBRA", "LPAREN", "RPAREN", "OR", "DOT", "COLON", "_7e", "X", "_2b", "_", "_2a", "_2f", "_5e", "_26", "_25", "_3d", "P", "_LT", "_GT", "IDENTIFIER", "CONSTANT", "STRING", "SIZEOF", "PTR_OP", "INC_OP", "DEC_OP", "LEFT_OP", "RIGHT_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "MOD_ASSIGN", "ADD_ASSIGN", "SUB_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "TYPENAME", "TYPEDEF", "EXTERN", "STATIC", "AUTO", "REGISTER", "INLINE", "RESTRICT", "SIGNED", "UNSIGNED", "CONST", "VOLATILE", "STRUCT", "UNION", "ENUM", "ELLIPSIS", "RANGE", "CASE", "DEFAULT", "IF", "ELSE", "SWITCH", "WHILE", "DO", "FOR", "GOTO", "CONTINUE", "BREAK", "RETURN", "ASM", "UNKNOWN", "EXTENSION", "AT_INTERFACE", "AT_IMPLEMENTATION", "AT_END", "AT_SELECTOR", "AT_DEFS", "AT_ENCODE", "AT_PUBLIC", "AT_PRIVATE", "AT_PROTECTED", "AT_PROTOCOL", "AT_CLASS", "AT_ALIAS", "AT_THROW", "AT_TRY", "AT_CATCH", "AT_FINALLY", "AT_SYNCHRONIZED", "AT_PROPERTY", "AT_SYNTHESIZE", "AT_DYNAMIC", "AT_OPTIONAL", "AT_REQUIRED", "OBJC_STRING", "START_MACRO", "$accept", "program", "file", "external_definition", "function_definition", "function_body", "external_declaration", "declaration", "declaration_specifiers", "init_declarator_list", "init_declarator", "storage_class_specifier", "type_specifier", "primary_expr", "postfix_expr", "argument_expr_list", "unary_expr", "unary_operator", "cast_expr", "multiplicative_expr", "additive_expr", "shift_expr", "relational_expr", "equality_expr", "and_expr", "exclusive_or_expr", "inclusive_or_expr", "logical_and_expr", "logical_or_expr", "conditional_expr", "assignment_expr", "expr", "constant_expr", "struct_or_union_specifier", "struct_or_union", "struct_declaration_list", "struct_declaration", "struct_declarator_list", "struct_declarator", "enum_specifier", "enumerator_list", "enumerator", "declarator", "declarator2", "pointer", "type_specifier_list", "parameter_identifier_list", "identifier_list", "parameter_type_list", "parameter_list", "parameter_declaration", "type_name", "abstract_declarator", "abstract_declarator2", "initializer", "initializer_list", "statement", "objc_statement", "objc_catch_prefix", "objc_catch_clause", "objc_opt_catch_list", "objc_try_catch_clause", "objc_finally_clause", "objc_try_catch_statement", "labeled_statement", "compound_statement", "declaration_list", "statement_list", "expression_statement", "selection_statement", "iteration_statement", "jump_statement", "identifier", "maybe_asm", "asm_expr", "asm_statement", "type_qualifier", "array_qualifier", "array_qualifier_list", "array_size_expr", "asm_argument", "string_list", "asm_operands", "asm_operands2", "asm_operand", "asm_clobbers", "asm_definition", "maybe_extension", "extension", "objc_definition", "classname", "classname_list", "objc_class_declaration", "objc_alias_declaration", "objc_superclass", "objc_class_ivars", "objc_class_definition", "objc_interface_head", "objc_protocol_definition", "objc_protocol_references", "objc_non_empty_protocol_references", "objc_ivar_declaration_list", "objc_visibility_spec", "objc_ivar_declarations", "objc_ivar_declaration", "objc_ivars", "objc_ivar_declarator", "objc_method_type", "objc_method_definition", "objc_method_prototype_list", "objc_method_prototype", "objc_property", "property_attribute_list", "objc_protocol_qualifier", "objc_method_declaration", "optarglist", "myxdecls", "error_statement", "mydecls", "mydecl", "optparmlist", "unary_selector", "keyword_selector", "selector", "reserved_words", "keyword_declarator", "message_args", "keyword_arg_list", "keyword_arg", "receiver", "objc_message_expr", "selector_arg", "keyword_name_list", "keyword_name", "objc_selector_expr", "objc_protocol_expr", "objc_encode_expr", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 108, 109, 109, 109, 110, 110, 111, 111, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 115, 116, 116, 116, 116, 117, 117, 118, 118, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 126, 126, 127, 127, 127, 127, 128, 128, 128, 129, 129, 129, 130, 130, 130, 130, 130, 131, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, 140, 141, 141, 141, 142, 142, 143, 143, 144, 144, 144, 144, 144, 145, 145, 146, 146, 146, 147, 147, 147, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, 163, 163, 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 166, 167, 168, 168, 169, 170, 171, 171, 172, 172, 172, 173, 173, 173, 173, 173, 174, 174, 175, 175, 176, 176, 176, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 180, 181, 181, 182, 183, 183, 184, 184, 184, 185, 185, 185, 185, 186, 186, 187, 187, 188, 188, 188, 188, 189, 189, 190, 190, 191, 191, 192, 192, 193, 193, 194, 195, 195, 196, 197, 197, 197, 197, 197, 198, 198, 199, 199, 200, 201, 202, 202, 203, 203, 204, 204, 204, 204, 205, 206, 206, 207, 207, 208, 209, 209, 210, 210, 210, 211, 211, 211, 212, 213, 213, 213, 214, 214, 214, 215, 215, 216, 217, 217, 217, 217, 217, 217, 218, 219, 219, 219, 219, 220, 220, 220, 221, 221, 222, 222, 222, 222, 223, 223, 224, 224, 225, 226, 226, 226, 226, 227, 227, 228, 228, 228, 229, 230, 230, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, 240, 241, 241, 242, 243, 244 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 1, 2, 1, 2, 2, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 3, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, 6, 1, 1, 1, 1, 1, 4, 3, 4, 3, 3, 2, 2, 1, 3, 1, 2, 2, 2, 2, 4, 2, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 1, 5, 4, 2, 1, 1, 1, 2, 3, 4, 2, 3, 4, 1, 3, 1, 2, 3, 4, 5, 5, 6, 2, 1, 3, 1, 3, 1, 2, 1, 3, 3, 4, 4, 5, 3, 4, 4, 1, 2, 2, 3, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 2, 1, 1, 2, 1, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 1, 3, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 5, 4, 2, 0, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 3, 4, 2, 1, 2, 1, 2, 1, 2, 2, 5, 7, 5, 5, 7, 6, 7, 7, 8, 7, 8, 8, 9, 3, 2, 2, 2, 3, 1, 0, 1, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 5, 7, 1, 2, 0, 1, 1, 3, 4, 7, 1, 3, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 2, 0, 3, 0, 6, 4, 7, 5, 2, 5, 3, 0, 1, 3, 3, 1, 1, 1, 1, 0, 3, 2, 2, 0, 1, 3, 1, 3, 2, 1, 1, 4, 0, 2, 2, 2, 2, 2, 3, 5, 2, 3, 3, 0, 1, 3, 0, 1, 5, 1, 6, 2, 0, 2, 0, 1, 2, 1, 1, 2, 2, 3, 2, 0, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 3, 6, 2, 1, 1, 1, 2, 3, 2, 1, 1, 4, 1, 1, 1, 2, 2, 1, 4, 4, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { 286, 329, 330, 288, 0, 0, 0, 0, 0, 0, 0, 286, 5, 0, 287, 10, 290, 291, 289, 301, 292, 0, 293, 254, 295, 294, 308, 301, 0, 311, 296, 0, 0, 0, 233, 0, 0, 0, 76, 77, 74, 75, 73, 72, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 55, 65, 78, 0, 80, 84, 87, 90, 95, 98, 100, 102, 104, 106, 108, 110, 122, 0, 231, 208, 219, 211, 201, 202, 0, 203, 204, 205, 206, 44, 207, 0, 51, 52, 53, 54, 1, 6, 0, 162, 0, 33, 28, 29, 30, 31, 37, 32, 41, 34, 35, 36, 38, 128, 129, 0, 0, 7, 9, 0, 20, 22, 39, 0, 40, 0, 151, 0, 153, 0, 8, 43, 0, 0, 311, 346, 0, 388, 370, 373, 374, 372, 381, 382, 375, 376, 380, 377, 378, 379, 386, 384, 383, 385, 387, 369, 352, 349, 363, 366, 371, 367, 0, 303, 310, 0, 332, 312, 298, 0, 0, 235, 228, 224, 229, 0, 0, 0, 0, 400, 399, 44, 0, 0, 166, 0, 178, 0, 0, 0, 69, 0, 66, 67, 78, 124, 0, 0, 0, 0, 0, 0, 0, 0, 250, 251, 252, 0, 0, 262, 260, 261, 0, 0, 0, 0, 210, 0, 215, 0, 0, 0, 0, 0, 61, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 0, 0, 220, 232, 0, 71, 0, 164, 163, 0, 42, 0, 146, 0, 15, 0, 24, 0, 21, 23, 0, 127, 11, 13, 0, 0, 0, 0, 152, 285, 0, 300, 303, 347, 0, 346, 392, 0, 0, 0, 351, 0, 368, 0, 0, 319, 305, 171, 0, 297, 299, 17, 0, 255, 226, 230, 0, 225, 19, 0, 393, 0, 394, 395, 48, 0, 0, 167, 180, 179, 181, 0, 49, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 249, 253, 275, 0, 271, 0, 407, 402, 0, 403, 404, 0, 0, 209, 217, 0, 0, 57, 0, 63, 59, 60, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 81, 82, 83, 85, 86, 88, 89, 91, 92, 93, 94, 96, 97, 99, 101, 103, 105, 0, 107, 123, 218, 221, 154, 165, 313, 0, 147, 149, 0, 0, 16, 0, 12, 27, 256, 0, 39, 0, 130, 0, 0, 0, 14, 155, 73, 263, 264, 265, 266, 269, 267, 0, 0, 159, 178, 0, 168, 0, 172, 174, 177, 170, 311, 332, 0, 0, 0, 0, 353, 358, 355, 0, 331, 364, 365, 346, 390, 307, 0, 315, 309, 0, 0, 0, 336, 337, 334, 0, 0, 333, 335, 18, 227, 398, 0, 401, 0, 396, 184, 0, 0, 192, 0, 0, 182, 0, 0, 0, 79, 70, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 277, 276, 0, 406, 408, 0, 405, 410, 409, 0, 0, 216, 0, 56, 0, 58, 0, 0, 142, 0, 0, 257, 25, 0, 0, 134, 126, 131, 0, 0, 137, 139, 39, 0, 0, 156, 268, 0, 157, 0, 176, 180, 161, 0, 160, 0, 332, 0, 0, 0, 356, 362, 0, 359, 360, 0, 0, 302, 318, 316, 317, 319, 321, 323, 0, 343, 340, 0, 0, 0, 397, 185, 0, 186, 193, 183, 188, 0, 0, 194, 0, 0, 196, 199, 0, 236, 238, 239, 0, 0, 0, 0, 0, 0, 258, 0, 0, 272, 278, 279, 0, 0, 214, 212, 64, 109, 143, 148, 150, 0, 144, 26, 0, 140, 132, 0, 0, 135, 0, 125, 158, 169, 173, 175, 0, 304, 348, 363, 0, 361, 0, 314, 0, 326, 322, 324, 320, 344, 0, 341, 342, 338, 187, 189, 0, 190, 195, 0, 0, 50, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 277, 0, 259, 0, 145, 136, 138, 141, 133, 306, 350, 391, 0, 328, 0, 0, 0, 0, 191, 0, 197, 200, 237, 240, 242, 243, 0, 245, 0, 0, 0, 0, 0, 273, 280, 213, 389, 327, 325, 345, 339, 198, 244, 246, 247, 0, 0, 281, 0, 248, 0, 283, 274, 0, 0, 282, 284 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 10, 11, 12, 125, 288, 468, 182, 183, 281, 282, 128, 192, 68, 69, 367, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 204, 130, 131, 419, 420, 531, 532, 132, 407, 408, 319, 134, 135, 436, 437, 28, 484, 440, 441, 442, 335, 336, 585, 586, 86, 87, 512, 513, 363, 88, 268, 89, 90, 91, 290, 92, 93, 94, 95, 96, 189, 415, 416, 98, 220, 432, 433, 434, 352, 353, 599, 600, 601, 715, 138, 13, 99, 15, 30, 31, 16, 17, 142, 312, 18, 19, 20, 174, 139, 460, 563, 461, 566, 636, 637, 470, 22, 314, 471, 472, 640, 300, 164, 304, 450, 451, 452, 453, 306, 165, 166, 167, 168, 169, 327, 328, 329, 190, 100, 357, 358, 359, 101, 102, 103 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -501 static const yytype_int16 yypact[] = { 228, -501, -501, -501, 26, 26, 36, 26, 36, 1301, 71, 262, -501, 2149, -501, -501, -501, -501, -501, 146, -501, 2025, -501, -501, -501, -501, -501, 155, 173, 76, -501, 238, 36, 373, -501, 887, 2466, 1395, -501, -501, -501, -501, -501, -501, -501, -501, 2790, 2817, 2817, 2898, 92, 113, 129, 145, 1301, 178, 36, 212, 220, 1476, 34, 225, 237, 263, 1504, 63, 267, -501, -501, 77, 1425, 2898, -501, 330, 313, 359, 231, 357, 264, 279, 293, 268, 31, -501, -501, 396, -501, -501, 240, -501, -501, -501, 785, -501, -501, -501, -501, 346, -501, 2898, -501, -501, -501, -501, -501, -501, 140, 2206, 26, 352, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, 64, 380, -501, -501, 56, 1789, 1789, -501, 87, -501, 309, 246, 89, -501, 384, -501, -501, 26, 26, 352, 36, 103, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, 388, -501, 3071, 392, -501, -501, 36, 431, -501, 36, -501, -501, -501, 26, 437, -501, -501, -501, -501, 97, 1071, 1169, 1887, -501, 442, -501, 1942, 441, -501, 195, 2587, 439, 440, 1395, -501, 1395, -501, -501, -501, -501, 438, 1301, 2898, 2898, 2898, 381, 1585, 449, -501, -501, -501, 398, 427, -501, -501, -501, 448, 2274, 418, 36, -501, 400, -501, 2898, 2898, 2493, 36, 36, -501, -501, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, -501, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, 2898, -501, 2898, 63, -501, -501, 1301, -501, 454, -501, 2206, 95, -501, 36, 463, 427, -501, 404, -501, 985, -501, -501, 457, 466, -501, -501, 309, 1487, 1970, 1598, 246, -501, 468, -501, 431, -501, 1984, 36, -501, 870, 63, 1623, -501, 392, -501, 117, 471, -501, -501, -501, 2892, -501, -501, -501, 408, 395, -501, -501, 1267, -501, -501, 2898, 470, 476, 1942, -501, -501, 2053, 2123, -501, 344, -501, 351, 1775, -501, 475, 478, 1301, -501, 208, 250, 254, 477, 1613, 410, -501, -501, -501, 484, 82, 427, -501, 482, 486, 2274, -501, 487, 488, -501, 401, 259, 199, -501, 261, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, 330, 330, 313, 313, 359, 359, 359, 359, 231, 231, 357, 264, 279, 293, 32, 268, -501, -501, -501, -501, -501, -501, 374, -501, 479, 36, 46, -501, 140, -501, 485, -501, 496, 507, 658, -501, 2695, 1984, 457, -501, -501, 504, -501, -501, -501, -501, -501, -501, 2136, 505, -501, 2232, 501, 520, 515, 522, -501, -501, -501, 352, -501, 517, 1984, 526, 952, -501, -501, 1789, 1870, -501, -501, 528, 36, -501, -501, 159, 1380, -501, 1170, 140, 140, -501, -501, -501, 56, 2025, -501, -501, -501, -501, 442, 2898, -501, 470, -501, -501, 2219, 525, -501, 524, 534, 351, 2302, 1050, 1804, -501, 530, 530, -501, 1301, 1301, 1301, 2898, 2574, 412, 1694, 527, 74, -501, 537, -501, -501, 482, -501, -501, -501, 529, 63, -501, 63, -501, 2898, -501, 2898, 55, -501, 2898, 378, -501, -501, 1804, 502, -501, -501, -501, 2898, 416, -501, 540, 553, 2695, 764, -501, -501, 549, -501, 2479, -501, 163, -501, 9, -501, 1706, -501, 2954, 2357, 548, -501, -501, 420, -501, -501, 1984, 1984, -501, -501, -501, -501, -501, -501, 211, 557, 36, -501, 422, 424, 559, 442, -501, 556, -501, -501, -501, -501, 2385, 563, -501, 562, 1804, -501, -501, 379, 495, -501, -501, 270, 1301, 273, 2601, 2682, 426, -501, 36, 564, 565, 571, -501, 576, 36, -501, -501, -501, -501, -501, -501, -501, 60, -501, -501, 570, -501, -501, 234, 2898, -501, 430, -501, -501, -501, -501, -501, 3008, -501, -501, 3071, 36, -501, 572, 1380, 2898, 568, 579, -501, -501, -501, 277, -501, -501, -501, -501, -501, 577, -501, -501, 382, 1804, -501, 1301, 581, -501, 1301, 1301, 282, 1301, 284, 2709, 578, 2898, 74, 74, -501, 580, -501, -501, -501, -501, -501, -501, -501, -501, 36, -501, 2898, 211, 36, 1487, -501, 1723, -501, -501, -501, -501, -501, -501, 1301, -501, 1301, 1301, 321, 560, 323, 575, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, -501, 1301, 582, -501, 566, -501, 2898, -501, 588, 328, 574, -501, -501 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -501, -501, -501, 583, -501, 317, 591, -173, 6, -149, 188, -501, 107, -501, -501, -501, 503, -501, -53, 189, 191, 88, 187, 347, 345, 348, 349, 350, 353, -41, 539, 3, -470, -266, -501, 185, -384, 75, -5, -501, 205, -482, 1, -125, -100, 40, -501, 324, -272, -278, -396, 7, -316, -310, -500, 37, -22, -501, -501, -501, -501, -501, -501, -501, -501, -8, 584, -9, -501, -501, -501, -501, -4, -501, 608, -501, -501, -391, -309, -273, 269, 343, -39, -501, -37, -501, -501, -501, 12, -501, 44, 521, -501, -501, 601, 333, -501, -501, -501, -127, 4, -501, -501, 72, -501, -501, -40, 132, -501, -407, -501, -501, -501, -260, 167, -501, -501, 190, -501, 192, 11, 91, 96, -136, -501, -160, -501, -501, 319, -501, -501, -501, -501, 287, -501, -501, -501 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -358 static const yytype_int16 yytable[] = { 25, 25, 29, 25, 32, 97, 308, 273, 203, 136, 294, 321, 14, 324, 133, 298, 485, 163, 245, 127, 418, 439, 481, 14, 486, 613, 185, 456, 178, 196, 307, 97, 209, 175, 318, 529, 23, 609, 549, 188, 193, 447, 538, 216, 195, 518, 271, 186, 26, 27, 97, 610, 211, 23, 326, 263, 523, 226, 482, 280, 615, 608, 215, 23, 191, 106, 667, 225, 35, 277, 269, 104, 264, 264, 107, 503, 623, 194, 24, -170, -170, 597, 23, 23, 228, 356, 229, 23, 97, 230, 538, 23, 286, 217, 334, 502, 218, 219, 106, 177, 317, 108, 136, 598, 25, 205, 106, 272, 231, 232, 233, 503, 301, 276, 23, 107, 23, 321, 324, 278, 129, 406, 206, 136, 23, 289, 457, 287, 283, 609, 23, 136, 21, 271, 284, 285, 25, 25, 207, 299, 302, 626, 129, 21, 23, 291, 175, 274, 670, 106, 684, 625, 529, 418, 208, 140, 534, 418, 107, 141, 539, 625, 163, 269, 170, 559, 310, 23, 141, 313, 331, 554, 541, 25, 405, 322, 172, 173, 579, 136, 97, 97, 684, 342, 296, 297, 163, 210, 538, 196, 23, 196, 478, 382, 383, 384, 186, 558, 186, 266, 193, 97, 193, 266, 339, 330, 340, 515, 574, 343, 344, 345, 266, 348, 580, 212, 582, 163, 494, 361, 106, 315, 507, 213, 634, 485, 369, 370, -2, 107, 364, 365, 334, 486, 221, 129, 129, 194, 23, 194, 129, 176, 177, 106, 1, 2, 222, 530, 403, 560, 561, 562, 107, 292, 266, 293, 253, 254, 266, 402, 495, 23, -3, 266, 496, 516, 97, 255, 256, 514, 418, 517, 223, 409, 266, 289, 227, 266, 1, 2, 653, 679, 424, 655, 490, 259, 266, 680, 266, 443, 568, 129, 689, 129, 691, 291, 454, 299, 422, 260, 269, 333, 291, 291, 261, 458, 646, 446, 262, 449, 191, 3, 4, 5, 35, 569, 570, 548, 97, 493, 469, 6, 7, 8, 163, 266, 421, 266, 475, 249, 250, 708, 266, 710, 108, 9, 543, 97, 718, 267, 194, 389, 390, 391, 392, 3, 4, 5, 246, 247, 499, 331, 248, 332, 163, 6, 7, 8, 487, 270, 488, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 179, 108, 519, 180, 520, 333, 611, 650, 612, 651, 682, 295, 683, 279, 129, 303, 3, 251, 252, 257, 258, 129, 129, 265, 266, 350, 266, 362, 266, 309, 409, 412, 413, 136, 129, 473, 413, 500, 266, 593, 266, 136, 294, 616, 617, 129, 533, 631, 557, 641, 413, 642, 413, 660, 266, 422, 136, 671, 617, 422, 311, 542, 385, 386, 316, 543, 387, 388, 393, 394, 266, 180, 175, 337, 338, 341, 349, 299, 551, 346, 351, 354, 449, 421, 136, 136, 535, 421, 404, 136, 163, 565, 410, 308, 360, 423, 587, 588, 589, 291, 124, 607, 444, 572, 203, 459, 108, 476, 477, 491, 497, 194, 492, 203, 97, 97, 97, 307, 501, 505, 506, 509, 510, 511, 590, 592, 521, 595, 604, 526, 605, 703, 525, 109, 527, 544, -270, 540, 114, 409, 116, 117, 118, 119, 120, 121, 122, 123, 545, 546, 547, 550, 333, 552, 596, 136, 557, 575, 576, 489, 533, 136, 603, 136, 3, 313, 272, 333, 577, 417, 163, 602, 422, 198, 200, 201, 202, 618, 614, 469, 619, 622, 630, 129, 638, 136, 643, 639, 644, 632, 635, 652, 129, 654, 129, 647, 648, 662, 202, 664, 421, 203, 663, 665, 668, 677, 675, 678, 686, 681, 694, 97, 711, 709, 698, 713, 717, 661, 105, 714, 657, 659, 194, 666, 414, 524, 202, 719, 126, 396, 395, 409, 536, 397, 620, 398, 669, 136, 400, 522, 399, 438, 533, 184, 649, 137, 411, 504, 696, 163, 674, 697, 171, 275, 685, 445, 469, 687, 688, 633, 690, 571, 701, 565, 673, 628, 333, 556, 555, 508, 629, 479, 97, 0, 0, 97, 97, 0, 97, 0, 129, 0, 0, 0, 0, 0, 0, 693, 528, 695, 0, 705, 0, 706, 707, 699, 0, 0, 136, 702, 0, 0, 0, 635, 0, 0, 0, 108, 0, 97, 712, 97, 97, 202, 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 114, 716, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, 0, 0, 0, 0, 0, 129, 3, 0, 0, 0, 0, 417, 0, 0, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 368, 0, 621, 0, 0, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 0, -4, 33, 129, 34, 108, 35, 0, 36, 0, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 401, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 109, 47, 48, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 431, 0, 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 417, 0, 49, 50, 51, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 3, 0, 431, 448, 61, 0, 62, -354, 0, 0, 63, 0, 0, 64, 65, 0, 0, 66, 0, 0, 33, 0, 34, 67, 35, 181, 36, 108, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 108, 0, 23, 44, 45, 46, 0, 47, 48, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 553, 49, 50, 51, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 3, 0, 431, 0, 61, 0, 62, 108, 0, 0, 63, 0, 0, 64, 65, 0, 191, 66, -255, -255, 35, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, -255, 114, 108, 116, 117, 118, 119, 120, 121, 122, 123, 0, 431, 202, 0, 0, 202, 0, 431, 0, 584, 0, 0, 0, 0, 202, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 606, 0, 0, 0, 0, 581, 0, 0, 0, 584, 0, 124, 0, 3, 0, 0, 0, 33, 0, 34, 108, 35, 320, 36, 0, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 108, 0, 23, 44, 45, 46, 109, 47, 48, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 431, 0, 0, 202, 584, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 49, 50, 51, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 64, 65, 0, 33, 66, 34, 676, 35, 323, 36, 67, 37, 567, 0, 0, 0, 38, 39, 40, 41, 42, 0, 584, 43, 0, 0, 0, 0, 108, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 700, 0, 0, 0, 0, 584, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 49, 50, 51, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 3, 3, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 64, 65, 0, 33, 66, 34, 0, 35, 474, 36, 67, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 49, 50, 51, 0, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 64, 65, 0, 0, 66, 0, 0, 49, 50, 51, 67, 52, 53, 54, 55, 56, 57, 58, 59, 60, 564, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 191, 64, 65, 0, 35, 66, 36, 0, 37, 108, 0, 67, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 108, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 109, 234, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 0, 0, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 0, 3, 214, 0, 0, 61, 36, 62, 37, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 224, 47, 48, 0, 36, 108, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 3, 347, 0, 0, 61, 36, 62, 37, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 435, 0, 67, 0, 23, 44, 45, 46, 498, 47, 48, 0, 36, 0, 37, 108, 0, 23, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 108, 0, 109, 0, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 109, 0, 0, 63, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 455, 67, 0, 0, 0, 0, 3, 594, 0, 0, 61, 36, 62, 37, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 0, 47, 48, 583, 704, 36, 108, 37, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 109, 0, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 624, 0, 0, 0, 3, 0, 0, 489, 61, 36, 62, 37, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 3, 47, 48, 583, 61, 36, 62, 37, 108, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 448, 0, 0, 0, -357, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 36, -357, 37, 63, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 67, 0, 108, 0, 23, 44, 45, 46, 0, 47, 48, 0, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, -357, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 3, 0, 145, 0, 61, 0, 62, 36, 425, 37, 63, 0, 0, 0, 38, 39, 40, 41, 426, 0, 0, 43, 0, 67, 146, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 147, 148, 149, 108, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 143, 0, 109, 0, 144, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 23, 3, 0, 145, 0, 61, 0, 62, 36, 480, 37, 63, 0, 0, 0, 38, 39, 40, 41, 426, 0, 0, 43, 0, 67, 146, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 331, 0, 332, 483, 0, 0, 3, 0, 0, 0, 61, 107, 62, 36, 537, 37, 63, 0, 108, 0, 38, 39, 40, 41, 426, 0, 0, 43, 106, 67, 0, 0, 0, 23, 44, 45, 46, 107, 47, 48, 0, 0, 0, 0, 108, 109, 23, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 3, 0, 0, 0, 61, 107, 62, 36, 573, 37, 63, 124, 108, 0, 38, 39, 40, 41, 426, 0, 331, 43, 541, 67, 0, 0, 0, 23, 44, 45, 46, 107, 47, 48, 0, 0, 0, 0, 108, 109, 23, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 0, 109, 0, 0, 355, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 23, 3, 0, 145, 0, 61, 0, 62, 36, 578, 37, 63, 0, 0, 0, 38, 39, 40, 41, 426, 0, 0, 43, 0, 67, 146, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 3, 0, 145, 0, 61, 0, 62, 36, 645, 37, 63, 0, 0, 0, 38, 39, 40, 41, 426, 0, 0, 43, 0, 67, 146, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 0, 427, 0, 0, 0, 428, 0, 0, 429, 430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 61, 36, 62, 37, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 331, 43, 541, 483, 0, 67, 0, 23, 44, 45, 46, 107, 47, 48, 36, 0, 37, 366, 108, 0, 23, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 187, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 109, 0, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 3, 0, 0, 0, 61, 36, 62, 37, 591, 0, 63, 0, 38, 39, 40, 41, 42, 0, 331, 43, 332, 0, 0, 67, 0, 23, 44, 45, 46, 107, 47, 48, 36, 0, 37, 656, 108, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 109, 0, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 3, 0, 0, 0, 61, 36, 62, 37, 658, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 106, 0, 0, 67, 530, 23, 44, 45, 46, 107, 47, 48, 36, 0, 37, 692, 108, 0, 23, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 109, 0, 0, 0, 0, 114, 0, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 3, 0, 0, 0, 61, 36, 62, 197, 0, 0, 63, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 0, 47, 48, 36, 0, 199, 0, 0, 0, 0, 38, 39, 40, 41, 42, 0, 0, 43, 0, 0, 0, 0, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 3, 0, 0, 0, 61, 36, 62, 37, 1, 2, 63, 0, 38, 39, 40, 41, 42, 108, 0, 43, 0, 0, 0, 67, 0, 23, 44, 45, 46, 0, 47, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 462, 108, 0, 3, 0, 0, 0, 61, 0, 62, 0, 0, 0, 63, 0, 463, 464, 465, 466, 467, 0, 0, 0, 0, 0, 0, 67, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 463, 464, 465, 466, 467, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 305, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, 0, 0, 23, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 463, 464, 465, 466, 467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, 148, 149, 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162 }; static const yytype_int16 yycheck[] = { 4, 5, 6, 7, 8, 9, 166, 107, 49, 13, 135, 184, 0, 186, 13, 142, 332, 21, 71, 13, 286, 293, 331, 11, 334, 525, 35, 305, 32, 37, 166, 35, 54, 29, 183, 419, 27, 519, 445, 36, 37, 301, 433, 9, 37, 13, 99, 35, 4, 5, 54, 521, 56, 27, 190, 24, 10, 65, 331, 3, 530, 6, 59, 27, 1, 9, 6, 64, 5, 5, 92, 0, 41, 41, 18, 29, 67, 37, 52, 3, 4, 7, 27, 27, 7, 221, 9, 27, 92, 12, 481, 27, 5, 59, 194, 13, 62, 63, 9, 4, 3, 25, 106, 29, 108, 13, 9, 106, 31, 32, 33, 29, 9, 109, 27, 18, 27, 290, 291, 123, 13, 26, 9, 127, 27, 133, 9, 131, 127, 611, 27, 135, 0, 186, 128, 129, 140, 141, 9, 143, 144, 548, 35, 11, 27, 133, 142, 107, 618, 9, 650, 547, 536, 419, 9, 9, 422, 423, 18, 13, 433, 557, 166, 185, 9, 6, 170, 27, 13, 173, 7, 449, 9, 177, 274, 184, 3, 4, 487, 183, 184, 185, 682, 205, 140, 141, 190, 9, 579, 197, 27, 199, 328, 246, 247, 248, 184, 457, 186, 4, 197, 205, 199, 4, 197, 10, 199, 8, 481, 206, 207, 208, 4, 210, 487, 3, 488, 221, 10, 223, 9, 177, 358, 3, 13, 541, 230, 231, 0, 18, 227, 228, 332, 543, 9, 128, 129, 197, 27, 199, 133, 3, 4, 9, 16, 17, 9, 13, 270, 90, 91, 92, 18, 7, 4, 9, 25, 26, 4, 267, 10, 27, 0, 4, 10, 4, 270, 36, 37, 10, 536, 10, 9, 277, 4, 283, 9, 4, 16, 17, 10, 4, 290, 10, 337, 21, 4, 10, 4, 293, 463, 184, 10, 186, 10, 283, 304, 301, 286, 20, 322, 194, 290, 291, 11, 309, 579, 300, 40, 303, 1, 83, 84, 85, 5, 464, 465, 444, 322, 341, 314, 93, 94, 95, 328, 4, 286, 4, 325, 16, 17, 10, 4, 10, 25, 107, 436, 341, 10, 99, 300, 253, 254, 255, 256, 83, 84, 85, 18, 19, 347, 7, 22, 9, 358, 93, 94, 95, 7, 13, 9, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 3, 25, 4, 6, 6, 274, 4, 4, 6, 6, 4, 3, 6, 9, 283, 3, 83, 34, 35, 38, 39, 290, 291, 3, 4, 3, 4, 3, 4, 13, 410, 3, 4, 413, 303, 3, 4, 3, 4, 3, 4, 421, 543, 3, 4, 314, 421, 3, 4, 3, 4, 3, 4, 3, 4, 419, 436, 3, 4, 423, 5, 436, 249, 250, 3, 541, 251, 252, 257, 258, 4, 6, 444, 10, 10, 13, 3, 457, 447, 74, 29, 9, 452, 419, 464, 465, 422, 423, 10, 469, 470, 461, 5, 629, 52, 5, 494, 495, 496, 463, 81, 518, 10, 476, 521, 10, 25, 13, 8, 10, 9, 447, 10, 530, 494, 495, 496, 629, 10, 13, 10, 10, 10, 98, 497, 498, 23, 500, 512, 9, 514, 680, 23, 52, 3, 10, 8, 8, 57, 519, 59, 60, 61, 62, 63, 64, 65, 66, 4, 10, 4, 10, 421, 3, 3, 535, 4, 8, 10, 5, 535, 541, 9, 543, 83, 545, 541, 436, 10, 88, 550, 10, 536, 46, 47, 48, 49, 13, 52, 549, 3, 8, 10, 452, 3, 565, 3, 567, 8, 558, 565, 72, 461, 591, 463, 8, 10, 9, 71, 4, 536, 618, 13, 3, 10, 13, 10, 4, 3, 8, 8, 591, 13, 29, 10, 9, 4, 597, 11, 29, 593, 594, 558, 603, 283, 413, 99, 29, 13, 260, 259, 611, 423, 261, 535, 262, 617, 617, 264, 410, 263, 293, 617, 35, 583, 13, 279, 354, 663, 629, 630, 664, 27, 108, 652, 298, 626, 655, 656, 563, 658, 470, 678, 633, 629, 550, 535, 453, 452, 358, 550, 328, 652, -1, -1, 655, 656, -1, 658, -1, 549, -1, -1, -1, -1, -1, -1, 660, 6, 662, -1, 689, -1, 691, 692, 675, -1, -1, 678, 679, -1, -1, -1, 678, -1, -1, -1, 25, -1, 689, 708, 691, 692, 186, -1, -1, 680, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 708, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 57, 713, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, -1, -1, -1, -1, -1, 626, -1, -1, -1, -1, -1, -1, 633, 83, -1, -1, -1, -1, 88, -1, -1, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 229, -1, 6, -1, -1, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, -1, 0, 1, 680, 3, 25, 5, -1, 7, -1, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, 266, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, 52, 32, 33, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, 292, -1, -1, -1, -1, -1, -1, -1, -1, 337, -1, -1, -1, -1, -1, -1, 83, -1, -1, -1, -1, 88, -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 83, -1, 331, 1, 87, -1, 89, 5, -1, -1, 93, -1, -1, 96, 97, -1, -1, 100, -1, -1, 1, -1, 3, 106, 5, 6, 7, 25, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 25, -1, 27, 28, 29, 30, -1, 32, 33, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, 3, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 83, -1, 433, -1, 87, -1, 89, 25, -1, -1, 93, -1, -1, 96, 97, -1, 1, 100, 3, 4, 5, -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, 23, 57, 25, 59, 60, 61, 62, 63, 64, 65, 66, -1, 481, 518, -1, -1, 521, -1, 487, -1, 489, -1, -1, -1, -1, 530, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 516, -1, -1, -1, -1, 10, -1, -1, -1, 525, -1, 81, -1, 83, -1, -1, -1, 1, -1, 3, 25, 5, 6, 7, -1, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 25, -1, 27, 28, 29, 30, 52, 32, 33, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, 579, -1, -1, 618, 583, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, 96, 97, -1, 1, 100, 3, 634, 5, 6, 7, 106, 9, 9, -1, -1, -1, 14, 15, 16, 17, 18, -1, 650, 21, -1, -1, -1, -1, 25, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 677, -1, -1, -1, -1, 682, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 83, 83, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, 96, 97, -1, 1, 100, 3, -1, 5, 6, 7, 106, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, 1, -1, 3, -1, 5, -1, 7, -1, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, 96, 97, -1, -1, 100, -1, -1, 69, 70, 71, 106, 73, 74, 75, 76, 77, 78, 79, 80, 81, 3, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, 1, 96, 97, -1, 5, 100, 7, -1, 9, 25, -1, 106, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 25, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 52, 23, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, -1, -1, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 83, 3, -1, -1, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, 3, 32, 33, -1, 7, 25, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, -1, 83, 3, -1, -1, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 10, -1, 106, -1, 27, 28, 29, 30, 3, 32, 33, -1, 7, -1, 9, 25, -1, 27, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, 25, -1, 52, -1, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, 52, -1, -1, 93, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, 106, -1, -1, -1, -1, 83, 3, -1, -1, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, -1, 32, 33, 5, 6, 7, 25, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, 52, -1, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, -1, -1, 83, -1, -1, 5, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, 83, 32, 33, 5, 87, 7, 89, 9, 25, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, 1, -1, -1, -1, 5, -1, -1, -1, -1, -1, 106, -1, -1, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, 7, 25, 9, 93, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 106, -1, 25, -1, 27, 28, 29, 30, -1, 32, 33, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 83, -1, 30, -1, 87, -1, 89, 7, 8, 9, 93, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 106, 52, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, 64, 65, 66, 25, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, 9, -1, 52, -1, 13, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, 27, 83, -1, 30, -1, 87, -1, 89, 7, 8, 9, 93, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 106, 52, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, 64, 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, 9, 10, -1, -1, 83, -1, -1, -1, 87, 18, 89, 7, 8, 9, 93, -1, 25, -1, 14, 15, 16, 17, 18, -1, -1, 21, 9, 106, -1, -1, -1, 27, 28, 29, 30, 18, 32, 33, -1, -1, -1, -1, 25, 52, 27, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 83, -1, -1, -1, 87, 18, 89, 7, 8, 9, 93, 81, 25, -1, 14, 15, 16, 17, 18, -1, 7, 21, 9, 106, -1, -1, -1, 27, 28, 29, 30, 18, 32, 33, -1, -1, -1, -1, 25, 52, 27, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, -1, 52, -1, -1, 13, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, 27, 83, -1, 30, -1, 87, -1, 89, 7, 8, 9, 93, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 106, 52, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, 64, 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, 83, -1, 30, -1, 87, -1, 89, 7, 8, 9, 93, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, 106, 52, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, 64, 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, 55, -1, -1, -1, 59, -1, -1, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, -1, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, 7, 21, 9, 10, -1, 106, -1, 27, 28, 29, 30, 18, 32, 33, 7, -1, 9, 10, 25, -1, 27, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 52, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, 52, -1, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, 83, -1, -1, -1, 87, 7, 89, 9, 10, -1, 93, -1, 14, 15, 16, 17, 18, -1, 7, 21, 9, -1, -1, 106, -1, 27, 28, 29, 30, 18, 32, 33, 7, -1, 9, 10, 25, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, 52, -1, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, 83, -1, -1, -1, 87, 7, 89, 9, 10, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, 9, -1, -1, 106, 13, 27, 28, 29, 30, 18, 32, 33, 7, -1, 9, 10, 25, -1, 27, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, 52, -1, -1, -1, -1, 57, -1, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, 83, -1, -1, -1, 87, 7, 89, 9, -1, -1, 93, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, -1, 32, 33, 7, -1, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, -1, -1, 21, -1, -1, -1, -1, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, -1, 83, -1, -1, -1, 87, 7, 89, 9, 16, 17, 93, -1, 14, 15, 16, 17, 18, 25, -1, 21, -1, -1, -1, 106, -1, 27, 28, 29, 30, -1, 32, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 17, -1, -1, -1, -1, -1, -1, 86, 25, -1, 83, -1, -1, -1, 87, -1, 89, -1, -1, -1, 93, -1, 101, 102, 103, 104, 105, -1, -1, -1, -1, -1, -1, 106, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, -1, 16, 17, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, -1, 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, 103, 104, 105, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 4, -1, -1, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, 86, -1, -1, -1, 27, -1, -1, 30, -1, -1, -1, -1, -1, -1, -1, 101, 102, 103, 104, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, -1, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 16, 17, 83, 84, 85, 93, 94, 95, 107, 109, 110, 111, 195, 196, 197, 200, 201, 204, 205, 206, 215, 216, 27, 52, 180, 198, 198, 155, 180, 198, 199, 180, 1, 3, 5, 7, 9, 14, 15, 16, 17, 18, 21, 28, 29, 30, 32, 33, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 87, 89, 93, 96, 97, 100, 106, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 164, 165, 169, 171, 172, 173, 175, 176, 177, 178, 179, 180, 183, 196, 238, 242, 243, 244, 0, 111, 9, 18, 25, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 81, 112, 114, 116, 119, 120, 141, 142, 147, 150, 151, 152, 180, 182, 194, 208, 9, 13, 202, 9, 13, 30, 52, 64, 65, 66, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 180, 222, 229, 230, 231, 232, 233, 9, 202, 3, 4, 207, 208, 3, 4, 180, 3, 6, 6, 115, 116, 174, 175, 196, 52, 139, 180, 237, 1, 120, 139, 153, 159, 173, 9, 124, 9, 124, 124, 124, 137, 140, 13, 9, 9, 9, 164, 9, 180, 3, 3, 3, 139, 9, 59, 62, 63, 184, 9, 9, 9, 3, 139, 173, 9, 7, 9, 12, 31, 32, 33, 23, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 126, 18, 19, 22, 16, 17, 34, 35, 25, 26, 36, 37, 38, 39, 21, 20, 11, 40, 24, 41, 3, 4, 99, 170, 164, 13, 126, 150, 152, 153, 199, 208, 5, 180, 9, 3, 117, 118, 150, 116, 116, 5, 180, 113, 173, 174, 196, 7, 9, 151, 3, 198, 198, 207, 180, 221, 9, 180, 3, 223, 4, 228, 231, 233, 13, 180, 5, 203, 180, 217, 198, 3, 3, 117, 150, 6, 115, 175, 6, 115, 13, 231, 234, 235, 236, 10, 7, 9, 120, 152, 160, 161, 10, 10, 159, 159, 13, 164, 139, 139, 139, 74, 3, 139, 3, 3, 29, 188, 189, 9, 13, 231, 239, 240, 241, 52, 180, 3, 168, 139, 139, 10, 123, 138, 180, 180, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 126, 126, 126, 127, 127, 128, 128, 129, 129, 129, 129, 130, 130, 131, 132, 133, 134, 136, 135, 138, 173, 164, 10, 152, 26, 148, 149, 180, 5, 189, 3, 4, 113, 181, 182, 88, 141, 143, 144, 153, 196, 5, 173, 8, 18, 55, 59, 62, 63, 138, 185, 186, 187, 10, 153, 154, 155, 156, 157, 158, 159, 180, 10, 203, 159, 221, 1, 116, 224, 225, 226, 227, 173, 67, 157, 9, 180, 10, 209, 211, 86, 101, 102, 103, 104, 105, 114, 116, 215, 218, 219, 3, 6, 139, 13, 8, 231, 236, 8, 186, 187, 10, 156, 160, 161, 7, 9, 5, 126, 10, 10, 164, 10, 10, 10, 9, 3, 139, 3, 10, 13, 29, 188, 13, 10, 231, 241, 10, 10, 98, 166, 167, 10, 8, 4, 10, 13, 4, 6, 23, 148, 10, 118, 23, 9, 3, 6, 144, 13, 145, 146, 150, 141, 153, 143, 8, 185, 187, 8, 9, 150, 152, 10, 4, 10, 4, 207, 217, 10, 159, 3, 3, 157, 227, 225, 4, 221, 6, 90, 91, 92, 210, 3, 116, 212, 9, 115, 117, 117, 222, 139, 8, 187, 8, 10, 10, 8, 186, 187, 10, 156, 5, 138, 162, 163, 164, 164, 164, 139, 10, 139, 3, 3, 139, 3, 7, 29, 190, 191, 192, 10, 9, 173, 173, 138, 137, 6, 149, 140, 4, 6, 162, 52, 140, 3, 4, 13, 3, 145, 6, 8, 67, 67, 158, 217, 86, 229, 230, 10, 3, 159, 211, 13, 150, 213, 214, 3, 180, 220, 3, 3, 3, 8, 8, 187, 8, 10, 163, 4, 6, 72, 10, 164, 10, 10, 139, 10, 139, 3, 180, 9, 13, 4, 3, 180, 6, 10, 146, 140, 3, 86, 228, 180, 10, 138, 13, 4, 4, 10, 8, 4, 6, 162, 164, 3, 164, 164, 10, 164, 10, 10, 139, 8, 139, 190, 192, 10, 180, 138, 214, 180, 115, 6, 164, 164, 164, 10, 29, 10, 13, 164, 9, 29, 193, 139, 4, 10, 29 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: /* Line 1455 of yacc.c */ #line 843 "c-grammar.y" { START_PROFILE(name_2) (yyval) = Scm_ApplyRec1(name_1, (yyvsp[(2) - (2)])); END_PROFILE(name_2) } break; case 7: /* Line 1455 of yacc.c */ #line 852 "c-grammar.y" { START_PROFILE(name_3) (yyval) = Scm_AllReferencedInfoClear(); END_PROFILE(name_3) } break; case 8: /* Line 1455 of yacc.c */ #line 853 "c-grammar.y" { START_PROFILE(name_4) (yyval) = Scm_AllReferencedInfoClear(); END_PROFILE(name_4) } break; case 9: /* Line 1455 of yacc.c */ #line 854 "c-grammar.y" { START_PROFILE(name_5) (yyval) = Scm_AllReferencedInfoClear(); END_PROFILE(name_5) } break; case 10: /* Line 1455 of yacc.c */ #line 855 "c-grammar.y" { START_PROFILE(name_6) (yyval) = Scm_AllReferencedInfoClear(); END_PROFILE(name_6) } break; case 11: /* Line 1455 of yacc.c */ #line 859 "c-grammar.y" { START_PROFILE(name_8) (yyval) = Scm_EmitDefineInline(name_7,(yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_8) } break; case 12: /* Line 1455 of yacc.c */ #line 860 "c-grammar.y" { START_PROFILE(name_9) (yyval) = Scm_EmitDefineInline((yyvsp[(1) - (3)]),(yyvsp[(2) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_9) } break; case 13: /* Line 1455 of yacc.c */ #line 864 "c-grammar.y" { START_PROFILE(name_11) (yyval) = Scm_ApplyRec1(name_10, (yyvsp[(1) - (1)])); END_PROFILE(name_11) } break; case 14: /* Line 1455 of yacc.c */ #line 865 "c-grammar.y" { START_PROFILE(name_12) (yyval) = SCM_FALSE; END_PROFILE(name_12) } break; case 15: /* Line 1455 of yacc.c */ #line 869 "c-grammar.y" { START_PROFILE(name_13) (yyval) = Scm_ExternalDeclaration((yyvsp[(1) - (2)]),SCM_LIST1(Scm_NullDeclarator())); END_PROFILE(name_13) } break; case 16: /* Line 1455 of yacc.c */ #line 870 "c-grammar.y" { START_PROFILE(name_14) (yyval) = Scm_ExternalDeclaration((yyvsp[(1) - (3)]),(yyvsp[(2) - (3)])); END_PROFILE(name_14) } break; case 17: /* Line 1455 of yacc.c */ #line 874 "c-grammar.y" { START_PROFILE(name_16) (yyval) = Scm_Declaration((yyvsp[(1) - (2)]),name_15); END_PROFILE(name_16) } break; case 18: /* Line 1455 of yacc.c */ #line 875 "c-grammar.y" { START_PROFILE(name_17) (yyval) = Scm_Declaration((yyvsp[(1) - (3)]),(yyvsp[(2) - (3)])); END_PROFILE(name_17) } break; case 19: /* Line 1455 of yacc.c */ #line 876 "c-grammar.y" { START_PROFILE(name_18) (yyval) = (yyvsp[(2) - (2)]); END_PROFILE(name_18) } break; case 21: /* Line 1455 of yacc.c */ #line 881 "c-grammar.y" { START_PROFILE(name_19) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_19) } break; case 22: /* Line 1455 of yacc.c */ #line 882 "c-grammar.y" { START_PROFILE(name_20) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_20) } break; case 23: /* Line 1455 of yacc.c */ #line 883 "c-grammar.y" { START_PROFILE(name_21) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_21) } break; case 24: /* Line 1455 of yacc.c */ #line 887 "c-grammar.y" { START_PROFILE(name_22) (yyval) = CParser_List(Scm_ComposeVariableAttribute((yyvsp[(1) - (1)]))); END_PROFILE(name_22) } break; case 25: /* Line 1455 of yacc.c */ #line 888 "c-grammar.y" { START_PROFILE(name_23) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),Scm_ComposeVariableAttribute((yyvsp[(3) - (3)]))); END_PROFILE(name_23) } break; case 26: /* Line 1455 of yacc.c */ #line 892 "c-grammar.y" { START_PROFILE(name_24) (yyval) = Scm_ComposeDeclarator((yyvsp[(1) - (4)]),Scm_InitValueDeclarator((yyvsp[(4) - (4)]))); END_PROFILE(name_24) } break; case 27: /* Line 1455 of yacc.c */ #line 893 "c-grammar.y" { START_PROFILE(name_25) (yyval) = (yyvsp[(1) - (2)]); END_PROFILE(name_25) } break; case 28: /* Line 1455 of yacc.c */ #line 897 "c-grammar.y" { START_PROFILE(name_27) (yyval) = name_26; END_PROFILE(name_27) } break; case 29: /* Line 1455 of yacc.c */ #line 898 "c-grammar.y" { START_PROFILE(name_28) (yyval) = name_15; END_PROFILE(name_28) } break; case 30: /* Line 1455 of yacc.c */ #line 899 "c-grammar.y" { START_PROFILE(name_29) (yyval) = name_15; END_PROFILE(name_29) } break; case 31: /* Line 1455 of yacc.c */ #line 900 "c-grammar.y" { START_PROFILE(name_30) (yyval) = name_15; END_PROFILE(name_30) } break; case 32: /* Line 1455 of yacc.c */ #line 901 "c-grammar.y" { START_PROFILE(name_31) (yyval) = name_15; END_PROFILE(name_31) } break; case 33: /* Line 1455 of yacc.c */ #line 905 "c-grammar.y" { START_PROFILE(name_32) (yyval) = CParser_Typename((yyvsp[(1) - (1)])); END_PROFILE(name_32) } break; case 34: /* Line 1455 of yacc.c */ #line 906 "c-grammar.y" { START_PROFILE(name_34) (yyval) = name_33; END_PROFILE(name_34) } break; case 35: /* Line 1455 of yacc.c */ #line 907 "c-grammar.y" { START_PROFILE(name_36) (yyval) = name_35; END_PROFILE(name_36) } break; case 36: /* Line 1455 of yacc.c */ #line 908 "c-grammar.y" { START_PROFILE(name_37) (yyval) = name_15; END_PROFILE(name_37) } break; case 37: /* Line 1455 of yacc.c */ #line 909 "c-grammar.y" { START_PROFILE(name_38) (yyval) = name_15; END_PROFILE(name_38) } break; case 38: /* Line 1455 of yacc.c */ #line 910 "c-grammar.y" { START_PROFILE(name_39) (yyval) = name_15; END_PROFILE(name_39) } break; case 39: /* Line 1455 of yacc.c */ #line 911 "c-grammar.y" { START_PROFILE(name_41) (yyval) = Scm_ApplyRec1(name_40, (yyvsp[(1) - (1)])); END_PROFILE(name_41) } break; case 40: /* Line 1455 of yacc.c */ #line 912 "c-grammar.y" { START_PROFILE(name_43) (yyval) = Scm_ApplyRec1(name_42, (yyvsp[(1) - (1)])); END_PROFILE(name_43) } break; case 41: /* Line 1455 of yacc.c */ #line 913 "c-grammar.y" { START_PROFILE(name_44) (yyval) = name_15; END_PROFILE(name_44) } break; case 42: /* Line 1455 of yacc.c */ #line 914 "c-grammar.y" { START_PROFILE(name_45) (yyval) = CParser_Typename((yyvsp[(1) - (2)])); END_PROFILE(name_45) } break; case 43: /* Line 1455 of yacc.c */ #line 915 "c-grammar.y" { START_PROFILE(name_47) (yyval) = name_46; END_PROFILE(name_47) } break; case 44: /* Line 1455 of yacc.c */ #line 919 "c-grammar.y" { START_PROFILE(name_49) (yyval) = Scm_ApplyRec1(name_48, (yyvsp[(1) - (1)])); END_PROFILE(name_49) } break; case 45: /* Line 1455 of yacc.c */ #line 920 "c-grammar.y" { START_PROFILE(name_50) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_50) } break; case 46: /* Line 1455 of yacc.c */ #line 921 "c-grammar.y" { START_PROFILE(name_51) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_51) } break; case 47: /* Line 1455 of yacc.c */ #line 922 "c-grammar.y" { START_PROFILE(name_53) (yyval) = Scm_ApplyRec1(name_52, (yyvsp[(1) - (1)])); END_PROFILE(name_53) } break; case 48: /* Line 1455 of yacc.c */ #line 923 "c-grammar.y" { START_PROFILE(name_55) (yyval) = Scm_ApplyRec1(name_54, (yyvsp[(2) - (3)])); END_PROFILE(name_55) } break; case 49: /* Line 1455 of yacc.c */ #line 924 "c-grammar.y" { START_PROFILE(name_57) (yyval) = Scm_ApplyRec1(name_56, (yyvsp[(2) - (3)])); END_PROFILE(name_57) } break; case 50: /* Line 1455 of yacc.c */ #line 925 "c-grammar.y" { START_PROFILE(name_58) (yyval) = SCM_FALSE; END_PROFILE(name_58) } break; case 51: /* Line 1455 of yacc.c */ #line 926 "c-grammar.y" { START_PROFILE(name_59) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_59) } break; case 52: /* Line 1455 of yacc.c */ #line 927 "c-grammar.y" { START_PROFILE(name_60) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_60) } break; case 53: /* Line 1455 of yacc.c */ #line 928 "c-grammar.y" { START_PROFILE(name_61) (yyval) = SCM_FALSE; END_PROFILE(name_61) } break; case 54: /* Line 1455 of yacc.c */ #line 929 "c-grammar.y" { START_PROFILE(name_62) (yyval) = SCM_FALSE; END_PROFILE(name_62) } break; case 55: /* Line 1455 of yacc.c */ #line 933 "c-grammar.y" { START_PROFILE(name_63) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_63) } break; case 56: /* Line 1455 of yacc.c */ #line 934 "c-grammar.y" { START_PROFILE(name_65) (yyval) = Scm_ApplyRec2(name_64, (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); END_PROFILE(name_65) } break; case 57: /* Line 1455 of yacc.c */ #line 935 "c-grammar.y" { START_PROFILE(name_67) (yyval) = Scm_ApplyRec2(name_66, (yyvsp[(1) - (3)]), name_15); END_PROFILE(name_67) } break; case 58: /* Line 1455 of yacc.c */ #line 936 "c-grammar.y" { START_PROFILE(name_68) (yyval) = Scm_ApplyRec2(name_66, (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); END_PROFILE(name_68) } break; case 59: /* Line 1455 of yacc.c */ #line 937 "c-grammar.y" { START_PROFILE(name_70) (yyval) = Scm_ApplyRec2(name_69, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_70) } break; case 60: /* Line 1455 of yacc.c */ #line 938 "c-grammar.y" { START_PROFILE(name_72) (yyval) = Scm_ApplyRec2(name_71, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_72) } break; case 61: /* Line 1455 of yacc.c */ #line 939 "c-grammar.y" { START_PROFILE(name_74) (yyval) = Scm_ApplyRec1(name_73, (yyvsp[(1) - (2)])); END_PROFILE(name_74) } break; case 62: /* Line 1455 of yacc.c */ #line 940 "c-grammar.y" { START_PROFILE(name_76) (yyval) = Scm_ApplyRec1(name_75, (yyvsp[(1) - (2)])); END_PROFILE(name_76) } break; case 63: /* Line 1455 of yacc.c */ #line 944 "c-grammar.y" { START_PROFILE(name_77) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_77) } break; case 64: /* Line 1455 of yacc.c */ #line 945 "c-grammar.y" { START_PROFILE(name_78) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_78) } break; case 65: /* Line 1455 of yacc.c */ #line 949 "c-grammar.y" { START_PROFILE(name_79) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_79) } break; case 66: /* Line 1455 of yacc.c */ #line 950 "c-grammar.y" { START_PROFILE(name_81) (yyval) = Scm_ApplyRec1(name_80, (yyvsp[(2) - (2)])); END_PROFILE(name_81) } break; case 67: /* Line 1455 of yacc.c */ #line 951 "c-grammar.y" { START_PROFILE(name_83) (yyval) = Scm_ApplyRec1(name_82, (yyvsp[(2) - (2)])); END_PROFILE(name_83) } break; case 68: /* Line 1455 of yacc.c */ #line 952 "c-grammar.y" { START_PROFILE(name_85) (yyval) = Scm_ApplyRec2(name_84, (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); END_PROFILE(name_85) } break; case 69: /* Line 1455 of yacc.c */ #line 953 "c-grammar.y" { START_PROFILE(name_87) (yyval) = Scm_ApplyRec1(name_86, (yyvsp[(2) - (2)])); END_PROFILE(name_87) } break; case 70: /* Line 1455 of yacc.c */ #line 954 "c-grammar.y" { START_PROFILE(name_89) (yyval) = Scm_ApplyRec1(name_88, (yyvsp[(3) - (4)])); END_PROFILE(name_89) } break; case 71: /* Line 1455 of yacc.c */ #line 955 "c-grammar.y" { START_PROFILE(name_90) (yyval) = (yyvsp[(2) - (2)]); END_PROFILE(name_90) } break; case 72: /* Line 1455 of yacc.c */ #line 959 "c-grammar.y" { START_PROFILE(name_91) (yyval) = token_sym__26; END_PROFILE(name_91) } break; case 73: /* Line 1455 of yacc.c */ #line 960 "c-grammar.y" { START_PROFILE(name_92) (yyval) = token_sym__2a; END_PROFILE(name_92) } break; case 74: /* Line 1455 of yacc.c */ #line 961 "c-grammar.y" { START_PROFILE(name_93) (yyval) = token_sym__2b; END_PROFILE(name_93) } break; case 75: /* Line 1455 of yacc.c */ #line 962 "c-grammar.y" { START_PROFILE(name_94) (yyval) = token_sym__; END_PROFILE(name_94) } break; case 76: /* Line 1455 of yacc.c */ #line 963 "c-grammar.y" { START_PROFILE(name_95) (yyval) = token_sym__7e; END_PROFILE(name_95) } break; case 77: /* Line 1455 of yacc.c */ #line 964 "c-grammar.y" { START_PROFILE(name_96) (yyval) = token_sym_X; END_PROFILE(name_96) } break; case 78: /* Line 1455 of yacc.c */ #line 968 "c-grammar.y" { START_PROFILE(name_97) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_97) } break; case 79: /* Line 1455 of yacc.c */ #line 969 "c-grammar.y" { START_PROFILE(name_99) (yyval) = Scm_ApplyRec2(name_98, (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])); END_PROFILE(name_99) } break; case 80: /* Line 1455 of yacc.c */ #line 973 "c-grammar.y" { START_PROFILE(name_100) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_100) } break; case 81: /* Line 1455 of yacc.c */ #line 974 "c-grammar.y" { START_PROFILE(name_102) (yyval) = Scm_ApplyRec2(name_101, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_102) } break; case 82: /* Line 1455 of yacc.c */ #line 975 "c-grammar.y" { START_PROFILE(name_104) (yyval) = Scm_ApplyRec2(name_103, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_104) } break; case 83: /* Line 1455 of yacc.c */ #line 976 "c-grammar.y" { START_PROFILE(name_106) (yyval) = Scm_ApplyRec2(name_105, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_106) } break; case 84: /* Line 1455 of yacc.c */ #line 980 "c-grammar.y" { START_PROFILE(name_107) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_107) } break; case 85: /* Line 1455 of yacc.c */ #line 981 "c-grammar.y" { START_PROFILE(name_109) (yyval) = Scm_ApplyRec2(name_108, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_109) } break; case 86: /* Line 1455 of yacc.c */ #line 982 "c-grammar.y" { START_PROFILE(name_111) (yyval) = Scm_ApplyRec2(name_110, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_111) } break; case 87: /* Line 1455 of yacc.c */ #line 986 "c-grammar.y" { START_PROFILE(name_112) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_112) } break; case 88: /* Line 1455 of yacc.c */ #line 987 "c-grammar.y" { START_PROFILE(name_114) (yyval) = Scm_ApplyRec2(name_113, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_114) } break; case 89: /* Line 1455 of yacc.c */ #line 988 "c-grammar.y" { START_PROFILE(name_116) (yyval) = Scm_ApplyRec2(name_115, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_116) } break; case 90: /* Line 1455 of yacc.c */ #line 992 "c-grammar.y" { START_PROFILE(name_117) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_117) } break; case 91: /* Line 1455 of yacc.c */ #line 993 "c-grammar.y" { START_PROFILE(name_119) (yyval) = Scm_ApplyRec2(name_118, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_119) } break; case 92: /* Line 1455 of yacc.c */ #line 994 "c-grammar.y" { START_PROFILE(name_121) (yyval) = Scm_ApplyRec2(name_120, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_121) } break; case 93: /* Line 1455 of yacc.c */ #line 995 "c-grammar.y" { START_PROFILE(name_123) (yyval) = Scm_ApplyRec2(name_122, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_123) } break; case 94: /* Line 1455 of yacc.c */ #line 996 "c-grammar.y" { START_PROFILE(name_125) (yyval) = Scm_ApplyRec2(name_124, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_125) } break; case 95: /* Line 1455 of yacc.c */ #line 1000 "c-grammar.y" { START_PROFILE(name_126) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_126) } break; case 96: /* Line 1455 of yacc.c */ #line 1001 "c-grammar.y" { START_PROFILE(name_128) (yyval) = Scm_ApplyRec2(name_127, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_128) } break; case 97: /* Line 1455 of yacc.c */ #line 1002 "c-grammar.y" { START_PROFILE(name_130) (yyval) = Scm_ApplyRec2(name_129, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_130) } break; case 98: /* Line 1455 of yacc.c */ #line 1006 "c-grammar.y" { START_PROFILE(name_131) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_131) } break; case 99: /* Line 1455 of yacc.c */ #line 1007 "c-grammar.y" { START_PROFILE(name_133) (yyval) = Scm_ApplyRec2(name_132, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_133) } break; case 100: /* Line 1455 of yacc.c */ #line 1011 "c-grammar.y" { START_PROFILE(name_134) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_134) } break; case 101: /* Line 1455 of yacc.c */ #line 1012 "c-grammar.y" { START_PROFILE(name_136) (yyval) = Scm_ApplyRec2(name_135, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_136) } break; case 102: /* Line 1455 of yacc.c */ #line 1016 "c-grammar.y" { START_PROFILE(name_137) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_137) } break; case 103: /* Line 1455 of yacc.c */ #line 1017 "c-grammar.y" { START_PROFILE(name_139) (yyval) = Scm_ApplyRec2(name_138, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_139) } break; case 104: /* Line 1455 of yacc.c */ #line 1021 "c-grammar.y" { START_PROFILE(name_140) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_140) } break; case 105: /* Line 1455 of yacc.c */ #line 1022 "c-grammar.y" { START_PROFILE(name_142) (yyval) = Scm_ApplyRec2(name_141, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_142) } break; case 106: /* Line 1455 of yacc.c */ #line 1026 "c-grammar.y" { START_PROFILE(name_143) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_143) } break; case 107: /* Line 1455 of yacc.c */ #line 1027 "c-grammar.y" { START_PROFILE(name_145) (yyval) = Scm_ApplyRec2(name_144, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_145) } break; case 108: /* Line 1455 of yacc.c */ #line 1031 "c-grammar.y" { START_PROFILE(name_146) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_146) } break; case 109: /* Line 1455 of yacc.c */ #line 1032 "c-grammar.y" { START_PROFILE(name_148) (yyval) = Scm_ApplyRec3(name_147, (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); END_PROFILE(name_148) } break; case 110: /* Line 1455 of yacc.c */ #line 1036 "c-grammar.y" { START_PROFILE(name_149) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_149) } break; case 111: /* Line 1455 of yacc.c */ #line 1037 "c-grammar.y" { START_PROFILE(name_151) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_151) } break; case 112: /* Line 1455 of yacc.c */ #line 1038 "c-grammar.y" { START_PROFILE(name_152) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_101, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_152) } break; case 113: /* Line 1455 of yacc.c */ #line 1039 "c-grammar.y" { START_PROFILE(name_153) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_103, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_153) } break; case 114: /* Line 1455 of yacc.c */ #line 1040 "c-grammar.y" { START_PROFILE(name_154) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_105, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_154) } break; case 115: /* Line 1455 of yacc.c */ #line 1041 "c-grammar.y" { START_PROFILE(name_155) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_108, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_155) } break; case 116: /* Line 1455 of yacc.c */ #line 1042 "c-grammar.y" { START_PROFILE(name_156) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_110, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_156) } break; case 117: /* Line 1455 of yacc.c */ #line 1043 "c-grammar.y" { START_PROFILE(name_157) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_113, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_157) } break; case 118: /* Line 1455 of yacc.c */ #line 1044 "c-grammar.y" { START_PROFILE(name_158) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_115, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_158) } break; case 119: /* Line 1455 of yacc.c */ #line 1045 "c-grammar.y" { START_PROFILE(name_159) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_132, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_159) } break; case 120: /* Line 1455 of yacc.c */ #line 1046 "c-grammar.y" { START_PROFILE(name_160) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_135, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_160) } break; case 121: /* Line 1455 of yacc.c */ #line 1047 "c-grammar.y" { START_PROFILE(name_161) (yyval) = Scm_ApplyRec2(name_150, (yyvsp[(1) - (3)]), Scm_ApplyRec2(name_138, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]))); END_PROFILE(name_161) } break; case 122: /* Line 1455 of yacc.c */ #line 1051 "c-grammar.y" { START_PROFILE(name_162) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_162) } break; case 123: /* Line 1455 of yacc.c */ #line 1052 "c-grammar.y" { START_PROFILE(name_164) (yyval) = Scm_ApplyRec2(name_163, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_164) } break; case 124: /* Line 1455 of yacc.c */ #line 1056 "c-grammar.y" { START_PROFILE(name_165) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_165) } break; case 125: /* Line 1455 of yacc.c */ #line 1060 "c-grammar.y" { START_PROFILE(name_167) (yyval) = Scm_ApplyRec3(name_166, (yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)])); END_PROFILE(name_167) } break; case 126: /* Line 1455 of yacc.c */ #line 1061 "c-grammar.y" { START_PROFILE(name_168) (yyval) = Scm_ApplyRec3(name_166, (yyvsp[(1) - (4)]), SCM_FALSE, (yyvsp[(3) - (4)])); END_PROFILE(name_168) } break; case 127: /* Line 1455 of yacc.c */ #line 1062 "c-grammar.y" { START_PROFILE(name_169) (yyval) = Scm_ApplyRec3(name_166, (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]), SCM_FALSE); END_PROFILE(name_169) } break; case 128: /* Line 1455 of yacc.c */ #line 1066 "c-grammar.y" { START_PROFILE(name_170) (yyval) = token_sym_STRUCT; END_PROFILE(name_170) } break; case 129: /* Line 1455 of yacc.c */ #line 1067 "c-grammar.y" { START_PROFILE(name_171) (yyval) = token_sym_UNION; END_PROFILE(name_171) } break; case 130: /* Line 1455 of yacc.c */ #line 1071 "c-grammar.y" { START_PROFILE(name_172) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_172) } break; case 131: /* Line 1455 of yacc.c */ #line 1072 "c-grammar.y" { START_PROFILE(name_173) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_173) } break; case 132: /* Line 1455 of yacc.c */ #line 1076 "c-grammar.y" { START_PROFILE(name_175) Scm_ApplyRec0(name_174); (yyval) = Scm_MakeTypeDeclList((yyvsp[(1) - (3)]),(yyvsp[(2) - (3)])); END_PROFILE(name_175) } break; case 133: /* Line 1455 of yacc.c */ #line 1077 "c-grammar.y" { START_PROFILE(name_176) Scm_ApplyRec0(name_174); (yyval) = Scm_MakeTypeDeclList((yyvsp[(2) - (4)]),(yyvsp[(3) - (4)])); END_PROFILE(name_176) } break; case 134: /* Line 1455 of yacc.c */ #line 1078 "c-grammar.y" { START_PROFILE(name_179) Scm_ApplyRec0(name_174); (yyval) = Scm_MakeTypeDeclList(CParser_List((yyvsp[(1) - (2)])),SCM_LIST1(Scm_IdentifierDeclarator(Scm_ApplyRec1(name_177, name_178)))); END_PROFILE(name_179) } break; case 135: /* Line 1455 of yacc.c */ #line 1079 "c-grammar.y" { START_PROFILE(name_180) Scm_ApplyRec0(name_174); (yyval) = Scm_MakeTypeDeclList(CParser_List((yyvsp[(2) - (3)])),SCM_LIST1(Scm_IdentifierDeclarator(Scm_ApplyRec1(name_177, name_178)))); END_PROFILE(name_180) } break; case 136: /* Line 1455 of yacc.c */ #line 1080 "c-grammar.y" { START_PROFILE(name_181) (yyval) = name_15; END_PROFILE(name_181) } break; case 137: /* Line 1455 of yacc.c */ #line 1084 "c-grammar.y" { START_PROFILE(name_182) (yyval) = CParser_List(Scm_ComposeVariableAttribute((yyvsp[(1) - (1)]))); END_PROFILE(name_182) } break; case 138: /* Line 1455 of yacc.c */ #line 1085 "c-grammar.y" { START_PROFILE(name_183) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),Scm_ComposeVariableAttribute((yyvsp[(3) - (3)]))); END_PROFILE(name_183) } break; case 139: /* Line 1455 of yacc.c */ #line 1089 "c-grammar.y" { START_PROFILE(name_184) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_184) } break; case 140: /* Line 1455 of yacc.c */ #line 1090 "c-grammar.y" { START_PROFILE(name_185) (yyval) = Scm_BitFieldDeclarator((yyvsp[(2) - (2)])); END_PROFILE(name_185) } break; case 141: /* Line 1455 of yacc.c */ #line 1091 "c-grammar.y" { START_PROFILE(name_186) (yyval) = Scm_ComposeDeclarator(Scm_BitFieldDeclarator((yyvsp[(3) - (3)])),(yyvsp[(1) - (3)])); END_PROFILE(name_186) } break; case 142: /* Line 1455 of yacc.c */ #line 1095 "c-grammar.y" { START_PROFILE(name_188) (yyval) = Scm_ApplyRec2(name_187, SCM_FALSE, (yyvsp[(3) - (4)])); END_PROFILE(name_188) } break; case 143: /* Line 1455 of yacc.c */ #line 1096 "c-grammar.y" { START_PROFILE(name_189) (yyval) = Scm_ApplyRec2(name_187, SCM_FALSE, (yyvsp[(3) - (5)])); END_PROFILE(name_189) } break; case 144: /* Line 1455 of yacc.c */ #line 1097 "c-grammar.y" { START_PROFILE(name_190) (yyval) = Scm_ApplyRec2(name_187, (yyvsp[(2) - (5)]), (yyvsp[(4) - (5)])); END_PROFILE(name_190) } break; case 145: /* Line 1455 of yacc.c */ #line 1098 "c-grammar.y" { START_PROFILE(name_191) (yyval) = Scm_ApplyRec2(name_187, (yyvsp[(2) - (6)]), (yyvsp[(4) - (6)])); END_PROFILE(name_191) } break; case 146: /* Line 1455 of yacc.c */ #line 1099 "c-grammar.y" { START_PROFILE(name_192) (yyval) = Scm_ApplyRec2(name_187, (yyvsp[(2) - (2)]), name_15); END_PROFILE(name_192) } break; case 147: /* Line 1455 of yacc.c */ #line 1103 "c-grammar.y" { START_PROFILE(name_193) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_193) } break; case 148: /* Line 1455 of yacc.c */ #line 1104 "c-grammar.y" { START_PROFILE(name_194) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_194) } break; case 149: /* Line 1455 of yacc.c */ #line 1108 "c-grammar.y" { START_PROFILE(name_196) (yyval) = Scm_ApplyRec2(name_195, (yyvsp[(1) - (1)]), SCM_FALSE); END_PROFILE(name_196) } break; case 150: /* Line 1455 of yacc.c */ #line 1109 "c-grammar.y" { START_PROFILE(name_197) (yyval) = Scm_ApplyRec2(name_195, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_197) } break; case 151: /* Line 1455 of yacc.c */ #line 1113 "c-grammar.y" { START_PROFILE(name_198) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_198) } break; case 152: /* Line 1455 of yacc.c */ #line 1114 "c-grammar.y" { START_PROFILE(name_199) (yyval) = Scm_ComposeDeclarator((yyvsp[(2) - (2)]),(yyvsp[(1) - (2)])); END_PROFILE(name_199) } break; case 153: /* Line 1455 of yacc.c */ #line 1118 "c-grammar.y" { START_PROFILE(name_200) (yyval) = Scm_IdentifierDeclarator((yyvsp[(1) - (1)])); END_PROFILE(name_200) } break; case 154: /* Line 1455 of yacc.c */ #line 1119 "c-grammar.y" { START_PROFILE(name_201) (yyval) = (yyvsp[(2) - (3)]); END_PROFILE(name_201) } break; case 155: /* Line 1455 of yacc.c */ #line 1120 "c-grammar.y" { START_PROFILE(name_202) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator(SCM_FALSE),(yyvsp[(1) - (3)])); END_PROFILE(name_202) } break; case 156: /* Line 1455 of yacc.c */ #line 1121 "c-grammar.y" { START_PROFILE(name_203) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator(SCM_FALSE),(yyvsp[(1) - (4)])); END_PROFILE(name_203) } break; case 157: /* Line 1455 of yacc.c */ #line 1122 "c-grammar.y" { START_PROFILE(name_204) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator((yyvsp[(3) - (4)])),(yyvsp[(1) - (4)])); END_PROFILE(name_204) } break; case 158: /* Line 1455 of yacc.c */ #line 1123 "c-grammar.y" { START_PROFILE(name_205) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator((yyvsp[(4) - (5)])),(yyvsp[(1) - (5)])); END_PROFILE(name_205) } break; case 159: /* Line 1455 of yacc.c */ #line 1124 "c-grammar.y" { START_PROFILE(name_206) (yyval) = Scm_ComposeDeclarator((yyvsp[(1) - (3)]),Scm_FuncDeclarator(name_15)); END_PROFILE(name_206) } break; case 160: /* Line 1455 of yacc.c */ #line 1125 "c-grammar.y" { START_PROFILE(name_207) (yyval) = Scm_ComposeDeclarator((yyvsp[(1) - (4)]),(yyvsp[(3) - (4)])); END_PROFILE(name_207) } break; case 161: /* Line 1455 of yacc.c */ #line 1126 "c-grammar.y" { START_PROFILE(name_208) (yyval) = (yyvsp[(1) - (4)]); END_PROFILE(name_208) } break; case 162: /* Line 1455 of yacc.c */ #line 1130 "c-grammar.y" { START_PROFILE(name_209) (yyval) = Scm_PtrDeclarator(); END_PROFILE(name_209) } break; case 163: /* Line 1455 of yacc.c */ #line 1131 "c-grammar.y" { START_PROFILE(name_210) (yyval) = Scm_PtrDeclarator(); END_PROFILE(name_210) } break; case 164: /* Line 1455 of yacc.c */ #line 1132 "c-grammar.y" { START_PROFILE(name_211) (yyval) = Scm_ComposeDeclarator(Scm_PtrDeclarator(),(yyvsp[(2) - (2)])); END_PROFILE(name_211) } break; case 165: /* Line 1455 of yacc.c */ #line 1133 "c-grammar.y" { START_PROFILE(name_212) (yyval) = Scm_ComposeDeclarator(Scm_PtrDeclarator(),(yyvsp[(3) - (3)])); END_PROFILE(name_212) } break; case 166: /* Line 1455 of yacc.c */ #line 1137 "c-grammar.y" { START_PROFILE(name_213) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_213) } break; case 167: /* Line 1455 of yacc.c */ #line 1138 "c-grammar.y" { START_PROFILE(name_214) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_214) } break; case 170: /* Line 1455 of yacc.c */ #line 1147 "c-grammar.y" { START_PROFILE(name_215) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_215) } break; case 171: /* Line 1455 of yacc.c */ #line 1148 "c-grammar.y" { START_PROFILE(name_216) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_216) } break; case 172: /* Line 1455 of yacc.c */ #line 1152 "c-grammar.y" { START_PROFILE(name_217) (yyval) = Scm_FuncDeclarator((yyvsp[(1) - (1)])); END_PROFILE(name_217) } break; case 173: /* Line 1455 of yacc.c */ #line 1153 "c-grammar.y" { START_PROFILE(name_218) (yyval) = Scm_FuncVaargsDeclarator((yyvsp[(1) - (3)])); END_PROFILE(name_218) } break; case 174: /* Line 1455 of yacc.c */ #line 1157 "c-grammar.y" { START_PROFILE(name_219) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_219) } break; case 175: /* Line 1455 of yacc.c */ #line 1158 "c-grammar.y" { START_PROFILE(name_220) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_220) } break; case 176: /* Line 1455 of yacc.c */ #line 1162 "c-grammar.y" { START_PROFILE(name_221) (yyval) = Scm_ParameterDeclaration(Scm_MakeTypeDecl((yyvsp[(1) - (2)]),Scm_ComposeVariableAttribute((yyvsp[(2) - (2)])))); END_PROFILE(name_221) } break; case 177: /* Line 1455 of yacc.c */ #line 1163 "c-grammar.y" { START_PROFILE(name_222) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_222) } break; case 178: /* Line 1455 of yacc.c */ #line 1167 "c-grammar.y" { START_PROFILE(name_223) (yyval) = Scm_MakeTypeDecl((yyvsp[(1) - (1)]),Scm_NullDeclarator()); END_PROFILE(name_223) } break; case 179: /* Line 1455 of yacc.c */ #line 1168 "c-grammar.y" { START_PROFILE(name_224) (yyval) = Scm_MakeTypeDecl((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_224) } break; case 180: /* Line 1455 of yacc.c */ #line 1172 "c-grammar.y" { START_PROFILE(name_225) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_225) } break; case 181: /* Line 1455 of yacc.c */ #line 1173 "c-grammar.y" { START_PROFILE(name_226) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_226) } break; case 182: /* Line 1455 of yacc.c */ #line 1174 "c-grammar.y" { START_PROFILE(name_227) (yyval) = Scm_ComposeDeclarator((yyvsp[(2) - (2)]),(yyvsp[(1) - (2)])); END_PROFILE(name_227) } break; case 183: /* Line 1455 of yacc.c */ #line 1178 "c-grammar.y" { START_PROFILE(name_228) (yyval) = (yyvsp[(2) - (3)]); END_PROFILE(name_228) } break; case 184: /* Line 1455 of yacc.c */ #line 1179 "c-grammar.y" { START_PROFILE(name_229) (yyval) = Scm_PtrDeclarator(); END_PROFILE(name_229) } break; case 185: /* Line 1455 of yacc.c */ #line 1180 "c-grammar.y" { START_PROFILE(name_230) (yyval) = Scm_PtrDeclarator(); END_PROFILE(name_230) } break; case 186: /* Line 1455 of yacc.c */ #line 1181 "c-grammar.y" { START_PROFILE(name_231) (yyval) = Scm_ArrayDeclarator((yyvsp[(2) - (3)])); END_PROFILE(name_231) } break; case 187: /* Line 1455 of yacc.c */ #line 1182 "c-grammar.y" { START_PROFILE(name_232) (yyval) = Scm_ArrayDeclarator((yyvsp[(3) - (4)])); END_PROFILE(name_232) } break; case 188: /* Line 1455 of yacc.c */ #line 1183 "c-grammar.y" { START_PROFILE(name_233) (yyval) = Scm_ComposeDeclarator(Scm_PtrDeclarator(),(yyvsp[(1) - (3)])); END_PROFILE(name_233) } break; case 189: /* Line 1455 of yacc.c */ #line 1184 "c-grammar.y" { START_PROFILE(name_234) (yyval) = Scm_ComposeDeclarator(Scm_PtrDeclarator(),(yyvsp[(1) - (4)])); END_PROFILE(name_234) } break; case 190: /* Line 1455 of yacc.c */ #line 1185 "c-grammar.y" { START_PROFILE(name_235) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator((yyvsp[(3) - (4)])),(yyvsp[(1) - (4)])); END_PROFILE(name_235) } break; case 191: /* Line 1455 of yacc.c */ #line 1186 "c-grammar.y" { START_PROFILE(name_236) (yyval) = Scm_ComposeDeclarator(Scm_ArrayDeclarator((yyvsp[(4) - (5)])),(yyvsp[(1) - (5)])); END_PROFILE(name_236) } break; case 192: /* Line 1455 of yacc.c */ #line 1187 "c-grammar.y" { START_PROFILE(name_237) (yyval) = Scm_FuncDeclarator(name_15); END_PROFILE(name_237) } break; case 193: /* Line 1455 of yacc.c */ #line 1188 "c-grammar.y" { START_PROFILE(name_238) (yyval) = (yyvsp[(2) - (3)]); END_PROFILE(name_238) } break; case 194: /* Line 1455 of yacc.c */ #line 1189 "c-grammar.y" { START_PROFILE(name_239) (yyval) = Scm_ComposeDeclarator((yyvsp[(1) - (3)]),Scm_FuncDeclarator(name_15)); END_PROFILE(name_239) } break; case 195: /* Line 1455 of yacc.c */ #line 1190 "c-grammar.y" { START_PROFILE(name_240) (yyval) = Scm_ComposeDeclarator((yyvsp[(1) - (4)]),(yyvsp[(3) - (4)])); END_PROFILE(name_240) } break; case 196: /* Line 1455 of yacc.c */ #line 1194 "c-grammar.y" { START_PROFILE(name_241) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_241) } break; case 197: /* Line 1455 of yacc.c */ #line 1195 "c-grammar.y" { START_PROFILE(name_242) (yyval) = SCM_FALSE; END_PROFILE(name_242) } break; case 198: /* Line 1455 of yacc.c */ #line 1196 "c-grammar.y" { START_PROFILE(name_243) (yyval) = SCM_FALSE; END_PROFILE(name_243) } break; case 201: /* Line 1455 of yacc.c */ #line 1205 "c-grammar.y" { START_PROFILE(name_244) (yyval) = SCM_FALSE; END_PROFILE(name_244) } break; case 202: /* Line 1455 of yacc.c */ #line 1206 "c-grammar.y" { START_PROFILE(name_245) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_245) } break; case 203: /* Line 1455 of yacc.c */ #line 1207 "c-grammar.y" { START_PROFILE(name_246) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_246) } break; case 204: /* Line 1455 of yacc.c */ #line 1208 "c-grammar.y" { START_PROFILE(name_247) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_247) } break; case 205: /* Line 1455 of yacc.c */ #line 1209 "c-grammar.y" { START_PROFILE(name_248) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_248) } break; case 206: /* Line 1455 of yacc.c */ #line 1210 "c-grammar.y" { START_PROFILE(name_249) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_249) } break; case 207: /* Line 1455 of yacc.c */ #line 1211 "c-grammar.y" { START_PROFILE(name_250) (yyval) = SCM_FALSE; END_PROFILE(name_250) } break; case 208: /* Line 1455 of yacc.c */ #line 1212 "c-grammar.y" { START_PROFILE(name_251) (yyval) = SCM_FALSE; END_PROFILE(name_251) } break; case 224: /* Line 1455 of yacc.c */ #line 1255 "c-grammar.y" { START_PROFILE(name_253) (yyval) = Scm_ApplyRec1(name_56, name_252); END_PROFILE(name_253) } break; case 225: /* Line 1455 of yacc.c */ #line 1256 "c-grammar.y" { START_PROFILE(name_254) (yyval) = Scm_ApplyRec1(name_56, (yyvsp[(2) - (3)])); END_PROFILE(name_254) } break; case 226: /* Line 1455 of yacc.c */ #line 1257 "c-grammar.y" { START_PROFILE(name_255) (yyval) = Scm_ApplyRec1(name_56, name_252); END_PROFILE(name_255) } break; case 227: /* Line 1455 of yacc.c */ #line 1258 "c-grammar.y" { START_PROFILE(name_257) (yyval) = Scm_ApplyRec2(name_256, (yyvsp[(2) - (4)]), (yyvsp[(3) - (4)])); END_PROFILE(name_257) } break; case 228: /* Line 1455 of yacc.c */ #line 1259 "c-grammar.y" { START_PROFILE(name_258) (yyval) = SCM_FALSE; END_PROFILE(name_258) } break; case 229: /* Line 1455 of yacc.c */ #line 1263 "c-grammar.y" { START_PROFILE(name_259) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_259) } break; case 230: /* Line 1455 of yacc.c */ #line 1264 "c-grammar.y" { START_PROFILE(name_260) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_260) } break; case 231: /* Line 1455 of yacc.c */ #line 1268 "c-grammar.y" { START_PROFILE(name_261) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_261) } break; case 232: /* Line 1455 of yacc.c */ #line 1269 "c-grammar.y" { START_PROFILE(name_262) (yyval) = CParser_AddList((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_262) } break; case 233: /* Line 1455 of yacc.c */ #line 1273 "c-grammar.y" { START_PROFILE(name_263) (yyval) = SCM_MAKE_INT(0); END_PROFILE(name_263) } break; case 234: /* Line 1455 of yacc.c */ #line 1274 "c-grammar.y" { START_PROFILE(name_264) (yyval) = (yyvsp[(1) - (2)]); END_PROFILE(name_264) } break; case 235: /* Line 1455 of yacc.c */ #line 1275 "c-grammar.y" { START_PROFILE(name_265) (yyval) = SCM_FALSE; END_PROFILE(name_265) } break; case 236: /* Line 1455 of yacc.c */ #line 1279 "c-grammar.y" { START_PROFILE(name_266) (yyval) = Scm_ApplyRec3(name_147, (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)]), SCM_MAKE_INT(0)); END_PROFILE(name_266) } break; case 237: /* Line 1455 of yacc.c */ #line 1280 "c-grammar.y" { START_PROFILE(name_267) (yyval) = Scm_ApplyRec3(name_147, (yyvsp[(3) - (7)]), (yyvsp[(5) - (7)]), (yyvsp[(7) - (7)])); END_PROFILE(name_267) } break; case 238: /* Line 1455 of yacc.c */ #line 1281 "c-grammar.y" { START_PROFILE(name_268) (yyval) = SCM_FALSE; END_PROFILE(name_268) } break; case 239: /* Line 1455 of yacc.c */ #line 1285 "c-grammar.y" { START_PROFILE(name_270) (yyval) = Scm_ApplyRec2(name_269, (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); END_PROFILE(name_270) } break; case 240: /* Line 1455 of yacc.c */ #line 1286 "c-grammar.y" { START_PROFILE(name_272) (yyval) = Scm_ApplyRec2(name_271, (yyvsp[(5) - (7)]), (yyvsp[(2) - (7)])); END_PROFILE(name_272) } break; case 241: /* Line 1455 of yacc.c */ #line 1287 "c-grammar.y" { START_PROFILE(name_274) (yyval) = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), SCM_MAKE_INT(1), SCM_MAKE_INT(0), (yyvsp[(6) - (6)])); END_PROFILE(name_274) } break; case 242: /* Line 1455 of yacc.c */ #line 1288 "c-grammar.y" { START_PROFILE(name_275) (yyval) = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), SCM_MAKE_INT(1), (yyvsp[(5) - (7)]), (yyvsp[(7) - (7)])); END_PROFILE(name_275) } break; case 243: /* Line 1455 of yacc.c */ #line 1289 "c-grammar.y" { START_PROFILE(name_276) (yyval) = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), (yyvsp[(4) - (7)]), SCM_MAKE_INT(0), (yyvsp[(7) - (7)])); END_PROFILE(name_276) } break; case 244: /* Line 1455 of yacc.c */ #line 1290 "c-grammar.y" { START_PROFILE(name_277) (yyval) = Scm_ApplyRec4(name_273, SCM_MAKE_INT(0), (yyvsp[(4) - (8)]), (yyvsp[(6) - (8)]), (yyvsp[(8) - (8)])); END_PROFILE(name_277) } break; case 245: /* Line 1455 of yacc.c */ #line 1291 "c-grammar.y" { START_PROFILE(name_278) (yyval) = Scm_ApplyRec4(name_273, (yyvsp[(3) - (7)]), SCM_MAKE_INT(1), SCM_MAKE_INT(0), (yyvsp[(7) - (7)])); END_PROFILE(name_278) } break; case 246: /* Line 1455 of yacc.c */ #line 1292 "c-grammar.y" { START_PROFILE(name_279) (yyval) = Scm_ApplyRec4(name_273, (yyvsp[(3) - (8)]), SCM_MAKE_INT(1), (yyvsp[(6) - (8)]), (yyvsp[(8) - (8)])); END_PROFILE(name_279) } break; case 247: /* Line 1455 of yacc.c */ #line 1293 "c-grammar.y" { START_PROFILE(name_280) (yyval) = Scm_ApplyRec4(name_273, (yyvsp[(3) - (8)]), (yyvsp[(5) - (8)]), SCM_MAKE_INT(0), (yyvsp[(8) - (8)])); END_PROFILE(name_280) } break; case 248: /* Line 1455 of yacc.c */ #line 1294 "c-grammar.y" { START_PROFILE(name_281) (yyval) = Scm_ApplyRec4(name_273, (yyvsp[(3) - (9)]), (yyvsp[(5) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)])); END_PROFILE(name_281) } break; case 249: /* Line 1455 of yacc.c */ #line 1298 "c-grammar.y" { START_PROFILE(name_282) (yyval) = SCM_FALSE; END_PROFILE(name_282) } break; case 250: /* Line 1455 of yacc.c */ #line 1299 "c-grammar.y" { START_PROFILE(name_284) (yyval) = Scm_ApplyRec0(name_283); END_PROFILE(name_284) } break; case 251: /* Line 1455 of yacc.c */ #line 1300 "c-grammar.y" { START_PROFILE(name_286) (yyval) = Scm_ApplyRec0(name_285); END_PROFILE(name_286) } break; case 252: /* Line 1455 of yacc.c */ #line 1301 "c-grammar.y" { START_PROFILE(name_288) (yyval) = Scm_ApplyRec1(name_287, SCM_MAKE_INT(0)); END_PROFILE(name_288) } break; case 253: /* Line 1455 of yacc.c */ #line 1302 "c-grammar.y" { START_PROFILE(name_289) (yyval) = Scm_ApplyRec1(name_287, (yyvsp[(2) - (3)])); END_PROFILE(name_289) } break; case 254: /* Line 1455 of yacc.c */ #line 1306 "c-grammar.y" { START_PROFILE(name_290) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_290) } break; case 269: /* Line 1455 of yacc.c */ #line 1342 "c-grammar.y" { START_PROFILE(name_291) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_291) } break; case 270: /* Line 1455 of yacc.c */ #line 1343 "c-grammar.y" { START_PROFILE(name_292) (yyval) = SCM_FALSE; END_PROFILE(name_292) } break; case 294: /* Line 1455 of yacc.c */ #line 1400 "c-grammar.y" { START_PROFILE(name_293) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_293) } break; case 295: /* Line 1455 of yacc.c */ #line 1401 "c-grammar.y" { START_PROFILE(name_294) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_294) } break; case 296: /* Line 1455 of yacc.c */ #line 1405 "c-grammar.y" { START_PROFILE(name_295) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_295) } break; case 297: /* Line 1455 of yacc.c */ #line 1406 "c-grammar.y" { START_PROFILE(name_296) (yyval) = CParser_AddList((yyvsp[(1) - (3)]),(yyvsp[(3) - (3)])); END_PROFILE(name_296) } break; case 298: /* Line 1455 of yacc.c */ #line 1410 "c-grammar.y" { START_PROFILE(name_297) (yyval) = Scm_EmitDefineObjcClass((yyvsp[(2) - (3)])); END_PROFILE(name_297) } break; case 299: /* Line 1455 of yacc.c */ #line 1414 "c-grammar.y" { START_PROFILE(name_298) (yyval) = SCM_FALSE; END_PROFILE(name_298) } break; case 308: /* Line 1455 of yacc.c */ #line 1435 "c-grammar.y" { START_PROFILE(name_299) (yyval) = Scm_EmitDefineObjcClass(CParser_List((yyvsp[(2) - (2)]))); END_PROFILE(name_299) } break; case 338: /* Line 1455 of yacc.c */ #line 1504 "c-grammar.y" { START_PROFILE(name_302) Scm_ApplyRec0(name_174); (yyval) = Scm_ApplyRec2(name_300, name_301, (yyvsp[(2) - (3)])); END_PROFILE(name_302) } break; case 348: /* Line 1455 of yacc.c */ #line 1526 "c-grammar.y" { START_PROFILE(name_304) (yyval) = Scm_ApplyRec2(name_303, (yyvsp[(3) - (5)]), (yyvsp[(5) - (5)])); END_PROFILE(name_304) } break; case 349: /* Line 1455 of yacc.c */ #line 1527 "c-grammar.y" { START_PROFILE(name_306) (yyval) = Scm_ApplyRec2(name_303, Scm_ApplyRec0(name_305), (yyvsp[(1) - (1)])); END_PROFILE(name_306) } break; case 350: /* Line 1455 of yacc.c */ #line 1528 "c-grammar.y" { START_PROFILE(name_307) (yyval) = Scm_ApplyRec2(name_303, (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)])); END_PROFILE(name_307) } break; case 351: /* Line 1455 of yacc.c */ #line 1529 "c-grammar.y" { START_PROFILE(name_308) (yyval) = Scm_ApplyRec2(name_303, Scm_ApplyRec0(name_305), (yyvsp[(1) - (2)])); END_PROFILE(name_308) } break; case 356: /* Line 1455 of yacc.c */ #line 1543 "c-grammar.y" { START_PROFILE(name_309) (yyval) = SCM_FALSE; END_PROFILE(name_309) } break; case 366: /* Line 1455 of yacc.c */ #line 1565 "c-grammar.y" { START_PROFILE(name_311) (yyval) = Scm_ApplyRec1(name_310, (yyvsp[(1) - (1)])); END_PROFILE(name_311) } break; case 367: /* Line 1455 of yacc.c */ #line 1569 "c-grammar.y" { START_PROFILE(name_313) (yyval) = Scm_ApplyRec1(name_312, (yyvsp[(1) - (1)])); END_PROFILE(name_313) } break; case 368: /* Line 1455 of yacc.c */ #line 1570 "c-grammar.y" { START_PROFILE(name_314) (yyval) = Scm_ApplyRec2(name_312, (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); END_PROFILE(name_314) } break; case 369: /* Line 1455 of yacc.c */ #line 1574 "c-grammar.y" { START_PROFILE(name_315) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_315) } break; case 370: /* Line 1455 of yacc.c */ #line 1575 "c-grammar.y" { START_PROFILE(name_316) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_316) } break; case 371: /* Line 1455 of yacc.c */ #line 1576 "c-grammar.y" { START_PROFILE(name_317) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_317) } break; case 389: /* Line 1455 of yacc.c */ #line 1600 "c-grammar.y" { START_PROFILE(name_318) Scm_ApplyRec0(name_174); (yyval) = Scm_ApplyRec2(name_310, (yyvsp[(1) - (7)]), (yyvsp[(5) - (7)])); END_PROFILE(name_318) } break; case 390: /* Line 1455 of yacc.c */ #line 1601 "c-grammar.y" { START_PROFILE(name_319) Scm_ApplyRec0(name_174); (yyval) = Scm_ApplyRec2(name_310, (yyvsp[(1) - (3)]), Scm_ApplyRec0(name_305)); END_PROFILE(name_319) } break; case 391: /* Line 1455 of yacc.c */ #line 1602 "c-grammar.y" { START_PROFILE(name_321) Scm_ApplyRec0(name_174); (yyval) = Scm_ApplyRec2(name_310, name_320, (yyvsp[(4) - (6)])); END_PROFILE(name_321) } break; case 392: /* Line 1455 of yacc.c */ #line 1603 "c-grammar.y" { START_PROFILE(name_322) Scm_ApplyRec0(name_174); (yyval) = Scm_ApplyRec2(name_310, name_320, Scm_ApplyRec0(name_305)); END_PROFILE(name_322) } break; case 393: /* Line 1455 of yacc.c */ #line 1607 "c-grammar.y" { START_PROFILE(name_324) (yyval) = Scm_ApplyRec1(name_323, (yyvsp[(1) - (1)])); END_PROFILE(name_324) } break; case 394: /* Line 1455 of yacc.c */ #line 1608 "c-grammar.y" { START_PROFILE(name_325) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_325) } break; case 395: /* Line 1455 of yacc.c */ #line 1612 "c-grammar.y" { START_PROFILE(name_326) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_326) } break; case 396: /* Line 1455 of yacc.c */ #line 1613 "c-grammar.y" { START_PROFILE(name_327) (yyval) = CParser_Append((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_327) } break; case 397: /* Line 1455 of yacc.c */ #line 1617 "c-grammar.y" { START_PROFILE(name_329) (yyval) = Scm_ApplyRec2(name_328, (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); END_PROFILE(name_329) } break; case 398: /* Line 1455 of yacc.c */ #line 1618 "c-grammar.y" { START_PROFILE(name_331) (yyval) = Scm_ApplyRec1(name_330, (yyvsp[(2) - (2)])); END_PROFILE(name_331) } break; case 399: /* Line 1455 of yacc.c */ #line 1622 "c-grammar.y" { START_PROFILE(name_332) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_332) } break; case 400: /* Line 1455 of yacc.c */ #line 1623 "c-grammar.y" { START_PROFILE(name_333) (yyval) = (yyvsp[(1) - (1)]); END_PROFILE(name_333) } break; case 401: /* Line 1455 of yacc.c */ #line 1627 "c-grammar.y" { START_PROFILE(name_335) (yyval) = Scm_ApplyRec2(name_334, (yyvsp[(2) - (4)]), (yyvsp[(3) - (4)])); END_PROFILE(name_335) } break; case 402: /* Line 1455 of yacc.c */ #line 1631 "c-grammar.y" { START_PROFILE(name_337) (yyval) = Scm_ApplyRec1(name_336, (yyvsp[(1) - (1)])); END_PROFILE(name_337) } break; case 403: /* Line 1455 of yacc.c */ #line 1632 "c-grammar.y" { START_PROFILE(name_341) (yyval) = Scm_ApplyRec2(name_338, Scm_ApplyRec2(name_339, name_336, (yyvsp[(1) - (1)])), name_340); END_PROFILE(name_341) } break; case 404: /* Line 1455 of yacc.c */ #line 1636 "c-grammar.y" { START_PROFILE(name_342) (yyval) = CParser_List((yyvsp[(1) - (1)])); END_PROFILE(name_342) } break; case 405: /* Line 1455 of yacc.c */ #line 1637 "c-grammar.y" { START_PROFILE(name_343) (yyval) = CParser_AddList((yyvsp[(1) - (2)]),(yyvsp[(2) - (2)])); END_PROFILE(name_343) } break; case 406: /* Line 1455 of yacc.c */ #line 1641 "c-grammar.y" { START_PROFILE(name_344) (yyval) = (yyvsp[(1) - (2)]); END_PROFILE(name_344) } break; case 407: /* Line 1455 of yacc.c */ #line 1642 "c-grammar.y" { START_PROFILE(name_346) (yyval) = name_345; END_PROFILE(name_346) } break; case 408: /* Line 1455 of yacc.c */ #line 1646 "c-grammar.y" { START_PROFILE(name_348) (yyval) = Scm_ApplyRec1(name_347, (yyvsp[(3) - (4)])); END_PROFILE(name_348) } break; /* Line 1455 of yacc.c */ #line 5375 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 1657 "c-grammar.y" #ifdef USE_PROFILER static void show_profile_result() { fprintf(stderr, "---\n"); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_39_count, _profile_name_39_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(yylex)", _profile_yylex_count, _profile_yylex_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_250_count, _profile_name_250_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_251_count, _profile_name_251_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%NE $1 $3)", _profile_name_130_count, _profile_name_130_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_131_count, _profile_name_131_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT '(0))", _profile_name_253_count, _profile_name_253_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT $2)", _profile_name_254_count, _profile_name_254_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-AND $1 $3)", _profile_name_133_count, _profile_name_133_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT '(0))", _profile_name_255_count, _profile_name_255_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_134_count, _profile_name_134_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT-WITH-DECLARATION $2 $3)", _profile_name_257_count, _profile_name_257_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-XOR $1 $3)", _profile_name_136_count, _profile_name_136_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_258_count, _profile_name_258_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_137_count, _profile_name_137_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_259_count, _profile_name_259_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BIT-OR $1 $3)", _profile_name_139_count, _profile_name_139_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%STRUCT-OR-UNION-SPECIFIER $1)", _profile_name_41_count, _profile_name_41_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ENUM-SPECIFIER $1)", _profile_name_43_count, _profile_name_43_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_44_count, _profile_name_44_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%TYPENAME $1)", _profile_name_45_count, _profile_name_45_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(id)", _profile_name_47_count, _profile_name_47_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IDENTIFIER $1)", _profile_name_49_count, _profile_name_49_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_260_count, _profile_name_260_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_261_count, _profile_name_261_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_140_count, _profile_name_140_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $2)", _profile_name_262_count, _profile_name_262_time); fprintf(stderr, "%s\t%lld\t%lld\n", "0", _profile_name_263_count, _profile_name_263_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LOG-AND $1 $3)", _profile_name_142_count, _profile_name_142_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_264_count, _profile_name_264_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_143_count, _profile_name_143_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_265_count, _profile_name_265_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $3 $5 0)", _profile_name_266_count, _profile_name_266_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LOG-OR $1 $3)", _profile_name_145_count, _profile_name_145_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $3 $5 $7)", _profile_name_267_count, _profile_name_267_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_146_count, _profile_name_146_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_268_count, _profile_name_268_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (apply emit-objc-method $2))", _profile_name_302_count, _profile_name_302_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%IF $1 $3 $5)", _profile_name_148_count, _profile_name_148_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_149_count, _profile_name_149_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method $3 $5)", _profile_name_304_count, _profile_name_304_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method (var-id) $1)", _profile_name_306_count, _profile_name_306_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method $3 $5)", _profile_name_307_count, _profile_name_307_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-objc-method (var-id) $1)", _profile_name_308_count, _profile_name_308_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_309_count, _profile_name_309_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_50_count, _profile_name_50_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_51_count, _profile_name_51_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%OBJC-STRING $1)", _profile_name_53_count, _profile_name_53_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%EXPR-IN-PARENS $2)", _profile_name_55_count, _profile_name_55_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOUND-STATEMENT $2)", _profile_name_57_count, _profile_name_57_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_58_count, _profile_name_58_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_59_count, _profile_name_59_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MACRO-BODY $2)", _profile_name_2_count, _profile_name_2_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_3_count, _profile_name_3_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_4_count, _profile_name_4_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_5_count, _profile_name_5_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(all-referenced-info-clear!)", _profile_name_6_count, _profile_name_6_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%WHILE $3 $5)", _profile_name_270_count, _profile_name_270_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-inline '(int) $1 $2)", _profile_name_8_count, _profile_name_8_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DO-WHILE $5 $2)", _profile_name_272_count, _profile_name_272_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-inline $1 $2 $3)", _profile_name_9_count, _profile_name_9_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 $3)", _profile_name_151_count, _profile_name_151_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%MUL $1 $3))", _profile_name_152_count, _profile_name_152_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 1 0 $6)", _profile_name_274_count, _profile_name_274_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%DIV $1 $3))", _profile_name_153_count, _profile_name_153_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 1 $5 $7)", _profile_name_275_count, _profile_name_275_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%MOD $1 $3))", _profile_name_154_count, _profile_name_154_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 $4 0 $7)", _profile_name_276_count, _profile_name_276_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%ADD $1 $3))", _profile_name_155_count, _profile_name_155_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR 0 $4 $6 $8)", _profile_name_277_count, _profile_name_277_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SUB $1 $3))", _profile_name_156_count, _profile_name_156_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-keyword $1)", _profile_name_311_count, _profile_name_311_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 1 0 $7)", _profile_name_278_count, _profile_name_278_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SHIFT-LEFT $1 $3))", _profile_name_157_count, _profile_name_157_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 1 $6 $8)", _profile_name_279_count, _profile_name_279_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%SHIFT-RIGHT $1 $3))", _profile_name_158_count, _profile_name_158_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(combine-decl-keyword $1)", _profile_name_313_count, _profile_name_313_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-AND $1 $3))", _profile_name_159_count, _profile_name_159_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(combine-decl-keyword $1 $2)", _profile_name_314_count, _profile_name_314_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_315_count, _profile_name_315_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_316_count, _profile_name_316_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_317_count, _profile_name_317_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $1 $5))", _profile_name_318_count, _profile_name_318_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $1 (var-id)))", _profile_name_319_count, _profile_name_319_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_60_count, _profile_name_60_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_61_count, _profile_name_61_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_62_count, _profile_name_62_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_63_count, _profile_name_63_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%REF-ARRAY $1 $3)", _profile_name_65_count, _profile_name_65_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCALL $1 '())", _profile_name_67_count, _profile_name_67_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCALL $1 $3)", _profile_name_68_count, _profile_name_68_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 $5 0 $8)", _profile_name_280_count, _profile_name_280_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FOR $3 $5 $7 $9)", _profile_name_281_count, _profile_name_281_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-XOR $1 $3))", _profile_name_160_count, _profile_name_160_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_282_count, _profile_name_282_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ASSIGN $1 (%BIT-OR $1 $3))", _profile_name_161_count, _profile_name_161_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_162_count, _profile_name_162_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CONTINUE)", _profile_name_284_count, _profile_name_284_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CONCAT-EXPR $1 $3)", _profile_name_164_count, _profile_name_164_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%BREAK)", _profile_name_286_count, _profile_name_286_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_165_count, _profile_name_165_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword $4))", _profile_name_321_count, _profile_name_321_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%RETURN 0)", _profile_name_288_count, _profile_name_288_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 $2 $4)", _profile_name_167_count, _profile_name_167_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(identifier-declarator $1)", _profile_name_200_count, _profile_name_200_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (decl-keyword (var-id)))", _profile_name_322_count, _profile_name_322_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%RETURN $2)", _profile_name_289_count, _profile_name_289_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 #f $3)", _profile_name_168_count, _profile_name_168_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_201_count, _profile_name_201_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-struct-or-union $1 $2 #f)", _profile_name_169_count, _profile_name_169_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator #f) $1)", _profile_name_202_count, _profile_name_202_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%QUOTE $1)", _profile_name_324_count, _profile_name_324_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator #f) $1)", _profile_name_203_count, _profile_name_203_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_325_count, _profile_name_325_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $3) $1)", _profile_name_204_count, _profile_name_204_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_326_count, _profile_name_326_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $4) $1)", _profile_name_205_count, _profile_name_205_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_327_count, _profile_name_327_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (func-declarator '()))", _profile_name_206_count, _profile_name_206_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 $3)", _profile_name_207_count, _profile_name_207_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%KEYWORD-ARG $1 $3)", _profile_name_329_count, _profile_name_329_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DOT-REF $1 $3)", _profile_name_70_count, _profile_name_70_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_208_count, _profile_name_208_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_209_count, _profile_name_209_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PTR-REF $1 $3)", _profile_name_72_count, _profile_name_72_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%POST-INC $1)", _profile_name_74_count, _profile_name_74_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%POST-DEC $1)", _profile_name_76_count, _profile_name_76_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_77_count, _profile_name_77_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_78_count, _profile_name_78_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_79_count, _profile_name_79_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_290_count, _profile_name_290_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_291_count, _profile_name_291_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'STRUCT", _profile_name_170_count, _profile_name_170_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_292_count, _profile_name_292_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'UNION", _profile_name_171_count, _profile_name_171_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_293_count, _profile_name_293_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_172_count, _profile_name_172_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_294_count, _profile_name_294_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_173_count, _profile_name_173_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_295_count, _profile_name_295_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(c_scan)", _profile_c_scan_count, _profile_c_scan_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_296_count, _profile_name_296_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list $1 $2))", _profile_name_175_count, _profile_name_175_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-objc-class $2)", _profile_name_297_count, _profile_name_297_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list $2 $3))", _profile_name_176_count, _profile_name_176_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%KEYWORD-ARG-WITHOUT-SELECTOR $2)", _profile_name_331_count, _profile_name_331_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_298_count, _profile_name_298_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_210_count, _profile_name_210_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_332_count, _profile_name_332_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(emit-define-objc-class (%LIST $2))", _profile_name_299_count, _profile_name_299_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $2)", _profile_name_211_count, _profile_name_211_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_333_count, _profile_name_333_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list (%LIST $1) (list (identifier-declarator (gensym %unnamed)))))", _profile_name_179_count, _profile_name_179_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $3)", _profile_name_212_count, _profile_name_212_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_213_count, _profile_name_213_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%OBJC-MESSAGE-EXPR $2 $3)", _profile_name_335_count, _profile_name_335_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_214_count, _profile_name_214_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_215_count, _profile_name_215_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(x->string $1)", _profile_name_337_count, _profile_name_337_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_216_count, _profile_name_216_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-declarator $1)", _profile_name_217_count, _profile_name_217_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-vaargs-declarator $1)", _profile_name_218_count, _profile_name_218_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PRE-INC $2)", _profile_name_81_count, _profile_name_81_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_219_count, _profile_name_219_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%PRE-DEC $2)", _profile_name_83_count, _profile_name_83_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%UNARY $1 $2)", _profile_name_85_count, _profile_name_85_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SIZEOF-EXPR $2)", _profile_name_87_count, _profile_name_87_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SIZEOF-TYPE $3)", _profile_name_89_count, _profile_name_89_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(begin (parser-attribute-clear!) (make-type-decl-list (%LIST $2) (list (identifier-declarator (gensym %unnamed)))))", _profile_name_180_count, _profile_name_180_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_181_count, _profile_name_181_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST (compose-variable-attribute $1))", _profile_name_182_count, _profile_name_182_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 (compose-variable-attribute $3))", _profile_name_183_count, _profile_name_183_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_184_count, _profile_name_184_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(bit-field-declarator $2)", _profile_name_185_count, _profile_name_185_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (bit-field-declarator $3) $1)", _profile_name_186_count, _profile_name_186_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(string-join (map x->string $1) :)", _profile_name_341_count, _profile_name_341_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_220_count, _profile_name_220_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_342_count, _profile_name_342_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_100_count, _profile_name_100_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum #f $3)", _profile_name_188_count, _profile_name_188_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(parameter-declaration (make-type-decl $1 (compose-variable-attribute $2)))", _profile_name_221_count, _profile_name_221_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $2)", _profile_name_343_count, _profile_name_343_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum #f $3)", _profile_name_189_count, _profile_name_189_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_222_count, _profile_name_222_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_344_count, _profile_name_344_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MUL $1 $3)", _profile_name_102_count, _profile_name_102_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(make-type-decl $1 (null-declarator))", _profile_name_223_count, _profile_name_223_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(make-type-decl $1 $2)", _profile_name_224_count, _profile_name_224_time); fprintf(stderr, "%s\t%lld\t%lld\n", "", _profile_name_346_count, _profile_name_346_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%DIV $1 $3)", _profile_name_104_count, _profile_name_104_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_225_count, _profile_name_225_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_226_count, _profile_name_226_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SELECTOR $3)", _profile_name_348_count, _profile_name_348_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%MOD $1 $3)", _profile_name_106_count, _profile_name_106_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $2 $1)", _profile_name_227_count, _profile_name_227_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_90_count, _profile_name_90_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_107_count, _profile_name_107_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_228_count, _profile_name_228_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'&", _profile_name_91_count, _profile_name_91_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_229_count, _profile_name_229_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'*", _profile_name_92_count, _profile_name_92_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD $1 $3)", _profile_name_109_count, _profile_name_109_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'+", _profile_name_93_count, _profile_name_93_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'-", _profile_name_94_count, _profile_name_94_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'~", _profile_name_95_count, _profile_name_95_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'!", _profile_name_96_count, _profile_name_96_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_97_count, _profile_name_97_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%FUNCTION-BODY $1)", _profile_name_11_count, _profile_name_11_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%CAST $2 $4)", _profile_name_99_count, _profile_name_99_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_12_count, _profile_name_12_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(external-declaration $1 (list (null-declarator)))", _profile_name_13_count, _profile_name_13_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(external-declaration $1 $2)", _profile_name_14_count, _profile_name_14_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(declaration $1 '())", _profile_name_16_count, _profile_name_16_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(declaration $1 $2)", _profile_name_17_count, _profile_name_17_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_18_count, _profile_name_18_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 $4)", _profile_name_190_count, _profile_name_190_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_19_count, _profile_name_19_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 $4)", _profile_name_191_count, _profile_name_191_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enum $2 '())", _profile_name_192_count, _profile_name_192_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST $1)", _profile_name_193_count, _profile_name_193_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 $3)", _profile_name_194_count, _profile_name_194_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enumerator $1 #f)", _profile_name_196_count, _profile_name_196_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(decl-enumerator $1 $3)", _profile_name_197_count, _profile_name_197_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(ptr-declarator)", _profile_name_230_count, _profile_name_230_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_198_count, _profile_name_198_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(array-declarator $2)", _profile_name_231_count, _profile_name_231_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SUB $1 $3)", _profile_name_111_count, _profile_name_111_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $2 $1)", _profile_name_199_count, _profile_name_199_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(array-declarator $3)", _profile_name_232_count, _profile_name_232_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_112_count, _profile_name_112_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $1)", _profile_name_233_count, _profile_name_233_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (ptr-declarator) $1)", _profile_name_234_count, _profile_name_234_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SHIFT-LEFT $1 $3)", _profile_name_114_count, _profile_name_114_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $3) $1)", _profile_name_235_count, _profile_name_235_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR (array-declarator $4) $1)", _profile_name_236_count, _profile_name_236_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%SHIFT-RIGHT $1 $3)", _profile_name_116_count, _profile_name_116_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(func-declarator '())", _profile_name_237_count, _profile_name_237_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_117_count, _profile_name_117_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$2", _profile_name_238_count, _profile_name_238_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (func-declarator '()))", _profile_name_239_count, _profile_name_239_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LT $1 $3)", _profile_name_119_count, _profile_name_119_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_20_count, _profile_name_20_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%APPEND $1 $2)", _profile_name_21_count, _profile_name_21_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LIST (compose-variable-attribute $1))", _profile_name_22_count, _profile_name_22_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%ADD-LIST $1 (compose-variable-attribute $3))", _profile_name_23_count, _profile_name_23_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 (init-value-declarator $4))", _profile_name_24_count, _profile_name_24_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_25_count, _profile_name_25_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(TYPEDEF)", _profile_name_27_count, _profile_name_27_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_28_count, _profile_name_28_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_29_count, _profile_name_29_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%COMPOSE-DECLARATOR $1 $3)", _profile_name_240_count, _profile_name_240_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_241_count, _profile_name_241_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%GT $1 $3)", _profile_name_121_count, _profile_name_121_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_242_count, _profile_name_242_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_243_count, _profile_name_243_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%LE $1 $3)", _profile_name_123_count, _profile_name_123_time); fprintf(stderr, "%s\t%lld\t%lld\n", "#f", _profile_name_244_count, _profile_name_244_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_245_count, _profile_name_245_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_246_count, _profile_name_246_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%GE $1 $3)", _profile_name_125_count, _profile_name_125_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_247_count, _profile_name_247_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_126_count, _profile_name_126_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_248_count, _profile_name_248_time); fprintf(stderr, "%s\t%lld\t%lld\n", "$1", _profile_name_249_count, _profile_name_249_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%EQ $1 $3)", _profile_name_128_count, _profile_name_128_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_30_count, _profile_name_30_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_31_count, _profile_name_31_time); fprintf(stderr, "%s\t%lld\t%lld\n", "(%TYPENAME $1)", _profile_name_32_count, _profile_name_32_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(SIGNED)", _profile_name_34_count, _profile_name_34_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'(UNSIGNED)", _profile_name_36_count, _profile_name_36_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_37_count, _profile_name_37_time); fprintf(stderr, "%s\t%lld\t%lld\n", "'()", _profile_name_38_count, _profile_name_38_time); } #endif void init_parser() { if (!SCM_UNBOUNDP(token_table)) { /* already initialized */ return; } name_347 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SELECTOR"); name_345 = SCM_MAKE_KEYWORD(""); name_340 = SCM_MAKE_STR_IMMUTABLE(":"); name_339 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "map"); name_338 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "string-join"); name_336 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "x->string"); name_334 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%OBJC-MESSAGE-EXPR"); name_330 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%KEYWORD-ARG-WITHOUT-SELECTOR"); name_328 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%KEYWORD-ARG"); name_323 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%QUOTE"); name_320 = SCM_MAKE_STR_IMMUTABLE(""); name_312 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "combine-decl-keyword"); name_310 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-keyword"); name_305 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "var-id"); name_303 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-objc-method"); name_301 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "emit-objc-method"); name_300 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "apply"); name_287 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%RETURN"); name_285 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BREAK"); name_283 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CONTINUE"); name_273 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FOR"); name_271 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DO-WHILE"); name_269 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%WHILE"); name_256 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%COMPOUND-STATEMENT-WITH-DECLARATION"); name_252 = SCM_LIST1(SCM_MAKE_INT(0)); name_195 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-enumerator"); name_187 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-enum"); name_178 = SCM_MAKE_STR_IMMUTABLE("%unnamed"); name_177 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "gensym"); name_174 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "parser-attribute-clear!"); name_166 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "decl-struct-or-union"); name_163 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CONCAT-EXPR"); name_150 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ASSIGN"); name_147 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%IF"); name_144 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LOG-OR"); name_141 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LOG-AND"); name_138 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-OR"); name_135 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-XOR"); name_132 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%BIT-AND"); name_129 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%NE"); name_127 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%EQ"); name_124 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%GE"); name_122 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LE"); name_120 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%GT"); name_118 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%LT"); name_115 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SHIFT-RIGHT"); name_113 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SHIFT-LEFT"); name_110 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SUB"); name_108 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ADD"); name_105 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MOD"); name_103 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DIV"); name_101 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MUL"); name_98 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%CAST"); name_88 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SIZEOF-TYPE"); name_86 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%SIZEOF-EXPR"); name_84 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%UNARY"); name_82 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PRE-DEC"); name_80 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PRE-INC"); name_75 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%POST-DEC"); name_73 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%POST-INC"); name_71 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%PTR-REF"); name_69 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%DOT-REF"); name_66 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FUNCALL"); name_64 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%REF-ARRAY"); name_56 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%COMPOUND-STATEMENT"); name_54 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%EXPR-IN-PARENS"); name_52 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%OBJC-STRING"); name_48 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%IDENTIFIER"); name_46 = SCM_LIST1(SCM_INTERN("id")); name_42 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%ENUM-SPECIFIER"); name_40 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%STRUCT-OR-UNION-SPECIFIER"); name_35 = SCM_LIST1(SCM_INTERN("UNSIGNED")); name_33 = SCM_LIST1(SCM_INTERN("SIGNED")); name_26 = SCM_LIST1(SCM_INTERN("TYPEDEF")); name_15 = SCM_NIL; name_10 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%FUNCTION-BODY"); name_7 = SCM_LIST1(SCM_INTERN("int")); name_1 = SCM_SYMBOL_VALUE(CPARSER_MODULE_NAME, "%MACRO-BODY"); token_sym_START_MACRO = SCM_INTERN("START_MACRO"); token_sym_OBJC_STRING = SCM_INTERN("OBJC_STRING"); token_sym_AT_REQUIRED = SCM_INTERN("AT_REQUIRED"); token_sym_AT_OPTIONAL = SCM_INTERN("AT_OPTIONAL"); token_sym_AT_DYNAMIC = SCM_INTERN("AT_DYNAMIC"); token_sym_AT_SYNTHESIZE = SCM_INTERN("AT_SYNTHESIZE"); token_sym_AT_PROPERTY = SCM_INTERN("AT_PROPERTY"); token_sym_AT_SYNCHRONIZED = SCM_INTERN("AT_SYNCHRONIZED"); token_sym_AT_FINALLY = SCM_INTERN("AT_FINALLY"); token_sym_AT_CATCH = SCM_INTERN("AT_CATCH"); token_sym_AT_TRY = SCM_INTERN("AT_TRY"); token_sym_AT_THROW = SCM_INTERN("AT_THROW"); token_sym_AT_ALIAS = SCM_INTERN("AT_ALIAS"); token_sym_AT_CLASS = SCM_INTERN("AT_CLASS"); token_sym_AT_PROTOCOL = SCM_INTERN("AT_PROTOCOL"); token_sym_AT_PROTECTED = SCM_INTERN("AT_PROTECTED"); token_sym_AT_PRIVATE = SCM_INTERN("AT_PRIVATE"); token_sym_AT_PUBLIC = SCM_INTERN("AT_PUBLIC"); token_sym_AT_ENCODE = SCM_INTERN("AT_ENCODE"); token_sym_AT_DEFS = SCM_INTERN("AT_DEFS"); token_sym_AT_SELECTOR = SCM_INTERN("AT_SELECTOR"); token_sym_AT_END = SCM_INTERN("AT_END"); token_sym_AT_IMPLEMENTATION = SCM_INTERN("AT_IMPLEMENTATION"); token_sym_AT_INTERFACE = SCM_INTERN("AT_INTERFACE"); token_sym_EXTENSION = SCM_INTERN("EXTENSION"); token_sym_UNKNOWN = SCM_INTERN("UNKNOWN"); token_sym_ASM = SCM_INTERN("ASM"); token_sym_RETURN = SCM_INTERN("RETURN"); token_sym_BREAK = SCM_INTERN("BREAK"); token_sym_CONTINUE = SCM_INTERN("CONTINUE"); token_sym_GOTO = SCM_INTERN("GOTO"); token_sym_FOR = SCM_INTERN("FOR"); token_sym_DO = SCM_INTERN("DO"); token_sym_WHILE = SCM_INTERN("WHILE"); token_sym_SWITCH = SCM_INTERN("SWITCH"); token_sym_ELSE = SCM_INTERN("ELSE"); token_sym_IF = SCM_INTERN("IF"); token_sym_DEFAULT = SCM_INTERN("DEFAULT"); token_sym_CASE = SCM_INTERN("CASE"); token_sym_RANGE = SCM_INTERN("RANGE"); token_sym_ELLIPSIS = SCM_INTERN("ELLIPSIS"); token_sym_ENUM = SCM_INTERN("ENUM"); token_sym_UNION = SCM_INTERN("UNION"); token_sym_STRUCT = SCM_INTERN("STRUCT"); token_sym_VOLATILE = SCM_INTERN("VOLATILE"); token_sym_CONST = SCM_INTERN("CONST"); token_sym_UNSIGNED = SCM_INTERN("UNSIGNED"); token_sym_SIGNED = SCM_INTERN("SIGNED"); token_sym_RESTRICT = SCM_INTERN("RESTRICT"); token_sym_INLINE = SCM_INTERN("INLINE"); token_sym_REGISTER = SCM_INTERN("REGISTER"); token_sym_AUTO = SCM_INTERN("AUTO"); token_sym_STATIC = SCM_INTERN("STATIC"); token_sym_EXTERN = SCM_INTERN("EXTERN"); token_sym_TYPEDEF = SCM_INTERN("TYPEDEF"); token_sym_TYPENAME = SCM_INTERN("TYPENAME"); token_sym_OR_ASSIGN = SCM_INTERN("OR_ASSIGN"); token_sym_XOR_ASSIGN = SCM_INTERN("XOR_ASSIGN"); token_sym_AND_ASSIGN = SCM_INTERN("AND_ASSIGN"); token_sym_RIGHT_ASSIGN = SCM_INTERN("RIGHT_ASSIGN"); token_sym_LEFT_ASSIGN = SCM_INTERN("LEFT_ASSIGN"); token_sym_SUB_ASSIGN = SCM_INTERN("SUB_ASSIGN"); token_sym_ADD_ASSIGN = SCM_INTERN("ADD_ASSIGN"); token_sym_MOD_ASSIGN = SCM_INTERN("MOD_ASSIGN"); token_sym_DIV_ASSIGN = SCM_INTERN("DIV_ASSIGN"); token_sym_MUL_ASSIGN = SCM_INTERN("MUL_ASSIGN"); token_sym_OR_OP = SCM_INTERN("OR_OP"); token_sym_AND_OP = SCM_INTERN("AND_OP"); token_sym_NE_OP = SCM_INTERN("NE_OP"); token_sym_EQ_OP = SCM_INTERN("EQ_OP"); token_sym_GE_OP = SCM_INTERN("GE_OP"); token_sym_LE_OP = SCM_INTERN("LE_OP"); token_sym_RIGHT_OP = SCM_INTERN("RIGHT_OP"); token_sym_LEFT_OP = SCM_INTERN("LEFT_OP"); token_sym_DEC_OP = SCM_INTERN("DEC_OP"); token_sym_INC_OP = SCM_INTERN("INC_OP"); token_sym_PTR_OP = SCM_INTERN("PTR_OP"); token_sym_SIZEOF = SCM_INTERN("SIZEOF"); token_sym_STRING = SCM_INTERN("STRING"); token_sym_CONSTANT = SCM_INTERN("CONSTANT"); token_sym_IDENTIFIER = SCM_INTERN("IDENTIFIER"); token_sym__GT = SCM_INTERN(">"); token_sym__LT = SCM_INTERN("<"); token_sym_P = SCM_INTERN("?"); token_sym__3d = SCM_INTERN("="); token_sym__25 = SCM_INTERN("%"); token_sym__26 = SCM_INTERN("&"); token_sym__5e = SCM_INTERN("^"); token_sym__2f = SCM_INTERN("/"); token_sym__2a = SCM_INTERN("*"); token_sym__ = SCM_INTERN("-"); token_sym__2b = SCM_INTERN("+"); token_sym_X = SCM_INTERN("!"); token_sym__7e = SCM_INTERN("~"); token_sym_COLON = SCM_INTERN("COLON"); token_sym_DOT = SCM_INTERN("DOT"); token_sym_OR = SCM_INTERN("OR"); token_sym_RPAREN = SCM_INTERN("RPAREN"); token_sym_LPAREN = SCM_INTERN("LPAREN"); token_sym_RSBRA = SCM_INTERN("RSBRA"); token_sym_LSBRA = SCM_INTERN("LSBRA"); token_sym_RCBRA = SCM_INTERN("RCBRA"); token_sym_LCBRA = SCM_INTERN("LCBRA"); token_sym_COMMA = SCM_INTERN("COMMA"); token_sym_SEMICOLON = SCM_INTERN("SEMICOLON"); token_table = Scm_MakeHashTableSimple(SCM_HASH_EQ, 105); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_START_MACRO, SCM_MAKE_INT(START_MACRO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OBJC_STRING, SCM_MAKE_INT(OBJC_STRING), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_REQUIRED, SCM_MAKE_INT(AT_REQUIRED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_OPTIONAL, SCM_MAKE_INT(AT_OPTIONAL), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_DYNAMIC, SCM_MAKE_INT(AT_DYNAMIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SYNTHESIZE, SCM_MAKE_INT(AT_SYNTHESIZE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROPERTY, SCM_MAKE_INT(AT_PROPERTY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SYNCHRONIZED, SCM_MAKE_INT(AT_SYNCHRONIZED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_FINALLY, SCM_MAKE_INT(AT_FINALLY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_CATCH, SCM_MAKE_INT(AT_CATCH), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_TRY, SCM_MAKE_INT(AT_TRY), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_THROW, SCM_MAKE_INT(AT_THROW), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_ALIAS, SCM_MAKE_INT(AT_ALIAS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_CLASS, SCM_MAKE_INT(AT_CLASS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROTOCOL, SCM_MAKE_INT(AT_PROTOCOL), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PROTECTED, SCM_MAKE_INT(AT_PROTECTED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PRIVATE, SCM_MAKE_INT(AT_PRIVATE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_PUBLIC, SCM_MAKE_INT(AT_PUBLIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_ENCODE, SCM_MAKE_INT(AT_ENCODE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_DEFS, SCM_MAKE_INT(AT_DEFS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_SELECTOR, SCM_MAKE_INT(AT_SELECTOR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_END, SCM_MAKE_INT(AT_END), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_IMPLEMENTATION, SCM_MAKE_INT(AT_IMPLEMENTATION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AT_INTERFACE, SCM_MAKE_INT(AT_INTERFACE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EXTENSION, SCM_MAKE_INT(EXTENSION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNKNOWN, SCM_MAKE_INT(UNKNOWN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ASM, SCM_MAKE_INT(ASM), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RETURN, SCM_MAKE_INT(RETURN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_BREAK, SCM_MAKE_INT(BREAK), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONTINUE, SCM_MAKE_INT(CONTINUE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_GOTO, SCM_MAKE_INT(GOTO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_FOR, SCM_MAKE_INT(FOR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DO, SCM_MAKE_INT(DO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_WHILE, SCM_MAKE_INT(WHILE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SWITCH, SCM_MAKE_INT(SWITCH), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ELSE, SCM_MAKE_INT(ELSE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_IF, SCM_MAKE_INT(IF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DEFAULT, SCM_MAKE_INT(DEFAULT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CASE, SCM_MAKE_INT(CASE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RANGE, SCM_MAKE_INT(RANGE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ELLIPSIS, SCM_MAKE_INT(ELLIPSIS), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ENUM, SCM_MAKE_INT(ENUM), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNION, SCM_MAKE_INT(UNION), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STRUCT, SCM_MAKE_INT(STRUCT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_VOLATILE, SCM_MAKE_INT(VOLATILE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONST, SCM_MAKE_INT(CONST), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_UNSIGNED, SCM_MAKE_INT(UNSIGNED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SIGNED, SCM_MAKE_INT(SIGNED), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RESTRICT, SCM_MAKE_INT(RESTRICT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_INLINE, SCM_MAKE_INT(INLINE), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_REGISTER, SCM_MAKE_INT(REGISTER), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AUTO, SCM_MAKE_INT(AUTO), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STATIC, SCM_MAKE_INT(STATIC), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EXTERN, SCM_MAKE_INT(EXTERN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_TYPEDEF, SCM_MAKE_INT(TYPEDEF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_TYPENAME, SCM_MAKE_INT(TYPENAME), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR_ASSIGN, SCM_MAKE_INT(OR_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_XOR_ASSIGN, SCM_MAKE_INT(XOR_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AND_ASSIGN, SCM_MAKE_INT(AND_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RIGHT_ASSIGN, SCM_MAKE_INT(RIGHT_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LEFT_ASSIGN, SCM_MAKE_INT(LEFT_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SUB_ASSIGN, SCM_MAKE_INT(SUB_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_ADD_ASSIGN, SCM_MAKE_INT(ADD_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_MOD_ASSIGN, SCM_MAKE_INT(MOD_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DIV_ASSIGN, SCM_MAKE_INT(DIV_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_MUL_ASSIGN, SCM_MAKE_INT(MUL_ASSIGN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR_OP, SCM_MAKE_INT(OR_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_AND_OP, SCM_MAKE_INT(AND_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_NE_OP, SCM_MAKE_INT(NE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_EQ_OP, SCM_MAKE_INT(EQ_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_GE_OP, SCM_MAKE_INT(GE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LE_OP, SCM_MAKE_INT(LE_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RIGHT_OP, SCM_MAKE_INT(RIGHT_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LEFT_OP, SCM_MAKE_INT(LEFT_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DEC_OP, SCM_MAKE_INT(DEC_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_INC_OP, SCM_MAKE_INT(INC_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_PTR_OP, SCM_MAKE_INT(PTR_OP), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SIZEOF, SCM_MAKE_INT(SIZEOF), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_STRING, SCM_MAKE_INT(STRING), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_CONSTANT, SCM_MAKE_INT(CONSTANT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_IDENTIFIER, SCM_MAKE_INT(IDENTIFIER), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__GT, SCM_MAKE_INT(_GT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__LT, SCM_MAKE_INT(_LT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_P, SCM_MAKE_INT(P), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__3d, SCM_MAKE_INT(_3d), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__25, SCM_MAKE_INT(_25), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__26, SCM_MAKE_INT(_26), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__5e, SCM_MAKE_INT(_5e), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2f, SCM_MAKE_INT(_2f), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2a, SCM_MAKE_INT(_2a), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__, SCM_MAKE_INT(_), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__2b, SCM_MAKE_INT(_2b), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_X, SCM_MAKE_INT(X), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym__7e, SCM_MAKE_INT(_7e), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_COLON, SCM_MAKE_INT(COLON), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_DOT, SCM_MAKE_INT(DOT), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_OR, SCM_MAKE_INT(OR), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RPAREN, SCM_MAKE_INT(RPAREN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LPAREN, SCM_MAKE_INT(LPAREN), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RSBRA, SCM_MAKE_INT(RSBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LSBRA, SCM_MAKE_INT(LSBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_RCBRA, SCM_MAKE_INT(RCBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_LCBRA, SCM_MAKE_INT(LCBRA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_COMMA, SCM_MAKE_INT(COMMA), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), token_sym_SEMICOLON, SCM_MAKE_INT(SEMICOLON), 0); Scm_HashTableSet(SCM_HASH_TABLE(token_table), SCM_INTERN("*eoi*"), SCM_MAKE_INT(0), 0); } gauche-c-wrapper-0.6.1.orig/testsuite/0002755000000000000000000000000011237307565014541 5ustar gauche-c-wrapper-0.6.1.orig/testsuite/array_qualifier-test.scm0000644000000000000000000000150311237307543021372 0ustar ;;; ;;; Test array qualifier (C99) ;;; (use gauche.test) (test-start "array_qualifier") (use c-wrapper) (test-module 'c-wrapper) (c-include "./array_qualifier.h") (test "static" (list (ptr )) (lambda () (let ((a (make (c-struct 'foo)))) (slot-ref (class-of (ref a 'f1)) 'arg-types)))) (test "restrict" (list (ptr )) (lambda () (let ((a (make (c-struct 'foo)))) (slot-ref (class-of (ref a 'f2)) 'arg-types)))) (test "const" (list (ptr )) (lambda () (let ((a (make (c-struct 'foo)))) (slot-ref (class-of (ref a 'f3)) 'arg-types)))) (test "volatile" (list (ptr )) (lambda () (let ((a (make (c-struct 'foo)))) (slot-ref (class-of (ref a 'f4)) 'arg-types)))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/array_qualifier.h0000644000000000000000000000021611237307543020062 0ustar struct foo { int (*f1)(int a[static 10]); int (*f2)(int a[restrict]); int (*f3)(int a[const]); int (*f4)(int a[volatile]); }; gauche-c-wrapper-0.6.1.orig/testsuite/attr-test.scm0000644000000000000000000000330211237307543017164 0ustar ;;; ;;; Test parse-attribute ;;; (use gauche.test) (test-start "parse-attribute") (use c-wrapper) (test-module 'c-wrapper.c-lex) (define-macro (test-attribute desc expected source) `(test ,desc ,expected (lambda () (with-module c-wrapper.c-parser (with-parse-context (lambda () (set-input-string! ,source) ((with-module c-wrapper.c-lex parse-attribute)) (parser-attribute))))))) (test-attribute "an attribute without args" '((always_inline)) "((always_inline))") (test-attribute "an attribute is equals to C keyword" '((const)) "((const))") (test-attribute "an attribute with a string arg" '((alias "__f")) "((alias(\"__f\")))") (test-attribute "an attribute with numerical args" '((format printf 2 3)) "((format(printf, 2, 3)))") (test-attribute "attribute list" '((weak) (alias "__f")) "((weak, alias(\"__f\")))") (test-attribute "multiple attributes" '((weak) (alias "__f") (format printf 2 3)) "((weak, alias(\"__f\"))) __attribute__((format(printf, 2, 3)))") (test "check token list" '((UNION LCBRA UNSIGNED (IDENTIFIER . __l) SEMICOLON (TYPENAME . double) (IDENTIFIER . __d) SEMICOLON RCBRA *eoi*) ((__mode__ __DI__))) (lambda () (with-module c-wrapper.c-parser (with-parse-context (lambda () (set-input-string! "union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }") (let ((token-list (do ((lst (list (c-scan)) (cons (c-scan) lst))) ((eq? (car lst) '*eoi*) (reverse lst))))) (list token-list (parser-attribute)))))))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/ctypestest.scm0000644000000000000000000003077511237307543017462 0ustar ;;; ;;; Test ctypes ;;; (use gauche.test) (test-start "c-types") (use c-wrapper) (use gauche.sequence) (use gauche.config) (test-module 'c-wrapper) (define DYLIB (string-append "./ffitest." (gauche-config "--dylib-suffix"))) (c-load-library DYLIB) (define (make-c-struct tagname decl-alist) (eval `(define-c-struct ,tagname) (current-module)) (init-c-struct! (c-struct tagname) decl-alist) (c-struct tagname)) (define (make-c-union tagname decl-alist) (eval `(define-c-union ,tagname) (current-module)) (init-c-union! (c-union tagname) decl-alist) (c-union tagname)) (define-syntax test-cfunc (syntax-rules () ((_ expected func-name c-type v1 v2) (test func-name expected (lambda () (let ((func (make-c-func (string->symbol func-name) c-type (list c-type c-type)))) (func v1 v2))))))) (test-cfunc 3 "add_uchar" 2 1) (test-cfunc 3 "add_ushort" 2 1) (test-cfunc 3 "add_uint" 2 1) (test-cfunc 3 "add_ulong" 2 1) (test-cfunc 3 "add_ulonglong" 2 1) (test-cfunc -1 "add_schar" -2 1) (test-cfunc -1 "add_sshort" -2 1) (test-cfunc -1 "add_sint" -2 1) (test-cfunc -1 "add_slong" -2 1) (test-cfunc -1 "add_slonglong" -2 1) (test-cfunc 2.5 "add_float" 5 -2.5) (test-cfunc 2.5 "add_double" 5 -2.5) (test "add_string" "Hello, world" (lambda () (let ((func (make-c-func 'add_string (ptr ) (list (ptr ) (ptr ))))) (cast (func "Hello, " "world"))))) (define-syntax test-carray (syntax-rules () ((_ expected func-name c-type class v1 v2) (test func-name expected (lambda () (let* ((array-class (c-type (length v1))) (func (make-c-func (string->symbol func-name) (ptr c-type) (list (ptr c-type) (ptr c-type))))) (map (cut cast class <>) (cast array-class (func (length v1) v1 v2))))))))) (test-carray '(5 7 9) "add_array_uchar" '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) "add_array_ushort" '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) "add_array_uint" '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) "add_array_ulong" '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) "add_array_ulonglong" '(1 2 3) '(4 5 6)) (test-carray '(5 -7 9) "add_array_schar" '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) "add_array_sshort" '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) "add_array_sint" '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) "add_array_slong" '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) "add_array_slonglong" '(1 2 3) '(4 -9 6)) (test-carray '(-0.5 0.0 0.5) "add_array_float" '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-carray '(-0.5 0.0 0.5) "add_array_double" '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-carray '("foo1" "bar2" "baz3") "add_array_string" (ptr ) '("foo" "bar" "baz") '("1" "2" "3")) (define-syntax test-cstruct (syntax-rules () ((_ expected func-name c-type class v1 v2) (test func-name expected (lambda () (let* ((struct-class (make-c-struct (gensym) (list (cons 'dummy ) (cons 'value c-type)))) (func (make-c-func (string->symbol func-name) struct-class (list struct-class struct-class))) (s1 (make struct-class)) (s2 (make struct-class))) (set! (ref s1 'value) v1) (set! (ref s2 'value) v2) (cast class (ref (func s1 s2) 'value)))))))) (test-cstruct 3 "add_struct_uchar" 2 1) (test-cstruct 3 "add_struct_ushort" 2 1) (test-cstruct 3 "add_struct_uint" 2 1) (test-cstruct 3 "add_struct_ulong" 2 1) (test-cstruct 3 "add_struct_ulonglong" 2 1) (test-cstruct -1 "add_struct_schar" -2 1) (test-cstruct -1 "add_struct_sshort" -2 1) (test-cstruct -1 "add_struct_sint" -2 1) (test-cstruct -1 "add_struct_slong" -2 1) (test-cstruct -1 "add_struct_slonglong" -2 1) (test-cstruct 1.5 "add_struct_float" 1.75 -0.25) (test-cstruct 1.5 "add_struct_double" 1.75 -0.25) (test-cstruct "Hello, world" "add_struct_string" (ptr ) "Hello, " "world") (define-syntax test-cstruct-array (syntax-rules () ((_ expected func-name c-type class v1 v2) (test func-name expected (lambda () (let* ((array-class (c-type (length v1))) (struct-class (make-c-struct (gensym) (list (cons 'dummy ) (cons 'value array-class)))) (func (make-c-func (string->symbol func-name) struct-class (list struct-class struct-class))) (s1 (make struct-class)) (s2 (make struct-class))) (set! (ref s1 'value) v1) (set! (ref s2 'value) v2) (map (cut cast class <>) (ref (func s1 s2) 'value)))))))) (test-cstruct-array '(5 7 9) "add_struct_array_uchar" '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) "add_struct_array_ushort" '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) "add_struct_array_uint" '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) "add_struct_array_ulong" '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) "add_struct_array_ulonglong" '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 -7 9) "add_struct_array_schar" '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) "add_struct_array_sshort" '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) "add_struct_array_sint" '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) "add_struct_array_slong" '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) "add_struct_array_slonglong" '(1 2 3) '(4 -9 6)) (test-cstruct-array '(-0.5 0.0 0.5) "add_struct_array_float" '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-cstruct-array '(-0.5 0.0 0.5) "add_struct_array_double" '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-cstruct-array '("foo1" "bar2" "baz3") "add_struct_array_string" (ptr ) '("foo" "bar" "baz") '("1" "2" "3")) (define-syntax test-cclosure (syntax-rules () ((_ expected func-name c-type v1 v2) (test func-name expected (lambda () (let* ((fp-class (c-func-ptr c-type (list c-type c-type))) (func (make-c-func (string->symbol func-name) c-type (list fp-class c-type c-type)))) (func + v1 v2))))))) (test-cclosure 3 "callback_uchar" 2 1) (test-cclosure 3 "callback_ushort" 2 1) (test-cclosure 3 "callback_uint" 2 1) (test-cclosure 3 "callback_ulong" 2 1) (test-cclosure 3 "callback_ulonglong" 2 1) (test-cclosure -1 "callback_schar" -2 1) (test-cclosure -1 "callback_sshort" -2 1) (test-cclosure -1 "callback_sint" -2 1) (test-cclosure -1 "callback_slong" -2 1) (test-cclosure -1 "callback_slonglong" -2 1) (test-cclosure 2.5 "callback_float" 5 -2.5) (test-cclosure 2.5 "callback_double" 5 -2.5) (test "callback_string" "Hello, world" (lambda () (let* ((fp-class (c-func-ptr (ptr ) (list (ptr ) (ptr )))) (func (make-c-func 'callback_string (ptr ) (list fp-class (ptr ) (ptr ))))) (cast (func (lambda (a1 a2) (string-append (cast a1) (cast a2))) "Hello, " "world"))))) (define-syntax test-vaarg (syntax-rules () ((_ expected func-name in-c-type out-c-type class) (test (format "~a (~a)" func-name (class-name in-c-type)) expected (lambda () (let* ((array-class (out-c-type (length expected))) (func (make-c-func-vaargs (string->symbol func-name) (ptr out-c-type) (list )))) (map (cut cast class <>) (cast array-class (apply func (length expected) (map (cut cast in-c-type <>) expected)))))))))) (test-vaarg '(1 2 3) "vaarg_uint" ) (test-vaarg '(1 2 3) "vaarg_ulong" ) (test-vaarg '(1 2 3) "vaarg_ulonglong" ) (test-vaarg '(1 -2 3) "vaarg_sint" ) (test-vaarg '(1 -2 3) "vaarg_slong" ) (test-vaarg '(1 -2 3) "vaarg_slonglong" ) (test-vaarg '(-0.5 0.0 0.5) "vaarg_double" ) (test-vaarg '("foo" "bar" "baz") "vaarg_string" (ptr ) (ptr ) ) ;; promote type (test-vaarg '(1 2 3) "vaarg_uint" ) (test-vaarg '(1 2 3) "vaarg_uint" ) (test-vaarg '(1 -2 3) "vaarg_sint" ) (test-vaarg '(1 -2 3) "vaarg_sint" ) (test-vaarg '(-0.5 0.0 0.5) "vaarg_double" ) (define-syntax test-union (syntax-rules () ((_ expected func-name class name v1 v2) (test func-name expected (lambda () (let* ((union-class (make-c-union (gensym) `((c . ,) (s . ,) (i . ,) (l . ,) (ll . ,) (f . ,) (d . ,) (str . ,(ptr ))))) (func (make-c-func (string->symbol func-name) union-class (list union-class union-class))) (u1 (make union-class)) (u2 (make union-class))) (set! (ref u1 name) v1) (set! (ref u2 name) v2) (cast class (ref (func u1 u2) name)))))))) (test-union -10 "test_union_c" 'c -15 5) (test-union -10 "test_union_s" 's -9 -1) (test-union -10 "test_union_i" 'i 20 -30) (test-union -10 "test_union_l" 'l 10000000 -10000010) (test-union -10 "test_union_ll" 'll 0 -10) (test-union -1.75 "test_union_f" 'f -1 -0.75) (test-union 0.5 "test_union_d" 'd 3.75 -3.25) (test-union "foobar" "test_union_str" 'str "foo" "bar") (test "test_modify" 2 (lambda () (let ((test_modify (make-c-func 'test_modify (list (ptr )))) (v (make ))) (set! (ref v) 1) (test_modify (ptr v)) (ref v)))) (test "null-ptr?" #t (lambda () (null-ptr? (make-null-ptr)))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/cwrappertest.scm0000644000000000000000000004246011237307543017770 0ustar ;;; ;;; Test c-wrapper ;;; (use gauche.test) (test-start "c-wrapper") (use c-wrapper) (use gauche.sequence) (test-module 'c-wrapper) (c-load-library "./ffitest") (c-include "./ffitest.h") (define-syntax test-cfunc (syntax-rules () ((_ expected func v1 v2) (test (symbol->string 'func) expected (lambda () (func v1 v2)))))) (test-cfunc 3 add_uchar 2 1) (test-cfunc 3 add_ushort 2 1) (test-cfunc 3 add_uint 2 1) (test-cfunc 3 add_ulong 2 1) (test-cfunc 3 add_ulonglong 2 1) (test-cfunc -1 add_schar -2 1) (test-cfunc -1 add_sshort -2 1) (test-cfunc -1 add_sint -2 1) (test-cfunc -1 add_slong -2 1) (test-cfunc -1 add_slonglong -2 1) (test-cfunc 2.5 add_float 5 -2.5) (test-cfunc 2.5 add_double 5 -2.5) (test "add_string" "Hello, world" (lambda () (x->string (add_string "Hello, " "world")))) (define-syntax test-carray (syntax-rules () ((_ expected func c-type class v1 v2) (test (symbol->string 'func) expected (lambda () (map (cut cast class <>) (cast (c-type (length v1)) (func (length v1) v1 v2)))))))) (test-carray '(5 7 9) add_array_uchar '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) add_array_ushort '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) add_array_uint '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) add_array_ulong '(1 2 3) '(4 5 6)) (test-carray '(5 7 9) add_array_ulonglong '(1 2 3) '(4 5 6)) (test-carray '(5 -7 9) add_array_schar '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) add_array_sshort '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) add_array_sint '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) add_array_slong '(1 2 3) '(4 -9 6)) (test-carray '(5 -7 9) add_array_slonglong '(1 2 3) '(4 -9 6)) (test-carray '(-0.5 0.0 0.5) add_array_float '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-carray '(-0.5 0.0 0.5) add_array_double '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-carray '("foo1" "bar2" "baz3") add_array_string (ptr ) '("foo" "bar" "baz") '("1" "2" "3")) (define-syntax test-cstruct (syntax-rules () ((_ expected func tagname class v1 v2) (test (symbol->string 'func) expected (lambda () (let ((s1 (make tagname)) (s2 (make tagname))) (set! (ref s1 'value) v1) (set! (ref s2 'value) v2) (cast class (ref (func s1 s2) 'value)))))))) (test-cstruct 3 add_struct_uchar (c-struct 'test_uchar) 2 1) (test-cstruct 3 add_struct_ushort (c-struct 'test_ushort) 2 1) (test-cstruct 3 add_struct_uint (c-struct 'test_uint) 2 1) (test-cstruct 3 add_struct_ulong (c-struct 'test_ulong) 2 1) (test-cstruct 3 add_struct_ulonglong (c-struct 'test_ulonglong) 2 1) (test-cstruct -1 add_struct_schar (c-struct 'test_schar) -2 1) (test-cstruct -1 add_struct_sshort (c-struct 'test_sshort) -2 1) (test-cstruct -1 add_struct_sint (c-struct 'test_sint) -2 1) (test-cstruct -1 add_struct_slong (c-struct 'test_slong) -2 1) (test-cstruct -1 add_struct_slonglong (c-struct 'test_slonglong) -2 1) (test-cstruct 1.5 add_struct_float (c-struct 'test_float) 1.75 -0.25) (test-cstruct 1.5 add_struct_double (c-struct 'test_double) 1.75 -0.25) (test-cstruct "Hello, world" add_struct_string (c-struct 'test_string) "Hello, " "world") (define-syntax test-cstruct-array (syntax-rules () ((_ expected func tagname class v1 v2) (test (symbol->string 'func) expected (lambda () (let* ((s1 (make tagname)) (s2 (make tagname))) (set! (ref s1 'value) v1) (set! (ref s2 'value) v2) (map (cut cast class <>) (ref (func s1 s2) 'value)))))))) (test-cstruct-array '(5 7 9) add_struct_array_ushort (c-struct 'test_array_ushort) '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) add_struct_array_uint (c-struct 'test_array_uint) '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) add_struct_array_ulong (c-struct 'test_array_ulong) '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 7 9) add_struct_array_ulonglong (c-struct 'test_array_ulonglong) '(1 2 3) '(4 5 6)) (test-cstruct-array '(5 -7 9) add_struct_array_schar (c-struct 'test_array_schar) '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) add_struct_array_sshort (c-struct 'test_array_sshort) '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) add_struct_array_sint (c-struct 'test_array_sint) '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) add_struct_array_slong (c-struct 'test_array_slong) '(1 2 3) '(4 -9 6)) (test-cstruct-array '(5 -7 9) add_struct_array_slonglong (c-struct 'test_array_slonglong) '(1 2 3) '(4 -9 6)) (test-cstruct-array '(-0.5 0.0 0.5) add_struct_array_float (c-struct 'test_array_float) '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-cstruct-array '(-0.5 0.0 0.5) add_struct_array_double (c-struct 'test_array_double) '(-1 1.5 1.75) '(0.5 -1.5 -1.25)) (test-cstruct-array '("foo1" "bar2" "baz3") add_struct_array_string (c-struct 'test_array_string) '("foo" "bar" "baz") '("1" "2" "3")) (define-syntax test-cclosure (syntax-rules () ((_ expected func v1 v2) (test (symbol->string 'func) expected (lambda () (func + v1 v2)))))) (test-cclosure 3 callback_uchar 2 1) (test-cclosure 3 callback_ushort 2 1) (test-cclosure 3 callback_uint 2 1) (test-cclosure 3 callback_ulong 2 1) (test-cclosure 3 callback_ulonglong 2 1) (test-cclosure -1 callback_schar -2 1) (test-cclosure -1 callback_sshort -2 1) (test-cclosure -1 callback_sint -2 1) (test-cclosure -1 callback_slong -2 1) (test-cclosure -1 callback_slonglong -2 1) (test-cclosure 2.5 callback_float 5 -2.5) (test-cclosure 2.5 callback_double 5 -2.5) (test "callback_string" "Hello, world" (lambda () (x->string (callback_string (lambda (a1 a2) (string-append (x->string a1) (x->string a2))) "Hello, " "world")))) (define-syntax test-vaarg (syntax-rules () ((_ expected func in-c-type out-c-type class) (test (symbol->string 'func) expected (lambda () (let* ((array-class (out-c-type (length expected)))) (map (cut cast class <>) (cast array-class (apply func (length expected) (map (cut cast in-c-type <>) expected)))))))))) (test-vaarg '(1 2 3) vaarg_uint ) (test-vaarg '(1 2 3) vaarg_ulong ) (test-vaarg '(1 2 3) vaarg_ulonglong ) (test-vaarg '(1 -2 3) vaarg_sint ) (test-vaarg '(1 -2 3) vaarg_slong ) (test-vaarg '(1 -2 3) vaarg_slonglong ) (test-vaarg '(-0.5 0.0 0.5) vaarg_double ) (test-vaarg '("foo" "bar" "baz") vaarg_string (ptr ) (ptr ) ) (define-syntax test-union (syntax-rules () ((_ expected func class name v1 v2) (test (symbol->string 'func) expected (lambda () (let ((u1 (make (c-union 'test))) (u2 (make (c-union 'test)))) (set! (ref u1 name) v1) (set! (ref u2 name) v2) (cast class (ref (func u1 u2) name)))))))) (test-union -10 test_union_c 'c -15 5) (test-union -10 test_union_s 's -9 -1) (test-union -10 test_union_i 'i 20 -30) (test-union -10 test_union_l 'l 10000000 -10000010) (test-union -10 test_union_ll 'll 0 -10) (test-union -1.75 test_union_f 'f -1 -0.75) (test-union 0.5 test_union_d 'd 3.75 -3.25) (test-union "foobar" test_union_str 'str "foo" "bar") (test "test_var" '(-1 -2 -3 -4 -5 5 4 3 2 1 -0.5 0.5 "foobar") (lambda () (set! (ref var_char) -2) (set! (ref var_short) -3) (set! (ref var_int) -4) (set! (ref var_long) -5) (set! (ref var_longlong) -6) (set! (ref var_uchar) 4) (set! (ref var_ushort) 3) (set! (ref var_uint) 2) (set! (ref var_ulong) 1) (set! (ref var_ulonglong) 0) (set! (ref var_float) -1.75) (set! (ref var_double) -0.75) (set! (ref var_string) "foo") (test_var) (list (ref var_char) (ref var_short) (ref var_int) (ref var_long) (ref var_longlong) (ref var_uchar) (ref var_ushort) (ref var_uint) (ref var_ulong) (ref var_ulonglong) (ref var_float) (ref var_double) (x->string var_string)))) (test "incomplete_array(ref)" '(1 -2 123) (lambda () (list (ref incomplete_array 0) (ref incomplete_array 1) (ref incomplete_array 2)))) (test "incomplete_array(set!)" '(5 -2 -321) (lambda () (set! (ref incomplete_array 0) 5) (set! (ref incomplete_array 2) -321) (list (ref incomplete_array 0) (ref incomplete_array 1) (ref incomplete_array 2)))) (test "test_null_ptr (make-null-ptr)" #t (lambda () (not (= 0 (test_null_ptr (make-null-ptr)))))) (test "test_null_ptr (0)" #t (lambda () (not (= 0 (test_null_ptr 0))))) (test "test_null_func_ptr (make-null-ptr)" #t (lambda () (not (= 0 (test_null_func_ptr (make-null-ptr)))))) (test "test_null_func_ptr (0)" #t (lambda () (not (= 0 (test_null_func_ptr 0))))) (test "test post++" '(3 4) (lambda () (c-value-set! test_val 3) (let ((x (post_pp test_val))) (list x (test_val))))) (test "test post--" '(3 2) (lambda () (c-value-set! test_val 3) (let ((x (post_mm test_val))) (list x (test_val))))) (test "test pre++" '(4 4) (lambda () (c-value-set! test_val 3) (let ((x (pre_pp test_val))) (list x (test_val))))) (test "test pre--" '(2 2) (lambda () (c-value-set! test_val 3) (let ((x (pre_mm test_val))) (list x (test_val))))) (test "test post++ (pointer)" '(-2 -1) (lambda () (init_test_ptr) (let ((x (post_pp test_ptr))) (list ((deref x)) ((deref test_ptr)))))) (test "test post-- (pointer)" '(-1 -2) (lambda () (init_test_ptr) (post++ test_ptr) (let ((x (post_mm test_ptr))) (list ((deref x)) ((deref test_ptr)))))) (test "test pre++ (pointer)" '(-1 -1) (lambda () (init_test_ptr) (let ((x (pre_pp test_ptr))) (list ((deref x)) ((deref test_ptr)))))) (test "test pre-- (pointer)" '(-2 -2) (lambda () (init_test_ptr) (pre++ test_ptr) (let ((x (pre_mm test_ptr))) (list ((deref x)) ((deref test_ptr)))))) (test "test plus (value)" 5 (lambda () (plus 2 3))) (test "test minus (value)" 3 (lambda () (let ((v1 (make )) (v2 (make ))) (v1 5) (v2 2) (minus v1 v2)))) (test "test plus (pointer)" 1 (lambda () (init_test_ptr) ((deref (plus test_ptr 3))))) (test "test minus (pointer)" -1 (lambda () (init_test_ptr) ((deref (minus (plus test_ptr 3) 2))))) (test "test bitfield" '(-2 2 2 -30001 3) (lambda () (let ((dat (make (c-struct 'bitfield_rec)))) (c-struct-set! dat 'v1 -1) (c-struct-set! dat 'v2 1) (c-struct-set! dat 'v3 1) (c-struct-set! dat 'v4 -30000) (c-struct-set! dat 'v5 2) (let ((newdat (test_bitfield dat))) (list (c-struct-ref newdat 'v1) (c-struct-ref newdat 'v2) (c-struct-ref newdat 'v3) (c-struct-ref newdat 'v4) (c-struct-ref newdat 'v5)))))) (test "test sizeof struct which has bitfields" (expected_sizeof_bitfield_rec2) (lambda () (c-sizeof (c-struct 'bitfield_rec2)))) (test "test bitfield2" '(8191 2) (lambda () (let ((dat (make (c-struct 'bitfield_rec2)))) (c-struct-set! dat 'v1 8190) (c-struct-set! dat 'v2 1) (let ((newdat (test_bitfield2 dat))) (list (c-struct-ref newdat 'v1) (c-struct-ref newdat 'v2)))))) (test "test macro function #1" '(1 0) (lambda () (let ((v1 (make )) (v2 (make ))) (v1 0) (v2 0) (IFMAC 1 (post++ v1) (post++ v2)) (list (v1) (v2))))) (test "test macro function #2" '(0 1) (lambda () (let ((v1 (make )) (v2 (make ))) (v1 0) (v2 0) (IFMAC 0 (post++ v1) (post++ v2)) (list (v1) (v2))))) (test "ignore function-like macro when an argument is used as a type." #f (lambda () (global-variable-bound? (current-module) 'FUNCLIKE_MACRO_USING_TYPE_PARAM))) (test "test function parameter" "foobar" (lambda () (x->string (param_func_test malloc)))) (test "test dereference of a function pointer" 3 (lambda () ((deref (get_fptr)) 1 2))) (test "object-apply of a function pointer" 3 (lambda () ((get_fptr) 1 2))) (test "test (setter ref) for a pointer" 3 (lambda () (let* ((v1 (make (c-array 10))) (v2 (cast (ptr ) v1))) (set! (ref v2 5) 3) (ref v1 5)))) (test "test variable attribute 'mode' QI" (lambda () (class-of test_qi))) (test "test variable attribute 'mode' HI" (lambda () (class-of test_hi))) (test "test variable attribute 'mode' SI" (lambda () (class-of test_si))) (test "test variable attribute 'mode' DI" (lambda () (class-of test_di))) (test "test variable attribute 'mode' QI (unsigned)" (lambda () (class-of test_uqi))) (test "test variable attribute 'mode' HI (unsigned)" (lambda () (class-of test_uhi))) (test "test variable attribute 'mode' SI (unsigned)" (lambda () (class-of test_usi))) (test "test variable attribute 'mode' DI (unsigned)" (lambda () (class-of test_udi))) (test "test variable attribute 'mode' SF" (lambda () (class-of test_sf))) (test "test variable attribute 'mode' DF" (lambda () (class-of test_df))) (test "test variable attribute 'mode' for struct" (list ) (lambda () (let ((s (make (c-struct 'test_attr_mode_rec)))) (map (lambda (name) (class-of (raw-ref s name))) '(test_qi test_hi test_si test_di test_uqi test_uhi test_usi test_udi test_sf test_df))))) (test "test variable attribute 'mode' for function argument" '(127 ; 2^7 - 1 32767 ; 2^15 - 1 2147483647 ; 2^31 - 1 9223372036854775807 ; 2^63 - 1 255 ; 2^8 - 1 65535 ; 2^16 - 1 4294967295 ; 2^32 - 1 18446744073709551615 ; 2^64 - 1 0.5 1.0e300 ) (lambda () (test_attr_mode 127 32767 2147483647 9223372036854775807 255 65535 4294967295 18446744073709551615 0.5 1.0e300) (map scm-cast (list test_qi test_hi test_si test_di test_uqi test_uhi test_usi test_udi test_sf test_df)))) (test "test variable-like macro" '(1 2 3) (lambda () (reset_counter) (do ((lst '() (cons (COUNTER) lst)) (i 0 (+ i 1))) ((<= 3 i) (reverse lst))))) (test "test suppress using function-like macro" 3 (lambda () (confusing_func2 1 2))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/ffitest.c0000644000000000000000000004172611237307543016355 0ustar /** * ffitest.c * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: $ */ #include "ffitest.h" char var_char; short var_short; int var_int; long var_long; long long var_longlong; unsigned char var_uchar; unsigned short var_ushort; unsigned int var_uint; unsigned long var_ulong; unsigned long long var_ulonglong; float var_float; double var_double; char *var_string; int incomplete_array[3] = {1, -2, 123}; int test_qi __attribute__((__mode__(__QI__))); int test_hi __attribute__((__mode__(__HI__))); int test_si __attribute__((__mode__(__SI__))); int test_di __attribute__((__mode__(__DI__))); unsigned int test_uqi __attribute__((__mode__(__QI__))) , test_uhi __attribute__((__mode__(__HI__))) , test_usi __attribute__((__mode__(__SI__))) , test_udi __attribute__((__mode__(__DI__))); float test_sf __attribute__((__mode__(__SF__))); float test_df __attribute__((__mode__(__DF__))); void test_attr_mode(int qi __attribute__((__mode__(__QI__))), int hi __attribute__((__mode__(__HI__))), int si __attribute__((__mode__(__SI__))), int di __attribute__((__mode__(__DI__))), unsigned int uqi __attribute__((__mode__(__QI__))), unsigned int uhi __attribute__((__mode__(__HI__))), unsigned int usi __attribute__((__mode__(__SI__))), unsigned int udi __attribute__((__mode__(__DI__))), float sf __attribute__((__mode__(__SF__))), float df __attribute__((__mode__(__DF__)))) { test_qi = qi; test_hi = hi; test_si = si; test_di = di; test_uqi = uqi; test_uhi = uhi; test_usi = usi; test_udi = udi; test_sf = sf; test_df = df; } unsigned char add_uchar(unsigned char v1, unsigned char v2) { return v1 + v2; } signed char add_schar(signed char v1, signed char v2) { return v1 + v2; } unsigned short add_ushort(unsigned short v1, unsigned short v2) { return v1 + v2; } signed short add_sshort(signed short v1, signed short v2) { return v1 + v2; } unsigned int add_uint(unsigned int v1, unsigned int v2) { return v1 + v2; } signed int add_sint(signed int v1, signed int v2) { return v1 + v2; } unsigned long add_ulong(unsigned long v1, unsigned long v2) { return v1 + v2; } signed long add_slong(signed long v1, signed long v2) { return v1 + v2; } unsigned long long add_ulonglong(unsigned long long v1, unsigned long long v2) { return v1 + v2; } signed long long add_slonglong(signed long long v1, signed long long v2) { return v1 + v2; } float add_float(float v1, float v2) { return v1 + v2; } double add_double(double v1, double v2) { return v1 + v2; } const char *add_string(const char *v1, const char *v2) { /* memory leaks */ char *result = (char*) malloc(strlen(v1) + strlen(v2) + 1); strcpy(result, v1); strcat(result, v2); return result; } unsigned char *add_array_uchar(int size, unsigned char v1[], unsigned char v2[]) { /* memory leaks */ unsigned char *result = (unsigned char*) malloc(size * sizeof(unsigned char)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } signed char *add_array_schar(int size, signed char v1[], signed char v2[]) { /* memory leaks */ signed char *result = (signed char*) malloc(size * sizeof(signed char)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } unsigned short *add_array_ushort(int size, unsigned short v1[], unsigned short v2[]) { /* memory leaks */ unsigned short *result = (unsigned short*) malloc(size * sizeof(unsigned short)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } signed short *add_array_sshort(int size, signed short v1[], signed short v2[]) { /* memory leaks */ signed short *result = (signed short*) malloc(size * sizeof(signed short)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } unsigned int *add_array_uint(int size, unsigned int v1[], unsigned int v2[]) { /* memory leaks */ unsigned int *result = (unsigned int*) malloc(size * sizeof(unsigned int)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } signed int *add_array_sint(int size, signed int v1[], signed int v2[]) { /* memory leaks */ signed int *result = (signed int*) malloc(size * sizeof(signed int)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } unsigned long *add_array_ulong(int size, unsigned long v1[], unsigned long v2[]) { /* memory leaks */ unsigned long *result = (unsigned long*) malloc(size * sizeof(unsigned long)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } signed long *add_array_slong(int size, signed long v1[], signed long v2[]) { /* memory leaks */ signed long *result = (signed long*) malloc(size * sizeof(signed long)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } unsigned long long *add_array_ulonglong(int size, unsigned long long v1[], unsigned long long v2[]) { /* memory leaks */ unsigned long long *result = (unsigned long long*) malloc(size * sizeof(unsigned long long)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } signed long long *add_array_slonglong(int size, signed long long v1[], signed long long v2[]) { /* memory leaks */ signed long long *result = (signed long long*) malloc(size * sizeof(signed long long)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } float *add_array_float(int size, float v1[], float v2[]) { /* memory leaks */ float *result = (float*) malloc(size * sizeof(float)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } double *add_array_double(int size, double v1[], double v2[]) { /* memory leaks */ double *result = (double*) malloc(size * sizeof(double)); int i; for (i = 0; i < size; ++i) { result[i] = v1[i] + v2[i]; } return result; } char **add_array_string(int size, const char *v1[], const char *v2[]) { /* memory leaks */ char **result = (char**) malloc(size * sizeof(const char*)); int i; for (i = 0; i < size; ++i) { result[i] = (char*) malloc(strlen(v1[i]) + strlen(v2[i]) + 1); strcpy(result[i], v1[i]); strcat(result[i], v2[i]); } return result; } unsigned char callback_uchar(unsigned char (*fn)(unsigned char, unsigned char), unsigned char v1, unsigned char v2) { return fn(v1, v2); } signed char callback_schar(signed char (*fn)(signed char, signed char), signed char v1, signed char v2) { return fn(v1, v2); } unsigned short callback_ushort(unsigned short (*fn)(unsigned short, unsigned short), unsigned short v1, unsigned short v2) { return fn(v1, v2); } signed short callback_sshort(signed short (*fn)(signed short, signed short), signed short v1, signed short v2) { return fn(v1, v2); } unsigned int callback_uint(unsigned int (*fn)(unsigned int, unsigned int), unsigned int v1, unsigned int v2) { return fn(v1, v2); } signed int callback_sint(signed int (*fn)(signed int, signed int), signed int v1, signed int v2) { return fn(v1, v2); } unsigned long callback_ulong(unsigned long (*fn)(unsigned long, unsigned long), unsigned long v1, unsigned long v2) { return fn(v1, v2); } signed long callback_slong(signed long (*fn)(signed long, signed long), signed long v1, signed long v2) { return fn(v1, v2); } unsigned long long callback_ulonglong(unsigned long long (*fn)(unsigned long long, unsigned long long), unsigned long long v1, unsigned long long v2) { return fn(v1, v2); } signed long long callback_slonglong(signed long long (*fn)(signed long long, signed long long), signed long long v1, signed long long v2) { return fn(v1, v2); } float callback_float(float (*fn)(float, float), float v1, float v2) { return fn(v1, v2); } double callback_double(double (*fn)(double, double), double v1, double v2) { return fn(v1, v2); } const char *callback_string(const char *(*fn)(const char *, const char*), const char *v1, const char *v2) { return fn(v1, v2); } #define DEFINE_FUNC_VAARG(type, ctype) \ ctype *vaarg_##type(int nargs, ...) \ { \ va_list argp; \ ctype *result = (ctype*) malloc(sizeof(ctype) * nargs); \ int i; \ va_start(argp, nargs); \ for (i = 0; i < nargs; ++i) { \ result[i] = va_arg(argp, ctype); \ } \ va_end(argp); \ return result;\ } DEFINE_FUNC_VAARG(uint, unsigned int) DEFINE_FUNC_VAARG(ulong, unsigned long) DEFINE_FUNC_VAARG(ulonglong, unsigned long long) DEFINE_FUNC_VAARG(sint, signed int) DEFINE_FUNC_VAARG(slong, signed long) DEFINE_FUNC_VAARG(slonglong, signed long long) DEFINE_FUNC_VAARG(double, double) DEFINE_FUNC_VAARG(string, char*) struct test_uchar add_struct_uchar(struct test_uchar v1, struct test_uchar v2) { struct test_uchar result = {0, 1}; result.value = v1.value + v2.value; return result; } struct test_ushort add_struct_ushort(struct test_ushort v1, struct test_ushort v2) { struct test_ushort result; result.value = v1.value + v2.value; return result; } struct test_uint add_struct_uint(struct test_uint v1, struct test_uint v2) { struct test_uint result; result.value = v1.value + v2.value; return result; } struct test_ulong add_struct_ulong(struct test_ulong v1, struct test_ulong v2) { struct test_ulong result; result.value = v1.value + v2.value; return result; } struct test_ulonglong add_struct_ulonglong(struct test_ulonglong v1, struct test_ulonglong v2) { struct test_ulonglong result; result.value = v1.value + v2.value; return result; } struct test_schar add_struct_schar(struct test_schar v1, struct test_schar v2) { struct test_schar result; result.value = v1.value + v2.value; return result; } struct test_sshort add_struct_sshort(struct test_sshort v1, struct test_sshort v2) { struct test_sshort result; result.value = v1.value + v2.value; return result; } struct test_sint add_struct_sint(struct test_sint v1, struct test_sint v2) { struct test_sint result; result.value = v1.value + v2.value; return result; } struct test_slong add_struct_slong(struct test_slong v1, struct test_slong v2) { struct test_slong result; result.value = v1.value + v2.value; return result; } struct test_slonglong add_struct_slonglong(struct test_slonglong v1, struct test_slonglong v2) { struct test_slonglong result; result.value = v1.value + v2.value; return result; } struct test_float add_struct_float(struct test_float v1, struct test_float v2) { struct test_float result; result.value = v1.value + v2.value; return result; } struct test_double add_struct_double(struct test_double v1, struct test_double v2) { struct test_double result; result.value = v1.value + v2.value; return result; } struct test_string add_struct_string(struct test_string v1, struct test_string v2) { struct test_string result; /* memoery leaks */ result.value = (char*) malloc(strlen(v1.value) + strlen(v2.value) + 1); strcpy(result.value, v1.value); strcat(result.value, v2.value); return result; } #define DEFINE_FUNC_TEST_STRUCT_ARRAY(type, ctype) \ struct test_array_##type add_struct_array_##type(struct test_array_##type v1, \ struct test_array_##type v2) \ { \ struct test_array_##type result; \ int i; \ for (i = 0; i < sizeof(result.value) / sizeof(ctype); ++i) { \ result.value[i] = v1.value[i] + v2.value[i]; \ } \ return result; \ } DEFINE_FUNC_TEST_STRUCT_ARRAY(uchar, unsigned char) DEFINE_FUNC_TEST_STRUCT_ARRAY(ushort, unsigned short) DEFINE_FUNC_TEST_STRUCT_ARRAY(uint, unsigned int) DEFINE_FUNC_TEST_STRUCT_ARRAY(ulong, unsigned long) DEFINE_FUNC_TEST_STRUCT_ARRAY(ulonglong, unsigned long long) DEFINE_FUNC_TEST_STRUCT_ARRAY(schar, signed char) DEFINE_FUNC_TEST_STRUCT_ARRAY(sshort, signed short) DEFINE_FUNC_TEST_STRUCT_ARRAY(sint, signed int) DEFINE_FUNC_TEST_STRUCT_ARRAY(slong, signed long) DEFINE_FUNC_TEST_STRUCT_ARRAY(slonglong, signed long long) DEFINE_FUNC_TEST_STRUCT_ARRAY(float, float) DEFINE_FUNC_TEST_STRUCT_ARRAY(double, double) struct test_array_string add_struct_array_string(struct test_array_string v1, struct test_array_string v2) { struct test_array_string result; int i; for (i = 0; i < sizeof(result.value) / sizeof(char*); ++i) { /* memoery leaks */ result.value[i] = (char*) malloc(strlen(v1.value[i]) + strlen(v2.value[i]) + 1); strcpy(result.value[i], v1.value[i]); strcat(result.value[i], v2.value[i]); } return result; } #define DEFINE_FUNC_TEST_UNION(ctype, name) \ union test test_union_##name(union test v1, union test v2) \ { \ union test result; \ result.name = v1.name + v2.name; \ return result; \ } DEFINE_FUNC_TEST_UNION(signed char, c) DEFINE_FUNC_TEST_UNION(signed short, s) DEFINE_FUNC_TEST_UNION(signed int, i) DEFINE_FUNC_TEST_UNION(signed long, l) DEFINE_FUNC_TEST_UNION(signed long long, ll) DEFINE_FUNC_TEST_UNION(float, f) DEFINE_FUNC_TEST_UNION(double, d) union test test_union_str(union test v1, union test v2) { union test result; /* memoery leaks */ result.str = (char*) malloc(strlen(v1.str) + strlen(v2.str) + 1); strcpy(result.str, v1.str); strcat(result.str, v2.str); return result; } void test_modify(int *v) { *v += 1; } void test_var() { var_char += 1; var_short += 1; var_int += 1; var_long += 1; var_longlong += 1; var_uchar += 1; var_ushort += 1; var_uint += 1; var_ulong += 1; var_ulonglong += 1; var_float += 1.25; var_double += 1.25; strcat(var_string, "bar"); } int test_null_ptr(void *ptr1) { return ptr1 == NULL; } int test_null_func_ptr(int (*fn)(void *ptr)) { return fn == NULL; } int *test_ptr; int test_array[5]; void init_test_ptr() { test_array[0] = -2; test_array[1] = -1; test_array[2] = 0; test_array[3] = 1; test_array[4] = 2; test_ptr = &test_array[0]; } int test_val; struct bitfield_rec test_bitfield(struct bitfield_rec dat) { dat.v1 -= 1; dat.v2 += 1; dat.v3 += 1; dat.v4 -= 1; dat.v5 += 1; return dat; } int expected_sizeof_bitfield_rec2() { return sizeof(struct bitfield_rec2); } struct bitfield_rec2 test_bitfield2(struct bitfield_rec2 dat) { dat.v1 += 1; dat.v2 += 1; return dat; } char *param_func_test(void *allocator(size_t)) { char *str = (char*) allocator(7); strncpy(str, "foobar", 7); return str; } sint_adder get_fptr() { return add_sint; } static int count_num = 0; int counter() { return ++count_num; } void reset_counter() { count_num = 0; } #undef confusing_func1 int confusing_func1(int a, int b) { return a + b; } gauche-c-wrapper-0.6.1.orig/testsuite/ffitest.h0000644000000000000000000004752611237307543016366 0ustar /** * ffitest.h * * Copyright (c) 2006 KOGURO, Naoki (naoki@koguro.net) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the * Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * $Id: $ */ #include #include #include #include #include extern char var_char; extern short var_short; extern int var_int; extern long var_long; extern long long var_longlong; extern unsigned char var_uchar; extern unsigned short var_ushort; extern unsigned int var_uint; extern unsigned long var_ulong; extern unsigned long long var_ulonglong; extern float var_float; extern double var_double; extern char *var_string; extern void test_var(void); struct test_uchar { char dummy; unsigned char value; }; struct test_ushort { char dummy; unsigned short value; }; struct test_uint { char dummy; unsigned int value; }; struct test_ulong { char dummy; unsigned long value; }; struct test_ulonglong { char dummy; unsigned long long value; }; struct test_schar { char dummy; signed char value; }; struct test_sshort { char dummy; signed short value; }; struct test_sint { char dummy; signed int value; }; struct test_slong { char dummy; signed long value; }; struct test_slonglong { char dummy; signed long long value; }; struct test_float { char dummy; float value; }; struct test_double { char dummy; double value; }; struct test_string { char dummy; char *value; }; #define DEFINE_TEST_STRUCT_ARRAY(type, ctype) \ struct test_array_##type { \ char dummy; \ ctype value[3]; \ }; DEFINE_TEST_STRUCT_ARRAY(uchar, unsigned char) DEFINE_TEST_STRUCT_ARRAY(ushort, unsigned short) DEFINE_TEST_STRUCT_ARRAY(uint, unsigned int) DEFINE_TEST_STRUCT_ARRAY(ulong, unsigned long) DEFINE_TEST_STRUCT_ARRAY(ulonglong, unsigned long long) DEFINE_TEST_STRUCT_ARRAY(schar, signed char) DEFINE_TEST_STRUCT_ARRAY(sshort, signed short) DEFINE_TEST_STRUCT_ARRAY(sint, signed int) DEFINE_TEST_STRUCT_ARRAY(slong, signed long) DEFINE_TEST_STRUCT_ARRAY(slonglong, signed long long) DEFINE_TEST_STRUCT_ARRAY(float, float) DEFINE_TEST_STRUCT_ARRAY(double, double) DEFINE_TEST_STRUCT_ARRAY(string, char*) extern struct test_uchar add_struct_uchar(struct test_uchar v1, struct test_uchar v2); extern struct test_ushort add_struct_ushort(struct test_ushort v1, struct test_ushort v2); extern struct test_uint add_struct_uint(struct test_uint v1, struct test_uint v2); extern struct test_ulong add_struct_ulong(struct test_ulong v1, struct test_ulong v2); extern struct test_ulonglong add_struct_ulonglong(struct test_ulonglong v1, struct test_ulonglong v2); extern struct test_schar add_struct_schar(struct test_schar v1, struct test_schar v2); extern struct test_sshort add_struct_sshort(struct test_sshort v1, struct test_sshort v2); extern struct test_sint add_struct_sint(struct test_sint v1, struct test_sint v2); extern struct test_slong add_struct_slong(struct test_slong v1, struct test_slong v2); extern struct test_slonglong add_struct_slonglong(struct test_slonglong v1, struct test_slonglong v2); extern struct test_float add_struct_float(struct test_float v1, struct test_float v2); extern struct test_double add_struct_double(struct test_double v1, struct test_double v2); extern struct test_string add_struct_string(struct test_string v1, struct test_string v2); #define EXTERN_FUNC_TEST_STRUCT_ARRAY(type) \ extern struct test_array_##type \ add_struct_array_##type(struct test_array_##type v1, \ struct test_array_##type v2); EXTERN_FUNC_TEST_STRUCT_ARRAY(uchar) EXTERN_FUNC_TEST_STRUCT_ARRAY(ushort) EXTERN_FUNC_TEST_STRUCT_ARRAY(uint) EXTERN_FUNC_TEST_STRUCT_ARRAY(ulong) EXTERN_FUNC_TEST_STRUCT_ARRAY(ulonglong) EXTERN_FUNC_TEST_STRUCT_ARRAY(schar) EXTERN_FUNC_TEST_STRUCT_ARRAY(sshort) EXTERN_FUNC_TEST_STRUCT_ARRAY(sint) EXTERN_FUNC_TEST_STRUCT_ARRAY(slong) EXTERN_FUNC_TEST_STRUCT_ARRAY(slonglong) EXTERN_FUNC_TEST_STRUCT_ARRAY(float) EXTERN_FUNC_TEST_STRUCT_ARRAY(double) EXTERN_FUNC_TEST_STRUCT_ARRAY(string) extern unsigned char add_uchar(unsigned char v1, unsigned char v2); extern signed char add_schar(signed char v1, signed char v2); extern unsigned short add_ushort(unsigned short v1, unsigned short v2); extern signed short add_sshort(signed short v1, signed short v2); extern unsigned int add_uint(unsigned int v1, unsigned int v2); extern signed int add_sint(signed int v1, signed int v2); extern unsigned long add_ulong(unsigned long v1, unsigned long v2); extern signed long add_slong(signed long v1, signed long v2); extern unsigned long long add_ulonglong(unsigned long long v1, unsigned long long v2); extern signed long long add_slonglong(signed long long v1, signed long long v2); extern float add_float(float v1, float v2); extern double add_double(double v1, double v2); extern const char *add_string(const char *v1, const char *v2); extern unsigned char *add_array_uchar(int size, unsigned char v1[], unsigned char v2[]); extern signed char *add_array_schar(int size, signed char v1[], signed char v2[]); extern unsigned short *add_array_ushort(int size, unsigned short v1[], unsigned short v2[]); extern signed short *add_array_sshort(int size, signed short v1[], signed short v2[]); extern unsigned int *add_array_uint(int size, unsigned int v1[], unsigned int v2[]); extern signed int *add_array_sint(int size, signed int v1[], signed int v2[]); extern unsigned long *add_array_ulong(int size, unsigned long v1[], unsigned long v2[]); extern signed long *add_array_slong(int size, signed long v1[], signed long v2[]); extern unsigned long long *add_array_ulonglong(int size, unsigned long long v1[], unsigned long long v2[]); extern signed long long *add_array_slonglong(int size, signed long long v1[], signed long long v2[]); extern float *add_array_float(int size, float v1[], float v2[]); extern double *add_array_double(int size, double v1[], double v2[]); extern char **add_array_string(int size, const char *v1[], const char *v2[]); extern unsigned char callback_uchar(unsigned char (*fn)(unsigned char, unsigned char), unsigned char v1, unsigned char v2); extern signed char callback_schar(signed char (*)(signed char, signed char), signed char v1, signed char v2); extern unsigned short callback_ushort(unsigned short (*fn)(unsigned short, unsigned short), unsigned short v1, unsigned short v2); extern signed short callback_sshort(signed short (*fn)(signed short, signed short), signed short v1, signed short v2); extern unsigned int callback_uint(unsigned int (*fn)(unsigned int, unsigned int), unsigned int v1, unsigned int v2); extern signed int callback_sint(signed int (*fn)(signed int, signed int), signed int v1, signed int v2); extern unsigned long callback_ulong(unsigned long (*fn)(unsigned long, unsigned long), unsigned long v1, unsigned long v2); extern signed long callback_slong(signed long (*fn)(signed long, signed long), signed long v1, signed long v2); extern unsigned long long callback_ulonglong(unsigned long long (*fn)(unsigned long long, unsigned long long), unsigned long long v1, unsigned long long v2); extern signed long long callback_slonglong(signed long long (*fn)(signed long long, signed long long), signed long long v1, signed long long v2); extern float callback_float(float (*fn)(float, float), float v1, float v2); extern double callback_double(double (*fn)(double, double), double v1, double v2); extern const char *callback_string(const char *(*fn)(const char *, const char*), const char *v1, const char *v2); #define EXTERN_FUNC_VAARG(type, ctype) extern ctype *vaarg_##type(int nargs, ...); EXTERN_FUNC_VAARG(uint, unsigned int) EXTERN_FUNC_VAARG(ulong, unsigned long) EXTERN_FUNC_VAARG(ulonglong, unsigned long long) EXTERN_FUNC_VAARG(sint, signed int) EXTERN_FUNC_VAARG(slong, signed long) EXTERN_FUNC_VAARG(slonglong, signed long long) EXTERN_FUNC_VAARG(double, double) EXTERN_FUNC_VAARG(string, char*) union test { char c; short s; int i; long l; long long ll; float f; double d; char *str; }; #define EXTERN_FUNC_TEST_UNION(name) extern union test test_union_##name(union test v1, union test v2); EXTERN_FUNC_TEST_UNION(c) EXTERN_FUNC_TEST_UNION(s) EXTERN_FUNC_TEST_UNION(i) EXTERN_FUNC_TEST_UNION(l) EXTERN_FUNC_TEST_UNION(ll) EXTERN_FUNC_TEST_UNION(f) EXTERN_FUNC_TEST_UNION(d) EXTERN_FUNC_TEST_UNION(str) extern void test_modify(int *v); extern int incomplete_array[]; extern int test_null_ptr(void *ptr1); extern int test_null_func_ptr(int (*fn)(void *ptr)); extern int test_val; extern int *test_ptr; extern int test_array[]; extern void init_test_ptr(); #define post_pp(x) ((x)++) #define post_mm(x) ((x)--) #define pre_pp(x) (++(x)) #define pre_mm(x) (--(x)) #define plus(x, y) ((x)+(y)) #define minus(x, y) ((x)-(y)) struct bitfield_rec { signed v1 : 3; unsigned v2 : 3; signed dummy1 : 30; unsigned v3 : 2; signed v4 : 16; float dummy2; unsigned : 4; unsigned v5 : 3; }; extern struct bitfield_rec test_bitfield(struct bitfield_rec dat); struct bitfield_rec2 { void *p; short s; unsigned int v1 : 14; unsigned int v2 : 2; }; extern int expected_sizeof_bitfield_rec2(); extern struct bitfield_rec2 test_bitfield2(struct bitfield_rec2 dat); #define IFMAC(test,then_expr,else_expr) ((test)?(then_expr):(else_expr)) #define FUNCLIKE_MACRO_USING_TYPE_PARAM(type) ((int (*)(const type *)) foo()) /* test funcations for inline function */ inline int return_const() { return 1; } inline char *return_string() { return "foo"; } inline int ref_array(int a[]) { return a[1]; } inline void funccall1() { init_test_ptr(); } inline int funcall2(int a, int b) { return add_sint(a, b); } inline int ref_struct1() { struct test_sint a; a.value = 1; return a.value; } inline int ref_struct2(struct test_sint *p) { return p->value; } inline int post_inc() { int a = 1; a++; return a; } inline int post_dec() { int a = 2; a--; return a; } inline int pre_inc() { int a = 1; return ++a; } inline int pre_dec() { int a = 2; return --a; } inline int unary_plus() { return +1; } inline int unary_minus() { return -1; } inline int unary_logneg(int a) { return !a; } inline int unary_bitneg(int a) { return ~a; } inline int unary_ref() { int a; sscanf("123", "%d", &a); return a; } inline int *unary_deref() { void *p0 = (int*) malloc(sizeof(int)); int *p = (int*)p0; *p = 456; return p; } inline long op_sizeof() { return sizeof(int); } inline int mul(int a, int b) { return a*b; } inline int divi(int a, int b) { return a/b; } inline int mod(int a, int b) { return a%b; } inline int add(int a, int b) { return a+b; } inline int sub(int a, int b) { return a-b; } inline int left_shift(int a, int b) { return a<>b; } inline int op_lt(int a, int b) { if (ab) return 1; else { return 0; } } inline int op_lteq(int a, int b) { if (a<=b) return 1; else return 0; } inline int op_gteq(int a, int b) { if (a>=b) { return 1; } else { return 0; } } inline int op_eq(int a, int b) { if (a==b) { return 1; } else { return 0; } } inline int op_noteq(int a, int b) { if (a!=b) { return 1; } else { return 0; } } inline int bitand(int a, int b) { return a&b; } inline int bitxor(int a, int b) { return a ^ b; } inline int bitor(int a, int b) { return a | b; } inline int op_logand(int a, int b, int c) { if ((a == b) && (b == c)) { return 1; } else { return 0; } } inline int op_logor(int a, int b, int c) { return ((a == b) || (b == c))?1:0; } inline int assign_mul(int a, int b) { a *= b; return a; } inline int assign_div(int a, int b) { a /= b; return a; } inline int assign_mod(int a, int b) { a %= b; return a; } inline int assign_add(int a, int b) { a += b; return a; } inline int assign_sub(int a, int b) { a -= b; return a; } inline int assign_left_shift(int a, int b) { a <<= b; return a; } inline int assign_right_shift(int a, int b) { a >>= b; return a; } inline int assign_bitand(int a, int b) { a &= b; return a; } inline int assign_bitor(int a, int b) { a |= b; return a; } inline int assign_bitxor(int a, int b) { a ^= b; return a; } inline int multi_expr(int a, int b) { return (a + b), (a - b), (a * b); } inline int test_while() { int i = 1; int sum = 0; while (i <= 10) { sum += i; ++i; } return sum; } inline int test_while_break() { int i = 1; int sum = 0; while (1) { sum += i; ++i; if (i > 10) break; } return sum; } inline int test_while_continue() { int i = -10; int sum = 0; while (i < 10) { if (i++ < 0) { continue; } sum += i; } return sum; } inline int test_dowhile() { int i = 1; int sum = 0; do { sum += i++; } while (i <= 10); return sum; } inline int test_dowhile_break() { int i = 1; int sum = 0; do { sum += i++; if (i > 10) break; } while (1); return sum; } inline int test_dowhile_continue() { int i = -10; int sum = 0; do { if (++i <= 0) { continue; } sum += i; } while ((0 < i) && (i < 10)); return sum; } inline int test_for() { int i; int sum; for (i = 0, sum = 0; i <= 10; ++i) { sum += i; } return sum; } inline int test_for_noinit_notest_noupdate() { int i = 0, sum = 0; for (;;) { sum += ++i; if (10 <= i) break; } return sum; } inline int test_for_noinit_notest() { int i = 0, sum = 0; for (;;sum += ++i) { if (10 <= i) break; } return sum; } inline int test_for_noinit_noupdate() { int i = 0, sum = 0; for (;i < 10;) { sum += ++i; } return sum; } inline int test_for_noinit() { int i = 0, sum = 0; for (;i < 10; sum += ++i); return sum; } inline int test_for_notest_noupdate() { int i, sum; for (i = 0, sum = 0;;) { sum += ++i; if (10 <= i) break; } return sum; } inline int test_for_notest() { int i, sum; for (i = 0, sum = 0;;sum += ++i) { if (10 <= i) break; } return sum; } inline int test_for_noupdate() { int i, sum; for (i = sum = 0;i < 10;) { sum += ++i; } return sum; } inline intptr_t offset_calc() { return (intptr_t) &(((struct test_uchar*)0)->value); } inline void not_supported(int a) { switch (a) { case 1: break; default: break; } } /* ISO/IEC 9899:1999 6.7.5.3 a declaration of a parameter as ``function returning type'' shall be adjusted to ``pointer to function returning type'' */ extern char *param_func_test(void *allocator(size_t)); typedef signed int (*sint_adder)(signed int v1, signed int v2); extern sint_adder get_fptr(); /* variable attribute 'mode' */ extern int test_qi __attribute__((__mode__(__QI__))); extern int test_hi __attribute__((__mode__(__HI__))); extern int test_si __attribute__((__mode__(__SI__))); extern int test_di __attribute__((__mode__(__DI__))); extern unsigned int test_uqi __attribute__((__mode__(__QI__))) , test_uhi __attribute__((__mode__(__HI__))) , test_usi __attribute__((__mode__(__SI__))) , test_udi __attribute__((__mode__(__DI__))); extern float test_sf __attribute__((__mode__(__SF__))); extern float test_df __attribute__((__mode__(__DF__))); struct test_attr_mode_rec { int test_qi __attribute__((__mode__(__QI__))); int test_hi __attribute__((__mode__(__HI__))); int test_si __attribute__((__mode__(__SI__))); int test_di __attribute__((__mode__(__DI__))); unsigned int test_uqi __attribute__((__mode__(__QI__))) , test_uhi __attribute__((__mode__(__HI__))) , test_usi __attribute__((__mode__(__SI__))) , test_udi __attribute__((__mode__(__DI__))); float test_sf __attribute__((__mode__(__SF__))); float test_df __attribute__((__mode__(__DF__))); }; extern void test_attr_mode(int qi __attribute__((__mode__(__QI__))), int hi __attribute__((__mode__(__HI__))), int si __attribute__((__mode__(__SI__))), int di __attribute__((__mode__(__DI__))), unsigned int uqi __attribute__((__mode__(__QI__))), unsigned int uhi __attribute__((__mode__(__HI__))), unsigned int usi __attribute__((__mode__(__SI__))), unsigned int udi __attribute__((__mode__(__DI__))), float sf __attribute__((__mode__(__SF__))), float df __attribute__((__mode__(__DF__)))); #define COUNTER counter() extern int counter(); extern void reset_counter(); /* Tricky code about function-like macro */ extern int confusing_func1(int a, int b); #define confusing_func1(a, b) ((a)-(b)) inline int confusing_func2(int a, int b) { return (confusing_func1)(a, b); } gauche-c-wrapper-0.6.1.orig/testsuite/ffitest.scm0000644000000000000000000001101511237307543016701 0ustar ;;; ;;; Test ffi ;;; (use gauche.test) (test-start "c-wrapper (ffi)") (use c-wrapper) (use gauche.uvector) (use gauche.config) (test-module 'c-wrapper) (define DYLIB (string-append "./ffitest." (gauche-config "--dylib-suffix"))) (define dlopen (with-module c-wrapper dlopen)) (define dlclose (with-module c-wrapper dlclose)) (define dlsym (with-module c-wrapper dlsym)) (define ffi-type-uint (with-module c-wrapper ffi-type-uint)) (define ffi-type-sint (with-module c-wrapper ffi-type-sint)) (define ffi-type-pointer (with-module c-wrapper ffi-type-pointer)) (define ffi-prep-cif (with-module c-wrapper ffi-prep-cif)) (define ffi-call (with-module c-wrapper ffi-call)) (define ffi-prep-closure (with-module c-wrapper ffi-prep-closure)) (define ffi-closure (with-module c-wrapper ffi-closure)) (test "dlopen" #f (lambda () (let ((handle (dlopen DYLIB))) (begin0 (null-ptr? handle) (dlclose handle))))) (test "dlsym" #f (lambda () (let* ((handle (dlopen DYLIB)) (ptr (dlsym "add_uint"))) (begin0 (null-ptr? ptr) (dlclose handle))))) (test "ffi_prep_cif" (with-module c-wrapper FFI_OK) (lambda () (let* ((handle (dlopen DYLIB)) (fn (dlsym "add_uint"))) (receive (status cif) (ffi-prep-cif (ffi-type-uint) (list (ffi-type-uint) (ffi-type-uint))) (begin0 status (dlclose handle)))))) (test "ffi_call" 3 (lambda () (let* ((handle (dlopen DYLIB)) (fn (dlsym "add_uint")) (rvalue (make )) (v1 (make )) (v2 (make ))) (receive (status cif) (ffi-prep-cif (ffi-type-sint) (list (ffi-type-uint) (ffi-type-uint))) (v1 1) (v2 2) (ffi-call cif fn (ptr rvalue) (list (slot-ref v1 'buffer) (slot-ref v2 'buffer))) (begin0 (rvalue) (dlclose handle)))))) (test "ffi_closure" #t (lambda () (let* ((handle (dlopen DYLIB)) (fn (dlsym "callback"))) (receive (status cif) (ffi-prep-cif (ffi-type-sint) (list (ffi-type-sint) (ffi-type-sint))) (receive (status closure) (ffi-prep-closure cif (lambda (v1 v2) (let ((result (make ))) (result (+ ((deref (cast (ptr ) v1))) ((deref (cast (ptr ) v2))))) (ptr result)))) (begin0 (and (= status (with-module c-wrapper FFI_OK)) (not (null-ptr? (ffi-closure closure)))) (dlclose handle))))))) (test "call callback" 5 (lambda () (let* ((handle (dlopen DYLIB)) (fn (dlsym "callback_sint")) (v1 (make )) (v2 (make )) (rvalue (make ))) (receive (status cif_closure) (ffi-prep-cif (ffi-type-sint) (list (ffi-type-sint) (ffi-type-sint))) (receive (status closure) (ffi-prep-closure cif_closure (lambda (v1 v2) (let ((result (make ))) (result (+ ((deref (cast (ptr ) v1))) ((deref (cast (ptr ) v2))))) (ptr result)))) (receive (status cif) (ffi-prep-cif (ffi-type-sint) (list (ffi-type-pointer) (ffi-type-sint) (ffi-type-sint))) (v1 -3) (v2 8) (ffi-call cif fn (ptr rvalue) (list (slot-ref (ffi-closure closure) 'buffer) (slot-ref v1 'buffer) (slot-ref v2 'buffer))) (begin0 (rvalue) (dlclose handle)))))))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/fptr_array-test.scm0000644000000000000000000000113111237307543020361 0ustar ;;; ;;; Test for an array of function pointers ;;; (use gauche.test) (test-start "fptr_array-test") (use gauche.sequence) (use c-wrapper) (test-module 'c-wrapper) (c-load-library "./fptr_array") (c-include "./fptr_array.h") (test "fptr_array" (list 3 55) (lambda () (let ((foo (make (c-struct 'foo))) (v (make )) (results #f)) (set! (ref v) 55) (fptr_array_set (ptr foo)) (set! results (fptr_array_test (ptr foo) (ptr v))) (map identity (cast (c-array 2) results))))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/fptr_array.c0000644000000000000000000000077411237307543017060 0ustar #include #include "fptr_array.h" static int testfunc1() { return 3; } static char *testfunc2(int *p) { char *c = (char*) malloc(sizeof(char)); *c = (char) (0xff & *p); return c; } void fptr_array_set(struct foo *s) { s->fptr_array[1] = testfunc1; s->c[3] = testfunc2; } int *fptr_array_test(struct foo *s, int *p) { int *results = (int*) malloc(sizeof(int) * 2); results[0] = (s->fptr_array[1])(); results[1] = (int) (*(s->c[3])(p)); return results; } gauche-c-wrapper-0.6.1.orig/testsuite/fptr_array.h0000644000000000000000000000025511237307543017057 0ustar struct foo { int (*fptr_array[3]) (void); char *(*c[10])(int *p); }; extern void fptr_array_set(struct foo *s); extern int *fptr_array_test(struct foo *s, int *p); gauche-c-wrapper-0.6.1.orig/testsuite/gcc_extension-test.scm0000644000000000000000000000202111237307543021037 0ustar ;;; ;;; Test GCC extension ;;; (use gauche.test) (test-start "gcc_extension") (use c-wrapper) (test-module 'c-wrapper) (c-load-library "./gcc_extension") (c-include "./gcc_extension.h") (test "Unnamed struct/union fields within structs/unions 1" '(2 3.0 4 5 6.0) (lambda () (let ((foo (make (c-struct 'foo)))) (set! (ref foo 'a) 1) (set! (ref foo 'b) 2) (set! (ref foo 'e) 3) (set! (ref foo 'f) 4) (set! (ref foo 'g) 5) (inc_foo (ptr foo) FLOAT_MODE) (map (cut ref foo <>) '(a b e f g))))) (test "Unnamed struct/union fields within structs/unions 2" '(2 3 4.0 5 6 7.0) (lambda () (let ((foo (make (c-struct 'foo)))) (set! (ref foo 'a) 1) (set! (ref foo 'c) 2) (set! (ref foo 'd) 3) (set! (ref foo 'e) 4) (set! (ref foo 'f) 5) (set! (ref foo 'g) 6) (inc_foo (ptr foo) STRUCT_MODE) (map (cut ref foo <>) '(a c d e f g))))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/gcc_extension.c0000644000000000000000000000046311237307543017532 0ustar #include "gcc_extension.h" void inc_foo(struct foo *v, int mode) { ++(v->a); switch (mode) { case FLOAT_MODE: ++(v->b); break; case STRUCT_MODE: ++(v->c); ++(v->d); break; default: break; } ++(v->e); ++(v->f); ++(v->g); } gauche-c-wrapper-0.6.1.orig/testsuite/gcc_extension.h0000644000000000000000000000053211237307543017534 0ustar /* Unnamed struct/union fields within structs/unions */ struct foo { int a; union { float b; struct { int c; double d; }; }; int e; struct { int f; double g; }; }; #define FLOAT_MODE 1 #define STRUCT_MODE 2 extern void inc_foo(struct foo *v, int mode); gauche-c-wrapper-0.6.1.orig/testsuite/inline-test.scm0000644000000000000000000001376611237307543017507 0ustar ;;; ;;; inline function test ;;; (use gauche.test) (test-start "c-wrapper (inline)") (use c-wrapper) (c-load-library "libc") (c-load-library "./ffitest") (c-include '("stdio.h" "stdlib.h" "./ffitest.h")) (test "constant" 1 (lambda () (return_const))) (test "string" "foo" (lambda () (x->string (return_string)))) (test "ref array" 10 (lambda () (let ((a (make (c-array 3)))) (set! (ref a 0) 0) (set! (ref a 1) 10) (set! (ref a 2) 20) (ref_array a)))) (test "func call without argument" '(-2 -1 0 1 2) (lambda () (funccall1) (list (ref test_array 0) (ref test_array 1) (ref test_array 2) (ref test_array 3) (ref test_array 4)))) (test "func call with arguments" 3 (lambda () (funcall2 1 2))) (test "ref struct (. operator)" 1 (lambda () (ref_struct1))) (test "ref struct (-> operator)" 1 (lambda () (let ((a (make (c-struct 'test_sint)))) (set! (ref a 'value) 1) (ref_struct2 (ptr a))))) (test "post increment" 2 (lambda () (post_inc))) (test "post decrement" 1 (lambda () (post_dec))) (test "pre increment" 2 (lambda () (pre_inc))) (test "pre decrement" 1 (lambda () (pre_dec))) (test "unary plus" 1 (lambda () (unary_plus))) (test "unary minus" -1 (lambda () (unary_minus))) (test "unary logical negation" '(0 1) (lambda () (list (unary_logneg 1) (unary_logneg 0)))) (test "unary bitwise negation" -2 (lambda () (unary_bitneg 1))) (test "unary reference" 123 (lambda () (unary_ref))) (test "unary dereference" 456 (lambda () (ref (deref (unary_deref))))) (test "sizeof" #t (lambda () (eq? (c-sizeof ) (op_sizeof)))) (test "mul" 6 (lambda () (mul 2 3))) (test "divi" 3 (lambda () (divi 18 6))) (test "mod" 1 (lambda () (mod 5 2))) (test "add" 3 (lambda () (add 1 2))) (test "sub" -1 (lambda () (sub 1 2))) (test "left shift" 4 (lambda () (left_shift 1 2))) (test "right shift" 2 (lambda () (right_shift 8 2))) (test "lesser than" '(1 0 0) (lambda () (list (op_lt 1 2) (op_lt 2 2) (op_lt 2 1)))) (test "greater than" '(0 0 1) (lambda () (list (op_gt 1 2) (op_gt 2 2) (op_gt 2 1)))) (test "lesser than or equal" '(1 1 0) (lambda () (list (op_lteq 1 2) (op_lteq 2 2) (op_lteq 2 1)))) (test "greater than or equal" '(0 1 1) (lambda () (list (op_gteq 1 2) (op_gteq 2 2) (op_gteq 2 1)))) (test "equal" '(0 1 0) (lambda () (list (op_eq 1 2) (op_eq 2 2) (op_eq 2 1)))) (test "not equal" '(1 0 1) (lambda () (list (op_noteq 1 2) (op_noteq 2 2) (op_noteq 2 1)))) (test "bitwise and" 1 (lambda () (bitand 11 5))) (test "bitwise or" 15 (lambda () (bitor 11 5))) (test "bitwise xor" 14 (lambda () (bitxor 11 5))) (test "logical and" '(1 0 0 0) (lambda () (list (op_logand 1 1 1) (op_logand 1 1 0) (op_logand 0 1 1) (op_logand 0 1 0)))) (test "logical or" '(1 1 1 0) (lambda () (list (op_logor 1 1 1) (op_logor 1 1 0) (op_logor 0 1 1) (op_logor 0 1 0)))) (test "assign mul" 6 (lambda () (assign_mul 2 3))) (test "assign div" 3 (lambda () (assign_div 18 6))) (test "assign mod" 1 (lambda () (assign_mod 5 2))) (test "assign_add" 3 (lambda () (assign_add 1 2))) (test "assign_sub" -1 (lambda () (assign_sub 1 2))) (test "assign left shift" 4 (lambda () (assign_left_shift 1 2))) (test "assign right shift" 2 (lambda () (assign_right_shift 8 2))) (test "assign bitwise and" 1 (lambda () (assign_bitand 11 5))) (test "assign bitwise or" 15 (lambda () (assign_bitor 11 5))) (test "assign bitwise xor" 14 (lambda () (assign_bitxor 11 5))) (test "multi expr" 10 (lambda () (multi_expr 2 5))) (test "while" 55 (lambda () (test_while))) (test "while break" 55 (lambda () (test_while_break))) (test "while continue" 55 (lambda () (test_while_continue))) (test "do while" 55 (lambda () (test_dowhile))) (test "do while break" 55 (lambda () (test_dowhile_break))) (test "do while continue" 0 (lambda () (test_dowhile_continue))) (test "for" 55 (lambda () (test_for))) (test "for noinit, notest, noupdate" 55 (lambda () (test_for_noinit_notest_noupdate))) (test "for noinit, notest" 55 (lambda () (test_for_noinit_notest))) (test "for noinit, noupdate" 55 (lambda () (test_for_noinit_noupdate))) (test "for noinit" 55 (lambda () (test_for_noinit_noupdate))) (test "for notest, noupdate" 55 (lambda () (test_for_notest_noupdate))) (test "for notest" 55 (lambda () (test_for_notest))) (test "for noupdate" 55 (lambda () (test_for_noupdate))) (test "offset" #t (lambda () (eq? (offset_calc) (c-offsetof (c-struct 'test_uchar) 'value)))) (test "not_supported" #t (lambda () (procedure? not_supported))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/Makefile.in0000644000000000000000000000446511237307543016611 0ustar # # $Id: Makefile.in 63 2006-02-17 15:38:49Z naoki $ # # General info SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ datarootdir = @datarootdir@ srcdir = @srcdir@ VPATH = $(srcdir) # These may be overridden by make invocators DESTDIR = GOSH = @GOSH@ GAUCHE_CONFIG = @GAUCHE_CONFIG@ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@ INSTALL = @GAUCHE_INSTALL@ CC = @CC@ CFLAGS = @TESTLIB_CFLAGS@ LDFLAGS = @TESTLIB_LDFLAGS@ # Other parameters SOEXT = @SOEXT@ OBJEXT = @OBJEXT@ EXEEXT = @EXEEXT@ DYLIBEXT = @DYLIBEXT@ # Module-specific stuff PACKAGE = c-wrapper GENERATED = CONFIG_GENERATED = Makefile GAUCHE_PKGINCDIR = @GAUCHE_PKGINCDIR@ GAUCHE_PKGLIBDIR = @GAUCHE_PKGLIBDIR@ GAUCHE_PKGARCHDIR = @GAUCHE_PKGARCHDIR@ CHECK_TARGET = check-c @OBJC_ENABLE_TRUE@CHECK_TARGET += check-objc .SUFFIXES: .m .c.o: $(CC) $(CFLAGS) $@ $< .m.o: $(CC) $(CFLAGS) $@ $< all : ffitest.$(DYLIBEXT): ffitest.o $(CC) $(LDFLAGS) $@ $< fptr_array.$(DYLIBEXT): fptr_array.o $(CC) $(LDFLAGS) $@ $< gcc_extension.$(DYLIBEXT): gcc_extension.o $(CC) $(LDFLAGS) $@ $< objc-test.$(DYLIBEXT): objc-test.o $(CC) $(LDFLAGS) $@ $< -framework Foundation check: $(CHECK_TARGET) check-c: ffitest.$(DYLIBEXT) fptr_array.$(DYLIBEXT) gcc_extension.$(DYLIBEXT) @rm -f test.log $(GOSH) -I../src -I../lib attr-test.scm >> test.log $(GOSH) -I../src -I../lib ffitest.scm >> test.log $(GOSH) -I../src -I../lib ctypestest.scm >> test.log $(GOSH) -I../src -I../lib cwrappertest.scm >> test.log $(GOSH) -I../src -I../lib struct_in_union-test.scm >> test.log $(GOSH) -I../src -I../lib stdio-test.scm >> test.log $(GOSH) -I../src -I../lib inline-test.scm >> test.log $(GOSH) -I../src -I../lib fptr_array-test.scm >> test.log $(GOSH) -I../src -I../lib array_qualifier-test.scm >> test.log $(GOSH) -I../src -I../lib gcc_extension-test.scm >> test.log check-objc: objc-test.$(DYLIBEXT) $(GOSH) -I../src -I../lib -I../objc objc-test.scm >> test.log clean : rm -rf core ffitest.$(DYLIBEXT) objc-test.$(DYLIBEXT) fptr_array.$(DYLIBEXT) gcc_extension.$(DYLIBEXT) *.o $(GENERATED) *~ test.log so_locations distclean : clean rm -rf $(CONFIG_GENERATED) maintainer-clean : clean rm -rf $(CONFIG_GENERATED) configure VERSION gauche-c-wrapper-0.6.1.orig/testsuite/objc-test.h0000644000000000000000000000326011237307543016577 0ustar #import typedef struct test_large_rec { int a; int b; } TestLarge; typedef struct test_small_rec { char a; char b; } TestSmall; typedef union test_large_union_rec { int a; long b; } TestLargeUnion; typedef struct test_small_union_rec { char a; char b; } TestSmallUnion; @interface OBJCTest : NSObject { } + (int)staticMethod; - (unsigned char)incrementUnsignedChar:(unsigned char)v; - (signed char)incrementSignedChar:(signed char)v; - (unsigned short)incrementUnsignedShort:(unsigned short)v; - (signed short)incrementSignedShort:(signed short)v; - (unsigned int)incrementUnsignedInt:(unsigned int)v; - (signed int)incrementSignedInt:(signed int)v; - (unsigned long)incrementUnsignedLong:(unsigned long)v; - (signed long)incrementSignedLong:(signed long)v; - (unsigned long long)incrementUnsignedLongLong:(unsigned long long)v; - (signed long long)incrementSignedLongLong:(signed long long)v; - (float)addFloat:(float)v1 and:(float)v2; - (double)addDouble:(double)v1 and:(double)v2; - (NSString*)appendString:(NSString*)str1 and:(NSString*)str2; - (TestLarge)addLargeStruct:(TestLarge)data valA:(int)a valB:(int)b; - (TestSmall)addSmallStruct:(TestSmall)data valA:(char)a valB:(char)b; - (TestLargeUnion)addLargeUnion:(TestLargeUnion)data valA:(int)a; - (TestSmallUnion)addSmallUnion:(TestSmallUnion)data valA:(char)a; - (void)overwriteData:(TestLarge*)data; @end inline NSString *returnString() { return @"foo"; } inline NSString *inlineAppendString(NSString *str1, NSString *str2) { OBJCTest *obj = [[OBJCTest alloc] init]; return [obj appendString:str1 and:str2]; } inline SEL inlineSelector() { return @selector(init); } gauche-c-wrapper-0.6.1.orig/testsuite/objc-test.m0000644000000000000000000000351411237307543016606 0ustar #import "objc-test.h" @implementation OBJCTest + (int)staticMethod { return 5; } - (unsigned char)incrementUnsignedChar:(unsigned char)v { return v + 1; } - (signed char)incrementSignedChar:(signed char)v { return v + 1; } - (unsigned short)incrementUnsignedShort:(unsigned short)v { return v + 1; } - (signed short)incrementSignedShort:(signed short)v { return v + 1; } - (unsigned int)incrementUnsignedInt:(unsigned int)v { return v + 1; } - (signed int)incrementSignedInt:(signed int)v { return v + 1; } - (unsigned long)incrementUnsignedLong:(unsigned long)v { return v + 1; } - (signed long)incrementSignedLong:(signed long)v { return v + 1; } - (unsigned long long)incrementUnsignedLongLong:(unsigned long long)v { return v + 1; } - (signed long long)incrementSignedLongLong:(signed long long)v { return v + 1; } - (float)addFloat:(float)v1 and:(float)v2 { return v1 + v2; } - (double)addDouble:(double)v1 and:(double)v2 { return v1 + v2; } - (NSString*)appendString:(NSString*)str1 and:(NSString*)str2 { NSMutableString *ret = [NSMutableString stringWithString:str1]; [ret appendString:str2]; return ret; } - (TestLarge)addLargeStruct:(TestLarge)data valA:(int)a valB:(int)b { TestLarge ret; ret.a = data.a + a; ret.b = data.b + b; return ret; } - (TestSmall)addSmallStruct:(TestSmall)data valA:(char)a valB:(char)b; { TestSmall ret; ret.a = data.a + a; ret.b = data.b + b; return ret; } - (TestLargeUnion)addLargeUnion:(TestLargeUnion)data valA:(int)a { TestLargeUnion ret; ret.a = data.a + a; return ret; } - (TestSmallUnion)addSmallUnion:(TestSmallUnion)data valA:(char)a { TestSmallUnion ret; ret.a = data.a + a; return ret; } - (void)overwriteData:(TestLarge*)data { data->a = 1; data->b = 2; } @end gauche-c-wrapper-0.6.1.orig/testsuite/objc-test.scm0000644000000000000000000001040511237307543017131 0ustar ;;; ;;; Test objc-wrapper ;;; (use gauche.test) (test-start "objc-wrapper") (use objc-wrapper) (use gauche.sequence) (test-module 'objc-wrapper) (c-load-framework "Foundation") (c-load-library "./objc-test") (c-include "./objc-test.h") [[NSAutoreleasePool 'alloc] 'init] (define obj [[OBJCTest 'alloc] 'init]) (test "staticMethod" 5 (lambda () [OBJCTest 'staticMethod])) (test "incrementUnsignedChar:" 3 (lambda () [obj :incrementUnsignedChar 2])) (test "incrementSignedChar:" -3 (lambda () [obj :incrementSignedChar -4])) (test "incrementUnsignedShort:" 4 (lambda () [obj :incrementUnsignedShort 3])) (test "incrementSignedShort:" -4 (lambda () [obj :incrementSignedShort -5])) (test "incrementUnsignedInt:" 5 (lambda () [obj :incrementUnsignedInt 4])) (test "incrementSignedInt:" -5 (lambda () [obj :incrementSignedInt -6])) (test "incrementUnsignedLong:" 6 (lambda () [obj :incrementUnsignedLong 5])) (test "incrementSignedLong:" -6 (lambda () [obj :incrementSignedLong -7])) (test "incrementUnsignedLongLong:" 7 (lambda () [obj :incrementUnsignedLongLong 6])) (test "incrementSignedLongLong:" -7 (lambda () [obj :incrementSignedLongLong -8])) (test "addFloat:and:" 1.5 (lambda () [obj :addFloat 1.0 :and 0.5])) (test "addDouble:and:" -1.5 (lambda () [obj :addDouble -1.0 :and -0.5])) (test "appendString:and:" YES (lambda () (let ((str [obj :appendString (@ "foo") :and (@ "bar")])) [str :isEqualToString (@ "foobar")]))) (test "addLargeStruct:valA:valB:" '(2 3) (lambda () (let ((data (make ))) (set! (ref data 'a) 3) (set! (ref data 'b) 2) (let ((ret [obj :addLargeStruct data :valA -1 :valB 1])) (list (ref ret 'a) (ref ret 'b)))))) (test "addSmallStruct:valA:valB:" '(2 3) (lambda () (let ((data (make ))) (set! (ref data 'a) 3) (set! (ref data 'b) 2) (let ((ret [obj :addSmallStruct data :valA -1 :valB 1])) (list (ref ret 'a) (ref ret 'b)))))) (test "addLargeUnion:valA:" 2 (lambda () (let ((data (make ))) (set! (ref data 'a) 3) (let ((ret [obj :addLargeUnion data :valA -1])) (ref ret 'a))))) (test "addSmallUnion:valA:" 2 (lambda () (let ((data (make ))) (set! (ref data 'a) 3) (let ((ret [obj :addSmallUnion data :valA -1])) (ref ret 'a))))) (test "overwriteData:" '(1 2) (lambda () (let ((data (make ))) (set! (ref data 'a) 3) (set! (ref data 'b) 2) [obj :overwriteData (ptr data)] (list (ref data 'a) (ref data 'b))))) (test "inline function (return NSString)" YES (lambda () [(returnString) :isEqualToString (@ "foo")])) (test "inline function (invoke method)" YES (lambda () [(inlineAppendString (@ "foo") (@ "bar")) :isEqualToString (@ "foobar")])) (test "inline function (selector)" #t (lambda () (equal? (@selector "init") (inlineSelector)))) (define-objc-class MyTest NSObject) (define-objc-method MyTest (:addA (v1 ) :addB (v2 )) (+ v1 v2)) (define *cnt* 0) (define-objc-class MyTest2 NSObject) (define-objc-method MyTest2 (:init) [super :init] (set! *cnt* (+ *cnt* 2)) self) (define-objc-method MyTest2 (:myString) (@ "foo")) (define-objc-class MyTest3 MyTest2) (define-objc-method MyTest3 (:init) [super :init] (set! *cnt* (* *cnt* 3)) self) (define-objc-method MyTest3 (:myString) [[super :myString] :stringByAppendingString (@ "bar")]) (test "define objc-class and method(1)" 5 (lambda () (let ((obj [[MyTest :alloc] :init])) [obj :addA 2 :addB 3]))) (test "define objc-class and method(2)" (list 6 YES) (lambda () (let ((obj [[MyTest3 :alloc] :init])) (list *cnt* [[obj :myString] :isEqualToString (@ "foobar")])))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/stdio-test.scm0000644000000000000000000000263211237307543017341 0ustar ;;; ;;; Test include stdio.h ;;; (use srfi-11) (use gauche.test) (use gauche.process) (test-start "c-wrapper (include stdio.h)") (use c-wrapper) (c-include '("stdio.h" "unistd.h")) (test "printf & fprintf" '("Hello, world" "error!") (lambda () (let-values (((stdout-in stdout-out) (sys-pipe)) ((stderr-in stderr-out) (sys-pipe))) (let ((pid (sys-fork))) (if (= pid 0) (begin (close-input-port stdout-in) (close-input-port stderr-in) (close 1) (close 2) (dup (port-file-number stdout-out)) (dup (port-file-number stderr-out)) (printf "Hello, world") (fprintf stderr "error!") (fflush stdout) (fflush stderr) (fclose stdout) (fclose stderr) (sys-exit 0)) (begin (close-output-port stdout-out) (close-output-port stderr-out) (let ((outstr (read-line stdout-in)) (errstr (read-line stderr-in))) (sys-wait) (list outstr errstr)))))))) (test "sscanf" 5 (lambda () (let ((v (make ))) (sscanf "5" "%d" (ptr v)) (v)))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/struct_in_union-test.scm0000644000000000000000000000134111237307543021435 0ustar ;;; ;;; Test struct_in_union ;;; (use gauche.test) (test-start "struct_in_union") (use c-wrapper) (test-module 'c-wrapper) (c-include "./struct_in_union.h") (test "reference" 0 (lambda () (ref (ref (ref (make ) 'u) 's1) 'v1))) (test "set" 1 (lambda () (let ((struct (make ))) (set! (ref (ref (ref struct 'u) 's1) 'v1) 1) (ref (ref (ref struct 'u) 's1) 'v1)))) (test "a union in an array" 2 (lambda () (let ((array (make ( 3)))) (set! (ref (ref (ref (ref array 1) 'u) 's1) 'v1) 2) (ref (ref (ref (ref array 1) 'u) 's1) 'v1)))) ;; epilogue (test-end) gauche-c-wrapper-0.6.1.orig/testsuite/struct_in_union.h0000644000000000000000000000017611237307543020132 0ustar typedef struct struct_in_union { union { struct { int v1; } s1; struct { int v2; } s2; } u; } foo; gauche-c-wrapper-0.6.1.orig/VERSION0000644000000000000000000000000611237307564013551 0ustar 0.6.1