@@ -119,7 +119,7 @@ function arc()
119119 fi
120120}
121121
122- LIBS_TO_BUILD=" ssl crypto"
122+ LIBS_TO_BUILD=" ssl crypto apps "
123123build_libs ()
124124{
125125 [[ -d $BUILD_DIR /build.$1 ]] && rm -rf $BUILD_DIR /build.$1
@@ -145,14 +145,19 @@ build_libs()
145145# (type, arc, c, cflags)
146146generic_build ()
147147{
148- if [[ $REBUILD == true ]] || [[ ! -d $BUILD_DIR /build.$1 .$2 ]] || [[ ! -f $BUILD_DIR /build.$1 .$2 .success ]]; then
148+ if [[ $REBUILD == true ]] || [[ ! -f $BUILD_DIR /build.$1 .$2 .success ]] || [[ ! -f $BUILD_DIR /build.$1 .$2 /libssl.a ]] || [[ ! -f $BUILD_DIR /build. $1 . $2 /libcrypto.a ]] || [[ ! -f $BUILD_DIR /build. $1 . $2 /libapps.a ]]; then
149149 [[ -f $BUILD_DIR /build.$1 .$2 .success ]] && rm $BUILD_DIR /build.$1 .$2 .success
150150 [[ -d $BUILD_DIR /build.$1 .$2 ]] && rm -rf $BUILD_DIR /build.$1 .$2
151151 mkdir $BUILD_DIR /build.$1 .$2
152152 pushd $BUILD_DIR /build.$1 .$2
153153 ../$OPENSSL_VER /Configure --openssldir=" $BUILD_DIR /build.$1 .$2 /ssl" no-shared $3 CFLAGS=" ${4:- } "
154- sed -i ' ' ' s/LIBS=apps\/libapps.a /LIB=/g' Makefile
154+ # remove 'fork()' dependence
155+ if [[ " $1 " == * tvos* ]] || [[ " $1 " == * watchos* ]]; then
156+ sed -i ' ' ' /apps\/lib\/libapps-lib-http_server.o \\/d' Makefile
157+ sed -i ' ' ' s/apps\/lib\/libapps-lib-http_server.o ' //g Makefile
158+ fi
155159 make -j$THREAD_COUNT build_libs
160+ mv apps/libapps.a ./
156161 popd
157162 touch $BUILD_DIR /build.$1 .$2 .success
158163 fi
@@ -197,13 +202,14 @@ build_watchossim_libs()
197202# (arc, cflags)
198203macosx_build ()
199204{
200- if [[ $REBUILD == true ]] || [[ ! -d $BUILD_DIR /build.macosx.$1 ]] || [[ ! -f $BUILD_DIR /build.macosx.$1 .success ]]; then
205+ if [[ $REBUILD == true ]] || [[ ! -f $BUILD_DIR /build.macosx.$1 .success ]] || [[ ! -f $BUILD_DIR /build.macosx.$1 /libssl.a ]] || [[ ! -f $BUILD_DIR /build.macosx. $1 /libcrypto.a ]] || [[ ! -f $BUILD_DIR /build.macosx. $1 /libapps.a ]]; then
201206 [[ -f $BUILD_DIR /build.macosx.$1 .success ]] && rm $BUILD_DIR /build.macosx.$1 .success
202207 [[ -d $BUILD_DIR /build.macosx.$1 ]] && rm -rf $BUILD_DIR /build.macosx.$1
203208 mkdir $BUILD_DIR /build.macosx.$1
204209 pushd $BUILD_DIR /build.macosx.$1
205210 ../$OPENSSL_VER /Configure --prefix=" $BUILD_DIR /macosx-native" --openssldir=" $BUILD_DIR /build.macosx.$1 /ssl" no-shared darwin64-$1 -cc CFLAGS=" $2 "
206211 make -j$THREAD_COUNT
212+ mv apps/libapps.a ./
207213 popd
208214 touch $BUILD_DIR /build.macosx.$1 .success
209215fi
0 commit comments