summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authororbea <orbea@riseup.net>2021-04-01 19:01:54 -0700
committerThomas Haller <thaller@redhat.com>2021-04-04 09:27:35 +0200
commit68913466af49c738d7e226f55db15be70b22dbe6 (patch)
tree62d6655bc2ce08c4f7cb2ccab3275acc6aa72697 /tools
parent74fc2793417a5e5b1bc366b3fb42bb3aa2fe3cf7 (diff)
downloadNetworkManager-68913466af49c738d7e226f55db15be70b22dbe6.tar.gz
tools: use libtool --mode=execute
Better fix for https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/732 The original issue was that when compiling NetworkManager with slibtool the create-exports-NetworkManager.sh script gave the NetworkManager-all-sym slibtool wrapper script to nm(1) instead of the actual binary. This is because slibtool and GNU libtool do not place the compiled programs in the same location. The original fix was to test both locations, but this is bit of a hack especially since the build system should not be using the .libs directory directly. However with $(LIBTOOL) --mode=execute this is not a problem since both implementations can figure out where the correct binary is. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/805
Diffstat (limited to 'tools')
-rwxr-xr-xtools/create-exports-NetworkManager.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh
index f7fd3bab95..21ba369a41 100755
--- a/tools/create-exports-NetworkManager.sh
+++ b/tools/create-exports-NetworkManager.sh
@@ -35,15 +35,18 @@ _sort() {
}
call_nm() {
- "${NM:-nm}" "$1" |
- sed -n 's/.* \([^ ]\) \([^ ]*\)$/\1 \2/p'
+ if [ -n "$from_meson" ]; then
+ "${NM:-nm}" "$1" |
+ sed -n 's/.* \([^ ]\) \([^ ]*\)$/\1 \2/p'
+ else
+ libtool=(${LIBTOOL:-libtool})
+ ${libtool[@]} --mode=execute "${NM:-nm}" "$1" |
+ sed -n 's/.* \([^ ]\) \([^ ]*\)$/\1 \2/p'
+ fi
}
get_symbols_nm () {
- base=./src/core/.libs/NetworkManager-all-sym
- if ! test -f "$base"; then
- base=./src/core/NetworkManager-all-sym
- fi
+ base=./src/core/NetworkManager-all-sym
call_nm "$base" |
sed -n 's/^[tTDGRBS] //p' |
_sort
@@ -85,6 +88,14 @@ do_update() {
do_generate > ./src/core/NetworkManager.ver
}
+if [ -f "build.ninja" ]; then
+ from_meson=1
+ libs=
+else
+ from_meson=
+ libs=.libs/
+fi
+
SYMBOLS_MISSING="$(get_symbols_missing | pretty)"
SYMBOLS_EXPLICIT="$(get_symbols_explicit | pretty)"
@@ -102,14 +113,6 @@ local:
EOF
}
-if [ -f "build.ninja" ]; then
- from_meson=1
- libs=
-else
- from_meson=
- libs=.libs/
-fi
-
test -f ./src/core/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree"
case "$1" in