[multiple changes]

2003-10-21  Andreas Tobler  <a.tobler@schweiz.ch>

	* configure.in: AC_LINK_FILES(ffitarget.h).
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
	* fficonfig.h.in: Likewise.

2003-10-21  Paolo Bonzini  <bonzini@gnu.org>
	    Richard Henderson  <rth@redhat.com>

	Avoid that ffi.h includes fficonfig.h.

	* Makefile.am (EXTRA_DIST): Include ffitarget.h files
	(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(TARGET_SRC_MIPS_SGI): Removed.
	(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
	(MIPS_SGI): Removed.
	(CLEANFILES): Removed.
	(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
	targets.
	* acconfig.h: Removed.
	* configure.in: Compute sizeofs only for double and long double.
	Use them to define and subst HAVE_LONG_DOUBLE.  Include comments
	into AC_DEFINE instead of using acconfig.h.  Create
	include/ffitarget.h instead of include/fficonfig.h.  Rename
	MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
	AC_DEFINE EH_FRAME_FLAGS.
	* include/Makefile.am (DISTCLEANFILES): New automake macro.
	(hack_DATA): Add ffitarget.h.
	* include/ffi.h.in: Remove all system specific definitions.
	Declare raw API even if it is not installed, why bother?
	Use limits.h instead of SIZEOF_* to define ffi_type_*.  Do
	not define EH_FRAME_FLAGS, it is in fficonfig.h now.  Include
	ffitarget.h instead of fficonfig.h.  Remove ALIGN macro.
	(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
	* include/ffi_common.h (bool): Do not define.
	(ffi_assert): Accept failed assertion.
	(ffi_type_test): Return void and accept file/line.
	(FFI_ASSERT): Pass stringized failed assertion.
	(FFI_ASSERT_AT): New macro.
	(FFI_ASSERT_VALID_TYPE): New macro.
	(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
	UINT64, SINT64): Define here with gcc's __attribute__ macro
	instead of in ffi.h
	(FLOAT32, ALIGN): Define here instead of in ffi.h
	* include/ffi-mips.h: Removed.  Its content moved to
	src/mips/ffitarget.h after separating assembly and C sections.
	* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
	src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
	src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
	src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
	SIZEOF_ARG -> FFI_SIZEOF_ARG.
	* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
	* src/debug.c (ffi_assert): Accept stringized failed assertion.
	(ffi_type_test): Rewritten.
	* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
	FFI_ASSERT_VALID_TYPE.
	* src/alpha/ffitarget.h, src/arm/ffitarget.h,
	src/ia64/ffitarget.h, src/m68k/ffitarget.h,
	src/mips/ffitarget.h, src/powerpc/ffitarget.h,
	src/s390/ffitarget.h, src/sh/ffitarget.h,
	src/sh64/ffitarget.h, src/sparc/ffitarget.h,
	src/x86/ffitarget.h: New files.
	* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
	src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
	src/powerpc/aix.S, src/powerpc/darwin.S,
	src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
	src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
	src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
	src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
	src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
	include fficonfig.h

From-SVN: r72766
This commit is contained in:
Andreas Tobler 2003-10-21 21:01:58 +02:00
parent 6b5a2662c7
commit 1450eb7a07
44 changed files with 658 additions and 1078 deletions

View File

@ -1,3 +1,78 @@
2003-10-21 Andreas Tobler <a.tobler@schweiz.ch>
* configure.in: AC_LINK_FILES(ffitarget.h).
* configure: Regenerate.
* Makefile.in: Likewise.
* include/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
* fficonfig.h.in: Likewise.
2003-10-21 Paolo Bonzini <bonzini@gnu.org>
Richard Henderson <rth@redhat.com>
Avoid that ffi.h includes fficonfig.h.
* Makefile.am (EXTRA_DIST): Include ffitarget.h files
(TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
(TARGET_SRC_MIPS_SGI): Removed.
(MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
(MIPS_SGI): Removed.
(CLEANFILES): Removed.
(mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
targets.
* acconfig.h: Removed.
* configure.in: Compute sizeofs only for double and long double.
Use them to define and subst HAVE_LONG_DOUBLE. Include comments
into AC_DEFINE instead of using acconfig.h. Create
include/ffitarget.h instead of include/fficonfig.h. Rename
MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
AC_DEFINE EH_FRAME_FLAGS.
* include/Makefile.am (DISTCLEANFILES): New automake macro.
(hack_DATA): Add ffitarget.h.
* include/ffi.h.in: Remove all system specific definitions.
Declare raw API even if it is not installed, why bother?
Use limits.h instead of SIZEOF_* to define ffi_type_*. Do
not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include
ffitarget.h instead of fficonfig.h. Remove ALIGN macro.
(UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
* include/ffi_common.h (bool): Do not define.
(ffi_assert): Accept failed assertion.
(ffi_type_test): Return void and accept file/line.
(FFI_ASSERT): Pass stringized failed assertion.
(FFI_ASSERT_AT): New macro.
(FFI_ASSERT_VALID_TYPE): New macro.
(UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
UINT64, SINT64): Define here with gcc's __attribute__ macro
instead of in ffi.h
(FLOAT32, ALIGN): Define here instead of in ffi.h
* include/ffi-mips.h: Removed. Its content moved to
src/mips/ffitarget.h after separating assembly and C sections.
* src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
SIZEOF_ARG -> FFI_SIZEOF_ARG.
* src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
* src/debug.c (ffi_assert): Accept stringized failed assertion.
(ffi_type_test): Rewritten.
* src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
FFI_ASSERT_VALID_TYPE.
* src/alpha/ffitarget.h, src/arm/ffitarget.h,
src/ia64/ffitarget.h, src/m68k/ffitarget.h,
src/mips/ffitarget.h, src/powerpc/ffitarget.h,
src/s390/ffitarget.h, src/sh/ffitarget.h,
src/sh64/ffitarget.h, src/sparc/ffitarget.h,
src/x86/ffitarget.h: New files.
* src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
src/powerpc/aix.S, src/powerpc/darwin.S,
src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
include fficonfig.h
2003-10-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2003-10-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external

View File

@ -1,4 +1,4 @@
libffi - Copyright (c) 1996-1999 Cygnus Solutions libffi - Copyright (c) 1996-2003 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

View File

@ -4,24 +4,26 @@ AUTOMAKE_OPTIONS = cygnus
SUBDIRS = include testsuite SUBDIRS = include testsuite
EXTRA_DIST = LICENSE ChangeLog.v1 \
src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \
src/mips/ffi.c src/mips/n32.S src/mips/o32.S \
src/mips/ffitarget.h \
src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
src/powerpc/ffi.c src/powerpc/sysv.S \
src/powerpc/linux64.S src/powerpc/linux64_closure.S \
src/powerpc/ppc_closure.S src/powerpc/asm.h \
src/powerpc/aix.S src/powerpc/darwin.S \
src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \
src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
src/sparc/ffi.c \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \
src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
src/x86/ffi64.c src/x86/unix64.S \
src/alpha/ffi.c src/alpha/osf.S \
src/m68k/ffi.c src/m68k/sysv.S \
src/powerpc/ffi.c src/powerpc/sysv.S \
src/powerpc/linux64.S src/powerpc/linux64_closure.S \
src/powerpc/ppc_closure.S src/powerpc/asm.h \
src/powerpc/ffi_darwin.c \
src/powerpc/darwin.S src/powerpc/aix.S \
src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
src/arm/ffi.c src/arm/sysv.S \
src/s390/ffi.c src/s390/sysv.S \
src/sh/ffi.c src/sh/sysv.S \
src/sh64/ffi.c src/sh64/sysv.S
VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
@ -85,9 +87,8 @@ noinst_LTLIBRARIES = libffi_convenience.la
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S TARGET_SRC_MIPS_IRIX = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.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_X86 = src/x86/ffi.c src/x86/sysv.S
TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.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
@ -107,18 +108,14 @@ TARGET_SRC_SH64 = src/sh64/sysv.S src/sh64/ffi.c
## Work around automake deficiency ## Work around automake deficiency
libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
src/raw_api.c src/java_raw_api.c src/raw_api.c src/java_raw_api.c
if MIPS_GCC if MIPS_IRIX
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
endif endif
if MIPS_LINUX if MIPS_LINUX
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
endif endif
if MIPS_SGI
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
endif
if X86 if X86
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86) libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
@ -180,7 +177,7 @@ AM_CFLAGS = -Wall -g -fexceptions
libffi_la_LDFLAGS = -release $(VERSION) libffi_la_LDFLAGS = -release $(VERSION)
INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
# Override these rules so that object files get put in the correct # Override these rules so that object files get put in the correct
# subdirectories. # subdirectories.
@ -229,7 +226,15 @@ maintainer-clean-multi:
## ################################################################ ## ################################################################
CLEANFILES = $(libffi_convenience_la_OBJECTS) \ # Our hacked automake doesn't clean subdirectories properly.
$(libffi_la_OBJECTS) \ mostlyclean-am: mostlyclean-sub
$(libffi_convenience_la_OBJECTS:.lo=.o) \ mostlyclean-sub:
$(libffi_la_OBJECTS:.lo=.o) -rm -f src/*.o src/*.lo
-rm -f src/@TARGETDIR@/*.o src/@TARGETDIR@/*.lo
clean-am: clean-sub
clean-sub:
-rm -rf src/.libs src/_libs
-rm -rf src/@TARGETDIR@/.libs src/@TARGETDIR@/_libs

View File

@ -71,6 +71,7 @@ DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
GCJ = @GCJ@ GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@ GCJFLAGS = @GCJFLAGS@
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@ LN_S = @LN_S@
MAINT = @MAINT@ MAINT = @MAINT@
@ -92,23 +93,25 @@ AUTOMAKE_OPTIONS = cygnus
SUBDIRS = include testsuite SUBDIRS = include testsuite
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \ EXTRA_DIST = LICENSE ChangeLog.v1 \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \ src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ src/arm/ffi.c src/arm/sysv.S src/arm/ffitarget.h \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ src/mips/ffi.c src/mips/n32.S src/mips/o32.S \
src/x86/ffi64.c src/x86/unix64.S \ src/mips/ffitarget.h \
src/alpha/ffi.c src/alpha/osf.S \ src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
src/m68k/ffi.c src/m68k/sysv.S \ src/powerpc/ffi.c src/powerpc/sysv.S \
src/powerpc/ffi.c src/powerpc/sysv.S \ src/powerpc/linux64.S src/powerpc/linux64_closure.S \
src/powerpc/linux64.S src/powerpc/linux64_closure.S \ src/powerpc/ppc_closure.S src/powerpc/asm.h \
src/powerpc/ppc_closure.S src/powerpc/asm.h \ src/powerpc/aix.S src/powerpc/darwin.S \
src/powerpc/ffi_darwin.c \ src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
src/powerpc/darwin.S src/powerpc/aix.S \ src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
src/arm/ffi.c src/arm/sysv.S \ src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h \
src/s390/ffi.c src/s390/sysv.S \ src/sh64/ffi.c src/sh64/sysv.S src/sh64/ffitarget.h \
src/sh/ffi.c src/sh/sysv.S \ src/sparc/v8.S src/sparc/v9.S src/sparc/ffitarget.h \
src/sh64/ffi.c src/sh64/sysv.S src/sparc/ffi.c \
src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
src/x86/ffi64.c src/x86/unix64.S src/x86/ffitarget.h
VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
@ -166,9 +169,8 @@ MULTICLEAN = true
toolexeclib_LTLIBRARIES = libffi.la toolexeclib_LTLIBRARIES = libffi.la
noinst_LTLIBRARIES = libffi_convenience.la noinst_LTLIBRARIES = libffi_convenience.la
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S TARGET_SRC_MIPS_IRIX = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.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_X86 = src/x86/ffi.c src/x86/sysv.S
TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.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
@ -187,9 +189,8 @@ TARGET_SRC_SH64 = src/sh64/sysv.S src/sh64/ffi.c
libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
src/raw_api.c src/java_raw_api.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_IRIX_TRUE@libffi_la_SOURCES = @MIPS_IRIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) @MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
@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) @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
@X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
@SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) @SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
@ -204,9 +205,8 @@ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) @X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) @SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
@SH64_TRUE@libffi_la_SOURCES = @SH64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH64) @SH64_TRUE@libffi_la_SOURCES = @SH64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
@MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) @MIPS_IRIX_TRUE@libffi_convenience_la_SOURCES = @MIPS_IRIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) @MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
@MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
@X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
@X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
@SPARC_TRUE@libffi_convenience_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) @SPARC_TRUE@libffi_convenience_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
@ -226,13 +226,7 @@ AM_CFLAGS = -Wall -g -fexceptions
libffi_la_LDFLAGS = -release $(VERSION) libffi_la_LDFLAGS = -release $(VERSION)
INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
CLEANFILES = $(libffi_convenience_la_OBJECTS) \
$(libffi_la_OBJECTS) \
$(libffi_convenience_la_OBJECTS:.lo=.o) \
$(libffi_la_OBJECTS:.lo=.o)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs
CONFIG_HEADER = fficonfig.h CONFIG_HEADER = fficonfig.h
@ -246,10 +240,6 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
libffi_convenience_la_LDFLAGS = libffi_convenience_la_LDFLAGS =
libffi_convenience_la_LIBADD = libffi_convenience_la_LIBADD =
@MIPS_GCC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
@MIPS_GCC_TRUE@src/mips/n32.lo
@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ @X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
@ -272,44 +262,41 @@ libffi_convenience_la_LIBADD =
@POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
@MIPS_SGI_TRUE@src/mips/n32.lo
@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo @MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo @X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo @X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@SH64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SH64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo @SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \
@SPARC_TRUE@src/sparc/v9.lo
@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo \ @POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo \
@POWERPC_TRUE@src/powerpc/linux64.lo src/powerpc/linux64_closure.lo @POWERPC_TRUE@src/powerpc/linux64.lo src/powerpc/linux64_closure.lo
@SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ @ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
@SPARC_TRUE@src/sparc/v9.lo @MIPS_IRIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_IRIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_IRIX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
@MIPS_IRIX_TRUE@src/mips/n32.lo
@M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
libffi_la_LIBADD = libffi_la_LIBADD =
@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ @X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
@ -331,35 +318,35 @@ libffi_la_LIBADD =
@POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo @MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo
@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ @X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ @X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
@X86_TRUE@src/x86/sysv.lo @X86_TRUE@src/x86/sysv.lo
@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo @X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo @SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
@ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@ARM_TRUE@src/arm/ffi.lo @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
@POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
@POWERPC_TRUE@src/powerpc/ppc_closure.lo src/powerpc/linux64.lo \ @POWERPC_TRUE@src/powerpc/ppc_closure.lo src/powerpc/linux64.lo \
@POWERPC_TRUE@src/powerpc/linux64_closure.lo @POWERPC_TRUE@src/powerpc/linux64_closure.lo
@SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
@SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo @ARM_TRUE@src/arm/ffi.lo
@MIPS_IRIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_IRIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_IRIX_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
@ -369,8 +356,7 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $
CCLD = $(CC) CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
acconfig.h acinclude.m4 aclocal.m4 configure configure.in \ acinclude.m4 aclocal.m4 configure configure.in fficonfig.h.in
fficonfig.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@ -413,7 +399,7 @@ $(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
rm -f $(srcdir)/stamp-h.in; \ rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \
else :; fi else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER) cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
@ -679,7 +665,6 @@ installdirs-am:
mostlyclean-generic: mostlyclean-generic:
clean-generic: clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f Makefile $(CONFIG_CLEAN_FILES)
@ -787,6 +772,17 @@ distclean-multi:
maintainer-clean-multi: maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
# Our hacked automake doesn't clean subdirectories properly.
mostlyclean-am: mostlyclean-sub
mostlyclean-sub:
-rm -f src/*.o src/*.lo
-rm -f src/@TARGETDIR@/*.o src/@TARGETDIR@/*.lo
clean-am: clean-sub
clean-sub:
-rm -rf src/.libs src/_libs
-rm -rf src/@TARGETDIR@/.libs src/@TARGETDIR@/_libs
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:

449
libffi/configure vendored
View File

@ -2508,7 +2508,6 @@ fi
TARGETDIR="unknown" TARGETDIR="unknown"
case "$host" in case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
@ -2525,6 +2524,7 @@ alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=A
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
mips64*-*);; mips64*-*);;
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;;
mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
@ -2548,21 +2548,12 @@ fi
if test ${TARGET}${ac_cv_prog_gcc} = MIPSyes; then if test x$TARGET = xMIPS_IRIX; then
MIPS_GCC_TRUE= MIPS_IRIX_TRUE=
MIPS_GCC_FALSE='#' MIPS_IRIX_FALSE='#'
else else
MIPS_GCC_TRUE='#' MIPS_IRIX_TRUE='#'
MIPS_GCC_FALSE= MIPS_IRIX_FALSE=
fi
if test ${TARGET}${ac_cv_prog_gcc} = MIPSno; then
MIPS_SGI_TRUE=
MIPS_SGI_FALSE='#'
else
MIPS_SGI_TRUE='#'
MIPS_SGI_FALSE=
fi fi
@ -2700,12 +2691,13 @@ else
SH64_FALSE= SH64_FALSE=
fi fi
if test x$TARGET = xMIPS_LINUX; then case x$TARGET in
TARGET=MIPS xMIPS*) TARGET=MIPS ;;
fi *) ;;
esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2709: checking how to run the C preprocessor" >&5 echo "configure:2701: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory. # On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then if test -n "$CPP" && test -d "$CPP"; then
CPP= CPP=
@ -2720,13 +2712,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser, # On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. # not just through cpp.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2724 "configure" #line 2716 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -2737,13 +2729,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp" CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2741 "configure" #line 2733 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -2754,13 +2746,13 @@ else
rm -rf conftest* rm -rf conftest*
CPP="${CC-cc} -nologo -E" CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2758 "configure" #line 2750 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <assert.h> #include <assert.h>
Syntax Error Syntax Error
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
@ -2785,12 +2777,12 @@ fi
echo "$ac_t""$CPP" 1>&6 echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2789: checking for ANSI C header files" >&5 echo "configure:2781: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2794 "configure" #line 2786 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -2798,7 +2790,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2815,7 +2807,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2819 "configure" #line 2811 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -2833,7 +2825,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2837 "configure" #line 2829 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -2854,7 +2846,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2858 "configure" #line 2850 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2865,7 +2857,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
: :
else else
@ -2891,12 +2883,12 @@ fi
for ac_func in memcpy for ac_func in memcpy
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2895: checking for $ac_func" >&5 echo "configure:2887: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2900 "configure" #line 2892 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -2919,7 +2911,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -2946,19 +2938,19 @@ done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless! # for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:2950: checking for working alloca.h" >&5 echo "configure:2942: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2955 "configure" #line 2947 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <alloca.h> #include <alloca.h>
int main() { int main() {
char *p = alloca(2 * sizeof(int)); char *p = alloca(2 * sizeof(int));
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:2954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_header_alloca_h=yes ac_cv_header_alloca_h=yes
else else
@ -2979,12 +2971,12 @@ EOF
fi fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6 echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:2983: checking for alloca" >&5 echo "configure:2975: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2988 "configure" #line 2980 "configure"
#include "confdefs.h" #include "confdefs.h"
#ifdef __GNUC__ #ifdef __GNUC__
@ -3012,7 +3004,7 @@ int main() {
char *p = (char *) alloca(1); char *p = (char *) alloca(1);
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_func_alloca_works=yes ac_cv_func_alloca_works=yes
else else
@ -3044,12 +3036,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:3048: checking whether alloca needs Cray hooks" >&5 echo "configure:3040: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3053 "configure" #line 3045 "configure"
#include "confdefs.h" #include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2) #if defined(CRAY) && ! defined(CRAY2)
webecray webecray
@ -3074,12 +3066,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3078: checking for $ac_func" >&5 echo "configure:3070: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3083 "configure" #line 3075 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -3102,7 +3094,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -3129,7 +3121,7 @@ done
fi fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:3133: checking stack direction for C alloca" >&5 echo "configure:3125: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -3137,7 +3129,7 @@ else
ac_cv_c_stack_direction=0 ac_cv_c_stack_direction=0
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3141 "configure" #line 3133 "configure"
#include "confdefs.h" #include "confdefs.h"
find_stack_direction () find_stack_direction ()
{ {
@ -3156,7 +3148,7 @@ main ()
exit (find_stack_direction() < 0); exit (find_stack_direction() < 0);
} }
EOF EOF
if { (eval echo configure:3160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_stack_direction=1 ac_cv_c_stack_direction=1
else else
@ -3178,209 +3170,14 @@ EOF
fi fi
echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:3183: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
#line 3189 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (short) == $ac_size):;
; return 0; }
EOF
if { (eval echo configure:3199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_short=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_short != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_short = x ; then
{ echo "configure: error: cannot determine a size for short" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_short" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:3222: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
#line 3228 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (int) == $ac_size):;
; return 0; }
EOF
if { (eval echo configure:3238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_int=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_int != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_int = x ; then
{ echo "configure: error: cannot determine a size for int" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:3261: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
#line 3267 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (long) == $ac_size):;
; return 0; }
EOF
if { (eval echo configure:3277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_long != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_long = x ; then
{ echo "configure: error: cannot determine a size for long" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:3300: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
#line 3306 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (long long) == $ac_size):;
; return 0; }
EOF
if { (eval echo configure:3316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_long=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_long_long != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_long_long = x ; then
{ echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
echo "configure:3339: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
#line 3345 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (float) == $ac_size):;
; return 0; }
EOF
if { (eval echo configure:3355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_float=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_float != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_float = x ; then
{ echo "configure: error: cannot determine a size for float" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_float" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_FLOAT $ac_cv_sizeof_float
EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6 echo $ac_n "checking size of double""... $ac_c" 1>&6
echo "configure:3378: checking size of double" >&5 echo "configure:3175: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3384 "configure" #line 3181 "configure"
#include "confdefs.h" #include "confdefs.h"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -3390,7 +3187,7 @@ int main() {
switch (0) case 0: case (sizeof (double) == $ac_size):; switch (0) case 0: case (sizeof (double) == $ac_size):;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_sizeof_double=$ac_size ac_cv_sizeof_double=$ac_size
else else
@ -3413,13 +3210,13 @@ EOF
echo $ac_n "checking size of long double""... $ac_c" 1>&6 echo $ac_n "checking size of long double""... $ac_c" 1>&6
echo "configure:3417: checking size of long double" >&5 echo "configure:3214: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3423 "configure" #line 3220 "configure"
#include "confdefs.h" #include "confdefs.h"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
@ -3429,7 +3226,7 @@ int main() {
switch (0) case 0: case (sizeof (long double) == $ac_size):; switch (0) case 0: case (sizeof (long double) == $ac_size):;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_sizeof_long_double=$ac_size ac_cv_sizeof_long_double=$ac_size
else else
@ -3452,54 +3249,28 @@ EOF
echo $ac_n "checking size of void *""... $ac_c" 1>&6 # Also AC_SUBST this variable for ffi.h.
echo "configure:3457: checking size of void *" >&5 HAVE_LONG_DOUBLE=0
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
echo $ac_n "(cached) $ac_c" 1>&6 if test $ac_cv_sizeof_long_double != 0; then
else HAVE_LONG_DOUBLE=1
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat >> confdefs.h <<\EOF
cat > conftest.$ac_ext <<EOF #define HAVE_LONG_DOUBLE 1
#line 3463 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF EOF
if { (eval echo configure:3473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test x$ac_cv_sizeof_void_p != x ; then break; fi
done
fi
fi fi
if test x$ac_cv_sizeof_void_p = x ; then
{ echo "configure: error: cannot determine a size for void *" 1>&2; exit 1; }
fi
echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
EOF
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:3496: checking whether byte ordering is bigendian" >&5 echo "configure:3267: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_cv_c_bigendian=unknown ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro. # See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3503 "configure" #line 3274 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -3510,11 +3281,11 @@ int main() {
#endif #endif
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not. # It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3518 "configure" #line 3289 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
@ -3525,7 +3296,7 @@ int main() {
#endif #endif
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_bigendian=yes ac_cv_c_bigendian=yes
else else
@ -3545,7 +3316,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6 echo $ac_n "cross-compiling... " 2>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3549 "configure" #line 3320 "configure"
#include "confdefs.h" #include "confdefs.h"
main () { main () {
/* Are we little or big endian? From Harbison&Steele. */ /* Are we little or big endian? From Harbison&Steele. */
@ -3558,7 +3329,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1); exit (u.c[sizeof (long) - 1] == 1);
} }
EOF EOF
if { (eval echo configure:3562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:3333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_bigendian=no ac_cv_c_bigendian=no
else else
@ -3576,7 +3347,7 @@ fi
echo "$ac_t""$ac_cv_c_bigendian" 1>&6 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = unknown; then if test $ac_cv_c_bigendian = unknown; then
echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
echo "configure:3580: checking to probe for byte ordering" >&5 echo "configure:3351: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@ -3630,7 +3401,7 @@ fi
if test x$TARGET = xSPARC; then if test x$TARGET = xSPARC; then
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
echo "configure:3634: checking assembler and linker support unaligned pc related relocs" >&5 echo "configure:3405: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -3640,14 +3411,14 @@ else
CFLAGS="$CFLAGS -fpic" CFLAGS="$CFLAGS -fpic"
LDFLAGS="$LDFLAGS -shared" LDFLAGS="$LDFLAGS -shared"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3644 "configure" #line 3415 "configure"
#include "confdefs.h" #include "confdefs.h"
asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text"); asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
libffi_cv_as_sparc_ua_pcrel=yes libffi_cv_as_sparc_ua_pcrel=yes
else else
@ -3670,7 +3441,7 @@ EOF
fi fi
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
echo "configure:3674: checking assembler .register pseudo-op support" >&5 echo "configure:3445: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -3678,14 +3449,14 @@ else
libffi_cv_as_register_pseudo_op=unknown libffi_cv_as_register_pseudo_op=unknown
# Check if we have .register # Check if we have .register
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3682 "configure" #line 3453 "configure"
#include "confdefs.h" #include "confdefs.h"
asm (".register %g2, #scratch"); asm (".register %g2, #scratch");
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
libffi_cv_as_register_pseudo_op=yes libffi_cv_as_register_pseudo_op=yes
else else
@ -3708,7 +3479,7 @@ EOF
fi fi
echo $ac_n "checking whether .eh_frame section should be read-only""... $ac_c" 1>&6 echo $ac_n "checking whether .eh_frame section should be read-only""... $ac_c" 1>&6
echo "configure:3712: checking whether .eh_frame section should be read-only" >&5 echo "configure:3483: checking whether .eh_frame section should be read-only" >&5
if eval "test \"`echo '$''{'libffi_cv_ro_eh_frame'+set}'`\" = set"; then if eval "test \"`echo '$''{'libffi_cv_ro_eh_frame'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -3731,6 +3502,15 @@ echo "$ac_t""$libffi_cv_ro_eh_frame" 1>&6
if test "x$libffi_cv_ro_eh_frame" = xyes; then if test "x$libffi_cv_ro_eh_frame" = xyes; then
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define HAVE_RO_EH_FRAME 1 #define HAVE_RO_EH_FRAME 1
EOF
cat >> confdefs.h <<\EOF
#define EH_FRAME_FLAGS "a"
EOF
else
cat >> confdefs.h <<\EOF
#define EH_FRAME_FLAGS "aw"
EOF EOF
fi fi
@ -3983,10 +3763,8 @@ s%@MAINT@%$MAINT%g
s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g
s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g
s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g
s%@MIPS_GCC_TRUE@%$MIPS_GCC_TRUE%g s%@MIPS_IRIX_TRUE@%$MIPS_IRIX_TRUE%g
s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g s%@MIPS_IRIX_FALSE@%$MIPS_IRIX_FALSE%g
s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g
s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g
s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g
s%@SPARC_TRUE@%$SPARC_TRUE%g s%@SPARC_TRUE@%$SPARC_TRUE%g
@ -4019,6 +3797,7 @@ s%@SH64_TRUE@%$SH64_TRUE%g
s%@SH64_FALSE@%$SH64_FALSE%g s%@SH64_FALSE@%$SH64_FALSE%g
s%@CPP@%$CPP%g s%@CPP@%$CPP%g
s%@ALLOCA@%$ALLOCA%g s%@ALLOCA@%$ALLOCA%g
s%@HAVE_LONG_DOUBLE@%$HAVE_LONG_DOUBLE%g
s%@TARGET@%$TARGET%g s%@TARGET@%$TARGET%g
s%@TARGETDIR@%$TARGETDIR%g s%@TARGETDIR@%$TARGETDIR%g
s%@toolexecdir@%$toolexecdir%g s%@toolexecdir@%$toolexecdir%g
@ -4230,6 +4009,51 @@ cat >> $CONFIG_STATUS <<\EOF
fi fi
fi; done fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
ac_sources="src/$TARGETDIR/ffitarget.h"
ac_dests="include/ffitarget.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
srcdir=$ac_given_srcdir
while test -n "$ac_sources"; do
set $ac_dests; ac_dest=$1; shift; ac_dests=$*
set $ac_sources; ac_source=$1; shift; ac_sources=$*
echo "linking $srcdir/$ac_source to $ac_dest"
if test ! -r $srcdir/$ac_source; then
{ echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
fi
rm -f $ac_dest
# Make relative symlinks.
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
else
ac_dest_dir_suffix= ac_dots=
fi
case "$srcdir" in
[/$]*) ac_rel_source="$srcdir/$ac_source" ;;
*) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
esac
# Make a symlink if possible; otherwise try a hard link.
if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
ln $srcdir/$ac_source $ac_dest; then :
else
{ echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
fi
done
EOF EOF
cat >> $CONFIG_STATUS <<EOF cat >> $CONFIG_STATUS <<EOF
@ -4243,14 +4067,13 @@ libffi_basedir=${libffi_basedir}
CC="${CC}" CC="${CC}"
DEFS="$DEFS" DEFS="$DEFS"
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
test ! -d include && mkdir include
test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h # Make target subdirectories if required.
if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then test -d src || mkdir src
echo fficonfig.h unchanged test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
else test -d include || mkdir include
echo Moving fficonfig.h to include/fficonfig.h
cp fficonfig.h include/fficonfig.h
fi
EOF EOF
cat >> $CONFIG_STATUS <<\EOF cat >> $CONFIG_STATUS <<\EOF
@ -4267,7 +4090,3 @@ chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
# Make target subdirectories if required.
test -d src || mkdir src
test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}

View File

@ -52,7 +52,6 @@ AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
TARGETDIR="unknown" TARGETDIR="unknown"
case "$host" in case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;; i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;; i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
@ -69,6 +68,7 @@ alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=A
ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
mips64*-*);; mips64*-*);;
mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS_IRIX; TARGETDIR=mips;;
mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc*-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
@ -90,8 +90,7 @@ if test $TARGETDIR = unknown; then
AC_ERROR("libffi has not been ported to $host.") AC_ERROR("libffi has not been ported to $host.")
fi fi
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) AM_CONDITIONAL(MIPS_IRIX, test x$TARGET = xMIPS_IRIX)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(X86, test x$TARGET = xX86)
@ -108,24 +107,28 @@ AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64)
AM_CONDITIONAL(SH, test x$TARGET = xSH) AM_CONDITIONAL(SH, test x$TARGET = xSH)
AM_CONDITIONAL(SH64, test x$TARGET = xSH64) AM_CONDITIONAL(SH64, test x$TARGET = xSH64)
if test x$TARGET = xMIPS_LINUX; then case x$TARGET in
TARGET=MIPS xMIPS*) TARGET=MIPS ;;
fi *) ;;
esac
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_FUNCS(memcpy) AC_CHECK_FUNCS(memcpy)
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
dnl AC_CHECK_SIZEOF(char)
AC_COMPILE_CHECK_SIZEOF(short)
AC_COMPILE_CHECK_SIZEOF(int)
AC_COMPILE_CHECK_SIZEOF(long)
AC_COMPILE_CHECK_SIZEOF(long long)
AC_COMPILE_CHECK_SIZEOF(float)
AC_COMPILE_CHECK_SIZEOF(double) AC_COMPILE_CHECK_SIZEOF(double)
AC_COMPILE_CHECK_SIZEOF(long double) AC_COMPILE_CHECK_SIZEOF(long double)
AC_COMPILE_CHECK_SIZEOF(void *) # Also AC_SUBST this variable for ffi.h.
HAVE_LONG_DOUBLE=0
if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
if test $ac_cv_sizeof_long_double != 0; then
HAVE_LONG_DOUBLE=1
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
fi
fi
AC_SUBST(HAVE_LONG_DOUBLE)
AC_C_BIGENDIAN_CROSS AC_C_BIGENDIAN_CROSS
if test x$TARGET = xSPARC; then if test x$TARGET = xSPARC; then
@ -176,6 +179,11 @@ AC_CACHE_CHECK([whether .eh_frame section should be read-only],
if test "x$libffi_cv_ro_eh_frame" = xyes; then if test "x$libffi_cv_ro_eh_frame" = xyes; then
AC_DEFINE(HAVE_RO_EH_FRAME, 1, AC_DEFINE(HAVE_RO_EH_FRAME, 1,
[Define if .eh_frame sections should be read-only.]) [Define if .eh_frame sections should be read-only.])
AC_DEFINE(EH_FRAME_FLAGS, "a",
[Define to the flags needed for the .section .eh_frame directive.])
else
AC_DEFINE(EH_FRAME_FLAGS, "aw",
[Define to the flags needed for the .section .eh_frame directive.])
fi fi
AC_SUBST(TARGET) AC_SUBST(TARGET)
@ -186,25 +194,25 @@ AC_SUBST(SHELL)
AC_ARG_ENABLE(debug, AC_ARG_ENABLE(debug,
[ --enable-debug debugging mode], [ --enable-debug debugging mode],
if test "$enable_debug" = "yes"; then if test "$enable_debug" = "yes"; then
AC_DEFINE(FFI_DEBUG) AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
fi) fi)
AC_ARG_ENABLE(structs, AC_ARG_ENABLE(structs,
[ --disable-structs omit code for struct support], [ --disable-structs omit code for struct support],
if test "$enable_structs" = "no"; then if test "$enable_structs" = "no"; then
AC_DEFINE(FFI_NO_STRUCTS) AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.])
fi) fi)
AC_ARG_ENABLE(raw-api, AC_ARG_ENABLE(raw-api,
[ --disable-raw-api make the raw api unavailable], [ --disable-raw-api make the raw api unavailable],
if test "$enable_raw_api" = "no"; then if test "$enable_raw_api" = "no"; then
AC_DEFINE(FFI_NO_RAW_API) AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.])
fi) fi)
AC_ARG_ENABLE(purify-safety, AC_ARG_ENABLE(purify-safety,
[ --enable-purify-safety purify-safe mode], [ --enable-purify-safety purify-safe mode],
if test "$enable_purify_safety" = "yes"; then if test "$enable_purify_safety" = "yes"; then
AC_DEFINE(USING_PURIFY) AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
fi) fi)
if test -n "$with_cross_host" && if test -n "$with_cross_host" &&
@ -246,16 +254,11 @@ libffi_basedir=${libffi_basedir}
CC="${CC}" CC="${CC}"
DEFS="$DEFS" DEFS="$DEFS"
ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
test ! -d include && mkdir include
test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h
if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then
echo fficonfig.h unchanged
else
echo Moving fficonfig.h to include/fficonfig.h
cp fficonfig.h include/fficonfig.h
fi
)
# Make target subdirectories if required. # Make target subdirectories if required.
test -d src || mkdir src test -d src || mkdir src
test -d src/${TARGETDIR} || mkdir src/${TARGETDIR} test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
test -d include || mkdir include
AC_LINK_FILES(src/$TARGETDIR/ffitarget.h, include/ffitarget.h)
)

View File

@ -25,49 +25,25 @@
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* Define this if you want extra debugging */
#undef FFI_DEBUG
/* Define this if you are using Purify and want to suppress
spurious messages. */
#undef USING_PURIFY
/* Define this is you do not want support for aggregate types. */
#undef FFI_NO_STRUCTS
/* Define this is you do not want support for the raw API. */
#undef FFI_NO_RAW_API
/* Define if you have the memcpy function. */ /* Define if you have the memcpy function. */
#undef HAVE_MEMCPY #undef HAVE_MEMCPY
/* The number of bytes in type short */
#undef SIZEOF_SHORT
/* The number of bytes in type int */
#undef SIZEOF_INT
/* The number of bytes in type long */
#undef SIZEOF_LONG
/* The number of bytes in type long long */
#undef SIZEOF_LONG_LONG
/* The number of bytes in type float */
#undef SIZEOF_FLOAT
/* The number of bytes in type double */ /* The number of bytes in type double */
#undef SIZEOF_DOUBLE #undef SIZEOF_DOUBLE
/* The number of bytes in type long double */ /* The number of bytes in type long double */
#undef SIZEOF_LONG_DOUBLE #undef SIZEOF_LONG_DOUBLE
/* The number of bytes in type void * */ /* Define if you have the long double type and it is bigger than a double */
#undef SIZEOF_VOID_P #undef HAVE_LONG_DOUBLE
/* whether byteorder is bigendian */ /* whether byteorder is bigendian */
#undef WORDS_BIGENDIAN #undef WORDS_BIGENDIAN
/* Define if the host machine stores words of multi-word integers in
big-endian order. */
#undef HOST_WORDS_BIG_ENDIAN
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#undef BYTEORDER #undef BYTEORDER
@ -79,3 +55,22 @@
/* Define if .eh_frame sections should be read-only. */ /* Define if .eh_frame sections should be read-only. */
#undef HAVE_RO_EH_FRAME #undef HAVE_RO_EH_FRAME
/* Define to the flags needed for the .section .eh_frame directive. */
#undef EH_FRAME_FLAGS
/* Define to the flags needed for the .section .eh_frame directive. */
#undef EH_FRAME_FLAGS
/* Define this if you want extra debugging. */
#undef FFI_DEBUG
/* Define this is you do not want support for aggregate types. */
#undef FFI_NO_STRUCTS
/* Define this is you do not want support for the raw API. */
#undef FFI_NO_RAW_API
/* Define this if you are using Purify and want to suppress spurious messages. */
#undef USING_PURIFY

View File

@ -1,9 +1,10 @@
## Process this with automake to create Makefile.in ## Process this with automake to create Makefile.in
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS=foreign
EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h DISTCLEANFILES=ffitarget.h
EXTRA_DIST=ffi.h.in ffi_common.h
hackdir=$(includedir) hackdir=$(includedir)
hack_DATA=fficonfig.h ffi.h ffi_mips.h hack_DATA=ffitarget.h ffi.h

View File

@ -72,6 +72,7 @@ DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
GCJ = @GCJ@ GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@ GCJFLAGS = @GCJFLAGS@
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@ LN_S = @LN_S@
MAINT = @MAINT@ MAINT = @MAINT@
@ -91,11 +92,12 @@ toolexeclibdir = @toolexeclibdir@
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h DISTCLEANFILES = ffitarget.h
EXTRA_DIST = ffi.h.in ffi_common.h
hackdir = $(includedir) hackdir = $(includedir)
hack_DATA = fficonfig.h ffi.h ffi_mips.h hack_DATA = ffitarget.h ffi.h
mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs
CONFIG_HEADER = ../fficonfig.h CONFIG_HEADER = ../fficonfig.h
CONFIG_CLEAN_FILES = ffi.h CONFIG_CLEAN_FILES = ffi.h
@ -196,6 +198,7 @@ clean-generic:
distclean-generic: distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]* -rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic mostlyclean-am: mostlyclean-generic

View File

@ -1,5 +1,5 @@
/* -----------------------------------------------------------------*-C-*- /* -----------------------------------------------------------------*-C-*-
libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions libffi @VERSION@ - Copyright (c) 1996-2003 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
@ -60,258 +60,70 @@ extern "C" {
/* ---- System configuration information --------------------------------- */ /* ---- System configuration information --------------------------------- */
#include <fficonfig.h> #include <ffitarget.h>
#ifndef LIBFFI_ASM
#if !defined(LIBFFI_ASM)
#include <stddef.h> #include <stddef.h>
#if defined(FFI_DEBUG) #include <limits.h>
#include <stdio.h>
#endif
#endif
/* ---- Generic type definitions ----------------------------------------- */
#define FLOAT32 float
#define FLOAT64 double
#define FLOAT80 long double
#define UINT8 unsigned char
#define SINT8 signed char
#if SIZEOF_INT == 2
#define UINT16 unsigned int
#define SINT16 int
#define ffi_type_uint ffi_type_uint16
#define ffi_type_sint ffi_type_sint16
#else
#if SIZEOF_SHORT == 2
#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 SINT32 int
#define ffi_type_uint ffi_type_uint32
#define ffi_type_sint ffi_type_sint32
#else
#if SIZEOF_SHORT == 4
#define UINT32 unsigned short
#define SINT32 short
#define ffi_type_ushort ffi_type_uint32
#define ffi_type_sshort ffi_type_sint32
/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
But we can find it either under the correct ANSI name, or under GNU
C's internal name. */
#ifdef LONG_LONG_MAX
# define FFI_LONG_LONG_MAX LONG_LONG_MAX
#else #else
#if SIZEOF_LONG == 4 # ifdef LLONG_MAX
# define FFI_LONG_LONG_MAX LLONG_MAX
#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
#else
#if SIZEOF_LONG == 8
#define UINT64 unsigned long
#define SINT64 long
#define ffi_type_ulong ffi_type_uint64
#define ffi_type_slong ffi_type_sint64
#else
#if SIZEOF_LONG_LONG == 8
#define UINT64 unsigned long long
#define SINT64 long long
#define ffi_type_ulong ffi_type_uint64
#define ffi_type_slong ffi_type_sint64
#endif
#endif
#endif
/* ---- System specific configurations ----------------------------------- */
#ifdef MIPS
#include <ffi_mips.h>
#else
#define SIZEOF_ARG SIZEOF_VOID_P
#endif
#ifdef POWERPC
#if defined (__powerpc64__)
#define POWERPC64
#endif
#endif
#ifdef SPARC
#if defined(__arch64__) || defined(__sparcv9)
#define SPARC64
#endif
#endif
#ifdef S390
#if defined (__s390x__)
#define S390X
#endif
#endif
#ifdef X86_64
#if defined (__i386__)
#undef X86_64
#define X86
#endif
#endif
#ifdef LIBFFI_ASM
#ifdef HAVE_RO_EH_FRAME
#define EH_FRAME_FLAGS "a"
#else
#define EH_FRAME_FLAGS "aw"
#endif
#else
/* ---- Generic type definitions ----------------------------------------- */
#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
/* The closure code assumes that this works on pointers, i.e. a size_t */
/* can hold a pointer. */
typedef enum ffi_abi {
/* Leave this for debugging purposes */
FFI_FIRST_ABI = 0,
/* ---- Sparc -------------------- */
#ifdef SPARC
FFI_V8,
FFI_V8PLUS,
FFI_V9,
#ifdef SPARC64
FFI_DEFAULT_ABI = FFI_V9,
#else
FFI_DEFAULT_ABI = FFI_V8,
#endif
#endif
/* ---- Intel x86 Win32 ---------- */
#ifdef X86_WIN32
FFI_SYSV,
FFI_STDCALL,
/* TODO: Add fastcall support for the sake of completeness */
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
/* ---- Intel x86 and AMD x86-64 - */
#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
FFI_SYSV,
FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
#ifdef __i386__
FFI_DEFAULT_ABI = FFI_SYSV,
#else
FFI_DEFAULT_ABI = FFI_UNIX64,
#endif
#endif
/* ---- Intel ia64 ---------------- */
#ifdef IA64
FFI_UNIX, /* Linux and all Unix variants use the same conventions */
FFI_DEFAULT_ABI = FFI_UNIX,
#endif
/* ---- Mips --------------------- */
#ifdef MIPS
FFI_O32,
FFI_N32,
FFI_N64,
#endif
/* ---- Alpha -------------------- */
#ifdef ALPHA
FFI_OSF,
FFI_DEFAULT_ABI = FFI_OSF,
#endif
/* ---- Motorola m68k ------------ */
#ifdef M68K
FFI_SYSV,
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
/* ---- PowerPC ------------------ */
#ifdef POWERPC
FFI_SYSV,
FFI_GCC_SYSV,
FFI_LINUX64,
# ifdef POWERPC64
FFI_DEFAULT_ABI = FFI_LINUX64,
# else # else
FFI_DEFAULT_ABI = FFI_GCC_SYSV, # ifdef __GNUC__
# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
# endif
# endif # endif
#endif #endif
#ifdef POWERPC_AIX #if SCHAR_MAX == 127
FFI_AIX, # define ffi_type_uchar ffi_type_uint8
FFI_DARWIN, # define ffi_type_schar ffi_type_sint8
FFI_DEFAULT_ABI = FFI_AIX, #else
#error "char size not supported"
#endif #endif
#ifdef POWERPC_DARWIN #if SHRT_MAX == 32767
FFI_AIX, # define ffi_type_ushort ffi_type_uint16
FFI_DARWIN, # define ffi_type_sshort ffi_type_sint16
FFI_DEFAULT_ABI = FFI_DARWIN, #elif SHRT_MAX == 2147483647
# define ffi_type_ushort ffi_type_uint32
# define ffi_type_sshort ffi_type_sint32
#else
#error "short size not supported"
#endif #endif
/* ---- ARM --------------------- */ #if INT_MAX == 32767
#ifdef ARM # define ffi_type_uint ffi_type_uint16
FFI_SYSV, # define ffi_type_sint ffi_type_sint16
FFI_DEFAULT_ABI = FFI_SYSV, #elif INT_MAX == 2147483647
# define ffi_type_uint ffi_type_uint32
# define ffi_type_sint ffi_type_sint32
#elif INT_MAX == 9223372036854775807
# define ffi_type_uint ffi_type_uint64
# define ffi_type_sint ffi_type_sint64
#else
#error "int size not supported"
#endif #endif
/* ---- S390 --------------------- */ #define ffi_type_ulong ffi_type_uint64
#ifdef S390 #define ffi_type_slong ffi_type_sint64
FFI_SYSV, #if LONG_MAX == 2147483647
FFI_DEFAULT_ABI = FFI_SYSV, # if FFI_LONG_LONG_MAX != 9223372036854775807
#error "no 64-bit data type supported"
# endif
#elif LONG_MAX != 9223372036854775807
#error "long size not supported"
#endif #endif
/* ---- SuperH ------------------- */ /* The closure code assumes that this works on pointers, i.e. a size_t */
#ifdef SH /* can hold a pointer. */
FFI_SYSV,
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
/* ---- SuperH - SHmedia --------- */
#ifdef SH64
FFI_SYSV,
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
/* Leave this for debugging purposes */
FFI_LAST_ABI
} ffi_abi;
typedef struct _ffi_type typedef struct _ffi_type
{ {
@ -336,9 +148,6 @@ extern ffi_type ffi_type_double;
extern ffi_type ffi_type_longdouble; extern ffi_type ffi_type_longdouble;
extern ffi_type ffi_type_pointer; extern ffi_type ffi_type_pointer;
/* Characters are 8 bit integral types */
#define ffi_type_schar ffi_type_sint8
#define ffi_type_uchar ffi_type_uint8
typedef enum { typedef enum {
FFI_OK = 0, FFI_OK = 0,
@ -355,53 +164,27 @@ typedef struct {
/*@dependent@*/ ffi_type *rtype; /*@dependent@*/ ffi_type *rtype;
unsigned bytes; unsigned bytes;
unsigned flags; unsigned flags;
#ifdef FFI_EXTRA_CIF_FIELDS
#ifdef MIPS FFI_EXTRA_CIF_FIELDS;
#if _MIPS_SIM == _ABIN32
unsigned rstruct_flag;
#endif #endif
#endif
#ifdef SH64
long long flags2;
#endif
} ffi_cif; } ffi_cif;
#if SIZEOF_ARG == 4
typedef UINT32 ffi_arg;
#else
#if SIZEOF_ARG == 8
typedef UINT64 ffi_arg;
#else
-- unsupported configuration
#endif
#endif
/* ---- Definitions for the raw API -------------------------------------- */ /* ---- Definitions for the raw API -------------------------------------- */
#if !FFI_NO_RAW_API #ifndef FFI_SIZEOF_ARG
# if LONG_MAX == 2147483647
#if SIZEOF_ARG == 4 # define FFI_SIZEOF_ARG 4
# elif LONG_MAX == 9223372036854775807
#define UINT_ARG UINT32 # define FFI_SIZEOF_ARG 8
#define SINT_ARG SINT32 # endif
#endif
#if SIZEOF_ARG == 8
#define UINT_ARG UINT64
#define SINT_ARG SINT64
#endif #endif
typedef union { typedef union {
SINT_ARG sint; ffi_sarg sint;
UINT_ARG uint; ffi_arg uint;
float flt; float flt;
char data[SIZEOF_ARG]; char data[FFI_SIZEOF_ARG];
void* ptr; void* ptr;
} ffi_raw; } ffi_raw;
void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, void ffi_raw_call (/*@dependent@*/ ffi_cif *cif,
@ -413,8 +196,6 @@ void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
size_t ffi_raw_size (ffi_cif *cif); size_t ffi_raw_size (ffi_cif *cif);
#if !NO_JAVA_RAW_API
/* This is analogous to the raw API, except it uses Java parameter */ /* This is analogous to the raw API, except it uses Java parameter */
/* packing, even on 64-bit machines. I.e. on 64-bit machines */ /* packing, even on 64-bit machines. I.e. on 64-bit machines */
/* longs and doubles are followed by an empty 64-bit word. */ /* longs and doubles are followed by an empty 64-bit word. */
@ -428,120 +209,8 @@ void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
size_t ffi_java_raw_size (ffi_cif *cif); size_t ffi_java_raw_size (ffi_cif *cif);
#endif /* !NO_JAVA_RAW_API */
#endif /* !FFI_NO_RAW_API */
/* ---- Definitions for closures ----------------------------------------- */ /* ---- Definitions for closures ----------------------------------------- */
#ifdef __i386__
#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
#define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */
/* can be interpreted as a C function */
/* decriptor: */
struct ffi_ia64_trampoline_struct {
void * code_pointer; /* Pointer to ffi_closure_UNIX */
void * fake_gp; /* Pointer to closure, installed as gp */
void * real_gp; /* Real gp value, reinstalled by */
/* ffi_closure_UNIX. */
};
#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
#ifdef POWERPC64
#define FFI_TRAMPOLINE_SIZE 24
#else
#define FFI_TRAMPOLINE_SIZE 40
#endif
#define FFI_NATIVE_RAW_API 0
#elif defined(POWERPC_DARWIN)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 40
#define FFI_NATIVE_RAW_API 0
#elif defined(POWERPC_AIX)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 24 /* see struct below */
#define FFI_NATIVE_RAW_API 0
#elif defined(SPARC64)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_NATIVE_RAW_API 0
#elif defined(SPARC)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 16
#define FFI_NATIVE_RAW_API 0
#elif defined(S390)
#define FFI_CLOSURES 1
#ifdef S390X
#define FFI_TRAMPOLINE_SIZE 32
#else
#define FFI_TRAMPOLINE_SIZE 16
#endif
#define FFI_NATIVE_RAW_API 0
#elif defined(SH)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 16
#define FFI_NATIVE_RAW_API 0
#elif defined(SH64)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 32
#define FFI_NATIVE_RAW_API 0
#elif defined(__x86_64__)
#define FFI_CLOSURES 1
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_NATIVE_RAW_API 0
#else
#define FFI_CLOSURES 0
#define FFI_NATIVE_RAW_API 0
#endif
#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX)
struct ffi_aix_trampoline_struct {
void * code_pointer; /* Pointer to ffi_closure_ASM */
void * toc; /* TOC */
void * static_chain; /* Pointer to closure */
};
#endif
#if FFI_CLOSURES #if FFI_CLOSURES
typedef struct { typedef struct {
@ -557,8 +226,6 @@ ffi_prep_closure (ffi_closure*,
void (*fun)(ffi_cif*,void*,void**,void*), void (*fun)(ffi_cif*,void*,void**,void*),
void *user_data); void *user_data);
#if !FFI_NO_RAW_API
typedef struct { typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE]; char tramp[FFI_TRAMPOLINE_SIZE];
@ -586,15 +253,12 @@ ffi_prep_raw_closure (ffi_raw_closure*,
void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
void *user_data); void *user_data);
#ifndef NO_JAVA_RAW_API
ffi_status ffi_status
ffi_prep_java_raw_closure (ffi_raw_closure*, ffi_prep_java_raw_closure (ffi_raw_closure*,
ffi_cif *cif, ffi_cif *cif,
void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
void *user_data); void *user_data);
#endif
#endif /* !FFI_NO_RAW_API */
#endif /* FFI_CLOSURES */ #endif /* FFI_CLOSURES */
/* ---- Public interface definition -------------------------------------- */ /* ---- Public interface definition -------------------------------------- */
@ -617,25 +281,25 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
#endif #endif
/* If these change, update src/mips/ffitarget.h. */
#define FFI_TYPE_VOID 0 #define FFI_TYPE_VOID 0
#define FFI_TYPE_INT 1 #define FFI_TYPE_INT 1
#define FFI_TYPE_FLOAT 2 #define FFI_TYPE_FLOAT 2
#define FFI_TYPE_DOUBLE 3 #define FFI_TYPE_DOUBLE 3
#if SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE #if @HAVE_LONG_DOUBLE@
#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
#else
#define FFI_TYPE_LONGDOUBLE 4 #define FFI_TYPE_LONGDOUBLE 4
#else
#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
#endif #endif
#define FFI_TYPE_UINT8 5
#define FFI_TYPE_UINT8 5 /* If this changes, update ffi_mips.h. */ #define FFI_TYPE_SINT8 6
#define FFI_TYPE_SINT8 6 /* If this changes, update ffi_mips.h. */
#define FFI_TYPE_UINT16 7 #define FFI_TYPE_UINT16 7
#define FFI_TYPE_SINT16 8 #define FFI_TYPE_SINT16 8
#define FFI_TYPE_UINT32 9 #define FFI_TYPE_UINT32 9
#define FFI_TYPE_SINT32 10 #define FFI_TYPE_SINT32 10
#define FFI_TYPE_UINT64 11 #define FFI_TYPE_UINT64 11
#define FFI_TYPE_SINT64 12 #define FFI_TYPE_SINT64 12
#define FFI_TYPE_STRUCT 13 /* If this changes, update ffi_mips.h. */ #define FFI_TYPE_STRUCT 13
#define FFI_TYPE_POINTER 14 #define FFI_TYPE_POINTER 14
/* This should always refer to the last type code (for sanity checks) */ /* This should always refer to the last type code (for sanity checks) */

View File

@ -1,7 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi_common.h - Copyright (c) 1996 Cygnus Solutions ffi_common.h - Copyright (c) 1996 Red Hat, Inc.
$Id: ffi_common.h,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
Common internal definitions and macros. Only necessary for building Common internal definitions and macros. Only necessary for building
libffi. libffi.
@ -14,6 +12,8 @@
extern "C" { extern "C" {
#endif #endif
#include <fficonfig.h>
/* Do not move this. Some versions of AIX are very picky about where /* Do not move this. Some versions of AIX are very picky about where
this is positioned. */ this is positioned. */
#ifdef __GNUC__ #ifdef __GNUC__
@ -41,36 +41,26 @@ char *alloca ();
# endif # endif
#endif #endif
#ifndef FALSE #if defined(FFI_DEBUG)
#define FALSE 0 #include <stdio.h>
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
#ifndef __cplusplus
/* bool is a keyword in C++ */
/*@-cppnames@*/
typedef int bool;
/*@=cppnames@*/
#endif #endif
#ifdef FFI_DEBUG #ifdef FFI_DEBUG
/*@exits@*/ void ffi_assert(/*@temp@*/ char *expr, /*@temp@*/ char *file, int line);
/* Debugging functions */
/*@exits@*/ int ffi_assert(/*@temp@*/ char *file, int line);
void ffi_stop_here(void); void ffi_stop_here(void);
bool ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a); void ffi_type_test(/*@temp@*/ /*@out@*/ ffi_type *a, /*@temp@*/ char *file, int line);
#define FFI_ASSERT(x) ((x) ? 0 : ffi_assert(__FILE__,__LINE__))
#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__)
#else #else
#define FFI_ASSERT(x) #define FFI_ASSERT(x)
#define FFI_ASSERT_AT(x, f, l)
#define FFI_ASSERT_VALID_TYPE(x)
#endif #endif
#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
/* Perform machine dependent cif processing */ /* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif); ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
@ -82,6 +72,19 @@ typedef struct
/*@dependent@*/ void **avalue; /*@dependent@*/ void **avalue;
} extended_cif; } extended_cif;
/* Terse sized type definitions. */
typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
typedef signed int SINT8 __attribute__((__mode__(__QI__)));
typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
typedef signed int SINT16 __attribute__((__mode__(__HI__)));
typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
typedef signed int SINT32 __attribute__((__mode__(__SI__)));
typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
typedef signed int SINT64 __attribute__((__mode__(__DI__)));
typedef float FLOAT32;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998, 2001 Cygnus Solutions ffi.c - Copyright (c) 1998, 2001 Red Hat, Inc.
Alpha Foreign Function Interface Alpha Foreign Function Interface
@ -37,8 +37,8 @@ ffi_prep_cif_machdep(ffi_cif *cif)
{ {
/* Adjust cif->bytes to represent a minimum 6 words for the temporary /* Adjust cif->bytes to represent a minimum 6 words for the temporary
register argument loading area. */ register argument loading area. */
if (cif->bytes < 6*SIZEOF_ARG) if (cif->bytes < 6*FFI_SIZEOF_ARG)
cif->bytes = 6*SIZEOF_ARG; cif->bytes = 6*FFI_SIZEOF_ARG;
/* Set the return type flag */ /* Set the return type flag */
switch (cif->rtype->type) switch (cif->rtype->type)
@ -73,7 +73,7 @@ ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue)
/* Allocate the space for the arguments, plus 4 words of temp /* Allocate the space for the arguments, plus 4 words of temp
space for ffi_call_osf. */ space for ffi_call_osf. */
argp = stack = alloca(cif->bytes + 4*SIZEOF_ARG); argp = stack = alloca(cif->bytes + 4*FFI_SIZEOF_ARG);
if (cif->flags == FFI_TYPE_STRUCT) if (cif->flags == FFI_TYPE_STRUCT)
*(void **) argp++ = rvalue; *(void **) argp++ = rvalue;
@ -137,7 +137,7 @@ ffi_call(ffi_cif *cif, void (*fn)(), void *rvalue, void **avalue)
FFI_ASSERT(0); FFI_ASSERT(0);
} }
argp += ALIGN((*arg_types)->size, SIZEOF_ARG) / SIZEOF_ARG; argp += ALIGN((*arg_types)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++, arg_types++, avalue++; i++, arg_types++, avalue++;
} }
@ -240,7 +240,7 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
FFI_ASSERT(0); FFI_ASSERT(0);
} }
argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++; i++;
} }

View File

@ -26,6 +26,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.arch ev6 .arch ev6

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998 Cygnus Solutions ffi.c - Copyright (c) 1998 Red Hat, Inc.
ARM Foreign Function Interface ARM Foreign Function Interface

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
sysv.S - Copyright (c) 1998 Cygnus Solutions sysv.S - Copyright (c) 1998 Red Hat, Inc.
ARM Foreign Function Interface ARM Foreign Function Interface
@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H #ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h> #include <machine/asm.h>

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
debug.c - Copyright (c) 1996 Cygnus Solutions debug.c - Copyright (c) 1996 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
@ -37,29 +37,23 @@ void ffi_stop_here(void)
/* This function should only be called via the FFI_ASSERT() macro */ /* This function should only be called via the FFI_ASSERT() macro */
int ffi_assert(char *file, int line) void ffi_assert(char *expr, char *file, int line)
{ {
fprintf(stderr, "ASSERTION FAILURE: %s line %d\n", file, line); fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line);
ffi_stop_here(); ffi_stop_here();
abort(); abort();
/* This has to return something for the compiler not to complain */
/*@notreached@*/
return 0;
} }
/* Perform a sanity check on an ffi_type structure */ /* Perform a sanity check on an ffi_type structure */
bool ffi_type_test(ffi_type *a) void ffi_type_test(ffi_type *a, char *file, int line)
{ {
/*@-usedef@*/ FFI_ASSERT_AT(a != NULL, file, line);
FFI_ASSERT(a->type <= FFI_TYPE_LAST);
FFI_ASSERT(a->type > FFI_TYPE_VOID ? a->size > 0 : 1);
FFI_ASSERT(a->type > FFI_TYPE_VOID ? a->alignment > 0 : 1);
FFI_ASSERT(a->type == FFI_TYPE_STRUCT ? a->elements != NULL : 1);
/*@=usedef@*/
/* This is a silly thing to return, but it keeps the compiler from /*@-usedef@*/
issuing warnings about "a" not being used in non-debug builds. */ FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line);
return (a != NULL); FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line);
FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line);
FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
/*@=usedef@*/
} }

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998 Cygnus Solutions ffi.c - Copyright (c) 1998 Red Hat, Inc.
Copyright (c) 2000 Hewlett Packard Company Copyright (c) 2000 Hewlett Packard Company
IA64 Foreign Function Interface IA64 Foreign Function Interface
@ -28,6 +28,7 @@
#include <ffi_common.h> #include <ffi_common.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include "ia64_flags.h" #include "ia64_flags.h"
@ -210,7 +211,7 @@ ffi_prep_args(struct ia64_args *stack, extended_cif *ecif, int bytes)
{ {
size_t sz = (*p_arg)->size; size_t sz = (*p_arg)->size;
unsigned short element_type; unsigned short element_type;
z = ((*p_arg)->size + SIZEOF_ARG - 1)/SIZEOF_ARG; z = ((*p_arg)->size + FFI_SIZEOF_ARG - 1)/FFI_SIZEOF_ARG;
if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) { if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) {
int i; int i;
int nelements = sz/float_type_size(element_type); int nelements = sz/float_type_size(element_type);
@ -596,7 +597,7 @@ ffi_prep_incoming_args_UNIX(struct ia64_args *args, void **rvalue,
{ {
size_t sz = (*p_arg)->size; size_t sz = (*p_arg)->size;
unsigned short element_type; unsigned short element_type;
z = ((*p_arg)->size + SIZEOF_ARG - 1)/SIZEOF_ARG; z = ((*p_arg)->size + FFI_SIZEOF_ARG - 1)/FFI_SIZEOF_ARG;
if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) { if (is_homogeneous_fp_aggregate(*p_arg, 8, &element_type)) {
int nelements = sz/float_type_size(element_type); int nelements = sz/float_type_size(element_type);
if (nelements + fp_reg_num >= 8) { if (nelements + fp_reg_num >= 8) {

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
unix.S - Copyright (c) 1998 Cygnus Solutions unix.S - Copyright (c) 1998 Red Hat, Inc.
Copyright (c) 2000 Hewlett Packard Company Copyright (c) 2000 Hewlett Packard Company
IA64/unix Foreign Function Interface IA64/unix Foreign Function Interface
@ -29,6 +29,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#include "ia64_flags.h" #include "ia64_flags.h"

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
java_raw_api.c - Copyright (c) 1999 Cygnus Solutions java_raw_api.c - Copyright (c) 1999 Red Hat, Inc.
Cloned from raw_api.c Cloned from raw_api.c
@ -54,13 +54,13 @@ ffi_java_raw_size (ffi_cif *cif)
case FFI_TYPE_UINT64: case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE: case FFI_TYPE_DOUBLE:
result += 2 * SIZEOF_ARG; result += 2 * FFI_SIZEOF_ARG;
break; break;
case FFI_TYPE_STRUCT: case FFI_TYPE_STRUCT:
/* No structure parameters in Java. */ /* No structure parameters in Java. */
abort(); abort();
default: default:
result += SIZEOF_ARG; result += FFI_SIZEOF_ARG;
} }
} }
@ -90,7 +90,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
*args = (void*) ((char*)(raw++) + 2); *args = (void*) ((char*)(raw++) + 2);
break; break;
#if SIZEOF_ARG == 8 #if FFI_SIZEOF_ARG == 8
case FFI_TYPE_UINT64: case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE: case FFI_TYPE_DOUBLE:
@ -105,7 +105,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
default: default:
*args = raw; *args = raw;
raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
} }
} }
@ -116,7 +116,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
/* then assume little endian */ /* then assume little endian */
for (i = 0; i < cif->nargs; i++, tp++, args++) for (i = 0; i < cif->nargs; i++, tp++, args++)
{ {
#if SIZEOF_ARG == 8 #if FFI_SIZEOF_ARG == 8
switch((*tp)->type) { switch((*tp)->type) {
case FFI_TYPE_UINT64: case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
@ -127,10 +127,10 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
default: default:
*args = (void*) raw++; *args = (void*) raw++;
} }
#else /* SIZEOF_ARG != 8 */ #else /* FFI_SIZEOF_ARG != 8 */
*args = (void*) raw; *args = (void*) raw;
raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
#endif /* SIZEOF_ARG == 8 */ #endif /* FFI_SIZEOF_ARG == 8 */
} }
#else #else
@ -202,7 +202,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
(raw++)->flt = *(FLOAT32*) (*args); (raw++)->flt = *(FLOAT32*) (*args);
break; break;
#if SIZEOF_ARG == 8 #if FFI_SIZEOF_ARG == 8
case FFI_TYPE_UINT64: case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE: case FFI_TYPE_DOUBLE:
@ -216,11 +216,11 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
break; break;
default: default:
#if SIZEOF_ARG == 8 #if FFI_SIZEOF_ARG == 8
FFI_ASSERT(FALSE); /* Should have covered all cases */ FFI_ASSERT(FALSE); /* Should have covered all cases */
#else #else
memcpy ((void*) raw->data, (void*)*args, (*tp)->size); memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
#endif #endif
} }
} }
@ -231,7 +231,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
static void static void
ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
{ {
#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 #if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
switch (cif->rtype->type) switch (cif->rtype->type)
{ {
case FFI_TYPE_UINT8: case FFI_TYPE_UINT8:
@ -256,7 +256,7 @@ ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
static void static void
ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
{ {
#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 #if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
switch (cif->rtype->type) switch (cif->rtype->type)
{ {
case FFI_TYPE_UINT8: case FFI_TYPE_UINT8:

View File

@ -5,6 +5,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.text .text

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1996 Cygnus Solutions ffi.c - Copyright (c) 1996 Red Hat, Inc.
MIPS Foreign Function Interface MIPS Foreign Function Interface
@ -23,7 +23,6 @@
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#include <sgidefs.h>
#include <ffi.h> #include <ffi.h>
#include <ffi_common.h> #include <ffi_common.h>
@ -59,8 +58,8 @@ static void ffi_prep_args(char *stack,
/* If more than 8 double words are used, the remainder go /* If more than 8 double words are used, the remainder go
on the stack. We reorder stuff on the stack here to on the stack. We reorder stuff on the stack here to
support this easily. */ support this easily. */
if (bytes > 8 * SIZEOF_ARG) if (bytes > 8 * FFI_SIZEOF_ARG)
argp = &stack[bytes - (8 * SIZEOF_ARG)]; argp = &stack[bytes - (8 * FFI_SIZEOF_ARG)];
else else
argp = stack; argp = stack;
#else #else
@ -75,8 +74,8 @@ static void ffi_prep_args(char *stack,
if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT )
#endif #endif
{ {
*(SLOT_TYPE_UNSIGNED *) argp = (SLOT_TYPE_UNSIGNED) ecif->rvalue; *(ffi_arg *) argp = (ffi_arg) ecif->rvalue;
argp += sizeof(SLOT_TYPE_UNSIGNED); argp += sizeof(ffi_arg);
FIX_ARGP; FIX_ARGP;
} }
@ -99,9 +98,9 @@ static void ffi_prep_args(char *stack,
#endif #endif
z = (*p_arg)->size; z = (*p_arg)->size;
if (z < sizeof(SLOT_TYPE_UNSIGNED)) if (z < sizeof(ffi_arg))
{ {
z = sizeof(SLOT_TYPE_UNSIGNED); z = sizeof(ffi_arg);
switch ((*p_arg)->type) switch ((*p_arg)->type)
{ {

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
n32.S - Copyright (c) 1996, 1998 Cygnus Solutions n32.S - Copyright (c) 1996, 1998 Red Hat, Inc.
MIPS Foreign Function Interface MIPS Foreign Function Interface
@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
/* Only build this code if we are compiling for n32 */ /* Only build this code if we are compiling for n32 */
@ -36,7 +37,7 @@
#define raddr a4 #define raddr a4
#define fn a5 #define fn a5
#define SIZEOF_FRAME ( 8 * SIZEOF_ARG ) #define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG )
.text .text
.align 2 .align 2
@ -46,37 +47,37 @@ ffi_call_N32:
# Prologue # Prologue
SUBU $sp, SIZEOF_FRAME # Frame size SUBU $sp, SIZEOF_FRAME # Frame size
REG_S $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Save frame pointer REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer
REG_S ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Save return address REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address
move $fp, $sp move $fp, $sp
move t9, callback # callback function pointer move t9, callback # callback function pointer
REG_S bytes, 2*SIZEOF_ARG($fp) # bytes REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes
REG_S flags, 3*SIZEOF_ARG($fp) # flags REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags
REG_S raddr, 4*SIZEOF_ARG($fp) # raddr REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr
REG_S fn, 5*SIZEOF_ARG($fp) # fn REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn
# Allocate at least 4 words in the argstack # Allocate at least 4 words in the argstack
move v0, bytes move v0, bytes
bge bytes, 4 * SIZEOF_ARG, bigger bge bytes, 4 * FFI_SIZEOF_ARG, bigger
LI v0, 4 * SIZEOF_ARG LI v0, 4 * FFI_SIZEOF_ARG
b sixteen b sixteen
bigger: bigger:
ADDU t4, v0, 2 * SIZEOF_ARG -1 # make sure it is aligned ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned
and v0, t4, -2 * SIZEOF_ARG # to a proper boundry. and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry.
sixteen: sixteen:
SUBU $sp, $sp, v0 # move the stack pointer to reflect the SUBU $sp, $sp, v0 # move the stack pointer to reflect the
# arg space # arg space
ADDU a0, $sp, 0 # 4 * SIZEOF_ARG ADDU a0, $sp, 0 # 4 * FFI_SIZEOF_ARG
ADDU a3, $fp, 3 * SIZEOF_ARG ADDU a3, $fp, 3 * FFI_SIZEOF_ARG
# Call ffi_prep_args # Call ffi_prep_args
jal t9 jal t9
# ADDU $sp, $sp, 4 * SIZEOF_ARG # adjust $sp to new args # ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
# Copy the stack pointer to t9 # Copy the stack pointer to t9
move t9, $sp move t9, $sp
@ -85,10 +86,10 @@ sixteen:
# of arguments. # of arguments.
# Load the number of bytes # Load the number of bytes
REG_L t6, 2*SIZEOF_ARG($fp) REG_L t6, 2*FFI_SIZEOF_ARG($fp)
# Is it bigger than 8 * SIZEOF_ARG? # Is it bigger than 8 * FFI_SIZEOF_ARG?
dadd t7, $0, 8 * SIZEOF_ARG dadd t7, $0, 8 * FFI_SIZEOF_ARG
dsub t8, t6, t7 dsub t8, t6, t7
bltz t8, loadregs bltz t8, loadregs
@ -96,125 +97,125 @@ sixteen:
loadregs: loadregs:
REG_L t4, 3*SIZEOF_ARG($fp) # load the flags word REG_L t4, 3*FFI_SIZEOF_ARG($fp) # load the flags word
add t6, t4, 0 # and copy it into t6 add t6, t4, 0 # and copy it into t6
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg1_floatp bnez t4, arg1_floatp
REG_L a0, 0*SIZEOF_ARG(t9) REG_L a0, 0*FFI_SIZEOF_ARG(t9)
b arg1_next b arg1_next
arg1_floatp: arg1_floatp:
bne t4, FFI_TYPE_FLOAT, arg1_doublep bne t4, FFI_TYPE_FLOAT, arg1_doublep
l.s $f12, 0*SIZEOF_ARG(t9) l.s $f12, 0*FFI_SIZEOF_ARG(t9)
b arg1_next b arg1_next
arg1_doublep: arg1_doublep:
l.d $f12, 0*SIZEOF_ARG(t9) l.d $f12, 0*FFI_SIZEOF_ARG(t9)
arg1_next: arg1_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 1*FFI_FLAG_BITS SRL t4, 1*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg2_floatp bnez t4, arg2_floatp
REG_L a1, 1*SIZEOF_ARG(t9) REG_L a1, 1*FFI_SIZEOF_ARG(t9)
b arg2_next b arg2_next
arg2_floatp: arg2_floatp:
bne t4, FFI_TYPE_FLOAT, arg2_doublep bne t4, FFI_TYPE_FLOAT, arg2_doublep
l.s $f13, 1*SIZEOF_ARG(t9) l.s $f13, 1*FFI_SIZEOF_ARG(t9)
b arg2_next b arg2_next
arg2_doublep: arg2_doublep:
l.d $f13, 1*SIZEOF_ARG(t9) l.d $f13, 1*FFI_SIZEOF_ARG(t9)
arg2_next: arg2_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 2*FFI_FLAG_BITS SRL t4, 2*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg3_floatp bnez t4, arg3_floatp
REG_L a2, 2*SIZEOF_ARG(t9) REG_L a2, 2*FFI_SIZEOF_ARG(t9)
b arg3_next b arg3_next
arg3_floatp: arg3_floatp:
bne t4, FFI_TYPE_FLOAT, arg3_doublep bne t4, FFI_TYPE_FLOAT, arg3_doublep
l.s $f14, 2*SIZEOF_ARG(t9) l.s $f14, 2*FFI_SIZEOF_ARG(t9)
b arg3_next b arg3_next
arg3_doublep: arg3_doublep:
l.d $f14, 2*SIZEOF_ARG(t9) l.d $f14, 2*FFI_SIZEOF_ARG(t9)
arg3_next: arg3_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 3*FFI_FLAG_BITS SRL t4, 3*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg4_floatp bnez t4, arg4_floatp
REG_L a3, 3*SIZEOF_ARG(t9) REG_L a3, 3*FFI_SIZEOF_ARG(t9)
b arg4_next b arg4_next
arg4_floatp: arg4_floatp:
bne t4, FFI_TYPE_FLOAT, arg4_doublep bne t4, FFI_TYPE_FLOAT, arg4_doublep
l.s $f15, 3*SIZEOF_ARG(t9) l.s $f15, 3*FFI_SIZEOF_ARG(t9)
b arg4_next b arg4_next
arg4_doublep: arg4_doublep:
l.d $f15, 3*SIZEOF_ARG(t9) l.d $f15, 3*FFI_SIZEOF_ARG(t9)
arg4_next: arg4_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 4*FFI_FLAG_BITS SRL t4, 4*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg5_floatp bnez t4, arg5_floatp
REG_L a4, 4*SIZEOF_ARG(t9) REG_L a4, 4*FFI_SIZEOF_ARG(t9)
b arg5_next b arg5_next
arg5_floatp: arg5_floatp:
bne t4, FFI_TYPE_FLOAT, arg5_doublep bne t4, FFI_TYPE_FLOAT, arg5_doublep
l.s $f16, 4*SIZEOF_ARG(t9) l.s $f16, 4*FFI_SIZEOF_ARG(t9)
b arg5_next b arg5_next
arg5_doublep: arg5_doublep:
l.d $f16, 4*SIZEOF_ARG(t9) l.d $f16, 4*FFI_SIZEOF_ARG(t9)
arg5_next: arg5_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 5*FFI_FLAG_BITS SRL t4, 5*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg6_floatp bnez t4, arg6_floatp
REG_L a5, 5*SIZEOF_ARG(t9) REG_L a5, 5*FFI_SIZEOF_ARG(t9)
b arg6_next b arg6_next
arg6_floatp: arg6_floatp:
bne t4, FFI_TYPE_FLOAT, arg6_doublep bne t4, FFI_TYPE_FLOAT, arg6_doublep
l.s $f17, 5*SIZEOF_ARG(t9) l.s $f17, 5*FFI_SIZEOF_ARG(t9)
b arg6_next b arg6_next
arg6_doublep: arg6_doublep:
l.d $f17, 5*SIZEOF_ARG(t9) l.d $f17, 5*FFI_SIZEOF_ARG(t9)
arg6_next: arg6_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 6*FFI_FLAG_BITS SRL t4, 6*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg7_floatp bnez t4, arg7_floatp
REG_L a6, 6*SIZEOF_ARG(t9) REG_L a6, 6*FFI_SIZEOF_ARG(t9)
b arg7_next b arg7_next
arg7_floatp: arg7_floatp:
bne t4, FFI_TYPE_FLOAT, arg7_doublep bne t4, FFI_TYPE_FLOAT, arg7_doublep
l.s $f18, 6*SIZEOF_ARG(t9) l.s $f18, 6*FFI_SIZEOF_ARG(t9)
b arg7_next b arg7_next
arg7_doublep: arg7_doublep:
l.d $f18, 6*SIZEOF_ARG(t9) l.d $f18, 6*FFI_SIZEOF_ARG(t9)
arg7_next: arg7_next:
add t4, t6, 0 add t4, t6, 0
SRL t4, 7*FFI_FLAG_BITS SRL t4, 7*FFI_FLAG_BITS
and t4, ((1<<FFI_FLAG_BITS)-1) and t4, ((1<<FFI_FLAG_BITS)-1)
bnez t4, arg8_floatp bnez t4, arg8_floatp
REG_L a7, 7*SIZEOF_ARG(t9) REG_L a7, 7*FFI_SIZEOF_ARG(t9)
b arg8_next b arg8_next
arg8_floatp: arg8_floatp:
bne t4, FFI_TYPE_FLOAT, arg8_doublep bne t4, FFI_TYPE_FLOAT, arg8_doublep
l.s $f19, 7*SIZEOF_ARG(t9) l.s $f19, 7*FFI_SIZEOF_ARG(t9)
b arg8_next b arg8_next
arg8_doublep: arg8_doublep:
l.d $f19, 7*SIZEOF_ARG(t9) l.d $f19, 7*FFI_SIZEOF_ARG(t9)
arg8_next: arg8_next:
callit: callit:
# Load the function pointer # Load the function pointer
REG_L t9, 5*SIZEOF_ARG($fp) REG_L t9, 5*FFI_SIZEOF_ARG($fp)
# If the return value pointer is NULL, assume no return value. # If the return value pointer is NULL, assume no return value.
REG_L t5, 4*SIZEOF_ARG($fp) REG_L t5, 4*FFI_SIZEOF_ARG($fp)
beqz t5, noretval beqz t5, noretval
# Shift the return type flag over # Shift the return type flag over
@ -222,42 +223,42 @@ callit:
bne t6, FFI_TYPE_INT, retfloat bne t6, FFI_TYPE_INT, retfloat
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
REG_S v0, 0(t4) REG_S v0, 0(t4)
b epilogue b epilogue
retfloat: retfloat:
bne t6, FFI_TYPE_FLOAT, retdouble bne t6, FFI_TYPE_FLOAT, retdouble
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t4) s.s $f0, 0(t4)
b epilogue b epilogue
retdouble: retdouble:
bne t6, FFI_TYPE_DOUBLE, retstruct_d bne t6, FFI_TYPE_DOUBLE, retstruct_d
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.d $f0, 0(t4) s.d $f0, 0(t4)
b epilogue b epilogue
retstruct_d: retstruct_d:
bne t6, FFI_TYPE_STRUCT_D, retstruct_f bne t6, FFI_TYPE_STRUCT_D, retstruct_f
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.d $f0, 0(t4) s.d $f0, 0(t4)
b epilogue b epilogue
retstruct_f: retstruct_f:
bne t6, FFI_TYPE_STRUCT_F, retstruct_d_d bne t6, FFI_TYPE_STRUCT_F, retstruct_d_d
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t4) s.s $f0, 0(t4)
b epilogue b epilogue
retstruct_d_d: retstruct_d_d:
bne t6, FFI_TYPE_STRUCT_DD, retstruct_f_f bne t6, FFI_TYPE_STRUCT_DD, retstruct_f_f
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.d $f0, 0(t4) s.d $f0, 0(t4)
s.d $f2, 8(t4) s.d $f2, 8(t4)
b epilogue b epilogue
@ -265,7 +266,7 @@ retstruct_d_d:
retstruct_f_f: retstruct_f_f:
bne t6, FFI_TYPE_STRUCT_FF, retstruct_d_f bne t6, FFI_TYPE_STRUCT_FF, retstruct_d_f
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t4) s.s $f0, 0(t4)
s.s $f2, 4(t4) s.s $f2, 4(t4)
b epilogue b epilogue
@ -273,7 +274,7 @@ retstruct_f_f:
retstruct_d_f: retstruct_d_f:
bne t6, FFI_TYPE_STRUCT_DF, retstruct_f_d bne t6, FFI_TYPE_STRUCT_DF, retstruct_f_d
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.d $f0, 0(t4) s.d $f0, 0(t4)
s.s $f2, 8(t4) s.s $f2, 8(t4)
b epilogue b epilogue
@ -281,7 +282,7 @@ retstruct_d_f:
retstruct_f_d: retstruct_f_d:
bne t6, FFI_TYPE_STRUCT_FD, retstruct_small bne t6, FFI_TYPE_STRUCT_FD, retstruct_small
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t4) s.s $f0, 0(t4)
s.d $f2, 8(t4) s.d $f2, 8(t4)
b epilogue b epilogue
@ -289,14 +290,14 @@ retstruct_f_d:
retstruct_small: retstruct_small:
bne t6, FFI_TYPE_STRUCT_SMALL, retstruct_small2 bne t6, FFI_TYPE_STRUCT_SMALL, retstruct_small2
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
REG_S v0, 0(t4) REG_S v0, 0(t4)
b epilogue b epilogue
retstruct_small2: retstruct_small2:
bne t6, FFI_TYPE_STRUCT_SMALL2, retstruct bne t6, FFI_TYPE_STRUCT_SMALL2, retstruct
jal t9 jal t9
REG_L t4, 4*SIZEOF_ARG($fp) REG_L t4, 4*FFI_SIZEOF_ARG($fp)
REG_S v0, 0(t4) REG_S v0, 0(t4)
REG_S v1, 8(t4) REG_S v1, 8(t4)
b epilogue b epilogue
@ -308,8 +309,8 @@ noretval:
# Epilogue # Epilogue
epilogue: epilogue:
move $sp, $fp move $sp, $fp
REG_L $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Restore frame pointer REG_L $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Restore frame pointer
REG_L ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Restore return address REG_L ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Restore return address
ADDU $sp, SIZEOF_FRAME # Fix stack pointer ADDU $sp, SIZEOF_FRAME # Fix stack pointer
j ra j ra

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
o32.S - Copyright (c) 1996, 1998 Cygnus Solutions o32.S - Copyright (c) 1996, 1998 Red Hat, Inc.
MIPS Foreign Function Interface MIPS Foreign Function Interface
@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
/* Only build this code if we are compiling for o32 */ /* Only build this code if we are compiling for o32 */
@ -34,7 +35,7 @@
#define bytes a2 #define bytes a2
#define flags a3 #define flags a3
#define SIZEOF_FRAME ( 4 * SIZEOF_ARG + 2 * SIZEOF_ARG ) #define SIZEOF_FRAME ( 4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG )
.text .text
.align 2 .align 2
@ -44,114 +45,114 @@ ffi_call_O32:
# Prologue # Prologue
SUBU $sp, SIZEOF_FRAME # Frame size SUBU $sp, SIZEOF_FRAME # Frame size
REG_S $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Save frame pointer REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer
REG_S ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Save return address REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address
move $fp, $sp move $fp, $sp
move t9, callback # callback function pointer move t9, callback # callback function pointer
REG_S flags, SIZEOF_FRAME + 3*SIZEOF_ARG($fp) # flags REG_S flags, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG($fp) # flags
# Allocate at least 4 words in the argstack # Allocate at least 4 words in the argstack
move v0, bytes move v0, bytes
bge bytes, 4 * SIZEOF_ARG, bigger bge bytes, 4 * FFI_SIZEOF_ARG, bigger
LI v0, 4 * SIZEOF_ARG LI v0, 4 * FFI_SIZEOF_ARG
b sixteen b sixteen
bigger: bigger:
ADDU t0, v0, 2 * SIZEOF_ARG -1 # make sure it is aligned ADDU t0, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned
and v0, t0, -2 * SIZEOF_ARG # to an 8 byte boundry and v0, t0, -2 * FFI_SIZEOF_ARG # to an 8 byte boundry
sixteen: sixteen:
SUBU $sp, $sp, v0 # move the stack pointer to reflect the SUBU $sp, $sp, v0 # move the stack pointer to reflect the
# arg space # arg space
ADDU a0, $sp, 4 * SIZEOF_ARG ADDU a0, $sp, 4 * FFI_SIZEOF_ARG
ADDU a3, $fp, SIZEOF_FRAME + 3*SIZEOF_ARG ADDU a3, $fp, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG
jal t9 jal t9
REG_L t0, SIZEOF_FRAME + 3*SIZEOF_ARG($fp) # load the flags word REG_L t0, SIZEOF_FRAME + 3*FFI_SIZEOF_ARG($fp) # load the flags word
add t2, t0, 0 # and copy it into t2 add t2, t0, 0 # and copy it into t2
and t0, ((1<<4)-1) # mask out the return type and t0, ((1<<4)-1) # mask out the return type
SRL t2, 4 # shift our arg info SRL t2, 4 # shift our arg info
ADDU $sp, $sp, 4 * SIZEOF_ARG # adjust $sp to new args ADDU $sp, $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
bnez t0, pass_d # make it quick for int bnez t0, pass_d # make it quick for int
REG_L a0, 0*SIZEOF_ARG($sp) # just go ahead and load the REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
REG_L a1, 1*SIZEOF_ARG($sp) # four regs. REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
REG_L a2, 2*SIZEOF_ARG($sp) REG_L a2, 2*FFI_SIZEOF_ARG($sp)
REG_L a3, 3*SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it b call_it
pass_d: pass_d:
bne t0, FFI_ARGS_D, pass_f bne t0, FFI_ARGS_D, pass_f
l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
REG_L a2, 2*SIZEOF_ARG($sp) # passing a double REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double
REG_L a3, 3*SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it b call_it
pass_f: pass_f:
bne t0, FFI_ARGS_F, pass_d_d bne t0, FFI_ARGS_F, pass_d_d
l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
REG_L a1, 1*SIZEOF_ARG($sp) # passing a float REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float
REG_L a2, 2*SIZEOF_ARG($sp) REG_L a2, 2*FFI_SIZEOF_ARG($sp)
REG_L a3, 3*SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it b call_it
pass_d_d: pass_d_d:
bne t0, FFI_ARGS_DD, pass_f_f bne t0, FFI_ARGS_DD, pass_f_f
l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
l.d $f14, 2*SIZEOF_ARG($sp) # passing two doubles l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles
b call_it b call_it
pass_f_f: pass_f_f:
bne t0, FFI_ARGS_FF, pass_d_f bne t0, FFI_ARGS_FF, pass_d_f
l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
l.s $f14, 1*SIZEOF_ARG($sp) # passing two floats l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats
REG_L a2, 2*SIZEOF_ARG($sp) REG_L a2, 2*FFI_SIZEOF_ARG($sp)
REG_L a3, 3*SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it b call_it
pass_d_f: pass_d_f:
bne t0, FFI_ARGS_DF, pass_f_d bne t0, FFI_ARGS_DF, pass_f_d
l.d $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
l.s $f14, 2*SIZEOF_ARG($sp) # passing double and float l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
REG_L a3, 3*SIZEOF_ARG($sp) REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it b call_it
pass_f_d: pass_f_d:
# assume that the only other combination must be float then double # assume that the only other combination must be float then double
# bne t0, FFI_ARGS_F_D, call_it # bne t0, FFI_ARGS_F_D, call_it
l.s $f12, 0*SIZEOF_ARG($sp) # load $fp regs from args l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
l.d $f14, 2*SIZEOF_ARG($sp) # passing double and float l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
call_it: call_it:
# Load the function pointer # Load the function pointer
REG_L t9, SIZEOF_FRAME + 5*SIZEOF_ARG($fp) REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp)
# If the return value pointer is NULL, assume no return value. # If the return value pointer is NULL, assume no return value.
REG_L t1, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
beqz t1, noretval beqz t1, noretval
bne t2, FFI_TYPE_INT, retfloat bne t2, FFI_TYPE_INT, retfloat
jal t9 jal t9
REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
REG_S v0, 0(t0) REG_S v0, 0(t0)
b epilogue b epilogue
retfloat: retfloat:
bne t2, FFI_TYPE_FLOAT, retdouble bne t2, FFI_TYPE_FLOAT, retdouble
jal t9 jal t9
REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
s.s $f0, 0(t0) s.s $f0, 0(t0)
b epilogue b epilogue
retdouble: retdouble:
bne t2, FFI_TYPE_DOUBLE, noretval bne t2, FFI_TYPE_DOUBLE, noretval
jal t9 jal t9
REG_L t0, SIZEOF_FRAME + 4*SIZEOF_ARG($fp) REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
s.d $f0, 0(t0) s.d $f0, 0(t0)
b epilogue b epilogue
@ -161,8 +162,8 @@ noretval:
# Epilogue # Epilogue
epilogue: epilogue:
move $sp, $fp move $sp, $fp
REG_L $fp, SIZEOF_FRAME - 2*SIZEOF_ARG($sp) # Restore frame pointer REG_L $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Restore frame pointer
REG_L ra, SIZEOF_FRAME - 1*SIZEOF_ARG($sp) # Restore return address REG_L ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Restore return address
ADDU $sp, SIZEOF_FRAME # Fix stack pointer ADDU $sp, SIZEOF_FRAME # Fix stack pointer
j ra j ra

View File

@ -80,6 +80,7 @@
.set f21,21 .set f21,21
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#define JUMPTARGET(name) name #define JUMPTARGET(name) name
#define L(x) x #define L(x) x

View File

@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#define JUMPTARGET(name) name #define JUMPTARGET(name) name
#define L(x) x #define L(x) x

View File

@ -25,6 +25,7 @@
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#include <ffi.h> #include <ffi.h>
#include <ffi_common.h> #include <ffi_common.h>

View File

@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef __powerpc64__ #ifdef __powerpc64__

View File

@ -1,4 +1,5 @@
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.file "linux64_closure.S" .file "linux64_closure.S"

View File

@ -1,4 +1,5 @@
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#include <powerpc/asm.h> #include <powerpc/asm.h>

View File

@ -26,6 +26,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#include <powerpc/asm.h> #include <powerpc/asm.h>

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
prep_cif.c - Copyright (c) 1996, 1998 Cygnus Solutions prep_cif.c - Copyright (c) 1996, 1998 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the
@ -26,9 +26,9 @@
#include <stdlib.h> #include <stdlib.h>
/* Round up to SIZEOF_ARG. */ /* Round up to FFI_SIZEOF_ARG. */
#define STACK_ARG_SIZE(x) ALIGN(x, SIZEOF_ARG) #define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
/* Perform machine independent initialization of aggregate type /* Perform machine independent initialization of aggregate type
specifications. */ specifications. */
@ -53,7 +53,7 @@ static ffi_status initialize_aggregate(/*@out@*/ ffi_type *arg)
return FFI_BAD_TYPEDEF; return FFI_BAD_TYPEDEF;
/* Perform a sanity check on the argument type */ /* Perform a sanity check on the argument type */
FFI_ASSERT(ffi_type_test((*ptr))); FFI_ASSERT_VALID_TYPE(*ptr);
arg->size = ALIGN(arg->size, (*ptr)->alignment); arg->size = ALIGN(arg->size, (*ptr)->alignment);
arg->size += (*ptr)->size; arg->size += (*ptr)->size;
@ -94,7 +94,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
ffi_type **ptr; ffi_type **ptr;
FFI_ASSERT(cif != NULL); FFI_ASSERT(cif != NULL);
FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi < FFI_LAST_ABI)); FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI));
cif->abi = abi; cif->abi = abi;
cif->arg_types = atypes; cif->arg_types = atypes;
@ -110,7 +110,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
/*@=usedef@*/ /*@=usedef@*/
/* Perform a sanity check on the return type */ /* Perform a sanity check on the return type */
FFI_ASSERT(ffi_type_test(cif->rtype)); FFI_ASSERT_VALID_TYPE(cif->rtype);
/* x86-64 and s390 stack space allocation is handled in prep_machdep. */ /* x86-64 and s390 stack space allocation is handled in prep_machdep. */
#if !defined M68K && !defined __x86_64__ && !defined S390 #if !defined M68K && !defined __x86_64__ && !defined S390
@ -126,7 +126,7 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
{ {
/* Perform a sanity check on the argument type */ /* Perform a sanity check on the argument type */
FFI_ASSERT(ffi_type_test(*ptr)); FFI_ASSERT_VALID_TYPE(*ptr);
/* Initialize any uninitialized aggregate type definitions */ /* Initialize any uninitialized aggregate type definitions */
if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
raw_api.c - Copyright (c) 1999 Cygnus Solutions raw_api.c - Copyright (c) 1999 Red Hat, Inc.
Author: Kresten Krab Thorup <krab@gnu.org> Author: Kresten Krab Thorup <krab@gnu.org>
@ -44,10 +44,10 @@ ffi_raw_size (ffi_cif *cif)
{ {
#if !FFI_NO_STRUCTS #if !FFI_NO_STRUCTS
if ((*at)->type == FFI_TYPE_STRUCT) if ((*at)->type == FFI_TYPE_STRUCT)
result += ALIGN (sizeof (void*), SIZEOF_ARG); result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
else else
#endif #endif
result += ALIGN ((*at)->size, SIZEOF_ARG); result += ALIGN ((*at)->size, FFI_SIZEOF_ARG);
} }
return result; return result;
@ -68,18 +68,18 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
{ {
case FFI_TYPE_UINT8: case FFI_TYPE_UINT8:
case FFI_TYPE_SINT8: case FFI_TYPE_SINT8:
*args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1);
break; break;
case FFI_TYPE_UINT16: case FFI_TYPE_UINT16:
case FFI_TYPE_SINT16: case FFI_TYPE_SINT16:
*args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2);
break; break;
#if SIZEOF_ARG >= 4 #if FFI_SIZEOF_ARG >= 4
case FFI_TYPE_UINT32: case FFI_TYPE_UINT32:
case FFI_TYPE_SINT32: case FFI_TYPE_SINT32:
*args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4);
break; break;
#endif #endif
@ -95,7 +95,7 @@ ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
default: default:
*args = raw; *args = raw;
raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
} }
} }
@ -152,7 +152,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
(raw++)->sint = *(SINT16*) (*args); (raw++)->sint = *(SINT16*) (*args);
break; break;
#if SIZEOF_ARG >= 4 #if FFI_SIZEOF_ARG >= 4
case FFI_TYPE_UINT32: case FFI_TYPE_UINT32:
(raw++)->uint = *(UINT32*) (*args); (raw++)->uint = *(UINT32*) (*args);
break; break;
@ -174,7 +174,7 @@ ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
default: default:
memcpy ((void*) raw->data, (void*)*args, (*tp)->size); memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
raw += ALIGN ((*tp)->size, SIZEOF_ARG) / SIZEOF_ARG; raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
} }
} }
} }

View File

@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifndef __s390x__ #ifndef __s390x__

View File

@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H #ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h> #include <machine/asm.h>

View File

@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H #ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h> #include <machine/asm.h>

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions ffi.c - Copyright (c) 1996, 2003 Red Hat, Inc.
Sparc Foreign Function Interface Sparc Foreign Function Interface
@ -491,7 +491,7 @@ ffi_closure_sparc_inner(ffi_closure *closure,
while (i < avn) while (i < avn)
{ {
/* Assume big-endian. FIXME */ /* Assume big-endian. FIXME */
argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
#ifdef SPARC64 #ifdef SPARC64
if (i < 16 && (arg_types[i]->type == FFI_TYPE_FLOAT if (i < 16 && (arg_types[i]->type == FFI_TYPE_FLOAT

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions v8.S - Copyright (c) 1996, 1997, 2003 Red Hat, Inc.
Sparc Foreign Function Interface Sparc Foreign Function Interface
@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#define STACKFRAME 96 /* Minimum stack framesize for SPARC */ #define STACKFRAME 96 /* Minimum stack framesize for SPARC */

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
v9.S - Copyright (c) 2000, 2003 Cygnus Solutions v9.S - Copyright (c) 2000, 2003 Red Hat, Inc.
Sparc 64bit Foreign Function Interface Sparc 64bit Foreign Function Interface
@ -24,6 +24,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef SPARC64 #ifdef SPARC64

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
types.c - Copyright (c) 1996, 1998 Cygnus Solutions types.c - Copyright (c) 1996, 1998 Red Hat, Inc.
Predefined ffi_types needed by libffi. Predefined ffi_types needed by libffi.

View File

@ -689,7 +689,7 @@ ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp)
FFI_ASSERT(0); FFI_ASSERT(0);
} }
argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++; i++;
} }

View File

@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Cygnus Solutions sysv.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc.
X86 Foreign Function Interface X86 Foreign Function Interface
@ -26,6 +26,7 @@
#ifndef __x86_64__ #ifndef __x86_64__
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.text .text

View File

@ -25,6 +25,7 @@
#ifdef __x86_64__ #ifdef __x86_64__
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.section .rodata .section .rodata

View File

@ -27,6 +27,7 @@
----------------------------------------------------------------------- */ ----------------------------------------------------------------------- */
#define LIBFFI_ASM #define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
.text .text

View File

@ -71,6 +71,7 @@ DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
GCJ = @GCJ@ GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@ GCJFLAGS = @GCJFLAGS@
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
LIBTOOL = @LIBTOOL@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@ LN_S = @LN_S@
MAINT = @MAINT@ MAINT = @MAINT@