summaryrefslogtreecommitdiffstats
path: root/tools/compare-buildsys.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:10:49 +0000
commitcfe5e3905201349e9cf3f95d52ff4bd100bde37d (patch)
treed0baf160cbee3195249d095f85e52d20c21acf02 /tools/compare-buildsys.sh
parentInitial commit. (diff)
downloadutil-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.tar.xz
util-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.zip
Adding upstream version 2.39.3.upstream/2.39.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/compare-buildsys.sh')
-rwxr-xr-xtools/compare-buildsys.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/compare-buildsys.sh b/tools/compare-buildsys.sh
new file mode 100755
index 0000000..e88cbd5
--- /dev/null
+++ b/tools/compare-buildsys.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+FILTER="$1"
+
+MESON_CONFIG_H="build/config.h"
+AUTOCONF_CONFIG_H="./config.h"
+
+if [ ! -f $MESON_CONFIG_H ]; then
+ echo 'Meson is not ready in the build/ directory (try "meson build")'
+ exit 1
+fi
+
+if [ ! -f $AUTOCONF_CONFIG_H ]; then
+ echo 'Autotools are not ready (try "./autogen.sh; ./configure")'
+ exit 1
+fi
+
+TMPFILE_MESON="/tmp/util-linux-meson"
+TMPFILE_AUTOCONF="/tmp/util-linux-autoconf"
+
+GREP_PATTERN="#define "
+
+if [ "$FILTER" = "headers" ]; then
+ GREP_PATTERN="#define .*_H[[:blank:]]"
+fi
+
+echo "===MESON===" > $TMPFILE_MESON
+grep "$GREP_PATTERN" $MESON_CONFIG_H | sort >> $TMPFILE_MESON
+
+echo "===AUTOCONF===" > $TMPFILE_AUTOCONF
+grep "$GREP_PATTERN" $AUTOCONF_CONFIG_H | sort >> $TMPFILE_AUTOCONF
+
+diff --side-by-side $TMPFILE_AUTOCONF $TMPFILE_MESON
+
+rm -rf $TMPFILE_MESON $TMPFILE_AUTOCONF