summaryrefslogtreecommitdiff
path: root/pkg/osx/cp-with-libs
blob: bb4fa001ada7dc05caa02fe852c49289428a7bc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# Copy a program to the specified destination, along
# with SDL libraries it depends upon.

BINARY=$1
DEST=$2

cp "$BINARY" "$DEST"

# Copy libraries; only those with libSDL in the name

otool -L "$BINARY" | grep libSDL | sed 's/^.//; s/ (.*//' | while read; do
        cp "$REPLY" "$DEST"
done