I'm trying to build pjsip for android with NDK r13b.
Standard build like ./configure-android --with-opus=/home/user/pjsip/pjproject/opus-dev-lib works perfect. But i need several TARGET_ABI and all my tries to do it ends with configure-android error: compiler not found, please check environment settings (TARGET_ABI, etc)
Commands as
TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags --with-opus=/home/user/pjsip/pjproject/opus-dev-lib
TARGET_ABI=armeabi-v7a APP_PLATFORM=android-21 ./configure-android --use-ndk-cflags --with-opus=/home/user/pjsip/pjproject/opus-dev-lib
return the same error.
I'm search a lot of links but no result.
I know that error is in configure-android file and throwing by
if test "x${CC}" = "x" || test ! -e ${CC}; then
echo "$F error: compiler not found, please check environment
settings (TARGET_ABI, etc)"
exit 1
fi
But i have no idea how to solve it.
Thanks in advance.
So, i'm finished with build.
Using Alex Gotev build and modify config.conf, prepare-build-system and build for needed configuration and latest pjsip source.
Also i had to use latest libyuv from googlesource and NDK r10e.
UPDATED
Using android-ndk-r13 or later use NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags. At the moment it's able to build pjsip 2.6
Related
I am trying to compile shell script that compiles the C project library, but i am stuck at this when it comes to compile the nmake part.
I am using NDK 21 and cmake version is 3.10
I am using shell script using bash same as defined here, i want to compress this library as they showing in the docs running ./android.sh
Please check the link: https://github.com/tanersener/mobile-ffmpeg#52-build-scripts
here is the attached log:
DEBUG: Downloading library source: cpu-features
DEBUG: Checking if cpu-features is already downloaded at /d/Bilals/Projects/GithubProjects/mobile-ffmpeg/src/cpu-features
INFO: cpu-features library already downloaded
INFO: cpu-features already downloaded. Source folder found at /d/Bilals/Projects/GithubProjects/mobile-ffmpeg/src/cpu-features
-- Building for: NMake Makefiles
-- Check for working C compiler: D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_adf3f\fast"
-- Check for working C compiler: D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
CMake Error at D:/Bilals/PcBackupData/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_adf3f\fast"
The system cannot find the file specified
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_adf3f\fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:9 (project)
-- Configuring incomplete, errors occurred!
See also "D:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeOutput.log".
See also "D:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeError.log".
and here is my environmental variables
You should use Linux Make, not NMake. Generally speaking, these scripts were never tuned to run on Windows, in cygwin or mingw shell, even though I have run them in WSL (Ubuntu) bash.
I am trying to build pjsip project with openh264 lib. Everything works fine except openh264 is not being detected by pjsip ./configure-android
this is my config_site.h
/* Activate Android specific settings in the 'config_site_sample.h' */
#define PJ_CONFIG_ANDROID 1
#include <pj/config_site_sample.h>
#define PJMEDIA_HAS_VIDEO 1
#define PJMEDIA_HAS_OPENH264_CODEC 1
I am getting following log
Using OpenH264 prefix... /home/user_name/PJSIPTOOLS/openh264-1.0.0/openlib/
checking OpenH264 usability... no
As it is not detected by ./configure-android my app is crashing at runtime saying lib not found for openh264.
I am on ubuntu 14.04 32 bit.
Any suggestions.
I just encountered a similar issue. In the following, I refer to the directory, I downloaded and extracted OpenH264 to, as path-to-openh264. I created a subdirectory android within that folder and modified OpenH264's Makefile by setting PREFIX=android. Afterwards running the following commands to build OpenH264 solved the issue for me:
make OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm
make OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm clean
make install OS=android NDKROOT=<path-to-ndk> TARGET=android-14 APP_ABI=armeabi ARCH=arm
The resulting libopenh264.so file should end up in the directory path-to-openh264/android/lib/. In order to configure pjsip I used the following command:
APP_PLATFORM=android-14 ./configure-android --with-openh264=<path-to-openh264>/android
The following StackOverflow thread lead me to the right direction:
building openh264 for android platform in x86
The reason for this issue was, that I ran the make install command without the command line parameters at first. This caused the native library file to be created for the wrong ABI (the default one, which is armeabi-v7a). When building pjsip for the armeabi ABI, it didn't recognize the library, because it was built for a different ABI. At least this is what I suppose.
Actually i faced that problem too.
Solution:
step 1:go to your openh264 directory and create a folder named "android"
step 2: open makefile and set prefix
PREFIX=/your_path/openh264-1.0.0/android
step3:then build openh264 using this command
make OS=android NDKROOT=/your_path/android-ndk-r10d TARGET=android-17 APP_ABI=armeabi
step4: now build pjsip using this command
TARGET_ABI=armeabi APP_PLATFORM=android-12 ./configure-android --use-ndk-cflags --with-openh264=/your_path/openh264-1.0.0/android
hope this time you will see
Using OpenH264 prefix...
/home/user_name/PJSIPTOOLS/openh264-1.0.0/openlib/
checking OpenH264 usability... ok
http://trac.pjsip.org/repos/ticket/1758
modify the "prefix" in Makefile
run "make install ARCH=armeabi"
run "./configure-android --with_openh264=/path/to/prefix/folder"
I tried to download the gnu readline-6.2 source code but could not manage to build it on Android platform. Could anyone point out a way for me to tackle this problem? Thanks a lot!
I try to get the default Android build flags on my PC and use it to run ./configure and got problems saying that:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-linux-androideabi
configure: cross-compiling for arm-linux-androideabi is not supported
Beginning configuration for readline-6.2 for arm-linux-androideabi
checking whether make sets $(MAKE)... yes
checking for arm-linux-gcc... /home/huangwei/ICS/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc
checking for C compiler default output file name...
configure: error: in `/home/huangwei/ICS/external/readline':
configure: error: C compiler cannot create executables
See `config.log' for more details.
However, I opened the config.log and use the same build command to compile the conftest.c, it works, the .o file is there. I don't know why the configure still fails. Is there anyone could help?
I found myself also needing to compile libreadline for arm-linux-androideabi. What I did was the following:
download source code for libreadline gnu.
set CC to the android-ndk cross compiler (CC=~/android/lib/bin/arm-linux-androideabi-gcc)
update the config.sub and config.guess files (the ones in the libreadline source are very old and don't have arm-linux-androideabi)
$ cp /usr/share/misc/config.{sub,guess} support/.
run ./configure with --host and --prefix set to the target architecture and the locations for the compiled objects
$ CC=~/android/lib/bin/arm-linux-androideabi-gcc ./configure --build=arm-linux-androideabi --prefix=~/android/lib/
make && make install and it worked for me! I have libreadline.a and libreadline.so files in ~/android/lib/lib
Note, before I had updated the support/config.sub and support/config.guess files I was getting the same error described in the question.
Please advise about building android LuaJit on mac or tips on resolving pseudo-op: '.private_extern' assembler errors in general.
I am on Mac and following instruction to complie LuaJit2 in doc/install or http://luajit.org/install.html#android :
The only change I made is to change linux-x86 to darwin-x86 to get NDK cross-compiler. I also added TARGET_SYS=Linux (I tried with and without) per installation notes: “Whenever the host OS and the target OS differ, you need to specify TARGET_SYS or you'll get assembler or linker errors…”
So my build script looks like this:
NDK=$ANDROID_NDK
NDKABI=8
NDKVER=$NDK/toolchains/arm-linux-androideabi-4.4.3
NDKP=$NDKVER/prebuilt/darwin-x86/bin/arm-linux-androideabi-
NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS="$NDKF"
My $ANDROID_NDK points to r8b NDK. But I also tried r8 and r7, and I tried gcc 4.6 with r8b. In all cases I get similar errors.
==== Building LuaJIT 2.0.0-beta9 ====
make -C src
ASM lj_vm.o
lj_vm.s: Assembler messages:
lj_vm.s:5: Error: unknown pseudo-op: `.private_extern'
lj_vm.s:8: Error: unknown pseudo-op: `.private_extern'
lj_vm.s:25: Error: unknown pseudo-op: `.private_extern'
…
I'm not sure but I think when you tried to build first time without TARGET_SYS=Linux you forgot clean *.o files in src/host directory after unsuccessful build.
For this reason you have seen a lot of errors like: Error: unknown pseudo-op: '.private_extern'
To clean all generated and builded files run make clean
I was able to build LuaJIT 2.0.0-beta10 with no problems. The problem posted was when building beta9 or lower: looks like they patched whatever issue it was.
I wand build project in windows, I get same Errors:
bash C:\linux\android-ndk1\ndk-build V=1
cygwin warning:
MS-DOS style path detected: C:\dev\android\workspace4_android\FFWall
Preferred POSIX equivalent is: /cygdrive/c/dev/android/workspace4_android/FFWall
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Android NDK: ERROR:jni/Android.mk:bambuser-libavcore: LOCAL_SRC_FILES points to a missing file
/cygdrive/c/linux/android-ndk1/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
Android NDK: Check that jni/ffmpeg-android/build/ffmpeg/armeabi/lib/libavcore.so exists or that its path is correct
Another way building:
C:\art\android-ndk\ndk-build V=1
Cannot run program "C:\art\android-ndk\ndk-build": Launching failed
Error: Program "C:/art/android-ndk/ndk-build" is not found in PATH
PATH=[C:\Art\android-ndk;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\MATLAB\R2011a\runtime\win32;C:\Program Files\MATLAB\R2011a\bin;C:\Program Files\MATLAB\R2007b\bin;C:\Program Files\MATLAB\R2007b\bin\win3;C:\dev\android\android-sdk-windows\tools;C:\cygwin\bin;C:/art/android-ndk/;C:\linux\android-ndk-r7b;C:\dev\android\eclipse]
Why this happened?
From: http://developer.android.com/sdk/ndk/overview.html#reqs
Required development tools
For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations.
Meaning, that you will have to install Cygwin. After that you can call the ndk-build like:
$ProjectPath> /cygdrive/c/myNdkPath/ndk-build
Please also check the "Getting Started" part of:
http://developer.android.com/sdk/ndk/index.html