Skip to content

Commit 0ad4010

Browse files
committed
use it kind of
1 parent 6684b6a commit 0ad4010

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

cross_compile_ffmpeg.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ build_libx264() {
464464
fi
465465

466466
if [[ $x264_profile_guided = y ]]; then
467+
# I wasn't able to figure out how/if this gave any speedup...
467468
# TODO more march=native here?
468469
# TODO profile guided here option, with wine?
469470
do_configure "$configure_flags"
@@ -1366,13 +1367,15 @@ if [[ $OSTYPE == darwin* ]]; then
13661367
mkdir mac_bin
13671368
fi
13681369
cd mac_bin
1369-
if [[ ! -f md5sum ]]; then
1370+
if [[ ! -x readlink ]]; then
1371+
# make some behave like linux...
13701372
curl https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/md5sum.mac > md5sum || exit 1
13711373
chmod u+x ./md5sum
1374+
curl https://raw.githubusercontent.com/rdp/ffmpeg-windows-build-helpers/master/patches/readlink.mac > readlink || exit 1
1375+
chmod u+x ./readlink
13721376
fi
1373-
export PATH=$PATH:`pwd`
1377+
export PATH=`pwd`:$PATH
13741378
cd ..
1375-
echo $PATH
13761379
fi
13771380

13781381
original_path="$PATH"

patches/readlink.mac

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
#http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
3+
4+
TARGET_FILE=$1
5+
6+
cd `dirname $TARGET_FILE`
7+
TARGET_FILE=`basename $TARGET_FILE`
8+
9+
# Iterate down a (possible) chain of symlinks
10+
while [ -L "$TARGET_FILE" ]
11+
do
12+
TARGET_FILE=`readlink $TARGET_FILE`
13+
cd `dirname $TARGET_FILE`
14+
TARGET_FILE=`basename $TARGET_FILE`
15+
done
16+
17+
# Compute the canonicalized name by finding the physical path
18+
# for the directory we're in and appending the target file.
19+
PHYS_DIR=`pwd -P`
20+
RESULT=$PHYS_DIR/$TARGET_FILE
21+
echo $RESULT

0 commit comments

Comments
 (0)