android-config 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. # aria2 - The high speed download utility
  3. #
  4. # Copyright (C) 2012 Tatsuhiro Tsujikawa
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. #
  20. # In addition, as a special exception, the copyright holders give
  21. # permission to link the code of portions of this program with the
  22. # OpenSSL library under certain conditions as described in each
  23. # individual source file, and distribute linked combinations
  24. # including the two.
  25. # You must obey the GNU General Public License in all respects
  26. # for all of the code used other than OpenSSL. If you modify
  27. # file(s) with this exception, you may extend this exception to your
  28. # version of the file(s), but you are not obligated to do so. If you
  29. # do not wish to do so, delete this exception statement from your
  30. # version. If you delete this exception statement from all source
  31. # files in the program, then also delete it here.
  32. if [ -z "$ANDROID_HOME" ]; then
  33. echo 'No $ANDROID_HOME specified.'
  34. exit 1
  35. fi
  36. if [ -z "$NDK" ]; then
  37. echo 'No $NDK specified.'
  38. exit 1
  39. fi
  40. PREFIX=$ANDROID_HOME/usr/local
  41. TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
  42. ./configure \
  43. --host=aarch64-linux-android \
  44. --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
  45. --disable-nls \
  46. --without-gnutls \
  47. --with-openssl \
  48. --without-sqlite3 \
  49. --without-libxml2 \
  50. --with-libexpat \
  51. --with-libcares \
  52. --with-libz \
  53. --with-libssh2 \
  54. AR=$TOOLCHAIN/bin/aarch64-linux-android-ar \
  55. AS=$TOOLCHAIN/bin/aarch64-linux-android-as \
  56. CC=$TOOLCHAIN/bin/aarch64-linux-android29-clang \
  57. CXX=$TOOLCHAIN/bin/aarch64-linux-android29-clang++ \
  58. LD=$TOOLCHAIN/bin/aarch64-linux-android-ld \
  59. RANLIB=$TOOLCHAIN/bin/aarch64-linux-android-ranlib \
  60. STRIP=$TOOLCHAIN/bin/aarch64-linux-android-strip \
  61. CXXFLAGS="-Os -g" \
  62. CFLAGS="-Os -g" \
  63. CPPFLAGS="-fPIE" \
  64. LDFLAGS="-fPIE -pie -L$PREFIX/lib -static-libstdc++" \
  65. PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig"