2 dnl Copyright 2003,2008,2009 Free Software Foundation, Inc.
4 dnl This file is part of GNU Radio
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING. If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
22 AC_DEFUN([_TRY_ADD_ALTIVEC],
24 LF_CHECK_CC_FLAG([-mabi=altivec -maltivec])
25 LF_CHECK_CXX_FLAG([-mabi=altivec -maltivec])
28 AC_DEFUN([_FIND_ARM_ISA],
30 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
31 [[#ifndef __ARM_ARCH_5__
38 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
39 [[#ifndef __ARM_ARCH_7A__
48 AC_DEFUN([GR_SET_MD_CPU],[
49 AC_REQUIRE([AC_CANONICAL_HOST])
51 AC_HELP_STRING([--with-md-cpu=ARCH],[set machine dependent speedups (auto)]),
52 [cf_with_md_cpu="$withval"],
54 dnl temporary fix for Darwin 10.6; $host_cpu is always "i386" no matter
55 dnl if the kernel is in 32-bit or 64-bit mode.
58 cf_with_md_cpu=`uname -m`
61 cf_with_md_cpu="$host_cpu"
65 AC_MSG_RESULT($cf_with_md_cpu)
66 case "$cf_with_md_cpu" in
67 x86 | i[[3-7]]86) MD_CPU=x86 MD_SUBCPU=x86 ;;
68 x86_64) MD_CPU=x86 MD_SUBCPU=x86_64 ;;
69 powerpc*) MD_CPU=powerpc ;;
72 if test $is_armv5 = yes; then MD_CPU=armv5;
73 elif test $is_armv7_a = yes; then MD_CPU=armv7_a;
74 else MD_CPU=generic; fi
79 AC_ARG_ENABLE(altivec,
80 AC_HELP_STRING([--enable-altivec],[enable altivec on PowerPC (yes)]),
81 [ if test $MD_CPU = powerpc; then
83 (no) MD_CPU=generic ;;
84 (yes) _TRY_ADD_ALTIVEC ;;
85 (*) AC_MSG_ERROR([Invalid argument ($enableval) to --enable-altivec]) ;;
88 [ if test $MD_CPU = powerpc; then _TRY_ADD_ALTIVEC fi])
91 AC_MSG_CHECKING([for machine dependent speedups])
92 AC_MSG_RESULT($MD_CPU)
96 AM_CONDITIONAL(MD_CPU_x86, test "$MD_CPU" = "x86")
97 AM_CONDITIONAL(MD_SUBCPU_x86_64, test "$MD_SUBCPU" = "x86_64")
98 AM_CONDITIONAL(MD_CPU_powerpc, test "$MD_CPU" = "powerpc")
99 AM_CONDITIONAL(MD_CPU_armv5, test "$MD_CPU" = "armv5")
100 AM_CONDITIONAL(MD_CPU_armv7_a, test "$MD_CPU" = "armv7_a")
101 AM_CONDITIONAL(MD_CPU_generic, test "$MD_CPU" = "generic")