aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/msys2-mcode/GetStandaloneDeps.sh
blob: 604612d76d5bbaf082aa0dfbecd8d93481b834e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

GetMinGWLibraries() {
  ldd "${MSYSTEM_PREFIX}/$1" | while IFS="" read -r dependency; do
    fields=($dependency)
    dep="${fields[2]}"
    if [[ "$dep" == /"${MSYSTEM,,}"/* ]]; then
      echo "$dep"
      GetMinGWLibraries "${dep#"/${MSYSTEM,,}/"}"
    fi
  done
}

for dep in $(GetMinGWLibraries "lib/libghdl-3_0_0_dev.dll"); do
  echo "$dep"
  cp "$dep" ./
done