summaryrefslogtreecommitdiff
path: root/util/meson_aux/extra-dist-cmd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/meson_aux/extra-dist-cmd.sh')
-rwxr-xr-xutil/meson_aux/extra-dist-cmd.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/util/meson_aux/extra-dist-cmd.sh b/util/meson_aux/extra-dist-cmd.sh
new file mode 100755
index 0000000..b73c1f4
--- /dev/null
+++ b/util/meson_aux/extra-dist-cmd.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -e
+
+# External command, intended to be called with meson.add_dist_script() in meson.build
+
+# extra-dist-cmd.sh <root_source_dir> <root_build_dir> <relative_dist_dir>
+
+# relative_dist_dir is the distribution directory path relative to root_build_dir.
+# Meson does not preserve timestamps on distributed files.
+# But this script preserves the timestamps on libstdc++.tag.
+
+# Make a ChangeLog file for distribution.
+git --git-dir="$1/.git" --work-tree="$1" log --no-merges --date=short --max-count=200 \
+ --pretty='tformat:%cd %an <%ae>%n%n %s%n%w(0,0,2)%+b' > "$2/$3/ChangeLog"
+
+# Distribute the libstdc++.tag file in addition to the files in the local git clone.
+cd "$2"
+cp --preserve=timestamps "libstdc++.tag" "$3/doctags/"