"Go" VLC Android code compilation

Source: Internet
Author: User
Tags gtk

Transferred from: http://blog.csdn.net/asircao/article/details/7734201

System: ubuntu12.04
Code: Git://git.videolan.org/vlc-ports/android.git
Code version: 375646994d0602

At the beginning of the year the three-month VLC Android was engaged. Yesterday saw VLC Android beta release released, decided to compile a look at the effect. The compilation process of their own this record, for friends to reference. The file path below will be replaced by the correct path.

1. Build Ubuntu Android Development environment
To find a directory of your liking install JDK, SDK, NDK, ANT
1.1 Installing the JDK
Refer to my forwarded "Ubuntu11.10 installation Jdk-6u30-linux-i586.bin"

1.2 Installing the SDK
Download sdk:http://developer.android.com/sdk/index.html
Unzip the SDK into a directory:

    1. $ sudo tar-xvf android-sdk_r20-linux.tgz


1.3 Installing the NDK
Download ndk:http://developer.android.com/tools/sdk/ndk/index.html
Unzip the NDK into a directory:

    1. $ sudo bzip2-d android-ndk-r5b-linux-x86.tar.bz2
    2. $ sudo tar-xvf Android-ndk-r5b-linux-x86.tar


1.4 Installing Ant
Download ant:http://mirror.bit.edu.cn/apache//ant/binaries/apache-ant-1.8.4-bin.tar.gz
Extract:

    1. $ sudo tar-xvf apache-ant-1.8.4-bin.tar.gz

To set the ANT environment variable:

    1. $ sudo vim/etc/profile

Add at the end of the file:

    1. Export ant_home=/home/workenv/apache-ant-1.8.4
    2. Path= $PATH:/home/workenv/apache-ant-1.8.4

Settings to take effect:

    1. $ source/etc/profile

Check to see if the installation was successful:

    1. $ ant-version

Should show:

    1. Apache Ant (TM) version 1.8.4 compiled on 22 2012


1.5 Installing eclipse:

    1. $ sudo cp eclipse-jee-indigo-sr1-linux-gtk.tar.gz. /workenv/
    2. $ CD. /workenv/
    3. $ sudo gzip-d eclipse-jee-indigo-sr1-linux-gtk.tar.gz
    4. $ sudo tar-xvf Eclipse-jee-indigo-sr1-linux-gtk.tar
    5. $ sudo chmod 777-r eclipse/
    6. $ RM Eclipse-jee-indigo-sr1-linux-gtk.tar


1.6 Installing the ADT Plugin

    1. $./eclips

Launch Eclipse Select "Help" > "Installnewsoftware ..."
Select Add Name:adt location:http://dl-ssl.google.com/android/eclipse/
Selection: Androidddms and Androiddevelopmenttools

1.7 Updating the Android SDK API

    1. $./eclips

Windows > Preferences > Android > SDK location
Fill in the path to the SDK.
Windows > Android SDK Manger
Select 2.2 and 4.1
Install

2. Install other libraries that VLC relies on:

    1. $ sudo apt-get build-dep VLC


3. Compiling
3.1 Setting environment variables

    1. $ Export Android_sdk=/home/workenv/android-sdk-linux
    2. $ Export ANDROID_NDK=/HOME/WORKENV/ANDROID-NDK-R8
    3. $ export path= $PATH: $ANDROID _sdk/platform-tools: $ANDROID _sdk/tools If the device is ARMv7 and above and supports neon:
    4. $ Export android_abi=armeabi-v7a

If the device is ARMv7 and above but does not support neon:

    1. $ Export android_abi=armeabi-v7a
    2. $ Export No_neon=1

How do I check the CPU type and support neon? Open the phone or pad under the file/proc/cpuinfo, you will see something like the following:

  1. Processor:armv7 Processor Rev 2 (V7L)
  2. bogomips:998.36
  3. FEATURES:SWP half thumb fastmult vfp edsp neon Vfpv3
  4. CPU implementer:0x41
  5. CPU Architecture:7
  6. CPU variant:0x3
  7. CPU PART:0XC08
  8. CPU Revision:2
  9. Hardware:p1lite Samsung Board
  10. revision:0004
  11. serial:0000000000000000

Here can go to ARMv7 and support neon,features have neon, it means support neon, otherwise not support.

3.2 Getting the Code

    1. $ git clone git://git.videolan.org/vlc-ports/android.git
    2. $ cd Android


3.3 Compiling

    1. $ sh compile.sh

The execution of compile.sh is the whole process of compiling, and the approximate process is as follows:
A. Download VLC code: COMPILE.SH's 42 line git clone git://git.videolan.org/vlc.git VLC.
B. And check out the VLC code to e75d2024 this version: compile.sh 44 line git checkout-b android ${tested_hash}
C. Compile all required third-party libraries, first download and recompile, this process takes a long time, it may not be successful, if you cannot download some libraries, download them manually and put them in this directory: Android/vlc/contrib/tarballs.
D. Configuring of VLC.
E. VLC compilation.
F. Compile the Android part code and link the VLC so library.

4 Troubleshooting problems that are encountered during compilation
4.1 Error C compiler cannot create executables

    1. Configure:error:c compiler cannot create executables
    2. See ' Config.log ' for more details.

Locate Config.log and open:

    1. $ vim./vlc/contrib/android/a52dec/config.log

An error has been found with this line:

    1. /home/workenv/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/. /lib/gcc/arm-linux-androideabi/4.4.3/http://www.cnblogs.com/http://www.cnblogs.com/arm-linux-androideabi/bin/ Ld:crtbegin_dynamic.o:no such file:no such file or directory

CRTBEGIN_DYNAMIC.O can not find, go to the NDK directory to find CRTBEGIN_DYNAMIC.O:

    1. $ find-name CRTBEGIN_DYNAMIC.O

Find a lot:

    1. ./PLATFORMS/ANDROID-14/ARCH-X86/USR/LIB/CRTBEGIN_DYNAMIC.O
    2. ./PLATFORMS/ANDROID-14/ARCH-MIPS/USR/LIB/CRTBEGIN_DYNAMIC.O
    3. ./PLATFORMS/ANDROID-14/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O
    4. ./PLATFORMS/ANDROID-3/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O
    5. ./PLATFORMS/ANDROID-8/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O
    6. ./PLATFORMS/ANDROID-5/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O
    7. ./PLATFORMS/ANDROID-9/ARCH-X86/USR/LIB/CRTBEGIN_DYNAMIC.O
    8. ./PLATFORMS/ANDROID-9/ARCH-MIPS/USR/LIB/CRTBEGIN_DYNAMIC.O
    9. ./PLATFORMS/ANDROID-9/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O
    10. ./PLATFORMS/ANDROID-4/ARCH-ARM/USR/LIB/CRTBEGIN_DYNAMIC.O

Check Permissions

    1. $ LL./platforms/android-14/arch-x86/usr/lib/crtbegin_dynamic.o

It should be this reason to find that ordinary users do not have Read permission. Change the file permissions in the NDK:

    1. $ sudo chmod 755-r android-ndk-r8

Re-compile:

    1. $ sh compile.sh

There is no prompt for this error.

4.2 Ant Error

    1. /bin/sh:1: Ant:permission denied
    1. $ ant-version

Tip No ant is installed, it is already installed, and setting the environment is OK again:

    1. $ source/etc/profile


4.3

    1. BUILD FAILED
    2. /home/workenv/android-sdk-linux/tools/ant/build.xml:518:unable to resolve project target ' android-15 '
    3. $ vim Vlc-android/project.properties

Change 15 to 16, because just now I installed the SDK API only 8 and 16.

    1. $ vim Vlc-android/androidmanifest.xml

Change android:targetsdkversion= "15" to android:targetsdkversion= "16"
Finally: BUILD successful

Postscript:
The compilation was smooth because it had been compiled many times before. If a friend encounters problems with some code compilation errors in VLC, it's probably a matter of permissions, git checkout, git am patching. Follow-up I will summarize some VLC Android code architecture aspects, also will long-term study, focus on VLC, hope to communicate with you.

"Go" VLC Android code compilation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.