[vlc-commits] apple: build: export nm in host tools

Alexandre Janniaux git at videolan.org
Sun May 3 01:05:08 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Fri Apr 24 17:01:59 2020 +0200| [2b62f4174bc5e2f3fb832c9af08b46dfced59d09] | committer: Alexandre Janniaux

apple: build: export nm in host tools

nm is used by some buildsystems to detect underscore prefixing, for
instance via ffmpeg --nm command. `nm` on linux is also not necessarily
able to open mach-o binaries, while darwin/clang variant returned by
xcrun can.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b62f4174bc5e2f3fb832c9af08b46dfced59d09
---

 extras/package/apple/build.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh
index b05aae16ef..6e2171623b 100755
--- a/extras/package/apple/build.sh
+++ b/extras/package/apple/build.sh
@@ -106,6 +106,7 @@ VLC_HOST_LD="$(xcrun --find ld)"
 VLC_HOST_AR="$(xcrun --find ar)"
 VLC_HOST_STRIP="$(xcrun --find strip)"
 VLC_HOST_RANLIB="$(xcrun --find ranlib)"
+VLC_HOST_NM="$(xcrun --find nm)"
 
 ##########################################################
 #                    Helper functions                    #
@@ -321,6 +322,7 @@ hostenv()
     AR="${VLC_HOST_AR}" \
     STRIP="${VLC_HOST_STRIP}" \
     RANLIB="${VLC_HOST_RANLIB}" \
+    NM="${VLC_HOST_NM}" \
     "$@"
 }
 
@@ -363,6 +365,7 @@ write_config_mak()
     printf '%s := %s\n' "AR" "${VLC_HOST_AR}" >&3
     printf '%s := %s\n' "STRIP" "${VLC_HOST_STRIP}" >&3
     printf '%s := %s\n' "RANLIB" "${VLC_HOST_RANLIB}" >&3
+    printf '%s := %s\n' "NM" "${VLC_HOST_NM}" >&3
 }
 
 # Generate the source file with the needed array for
@@ -702,7 +705,7 @@ VLC_PLUGINS_SYMBOL_LIST=()
 # Find all static plugins in build dir
 while IFS=  read -r -d $'\0' plugin_path; do
     # Get module entry point symbol name (_vlc_entry__MODULEFULLNAME)
-    nm_symbol_output=( $(nm "$plugin_path" | grep _vlc_entry__) ) \
+    nm_symbol_output=( $(${VLC_HOST_NM} "$plugin_path" | grep _vlc_entry__) ) \
       || abort_err "Failed to find module entry function in '$plugin_path'"
 
     symbol_name="${nm_symbol_output[2]:1}"



More information about the vlc-commits mailing list