From patchwork Tue Aug 31 15:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1522681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=P9O9OWKG; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GzWZn5wM2z9s24 for ; Wed, 1 Sep 2021 01:39:29 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FF743857811 for ; Tue, 31 Aug 2021 15:39:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FF743857811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630424366; bh=W0+pusRtMu+Gm8pE4DZ/rtYO80MimqceKlR5qX2Y4OY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=P9O9OWKG7Zk1OAs2tVE1GLQiIO5BedcUfs9oDY6YoR9n3bMi1iOB8NzbunrsEaRyK xPgVprhj44Exq1DD8IcQfMCIs00kR+60rmT/nV9dfeabCdL9c0DxWd6zLEtfeu3gMy MVv0MtpOVL0nNVTa0Cr2kqOQBGRunxEDHrRDqBi8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 3152A3858410 for ; Tue, 31 Aug 2021 15:37:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3152A3858410 Received: by mail-pg1-x52a.google.com with SMTP id q68so17086424pga.9 for ; Tue, 31 Aug 2021 08:37:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W0+pusRtMu+Gm8pE4DZ/rtYO80MimqceKlR5qX2Y4OY=; b=rIym3UKuyYcs1e+eOyoYYwPcrq5wEYWKUQTf8Qckc8ingVeYFnWIz3lmTgDbWbKhkT 8uTcO8NhSjIpV1Va9g3YmUbX0YkM4Vuf6jg71O/Y95fYEZkbzUWLFxlrJ7gmIR7hxcUa +n4jAx7PHveaVqaIJ/Rxpo7wT8VzKfXKjcWdKppNr+WxWZcJ1QheL87fxDY5Q0KOQSmS eeA3lqn7iYoTGLGaio1O01K9s6TKGUz0WyARUQGr4iuMLYp4UqgEPCrMWOTprD2XwhMR wOuQYCugLx6n1iG2qg0xT38zEo033h3iemyVmyhB4egvbIg7thty8BHc3EN/KgjjP8It rpPg== X-Gm-Message-State: AOAM531lc46777yWKaUNhNpHey3mKyvljGuKTDZu8OgV+Dg+qG6PIQzK L/OaI3AZx0FxWC78dNOe09pT8uxjlPU= X-Google-Smtp-Source: ABdhPJz8+Z0agbYGbo4OlIUhUkomKTulZbFrC8kaL4znHvFDIoJply1QB2dInSiP4CAzaxzzbvWcLQ== X-Received: by 2002:a05:6a00:2346:b0:3e1:9a1e:4a0d with SMTP id j6-20020a056a00234600b003e19a1e4a0dmr29193819pfj.47.1630424221921; Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id o10sm17756124pfk.212.2021.08.31.08.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 08:37:01 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id DDD5CC032A; Tue, 31 Aug 2021 08:36:59 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/4] libffi: Integrate with GCC Date: Tue, 31 Aug 2021 08:36:58 -0700 Message-Id: <20210831153659.3756892-4-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210831153659.3756892-1-hjl.tools@gmail.com> References: <20210831153659.3756892-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_STOCKGEN, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 1. Integrate with GCC. 2. Support multilib. * Makefile.am (AUTOMAKE_OPTIONS): Add info-in-builddir. (ACLOCAL_AMFLAGS): Set to -I .. -I ../config. (SUBDIRS): Don't add doc. (TEXINFO_TEX): New. (MAKEINFOFLAGS): Likewise. (info_TEXINFOS): Likewise. (STAMP_GENINSRC): Likewise. (STAMP_BUILD_INFO): Likewise. (all-local): Likewise. (stamp-geninsrc): Likewise. (doc/libffi.info): Likewise. (stamp-build-info:): Likewise. (CLEANFILES): Likewise. (MAINTAINERCLEANFILES): Likewise. (AM_MAKEFLAGS): Likewise. (all-recursive): Likewise. (install-recursive): Likewise. (mostlyclean-recursive): Likewise. (clean-recursive): Likewise. (distclean-recursive): Likewise. (maintainer-clean-recursive): Likewise. (LTLDFLAGS): Replace libtool-ldflags with ../libtool-ldflags. (AM_CFLAGS): Add -g -fexceptions. (libffi.map-sun): Replace make_sunver.pl with ../contrib/make_sunver.pl. (dist-hook): Removed. Include $(top_srcdir)/../multilib.am. * configure.ac: Add AM_ENABLE_MULTILIB. Remove the frv*-elf check. (AX_ENABLE_BUILDDIR): Removed. (AM_INIT_AUTOMAKE): Add [no-dist]. Add --enable-generated-files-in-srcdir. (C_CONFIG_MACRO_DIR): Removed. (AX_COMPILER_VENDOR): Likewise. (AX_CC_MAXOPT): Likewise. (AX_CFLAGS_WARN_ALL): Likewise. Remove the GCC check. (SYMBOL_UNDERSCORE): Removed. (AX_CHECK_COMPILE_FLAG): Likewise. Remove --disable-docs. (ACX_CHECK_PROG_VER): Check makeinfo. (BUILD_DOCS): Updated. Remove --disable-multi-os-directory. (GCC_WITH_TOOLEXECLIBDIR): New. Support cross host. Support --enable-multilib. * include/Makefile.am (nodist_include_HEADERS): Removed. (gcc_version): New. (toollibffidir): Likewise. (toollibffi_HEADERS): Likewise. * Makefile.in: Regenerate. (GCC_BASE_VER): New. (AC_CONFIG_FILES): Remove doc/Makefile. (AC_CONFIG_LINKS): New. * aclocal.m4: Likewise. * configure: Likewise. * fficonfig.h.in: Likewise. * mdate-sh: Likewise. * include/Makefile.in: Likewise. * man/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. --- libffi/Makefile.am | 116 +- libffi/Makefile.in | 1963 ++++ libffi/aclocal.m4 | 1202 ++ libffi/configure | 19584 +++++++++++++++++++++++++++++++++ libffi/configure.ac | 126 +- libffi/fficonfig.h.in | 227 + libffi/include/Makefile.am | 6 +- libffi/include/Makefile.in | 566 + libffi/man/Makefile.in | 516 + libffi/mdate-sh | 224 + libffi/testsuite/Makefile.in | 606 + 11 files changed, 25052 insertions(+), 84 deletions(-) create mode 100644 libffi/Makefile.in create mode 100644 libffi/aclocal.m4 create mode 100755 libffi/configure create mode 100644 libffi/fficonfig.h.in create mode 100644 libffi/include/Makefile.in create mode 100644 libffi/man/Makefile.in create mode 100755 libffi/mdate-sh create mode 100644 libffi/testsuite/Makefile.in diff --git a/libffi/Makefile.am b/libffi/Makefile.am index 1b18198ad18..02e36176c67 100644 --- a/libffi/Makefile.am +++ b/libffi/Makefile.am @@ -1,18 +1,10 @@ ## Process this with automake to create Makefile.in -AUTOMAKE_OPTIONS = foreign subdir-objects +AUTOMAKE_OPTIONS = foreign subdir-objects info-in-builddir -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I .. -I ../config SUBDIRS = include testsuite man -if BUILD_DOCS -## This hack is needed because it doesn't seem possible to make a -## conditional info_TEXINFOS in Automake. At least Automake 1.14 -## either gives errors -- if this attempted in the most -## straightforward way -- or simply unconditionally tries to build the -## info file. -SUBDIRS += doc -endif EXTRA_DIST = LICENSE ChangeLog.old \ m4/libtool.m4 m4/lt~obsolete.m4 \ @@ -26,6 +18,90 @@ EXTRA_DIST = LICENSE ChangeLog.old \ # local.exp is generated by configure DISTCLEANFILES = local.exp +# Automake Documentation: +# If your package has Texinfo files in many directories, you can use the +# variable TEXINFO_TEX to tell Automake where to find the canonical +# `texinfo.tex' for your package. The value of this variable should be +# the relative path from the current `Makefile.am' to `texinfo.tex'. +TEXINFO_TEX = ../gcc/doc/include/texinfo.tex + +# Defines info, dvi, pdf and html targets +MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include +info_TEXINFOS = doc/libffi.texi + +# AM_CONDITIONAL on configure option --generated-files-in-srcdir +if GENINSRC +STAMP_GENINSRC = stamp-geninsrc +else +STAMP_GENINSRC = +endif + +# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO]) +if BUILD_DOCS +STAMP_BUILD_INFO = stamp-build-info +else +STAMP_BUILD_INFO = +endif + +all-local: $(STAMP_GENINSRC) + +stamp-geninsrc: doc/libffi.info + cp -p $(top_builddir)/doc/libffi.info $(srcdir)/doc/libffi.info + @touch $@ + +doc/libffi.info: $(STAMP_BUILD_INFO) + +stamp-build-info: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp) + $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)/doc -o doc/libffi.info $(srcdir)/doc/libffi.texi + @touch $@ + +CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) +MAINTAINERCLEANFILES = $(srcdir)/doc/libffi.info + +## ################################################################ + +## +## This section is for make and multilib madness. +## + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "JC1FLAGS=$(JC1FLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "SHELL=$(SHELL)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "mandir=$(mandir)" \ + "prefix=$(prefix)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ + "LD=$(LD)" \ + "NM=$(NM)" \ + "RANLIB=$(RANLIB)" \ + "DESTDIR=$(DESTDIR)" + # Subdir rules rely on $(FLAGS_TO_PASS) FLAGS_TO_PASS = $(AM_MAKEFLAGS) @@ -104,9 +180,9 @@ libffi_convenience_la_LIBADD = $(libffi_la_LIBADD) libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES) nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) -LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) +LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) -AM_CFLAGS = +AM_CFLAGS = -Wall -g -fexceptions if FFI_DEBUG # Build debug. Define FFI_DEBUG on the commandline so that, when building with # MSVC, it can link against the debug CRT. @@ -121,9 +197,9 @@ endif if LIBFFI_BUILD_VERSIONED_SHLIB_SUN libffi_version_script = -Wl,-M,libffi.map-sun libffi_version_dep = libffi.map-sun -libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \ +libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \ $(libffi_la_OBJECTS) $(libffi_la_LIBADD) - perl $(top_srcdir)/make_sunver.pl libffi.map \ + perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \ `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \ > $@ || (rm -f $@ ; exit 1) @@ -144,8 +220,12 @@ libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src AM_CCASFLAGS = $(AM_CPPFLAGS) -dist-hook: - d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc) - if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog - s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md +# Multilib support. Automake should provide these on its own. +all-recursive: all-multi +install-recursive: install-multi +mostlyclean-recursive: mostlyclean-multi +clean-recursive: clean-multi +distclean-recursive: distclean-multi +maintainer-clean-recursive: maintainer-clean-multi +include $(top_srcdir)/../multilib.am diff --git a/libffi/configure.ac b/libffi/configure.ac index 70f6d2c2ea4..d67b205ea92 100644 --- a/libffi/configure.ac +++ b/libffi/configure.ac @@ -5,18 +5,30 @@ AC_PREREQ(2.68) AC_INIT([libffi], [3.4.2], [http://github.com/libffi/libffi/issues]) AC_CONFIG_HEADERS([fficonfig.h]) +AM_ENABLE_MULTILIB(, ..) + AC_CANONICAL_SYSTEM target_alias=${target_alias-$host_alias} -case "${host}" in - frv*-elf) - LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ - ;; -esac - -AX_ENABLE_BUILDDIR - -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([no-dist]) + +# We would like our source tree to be readonly. However when releases or +# pre-releases are generated, the flex/bison generated files as well as the +# various formats of manuals need to be included along with the rest of the +# sources. Therefore we have --enable-generated-files-in-srcdir to do +# just that. +AC_MSG_CHECKING(generated-files-in-srcdir) +AC_ARG_ENABLE(generated-files-in-srcdir, +AS_HELP_STRING([--enable-generated-files-in-srcdir], + [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]), +[case "$enableval" in + yes) enable_generated_files_in_srcdir=yes ;; + no) enable_generated_files_in_srcdir=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[enable_generated_files_in_srcdir=no]) +AC_MSG_RESULT($enable_generated_files_in_srcdir) +AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes) # The same as in boehm-gc and libstdc++. Have to borrow it from there. # We must force CC to /not/ be precious variables; otherwise @@ -39,25 +51,12 @@ AC_SUBST(CFLAGS) AM_PROG_AS AM_PROG_CC_C_O AC_PROG_LIBTOOL -AC_CONFIG_MACRO_DIR([m4]) AC_CHECK_TOOL(READELF, readelf) # Test for 64-bit build. AC_CHECK_SIZEOF([size_t]) -AX_COMPILER_VENDOR -AX_CC_MAXOPT -# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro -# compiler. -if test "$ax_cv_c_compiler_vendor" != "sun"; then - AX_CFLAGS_WARN_ALL -fi - -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fexceptions" -fi - cat > local.exp < conftest.c - if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then + if $CC $CFLAGS -c -fpic -fexceptions -fno-lto -o conftest.o conftest.c > /dev/null 2>&1; then if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then libffi_cv_ro_eh_frame=no fi @@ -306,12 +298,12 @@ if test "x$GCC" = "xyes"; then fi fi -AC_ARG_ENABLE(docs, - AC_HELP_STRING([--disable-docs], - [Disable building of docs (default: no)]), - [enable_docs=no], - [enable_docs=yes]) -AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes]) +# See if makeinfo has been installed and is modern enough +# that we can use it. +ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version], + [GNU texinfo.* \([0-9][0-9.]*\)], + [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) +AM_CONDITIONAL(BUILD_DOCS, test $gcc_cv_prog_makeinfo_modern = "yes") AH_BOTTOM([ #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE @@ -386,47 +378,51 @@ AC_ARG_ENABLE(purify-safety, AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) fi) -AC_ARG_ENABLE(multi-os-directory, -[ --disable-multi-os-directory - disable use of gcc --print-multi-os-directory to change the library installation directory]) - -# These variables are only ever used when we cross-build to X86_WIN32. -# And we only support this with GCC, so... -if test "x$GCC" = "xyes"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - toolexecdir='${exec_prefix}'/'$(target_alias)' - toolexeclibdir='${toolexecdir}'/lib - else - toolexecdir='${libdir}'/gcc-lib/'$(target_alias)' - toolexeclibdir='${libdir}' - fi - if test x"$enable_multi_os_directory" != x"no"; then - multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` - case $multi_os_directory in - .) ;; # Avoid trailing /. - ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; - esac - fi - AC_SUBST(toolexecdir) +GCC_WITH_TOOLEXECLIBDIR + +if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + toolexecdir='$(exec_prefix)/$(target_alias)' + case ${with_toolexeclibdir} in + no) + toolexeclibdir='$(toolexecdir)/lib' + ;; + *) + toolexeclibdir=${with_toolexeclibdir} + ;; + esac else - toolexeclibdir='${libdir}' + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' fi +multi_os_directory=`$CC -print-multi-os-directory` +case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +esac +AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + # Check linker support. LIBFFI_ENABLE_SYMVERS +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_COMMANDS(include, [test -d include || mkdir include]) AC_CONFIG_COMMANDS(src, [ test -d src || mkdir src test -d src/$TARGETDIR || mkdir src/$TARGETDIR ], [TARGETDIR="$TARGETDIR"]) -AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc) +AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) -AC_OUTPUT +AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) -# Copy this file instead of using AC_CONFIG_LINK in order to support -# compiling with MSVC, which won't understand cygwin style symlinks. -cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h +AC_OUTPUT diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am index 5f0d4066f4a..d7d1641f00c 100644 --- a/libffi/include/Makefile.am +++ b/libffi/include/Makefile.am @@ -6,4 +6,8 @@ DISTCLEANFILES=ffitarget.h noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h EXTRA_DIST=ffi.h.in -nodist_include_HEADERS = ffi.h ffitarget.h +# Where generated headers like ffitarget.h get installed. +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) +toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include + +toollibffi_HEADERS = ffi.h ffitarget.h