Skip to content

Commit a0d0579

Browse files
author
lzj
committed
1、修复openssl脚本编译错误
1 parent ab9d0ec commit a0d0579

File tree

3 files changed

+25
-36
lines changed

3 files changed

+25
-36
lines changed

4.2/build-ffmpeg-iOS.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SRC_PATH="$SHELL_PATH/$SRC_NAME"
1010
ARCHS="arm64 armv7 armv7s x86_64 i386"
1111
#输出路径
1212
PREFIX="$SHELL_PATH/FFmpeg-iOS"
13-
SRC_SCRATCH="$SHELL_PATH/FFmpeg-build"
13+
SRC_BUILD="$SHELL_PATH/FFmpeg-build"
1414

1515
#需要编译的平台
1616
BUILD_ARCH=$1
@@ -103,7 +103,7 @@ then
103103
|| exit 1
104104
fi
105105

106-
rm -rf "$PREFIX" "$SRC_SCRATCH"
106+
rm -rf "$PREFIX" "$SRC_BUILD"
107107
#检测并下载资源包
108108
if [ ! -r $SRC_NAME ]
109109
then
@@ -123,8 +123,8 @@ do
123123
if [ "$BUILD_ARCH" = "all" -o "$BUILD_ARCH" = "$ARCH" ]
124124
then
125125
echo "building $ARCH..."
126-
mkdir -p "$SRC_SCRATCH/$ARCH"
127-
cd "$SRC_SCRATCH/$ARCH"
126+
mkdir -p "$SRC_BUILD/$ARCH"
127+
cd "$SRC_BUILD/$ARCH"
128128

129129
CFLAGS="-arch $ARCH -fno-stack-check"
130130
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]
@@ -191,7 +191,7 @@ do
191191
$CONFIGURE_FLAGS \
192192
--extra-cflags="$CFLAGS" \
193193
--extra-ldflags="$LDFLAGS" \
194-
--prefix="$SRC_SCRATCH/$ARCH" \
194+
--prefix="$SRC_BUILD/$ARCH" \
195195
|| exit 1
196196

197197
make -j3 install $EXPORT || exit 1
@@ -202,15 +202,14 @@ done
202202
echo "building lipo ffmpeg lib binaries..."
203203
mkdir -p $PREFIX/lib
204204
set - $ARCHS
205-
cd $SRC_SCRATCH/$1/lib
205+
cd $SRC_BUILD/$1/lib
206206
for LIB in *.a
207207
do
208208
cd $SHELL_PATH
209-
lipo -create `find $SRC_SCRATCH -name $LIB` -output $PREFIX/lib/$LIB || exit 1
209+
lipo -create `find $SRC_BUILD -name $LIB` -output $PREFIX/lib/$LIB || exit 1
210210
done
211211

212212
cd $SHELL_PATH
213-
cp -rf $SRC_SCRATCH/$1/include $PREFIX
214-
rm -rf $SCRATCH
215-
rm -rf $SRC_SCRATCH
213+
cp -rf $SRC_BUILD/$1/include $PREFIX
214+
rm -rf $SRC_BUILD
216215
echo "building lipo ffmpeg lib binaries successed"

4.2/build-opencore-amr-iOS.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ for arch in $ARCHS; do
5454
*)
5555
echo "Building opencore-amr for iPhoneSimulator $arch *****************"
5656
PATH=`xcodebuild -version -sdk iphonesimulator PlatformPath`"/Developer/usr/bin:$PATH" \
57-
CXX="xcrun --sdk iphonesimulator clang++ -arch $arch $IOSMV -fembed-bitcode" \
57+
CXX="xcrun --sdk iphonesimulator clang++ -arch $arch $IOSMV -fembed-bitcode" \
5858
./configure \
5959
--host=$arch \
6060
--prefix=$DEST \

4.2/build-openssl-iOS.sh

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ SRC_VERSION="1.1.1f"
77
SRC_NAME="openssl-$SRC_VERSION"
88
SRC_PATH="$SHELL_PATH/$SRC_NAME"
99
#编译的平台
10-
ARCHS="arm64 armv7 x86_64 i386"
10+
ARCHS="arm64 armv7 armv7s x86_64 i386"
1111
#最低触发的版本
1212
DEPLOYMENT_TARGET="8.0"
1313
#输出路径
1414
PREFIX="$SHELL_PATH/openssl-iOS"
15+
SRC_BUILD="$SHELL_PATH/openssl-build"
1516

1617
#需要编译的平台
1718
BUILD_ARCH=$1
1819
#最低触发的版本
1920
DEPLOYMENT_TARGET=$2
2021

21-
ARCHS="arm64 armv7 armv7s x86_64 i386"
22-
2322
if [ ! "$BUILD_ARCH" ]
2423
then
2524
BUILD_ARCH="all"
@@ -29,7 +28,7 @@ then
2928
DEPLOYMENT_TARGET="8.0"
3029
fi
3130

32-
rm -rf "$SRC_PATH" "$PREFIX"
31+
rm -rf "$SRC_PATH" "$SRC_BUILD"
3332
#下载资源包
3433
if [ ! -r $SRC_NAME ]
3534
then
@@ -43,7 +42,7 @@ then
4342
tar zxvf $SHELL_PATH/$SRC_TAR_NAME --strip-components 1 -C $SRC_PATH || exit 1
4443
fi
4544

46-
CC=$(xcrun --find clang)
45+
XCRUN=$(xcrun --find clang)
4746
IOS_SDK_PATH=$(xcrun -sdk iphoneos --show-sdk-path)
4847
IOS_CROSS_TOP=${IOS_SDK_PATH//\/SDKs*/}
4948
IOS_CROSS_SDK=${IOS_SDK_PATH##*/}
@@ -55,7 +54,8 @@ for ARCH in $ARCHS
5554
do
5655
if [ "$BUILD_ARCH" = "all" -o "$BUILD_ARCH" = "$ARCH" ]
5756
then
58-
cd $SRC_PATH
57+
mkdir -p "$SRC_BUILD/$ARCH"
58+
cd "$SRC_BUILD/$ARCH"
5959
echo "building $ARCH..."
6060

6161
CONFIGURE_FLAGS="no-shared"
@@ -64,12 +64,12 @@ do
6464
then
6565
CROSS_TOP=$IOS_SIMULATOR_CROSS_TOP
6666
CROSS_SDK=$IOS_SIMULATOR_CROSS_SDK
67-
if [ "$ARCH" = "i386" ]
67+
if [ "$ARCH" = "x86_64" ]
6868
then
6969
CONFIGURE_FLAGS="$CONFIGURE_FLAGS no-asm"
7070
fi
7171
else
72-
if [ "$ARCH" == "arm64" -o "$ARCH" == "armv7" ]
72+
if [ "$ARCH" == "arm64" -o "$ARCH" == "armv7" -o "$ARCH" == "armv7s" ]
7373
then
7474
CROSS_TOP=$IOS_CROSS_TOP
7575
CROSS_SDK=$IOS_CROSS_SDK
@@ -79,41 +79,31 @@ do
7979

8080
export CROSS_TOP
8181
export CROSS_SDK
82-
export CC="$CC -arch $ARCH $CFLAGS"
82+
export CC="$XCRUN -arch $ARCH $CFLAGS"
8383

8484
echo CROSS_TOP=$CROSS_TOP
8585
echo CROSS_SDK=$CROSS_SDK
8686
echo CC=$CC
87-
echo prefix=$PREFIX/$ARCH
8887

8988
$SRC_PATH/Configure \
9089
iphoneos-cross \
91-
--prefix=$PREFIX/$ARCH \
90+
--prefix=$SRC_BUILD/$ARCH \
9291
$CONFIGURE_FLAGS
9392
make -j3
94-
make install -j3
95-
96-
mkdir $PREFIX/$ARCH/lib
97-
cp *.a $PREFIX/$ARCH/lib
98-
cp -rf include $PREFIX
99-
make clean
100-
101-
unset CC
102-
unset CROSS_SDK
103-
unset CROSS_TOP
93+
make install_sw -j3
10494
fi
10595
done
10696

10797
echo "building lipo lib binaries..."
10898
mkdir -p $PREFIX/lib
10999
set - $ARCHS
110-
cd $PREFIX/$1/lib
100+
cd $SRC_BUILD/$1
111101
for LIB in *.a
112102
do
113-
cd $SHELL_PATH
114-
lipo -create `find $PREFIX -name $LIB` -output $PREFIX/lib/$LIB
103+
lipo -create `find $SRC_BUILD -name $LIB` -output $PREFIX/lib/$LIB
115104
done
116105

117106
cd $SHELL_PATH
118-
cp -rf $PREFIX/$1/include $PREFIX
107+
cp -rf $SRC_BUILD/$1/include $PREFIX
108+
rm -rf $SRC_BUILD
119109
echo "building lipo openssl lib binaries successed"

0 commit comments

Comments
 (0)