diff --git a/libffi/ChangeLog b/libffi/ChangeLog index d931673d..84c09072 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,33 @@ +1999-08-02 Kresten Krab Thorup + + * src/x86/ffi.c (ffi_closure_SYSV): New function. + (ffi_prep_incoming_args_SYSV): Ditto. + (ffi_prep_closure): Ditto. + (ffi_closure_raw_SYSV): Ditto. + (ffi_prep_raw_closure): More ditto. + (ffi_call_raw): Final ditto. + + * include/ffi.h.in: + + * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for + FFI_TYPE_UINT64. + + * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c + + * src/raw_api.c: New file. + + * include/ffi.h.in (ffi_raw): New type. + (UINT_ARG, SINT_ARG): New defines. + (ffi_closure, ffi_raw_closure): New types. + (ffi_prep_closure, ffi_prep_raw_closure): New declarations. + + * configure.in: Add check for endianness and sizeof void*. + + * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, + instead of directly. + + * configure: Rebuilt. + Thu Jul 8 14:28:42 1999 Anthony Green * configure.in: Add x86 and powerpc BeOS configurations. diff --git a/libffi/Makefile.am b/libffi/Makefile.am index 6519011f..99c8f2fc 100644 --- a/libffi/Makefile.am +++ b/libffi/Makefile.am @@ -44,7 +44,7 @@ TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) ## 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 if MIPS_GCC libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) endif diff --git a/libffi/Makefile.in b/libffi/Makefile.in index d26da200..3fc96ef1 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -10,6 +10,7 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. + SHELL = @SHELL@ srcdir = @srcdir@ @@ -44,10 +45,9 @@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = transform = @program_transform_name@ NORMAL_INSTALL = : @@ -58,37 +58,20 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ -AMTAR = @AMTAR@ -AMTARFLAGS = @AMTARFLAGS@ -AS = @AS@ CC = @CC@ -DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ -LD = @LD@ LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -NM = @NM@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ SHELL = @SHELL@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ -USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ VERSION = @VERSION@ - AUTOMAKE_OPTIONS = cygnus -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/x86/ffi.c src/x86/sysv.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/asm.h \ - src/arm/ffi.c src/arm/sysv.S +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/x86/ffi.c src/x86/sysv.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/asm.h src/arm/ffi.c src/arm/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ @@ -120,20 +103,19 @@ TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c -@MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -@MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) -@X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) -@SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) -@ALPHA_TRUE@libffi_la_SOURCES = @ALPHA_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA) -@M68K_TRUE@libffi_la_SOURCES = @M68K_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_M68K) -@POWERPC_TRUE@libffi_la_SOURCES = @POWERPC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC) -@ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) +libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c src/raw_api.c +@MIPS_GCC_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) +@MIPS_SGI_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) +@X86_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86) +@SPARC_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC) +@ALPHA_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA) +@M68K_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K) +@POWERPC_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC) +@ARM_TRUE@libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) libffi_la_LDFLAGS = -release $(VERSION) INCLUDES = -I$(top_srcdir)/include -Iinclude -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = fficonfig.h @@ -146,46 +128,49 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libffi_la_LIBADD = -@ALPHA_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo ffi.lo \ -@ALPHA_TRUE@osf.lo -@ARM_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo sysv.lo \ -@ARM_TRUE@ffi.lo -@M68K_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo ffi.lo \ -@M68K_TRUE@sysv.lo -@MIPS_GCC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ -@MIPS_GCC_TRUE@ffi.lo o32.lo n32.lo -@MIPS_SGI_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ -@MIPS_SGI_TRUE@ffi.lo o32.lo n32.lo -@POWERPC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ -@POWERPC_TRUE@ffi.lo sysv.lo -@SPARC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo ffi.lo \ +@SPARC_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@SPARC_TRUE@types.lo raw_api.lo ffi.lo \ @SPARC_TRUE@v8.lo -@X86_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo ffi.lo \ -@X86_TRUE@sysv.lo -libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) +@MIPS_SGI_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@MIPS_SGI_TRUE@types.lo raw_api.lo ffi.lo \ +@MIPS_SGI_TRUE@o32.lo n32.lo +@MIPS_GCC_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@MIPS_GCC_TRUE@types.lo raw_api.lo ffi.lo \ +@MIPS_GCC_TRUE@o32.lo n32.lo +@M68K_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@M68K_TRUE@types.lo raw_api.lo m68ffi.lo src/m68sysv.lo +@ALPHA_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@ALPHA_TRUE@types.lo raw_api.lo ffi.lo \ +@ALPHA_TRUE@osf.lo +@X86_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ +@X86_TRUE@raw_api.lo ffi.lo sysv.lo +@ARM_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \ +@ARM_TRUE@raw_api.lo sysv.lo ffi.lo +@POWERPC_TRUE@libffi_la_OBJECTS = debug.lo prep_cif.lo \ +@POWERPC_TRUE@types.lo raw_api.lo ffi.lo \ +@POWERPC_TRUE@sysv.lo noinst_PROGRAMS = ffitest$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am_ffitest_OBJECTS = ffitest.o -ffitest_OBJECTS = $(am_ffitest_OBJECTS) +ffitest_OBJECTS = ffitest.o ffitest_DEPENDENCIES = libffi.la ffitest_LDFLAGS = +CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = @CFLAGS@ CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ acconfig.h aclocal.m4 config.guess config.sub configure configure.in \ fficonfig.h.in install-sh ltconfig ltmain.sh missing mkinstalldirs -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) +TAR = tar GZIP_ENV = --best SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES) -OBJECTS = $(am_libffi_la_OBJECTS) $(am_ffitest_OBJECTS) +OBJECTS = $(libffi_la_OBJECTS) $(ffitest_OBJECTS) all: all-redirect .SUFFIXES: @@ -211,22 +196,18 @@ fficonfig.h: stamp-h $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status - @rm -f stamp-h stamp-hT - @echo timestamp > stamp-hT 2> /dev/null cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=fficonfig.h \ $(SHELL) ./config.status - @mv stamp-hT stamp-h -$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/./stamp-h.in + @echo timestamp > stamp-h 2> /dev/null +$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in @if test ! -f $@; then \ - rm -f $(srcdir)/./stamp-h.in; \ - $(MAKE) $(srcdir)/./stamp-h.in; \ + rm -f $(srcdir)/stamp-h.in; \ + $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi -$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT - @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) - @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in + @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: @@ -258,11 +239,19 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) uninstall-toolexeclibLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p"; \ + list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \ done +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + mostlyclean-compile: -rm -f *.o core *.core @@ -273,6 +262,15 @@ distclean-compile: maintainer-clean-compile: +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + mostlyclean-libtool: -rm -f *.lo @@ -282,15 +280,6 @@ clean-libtool: distclean-libtool: maintainer-clean-libtool: -debug.lo: src/debug.c -prep_cif.lo: src/prep_cif.c -types.lo: src/types.c -ffi.lo: src/alpha/ffi.c -osf.lo: src/alpha/osf.S -sysv.lo: src/arm/sysv.S -o32.lo: src/mips/o32.S -n32.lo: src/mips/n32.S -v8.lo: src/sparc/v8.S libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(LINK) -rpath $(toolexeclibdir) $(libffi_la_LDFLAGS) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS) @@ -303,23 +292,10 @@ clean-noinstPROGRAMS: distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -ffitest.o: src/ffitest.c ffitest$(EXEEXT): $(ffitest_OBJECTS) $(ffitest_DEPENDENCIES) @rm -f ffitest$(EXEEXT) $(LINK) $(ffitest_LDFLAGS) $(ffitest_OBJECTS) $(ffitest_LDADD) $(LIBS) -.S.o: - $(COMPILE) -c $< -.S.lo: - $(LTCOMPILE) -c -o $@ $< -.c.o: - $(COMPILE) -c $< -.c.lo: - $(LTCOMPILE) -c -o $@ $< -.s.o: - $(COMPILE) -c $< -.s.lo: - $(LTCOMPILE) -c -o $@ $< tags: TAGS @@ -358,7 +334,7 @@ top_distdir = $(distdir) # tarfile. distcheck: dist -rm -rf $(distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ @@ -378,11 +354,11 @@ distcheck: dist echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) - $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) - $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) @@ -395,7 +371,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -429,7 +405,7 @@ uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) fficonfig.h all-redirect: all-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) @@ -489,9 +465,9 @@ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-info-am install-info \ all-recursive-am install-exec-am install-exec install-data-am \ install-data install-am install uninstall-am uninstall all-redirect \ -all-am all install-strip installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +all-am all installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libffi/README b/libffi/README index d2db1b2a..902e644c 100644 --- a/libffi/README +++ b/libffi/README @@ -477,6 +477,9 @@ libffi was written by Anthony Green . Portions of libffi were derived from Gianni Mariani's free gencall library for Silicon Graphics machines. +The closure mechanism was designed and implemented by Kresten Krab +Thorup. + The Sparc port was derived from code contributed by the fine folks at Visible Decisions Inc . Further enhancements were made by Gordon Irlam at Cygnus Solutions . diff --git a/libffi/aclocal.m4 b/libffi/aclocal.m4 index eb0d09d7..db10dbf1 100644 --- a/libffi/aclocal.m4 +++ b/libffi/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4a +dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -44,8 +44,6 @@ dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) -dnl We require 2.13 because we rely on SHELL being computed by configure. -AC_PREREQ([2.13]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] @@ -66,19 +64,6 @@ AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -dnl We check for tar when the user configures the end package. -dnl This is sad, since we only need this for "dist". However, -dnl there's no other good way to do it. We prefer GNU tar if -dnl we can find it. If we can't find a tar, it doesn't really matter. -AC_CHECK_PROGS(AMTAR, gnutar gtar tar) -AMTARFLAGS= -if test -n "$AMTAR"; then - if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then - dnl We have GNU tar. - AMTARFLAGS=o - fi -fi -AC_SUBST(AMTARFLAGS) AC_REQUIRE([AC_PROG_MAKE_SET])]) # @@ -140,26 +125,6 @@ else fi AC_SUBST($1)]) -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering - -# serial 1 - -AC_DEFUN(AM_MAINTAINER_MODE, -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) - # Define a conditional. AC_DEFUN(AM_CONDITIONAL, @@ -173,607 +138,3 @@ else $1_FALSE= fi]) - -# serial 35 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ -DLLTOOL="$DLLTOOL" AS="$AS" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_SYS_NM_PARSE])dnl -AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen" -test "$silent" = yes && libtool_flags="$libtool_flags --silent" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$host" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -*-*-cygwin*) - AC_SYS_LIBTOOL_CYGWIN - ;; - -esac - -# enable the --disable-libtool-lock switch - -AC_ARG_ENABLE(libtool-lock, -[ --disable-libtool-lock force libtool not to do file locking], -need_locks=$enableval, -need_locks=yes) - -if test x"$need_locks" = xno; then - libtool_flags="$libtool_flags --disable-lock" -fi -]) - -# AC_LIBTOOL_DLOPEN - check for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, -[AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, -[AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, -[AC_ENABLE_FAST_INSTALL(no)]) - - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - /* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog"; then - ac_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_SUBST(LD) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -AC_SUBST(NM) -]) - -# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed -# by C symbol name from nm. -AC_DEFUN(AC_SYS_NM_PARSE, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_NM])dnl -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe, -[# These are sane defaults that work on at least a few old systems. -# {They come from Ultrix. What could be older than Ultrix?!! ;)} - -changequote(,)dnl -# Character class describing NM global symbol codes. -ac_symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -ac_symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case "$host_os" in -aix*) - ac_symcode='[BCDT]' - ;; -cygwin* | mingw*) - ac_symcode='[ABCDGISTW]' - ;; -hpux*) - ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - ac_symcode='[BCDEGRST]' - ;; -solaris*) - ac_symcode='[BDT]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - ac_symcode='[ABCDGISTW]' -fi -changequote([,])dnl - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'" - - # Check to see that the pipe works correctly. - ac_pipe_works=no - rm -f conftest.$ac_ext - cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then - - # Try sorting and uniquifying the output. - if sort "$ac_nlist" | uniq > "$ac_nlist"T; then - mv -f "$ac_nlist"T "$ac_nlist" - else - rm -f "$ac_nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then - if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then - cat < conftest.c -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c' - - cat <> conftest.c -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -changequote(,)dnl -lt_preloaded_symbols[] = -changequote([,])dnl -{ -EOF - sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c - cat <<\EOF >> conftest.c - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftestm.$ac_objext - ac_save_LIBS="$LIBS" - ac_save_CFLAGS="$CFLAGS" - LIBS="conftestm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - ac_pipe_works=yes - else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.c >&AC_FD_CC - fi - LIBS="$ac_save_LIBS" - CFLAGS="$ac_save_CFLAGS" - else - echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC - fi - else - echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.c >&AC_FD_CC - fi - rm -rf conftest* - - # Do not use the global_symbol_pipe unless it works. - if test "$ac_pipe_works" = yes; then - if test x"$ac_symprfx" = x"_"; then - ac_cv_sys_symbol_underscore=yes - else - ac_cv_sys_symbol_underscore=no - fi - break - else - ac_cv_sys_global_symbol_pipe= - fi -done -]) - -ac_result=yes -if test -z "$ac_cv_sys_global_symbol_pipe"; then - ac_result=no -fi -AC_MSG_RESULT($ac_result) -]) - -# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin -AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN, -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -AC_CHECK_TOOL(AS, as, false) -]) - -# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols -# with an underscore? -AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE, -[AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_SYS_NM_PARSE])dnl -AC_MSG_CHECKING([for _ prefix in compiled symbols]) -AC_CACHE_VAL(ac_cv_sys_symbol_underscore, -[ac_cv_sys_symbol_underscore=no -cat > conftest.$ac_ext < $ac_nlist) && test -s "$ac_nlist"; then - # See whether the symbols have a leading underscore. - if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then - ac_cv_sys_symbol_underscore=yes - else - if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then - : - else - echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC - fi - fi - else - echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi -else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.c >&AC_FD_CC -fi -rm -rf conftest* -]) -AC_MSG_RESULT($ac_cv_sys_symbol_underscore) -USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no} -AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, [ -AC_CHECK_LIB(mw, _mwvalidcheckl) -AC_CHECK_LIB(m, cos) -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [ - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [ - AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [ - case "$enable_ltdl_install" in - no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;; - "") enable_ltdl_install=yes - ac_configure_args="$ac_configure_args --enable-ltdl-install" ;; - esac - ]) - if test x"$enable_ltdl_install" != x"no"; then - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl -AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl -AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl -AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl - diff --git a/libffi/configure b/libffi/configure index cc786f87..fcdfba5e 100755 --- a/libffi/configure +++ b/libffi/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.14.1 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -30,6 +30,8 @@ ac_help="$ac_help --enable-purify-safety Purify-safe mode" ac_help="$ac_help --disable-structs Omit code for struct support" +ac_help="$ac_help + --disable-raw-api Make the raw api unavailable" ac_help="$ac_help --enable-purify-safety Purify-safe mode" @@ -354,7 +356,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.14.1" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -514,7 +516,7 @@ done if test -r "$cache_file"; then echo "loading cache $cache_file" - test -f "$cache_file" && . $cache_file + . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -568,50 +570,36 @@ done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:578: checking host system type" >&5 -if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then - # Make sure we can run config.sub. - if $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } - fi - - ac_cv_host_alias=$host - case "$ac_cv_host_alias" in - NONE) - case $nonopt in - NONE) - if ac_cv_host_alias=`$ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) ac_cv_host_alias=$nonopt ;; - esac ;; - esac - - ac_cv_host=`$ac_config_sub $ac_cv_host_alias` - ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -else - echo $ac_n "(cached) $ac_c" 1>&6 +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi -echo "$ac_t""$ac_cv_host" 1>&6 - -host=$ac_cv_host -host_alias=$ac_cv_host_alias -host_cpu=$ac_cv_host_cpu -host_vendor=$ac_cv_host_vendor -host_os=$ac_cv_host_os - +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:585: checking host system type" >&5 +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 # Find a good install program. We prefer a C program (faster), @@ -626,9 +614,9 @@ host_os=$ac_cv_host_os # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:630: checking for a BSD compatible install" >&5 +echo "configure:618: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then -if eval "test \"\${ac_cv_path_install+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -646,10 +634,6 @@ else grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : - elif test $ac_prog = install && - grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 @@ -678,12 +662,12 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:687: checking whether build environment is sane" >&5 +echo "configure:671: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -731,18 +715,18 @@ EOF_SED rm -f conftestsed fi test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},;$program_transform_name" + program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},;$program_transform_name" + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:744: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:728: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF @@ -767,7 +751,6 @@ else fi - PACKAGE=libffi VERSION=2.00 @@ -787,7 +770,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:791: checking for working aclocal" >&5 +echo "configure:774: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -800,7 +783,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:804: checking for working autoconf" >&5 +echo "configure:787: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -813,7 +796,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:817: checking for working automake" >&5 +echo "configure:800: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -826,7 +809,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:830: checking for working autoheader" >&5 +echo "configure:813: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -839,7 +822,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:843: checking for working makeinfo" >&5 +echo "configure:826: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -851,56 +834,15 @@ else echo "$ac_t""missing" 1>&6 fi -for ac_prog in gnutar gtar tar -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:860: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AMTAR"; then - ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AMTAR="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -AMTAR="$ac_cv_prog_AMTAR" -if test -n "$AMTAR"; then - echo "$ac_t""$AMTAR" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$AMTAR" && break -done - -AMTARFLAGS= -if test -n "$AMTAR"; then - if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then - AMTARFLAGS=o - fi -fi - echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:899: checking for Cygwin environment" >&5 -if eval "test \"\${ac_cv_cygwin+set}\" = set"; then +echo "configure:841: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -921,25 +863,26 @@ else ac_cv_cygwin=no fi rm -f conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:931: checking for mingw32 environment" >&5 -if eval "test \"\${ac_cv_mingw32+set}\" = set"; then +echo "configure:874: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -949,57 +892,29 @@ else ac_cv_mingw32=no fi rm -f conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes -echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6 -echo "configure:959: checking for EMX OS/2 environment" >&5 -if eval "test \"\${ac_cv_emxos2+set}\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_emxos2=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_emxos2=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_emxos2" 1>&6 -EMXOS2= -test "$ac_cv_emxos2" = yes && EMXOS2=yes - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:990: checking for executable suffix" >&5 -if eval "test \"\${ac_cv_exeext+set}\" = set"; then +echo "configure:905: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.C | *.o | *.obj | *.xcoff) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1017,7 +932,7 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1021: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:936: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1043,8 +958,8 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1047: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +echo "configure:962: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1073,8 +988,8 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1077: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +echo "configure:992: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1120,12 +1035,12 @@ fi if test -z "$CC"; then case "`uname -s`" in - *win32* | *WIN32* | *CYGWIN*) + *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1128: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then +echo "configure:1043: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1155,8 +1070,8 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1160: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1075: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1167,12 +1082,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1171 "configure" +#line 1086 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1197,14 +1112,14 @@ echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1202: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1117: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1207: checking whether we are using GNU C" >&5 -if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then +echo "configure:1122: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1231,8 +1146,8 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1235: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then +echo "configure:1150: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c @@ -1331,51 +1246,29 @@ else enable_fast_install=yes fi - echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1337: checking build system type" >&5 -if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then - -# Make sure we can run config.sub. - if $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } - fi - - ac_cv_build_alias=$build - case "$ac_cv_build_alias" in - NONE) - case $nonopt in - NONE) - ac_cv_build_alias=$host_alias ;; - - *) ac_cv_build_alias=$nonopt ;; - esac ;; - esac - - ac_cv_build=`$ac_config_sub $ac_cv_build_alias` - ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -else - echo $ac_n "(cached) $ac_c" 1>&6 -fi - -echo "$ac_t""$ac_cv_build" 1>&6 - -build=$ac_cv_build -build_alias=$ac_cv_build_alias -build_cpu=$ac_cv_build_cpu -build_vendor=$ac_cv_build_vendor -build_os=$ac_cv_build_os - +echo "configure:1251: checking build system type" >&5 +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1378: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then +echo "configure:1271: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then @@ -1413,7 +1306,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1417: checking for ld used by GCC" >&5 +echo "configure:1310: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1437,12 +1330,12 @@ echo "configure:1417: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1441: checking for GNU ld" >&5 +echo "configure:1334: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1444: checking for non-GNU ld" >&5 +echo "configure:1337: checking for non-GNU ld" >&5 fi -if eval "test \"\${ac_cv_path_LD+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1476,8 +1369,8 @@ fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1480: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then +echo "configure:1373: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. @@ -1492,8 +1385,8 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1496: checking for BSD-compatible nm" >&5 -if eval "test \"\${ac_cv_path_NM+set}\" = set"; then +echo "configure:1389: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then @@ -1530,8 +1423,8 @@ echo "$ac_t""$NM" 1>&6 # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1534: checking command to parse $NM output" >&5 -if eval "test \"\${ac_cv_sys_global_symbol_pipe+set}\" = set"; then +echo "configure:1427: checking command to parse $NM output" >&5 +if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # These are sane defaults that work on at least a few old systems. @@ -1593,11 +1486,11 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func;return 0;} EOF - if { (eval echo configure:1597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. ac_nlist=conftest.nm - if { (eval echo configure:1601: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then + if { (eval echo configure:1494: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then # Try sorting and uniquifying the output. if sort "$ac_nlist" | uniq > "$ac_nlist"T; then @@ -1649,7 +1542,7 @@ EOF ac_save_CFLAGS="$CFLAGS" LIBS="conftestm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:1653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo configure:1546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_pipe_works=yes else echo "configure: failed program was:" >&5 @@ -1695,8 +1588,8 @@ fi echo "$ac_t""$ac_result" 1>&6 echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6 -echo "configure:1699: checking for _ prefix in compiled symbols" >&5 -if eval "test \"\${ac_cv_sys_symbol_underscore+set}\" = set"; then +echo "configure:1592: checking for _ prefix in compiled symbols" >&5 +if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_symbol_underscore=no @@ -1704,10 +1597,10 @@ cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. ac_nlist=conftest.nm - if { (eval echo configure:1711: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then + if { (eval echo configure:1604: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then ac_cv_sys_symbol_underscore=yes @@ -1733,8 +1626,8 @@ echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no} echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1737: checking whether ln -s works" >&5 -if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then +echo "configure:1630: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata @@ -1775,8 +1668,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1779 "configure"' > conftest.$ac_ext - if { (eval echo configure:1780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1672 "configure"' > conftest.$ac_ext + if { (eval echo configure:1673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1797,19 +1690,19 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1801: checking whether the C compiler needs -belf" >&5 -if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then +echo "configure:1694: checking whether the C compiler needs -belf" >&5 +if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -1832,8 +1725,8 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1836: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then +echo "configure:1729: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$DLLTOOL"; then @@ -1864,8 +1757,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1868: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then +echo "configure:1761: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$DLLTOOL"; then @@ -1899,8 +1792,8 @@ fi # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1903: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then +echo "configure:1796: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AS"; then @@ -1931,8 +1824,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1935: checking for $ac_word" >&5 -if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then +echo "configure:1828: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AS"; then @@ -2044,7 +1937,7 @@ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then echo "loading cache $cache_file" - test -f "$cache_file" && . $cache_file + . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -2062,6 +1955,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' exec 5>>./config.log + TARGETDIR="unknown" case "$host" in mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;; @@ -2154,13 +2048,13 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2156: checking how to run the C preprocessor" >&5 +echo "configure:2052: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get @@ -2169,13 +2063,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2186,13 +2080,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2203,13 +2097,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2234,12 +2128,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2236: checking for ANSI C header files" >&5 -if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then +echo "configure:2132: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2247,7 +2141,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2264,7 +2158,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2282,7 +2176,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2303,7 +2197,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2314,7 +2208,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2340,12 +2234,12 @@ fi for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2342: checking for $ac_func" >&5 -if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then +echo "configure:2238: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2396,19 +2289,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2398: checking for working alloca.h" >&5 -if eval "test \"\${ac_cv_header_alloca_h+set}\" = set"; then +echo "configure:2293: checking for working alloca.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2429,12 +2322,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2431: checking for alloca" >&5 -if eval "test \"\${ac_cv_func_alloca_works+set}\" = set"; then +echo "configure:2326: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2494,12 +2387,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2496: checking whether alloca needs Cray hooks" >&5 -if eval "test \"\${ac_cv_os_cray+set}\" = set"; then +echo "configure:2391: checking whether alloca needs Cray hooks" >&5 +if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2526: checking for $ac_func" >&5 -if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then +echo "configure:2421: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2580,15 +2472,15 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2582: checking stack direction for C alloca" >&5 -if eval "test \"\${ac_cv_c_stack_direction+set}\" = set"; then +echo "configure:2476: checking stack direction for C alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2630,15 +2522,15 @@ fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2632: checking size of short" >&5 -if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then +echo "configure:2526: 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 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2649,7 +2541,7 @@ main() exit(0); } EOF -if { (eval echo configure:2651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2669,15 +2561,15 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2671: checking size of int" >&5 -if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then +echo "configure:2565: 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 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2688,7 +2580,7 @@ main() exit(0); } EOF -if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -2708,15 +2600,15 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:2710: checking size of long" >&5 -if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then +echo "configure:2604: 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 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2727,7 +2619,7 @@ main() exit(0); } EOF -if { (eval echo configure:2729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2747,15 +2639,15 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:2749: checking size of long long" >&5 -if eval "test \"\${ac_cv_sizeof_long_long+set}\" = set"; then +echo "configure:2643: 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 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2766,7 +2658,7 @@ main() exit(0); } EOF -if { (eval echo configure:2768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -2786,15 +2678,15 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:2788: checking size of float" >&5 -if eval "test \"\${ac_cv_sizeof_float+set}\" = set"; then +echo "configure:2682: 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 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2805,7 +2697,7 @@ main() exit(0); } EOF -if { (eval echo configure:2807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -2825,15 +2717,15 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:2827: checking size of double" >&5 -if eval "test \"\${ac_cv_sizeof_double+set}\" = set"; then +echo "configure:2721: checking size of double" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2844,7 +2736,7 @@ main() exit(0); } EOF -if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -2864,15 +2756,15 @@ EOF echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:2866: checking size of long double" >&5 -if eval "test \"\${ac_cv_sizeof_long_double+set}\" = set"; then +echo "configure:2760: checking size of long double" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2883,7 +2775,7 @@ main() exit(0); } EOF -if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -2903,6 +2795,136 @@ EOF +echo $ac_n "checking size of void *""... $ac_c" 1>&6 +echo "configure:2800: checking size of void *" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(void *)); + exit(0); +} +EOF +if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_void_p=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_void_p=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6 +cat >> confdefs.h <&6 +echo "configure:2839: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:2857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + + @@ -2937,6 +2959,16 @@ EOF fi +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + cat >> confdefs.h <<\EOF +#define FFI_DISABLE_RAW_API 1 +EOF + +fi + + # Check whether --enable-purify-safety or --disable-purify-safety was given. if test "${enable_purify_safety+set}" = set; then enableval="$enable_purify_safety" @@ -3037,7 +3069,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.14.1" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3095,8 +3127,6 @@ s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g -s%@AMTAR@%$AMTAR%g -s%@AMTARFLAGS@%$AMTARFLAGS%g s%@SET_MAKE@%$SET_MAKE%g s%@EXEEXT@%$EXEEXT%g s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g @@ -3363,5 +3393,5 @@ exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 diff --git a/libffi/configure.in b/libffi/configure.in index 96134319..72cfca46 100644 --- a/libffi/configure.in +++ b/libffi/configure.in @@ -17,7 +17,8 @@ AC_EXEEXT AM_MAINTAINER_MODE AC_PROG_CC -AC_PROG_LIBTOOL +AM_PROG_LIBTOOL + TARGETDIR="unknown" case "$host" in @@ -59,17 +60,20 @@ AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(long double) +AC_CHECK_SIZEOF(void *) +AC_C_BIGENDIAN + AC_SUBST(TARGET) AC_SUBST(TARGETDIR) AC_SUBST(SHELL) AC_ARG_ENABLE(debug,[ --enable-debug Debugging mode], AC_DEFINE(FFI_DEBUG)) -AC_ARG_ENABLE(purify-safety, -[ --enable-purify-safety Purify-safe mode], AC_DEFINE(USING_PURIFY)) AC_ARG_ENABLE(debug,[ --disable-structs Omit code for struct support], AC_DEFINE(FFI_NO_STRUCTS)) +AC_ARG_ENABLE(debug,[ --disable-raw-api Make the raw api unavailable], AC_DEFINE(FFI_NO_RAW_API)) + AC_ARG_ENABLE(purify-safety, [ --enable-purify-safety Purify-safe mode], AC_DEFINE(USING_PURIFY)) diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in index b3cc63d7..d5b27430 100644 --- a/libffi/fficonfig.h.in +++ b/libffi/fficonfig.h.in @@ -32,6 +32,9 @@ spurious messages. */ #undef USING_PURIFY +/* Define this if you want the raw api disabled */ +#undef FFI_DISABLE_RAW_API + /* This is the package name */ #undef PACKAGE @@ -61,3 +64,10 @@ /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY + +/* Define if target machine is big endian. */ +#undef WORDS_BIGENDIAN + +/* The number of bytes in a void pointer. */ +#undef SIZEOF_VOID_P + diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in index 20192e56..2687d856 100644 --- a/libffi/include/Makefile.in +++ b/libffi/include/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4a from Makefile.am +# Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -10,6 +10,7 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. + SHELL = @SHELL@ srcdir = @srcdir@ @@ -45,10 +46,9 @@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = transform = @program_transform_name@ NORMAL_INSTALL = : @@ -59,27 +59,17 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ -AMTAR = @AMTAR@ -AMTARFLAGS = @AMTARFLAGS@ -AS = @AS@ CC = @CC@ -DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ -LD = @LD@ LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -NM = @NM@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ SHELL = @SHELL@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ -USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ VERSION = @VERSION@ - AUTOMAKE_OPTIONS = foreign EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h @@ -87,18 +77,17 @@ EXTRA_DIST = ffi.h.in ffi_common.h ffi_mips.h hackdir = $(includedir) hack_DATA = fficonfig.h ffi.h ffi_mips.h -subdir = include mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../fficonfig.h CONFIG_CLEAN_FILES = ffi.h -DIST_SOURCES = DATA = $(hack_DATA) -DIST_COMMON = $(hack_DATA) Makefile.am Makefile.in ffi.h.in +DIST_COMMON = Makefile.am Makefile.in ffi.h.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: @@ -116,18 +105,19 @@ install-hackDATA: $(hack_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(hackdir) @list='$(hack_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(hackdir)/$$f"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(hackdir)/$$f; \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(hackdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(hackdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(hackdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(hackdir)/$$p; \ + fi; fi; \ done uninstall-hackDATA: @$(NORMAL_UNINSTALL) - @list='$(hack_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(hackdir)/$$f"; \ - rm -f $(DESTDIR)$(hackdir)/$$f; \ + list='$(hack_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(hackdir)/$$p; \ done tags: TAGS TAGS: @@ -135,6 +125,8 @@ TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +subdir = include + distdir: $(DISTFILES) here=`cd $(top_builddir) && pwd`; \ top_distdir=`cd $(top_distdir) && pwd`; \ @@ -144,7 +136,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -173,7 +165,7 @@ uninstall: uninstall-am all-am: Makefile $(DATA) all-redirect: all-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(hackdir) @@ -209,8 +201,8 @@ maintainer-clean: maintainer-clean-am .PHONY: uninstall-hackDATA install-hackDATA tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all install-strip \ -installdirs mostlyclean-generic distclean-generic clean-generic \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean diff --git a/libffi/include/ffi.h.in b/libffi/include/ffi.h.in index f76dbf50..710677e6 100644 --- a/libffi/include/ffi.h.in +++ b/libffi/include/ffi.h.in @@ -1,7 +1,7 @@ /* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - Copyright (c) 1996, 1997, 1998 Cygnus Solutions + libffi @VERSION@ - Copyright (c) 1996-1999 Cygnus Solutions - $Id: ffi.h.in,v 1.1 1998/11/29 16:48:16 green Exp $ + $Id: ffi.h.in,v 1.2 1999/08/04 18:00:05 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -127,7 +127,7 @@ #ifdef MIPS #include #else -#define SIZEOF_ARG sizeof(void*) +#define SIZEOF_ARG SIZEOF_VOID_P #endif #ifndef LIBFFI_ASM @@ -243,6 +243,109 @@ typedef struct { } ffi_cif; +/* ---- Definitions for the raw API -------------------------------------- */ + +#if !FFI_NO_RAW_API + +#if SIZEOF_ARG == 4 + +#define UINT_ARG UINT32 +#define SINT_ARG SINT32 + +#endif + +#if SIZEOF_ARG == 8 + +#define UINT_ARG UINT64 +#define SINT_ARG SINT64 + +#endif + +typedef union { + SINT_ARG sint; + UINT_ARG uint; + char data[SIZEOF_ARG]; + void* ptr; +} ffi_raw; + +void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ ffi_raw *avalue); + +void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +size_t ffi_raw_size (ffi_cif *cif); + + + + +#endif /* !FFI_NO_RAW_API */ + +/* ---- Definitions for closures ----------------------------------------- */ + +#ifdef X86 + +#define FFI_CLOSURES 1 /* x86 supports closures */ +#define FFI_TRAMPOLINE_SIZE 10 +#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ + +#else + +#define FFI_CLOSURES 0 +#define FFI_NATIVE_RAW_API 0 + +#endif + + + +#if FFI_CLOSURES + +typedef struct { + char tramp[FFI_TRAMPOLINE_SIZE]; + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); + void *user_data; +} ffi_closure; + +ffi_status +ffi_prep_closure (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data); + +#if !FFI_NO_RAW_API + +typedef struct { + char tramp[FFI_TRAMPOLINE_SIZE]; + + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* if this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_raw*,void*); + void *user_data; + +} ffi_raw_closure; + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +#endif /* !FFI_NO_RAW_API */ +#endif /* FFI_CLOSURES */ + /* ---- Public interface definition -------------------------------------- */ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, diff --git a/libffi/src/x86/ffi.c b/libffi/src/x86/ffi.c index 8118862c..2bc7570e 100644 --- a/libffi/src/x86/ffi.c +++ b/libffi/src/x86/ffi.c @@ -1,9 +1,9 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1996, 1998 Cygnus Solutions + ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions x86 Foreign Function Interface - $Id: ffi.c,v 1.1 1998/11/29 16:48:16 green Exp $ + $Id: ffi.c,v 1.2 1999/08/04 18:00:05 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -127,7 +127,6 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: - case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: @@ -135,6 +134,10 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) cif->flags = (unsigned) cif->rtype->type; break; + case FFI_TYPE_UINT64: + cif->flags = FFI_TYPE_SINT64; + break; + default: cif->flags = FFI_TYPE_INT; break; @@ -190,3 +193,317 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif, break; } } + + +/** private members **/ + +static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif); +static void ffi_closure_SYSV (); +static void ffi_closure_raw_SYSV (); + +/* This function is jumped to by the trampoline, on entry, %ecx (a + * caller-save register) holds the address of the closure. + * Clearly, this requires __GNUC__, so perhaps we should translate this + * into an assembly file if this is to be distributed with ffi. + */ + +static void +ffi_closure_SYSV () +{ + // this is our return value storage + long double res; + + // our various things... + void *args; + ffi_cif *cif; + void **arg_area; + ffi_closure *closure; + unsigned short rtype; + void *resp = (void*)&res; + + /* grab the trampoline context pointer */ + asm ("movl %%ecx,%0" : "=r" (closure)); + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + asm ("leal 8(%%ebp),%0" : "=q" (args)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, (void**)&resp, arg_area, cif); + + (closure->fun) (cif, resp, arg_area, closure->user_data); + + rtype = cif->flags; + + /* now, do a generic return based on the value of rtype */ + if (rtype == FFI_TYPE_INT) + { + asm ("movl (%0),%%eax" : : "r" (resp) : "eax"); + } + else if (rtype == FFI_TYPE_FLOAT) + { + asm ("flds (%0)" : : "r" (resp) : "st" ); + } + else if (rtype == FFI_TYPE_DOUBLE) + { + asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_LONGDOUBLE) + { + asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_SINT64) + { + asm ("movl 0(%0),%%eax;" + "movl 4(%0),%%edx" + : : "r"(resp) + : "eax", "edx"); + } +} + +/*@-exportheader@*/ +static void +ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif) +/*@=exportheader@*/ +{ + register unsigned int i; + register int tmp; + register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + tmp = 0; + argp = stack; + + if ( cif->rtype->type == FFI_TYPE_STRUCT ) { + *rvalue = *(void **) argp; + argp += 4; + } + + avn = cif->nargs; + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; + (i != 0) && (avn != 0); + i--, p_arg++) + { + size_t z; + + /* Align if necessary */ + if (((*p_arg)->alignment - 1) & (unsigned) argp) { + argp = (char *) ALIGN(argp, (*p_arg)->alignment); + } + + if (avn != 0) + { + avn--; + z = (*p_arg)->size; + + /* because we're little endian, this is + what it turns into. */ + + *p_argv = (void*) argp; + + p_argv++; + argp += z; + } + } + + return; +} + +/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */ + +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned int __dis = __fun - ((unsigned int) __tramp + 10); \ + *(unsigned char*) &__tramp[0] = 0xb9; \ + *(unsigned int*) &__tramp[1] = __ctx; \ + *(unsigned char*) &__tramp[5] = 0xe9; \ + *(unsigned int*) &__tramp[6] = __dis; \ + }) + + +/* the cif must already be prep'ed */ + +ffi_status +ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data) +{ + FFI_ASSERT (cif->abi == FFI_SYSV); + + FFI_INIT_TRAMPOLINE (&closure->tramp[0], \ + &ffi_closure_SYSV, \ + (void*)closure); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + +/* ------- Native raw API support -------------------------------- */ + +#if !FFI_NO_RAW_API + +static void +ffi_closure_raw_SYSV () +{ + // this is our return value storage + long double res; + + // our various things... + void *args; + ffi_raw *raw_args; + ffi_cif *cif; + ffi_raw_closure *closure; + unsigned short rtype; + void *resp = (void*)&res; + + /* grab the trampoline context pointer */ + asm ("movl %%ecx,%0" : "=r" (closure)); + + /* take the argument pointer */ + asm ("leal 8(%%ebp),%0" : "=q" (args)); + + /* get the cif */ + cif = closure->cif; + + /* the SYSV/X86 abi matches the RAW API exactly, well.. almost */ + raw_args = (ffi_raw*) args; + + (closure->fun) (cif, resp, raw_args, closure->user_data); + + rtype = cif->flags; + + /* now, do a generic return based on the value of rtype */ + if (rtype == FFI_TYPE_INT) + { + asm ("movl (%0),%%eax" : : "r" (resp) : "eax"); + } + else if (rtype == FFI_TYPE_FLOAT) + { + asm ("flds (%0)" : : "r" (resp) : "st" ); + } + else if (rtype == FFI_TYPE_DOUBLE) + { + asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_LONGDOUBLE) + { + asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" ); + } + else if (rtype == FFI_TYPE_SINT64) + { + asm ("movl 0(%0),%%eax; movl 4(%0),%%edx" + : : "r"(resp) + : "eax", "edx"); + } +} + + + + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data) +{ + int i; + + FFI_ASSERT (cif->abi == FFI_SYSV); + + // we currently don't support certain kinds of arguments for raw + // closures. This should be implemented by a seperate assembly language + // routine, since it would require argument processing, something we + // don't do now for performance. + + for (i = cif->nargs-1; i >= 0; i--) + { + FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT); + FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE); + } + + + FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV, + (void*)closure); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + +static void +ffi_prep_args_raw(char *stack, extended_cif *ecif) +{ + memcpy (stack, ecif->avalue, ecif->cif->bytes); +} + +/* we borrow this routine from libffi (it must be changed, though, to + * actually call the function passed in the first argument. as of + * libffi-1.20, this is not the case.) + */ + +extern void +ffi_call_SYSV(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); + +void +ffi_call_raw(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) +{ + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + /*@-sysunrecog@*/ + ecif.rvalue = alloca(cif->rtype->size); + /*@=sysunrecog@*/ + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { + case FFI_SYSV: + /*@-usedef@*/ + ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; + default: + FFI_ASSERT(0); + break; + } +} + +#endif diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S index 3ef40a0e..41ac4601 100644 --- a/libffi/src/x86/sysv.S +++ b/libffi/src/x86/sysv.S @@ -3,7 +3,7 @@ X86 Foreign Function Interface - $Id: sysv.S,v 1.1 1998/11/29 16:48:16 green Exp $ + $Id: sysv.S,v 1.2 1999/08/04 18:00:05 green Exp $ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -50,7 +50,7 @@ ffi_call_SYSV: # Place all of the ffi_prep_args in position pushl 12(%ebp) pushl %eax - call ffi_prep_args + call *8(%ebp) # Return stack to previous state and call the function addl $8,%esp