[patch] Error when building pjsip 2.7.1 for android

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When building pjsip 2.7.1 for android with NDK r15b  I got this error:

/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.

But video support was disabled 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.

The problem in pjproject-2.7.1\pjmedia\src\pjmedia-codec\openh264.cpp - it includes some headers before check if this codec is used:

#include <pjmedia-codec/openh264.h>
#include <pjmedia-codec/h264_packetizer.h>
#include <pjmedia/vid_codec_util.h>
#include <pjmedia/errno.h>
#include <pj/log.h>

#if defined(PJMEDIA_HAS_OPENH264_CODEC) && \
            PJMEDIA_HAS_OPENH264_CODEC != 0 && \
    defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0)

Moving this check before include fix compilation error. The patch is attached.

-- 
С уважением,
Александр Анцев
diff --git a/pjmedia/src/pjmedia-codec/openh264.cpp b/pjmedia/src/pjmedia-codec/openh264.cpp
index d8d4a40..1aebe00 100644
--- a/pjmedia/src/pjmedia-codec/openh264.cpp
+++ b/pjmedia/src/pjmedia-codec/openh264.cpp
@@ -16,16 +16,16 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
+#if defined(PJMEDIA_HAS_OPENH264_CODEC) && \
+            PJMEDIA_HAS_OPENH264_CODEC != 0 && \
+    defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0)
+
 #include <pjmedia-codec/openh264.h>
 #include <pjmedia-codec/h264_packetizer.h>
 #include <pjmedia/vid_codec_util.h>
 #include <pjmedia/errno.h>
 #include <pj/log.h>
 
-#if defined(PJMEDIA_HAS_OPENH264_CODEC) && \
-            PJMEDIA_HAS_OPENH264_CODEC != 0 && \
-    defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0)
-
 #ifdef _MSC_VER
 #   include <stdint.h>
 #   pragma comment( lib, "openh264.lib")
_______________________________________________
Visit our blog: http://blog.pjsip.org

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

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux