summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2021-01-09 17:57:23 +0300
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2021-01-18 17:57:41 +0000
commit353c01378075fe125694e80790a72b428cad5185 (patch)
treeb4f4aa8e6fac0c06a5c52f049a37a72014355fde /scripts
parent4f0f215a13ebf7618bfc25b0349b457359407034 (diff)
buildsys: meson: implement update-map-file target
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/461>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-map-file.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/generate-map-file.sh b/scripts/generate-map-file.sh
new file mode 100755
index 000000000..ce843af34
--- /dev/null
+++ b/scripts/generate-map-file.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Generator for linker version script.
+# We use the same linker version script for all public .so files
+#
+# generate-map-file.sh where-is/map-file public_interface_1.h public_interface_2.h ... public_interface_N.h
+#
+
+CTAGS_IDENTIFIER_LIST="PA_GCC_MALLOC,PA_GCC_ALLOC_SIZE2,PA_GCC_ALLOC_SIZE,PA_GCC_PURE,PA_GCC_CONST,PA_GCC_DEPRECATED,PA_GCC_PRINTF_ATTR"
+
+print_map_file() {
+ echo "PULSE_0 {"
+ echo "global:"
+ ctags -I ${CTAGS_IDENTIFIER_LIST} -f - --c-kinds=p "$@" | awk '/^pa_/ { print $1 ";" }' | sort
+ echo "local:"
+ echo "*;"
+ echo "};"
+}
+
+TARGET_FILE=$1
+shift
+
+cd "${MESON_SOURCE_ROOT}/${MESON_SUBDIR}" && print_map_file "$@" > ${TARGET_FILE}