Makefile: enable target overridings. (#661) This patch allows target to provide extra files enabling the override of Makefile rules. This patch is not needed for libffi itself but only for GCC on AIX. The t-aix file which is here empty will be replaced in GCC repository. We cannot include GCC version directly here because it has no sense for a standalone libffi. Co-authored-by: Clement <clement.chigot@atos.net>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/Makefile.am b/Makefile.am
index a1a8912..31ece7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -150,3 +150,5 @@ dist-hook:
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
+# target overrides
+-include $(tmake_file)
diff --git a/configure.ac b/configure.ac
index 7a17a23..915b820 100644
--- a/configure.ac
+++ b/configure.ac
@@ -431,6 +431,16 @@ else
fi
AC_SUBST(toolexeclibdir)
+# Conditionalize the makefile for this target machine.
+tmake_file_=
+for f in ${tmake_file}; do
+ if test -f ${srcdir}/src/$TARGETDIR/$f; then
+ tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f"
+ fi
+done
+tmake_file="${tmake_file_}"
+AC_SUBST(tmake_file)
+
# Check linker support.
LIBFFI_ENABLE_SYMVERS
diff --git a/configure.host b/configure.host
index 9d73f18..5cd5fc4 100644
--- a/configure.host
+++ b/configure.host
@@ -212,6 +212,8 @@ case "${host}" in
;;
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
+ # Create AIX-style "FAT" libraries.
+ tmake_file="t-aix"
;;
powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
diff --git a/src/powerpc/t-aix b/src/powerpc/t-aix
new file mode 100644
index 0000000..e7be1ca
--- /dev/null
+++ b/src/powerpc/t-aix
@@ -0,0 +1,5 @@
+# This file is needed by GCC in order to correctly build AIX FAT
+# library for libffi.
+# However, it has no sense to include this code here, as it depends
+# on GCC multilib architecture.
+# Thus, this file is a simple stub replaced in GCC repository.