diff options
author | Igor V. Kovalenko <igor.v.kovalenko@gmail.com> | 2021-01-09 17:57:23 +0300 |
---|---|---|
committer | PulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org> | 2021-01-18 17:57:41 +0000 |
commit | 353c01378075fe125694e80790a72b428cad5185 (patch) | |
tree | b4f4aa8e6fac0c06a5c52f049a37a72014355fde | |
parent | 4f0f215a13ebf7618bfc25b0349b457359407034 (diff) |
buildsys: meson: implement update-map-file target
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/461>
-rwxr-xr-x | scripts/generate-map-file.sh | 23 | ||||
-rw-r--r-- | src/pulse/meson.build | 6 |
2 files changed, 28 insertions, 1 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} diff --git a/src/pulse/meson.build b/src/pulse/meson.build index 8341bfcf0..ccaff29d5 100644 --- a/src/pulse/meson.build +++ b/src/pulse/meson.build @@ -72,7 +72,11 @@ if glib_dep.found() libpulse_headers += 'glib-mainloop.h' endif -versioning_link_args = '-Wl,-version-script=' + join_paths(meson.source_root(), 'src', 'map-file') +run_target('update-map-file', + command : [ join_paths(meson.source_root(), 'scripts/generate-map-file.sh'), 'map-file', + [ libpulse_headers, 'simple.h', join_paths(meson.build_root(), 'src', 'pulse', 'version.h') ] ]) + +versioning_link_args = '-Wl,-version-script=' + join_paths(meson.source_root(), 'src', 'pulse', 'map-file') libpulse = shared_library('pulse', libpulse_sources, |