public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4563] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
@ 2021-10-20 12:36 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-10-20 12:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d738405e7fe62cc8eb9580948a6ea39005cd7170

commit r12-4563-gd738405e7fe62cc8eb9580948a6ea39005cd7170
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Aug 30 14:36:52 2021 -0700

    libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
    
    Add scripts for syncing with libffi upstream:
    
    1. Clone libffi repo.
    2. Checkout the specific commit.
    3. Remove the unused files.
    4. Add new files and remove old files if needed.
    
            * HOWTO_MERGE: New file.
            * autogen.sh: Likewise.
            * merge.sh: Likewise.

Diff:
---
 libffi/HOWTO_MERGE | 13 +++++++++++++
 libffi/autogen.sh  | 11 +++++++++++
 libffi/merge.sh    | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+)

diff --git a/libffi/HOWTO_MERGE b/libffi/HOWTO_MERGE
new file mode 100644
index 00000000000..5b92b10c15c
--- /dev/null
+++ b/libffi/HOWTO_MERGE
@@ -0,0 +1,13 @@
+In general, merging process should not be very difficult, but we need to
+track GCC-specific patches carefully.  Here is a general list of actions
+required to perform the merge:
+
+* Checkout recent GCC tree.
+* Run merge.sh script from the libffi directory.
+* Add new files and remove old files if needed.
+* Apply all needed GCC-specific patches to libffi (note that some of
+  them might be already included to upstream).  The list of these patches
+  is stored into LOCAL_PATCHES file.  May need to re-run autogen.sh to
+  regenerate configure and Makefile.in files.
+* Send your patches for review to GCC Patches Mailing List (gcc-patches@gcc.gnu.org).
+* Update LOCAL_PATCHES file when you've committed the whole patch set with new revisions numbers.
diff --git a/libffi/autogen.sh b/libffi/autogen.sh
new file mode 100755
index 00000000000..95bfc389faf
--- /dev/null
+++ b/libffi/autogen.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+#exec autoreconf -v -i
+
+rm -rf autom4te.cache
+aclocal  -I .. -I ../config
+autoheader -I .. -I ../config
+autoconf
+automake --foreign --add-missing --copy Makefile
+automake --foreign include/Makefile
+automake --foreign man/Makefile
+automake --foreign testsuite/Makefile
diff --git a/libffi/merge.sh b/libffi/merge.sh
new file mode 100755
index 00000000000..b36fbb92185
--- /dev/null
+++ b/libffi/merge.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# FIXME: do we need a license (or whatever else) header here?
+
+# This script merges libffi sources from upstream.
+
+# Default to the tip of master branch.
+commit=${1-master}
+
+fatal() {
+  echo "$1"
+  exit 1;
+}
+
+get_upstream() {
+  rm -rf upstream
+  git clone https://github.com/libffi/libffi.git upstream
+  pushd upstream
+  git checkout $commit || fatal "Failed to checkout $commit"
+  popd
+}
+
+get_current_rev() {
+  cd upstream
+  git rev-parse HEAD
+}
+
+pwd | grep 'libffi$' || \
+  fatal "Run this script from the libffi directory"
+get_upstream
+CUR_REV=$(get_current_rev)
+echo Current upstream revision: $CUR_REV
+
+# Remove the unused files.
+pushd upstream
+rm -rf ChangeLog.old .appveyor* .ci .github .gitignore .travis* \
+	config.guess config.sub libtool-ldflags m4 make_sunver.pl \
+	msvc_build
+rm -rf .git autogen.sh
+cp -a . ..
+popd
+
+rm -rf upstream
+
+# Update the MERGE file.
+cat << EOF > MERGE
+$CUR_REV
+
+The first line of this file holds the git revision number of the
+last merge done from the master library sources.
+EOF


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-20 12:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 12:36 [gcc r12-4563] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).