android_build.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #!/bin/bash
  2. export HOME=`pwd`
  3. ### Options (change next values to 'no' to disable some features) ###
  4. export DEBUG=no
  5. export FFMPEG=yes
  6. export LIBYUV=yes
  7. export VPX=yes
  8. export OPENH264=yes
  9. export OPUS=yes
  10. export OPENCORE_AMR=yes
  11. export SPEEX_CODEC=yes
  12. export SPEEX_DSP=yes
  13. export SPEEX=yes
  14. export ILBC=yes
  15. export LIBGSM=yes
  16. export G729=yes
  17. export SRTP=yes
  18. export WEBRTC=yes
  19. export SSL=yes
  20. if [ x$NDK = "x" ]
  21. then
  22. echo ERROR: NDK env variable is not set
  23. exit 1;
  24. fi
  25. export ANDROID_NDK_ROOT=$NDK
  26. if [ x$1 = "xcommercial" ]
  27. then
  28. echo "************************"
  29. echo " COMMERCIAL "
  30. echo "************************"
  31. export HOME=$HOME/android-projects/output/commercial
  32. export ENABLE_NONFREE=no
  33. export ENABLE_GPL=no
  34. export FFMPEG=no # Do not use FFmpeg-LGPL because we're using static linking on Android
  35. export ILBC=no #LGPL
  36. elif [ x$1 = "xlgpl" ]
  37. then
  38. echo "************************"
  39. echo " LGPL "
  40. echo "************************"
  41. export HOME=$HOME/android-projects/output/lgpl
  42. export ENABLE_NONFREE=yes
  43. export ENABLE_GPL=no
  44. else
  45. echo "************************"
  46. echo " GPL "
  47. echo "************************"
  48. export HOME=$HOME/android-projects/output/gpl
  49. export ENABLE_NONFREE=yes
  50. export ENABLE_GPL=yes
  51. fi
  52. export OPTIONS=
  53. if [ x$FFMPEG = "xno" ]; then
  54. export OPTIONS="${OPTIONS} --without-ffmpeg"
  55. fi
  56. if [ x$LIBYUV = "xno" ]; then
  57. export OPTIONS="${OPTIONS} --without-yuv"
  58. fi
  59. if [ x$VPX = "xno" ]; then
  60. export OPTIONS="${OPTIONS} --without-vpx"
  61. fi
  62. if [ x$OPENH264 = "xno" ]; then
  63. export OPTIONS="${OPTIONS} --without-openh264"
  64. fi
  65. if [ x$OPUS = "xno" ]; then
  66. export OPTIONS="${OPTIONS} --without-opus"
  67. fi
  68. if [ x$G729 = "xno" ]; then
  69. export OPTIONS="${OPTIONS} --without-g729"
  70. else
  71. export ac_cv_lib_g729b_Init_Decod_ld8a=yes
  72. export OPENCORE_AMR=no
  73. fi
  74. if [ x$OPENCORE_AMR = "xno" ]; then
  75. export OPTIONS="${OPTIONS} --without-amr"
  76. fi
  77. if [ x$SPEEX_CODEC = "xno" ]; then
  78. export OPTIONS="${OPTIONS} --without-speex"
  79. fi
  80. if [ x$SPEEX_DSP = "xno" ]; then
  81. export OPTIONS="${OPTIONS} --without-speexdsp"
  82. fi
  83. if [ x$ILBC = "xno" ]; then
  84. export OPTIONS="${OPTIONS} --without-ilbc"
  85. fi
  86. if [ x$LIBGSM = "xno" ]; then
  87. export OPTIONS="${OPTIONS} --without-gsm"
  88. fi
  89. if [ x$SRTP = "xno" ]; then
  90. export OPTIONS="${OPTIONS} --without-srtp"
  91. fi
  92. if [ x$WEBRTC = "xno" ]; then
  93. export OPTIONS="${OPTIONS} --without-webrtc"
  94. fi
  95. if [ x$SSL = "xno" ]; then
  96. export OPTIONS="${OPTIONS} --with-ssl"
  97. fi
  98. for arch in armv5te armv7-a armv7-a-neon x86
  99. do
  100. if [ $arch = "x86" ]; then \
  101. export HOST=i686-linux-android; \
  102. else \
  103. export HOST=arm-linux-androideabi; \
  104. fi \
  105. echo -e building for ARCH="$arch, OPTIONS=$OPTIONS.... \n"
  106. ./configure --host=$HOST --with-android-cpu=$arch --prefix=$HOME/$arch --without-pic --enable-nonfree=$ENABLE_NONFREE --enable-gpl=$ENABLE_GPL --enable-debug=$DEBUG $OPTIONS
  107. make clean
  108. make uninstall
  109. make all
  110. if [ $DEBUG = "yes" ]; then \
  111. make install; \
  112. else \
  113. make install-strip; \
  114. fi \
  115. done
  116. mkdir -p $HOME/imsdroid/libs/armeabi
  117. mkdir -p $HOME/imsdroid/libs/armeabi-v7a
  118. mkdir -p $HOME/imsdroid/libs/x86
  119. mkdir -p $HOME/imsdroid/libs/mips
  120. cp --force $HOME/armv5te/lib/libtinyWRAP.so.0.0.0 $HOME/imsdroid/libs/armeabi/libtinyWRAP.so
  121. cp --force $HOME/armv5te/lib/libplugin_audio_opensles.so.0.0.0 $HOME/imsdroid/libs/armeabi/libplugin_audio_opensles.so
  122. cp --force $HOME/armv7-a/lib/libtinyWRAP.so.0.0.0 $HOME/imsdroid/libs/armeabi-v7a/libtinyWRAP.so
  123. cp --force $HOME/armv7-a/lib/libplugin_audio_opensles.so.0.0.0 $HOME/imsdroid/libs/armeabi-v7a/libplugin_audio_opensles.so
  124. cp --force $HOME/armv7-a-neon/lib/libtinyWRAP.so.0.0.0 $HOME/imsdroid/libs/armeabi-v7a/libtinyWRAP_neon.so
  125. cp --force $HOME/x86/lib/libtinyWRAP.so.0.0.0 $HOME/imsdroid/libs/x86/libtinyWRAP.so
  126. cp --force $HOME/x86/lib/libplugin_audio_opensles.so.0.0.0 $HOME/imsdroid/libs/x86/libplugin_audio_opensles.so