Skip to content

Commit 420b57b

Browse files
build pjsip with bcg729
1 parent e1f5185 commit 420b57b

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

.github/workflows/pjsua2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
brew install nasm autoconf automake libtool swig
3030
sudo mv /Applications/Xcode_15.1.app /Applications/Xcode.app
3131
sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile
32-
./build --ssl --opus --h264 -a=x86_64,arm64 --ci
32+
./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci
3333
- uses: actions/upload-artifact@v3
3434
with:
3535
name: libpjsua2-ios

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
brew install nasm autoconf automake libtool swig
2727
sed -i'' -e 's/xamarin/maui/g' ${{ github.workspace }}/pjproject/pjsip-apps/src/swig/csharp/Makefile
28-
./build h264 opus ssl -a=x86_64,arm64 --ci
28+
./build h264 opus ssl bcg729 -a=x86_64,arm64 --ci
2929
tar -zcvf libpjsua2.tar.gz ./libpjsua2
3030
- name: release
3131
uses: actions/create-release@v1

build

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,19 @@ function build_bcg729 () {
205205

206206
for arch in ${USE_ARCHS[@]}
207207
do
208-
echo "-- BCG729: Compiling $arch"
209-
g729_extra_cflags="-arch $arch"
210-
if [ "$arch" == "i386" ] || [ "$arch" == "x86_64" ]; then
208+
echo "-- BCG729: Compiling $arch"
209+
if [ "$arch" == "x86_64" ]; then
211210
os_platform="iPhoneSimulator"
211+
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
212+
cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON
213+
make C_FLAGS="$C_FLAGS -O2 -m64 -miphoneos-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk -march=x86-64" || exit
214+
212215
else
213-
os_platform="iPhoneOS"
216+
os_platform="iPhoneOS"
217+
mkdir -p "${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
218+
cmake . -DCMAKE_INSTALL_PREFIX="${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON
219+
make C_FLAGS="$C_FLAGS -fPIE -miphoneos-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk -march=${arch}" || exit
214220
fi
215-
216-
sed -i'' -e 's/dd_definitions("-Wall")/dd_definitions("-Wall -march=${arch}")/g' CMakeLists.txt
217-
218-
mkdir -p "${$BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk"
219-
220-
cmake . -DCMAKE_INSTALL_PREFIX="${$BCG729_BUILD_DIR}/${os_platform}${IOS_SDK_VERSION}-${arch}.sdk" -DCMAKE_SKIP_INSTALL_RPATH=ON
221-
222-
make CFLAGS="$CFLAGS ${opus_opt_cflags} -fPIE -miphoneos-version-min=${MIN_IOS_VERSION} -isysroot ${xcode_dev_path}/Platforms/${os_platform}.platform/Developer/SDKs/${os_platform}.sdk -march=${arch}" || exit
223-
224221
make install
225222
done
226223

@@ -315,7 +312,7 @@ function build_opus () {
315312
return
316313
fi
317314

318-
opus_version="1.3.1"
315+
opus_version="1.4"
319316
opus_opt_cflags="-Ofast -flto -g"
320317
opus_opt_ldflags="-flto"
321318
opus_opt_config_args=""
@@ -442,6 +439,10 @@ function config_site () {
442439
echo "#define PJMEDIA_HAS_OPUS_CODEC 1" >> "$PJSIP_CONFIG_SITE_H"
443440
fi
444441

442+
if [ $BCG729_SUPPORT = true ]; then
443+
echo "#define PJMEDIA_HAS_BCG729 1" >> "$PJSIP_CONFIG_SITE_H"
444+
fi
445+
445446
while IFS=',' read -ra CONFIG_SITE_OPTION; do
446447
for i in "${CONFIG_SITE_OPTION[@]}"; do
447448
echo "#define $i" >> $PJSIP_CONFIG_SITE_H
@@ -521,13 +522,13 @@ function _build () {
521522

522523
if [ $BCG729_SUPPORT = true ]; then
523524
if [ "$arch" != "i386" ] && [ "$arch" != "x86_64" ]; then
524-
configure="$configure --with-bcg729=${BCG729_BUILD_DIR}/"
525-
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/include/bcg729"
525+
configure="$configure --with-bcg729=${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk"
526+
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk/include/bcg729"
526527
export LDFLAGS="${LDFLAGS} -L${BCG729_BUILD_DIR}/iPhoneOS${IOS_SDK_VERSION}-${arch}.sdk/lib"
527528
else
528-
configure="$configure --with-bcg729=${SSL_BUILD_DIR}/"
529-
export CFLAGS="${CFLAGS} -I${SSL_BUILD_DIR}/include/bcg729"
530-
export LDFLAGS="${LDFLAGS} -L${SSL_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/lib"
529+
configure="$configure --with-bcg729=${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk"
530+
export CFLAGS="${CFLAGS} -I${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/include/bcg729"
531+
export LDFLAGS="${LDFLAGS} -L${BCG729_BUILD_DIR}/iPhoneSimulator${IOS_SDK_VERSION}-${arch}.sdk/lib"
531532
fi
532533
fi
533534

@@ -571,9 +572,11 @@ function _build () {
571572

572573
ARCH="-arch $arch " $configure #>> $arch_log 2>&1 || exit
573574
echo "make dep"
574-
make dep >> $arch_log 2>&1 || exit
575+
make dep >> $arch_log 2>&1 &
576+
spinner $! || exit
575577
echo "make "
576-
make >> $arch_log 2>&1 || exit
578+
make >> $arch_log 2>&1 &
579+
spinner $! || exit
577580

578581
if [ $SSL_SUPPORT = true ]; then
579582
if [ $ENABLE_ZRTP = true ]; then
@@ -590,8 +593,12 @@ function _build () {
590593
#TODO: fix libs not found on runner path because they are in temp
591594
echo "Making swig "
592595
cd "$PJSIP_SRC_DIR/pjsip-apps/src/swig"
593-
make clean
594-
make
596+
make clean >> $arch_log 2>&1 &
597+
spinner $! || exit
598+
599+
make >> $arch_log 2>&1 &
600+
spinner $! || exit
601+
595602

596603
echo "Done building for $arch"
597604
echo "============================="

0 commit comments

Comments
 (0)