Skip to content

Commit

Permalink
[depends] add neon and tegra switches
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnipex authored and FernetMenta committed Apr 27, 2014
1 parent 6edaeed commit ac39d8f
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions tools/depends/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ AC_ARG_WITH([cpu],
[optional. specify target cpu. guessed if not specified])],
[use_cpu=$withval],use_cpu=auto)

AC_ARG_ENABLE([neon],
[AS_HELP_STRING([--enable-neon],
[enable neon support (default is no)])],
[use_neon=$enableval],
[use_neon=no])

AC_ARG_ENABLE([tegra],
[AS_HELP_STRING([--enable-tegra],
[enable Tegra2 arm (default is no)])],
[use_tegra=$enableval],
[use_tegra=no])

AC_ARG_WITH([ndk],
[AS_HELP_STRING([--with-ndk],
[specify path to ndk (required for android only)])],
Expand Down Expand Up @@ -93,15 +105,20 @@ platform_cc=gcc
platform_cxx=g++
case $host in
arm*-*linux-android*)
if test "x$use_cpu" = "xauto"; then
if test "x$use_cpu" = "xauto" || test "x$use_cpu" = "xarmeabi-v7a"; then
use_cpu="armeabi-v7a"
platform_cflags+=" -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp"
use_neon="yes"
fi
if test "$use_neon" = "yes"; then
platform_cflags+="-mfpu=neon -mvectorize-with-neon-quad"
fi
if test "$use_tegra" = "yes"; then
platform_cflags+="-Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
fi
use_sdk="${use_sdk:-android-14}"
deps_dir="$use_host-$use_sdk"
platform_cflags="-DANDROID -Os -fexceptions"
if test "x$use_cpu" = "xarmeabi-v7a"; then
platform_cflags+=" -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon"
fi
platform_ldflags="-L$prefix/$deps_dir/lib/$use_sdk"
platform_cxxflags="$platform_cflags -frtti"
platform_includes="-I$prefix/$deps_dir/include/$use_sdk"
Expand Down Expand Up @@ -134,6 +151,12 @@ case $host in
if test "x$use_cpu" = "xauto"; then
use_cpu=$host_cpu
fi
if test "$use_neon" = "yes"; then
platform_cflags+="-mfpu=neon -mvectorize-with-neon-quad"
fi
if test "$use_tegra" = "yes"; then
platform_cflags+="-Wno-psabi -Wa,-march=armv7a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mthumb-interwork"
fi
use_toolchain="${use_toolchain:-/usr}"
platform_cflags="-Os -fPIC -DPIC"
platform_ldflags="-Wl,-rpath-link=$prefix/$deps_dir/lib"
Expand Down

0 comments on commit ac39d8f

Please sign in to comment.