From 8807355af34cba8ffe87aee51152dfccec2771fa Mon Sep 17 00:00:00 2001 From: green Date: Mon, 9 Apr 2001 00:58:38 +0000 Subject: [PATCH] Many many updates. Merge from gcc and then some. --- libffi/ChangeLog | 148 +++++++ libffi/LICENSE | 2 +- libffi/Makefile.in | 479 ++++++++++++++++++---- libffi/README | 2 + libffi/config-ml.in | 151 ++++++- libffi/config.guess | 169 ++++++-- libffi/config.sub | 170 ++++++-- libffi/configure | 142 ++++--- libffi/configure.in | 8 +- libffi/include/Makefile.in | 64 +-- libffi/include/ffi.h.in | 83 ++-- libffi/include/ffi_common.h | 4 +- libffi/include/ffi_mips.h | 2 - libffi/install-sh | 9 +- libffi/ltconfig | 862 ++++++++++++++++++++++++++------------- libffi/ltmain.sh | 746 +++++++++++++++++++++------------ libffi/missing | 86 +++- libffi/mkinstalldirs | 10 +- libffi/src/Makefile.am | 1 + libffi/src/alpha/ffi.c | 252 +++++++----- libffi/src/alpha/osf.S | 279 ++++++++++--- libffi/src/arm/ffi.c | 2 - libffi/src/arm/sysv.S | 18 +- libffi/src/debug.c | 6 +- libffi/src/ffitest.c | 45 +- libffi/src/java_raw_api.c | 2 +- libffi/src/mips/ffi.c | 2 - libffi/src/mips/n32.S | 2 - libffi/src/mips/o32.S | 2 - libffi/src/powerpc/ffi.c | 259 +++++++++++- libffi/src/powerpc/ppc_closure.S | 148 +++++++ libffi/src/prep_cif.c | 17 +- libffi/src/raw_api.c | 10 +- libffi/src/s390/ffi.c | 589 ++++++++++++++++++++++++++ libffi/src/s390/sysv.S | 161 ++++++++ libffi/src/sparc/ffi.c | 298 +++++++++++--- libffi/src/sparc/v8.S | 12 +- libffi/src/sparc/v9.S | 2 - libffi/src/types.c | 33 +- libffi/src/x86/ffi.c | 2 - libffi/src/x86/sysv.S | 43 +- libffi/src/x86/win32.S | 125 ++++++ 42 files changed, 4342 insertions(+), 1105 deletions(-) create mode 100644 libffi/src/powerpc/ppc_closure.S create mode 100644 libffi/src/s390/ffi.c create mode 100644 libffi/src/s390/sysv.S create mode 100644 libffi/src/x86/win32.S diff --git a/libffi/ChangeLog b/libffi/ChangeLog index b62d411..6d3e36f 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,151 @@ +2001-04-8 Neale Ferguson + + * src/s390/ffi.c: New file. + * src/s390/sysv.S: New file. + * include/ffi.h: Add s390 bits. + * configure.in: Ditto. + * configure: Rebuild. + +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 * README: Credit updates. Update supported platorms. diff --git a/libffi/LICENSE b/libffi/LICENSE index f8f54a0..9aac69c 100644 --- a/libffi/LICENSE +++ b/libffi/LICENSE @@ -1,4 +1,4 @@ -libffi - Copyright (c) 1996-1999 Cygnus Solutions +libffi - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 078daf4..9140f90 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4d from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. @@ -30,8 +31,6 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -48,6 +47,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : @@ -56,20 +56,18 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : + +@SET_MAKE@ host_alias = @host_alias@ host_triplet = @host@ -AMTAR = @AMTAR@ -AMTARFLAGS = @AMTARFLAGS@ AS = @AS@ CC = @CC@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ -LD = @LD@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -NM = @NM@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ @@ -77,7 +75,7 @@ SHELL = @SHELL@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ VERSION = @VERSION@ -install_sh = @install_sh@ +libffi_basedir = @libffi_basedir@ AUTOMAKE_OPTIONS = cygnus @@ -115,20 +113,22 @@ ffitest_LDADD = libffi.la TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S -TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S +TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c src/raw_api.c src/java_raw_api.c +libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ + src/raw_api.c src/java_raw_api.c + @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) @ALPHA_TRUE@libffi_la_SOURCES = @ALPHA_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA) -@IA64_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64) +@IA64_TRUE@libffi_la_SOURCES = @IA64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_IA64) @M68K_TRUE@libffi_la_SOURCES = @M68K_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_M68K) @POWERPC_TRUE@libffi_la_SOURCES = @POWERPC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC) @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) @@ -155,6 +155,8 @@ libffi_la_LIBADD = @ALPHA_TRUE@raw_api.lo java_raw_api.lo ffi.lo osf.lo @ARM_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ @ARM_TRUE@raw_api.lo java_raw_api.lo sysv.lo ffi.lo +@IA64_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ +@IA64_TRUE@raw_api.lo java_raw_api.lo ffi.lo unix.lo @M68K_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ @M68K_TRUE@raw_api.lo java_raw_api.lo ffi.lo sysv.lo @MIPS_GCC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ @@ -179,8 +181,9 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CF LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CFLAGS = @CFLAGS@ CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES) +depcomp = DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ acconfig.h aclocal.m4 config.guess config.sub configure configure.in \ fficonfig.h.in install-sh ltconfig ltmain.sh missing mkinstalldirs @@ -189,7 +192,6 @@ fficonfig.h.in install-sh ltconfig ltmain.sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) GZIP_ENV = --best -depcomp = SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES) OBJECTS = $(am_libffi_la_OBJECTS) $(am_ffitest_OBJECTS) @@ -201,7 +203,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configur Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) @@ -234,15 +236,9 @@ $(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in -mostlyclean-hdr: - -clean-hdr: - distclean-hdr: -rm -f fficonfig.h -maintainer-clean-hdr: - mostlyclean-toolexeclibLTLIBRARIES: clean-toolexeclibLTLIBRARIES: @@ -272,13 +268,9 @@ uninstall-toolexeclibLTLIBRARIES: mostlyclean-compile: -rm -f *.o core *.core -clean-compile: - distclean-compile: -rm -f *.tab.c -maintainer-clean-compile: - mostlyclean-libtool: -rm -f *.lo @@ -286,8 +278,7 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -maintainer-clean-libtool: + -rm -f libtool debug.lo: src/debug.c prep_cif.lo: src/prep_cif.c types.lo: src/types.c @@ -296,6 +287,7 @@ java_raw_api.lo: src/java_raw_api.c ffi.lo: src/alpha/ffi.c osf.lo: src/alpha/osf.S sysv.lo: src/arm/sysv.S +unix.lo: src/ia64/unix.S o32.lo: src/mips/o32.S n32.lo: src/mips/n32.S v8.lo: src/sparc/v8.S @@ -339,9 +331,9 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique $(LISP) -TAGS: $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ @@ -351,17 +343,346 @@ TAGS: $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)fficonfig.h.in$$unique$(LISP)$$tags" \ - || etags $(ETAGS_ARGS) $$tags fficonfig.h.in $$unique $(LISP) + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -mostlyclean-tags: - -clean-tags: +GTAGS: + here=`CDPATH=: && cd $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $$here distclean-tags: -rm -f TAGS ID -maintainer-clean-tags: +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/alpha/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/alpha/ffi.c || echo '$(srcdir)/'`src/alpha/ffi.c + +ffi.lo: src/alpha/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/alpha/ffi.c || echo '$(srcdir)/'`src/alpha/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/arm/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/arm/ffi.c || echo '$(srcdir)/'`src/arm/ffi.c + +ffi.lo: src/arm/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/arm/ffi.c || echo '$(srcdir)/'`src/arm/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/ia64/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/ia64/ffi.c || echo '$(srcdir)/'`src/ia64/ffi.c + +ffi.lo: src/ia64/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/ia64/ffi.c || echo '$(srcdir)/'`src/ia64/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/m68k/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/m68k/ffi.c || echo '$(srcdir)/'`src/m68k/ffi.c + +ffi.lo: src/m68k/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/m68k/ffi.c || echo '$(srcdir)/'`src/m68k/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/mips/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/mips/ffi.c || echo '$(srcdir)/'`src/mips/ffi.c + +ffi.lo: src/mips/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/mips/ffi.c || echo '$(srcdir)/'`src/mips/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/mips/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/mips/ffi.c || echo '$(srcdir)/'`src/mips/ffi.c + +ffi.lo: src/mips/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/mips/ffi.c || echo '$(srcdir)/'`src/mips/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/powerpc/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/powerpc/ffi.c || echo '$(srcdir)/'`src/powerpc/ffi.c + +ffi.lo: src/powerpc/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/powerpc/ffi.c || echo '$(srcdir)/'`src/powerpc/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/sparc/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/sparc/ffi.c || echo '$(srcdir)/'`src/sparc/ffi.c + +ffi.lo: src/sparc/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/sparc/ffi.c || echo '$(srcdir)/'`src/sparc/ffi.c + +debug.o: src/debug.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.o `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +debug.lo: src/debug.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o debug.lo `test -f src/debug.c || echo '$(srcdir)/'`src/debug.c + +prep_cif.o: src/prep_cif.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.o `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +prep_cif.lo: src/prep_cif.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o prep_cif.lo `test -f src/prep_cif.c || echo '$(srcdir)/'`src/prep_cif.c + +types.o: src/types.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.o `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +types.lo: src/types.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o types.lo `test -f src/types.c || echo '$(srcdir)/'`src/types.c + +raw_api.o: src/raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.o `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +raw_api.lo: src/raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o raw_api.lo `test -f src/raw_api.c || echo '$(srcdir)/'`src/raw_api.c + +java_raw_api.o: src/java_raw_api.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.o `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +java_raw_api.lo: src/java_raw_api.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o java_raw_api.lo `test -f src/java_raw_api.c || echo '$(srcdir)/'`src/java_raw_api.c + +ffi.o: src/x86/ffi.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.o `test -f src/x86/ffi.c || echo '$(srcdir)/'`src/x86/ffi.c + +ffi.lo: src/x86/ffi.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libffi_la_CFLAGS) $(CFLAGS) -c -o ffi.lo `test -f src/x86/ffi.c || echo '$(srcdir)/'`src/x86/ffi.c + +ffitest.o: src/ffitest.c + $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ffitest_CFLAGS) $(CFLAGS) -c -o ffitest.o `test -f src/ffitest.c || echo '$(srcdir)/'`src/ffitest.c + +ffitest.lo: src/ffitest.c + $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ffitest_CFLAGS) $(CFLAGS) -c -o ffitest.lo `test -f src/ffitest.c || echo '$(srcdir)/'`src/ffitest.c distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -413,21 +734,20 @@ dist-all: distdir || chmod -R a+r $(distdir) $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) + distdir: $(DISTFILES) -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) mkdir $(distdir) - $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ - $(distdir)/src/m68k $(distdir)/src/mips \ - $(distdir)/src/powerpc $(distdir)/src/sparc \ - $(distdir)/src/x86 + $(mkinstalldirs) $(distdir)/include $(distdir)/src/alpha $(distdir)/src/arm $(distdir)/src/m68k $(distdir)/src/mips $(distdir)/src/powerpc $(distdir)/src/sparc $(distdir)/src/x86 include src/alpha src/arm src/m68k src/mips src/powerpc src/sparc src/x86 @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir); \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ else \ test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ fi; \ done info-am: @@ -440,8 +760,8 @@ installcheck-am: installcheck: installcheck-am install-info-am: install-info: install-info-am -all-recursive-am: fficonfig.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive +all-redirect: fficonfig.h + $(MAKE) $(AM_MAKEFLAGS) all-am install-exec-am: install-toolexeclibLTLIBRARIES install-exec: install-exec-am @@ -455,7 +775,6 @@ install: install-am uninstall-am: uninstall-toolexeclibLTLIBRARIES uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) fficonfig.h -all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install installdirs: @@ -471,56 +790,48 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." -rm -f Makefile.in -mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \ - mostlyclean-compile mostlyclean-libtool \ - mostlyclean-noinstPROGRAMS mostlyclean-tags \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \ - clean-libtool clean-noinstPROGRAMS clean-tags \ - clean-generic mostlyclean-am - clean: clean-am -distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \ - distclean-compile distclean-libtool \ - distclean-noinstPROGRAMS distclean-tags \ - distclean-generic clean-am - -rm -f libtool +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + clean-toolexeclibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f config.status -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-toolexeclibLTLIBRARIES \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-noinstPROGRAMS distclean-tags \ + distclean-toolexeclibLTLIBRARIES maintainer-clean: maintainer-clean-am -rm -f config.status -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \ -clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \ -uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool mostlyclean-noinstPROGRAMS \ -distclean-noinstPROGRAMS clean-noinstPROGRAMS \ -maintainer-clean-noinstPROGRAMS tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-info-am install-info \ -all-recursive-am install-exec-am install-exec install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all install-strip installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-noinstPROGRAMS \ + maintainer-clean-toolexeclibLTLIBRARIES + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-noinstPROGRAMS \ + mostlyclean-toolexeclibLTLIBRARIES + +.PHONY: all-redirect check check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS clean-toolexeclibLTLIBRARIES distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-noinstPROGRAMS distclean-tags \ + distclean-toolexeclibLTLIBRARIES 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-strip install-toolexeclibLTLIBRARIES installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic maintainer-clean-noinstPROGRAMS \ + maintainer-clean-toolexeclibLTLIBRARIES mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + mostlyclean-noinstPROGRAMS mostlyclean-toolexeclibLTLIBRARIES \ + tags uninstall uninstall-am uninstall-toolexeclibLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libffi/README b/libffi/README index 4d276bc..3e9154f 100644 --- a/libffi/README +++ b/libffi/README @@ -56,6 +56,8 @@ Libffi has been ported to: PowerPC - Linux (System V ABI) + S390 - Linux (System V ABI) + Sparc, 32-bit - SunOS 4.1.3, Solaris 2.x, and Linux (Sparc v8) Sparc, 64-bit - Linux (Sparc v9) diff --git a/libffi/config-ml.in b/libffi/config-ml.in index 3f88050..8c87918 100644 --- a/libffi/config-ml.in +++ b/libffi/config-ml.in @@ -17,8 +17,6 @@ # . ${srcdir}/../config-ml.in # fi # -# See librx/configure.in in the libg++ distribution for an example of how -# to handle autoconf'd libraries. # # Things are complicated because 6 separate cases must be handled: # 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. @@ -30,13 +28,10 @@ # The build tree is layed out as # # ./ -# libg++ # newlib # m68020/ -# libg++ # newlib # m68881/ -# libg++ # newlib # # The nice feature about this arrangement is that inter-library references @@ -156,7 +151,7 @@ done 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 libg++/src). +# (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 @@ -280,6 +275,17 @@ arm-*-*) 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 ] @@ -464,6 +470,30 @@ powerpc*-*-* | rs6000*-*-*) 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. @@ -494,6 +524,9 @@ multi-do: flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ CXXFLAGS="$(CXXFLAGS) $${flags}" \ LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ @@ -637,7 +670,24 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then echo "pwd: `pwd`" fi - if [ -d ${ml_dir} ]; then true; else mkdir ${ml_dir}; 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 = ../../ @@ -666,7 +716,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then ;; *) case "${srcdir}" in - /*) # absolute path + /* | [A-Za-z]:[\\/]* ) # absolute path ml_newsrcdir=${srcdir} ;; *) # otherwise relative @@ -679,7 +729,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then esac case "${progname}" in - /*) ml_recprog=${progname} ;; + /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;; *) ml_recprog=${dotdot}${progname} ;; esac @@ -688,7 +738,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then cd ${ml_dir}/${ml_libdir} if [ -f ${ml_newsrcdir}/configure ]; then - ml_recprog=${ml_newsrcdir}/configure + ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache" fi # find compiler flag corresponding to ${ml_dir} @@ -699,7 +749,86 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then break fi done - ml_config_env='CC="${CC} $flags"' + ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"' + + if [ "${with_target_subdir}" = "." ]; then + CC_=$CC' ' + CXX_=$CXX' ' + GCJ_=$GCJ' ' + 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 + + 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 + + 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} \ diff --git a/libffi/config.guess b/libffi/config.guess index 20c971a..4a4c2a4 100755 --- a/libffi/config.guess +++ b/libffi/config.guess @@ -2,7 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2000-10-03' + # 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 @@ -36,6 +38,46 @@ # (but try to keep the structure clean). # +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of this system. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$help" + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then @@ -77,7 +119,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in - amiga) machine=m68k-cbm ;; + amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; @@ -173,7 +215,7 @@ EOF echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} @@ -266,7 +308,7 @@ EOF 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 + # "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 @@ -360,7 +402,7 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110] + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] @@ -458,6 +500,8 @@ EOF 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE #include #include @@ -588,7 +632,7 @@ EOF echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos @@ -604,7 +648,7 @@ EOF hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -614,12 +658,6 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - if test -x /usr/bin/objformat; then - if test "elf" = "`/usr/bin/objformat`"; then - echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` - exit 0 - fi - fi echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) @@ -631,6 +669,9 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + 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 @@ -649,13 +690,15 @@ EOF *: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 ;; *: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. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ + ld_supported_emulations=`cd /; ld --help 2>&1 \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// @@ -670,6 +713,9 @@ EOF echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; + elf_i?86) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 @@ -721,11 +767,15 @@ EOF if test "$?" = 0 ; then LIBC="libc1" fi - fi + fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; + shelf_linux) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then @@ -807,14 +857,18 @@ EOF rm -f $dummy.c $dummy elif test "${UNAME_MACHINE}" = "s390"; then echo s390-ibm-linux && exit 0 + elif test "${UNAME_MACHINE}" = "s390x"; then + echo s390x-ibm-linux && exit 0 + elif test "${UNAME_MACHINE}" = "x86_64"; then + echo x86_64-unknown-linux-gnu && exit 0 else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + test -z "$ld_supported_emulations" \ + && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i?86) @@ -851,6 +905,7 @@ EOF EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 fi ;; # 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. @@ -987,7 +1042,7 @@ EOF mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -1018,14 +1073,37 @@ EOF *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; - Power*:Mac*OS:*:*) - echo powerpc-apple-macos${UNAME_RELEASE} + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; - *:Mac*OS:*:*) - echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE} + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) - echo i386-qnx-qnx${UNAME_VERSION} + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + 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 ;; esac @@ -1166,6 +1244,47 @@ then esac fi -#echo '(Unable to guess system type)' 1>&2 +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess version = $version + +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: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/libffi/config.sub b/libffi/config.sub index 5d75624..86351bc 100755 --- a/libffi/config.sub +++ b/libffi/config.sub @@ -2,7 +2,9 @@ # Configuration validation subroutine script, version 1.1. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Free Software Foundation, Inc. -# + +version='2001-04-06' + # 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. @@ -27,7 +29,6 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. @@ -50,30 +51,61 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi +me=`echo "$0" | sed -e 's,.*/,,'` -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -V, --version print version number, then exit" + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case "$1" in + --version | --vers* | -V ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + exec >&2 + echo "$me: invalid option $1" + echo "$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 - linux-gnu*) + nto-qnx* | linux-gnu* | storm-chaos*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -99,7 +131,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple) + -apple | -axis) os= basic_machine=$1 ;; @@ -113,6 +145,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -171,28 +211,36 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm | xscale \ + | arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | we32k | ns16k | clipper | i370 | sh | sh[34] \ + | powerpc | powerpcle \ | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | fr30 | avr) + | thumb | d10v | d30v | fr30 | avr) 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 | z8k | v70 | h8500 | w65 | pj | pjl) ;; # 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[34567]86) + i[234567]86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -202,12 +250,14 @@ case $basic_machine in ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ @@ -217,9 +267,10 @@ case $basic_machine in | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | f301-* | armv*-* | s390-* | s390x-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-* | tic54x-* | c54x-* | x86_64-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -256,14 +307,14 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) @@ -317,6 +368,9 @@ case $basic_machine in crds | unos) basic_machine=m68k-crds ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -471,8 +525,9 @@ case $basic_machine in basic_machine=i386-unknown os=-mingw32 ;; - i386-qnx | qnx) - basic_machine=i386-qnx + i[34567]86-pw32 | pw32) + basic_machine=i586-unknown + os=-pw32 ;; iris | iris4d) basic_machine=mips-sgi @@ -596,6 +651,9 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -628,7 +686,7 @@ case $basic_machine in pentium | p5 | k5 | k6 | nexen) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86) + pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) @@ -637,7 +695,7 @@ case $basic_machine in pentium-* | p5-* | k5-* | k6-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumpro-* | p6-* | 6x86-*) + pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) @@ -752,6 +810,10 @@ case $basic_machine in basic_machine=t3e-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -853,6 +915,9 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; + sh3 | sh4) + basic_machine=sh-unknown + ;; sparc | sparcv9) basic_machine=sparc-sun ;; @@ -875,6 +940,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -931,11 +999,25 @@ case $os in | -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* | -rhapsody* | -opened* | -openstep* | -oskit*) + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -storm-chaos*) # Remember, each alternative MUST END IN *, to match a version number. ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) @@ -982,6 +1064,9 @@ case $os in -ns2 ) os=-nextstep2 ;; + -nsk*) + os=-nsk + ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` @@ -995,9 +1080,6 @@ case $os in -oss*) os=-sysv3 ;; - -qnx) - os=-qnx4 - ;; -svr4) os=-sysv4 ;; @@ -1248,3 +1330,11 @@ case $basic_machine in esac echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "version='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/libffi/configure b/libffi/configure index 6f66793..d27b087 100755 --- a/libffi/configure +++ b/libffi/configure @@ -1628,6 +1628,10 @@ mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; +i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;; +i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;; +i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;; +i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;; sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; @@ -1637,7 +1641,8 @@ ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; -arm-*-linux-*) TARGET=ARM; TARGETDIR=arm;; +arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; +s390-*-linux*) TARGET=S390; TARGETDIR=s390;; esac if test $TARGETDIR = unknown; then @@ -1726,8 +1731,17 @@ else ARM_FALSE= fi + +if test x$TARGET = xS390; then + S390_TRUE= + S390_FALSE='#' +else + S390_TRUE='#' + S390_FALSE= +fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1729: checking how to run the C preprocessor" >&5 +echo "configure:1745: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1742,13 +1756,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1766: \"$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 : @@ -1759,13 +1773,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1783: \"$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 : @@ -1776,13 +1790,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1800: \"$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 : @@ -1807,12 +1821,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1809: checking for ANSI C header files" >&5 +echo "configure:1825: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1820,7 +1834,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1838: \"$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* @@ -1837,7 +1851,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1855,7 +1869,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1876,7 +1890,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1887,7 +1901,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1913,12 +1927,12 @@ fi for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1915: checking for $ac_func" >&5 +echo "configure:1931: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1968,19 +1982,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1970: checking for working alloca.h" >&5 +echo "configure:1986: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2001,12 +2015,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2003: checking for alloca" >&5 +echo "configure:2019: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2066,12 +2080,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2068: checking whether alloca needs Cray hooks" >&5 +echo "configure:2084: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2098: checking for $ac_func" >&5 +echo "configure:2114: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2151,7 +2165,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2153: checking stack direction for C alloca" >&5 +echo "configure:2169: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2159,7 +2173,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2201,7 +2215,7 @@ fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2203: checking size of short" >&5 +echo "configure:2219: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2209,7 +2223,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2220,7 +2234,7 @@ main() exit(0); } EOF -if { (eval echo configure:2222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2240,7 +2254,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2242: checking size of int" >&5 +echo "configure:2258: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2248,7 +2262,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2259,7 +2273,7 @@ main() exit(0); } EOF -if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -2279,7 +2293,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2281: checking size of long" >&5 +echo "configure:2297: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2287,7 +2301,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2298,7 +2312,7 @@ main() exit(0); } EOF -if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2318,7 +2332,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:2320: checking size of long long" >&5 +echo "configure:2336: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2326,7 +2340,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2337,7 +2351,7 @@ main() exit(0); } EOF -if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -2357,7 +2371,7 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:2359: checking size of float" >&5 +echo "configure:2375: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2365,7 +2379,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2376,7 +2390,7 @@ main() exit(0); } EOF -if { (eval echo configure:2378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -2396,7 +2410,7 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:2398: checking size of double" >&5 +echo "configure:2414: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2404,7 +2418,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2415,7 +2429,7 @@ main() exit(0); } EOF -if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -2435,7 +2449,7 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:2437: checking size of long double" >&5 +echo "configure:2453: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2443,7 +2457,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2454,7 +2468,7 @@ main() exit(0); } EOF -if { (eval echo configure:2456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -2475,7 +2489,7 @@ EOF echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:2477: checking size of void *" >&5 +echo "configure:2493: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2483,7 +2497,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2494,7 +2508,7 @@ main() exit(0); } EOF -if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_void_p=`cat conftestval` else @@ -2514,14 +2528,14 @@ EOF echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2516: checking whether byte ordering is bigendian" >&5 +echo "configure:2532: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2532,11 +2546,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2547,7 +2561,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2567,7 +2581,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2846,6 +2860,8 @@ s%@POWERPC_TRUE@%$POWERPC_TRUE%g s%@POWERPC_FALSE@%$POWERPC_FALSE%g s%@ARM_TRUE@%$ARM_TRUE%g s%@ARM_FALSE@%$ARM_FALSE%g +s%@S390_TRUE@%$S390_TRUE%g +s%@S390_FALSE@%$S390_FALSE%g s%@CPP@%$CPP%g s%@ALLOCA@%$ALLOCA%g s%@TARGET@%$TARGET%g diff --git a/libffi/configure.in b/libffi/configure.in index cbc886f..12e8939 100644 --- a/libffi/configure.in +++ b/libffi/configure.in @@ -48,6 +48,10 @@ mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; +i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;; +i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;; +i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;; +i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;; sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; @@ -57,7 +61,8 @@ ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; -arm-*-linux-*) TARGET=ARM; TARGETDIR=arm;; +arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; +s390-*-linux*) TARGET=S390; TARGETDIR=s390;; esac if test $TARGETDIR = unknown; then @@ -73,6 +78,7 @@ AM_CONDITIONAL(IA64, test x$TARGET = xIA64) AM_CONDITIONAL(M68K, test x$TARGET = xM68K) AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC) AM_CONDITIONAL(ARM, test x$TARGET = xARM) +AM_CONDITIONAL(S390, test x$TARGET = xS390) AC_HEADER_STDC AC_CHECK_FUNCS(memcpy) diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in index 3d19b8f..726a04d 100644 --- a/libffi/include/Makefile.in +++ b/libffi/include/Makefile.in @@ -1,6 +1,7 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4d from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# 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. @@ -31,8 +32,6 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -49,6 +48,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : @@ -57,6 +57,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : + +@SET_MAKE@ host_alias = @host_alias@ host_triplet = @host@ AS = @AS@ @@ -91,29 +93,29 @@ CONFIG_CLEAN_FILES = ffi.h DIST_SOURCES = DATA = $(hack_DATA) -DIST_COMMON = $(hack_DATA) Makefile.am Makefile.in ffi.h.in +DIST_COMMON = Makefile.am Makefile.in ffi.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) GZIP_ENV = --best -all: all-redirect +all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status ffi.h: $(top_builddir)/config.status ffi.h.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status install-hackDATA: $(hack_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(hackdir) @list='$(hack_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(hackdir)/$$f"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(hackdir)/$$f; \ @@ -132,15 +134,17 @@ TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pR $$d/$$file $(distdir); \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ else \ test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ fi; \ done info-am: @@ -163,7 +167,6 @@ install: install-am uninstall-am: uninstall-hackDATA uninstall: uninstall-am all-am: Makefile $(DATA) -all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install installdirs: @@ -179,32 +182,31 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." -rm -f Makefile.in -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - clean: clean-am -distclean-am: distclean-generic clean-am - -rm -f libtool +clean-am: clean-generic mostlyclean-am distclean: distclean-am -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +distclean-am: clean-am distclean-generic maintainer-clean: maintainer-clean-am -.PHONY: uninstall-hackDATA install-hackDATA tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all install-strip \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +.PHONY: check check-am clean clean-generic distclean distclean-generic \ + distdir dvi dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-hackDATA \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-hackDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libffi/include/ffi.h.in b/libffi/include/ffi.h.in index 23fe4a9..c6c85fd 100644 --- a/libffi/include/ffi.h.in +++ b/libffi/include/ffi.h.in @@ -1,5 +1,6 @@ /* -----------------------------------------------------------------*-C-*- - libffi 2.00 - Copyright (c) 1996, 1997, 1998, 1999, 2000 Red Hat, Inc. + libffi @VERSION@ - Copyright (C) 1996, 1997, 1998, 1999, 2000, + 2001 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -15,7 +16,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. @@ -41,11 +42,11 @@ More details on the raw and cloure API can be found in: - http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00138.html + http://gcc.gnu.org/ml/java/1999-q3/msg00138.html and - http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00174.html + http://gcc.gnu.org/ml/java/1999-q3/msg00174.html -------------------------------------------------------------------- */ #ifndef LIBFFI_H @@ -79,69 +80,75 @@ extern "C" { #define SINT8 signed char #if SIZEOF_INT == 2 -#define UINT16 unsigned int + +#define UINT16 unsigned int #define SINT16 int #define ffi_type_uint ffi_type_uint16 #define ffi_type_sint ffi_type_sint16 -#endif +#else #if SIZEOF_SHORT == 2 -#undef UINT16 -#undef SINT16 + #define UINT16 unsigned short #define SINT16 short #define ffi_type_ushort ffi_type_uint16 #define ffi_type_sshort ffi_type_sint16 + +#endif #endif #if SIZEOF_INT == 4 -#define UINT32 unsigned int + +#define UINT32 unsigned int #define SINT32 int #define ffi_type_uint ffi_type_uint32 #define ffi_type_sint ffi_type_sint32 -#endif +#else #if SIZEOF_SHORT == 4 -#undef UINT32 -#undef SINT32 + #define UINT32 unsigned short #define SINT32 short #define ffi_type_ushort ffi_type_uint32 #define ffi_type_sshort ffi_type_sint32 -#endif +#else #if SIZEOF_LONG == 4 -#undef UINT32 -#undef SINT32 + #define UINT32 unsigned long #define SINT32 long #define ffi_type_ulong ffi_type_uint32 #define ffi_type_slong ffi_type_sint32 + +#endif +#endif #endif #if SIZEOF_INT == 8 + #define UINT64 unsigned int #define SINT64 int #define ffi_type_uint ffi_type_uint64 #define ffi_type_sint ffi_type_sint64 -#endif +#else #if SIZEOF_LONG == 8 -#undef UINT64 -#undef SINT64 + #define UINT64 unsigned long #define SINT64 long #define ffi_type_ulong ffi_type_uint64 #define ffi_type_slong ffi_type_sint64 -#endif +#else #if SIZEOF_LONG_LONG == 8 -#undef UINT64 -#undef SINT64 + #define UINT64 unsigned long long #define SINT64 long long -#define ffi_type_ulonglong ffi_type_uint64 -#define ffi_type_slonglong ffi_type_sint64 +#define ffi_type_ulong ffi_type_uint64 +#define ffi_type_slong ffi_type_sint64 + +#endif +#endif #endif /* ---- System specific configurations ----------------------------------- */ @@ -189,6 +196,12 @@ typedef enum ffi_abi { FFI_DEFAULT_ABI = FFI_SYSV, #endif + /* ---- Intel x86 Win32 ---------- */ +#ifdef X86_WIN32 + FFI_SYSV, + FFI_DEFAULT_ABI = FFI_SYSV, +#endif + /* ---- Intel ia64 ---------------- */ #ifdef IA64 FFI_UNIX, /* Linux and all Unix variants use the same conventions */ @@ -227,6 +240,12 @@ typedef enum ffi_abi { FFI_DEFAULT_ABI = FFI_SYSV, #endif + /* ---- S390 --------------------- */ +#ifdef S390 + FFI_SYSV, + FFI_DEFAULT_ABI = FFI_SYSV, +#endif + /* Leave this for debugging purposes */ FFI_LAST_ABI @@ -345,6 +364,12 @@ size_t ffi_java_raw_size (ffi_cif *cif); #define FFI_TRAMPOLINE_SIZE 10 #define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ +#elif defined(X86_WIN32) + +#define FFI_CLOSURES 1 /* x86 supports closures */ +#define FFI_TRAMPOLINE_SIZE 10 +#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ + #elif defined(IA64) #define FFI_CLOSURES 1 @@ -360,6 +385,18 @@ struct ffi_ia64_trampoline_struct { }; #define FFI_NATIVE_RAW_API 0 +#elif defined(ALPHA) + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 + +#elif defined(POWERPC) + +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 40 +#define FFI_NATIVE_RAW_API 0 + #else #define FFI_CLOSURES 0 diff --git a/libffi/include/ffi_common.h b/libffi/include/ffi_common.h index a54c44f..2120754 100644 --- a/libffi/include/ffi_common.h +++ b/libffi/include/ffi_common.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- - ffi_common.h - Copyright (c) 1996 Cygnus Solutions + ffi_common.h - Copyright (c) 1996 Red Hat, Inc. - $Id: ffi_common.h,v 1.2 2000/04/17 03:18:45 green Exp $ + $Id: ffi_common.h,v 1.3 2001/04/09 00:58:37 green Exp $ Common internal definitions and macros. Only necessary for building libffi. diff --git a/libffi/include/ffi_mips.h b/libffi/include/ffi_mips.h index 998f564..6fd5647 100644 --- a/libffi/include/ffi_mips.h +++ b/libffi/include/ffi_mips.h @@ -3,8 +3,6 @@ MIPS FFI Definitions - $Id: ffi_mips.h,v 1.2 2000/04/17 03:18:45 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 diff --git a/libffi/install-sh b/libffi/install-sh index 70d2704..e9de238 100755 --- a/libffi/install-sh +++ b/libffi/install-sh @@ -15,9 +15,13 @@ # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # -# This script is compatible with the BSD install script, but was written -# from scratch. +# 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 @@ -114,6 +118,7 @@ if [ x"$dir_arg" != x ]; then if [ -d $dst ]; then instcmd=: + chmodcmd="" else instcmd=mkdir fi diff --git a/libffi/ltconfig b/libffi/ltconfig index ab304fd..c14d83c 100755 --- a/libffi/ltconfig +++ b/libffi/ltconfig @@ -2,7 +2,7 @@ # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# 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 @@ -32,12 +32,8 @@ if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : @@ -46,9 +42,18 @@ else 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=';' ;; @@ -58,9 +63,9 @@ fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi -if test "X${echo_test_string+set}" != "Xset"; 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, ... @@ -82,7 +87,7 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do - if test -f $dir/echo && + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" @@ -97,7 +102,8 @@ if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`(print -r "$echo_test_string") 2>/dev/null`" = 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 "X$CONFIG_SHELL" != X/bin/ksh; then + 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 @@ -163,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool -VERSION=1.2f -TIMESTAMP=" (1.385 1999/03/15 17:24:54)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" +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." @@ -175,10 +181,12 @@ help="Try \`$progname --help' for more information." default_ofile=libtool can_build_shared=yes enable_shared=yes -# All known linkers require a `.a' archive for static linking. +# 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 ltmain= silent= srcdir= @@ -194,17 +202,21 @@ need_locks=yes ac_ext=c objext=o libext=a +exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" +old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. @@ -235,7 +247,7 @@ Generate a system-specific libtool script. --disable-static do not build static libraries --disable-fast-install do not optimize for fast installation --enable-dlopen enable dlopen support - --enable-dlopen-self enable support for dlopening programs + --enable-win32-dll enable building dlls on win32 hosts --help display this help and exit --no-verify do not verify that HOST is a valid host type -o, --output=FILE specify the output file [default=$default_ofile] @@ -269,6 +281,8 @@ EOM --enable-dlopen) enable_dlopen=yes ;; + --enable-win32-dll) enable_win32_dll=yes ;; + --quiet | --silent) silent=yes ;; --srcdir) prev=srcdir ;; @@ -355,8 +369,8 @@ exec 5>>./config.log # 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 "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi +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"; then echo "loading cache $cache_file within ltconfig" @@ -448,7 +462,7 @@ 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 "${COLLECT_NAMES+set}" != set; then + if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -463,6 +477,9 @@ old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar +# Set a sane default for `OBJDUMP'. +test -z "$OBJDUMP" && OBJDUMP=objdump + # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no @@ -471,7 +488,7 @@ if test "${RANLIB+set}" != "set"; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. - if test -f $dir/ranlib; then + if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break @@ -487,8 +504,9 @@ if test -n "$RANLIB"; then old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi -# Set sane defaults for `DLLTOOL' and `AS', used on cygwin. +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. @@ -498,9 +516,8 @@ if test "$with_gcc" != yes || test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do - IFS="$save_ifs" test -z "$dir" && dir=. - if test -f $dir/gcc; then + if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi @@ -521,7 +538,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. - if test -f $dir/cc; then + if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue @@ -561,7 +578,7 @@ if test "$with_gcc" != yes || test -z "$CC"; then # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 - echo "$progname:564: checking whether we are using GNU C" >&5 + echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c @@ -583,8 +600,8 @@ compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c -echo "$progname:586: checking for object suffix" >& 5 -if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then +echo "$progname:603: checking for object suffix" >& 5 +if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 @@ -602,6 +619,38 @@ fi $rm conftest* echo "$ac_t$objext" 1>&6 +echo $ac_n "checking for executable suffix... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_exeext="no" + $rm conftest* + echo 'main () { return 0; }' > conftest.c + echo "$progname:629: checking for executable suffix" >& 5 + if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c | *.err | *.$objext ) ;; + *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; + esac + done + else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* +fi +if test "X$ac_cv_exeext" = Xno; then + exeext="" +else + exeext="$ac_cv_exeext" +fi +echo "$ac_t$ac_cv_exeext" 1>&6 + echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= @@ -614,7 +663,7 @@ if test "$with_gcc" = yes; then link_static_flag='-static' case "$host_os" in - beos* | irix5* | irix6* | osf3* | osf4*) + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) @@ -635,6 +684,11 @@ if test "$with_gcc" = yes; then # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; + sysv4*MP*) + if test -d /usr/nec; then + pic_flag=-Kconform_pic + fi + ;; *) pic_flag='-fPIC' ;; @@ -664,7 +718,7 @@ else # We can build DLLs from non-PIC. ;; - osf3* | osf4*) + osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' @@ -688,7 +742,7 @@ else wl='-Qoption ld ' ;; - sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' @@ -698,7 +752,12 @@ else pic_flag='-pic' link_static_flag='-Bstatic' ;; - + sysv4*MP*) + if test -d /usr/nec ;then + pic_flag='-Kconform_pic' + link_static_flag='-Bstatic' + fi + ;; *) can_build_shared=no ;; @@ -714,8 +773,8 @@ if test -n "$pic_flag"; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" - echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5 - if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 + if { (eval echo $progname:777: \"$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 @@ -753,16 +812,26 @@ fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c +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 -c -o conftest2.o" -echo "$progname:760: checking if $compiler supports -c -o file.o" >&5 -if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then +CFLAGS="$CFLAGS -o out/conftest2.o" +echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 +if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; 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 + if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else @@ -771,12 +840,17 @@ if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conft fi else # Append any errors to the config.log. - cat conftest.err 1>&5 + cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" -$rm conftest* +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo @@ -785,8 +859,8 @@ if test x"$compiler_c_o" = x"yes"; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" - echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5 -if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then + echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 +if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -837,8 +911,8 @@ if test "$with_gcc" = yes; then echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" - echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then + echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -881,8 +955,8 @@ $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" -echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5 -if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 +if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 @@ -894,9 +968,9 @@ $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 - $rm conftestdata - if ln -s X conftestdata 2>/dev/null; then - $rm conftestdata + $rm conftest.dat + if ln -s X conftest.dat 2>/dev/null; then + $rm conftest.dat LN_S="ln -s" else LN_S=ln @@ -914,11 +988,11 @@ if test -z "$LD"; then if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 - echo "$progname:917: checking for ld used by GCC" >&5 + echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. - /* | [A-Za-z]:[\\/]*) + [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` @@ -938,17 +1012,17 @@ if test -z "$LD"; then esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 - echo "$progname:941: checking for GNU ld" >&5 + echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 - echo "$progname:944: checking for non-GNU ld" >&5 + echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog"; then + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. @@ -1007,7 +1081,7 @@ hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no -export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +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= @@ -1015,7 +1089,12 @@ include_expsyms= # 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= +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. case "$host_os" in cygwin* | mingw*) @@ -1027,10 +1106,6 @@ cygwin* | mingw*) fi ;; -freebsd2* | sunos4*) - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - ;; - esac ld_shlibs=yes @@ -1058,18 +1133,21 @@ EOF archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes - ;; - sunos4*) - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - wlarc= - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no + # 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 $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no @@ -1086,25 +1164,70 @@ EOF # 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. - export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~ - sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ - (cd $objdir && $CC -c $soname-ltdll.c)~ - $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' + # Be careful not to strip the DATA tag left by newer dlltools. + export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; - for symbol in `cat $export_symbols`; do - echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ + test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' + # can we support soname and/or expsyms with a.out? -oliva + 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 $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${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 $linkopts' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no ;; *) @@ -1121,7 +1244,20 @@ EOF runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + 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) @@ -1141,35 +1277,45 @@ else ;; aix4*) - allow_undefined_flag= + hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + hardcode_libdir_separator=':' if test "$with_gcc" = yes; then - if strings `${CC} -print-prog-name=collect2` | \ - grep resolve_lib_name >/dev/null + 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 - archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts' + shared_flag='-shared' else - always_export_symbols=yes - archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry' + shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi - hardcode_minus_L=yes - # Though LIBPATH variable hardcodes shlibpath into executable, - # it doesn't affect searching for -l* libraries; this confuses - # tests in mdemo. - hardcode_shlibpath_var=unsupported - hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=' ${wl}-berok' + archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' + archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' + case "$host_os" in aix4.[01]|aix4.[01].*) + # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on + always_export_symbols=yes ;; + esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $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*) @@ -1192,7 +1338,6 @@ else freebsd1*) ld_shlibs=no - can_build_shared=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor @@ -1203,7 +1348,6 @@ else archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes - hardcode_minus_L=no # verified on 2.2.6 hardcode_shlibpath_var=no ;; @@ -1220,31 +1364,27 @@ else archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes - hardcode_minus_L=no hardcode_shlibpath_var=no ;; - hpux9*) - archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10* | hpux11*) - archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts' + hpux9* | hpux10* | hpux11*) + case "$host_os" in + hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; + esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: hardcode_direct=yes - hardcode_minus_L=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${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 $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $linkopts -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=: @@ -1276,21 +1416,41 @@ else old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; - osf3* | osf4*) + osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${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 $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; - sco3.2v5*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes ;; solaris*) @@ -1302,63 +1462,106 @@ else $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' 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 ;; sunos4*) - # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... - if test "$with_gcc" = yes; then - # Use -fPIC here because libgcc is multilibbed - archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' - fi + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; + sysv4) + 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 $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi + 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 $linkopts' - hardcode_direct=no - hardcode_minus_L=no 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 $linkopts' + 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 $linkopts~$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 $linkopts' hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_minus_L=no hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + 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 $linkopts' + hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; *) ld_shlibs=no - can_build_shared=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in - /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. + [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm; then + if test -f $ac_dir/nm || test -f $ac_dir/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 @@ -1416,6 +1619,9 @@ irix*) solaris*) symcode='[BDT]' ;; +sysv4) + symcode='[DFNSTU]' + ;; esac # If we're using GNU nm, then use its standard symbol codes. @@ -1444,11 +1650,11 @@ void nm_test_func(){} main(){nm_test_var='a';nm_test_func();return(0);} EOF - echo "$progname:1447: checking if global_symbol_pipe works" >&5 - if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + echo "$progname:1653: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1654: \"$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:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + if { echo "$progname:1657: 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 @@ -1495,12 +1701,12 @@ EOF #endif EOF # Now try linking the two files. - mv conftest.$objext conftestm.$objext + mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" - LIBS="conftestm.$objext" + LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 @@ -1520,7 +1726,7 @@ EOF echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi - $rm conftest* + $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -1529,7 +1735,11 @@ EOF global_symbol_pipe= fi done -echo "$ac_t$pipe_works" 1>&6 +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= @@ -1542,10 +1752,12 @@ if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && \ - test "$hardcode_minus_L" != no && \ - test "$hardcode_shlibpath_var" != no; then - + 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 @@ -1628,19 +1840,25 @@ beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH + deplibs_check_method=pass_all + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux - library_names_spec='${libname}.so$major ${libname}.so' - soname_spec='${libname}.so' - finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' + 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 - deplibs_check_method='file_magic ELF 32-bit LSB shared object' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so 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 @@ -1648,17 +1866,20 @@ bsdi4*) cygwin* | mingw*) version_type=windows + need_version=no + need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' - deplibs_check_method='file_magic file format pei*-i386.*architecture: i386' - file_magic_cmd='objdump -f' - need_lib_prefix=no + deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= ;; freebsd1*) @@ -1683,13 +1904,23 @@ freebsd*) need_version=yes ;; esac - finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH + case "$host_os" in + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + ;; + esac ;; gnu*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}.so' + 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 ;; @@ -1701,46 +1932,49 @@ hpux9* | hpux10* | hpux11*) need_lib_prefix=no need_version=no 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' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac ;; -irix5*) - version_type=irix - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all? - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so*` - shlibpath_overrides_runpath=no - ;; - -irix6*) +irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - case "$LD" in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; + 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= + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no - # even though /usr/local/lib is always searched, the man-page says - # shared libraries should not be installed there if they use an ABI - # different from -32, so we'd better not search for shared libraries - # there either - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all? + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` + deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. @@ -1755,12 +1989,10 @@ linux-gnu*) 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' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - file_magic_cmd=/usr/bin/file - file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' @@ -1777,7 +2009,7 @@ netbsd*) 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' + 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' @@ -1806,23 +2038,29 @@ os2*) shlibpath_var=LIBPATH ;; -osf3* | osf4*) +osf3* | osf4* | osf5*) version_type=osf + need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH - # deplibs_check_method='pass_all' - # Although pass_all appears to work, it copies symbols from static libraries - # into shared ones and exports them. So, when a program is linked with two - # or more libraries that have got copies of the same symbols, link fails - # This was only tested on osf4: + # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so + deplibs_check_method='pass_all' 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" ;; +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' @@ -1857,15 +2095,28 @@ sunos4*) need_version=yes ;; -sysv4.2uw2* | sysv4.3* | sysv5*) +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 + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; ncr) deplibs_check_method='pass_all' ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + 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]' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + ;; esac ;; @@ -1885,6 +2136,15 @@ dgux*) 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 ;; @@ -1895,6 +2155,17 @@ test "$dynamic_linker" = no && can_build_shared=no # 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* | 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 + if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) @@ -1973,90 +2244,95 @@ if test "x$enable_dlopen" != xyes; then else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1977: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "$progname:2248: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_dlopen=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_dlopen=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:2022: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:2288: checking for dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext < 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() { -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 +#else +dlopen(); +#endif + ; return 0; } EOF -if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_dlopen=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:2059: checking for dld_link in -ldld" >&5 +echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2064,17 +2340,20 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2093,18 +2372,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:2096: checking for shl_load" >&5 +echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; 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() { @@ -2120,7 +2402,7 @@ shl_load(); ; return 0; } EOF -if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -2137,54 +2419,50 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6 -echo "$progname:2141: checking for LoadLibrary" >&5 -if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:2423: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_LoadLibrary=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_LoadLibrary=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi - + fi @@ -2207,17 +2485,17 @@ fi 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:2210: checking for $ac_hdr" >&5 +echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF -ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2498: \"$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* @@ -2245,7 +2523,7 @@ done LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:2248: checking whether a program can dlopen itself" >&5 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2253,7 +2531,7 @@ else lt_cv_dlopen_self=cross else cat > conftest.c < @@ -2296,10 +2574,10 @@ else fnord() { int i=42;} 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) exit(0); } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else @@ -2318,7 +2596,7 @@ 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:2321: checking whether a statically linked program can dlopen itself" >&5 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2326,7 +2604,7 @@ else lt_cv_dlopen_self_static=cross else cat > conftest.c < @@ -2369,10 +2647,10 @@ else fnord() { int i=42;} 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) exit(0); } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF -if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo $progname:2653: \"$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 @@ -2416,8 +2694,10 @@ LTCONFIG_VERSION="$VERSION" case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. - for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ + AR CC 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 \ @@ -2462,7 +2742,7 @@ case "$ltmain" in # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# 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 @@ -2488,7 +2768,7 @@ Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF @@ -2497,8 +2777,9 @@ EOF *) # Double-quote the variables that need it (for aesthetics). - for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ - old_LN_S old_DLLTOOL old_AS; do + for var in old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done @@ -2518,8 +2799,9 @@ cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ -# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for @@ -2565,6 +2847,9 @@ NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + # Used on cygwin: assembler. AS="$AS" @@ -2584,10 +2869,13 @@ objext="$objext" # Old archive suffix (normally "a"). libext="$libext" +# Executable file suffix (normally ""). +exeext="$exeext" + # Additional compiler flags for building library objects. pic_flag=$pic_flag -# Does compiler simultaneously support -c and -o options +# Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? @@ -2657,7 +2945,7 @@ postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method -# Command to use when deplibs_check_method == file_magic +# 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. @@ -2718,16 +3006,16 @@ 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 +# Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols -# The command to extract exported symbols +# The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds -# Symbols that should not be listed in the preloaded symbols +# Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms -# Symbols that must always be exported +# Symbols that must always be exported. include_expsyms=$include_expsyms EOF @@ -2743,7 +3031,7 @@ case "$ltmain" in # 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 "${COLLECT_NAMES+set}" != set; then +if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -2752,7 +3040,11 @@ EOF esac # Append the ltmain.sh script. - cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; diff --git a/libffi/ltmain.sh b/libffi/ltmain.sh index 878787a..766732d 100644 --- a/libffi/ltmain.sh +++ b/libffi/ltmain.sh @@ -2,7 +2,7 @@ # NOTE: Changing this file will not affect anything until you rerun ltconfig. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. -# Gordon Matzigkeit , 1996 +# 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 @@ -28,12 +28,8 @@ if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`" = 'X\t'; then # Yippee, $echo works! : @@ -42,6 +38,15 @@ else exec $SHELL "$0" --no-reexec ${1+"$@"} fi +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat < # +# #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 @@ -783,8 +808,8 @@ compiler." allow_undefined=yes ;; esac - compile_command="$CC" - finalize_command="$CC" + compile_command="$nonopt" + finalize_command="$nonopt" compile_rpath= finalize_rpath= @@ -818,6 +843,7 @@ compiler." ltlibs= module=no objs= + prefer_static_libs=no preload=no prev= prevarg= @@ -834,11 +860,21 @@ compiler." do case "$arg" in -all-static | -static) - if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi fi build_libtool_libs=no build_old_libs=yes + prefer_static_libs=yes break ;; esac @@ -871,18 +907,32 @@ compiler." 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 ;; *) - dlprefiles="$dlprefiles $arg" - test "$prev" = dlfiles && dlfiles="$dlfiles $arg" + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi prev= ;; esac @@ -906,13 +956,26 @@ compiler." prev= continue ;; - rpath) - rpath="$rpath $arg" - prev= - continue - ;; - xrpath) - xrpath="$xrpath $arg" + rpath | xrpath) + # We need an absolute path. + case "$arg" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi prev= continue ;; @@ -931,7 +994,6 @@ compiler." if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static fi continue ;; @@ -958,22 +1020,16 @@ compiler." ;; -export-dynamic) - if test "$export_dynamic" != yes; then - export_dynamic=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi + export_dynamic=yes + continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: cannot have more than one -exported-symbols" + $echo "$modename: not more than one -exported-symbols argument allowed" exit 1 fi - if test "$arg" = "-export-symbols"; then + if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex @@ -982,14 +1038,18 @@ compiler." ;; -L*) - dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'` + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. case "$dir" in - /* | [A-Za-z]:[/\\]*) - # Add the corresponding hardcode_libdir_flag, if it is not identical. - ;; + [\\/]* | [A-Za-z]:[\\/]*) ;; *) - $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2 - exit 1 + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" + fi + dir="$absdir" ;; esac case " $deplibs " in @@ -1013,20 +1073,29 @@ compiler." ;; -l*) + if test "$arg" = "-lc"; then + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) + # These systems don't actually have c library (as such) + continue + ;; + esac + elif test "$arg" = "-lm"; then + case "$host" in + *-*-cygwin* | *-*-beos*) + # These systems don't actually have math library (as such) + continue + ;; + esac + fi deplibs="$deplibs $arg" ;; -module) - if test "$module" != yes; then - module=yes - if test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - else - arg= - fi - fi + module=yes + continue ;; - + -no-undefined) allow_undefined=no continue @@ -1050,7 +1119,19 @@ compiler." ;; -R*) - xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'` + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case "$dir" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac continue ;; @@ -1059,7 +1140,6 @@ compiler." if test -z "$pic_flag" && test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" - dlopen_self=$dlopen_self_static fi continue ;; @@ -1131,6 +1211,7 @@ compiler." # it will not redefine variable installed. installed=yes + # Read the .la file # If there is no directory component, then add one. case "$arg" in */* | *\\*) . $arg ;; @@ -1163,7 +1244,7 @@ compiler." fi if test -n "$dependency_libs"; then - # Extract -R from dependency_libs + # Extract -R and -L from dependency_libs temp_deplibs= for deplib in $dependency_libs; do case "$deplib" in @@ -1175,7 +1256,13 @@ compiler." -L*) case "$compile_command $temp_deplibs " in *" $deplib "*) ;; *) temp_deplibs="$temp_deplibs $deplib";; - esac;; + esac + temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` + case " $lib_search_path " in + *" $temp_dir "*) ;; + *) lib_search_path="$lib_search_path $temp_dir";; + esac + ;; *) temp_deplibs="$temp_deplibs $deplib";; esac done @@ -1221,7 +1308,8 @@ compiler." prev= fi - if test "$build_libtool_libs" = yes && test -n "$library_names"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then link_against_libtool_libs="$link_against_libtool_libs $arg" if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. @@ -1233,12 +1321,13 @@ compiler." # We need an absolute path. case "$dir" in - /* | [A-Za-z]:[/\\]*) absdir="$dir" ;; + [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2 - exit 1 + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" fi ;; esac @@ -1247,24 +1336,24 @@ compiler." # Skip directories that are in the system default run-time # search path, unless they have been requested with -R. case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; + *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; - esac + esac case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; + *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; - esac + esac lib_linked=yes case "$hardcode_action" in @@ -1422,6 +1511,12 @@ compiler." exit 1 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%^.*/%%'` @@ -1444,7 +1539,7 @@ compiler." $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi @@ -1464,7 +1559,7 @@ compiler." $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi - if test -n "$export_symbols"; then + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi @@ -1503,11 +1598,6 @@ compiler." output_objdir="$output_objdir/$objdir" fi - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - if test -n "$objs"; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 exit 1 @@ -1519,7 +1609,7 @@ compiler." exit 1 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 fi @@ -1702,9 +1792,13 @@ compiler." dependency_libs="$deplibs" case "$host" in - *-*-cygwin* | *-*-mingw* | *-*-os2*) + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; + *-*-rhapsody*) + # rhapsody is a little odd... + deplibs="$deplibs -framework System" + ;; *) # Add libc to deplibs on all other systems. deplibs="$deplibs -lc" @@ -1750,12 +1844,13 @@ compiler." droppeddeps=no case "$deplibs_check_method" in pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. newdeplibs=$deplibs - ;; # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. + ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it @@ -1766,7 +1861,7 @@ compiler." int main() { return 0; } EOF $rm conftest - $C_compiler -o conftest conftest.c $deplibs + $CC -o conftest conftest.c $deplibs if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do @@ -1799,24 +1894,24 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" ; then $rm conftest - $C_compiler -o conftest conftest.c $i + $CC -o conftest conftest.c $i # Did it work? if test $? -eq 0 ; then ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi else droppeddeps=yes echo @@ -1830,7 +1925,6 @@ EOF fi done fi - deplibs=$newdeplibs ;; file_magic*) set dummy $deplibs_check_method @@ -1844,7 +1938,7 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. - if ls -lLd "$potlib" 2>/dev/null \ + if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi @@ -1857,11 +1951,11 @@ EOF while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case "$potliblink" in - /*) potlib="$potliblink";; + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done - if eval $file_magic_cmd \"\$potlib\" \ + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" @@ -1884,7 +1978,8 @@ EOF fi done # Gone through all deplibs. ;; - none | unknown | *) newdeplibs="" + none | unknown | *) + newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then @@ -1926,21 +2021,23 @@ EOF else build_libtool_libs=no fi - dlname= - library_names= 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." fi fi + # Done checking deplibs! + deplibs=$newdeplibs fi - # test again, we may have decided not to build it any more + # 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 - deplibs=$newdeplibs - # Done checking deplibs! - # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names @@ -1960,52 +2057,30 @@ EOF done # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) incase we are running --disable-static + # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do - oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` - test -f $oldobj || ${LN_S} $obj $oldobj + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - if test -n "$whole_archive_flag_spec"; then - if test -n "$convenience"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - else - for xlib in $convenience; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - - linkopts="$linkopts $flag" - fi - # 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="$objdir/$libname.exp" + export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2028,6 +2103,51 @@ EOF $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linkopts="$linkopts $flag" + fi + # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" @@ -2068,7 +2188,7 @@ EOF $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi - if test -n "$dlfiles$dlprefiles"; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi @@ -2106,8 +2226,58 @@ EOF # Delete the old objects. $run $rm $obj $libobj + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + # Create the old-style object. - reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" output="$obj" eval cmds=\"$reload_cmds\" @@ -2120,9 +2290,21 @@ EOF IFS="$save_ifs" # Exit if we aren't doing a library object file. - test -z "$libobj" && exit 0 + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" @@ -2132,7 +2314,7 @@ EOF if test -n "$pic_flag"; then # Only do commands if we really have different PIC objects. - reload_objs="$libobjs" + reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2146,8 +2328,21 @@ EOF # Just create a symlink. $show $rm $libobj $run $rm $libobj - $show "$LN_S $obj $libobj" - $run $LN_S $obj $libobj || exit $? + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop fi exit 0 @@ -2170,11 +2365,6 @@ EOF fi fi - if test "$dlself" = yes && test "$export_dynamic" = no; then - $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2 - exit 1 - fi - if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do @@ -2210,7 +2400,6 @@ EOF fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" fi elif test -n "$runpath_var"; then @@ -2247,7 +2436,6 @@ EOF fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" fi elif test -n "$runpath_var"; then @@ -2272,6 +2460,16 @@ EOF output_objdir="$output_objdir/$objdir" fi + # Create the binary in the object directory, then wrap it. + 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 + 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` @@ -2279,7 +2477,7 @@ EOF fi dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else @@ -2292,24 +2490,15 @@ EOF "") ;; *.c) # Discover the nlist of each of the dlfiles. - nlist="$objdir/${output}.nm" + nlist="$output_objdir/${outputname}.nm" - if test -d $objdir; then - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - else - $show "$mkdir $objdir" - $run $mkdir $objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. - $show "creating $objdir/$dlsyms" + $show "creating $output_objdir/$dlsyms" - $echo > "$objdir/$dlsyms" "\ + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ @@ -2326,7 +2515,7 @@ extern \"C\" { if test "$dlself" = yes; then $show "generating symbol list for \`$output'" - echo ': @PROGRAM@ ' > "$nlist" + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` @@ -2347,13 +2536,12 @@ extern \"C\" { # Prepare the list of exported symbols if test -z "$export_symbols"; then - export_symbols="$objdir/$output.exp" + export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else - $run $rm $export_symbols - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"' - $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi @@ -2429,26 +2617,35 @@ static const void *lt_preloaded_setup() { fi pic_flag_for_symtable= - case "$host" in + 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*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. - $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -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@%$objdir/${output}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"` + 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 @@ -2473,7 +2670,15 @@ static const void *lt_preloaded_setup() { # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" - exit $? + 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 @@ -2481,7 +2686,7 @@ static const void *lt_preloaded_setup() { rpath= for dir in $temp_rpath; do case "$dir" in - /* | [A-Za-z]:[/\\]*) + [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; @@ -2527,7 +2732,6 @@ static const void *lt_preloaded_setup() { link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" - # AGH! Flame the AIX and HP-UX people for me, will ya? $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else @@ -2548,17 +2752,7 @@ static const void *lt_preloaded_setup() { # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi - - # Delete the old output file. + # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" @@ -2575,7 +2769,7 @@ static const void *lt_preloaded_setup() { # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case "$0" in - /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";; + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` @@ -2612,7 +2806,7 @@ sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" @@ -2652,7 +2846,7 @@ else # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in - /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;; + [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi @@ -2737,13 +2931,21 @@ else # Run the actual program with our arguments. " case $host in - *-*-cygwin* | *-*-mingw | *-*-os2*) # win32 systems need to use the prog path for dll # lookup to work + *-*-cygwin*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; + *) $echo >> $output "\ # Export the path to the program. @@ -2790,31 +2992,65 @@ fi\ addlibs="$old_convenience" fi - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - xdir="$xlib"x - generated="$generated $xdir" - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" status=$? - if test $status -ne 0 && test ! -d "$xdir"; then + if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi - $show "(cd $xdir && $AR x ../$xlib)" - $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $? + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" - oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else + # Ensure that we have .o objects in place in case we decided + # not to build a shared library, and have fallen back to building + # static libs even though --disable-static was passed! + for oldobj in $oldobjs; do + if test ! -f $oldobj; then + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? + fi + done + eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' @@ -2848,9 +3084,20 @@ fi\ # Only create the output if not a dry run. if test -z "$run"; then - $echo > $output "\ -# $output - a libtool library file + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + fi + $rm $output + $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='$dlname' @@ -2870,15 +3117,12 @@ age=$age revision=$revision # Is this an already installed library? -installed=no +installed=$installed # Directory that this library needs to be installed in: libdir='$install_libdir'\ " - - $rm "$output_objdir/$outputname"i - sed 's/^installed=no$/installed=yes/' \ - < "$output" > "$output_objdir/$outputname"i || exit 1 + done fi # Do a symbolic link so that the libtool archive can be found in @@ -3015,7 +3259,7 @@ libdir='$install_libdir'\ fi fi case "$destdir" in - /* | [A-Za-z]:[/\\]*) ;; + [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case "$file" in @@ -3091,13 +3335,11 @@ libdir='$install_libdir'\ # Install the shared library and build the symlinks. $show "$install_prog $dir/$realname $destdir/$realname" $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - test "X$dlname" = "X$realname" && dlname= if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do - test "X$dlname" = "X$linkname" && dlname= if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" @@ -3105,12 +3347,6 @@ libdir='$install_libdir'\ done fi - if test -n "$dlname"; then - # Install the dynamically-loadable library. - $show "$install_prog $dir/$dlname $destdir/$dlname" - $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $? - fi - # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" @@ -3126,12 +3362,6 @@ libdir='$install_libdir'\ # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i - if test ! -f "$instname"; then - # Just in case it was removed... - $show "Creating $instname" - $rm "$instname" - sed 's/^installed=no$/installed=yes/' "$file" > "$instname" - fi $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? @@ -3229,21 +3459,29 @@ libdir='$install_libdir'\ outputname= if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes; then - outputname="/tmp/$$-$file" + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 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 + ${rm}r "$tmpdir" continue fi file="$outputname" else - $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 + $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. @@ -3253,7 +3491,7 @@ libdir='$install_libdir'\ $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && $rm $outputname + test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done @@ -3479,8 +3717,10 @@ libdir='$install_libdir'\ done if test -z "$run"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then @@ -3497,8 +3737,10 @@ libdir='$install_libdir'\ exit 1 else # Display what would be done. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi $echo "$cmd$args" exit 0 fi @@ -3540,9 +3782,7 @@ libdir='$install_libdir'\ # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" - test "X$n" = "X$dlname" && dlname= done - test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname" test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles" @@ -3721,6 +3961,8 @@ The following components of LINK-COMMAND are treated specially: -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 @@ -3751,7 +3993,7 @@ is created, otherwise an executable program is created." ;; uninstall) - $echo + $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. diff --git a/libffi/missing b/libffi/missing index dc01d27..7789652 100755 --- a/libffi/missing +++ b/libffi/missing @@ -41,9 +41,11 @@ Supported PROGRAM values: autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc touch file \`y.tab.c'" + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) @@ -58,7 +60,7 @@ Supported PROGRAM values: aclocal) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -67,7 +69,7 @@ WARNING: \`$1' is missing on your system. It should be needed only if autoconf) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -76,36 +78,90 @@ WARNING: \`$1' is missing on your system. It should be needed only if autoheader) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - touch config.h.in + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + 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 missing on your system. It should be needed only if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. 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$/touch \1.in/' \ - | sh + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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." - touch y.tab.c + 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 missing on your system. 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 ;; makeinfo) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if +WARNING: \`$1' is missing on your system. 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, diff --git a/libffi/mkinstalldirs b/libffi/mkinstalldirs index cd1fe0a..cc8783e 100755 --- a/libffi/mkinstalldirs +++ b/libffi/mkinstalldirs @@ -2,12 +2,12 @@ # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 +# Last modified: 1994-03-25 # Public domain errstatus=0 -for file -do +for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift @@ -20,7 +20,11 @@ do if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi + + if test ! -d "$pathcomp"; then + errstatus=$lasterr fi pathcomp="$pathcomp/" diff --git a/libffi/src/Makefile.am b/libffi/src/Makefile.am index 3047f45..d791042 100644 --- a/libffi/src/Makefile.am +++ b/libffi/src/Makefile.am @@ -27,6 +27,7 @@ TARGET_SRC_ALPHA = alpha/ffi.c alpha/osf.S TARGET_SRC_M68K = m68k/ffi.c m68k/sysv.S TARGET_SRC_POWERPC = powerpc/ffi.c powerpc/sysv.S TARGET_SRC_ARM = arm/sysv.S arm/ffi.c +TARGET_SRC_S390 = s390/sysv.S s390/ffi.c ##libffi_la_SOURCES = debug.c prep_cif.c types.c $(TARGET_SRC_@TARGET@) ## Work around automake deficiency diff --git a/libffi/src/alpha/ffi.c b/libffi/src/alpha/ffi.c index 3633ebc..a0becb3 100644 --- a/libffi/src/alpha/ffi.c +++ b/libffi/src/alpha/ffi.c @@ -3,8 +3,6 @@ Alpha Foreign Function Interface - $Id: ffi.c,v 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 @@ -30,170 +28,220 @@ #include -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ +extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)()); +extern void ffi_closure_osf(void); + -static void -ffi_prep_args(char *stack, extended_cif *ecif, int bytes, int flags) +ffi_status +ffi_prep_cif_machdep(ffi_cif *cif) { - register long i, avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - /* To streamline things in the assembly code, we always allocate 12 - words for loading up the int and fp argument registers. The layout - is as when processing varargs: the 6 fp args, the 6 int args, then - the incoming stack. ARGP points to the first int slot. */ - argp = stack + 6 * SIZEOF_ARG; - memset (stack, 0, 12 * SIZEOF_ARG); - - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) + /* Adjust cif->bytes to represent a minimum 6 words for the temporary + register argument loading area. */ + if (cif->bytes < 6*SIZEOF_ARG) + cif->bytes = 6*SIZEOF_ARG; + + /* Set the return type flag */ + switch (cif->rtype->type) { - *(void **) argp = ecif->rvalue; - argp += sizeof(void *); + 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*SIZEOF_ARG); + + if (cif->flags == FFI_TYPE_STRUCT) + *(void **) argp++ = rvalue; i = 0; - avn = ecif->cif->nargs; - p_arg = ecif->cif->arg_types; - p_argv = ecif->avalue; + avn = cif->nargs; + arg_types = cif->arg_types; + while (i < avn) { - size_t z = ALIGN((*p_arg)->size, SIZEOF_ARG); - - switch ((*p_arg)->type) + switch ((*arg_types)->type) { case FFI_TYPE_SINT8: - *(SINT64 *) argp = *(SINT8 *)(* p_argv); + *(SINT64 *) argp = *(SINT8 *)(* avalue); break; case FFI_TYPE_UINT8: - *(UINT64 *) argp = *(UINT8 *)(* p_argv); + *(SINT64 *) argp = *(UINT8 *)(* avalue); break; case FFI_TYPE_SINT16: - *(SINT64 *) argp = *(SINT16 *)(* p_argv); + *(SINT64 *) argp = *(SINT16 *)(* avalue); break; case FFI_TYPE_UINT16: - *(UINT64 *) argp = *(UINT16 *)(* p_argv); + *(SINT64 *) argp = *(UINT16 *)(* avalue); break; case FFI_TYPE_SINT32: - *(SINT64 *) argp = *(SINT32 *)(* p_argv); - break; - case FFI_TYPE_UINT32: - *(UINT64 *) argp = *(UINT32 *)(* p_argv); + /* 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 *)(* p_argv); + *(UINT64 *) argp = *(UINT64 *)(* avalue); break; case FFI_TYPE_FLOAT: - if (argp - stack < 12 * SIZEOF_ARG) + if (argp - stack < 6) { /* Note the conversion -- all the fp regs are loaded as doubles. The in-register format is the same. */ - *(double *) (argp - 6 * SIZEOF_ARG) = *(float *)(* p_argv); + *(double *) argp = *(float *)(* avalue); } else - *(float *) argp = *(float *)(* p_argv); + *(float *) argp = *(float *)(* avalue); break; case FFI_TYPE_DOUBLE: - if (argp - stack < 12 * SIZEOF_ARG) - *(double *) (argp - 6 * SIZEOF_ARG) = *(double *)(* p_argv); - else - *(double *) argp = *(double *)(* p_argv); + *(double *) argp = *(double *)(* avalue); break; case FFI_TYPE_STRUCT: - memcpy(argp, *p_argv, (*p_arg)->size); + memcpy(argp, *avalue, (*arg_types)->size); break; default: FFI_ASSERT(0); } - argp += z; - i++, p_arg++, p_argv++; + argp += ALIGN((*arg_types)->size, SIZEOF_ARG) / SIZEOF_ARG; + i++, arg_types++, avalue++; } + + ffi_call_osf(stack, cif->bytes, cif->flags, rvalue, fn); } -/* Perform machine dependent cif processing */ + ffi_status -ffi_prep_cif_machdep(ffi_cif *cif) +ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data) { - /* Adjust cif->bytes. to include 12 words for the temporary register - argument loading area. This will be removed before the call. */ - - cif->bytes += 6*SIZEOF_ARG; - if (cif->bytes < 12*SIZEOF_ARG) - cif->bytes = 12*SIZEOF_ARG; + unsigned int *tramp; - /* The stack must be double word aligned, so round bytes up - appropriately. */ + FFI_ASSERT (cif->abi == FFI_OSF); - cif->bytes = ALIGN(cif->bytes, 2*sizeof(void*)); + 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; - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - cif->flags = cif->rtype->type; - break; + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; - case FFI_TYPE_FLOAT: - cif->flags = FFI_TYPE_FLOAT; - break; + /* Flush the Icache. */ + asm volatile ("imb" : : : "memory"); - case FFI_TYPE_DOUBLE: - cif->flags = FFI_TYPE_DOUBLE; - break; - - default: - cif->flags = FFI_TYPE_INT; - break; - } - return FFI_OK; } -extern int ffi_call_osf(void (*)(char *, extended_cif *, int, int), - extended_cif *, unsigned, - unsigned, unsigned *, void (*)()); - -void -ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue) +int +ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp) { - extended_cif ecif; + ffi_cif *cif; + void **avalue; + ffi_type **arg_types; + long i, avn, argn; - 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. */ + 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; - if (rvalue == NULL && cif->rtype->type == FFI_TYPE_STRUCT) - ecif.rvalue = alloca(cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch (cif->abi) + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) { - case FFI_OSF: - ffi_call_osf(ffi_prep_args, &ecif, cif->bytes, - cif->flags, rvalue, fn); - break; + 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; - default: - FFI_ASSERT(0); - 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, SIZEOF_ARG) / 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; } diff --git a/libffi/src/alpha/osf.S b/libffi/src/alpha/osf.S index 9856b36..b3dc477 100644 --- a/libffi/src/alpha/osf.S +++ b/libffi/src/alpha/osf.S @@ -3,8 +3,6 @@ Alpha/OSF Foreign Function Interface - $Id: osf.S,v 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 @@ -28,91 +26,252 @@ #define LIBFFI_ASM #include -#define callback $16 -#define ecifp $17 -#define bytes $18 -#define flags $19 -#define raddr $20 -#define fn $21 + .arch ev6 + .text -#define flags_ofs 16 -#define raddr_ofs 24 -#define fn_ofs 32 +/* ffi_call_osf (void *args, unsigned long bytes, unsigned flags, + void *raddr, void (*fnaddr)()); -#define SIZEOF_FRAME (6*8) + 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. */ - .text - .align 4 + .align 3 .globl ffi_call_osf .ent ffi_call_osf - ffi_call_osf: - lda $30, -SIZEOF_FRAME($30) - stq $26, 0($30) - stq $15, 8($30) - stq flags, flags_ofs($30) - stq raddr, raddr_ofs($30) - stq fn, fn_ofs($30) - mov $30, $15 - .frame $15, SIZEOF_FRAME, $26, 0 - .mask 0x4008000, -SIZEOF_FRAME + .frame $15, 32, $26, 0 + .mask 0x4008000, -32 + addq $16,$17,$1 + mov $16, $30 + stq $26, 0($1) + stq $15, 8($1) + stq $18, 16($1) + mov $1, $15 .prologue 0 - mov callback, $27 # mov callback into place - subq $30, bytes, $30 # allocate stack space - - # Call ffi_prep_args; ecif, bytes and flags are already in place. - mov $30, $16 # push stack arg - jsr $26, ($27), 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 $16, 48($30) - ldq $17, 56($30) - ldq $18, 64($30) - ldq $19, 72($30) - ldq $20, 80($30) - ldq $21, 88($30) - - # Get rid of the arg reg temp space and call the function. - ldq $27, fn_ofs($15) - lda $30, 12*8($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 raddr, raddr_ofs($15) - beq raddr, $noretval + ldq $19, 24($15) + ldq $18, 16($15) + ldq $26, 0($15) + beq $19, $noretval - ldq flags, flags_ofs($15) - cmpeq flags, FFI_TYPE_INT, $1 + # Store the return value out in the proper type. + cmpeq $18, FFI_TYPE_INT, $1 bne $1, $retint - cmpeq flags, FFI_TYPE_FLOAT, $2 + cmpeq $18, FFI_TYPE_FLOAT, $2 bne $2, $retfloat - cmpeq flags, FFI_TYPE_DOUBLE, $3 + cmpeq $18, FFI_TYPE_DOUBLE, $3 bne $3, $retdouble - br $retstruct - - .align 3 + +$noretval: + ldq $15, 8($15) + ret + $retint: - stq $0, 0(raddr) - br $noretval + stq $0, 0($19) + nop + ldq $15, 8($15) + ret + $retfloat: - sts $f0, 0(raddr) - br $noretval -$retdouble: - stt $f0, 0(raddr) + sts $f0, 0($19) + nop + ldq $15, 8($15) + ret -$retstruct: -$noretval: - mov $15, $30 - ldq $26, 0($15) +$retdouble: + stt $f0, 0($19) + nop ldq $15, 8($15) - lda $30, SIZEOF_FRAME($30) ret .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 + ldgp $29, 0($27) + subq $30, 16*8, $30 + stq $26, 0($30) + .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 + + .end ffi_closure_osf + +.section .rodata +$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 diff --git a/libffi/src/arm/ffi.c b/libffi/src/arm/ffi.c index 40bd5d8..0ede742 100644 --- a/libffi/src/arm/ffi.c +++ b/libffi/src/arm/ffi.c @@ -3,8 +3,6 @@ ARM Foreign Function Interface - $Id: ffi.c,v 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 diff --git a/libffi/src/arm/sysv.S b/libffi/src/arm/sysv.S index 21d2f23..84744d7 100644 --- a/libffi/src/arm/sysv.S +++ b/libffi/src/arm/sysv.S @@ -3,8 +3,6 @@ ARM Foreign Function Interface - $Id: sysv.S,v 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 @@ -97,19 +95,13 @@ ENTRY(ffi_call_SYSV) beq epilogue # return FLOAT - cmp a4, #FFI_TYPE_FLOAT - bne retdouble - stfs f0, [a3] - b epilogue + cmp a4, #FFI_TYPE_FLOAT + stfeqs f0, [a3] + beq epilogue # return DOUBLE or LONGDOUBLE -retdouble: - cmp a4, #FFI_TYPE_DOUBLE - bne epilogue - - stfs f0, [a3, #0] - stfs f1, [a3, #4] - b epilogue + cmp a4, #FFI_TYPE_DOUBLE + stfeqd f0, [a3] epilogue: ldmfd sp!, {a1-a4, fp, pc} diff --git a/libffi/src/debug.c b/libffi/src/debug.c index 67319d7..17196ba 100644 --- a/libffi/src/debug.c +++ b/libffi/src/debug.c @@ -1,7 +1,5 @@ /* ----------------------------------------------------------------------- - debug.c - Copyright (c) 1996 Cygnus Solutions - - $Id: debug.c,v 1.1 1998/11/29 16:48:16 green Exp $ + 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 @@ -17,7 +15,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. diff --git a/libffi/src/ffitest.c b/libffi/src/ffitest.c index 33e4135..ca7db26 100644 --- a/libffi/src/ffitest.c +++ b/libffi/src/ffitest.c @@ -1,8 +1,6 @@ /* ----------------------------------------------------------------------- ffitest.c - Copyright (c) 1996, 1997, 1998 Cygnus Solutions - $Id: ffitest.c,v 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 @@ -17,7 +15,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. @@ -196,6 +194,16 @@ static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2) return ts1; } +/* Take an int and a float argument, together with int userdata, and */ +/* return the sum. */ +static void closure_test_fn(ffi_cif* cif,void* resp,void** args, void* userdata) +{ + *(int*)resp = + *(int *)args[0] + (int)(*(float *)args[1]) + (int)(long)userdata; +} + +typedef int (*closure_test_type)(int, float); + int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) { ffi_cif cif; @@ -214,7 +222,7 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) signed int si1; signed int si2; -#if defined(ALPHA) || (defined(MIPS) && (_MIPS_SIM == _ABIN32)) +#if defined(ALPHA) || defined(IA64) || defined(SPARC64) || (defined(MIPS) && (_MIPS_SIM == _ABIN32)) long long rint; #else int rint; @@ -285,7 +293,7 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) /* return value tests */ { -#if defined(MIPS) || defined(SPARC) /* || defined(ARM) */ +#if defined(MIPS) /* || defined(ARM) */ puts ("long long tests not run. This is a known bug on this architecture."); #else args[0] = &ffi_type_sint64; @@ -533,6 +541,8 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) printf("%lu promotion tests run\n", ul); } +#ifndef X86_WIN32 /* Structures dont work on Win32 */ + /* struct tests */ { test_structure_1 ts1_arg; @@ -691,6 +701,31 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) free (ts5_result); } +#else + printf("Structure passing doesn't work on Win32.\n"); +#endif /* X86_WIN32 */ + +# if FFI_CLOSURES + /* A simple closure test */ + { + ffi_closure cl; + ffi_type * cl_arg_types[3]; + + cl_arg_types[0] = &ffi_type_sint; + cl_arg_types[1] = &ffi_type_float; + cl_arg_types[2] = NULL; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, + &ffi_type_sint, cl_arg_types) == FFI_OK); + + CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn, + (void *) 3 /* userdata */) + == FFI_OK); + CHECK((*((closure_test_type)(&cl)))(1, 2.0) == 6); + } +# endif + /* If we arrived here, all is good */ (void) puts("\nLooks good. No surprises.\n"); diff --git a/libffi/src/java_raw_api.c b/libffi/src/java_raw_api.c index 5f85582..d330507 100644 --- a/libffi/src/java_raw_api.c +++ b/libffi/src/java_raw_api.c @@ -22,7 +22,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. diff --git a/libffi/src/mips/ffi.c b/libffi/src/mips/ffi.c index 755eb6d..ca3971f 100644 --- a/libffi/src/mips/ffi.c +++ b/libffi/src/mips/ffi.c @@ -3,8 +3,6 @@ MIPS Foreign Function Interface - $Id: ffi.c,v 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 diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S index 81a9b95..04b5e40 100644 --- a/libffi/src/mips/n32.S +++ b/libffi/src/mips/n32.S @@ -3,8 +3,6 @@ MIPS Foreign Function Interface - $Id: n32.S,v 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 diff --git a/libffi/src/mips/o32.S b/libffi/src/mips/o32.S index 209c9c6..4dfb2ba 100644 --- a/libffi/src/mips/o32.S +++ b/libffi/src/mips/o32.S @@ -3,8 +3,6 @@ MIPS Foreign Function Interface - $Id: o32.S,v 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 diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c index 42d6660..05454d5 100644 --- a/libffi/src/powerpc/ffi.c +++ b/libffi/src/powerpc/ffi.c @@ -3,7 +3,7 @@ PowerPC Foreign Function Interface - $Id: ffi.c,v 1.1 1998/11/29 16:48:16 green Exp $ + $Id: ffi.c,v 1.2 2001/04/09 00:58:37 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -29,6 +29,9 @@ #include #include +#include + +extern void ffi_closure_SYSV(void); enum { /* The assembly depends on these exact flags. */ @@ -172,6 +175,18 @@ void ffi_prep_args(extended_cif *ecif, unsigned *const stack) } 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; } @@ -421,3 +436,245 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif, break; } } + + +static void flush_icache(char *, int); + +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]; + 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 */ + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Flush the icache. */ + flush_icache(&closure->tramp[0],FFI_TRAMPOLINE_SIZE); + + return FFI_OK; +} + + +#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"); +} + + +int ffi_closure_helper_SYSV (ffi_closure*, void*, unsigned long*, + unsigned long*, 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, unsigned long * 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; + + 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 = *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: + case FFI_TYPE_STRUCT: + /* 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_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). This is also true + * of floats passed on the outgoing parameter stack. + * Also, on the outgoing stack all values are aligned + * to 8 + * + * Don't you just love the simplicity of this ABI! + */ + + /* there are 8 64bit floating point registers */ + + if (nf < 8) { + temp = *(double*)pfr; + *(float*)pfr = (float)temp; + avalue[i] = pfr; + nf++; + pfr+=2; + } 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... + */ + if (((long)pst) & 4) pst++; + temp = *(double*)pst; + *(float*)pst = (float)temp; + avalue[i] = pst; + nf++; + pst+=2; + } + 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+=2; + } 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_osf how to perform return type promotions. */ + return cif->rtype->type; + +} + + + + + diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S new file mode 100644 index 0000000..3118577 --- /dev/null +++ b/libffi/src/powerpc/ppc_closure.S @@ -0,0 +1,148 @@ +#define LIBFFI_ASM +#include + +.globl ffi_closure_helper_SYSV + +ENTRY(ffi_closure_SYSV) + stwu %r1,-144(%r1) + mflr %r0 + stw %r31,140(%r1) + 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 JUMPTARGET(ffi_closure_helper_SYSV) + + # 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,112 # get pointer to results area + addis %r4,0,.L60@ha # get address of jump table + addi %r4,%r4,.L60@l + 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 + .align 2 +.L60: + .long .L44-.L60 # FFI_TYPE_VOID + .long .L50-.L60 # FFI_TYPE_INT + .long .L47-.L60 # FFI_TYPE_FLOAT + .long .L46-.L60 # FFI_TYPE_DOUBLE + .long .L46-.L60 # FFI_TYPE_LONGDOUBLE + .long .L56-.L60 # FFI_TYPE_UINT8 + .long .L55-.L60 # FFI_TYPE_SINT8 + .long .L58-.L60 # FFI_TYPE_UINT16 + .long .L57-.L60 # FFI_TYPE_SINT16 + .long .L50-.L60 # FFI_TYPE_UINT32 + .long .L50-.L60 # FFI_TYPE_SINT32 + .long .L48-.L60 # FFI_TYPE_UINT64 + .long .L48-.L60 # FFI_TYPE_SINT64 + .long .L44-.L60 # FFI_TYPE_STRUCT + .long .L50-.L60 # FFI_TYPE_POINTER + + +# case double +.L46: + lfd %f1,0(%r5) + b .L44 + +# case float +.L47: + lfs %f1,0(%r5) + b .L44 + +# case long long +.L48: + lwz %r3,0(%r5) + lwz %r4,4(%r5) + b .L44 + +# case default / int32 / pointer +.L50: + lwz %r3,0(%r5) + b .L44 + +# case signed int8 +.L55: + addi %r5,%r5,3 + lbz %r3,0(%r5) + extsb %r3,%r3 + b .L44 + +# case unsigned int8 +.L56: + addi %r5,%r5,3 + lbz %r3,0(%r5) + b .L44 + +# case signed int16 +.L57: + addi %r5,%r5,2 + lhz %r3,0(%r5) + extsh %r3,%r3 + b .L44 + +#case unsigned int16 +.L58: + addi %r5,%r5,2 + lhz %r3,0(%r5) + +# case void / done +.L44: + + lwz %r11,0(%r1) + lwz %r0,4(%r11) + mtlr %r0 + lwz %r31,-4(%r11) + mr %r1,%r11 + blr +END(ffi_closure_SYSV) + + + + diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c index 41dfff3..79e3e93 100644 --- a/libffi/src/prep_cif.c +++ b/libffi/src/prep_cif.c @@ -1,8 +1,6 @@ /* ----------------------------------------------------------------------- prep_cif.c - Copyright (c) 1996, 1998 Cygnus Solutions - $Id: prep_cif.c,v 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 @@ -17,7 +15,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. @@ -107,7 +105,11 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, #ifndef M68K /* Make space for the return structure pointer */ - if (cif->rtype->type == FFI_TYPE_STRUCT) + if (cif->rtype->type == FFI_TYPE_STRUCT +#ifdef SPARC + && (cif->abi != FFI_V9 || cif->rtype->size > 32) +#endif + ) bytes = STACK_ARG_SIZE(sizeof(void*)); #endif @@ -121,8 +123,10 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, return FFI_BAD_TYPEDEF; #ifdef SPARC - if ((*ptr)->type == FFI_TYPE_STRUCT - || (*ptr)->type == FFI_TYPE_LONGDOUBLE) + 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 @@ -140,4 +144,3 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, /* Perform machine dependent cif processing */ return ffi_prep_cif_machdep(cif); } - diff --git a/libffi/src/raw_api.c b/libffi/src/raw_api.c index 55bf9ec..c8a8e3d 100644 --- a/libffi/src/raw_api.c +++ b/libffi/src/raw_api.c @@ -19,7 +19,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. @@ -202,13 +202,13 @@ void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, #if FFI_CLOSURES /* base system provides closures */ static void -ffi_translate_args (ffi_cif *cif, void *ravlue, +ffi_translate_args (ffi_cif *cif, void *rvalue, void **avalue, void *user_data) { ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif)); - ffi_ptrarray_to_raw (cif, avalue, raw); - ffi_raw_closure *cl = (ffi_raw_closure*)user_data; + + ffi_ptrarray_to_raw (cif, avalue, raw); (*cl->fun) (cif, rvalue, raw, cl->user_data); } @@ -226,7 +226,7 @@ ffi_prep_raw_closure (ffi_raw_closure* cl, status = ffi_prep_closure ((ffi_closure*) cl, cif, - &ffi_closure_translate, + &ffi_translate_args, (void*)cl); if (status == FFI_OK) { diff --git a/libffi/src/s390/ffi.c b/libffi/src/s390/ffi.c new file mode 100644 index 0000000..5498883 --- /dev/null +++ b/libffi/src/s390/ffi.c @@ -0,0 +1,589 @@ +/* ----------------------------------------------------------------------- + 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 */ +/* ------- */ +/*====================================================================*/ + +#define MAX_GPRARGS 5 /* Max. no. of GPR available */ +#define MAX_FPRARGS 2 /* Max. no. of FPR available */ + +#define STR_GPR 1 /* Structure will fit in 1 or 2 GPR */ +#define STR_FPR 2 /* Structure will fit in a FPR */ +#define STR_STACK 3 /* Structure needs to go on stack */ + +/*===================== End of Defines ===============================*/ + +/*====================================================================*/ +/* Types */ +/* ----- */ +/*====================================================================*/ + +typedef struct stackLayout +{ + int *backChain; + int *endOfStack; + int glue[2]; + int scratch[2]; + int gprArgs[MAX_GPRARGS]; + int notUsed; + union + { + float f; + double d; + } fprArgs[MAX_FPRARGS]; + int unUsed[8]; + int outArgs[100]; +} stackLayout; + +/*======================== End of Types ==============================*/ + +/*====================================================================*/ +/* Prototypes */ +/* ---------- */ +/*====================================================================*/ + +void ffi_prep_args(stackLayout *, extended_cif *); +static int ffi_check_struct(ffi_type *, unsigned int *); +static void ffi_insert_int(int, stackLayout *, int *, int *); +static void ffi_insert_int64(long long, stackLayout *, int *, int *); +static void ffi_insert_double(double, stackLayout *, int *, int *); + +/*====================== End of Prototypes ===========================*/ + +/*====================================================================*/ +/* Externals */ +/* --------- */ +/*====================================================================*/ + +extern void ffi_call_SYSV(void (*)(stackLayout *, extended_cif *), + extended_cif *, + unsigned, unsigned, + unsigned *, + void (*fn)()); + +/*====================== End of Externals ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_check_struct. */ +/* */ +/* Function - Determine if a structure can be passed within a */ +/* general or floating point register. */ +/* */ +/*====================================================================*/ + +int +ffi_check_struct(ffi_type *arg, unsigned int *strFlags) +{ + ffi_type *element; + int i_Element; + + for (i_Element = 0; arg->elements[i_Element]; i_Element++) { + element = arg->elements[i_Element]; + switch (element->type) { + case FFI_TYPE_DOUBLE : + *strFlags |= STR_FPR; + break; + + case FFI_TYPE_STRUCT : + *strFlags |= ffi_check_struct(element, strFlags); + break; + + default : + *strFlags |= STR_GPR; + } + } + return (*strFlags); +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_insert_int. */ +/* */ +/* Function - Insert an integer parameter in a register if there are */ +/* spares else on the stack. */ +/* */ +/*====================================================================*/ + +void +ffi_insert_int(int gprValue, stackLayout *stack, + int *intArgC, int *outArgC) +{ + if (*intArgC < MAX_GPRARGS) { + stack->gprArgs[*intArgC] = gprValue; + *intArgC += 1; + } + else { + stack->outArgs[*outArgC++] = gprValue; + *outArgC += 1; + } +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_insert_int64. */ +/* */ +/* Function - Insert a long long parameter in registers if there are */ +/* spares else on the stack. */ +/* */ +/*====================================================================*/ + +void +ffi_insert_int64(long long llngValue, stackLayout *stack, + int *intArgC, int *outArgC) +{ + + if (*intArgC < (MAX_GPRARGS-1)) { + memcpy(&stack->gprArgs[*intArgC], + &llngValue, sizeof(long long)); + *intArgC += 2; + } + else { + memcpy(&stack->outArgs[*outArgC], + &llngValue, sizeof(long long)); + *outArgC += 2; + } + +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_insert_double. */ +/* */ +/* Function - Insert a double parameter in a FP register if there is */ +/* a spare else on the stack. */ +/* */ +/*====================================================================*/ + +void +ffi_insert_double(double dblValue, stackLayout *stack, + int *fprArgC, int *outArgC) +{ + + if (*fprArgC < MAX_FPRARGS) { + stack->fprArgs[*fprArgC].d = dblValue; + *fprArgC += 1; + } + else { + memcpy(&stack->outArgs[*outArgC], + &dblValue,sizeof(double)); + *outArgC += 2; + } + +} + +/*======================== 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. */ +/* */ +/* The stack layout we want looks like this: */ +/* *------------------------------------------------------------* */ +/* | 0 | Back chain (a 0 here signifies end of back chain) | */ +/* +--------+---------------------------------------------------+ */ +/* | 4 | EOS (end of stack, not used on Linux for S390) | */ +/* +--------+---------------------------------------------------+ */ +/* | 8 | Glue used in other linkage formats | */ +/* +--------+---------------------------------------------------+ */ +/* | 12 | Glue used in other linkage formats | */ +/* +--------+---------------------------------------------------+ */ +/* | 16 | Scratch area | */ +/* +--------+---------------------------------------------------+ */ +/* | 20 | Scratch area | */ +/* +--------+---------------------------------------------------+ */ +/* | 24 | GPR parameter register 1 | */ +/* +--------+---------------------------------------------------+ */ +/* | 28 | GPR parameter register 2 | */ +/* +--------+---------------------------------------------------+ */ +/* | 32 | GPR parameter register 3 | */ +/* +--------+---------------------------------------------------+ */ +/* | 36 | GPR parameter register 4 | */ +/* +--------+---------------------------------------------------+ */ +/* | 40 | GPR parameter register 5 | */ +/* +--------+---------------------------------------------------+ */ +/* | 44 | Unused | */ +/* +--------+---------------------------------------------------+ */ +/* | 48 | FPR parameter register 1 | */ +/* +--------+---------------------------------------------------+ */ +/* | 56 | FPR parameter register 2 | */ +/* +--------+---------------------------------------------------+ */ +/* | 64 | Unused | */ +/* +--------+---------------------------------------------------+ */ +/* | 96 | Outgoing args (length x) | */ +/* +--------+---------------------------------------------------+ */ +/* | 96+x | Copy area for structures (length y) | */ +/* +--------+---------------------------------------------------+ */ +/* | 96+x+y | Possible stack alignment | */ +/* *------------------------------------------------------------* */ +/* */ +/*====================================================================*/ + +void +ffi_prep_args(stackLayout *stack, extended_cif *ecif) +{ + const unsigned bytes = ecif->cif->bytes; + const unsigned flags = ecif->cif->flags; + + /*----------------------------------------------------------*/ + /* Pointer to the copy area on stack for structures */ + /*----------------------------------------------------------*/ + char *copySpace = (char *) stack + bytes + sizeof(stackLayout); + + /*----------------------------------------------------------*/ + /* Count of general and floating point register usage */ + /*----------------------------------------------------------*/ + int intArgC = 0, + fprArgC = 0, + outArgC = 0; + + int i; + ffi_type **ptr; + void **p_argv; + size_t structCopySize; + unsigned gprValue, strFlags = 0; + unsigned long long llngValue; + double dblValue; + + /* Now for the arguments. */ + p_argv = ecif->avalue; + + /*----------------------------------------------------------------------*/ + /* If we returning a structure then we set the first parameter register */ + /* to the address of where we are returning this structure */ + /*----------------------------------------------------------------------*/ + if (flags == FFI_TYPE_STRUCT) + stack->gprArgs[intArgC++] = (int) ecif->rvalue; + + for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; + i > 0; + i--, ptr++, p_argv++) + { + switch ((*ptr)->type) { + + case FFI_TYPE_FLOAT: + if (fprArgC < MAX_FPRARGS) + stack->fprArgs[fprArgC++].f = *(float *) *p_argv; + else + stack->outArgs[outArgC++] = *(int *) *p_argv; + break; + + case FFI_TYPE_DOUBLE: + dblValue = *(double *) *p_argv; + ffi_insert_double(dblValue, stack, &fprArgC, &outArgC); + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + llngValue = *(unsigned long long *) *p_argv; + ffi_insert_int64(llngValue, stack, &intArgC, &outArgC); + break; + + case FFI_TYPE_UINT8: + gprValue = *(unsigned char *)*p_argv; + ffi_insert_int(gprValue, stack, &intArgC, &outArgC); + break; + + case FFI_TYPE_SINT8: + gprValue = *(signed char *)*p_argv; + ffi_insert_int(gprValue, stack, &intArgC, &outArgC); + break; + + case FFI_TYPE_UINT16: + gprValue = *(unsigned short *)*p_argv; + ffi_insert_int(gprValue, stack, &intArgC, &outArgC); + break; + + case FFI_TYPE_SINT16: + gprValue = *(signed short *)*p_argv; + ffi_insert_int(gprValue, stack, &intArgC, &outArgC); + break; + + case FFI_TYPE_STRUCT: + /*--------------------------------------------------*/ + /* If structure > 8 bytes then it goes on the stack */ + /*--------------------------------------------------*/ + if (((*ptr)->size > 8) || + ((*ptr)->size > 4 && + (*ptr)->size < 8)) + strFlags = STR_STACK; + else + strFlags = ffi_check_struct((ffi_type *) *ptr, &strFlags); + + switch (strFlags) { + /*-------------------------------------------*/ + /* Structure that will fit in one or two GPR */ + /*-------------------------------------------*/ + case STR_GPR : + if ((*ptr)->size <= 4) { + gprValue = *(unsigned int *) *p_argv; + gprValue = gprValue >> ((4 - (*ptr)->size) * 8); + ffi_insert_int(gprValue, stack, &intArgC, &outArgC); + } + else { + llngValue = *(unsigned long long *) *p_argv; + ffi_insert_int64(llngValue, stack, &intArgC, &outArgC); + } + break; + + /*-------------------------------------------*/ + /* Structure that will fit in one FPR */ + /*-------------------------------------------*/ + case STR_FPR : + dblValue = *(double *) *p_argv; + ffi_insert_double(dblValue, stack, &fprArgC, &outArgC); + break; + + /*-------------------------------------------*/ + /* Structure that must be copied to stack */ + /*-------------------------------------------*/ + default : + structCopySize = (((*ptr)->size + 15) & ~0xF); + copySpace -= structCopySize; + memcpy(copySpace, (char *)*p_argv, (*ptr)->size); + gprValue = (unsigned) copySpace; + if (intArgC < MAX_GPRARGS) + stack->gprArgs[intArgC++] = gprValue; + else + stack->outArgs[outArgC++] = gprValue; + } + break; + +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + structCopySize = (((*ptr)->size + 15) & ~0xF); + copySpace -= structCopySize; + memcpy(copySpace, (char *)*p_argv, (*ptr)->size); + gprValue = (unsigned) copySpace; + if (intArgC < MAX_GPRARGS) + stack->gprArgs[intArgC++] = gprValue; + else + stack->outArgs[outArgC++] = gprValue; + break; +#endif + + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_POINTER: + gprValue = *(unsigned *)*p_argv; + if (intArgC < MAX_GPRARGS) + stack->gprArgs[intArgC++] = gprValue; + else + stack->outArgs[outArgC++] = gprValue; + break; + + } + } +} + +/*======================== End of Routine ============================*/ + +/*====================================================================*/ +/* */ +/* Name - ffi_prep_cif_machdep. */ +/* */ +/* Function - Perform machine dependent CIF processing. */ +/* */ +/*====================================================================*/ + +ffi_status +ffi_prep_cif_machdep(ffi_cif *cif) +{ + int i; + ffi_type **ptr; + unsigned bytes; + int fpArgC = 0, + intArgC = 0; + unsigned flags = 0; + unsigned structCopySize = 0; + + /*-----------------------------------------------------------------*/ + /* Extra space required in stack for overflow parameters. */ + /*-----------------------------------------------------------------*/ + bytes = 0; + + /*--------------------------------------------------------*/ + /* Return value handling. The rules are as follows: */ + /* - 32-bit (or less) integer values are returned in gpr2 */ + /* - Structures are returned as pointers in gpr2 */ + /* - 64-bit integer values are returned in gpr2 and 3 */ + /* - Single/double FP values are returned in fpr0 */ + /*--------------------------------------------------------*/ + flags = cif->rtype->type; + + /*------------------------------------------------------------------------*/ + /* The first MAX_GPRARGS words of integer arguments, and the */ + /* first MAX_FPRARGS floating point 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: + case FFI_TYPE_DOUBLE: + fpArgC++; + if (fpArgC > MAX_FPRARGS && intArgC%2 != 0) + intArgC++; + 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. */ + /*----------------------------------------------------*/ + if ((intArgC == MAX_GPRARGS-1) || + (intArgC >= MAX_GPRARGS) && + (intArgC%2 != 0)) + intArgC++; + intArgC += 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). */ + /*----------------------------------------------------*/ + structCopySize += ((*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. */ + /*----------------------------------------------------*/ + intArgC++; + break; + } + } + + /*-----------------------------------------------------------------*/ + /* Stack space. */ + /*-----------------------------------------------------------------*/ + if (intArgC > MAX_GPRARGS) + bytes += (intArgC - MAX_GPRARGS) * sizeof(int); + if (fpArgC > MAX_FPRARGS) + bytes += (fpArgC - MAX_FPRARGS) * sizeof(double); + + /*-----------------------------------------------------------------*/ + /* 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 += structCopySize; + + cif->flags = flags; + cif->bytes = bytes; + + 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) +{ + 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_SYSV: + ffi_call_SYSV(ffi_prep_args, + &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT(0); + break; + } +} + +/*======================== End of Routine ============================*/ diff --git a/libffi/src/s390/sysv.S b/libffi/src/s390/sysv.S new file mode 100644 index 0000000..afaf1ea --- /dev/null +++ b/libffi/src/s390/sysv.S @@ -0,0 +1,161 @@ +/* ----------------------------------------------------------------------- + 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 +#ifdef HAVE_MACHINE_ASM_H +#include +#endif + +.text + + # r2: ffi_prep_args + # r3: &ecif + # r4: cif->bytes + # r5: fig->flags + # r6: ecif.rvalue + # sp+0: fn + + # This assumes we are using gas. + .globl ffi_call_SYSV + .type ffi_call_SYSV,%function +ffi_call_SYSV: + # Save registers + stm %r7,%r15,28(%r15) + l %r7,96(%r15) # Get A(fn) + lr %r0,%r15 + ahi %r15,-128 # Make room for my args + st %r0,0(%r15) # Set backchain + lr %r11,%r15 # Establish my stack register + sr %r15,%r4 # Make room for fn args + ahi %r15,-96 # Make room for new frame + lr %r10,%r15 # Establish stack build area + ahi %r15,-96 # Stack for next call + lr %r1,%r7 + stm %r2,%r7,96(%r11) # Save args on my stack + +#------------------------------------------------------------------ +# move first 3 parameters in registers +#------------------------------------------------------------------ + lr %r9,%r2 # r9: &ffi_prep_args + lr %r2,%r10 # Parm 1: &stack Parm 2: &ecif + basr %r14,%r9 # call ffi_prep_args + +#------------------------------------------------------------------ +# load first 5 parameter registers +#------------------------------------------------------------------ + lm %r2,%r6,24(%r10) + +#------------------------------------------------------------------ +# load fp parameter registers +#------------------------------------------------------------------ + ld %f0,48(%r10) + ld %f2,56(%r10) + +#------------------------------------------------------------------ +# call function +#------------------------------------------------------------------ + lr %r15,%r10 # Set new stack + l %r9,116(%r11) # Get &fn + basr %r14,%r9 # Call function + +#------------------------------------------------------------------ +# On return: +# r2: Return value (r3: Return value + 4 for long long) +#------------------------------------------------------------------ + +#------------------------------------------------------------------ +# If the return value pointer is NULL, assume no return value. +#------------------------------------------------------------------ + icm %r6,15,112(%r11) + jz .Lepilogue + + l %r5,108(%r11) # Get return type +#------------------------------------------------------------------ +# return INT +#------------------------------------------------------------------ + chi %r5,FFI_TYPE_INT + jne .Lchk64 + + st %r2,0(%r6) + j .Lepilogue + +.Lchk64: +#------------------------------------------------------------------ +# return LONG LONG (signed/unsigned) +#------------------------------------------------------------------ + chi %r5,FFI_TYPE_UINT64 + je .LdoLongLong + + chi %r5,FFI_TYPE_SINT64 + jne .LchkFloat + +.LdoLongLong: + stm %r2,%r3,0(%r6) + j .Lepilogue + +.LchkFloat: +#------------------------------------------------------------------ +# return FLOAT +#------------------------------------------------------------------ + chi %r5,FFI_TYPE_FLOAT + jne .LchkDouble + + std %f0,0(%r6) + j .Lepilogue + +.LchkDouble: +#------------------------------------------------------------------ +# return DOUBLE or LONGDOUBLE +#------------------------------------------------------------------ + chi %r5,FFI_TYPE_DOUBLE + jne .LchkStruct + + std %f0,0(%r6) + std %f2,8(%r6) + j .Lepilogue + +.LchkStruct: +#------------------------------------------------------------------ +# Structure - rvalue already set as sent as 1st parm to routine +#------------------------------------------------------------------ + chi %r5,FFI_TYPE_STRUCT + je .Lepilogue + +.Ldefault: +#------------------------------------------------------------------ +# return a pointer +#------------------------------------------------------------------ + st %r2,0(%r6) + j .Lepilogue + +.Lepilogue: + l %r15,0(%r11) + l %r4,56(%r15) + lm %r7,%r15,28(%r15) + br %r4 + +.ffi_call_SYSV_end: + .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV diff --git a/libffi/src/sparc/ffi.c b/libffi/src/sparc/ffi.c index 50019b9..f557013 100644 --- a/libffi/src/sparc/ffi.c +++ b/libffi/src/sparc/ffi.c @@ -3,8 +3,6 @@ Sparc Foreign Function Interface - $Id: ffi.c,v 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 @@ -33,7 +31,7 @@ /* 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) +void ffi_prep_args_v8(char *stack, extended_cif *ecif) { int i; int tmp; @@ -45,16 +43,16 @@ void ffi_prep_args(char *stack, extended_cif *ecif) tmp = 0; /* Skip 16 words for the window save area */ - argp = stack + 16*sizeof(void*); + 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 ) */ - *(void **) argp = ecif->rvalue; + *(int *) argp = (long)ecif->rvalue; /* And 1 word for the structure return value. */ - argp += sizeof(void*); + argp += sizeof(int); #ifdef USING_PURIFY /* Purify will probably complain in our assembly routine, unless we @@ -81,10 +79,13 @@ void ffi_prep_args(char *stack, extended_cif *ecif) { avn--; if ((*p_arg)->type == FFI_TYPE_STRUCT - || (*p_arg)->type == FFI_TYPE_LONGDOUBLE) +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + || (*p_arg)->type == FFI_TYPE_LONGDOUBLE +#endif + ) { - *(unsigned int *) argp = (unsigned int)(* p_argv); - z = sizeof(void*); + *(unsigned int *) argp = (unsigned long)(* p_argv); + z = sizeof(int); } else { @@ -109,15 +110,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif) case FFI_TYPE_UINT16: *(unsigned int *) argp = *(UINT16 *)(* p_argv); break; - - case FFI_TYPE_SINT32: - *(signed int *) argp = *(SINT32 *)(* p_argv); - break; - - case FFI_TYPE_UINT32: - *(unsigned int *) argp = *(UINT32 *)(* p_argv); - break; - + default: FFI_ASSERT(0); } @@ -135,82 +128,295 @@ void ffi_prep_args(char *stack, extended_cif *ecif) 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; + 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) { - /* 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! */ + int wordsize; + + if (cif->abi != FFI_V9) + { + wordsize = 4; - if (cif->rtype->type != FFI_TYPE_STRUCT) - cif->bytes += sizeof(void*); + /* 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! */ - /* sparc call frames require that space is allocated for 6 args, - even if they aren't used. Make that space if necessary. */ + 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; + 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 += 64; + cif->bytes += 16 * wordsize; - /* The stack must be double word aligned, so round bytes up + /* The stack must be 2 word aligned, so round bytes up appropriately. */ - cif->bytes = ALIGN(cif->bytes, 2*sizeof(void*)); + cif->bytes = ALIGN(cif->bytes, 2 * wordsize); /* Set the return type flag */ switch (cif->rtype->type) { case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - cif->flags = cif->rtype->type; - break; - case FFI_TYPE_FLOAT: - cif->flags = 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_DOUBLE: - cif->flags = FFI_TYPE_DOUBLE; + 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_return_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_return_struct(*ptr, off, ret, intg, flt); + break; + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: +#endif + memcpy(ret + off, flt + off, (*ptr)->size); + off += (*ptr)->size; + break; + default: + memcpy(ret + off, intg + off, (*ptr)->size); + off += (*ptr)->size; + break; + } + ptr++; + } + return off; +} + extern int ffi_call_V8(void *, extended_cif *, unsigned, unsigned, unsigned *, void (*fn)()); +extern int ffi_call_V9(void *, extended_cif *, unsigned, + unsigned, unsigned *, void (*fn)()); 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 */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - ecif.rvalue = alloca(cif->rtype->size); - else - ecif.rvalue = rvalue; - + + 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: - ffi_call_V8(ffi_prep_args, &ecif, cif->bytes, +#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_return_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; } + } diff --git a/libffi/src/sparc/v8.S b/libffi/src/sparc/v8.S index c6bf6d2..0357f4d 100644 --- a/libffi/src/sparc/v8.S +++ b/libffi/src/sparc/v8.S @@ -3,8 +3,6 @@ Sparc Foreign Function Interface - $Id: v8.S,v 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 @@ -56,6 +54,7 @@ _ffi_call_V8: 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 @@ -70,6 +69,9 @@ _ffi_call_V8: be,a done st %f0, [%i4+0] ! (delay) + cmp %i3, FFI_TYPE_SINT64 + be longlong + cmp %i3, FFI_TYPE_DOUBLE bne done nop @@ -80,6 +82,12 @@ done: ret restore +longlong: + st %o0, [%i4+0] + st %o1, [%i4+4] + ret + restore + .ffi_call_V8_end: .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 diff --git a/libffi/src/sparc/v9.S b/libffi/src/sparc/v9.S index eccf946..c937f43 100644 --- a/libffi/src/sparc/v9.S +++ b/libffi/src/sparc/v9.S @@ -3,8 +3,6 @@ Sparc 64bit Foreign Function Interface - $Id: v9.S,v 1.1 2000/04/17 03:18:46 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 diff --git a/libffi/src/types.c b/libffi/src/types.c index 61fa5a0..4120e76 100644 --- a/libffi/src/types.c +++ b/libffi/src/types.c @@ -3,8 +3,6 @@ Predefined ffi_types needed by libffi. - $Id: types.c,v 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 @@ -19,7 +17,7 @@ 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 + IN NO EVENT SHALL RED HAT 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. @@ -42,15 +40,28 @@ FFI_INTEGRAL_TYPEDEF(uint16, 2, 2, FFI_TYPE_UINT16); FFI_INTEGRAL_TYPEDEF(sint16, 2, 2, FFI_TYPE_SINT16); FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_TYPE_UINT32); FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); -FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_TYPE_POINTER); FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); +#if defined ALPHA || defined SPARC64 + +FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); + +#else + +FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_TYPE_POINTER); + +#endif #ifdef X86 FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +#elif defined X86_WIN32 + +FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); + #elif defined ARM FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); @@ -74,6 +85,11 @@ FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64); FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); +#elif defined X86_WIN32 + +FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); + #elif defined ARM FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); @@ -87,8 +103,17 @@ FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); #elif defined SPARC FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); + +#ifdef SPARC64 + +FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); + +#else + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); +#endif + #else FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); diff --git a/libffi/src/x86/ffi.c b/libffi/src/x86/ffi.c index 1e58e03..162d66f 100644 --- a/libffi/src/x86/ffi.c +++ b/libffi/src/x86/ffi.c @@ -3,8 +3,6 @@ x86 Foreign Function Interface - $Id: ffi.c,v 1.3 1999/08/08 13:05:12 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 diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index 41ac460..d59a164 100644 --- a/libffi/src/x86/sysv.S +++ b/libffi/src/x86/sysv.S @@ -3,8 +3,6 @@ X86 Foreign Function Interface - $Id: sysv.S,v 1.2 1999/08/04 18:00:05 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 @@ -38,9 +36,11 @@ .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 @@ -124,6 +124,43 @@ epilogue: movl %ebp,%esp popl %ebp ret +.LFE1: .ffi_call_SYSV_end: .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV +.section .eh_frame,"aw",@progbits +__FRAME_BEGIN__: + .4byte .LLCIE1 +.LSCIE1: + .4byte 0x0 + .byte 0x1 + .byte 0x0 + .byte 0x1 + .byte 0x7c + .byte 0x8 + .byte 0xc + .byte 0x4 + .byte 0x4 + .byte 0x88 + .byte 0x1 + .align 4 +.LECIE1: + .set .LLCIE1,.LECIE1-.LSCIE1 + .4byte .LLFDE1 +.LSFDE1: + .4byte .LSFDE1-__FRAME_BEGIN__ + .4byte .LFB1 + .4byte .LFE1-.LFB1 + .byte 0x4 + .4byte .LCFI0-.LFB1 + .byte 0xe + .byte 0x8 + .byte 0x85 + .byte 0x2 + .byte 0x4 + .4byte .LCFI1-.LCFI0 + .byte 0xd + .byte 0x5 + .align 4 +.LEFDE1: + .set .LLFDE1,.LEFDE1-.LSFDE1 diff --git a/libffi/src/x86/win32.S b/libffi/src/x86/win32.S new file mode 100644 index 0000000..520d1fc --- /dev/null +++ b/libffi/src/x86/win32.S @@ -0,0 +1,125 @@ +/* ----------------------------------------------------------------------- + win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions + + 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 + +.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 + + 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 + +.ffi_call_SYSV_end: -- 2.7.4