Error when building pjsip 2.7.1 for android - No rule to make target '../lib/libpj-arm-unknown-linux-androideabi.a', needed by '../bin/pjlib-test-arm-unknown-linux-androideabi'

Анцев Александр
Thu, Nov 16, 2017 8:56 PM

Hello!

I'm trying to build pjsip 2.7.1 for android with NDK 16 on Windows with MSYS2.

Created config_site.h:

#define PJ_CONFIG_ANDROID 1  
#define PJMEDIA_SRTP_HAS_DTLS 1
#include <pj/config_site_sample.h>  

Then started MSYS2 shell and configured pjsip:

export ANDROID_NDK_ROOT=/Dev/Android/android-ndk-r16  
TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android --use-ndk-cflags  --with-ssl=/Dev/openssl-1.1.0g/lib  --with-bcg729=/Dev/bcg729/lib

Then executed make dep && make. And make produces this error:

/Dev/Android/android-ndk-r16/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include  -gcc-toolchain /Dev/Android/android-ndk-r16/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -target armv7-none-linux-androideabi18 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Oz -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r16/sysroot -isystem /Dev/Android/android-ndk-r16/sysroot/usr/include/arm-linux-androideabi  -I/Dev/Android/android-ndk-r16/sources/cxx-stl/llvm-libc++/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include    -I../include
-o output/pjlib-test-arm-unknown-linux-androideabi/util.o
../src/pjlib-test/util.c
make[2]: *** No rule to make target '../lib/libpj-arm-unknown-linux-androideabi.a', needed by '../bin/pjlib-test-arm-unknown-linux-androideabi'.  Stop.
make[2]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build'
make[1]: *** [Makefile:112: pjlib-test-arm-unknown-linux-androideabi] Error 2
make[1]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build'
make: *** [Makefile:14: all] Error 1

Any ideas how to fix this?

--
С уважением,
Александр Анцев

Hello! I'm trying to build pjsip 2.7.1 for android with NDK 16 on Windows with MSYS2. Created `config_site.h`: #define PJ_CONFIG_ANDROID 1 #define PJMEDIA_SRTP_HAS_DTLS 1 #include <pj/config_site_sample.h> Then started MSYS2 shell and configured pjsip: export ANDROID_NDK_ROOT=/Dev/Android/android-ndk-r16 TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android --use-ndk-cflags --with-ssl=/Dev/openssl-1.1.0g/lib --with-bcg729=/Dev/bcg729/lib Then executed make dep && make. And make produces this error: /Dev/Android/android-ndk-r16/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include -gcc-toolchain /Dev/Android/android-ndk-r16/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -target armv7-none-linux-androideabi18 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Oz -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r16/sysroot -isystem /Dev/Android/android-ndk-r16/sysroot/usr/include/arm-linux-androideabi -I/Dev/Android/android-ndk-r16/sources/cxx-stl/llvm-libc++/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include -I../include \ -o output/pjlib-test-arm-unknown-linux-androideabi/util.o \ ../src/pjlib-test/util.c make[2]: *** No rule to make target '../lib/libpj-arm-unknown-linux-androideabi.a', needed by '../bin/pjlib-test-arm-unknown-linux-androideabi'. Stop. make[2]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build' make[1]: *** [Makefile:112: pjlib-test-arm-unknown-linux-androideabi] Error 2 make[1]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build' make: *** [Makefile:14: all] Error 1 Any ideas how to fix this? -- С уважением, Александр Анцев
Анцев Александр
Fri, Nov 17, 2017 7:25 AM

Found problem - by default new NDK use clang complier. To avoid this problem we need to switch on gcc like this:
NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android

But I ran into new problem:

/Dev/Android/android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include -I/Dev/openh264-1.6.0/lib/armeabi_v7/include  -fpic -ffunction-sections -funwind-tables -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Os -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r15b/sysroot -isystem /Dev/Android/android-ndk-r15b/sysroot/usr/include/arm-linux-androideabi  -I/Dev/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/Dev/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include        -DPJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL=1 -DPJMEDIA_VIDEO_DEV_HAS_ANDROID=1 -DPJMEDIA_HAS_OPENH264_CODEC=1 -I/Dev/openh264-1.6.0/lib/armeabi_v7/include -I/Dev/pjproject-2.7.1/third_party/build/speex -I/Dev/pjproject-2.7.1/third_party/speex/include -DPJMEDIA_HAS_OPENCORE_AMRNB_CODEC=0 -DPJMEDIA_HAS_OPENCORE_AMRWB_CODEC=0 -I/Dev/pjproject-2.7.1/third_party/build/srtp -I/Dev/pjproject-2.7.1/third_party/srtp/crypto/include -I/Dev/pjproject-2.7.1/third_party/srtp/include -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_LIBRESAMPLE -DPJMEDIA_HAS_LIBYUV=1 -I/Dev/pjproject-2.7.1/third_party/yuv/include -DPJMEDIA_HAS_WEBRTC_AEC=1 -I/Dev/pjproject-2.7.1/third_party/webrtc/src -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 -I../include -I../../pjlib/include -I../../pjlib-util/include -I../../pjmedia/include -I../../pjnath/include -I../..  -DPJ_AUTOCONF=1  -shared --sysroot=/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm -lgcc -Wl,--exclude-libs,libgcc.a -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -lc -lm -fexceptions -frtti        -I/Dev/pjproject-2.7.1/third_party
-o output/pjmedia-codec-arm-unknown-linux-androideabi/openh264.o
../src/pjmedia-codec/openh264.cpp
In file included from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/linux/posix_types.h:41:0,
from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/sys/types.h:37,
from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/stdio.h:50,
from ../../pjlib/include/pj/compat/string.h:39,
from ../../pjlib/include/pj/string.h:29,
from ../include/pjmedia/frame.h:28,
from ../include/pjmedia/port.h:30,
from ../include/pjmedia/codec.h:29,
from ../include/pjmedia-codec/types.h:29,
from ../include/pjmedia-codec/openh264.h:22,
from ../src/pjmedia-codec/openh264.cpp:19:
D:/Dev/Android/android-ndk-r15b/sysroot/usr/include/arm-linux-androideabi/asm/posix_types.h:32:37: fatal error: asm-generic/posix_types.h: No such file or directory
#include <asm-generic/posix_types.h>
^
compilation terminated.

I can't understad - I disabled video support in config_site.h:
#define PJMEDIA_HAS_VIDEO 0

I even build external openh264-1.6.0. But pjsip anyway for some reason tries to biuld internal openh264 and fails.
Any ideas?

16.11.2017, 23:57, "Анцев Александр" a.antsev@yandex.ru:

Hello!

I'm trying to build pjsip 2.7.1 for android with NDK 16 on Windows with MSYS2.

Created config_site.h:

    #define PJ_CONFIG_ANDROID 1
    #define PJMEDIA_SRTP_HAS_DTLS 1
    #include <pj/config_site_sample.h>

Then started MSYS2 shell and configured pjsip:

    export ANDROID_NDK_ROOT=/Dev/Android/android-ndk-r16
    TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android --use-ndk-cflags --with-ssl=/Dev/openssl-1.1.0g/lib --with-bcg729=/Dev/bcg729/lib

Then executed make dep && make. And make produces this error:

/Dev/Android/android-ndk-r16/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include -gcc-toolchain /Dev/Android/android-ndk-r16/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -target armv7-none-linux-androideabi18 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Oz -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r16/sysroot -isystem /Dev/Android/android-ndk-r16/sysroot/usr/include/arm-linux-androideabi -I/Dev/Android/android-ndk-r16/sources/cxx-stl/llvm-libc++/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include -I../include
        -o output/pjlib-test-arm-unknown-linux-androideabi/util.o
        ../src/pjlib-test/util.c
make[2]: *** No rule to make target '../lib/libpj-arm-unknown-linux-androideabi.a', needed by '../bin/pjlib-test-arm-unknown-linux-androideabi'. Stop.
make[2]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build'
make[1]: *** [Makefile:112: pjlib-test-arm-unknown-linux-androideabi] Error 2
make[1]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build'
make: *** [Makefile:14: all] Error 1

Any ideas how to fix this?

--
С уважением,
Александр Анцев
,


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
С уважением,
Александр Анцев

Found problem - by default new NDK use clang complier. To avoid this problem we need to switch on gcc like this: NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android But I ran into new problem: /Dev/Android/android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include -I/Dev/openh264-1.6.0/lib/armeabi_v7/include -fpic -ffunction-sections -funwind-tables -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Os -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r15b/sysroot -isystem /Dev/Android/android-ndk-r15b/sysroot/usr/include/arm-linux-androideabi -I/Dev/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/Dev/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include -DPJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL=1 -DPJMEDIA_VIDEO_DEV_HAS_ANDROID=1 -DPJMEDIA_HAS_OPENH264_CODEC=1 -I/Dev/openh264-1.6.0/lib/armeabi_v7/include -I/Dev/pjproject-2.7.1/third_party/build/speex -I/Dev/pjproject-2.7.1/third_party/speex/include -DPJMEDIA_HAS_OPENCORE_AMRNB_CODEC=0 -DPJMEDIA_HAS_OPENCORE_AMRWB_CODEC=0 -I/Dev/pjproject-2.7.1/third_party/build/srtp -I/Dev/pjproject-2.7.1/third_party/srtp/crypto/include -I/Dev/pjproject-2.7.1/third_party/srtp/include -DPJMEDIA_RESAMPLE_IMP=PJMEDIA_RESAMPLE_LIBRESAMPLE -DPJMEDIA_HAS_LIBYUV=1 -I/Dev/pjproject-2.7.1/third_party/yuv/include -DPJMEDIA_HAS_WEBRTC_AEC=1 -I/Dev/pjproject-2.7.1/third_party/webrtc/src -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 -I../include -I../../pjlib/include -I../../pjlib-util/include -I../../pjmedia/include -I../../pjnath/include -I../.. -DPJ_AUTOCONF=1 -shared --sysroot=/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm -lgcc -Wl,--exclude-libs,libgcc.a -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -lc -lm -fexceptions -frtti -I/Dev/pjproject-2.7.1/third_party \ -o output/pjmedia-codec-arm-unknown-linux-androideabi/openh264.o \ ../src/pjmedia-codec/openh264.cpp In file included from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/linux/posix_types.h:41:0, from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/sys/types.h:37, from D:/Dev/Android/android-ndk-r15b/platforms/android-18/arch-arm/usr/include/stdio.h:50, from ../../pjlib/include/pj/compat/string.h:39, from ../../pjlib/include/pj/string.h:29, from ../include/pjmedia/frame.h:28, from ../include/pjmedia/port.h:30, from ../include/pjmedia/codec.h:29, from ../include/pjmedia-codec/types.h:29, from ../include/pjmedia-codec/openh264.h:22, from ../src/pjmedia-codec/openh264.cpp:19: D:/Dev/Android/android-ndk-r15b/sysroot/usr/include/arm-linux-androideabi/asm/posix_types.h:32:37: fatal error: asm-generic/posix_types.h: No such file or directory #include <asm-generic/posix_types.h> ^ compilation terminated. I can't understad - I disabled video support in config_site.h: #define PJMEDIA_HAS_VIDEO 0 I even build external openh264-1.6.0. But pjsip anyway for some reason tries to biuld internal openh264 and fails. Any ideas? 16.11.2017, 23:57, "Анцев Александр" <a.antsev@yandex.ru>: > Hello! > > I'm trying to build pjsip 2.7.1 for android with NDK 16 on Windows with MSYS2. > > Created `config_site.h`: > >     #define PJ_CONFIG_ANDROID 1 >     #define PJMEDIA_SRTP_HAS_DTLS 1 >     #include <pj/config_site_sample.h> > > Then started MSYS2 shell and configured pjsip: > >     export ANDROID_NDK_ROOT=/Dev/Android/android-ndk-r16 >     TARGET_ABI=armeabi-v7a APP_PLATFORM=android-18 ./configure-android --use-ndk-cflags --with-ssl=/Dev/openssl-1.1.0g/lib --with-bcg729=/Dev/bcg729/lib > > Then executed make dep && make. And make produces this error: > > /Dev/Android/android-ndk-r16/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -c -Wall -DPJ_AUTOCONF=1 -I/Dev/bcg729/lib/include -gcc-toolchain /Dev/Android/android-ndk-r16/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -target armv7-none-linux-androideabi18 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Oz -DNDEBUG -Ijni -DANDROID -D__ANDROID_API__=18 -Wa,--noexecstack -Wformat -Werror=format-security --sysroot /Dev/Android/android-ndk-r16/sysroot -isystem /Dev/Android/android-ndk-r16/sysroot/usr/include/arm-linux-androideabi -I/Dev/Android/android-ndk-r16/sources/cxx-stl/llvm-libc++/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/Dev/openssl-1.1.0g/lib/include -I../include \ >         -o output/pjlib-test-arm-unknown-linux-androideabi/util.o \ >         ../src/pjlib-test/util.c > make[2]: *** No rule to make target '../lib/libpj-arm-unknown-linux-androideabi.a', needed by '../bin/pjlib-test-arm-unknown-linux-androideabi'. Stop. > make[2]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build' > make[1]: *** [Makefile:112: pjlib-test-arm-unknown-linux-androideabi] Error 2 > make[1]: Leaving directory '/Dev/pjproject-2.7.1/pjlib/build' > make: *** [Makefile:14: all] Error 1 > > Any ideas how to fix this? > > -- > С уважением, > Александр Анцев > , > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- С уважением, Александр Анцев