diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-08-30 14:31:19 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-10-20 05:35:52 -0700 |
commit | 5be7b66998127286fada45e4f23bd8a2056d553e (patch) | |
tree | 701ca9676299ab51e64df31f8ddfc67bf5a7514e /libffi/Makefile.am | |
parent | 92456a4e5658e138e2cea79e390e3306b07685b0 (diff) | |
download | gcc-5be7b66998127286fada45e4f23bd8a2056d553e.zip gcc-5be7b66998127286fada45e4f23bd8a2056d553e.tar.gz gcc-5be7b66998127286fada45e4f23bd8a2056d553e.tar.bz2 |
libffi: Integrate build with GCC
1. Integrate with GCC build.
2. Disable static trampolines by default.
3. 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.
(exec-static-tramp): Don't enable use of static exec trampolines
by default.
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.
Diffstat (limited to 'libffi/Makefile.am')
-rw-r--r-- | libffi/Makefile.am | 116 |
1 files changed, 98 insertions, 18 deletions
diff --git a/libffi/Makefile.am b/libffi/Makefile.am index 1b18198..02e3617 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 |