[m-rev.] diff: Use nested submodules to include boehm_gc/libatomic_ops

Paul Bone paul at bone.id.au
Mon Oct 19 16:45:59 AEDT 2015


Use nested submodules to include boehm_gc/libatomic_ops

Feedback of the upgrade of Boehm GC indicated that including the
libatomic_ops submodule in the top-level was inconvenient, and I agree.
This change, along with a corresponding change to the boehm_gc repository,
will instead included it as a nested submodule of boehm_gc.

.gitmodules:
libatomic_ops:
    Remove libatomic_ops submodule.

boehm_gc
    Update to the most recent revision that adds a libatomic_ops submodule.

prepare.sh:
    Update submodules recursively.

Mmakefile:
scripts/prepare_install_dir.in:
tools/bootcheck:
    Remove code in build tools that links or copies the libatomic_ops
    directory from Mercury's top-level,
---
 .gitmodules                    |  5 +----
 Mmakefile                      |  5 -----
 boehm_gc                       |  2 +-
 libatomic_ops                  |  1 -
 prepare.sh                     |  4 +---
 scripts/prepare_install_dir.in | 17 +++--------------
 tools/bootcheck                |  3 +--
 7 files changed, 7 insertions(+), 30 deletions(-)
 delete mode 160000 libatomic_ops

diff --git a/.gitmodules b/.gitmodules
index 0b2b7d6..fda72ba 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,7 +2,4 @@
 	path = boehm_gc
 	url = ../bdwgc.git
 	branch = release-7_4-mercury
-[submodule "libatomic_ops"]
-	path = libatomic_ops
-	url = ../libatomic_ops.git
-	branch = release-7_4-mercury
+	update = checkout
diff --git a/Mmakefile b/Mmakefile
index 20ab8ba..dd4ebd1 100644
--- a/Mmakefile
+++ b/Mmakefile
@@ -489,15 +489,10 @@ tar: 	$(GENERATED_DOCS)
 		test -d $$ROOTNAME/bytecode && 				\
 			mv $$ROOTNAME/bytecode stuff-to-exclude; 	\
 		mv $$ROOTNAME/extras/quickcheck stuff-to-exclude;	\
-		rm $$ROOTNAME/boehm_gc/libatomic_ops;			\
-		mv $$ROOTNAME/libatomic_ops 				\
-			$$ROOTNAME/boehm_gc/libatomic_ops;		\
 		mv $$ROOTNAME		mercury-srcdist-$(VERSION);	\
 		tar --exclude ".git" -cf - mercury-srcdist-$(VERSION) | \
 			gzip -9 > mercury-srcdist-$(VERSION).tar.gz;	\
 		mv mercury-srcdist-$(VERSION)	$$ROOTNAME;		\
-		mv $$ROOTNAME/boehm_gc/libatomic_ops 			\
-			$$ROOTNAME/libatomic_ops;			\
 		mv stuff-to-exclude/quickcheck  $$ROOTNAME/extras/quickcheck; \
 		mv stuff-to-exclude/*		$$ROOTNAME;		\
 		rmdir stuff-to-exclude;					\
diff --git a/boehm_gc b/boehm_gc
index 67a048e..400df79 160000
--- a/boehm_gc
+++ b/boehm_gc
@@ -1 +1 @@
-Subproject commit 67a048ed3ae40b5e2766fa3d009c5ddaaf9b95ac
+Subproject commit 400df7995fa3b6b10ed6f1a016db701f63d1c287
diff --git a/libatomic_ops b/libatomic_ops
deleted file mode 160000
index 137001b..0000000
--- a/libatomic_ops
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 137001b1d9bddc0034de887c8e6ebc32893b1821
diff --git a/prepare.sh b/prepare.sh
index 3eaa5ad..8e454cd 100755
--- a/prepare.sh
+++ b/prepare.sh
@@ -5,9 +5,7 @@
 if [ ! -e boehm_gc/.git ]; then
     echo "Setting up submodules"
     if git submodule --quiet init; then
-        git submodule update --remote --checkout
-        ln -s ../libatomic_ops boehm_gc/libatomic_ops || \
-            cp -R libatomic_ops boehm_gc/libatomic_ops
+        git submodule update --remote --init --recursive
     else
         echo "There was a problem configuring the submodules.  If the"
         echo "repositories could not be found then edit .git/config and run"
diff --git a/scripts/prepare_install_dir.in b/scripts/prepare_install_dir.in
index 009c4c5..08bcc4d 100644
--- a/scripts/prepare_install_dir.in
+++ b/scripts/prepare_install_dir.in
@@ -57,20 +57,9 @@ cp boehm_gc/*.[chsS] ${installdir}/boehm_gc/
 cp boehm_gc/tools/*.[ch] ${installdir}/boehm_gc/tools
 cp boehm_gc/tools/*.sh ${installdir}/boehm_gc/tools
 cp boehm_gc/build_atomic_ops.sh* ${installdir}/boehm_gc
-if [ -d libatomic_ops ]; then
-    # If the libatomic_ops directory is present then boehm_gc/libatomic_ops
-    # is a symlink.  This doesn't work on platforms without symlinks, but
-    # does anyone run this script on Windows?
-    cp -Rp libatomic_ops ${installdir}
-    ln -s ${installdir}/libatomic_ops ${installdir}/boehm_gc
-    rm -fr ${installdir}/libatomic_ops/src/*.o
-    rm -fr ${installdir}/libatomic_ops/src/*.a
-else
-    # Otherwise boehmgc_libatomic_ops is a directory.
-    cp -Rp boehm_gc/libatomic_ops ${installdir}/boehm_gc
-    rm -fr ${installdir}/boehm_gc/libatomic_ops/src/*.o
-    rm -fr ${installdir}/boehm_gc/libatomic_ops/src/*.a
-fi
+cp -Rp boehm_gc/libatomic_ops ${installdir}/boehm_gc
+rm -fr ${installdir}/boehm_gc/libatomic_ops/src/*.o
+rm -fr ${installdir}/boehm_gc/libatomic_ops/src/*.a
 cp -Rp boehm_gc/extra ${installdir}/boehm_gc
 mkdir ${installdir}/runtime
 mkdir ${installdir}/runtime/machdeps
diff --git a/tools/bootcheck b/tools/bootcheck
index 914a083..8c0b747 100755
--- a/tools/bootcheck
+++ b/tools/bootcheck
@@ -765,11 +765,10 @@ then
             cp $root/boehm_gc/gc_cpp.cpp .
             cp $root/boehm_gc/build_atomic_ops.sh* .
             cp -r $root/boehm_gc/cord .
+            cp -r $root/boehm_gc/libatomic_ops .
             cp -r $root/boehm_gc/extra .
             cp -r $root/boehm_gc/tools .
-            ln -s ../libatomic_ops .
             cd $root/$stage2dir
-            cp -r $root/libatomic_ops .
         else
             $LN_S $root/boehm_gc .
         fi
-- 
2.6.1




More information about the reviews mailing list