]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - library-bundler
bundle: use ntldd on msys2 instead of ldd to enable 32bit build on 64bit os
[xonotic/netradiant.git] / library-bundler
1 #! /usr/bin/env bash
2
3 system_name="${1}"
4 exe_file="${2}"
5 bundle_dir="${3}"
6
7 case "${system_name}" in
8         'windows')
9                 bundle_dir="$(cygpath --unix "${bundle_dir}")"
10                 exe_file="$(cygpath --unix "${exe_file}")"
11                 ntldd --recursive "${exe_file}" \
12                 | egrep -i '\.dll => [A-Z]:\\msys64\\' \
13                 | sed -e 's/ (0x[0-9a-f]*)$//;s/^.* => //' \
14                 | cygpath --unix --file - \
15                 | while read dll_file
16                 do
17                         dll_basename="$(basename "${dll_file}")"
18                         cp -n --preserve=timestamps "${dll_file}" "${bundle_dir}/${dll_basename}"
19                 done
20                 ;;
21         *)
22                 printf 'ERROR: unsupported system: %s\n' "${system_name}" >&2
23                 exit 1
24                 ;;
25 esac