Statistics
| Branch: | Tag: | Revision:

root / config / gr_set_md_cpu.m4 @ 8193fd8a

History | View | Annotate | Download (2.1 kB)

1 5d69a524 jcorgan
dnl
2 2c8ea58e eb
dnl Copyright 2003,2008 Free Software Foundation, Inc.
3 5d69a524 jcorgan
dnl 
4 5d69a524 jcorgan
dnl This file is part of GNU Radio
5 5d69a524 jcorgan
dnl 
6 5d69a524 jcorgan
dnl GNU Radio is free software; you can redistribute it and/or modify
7 5d69a524 jcorgan
dnl it under the terms of the GNU General Public License as published by
8 937b719d eb
dnl the Free Software Foundation; either version 3, or (at your option)
9 5d69a524 jcorgan
dnl any later version.
10 5d69a524 jcorgan
dnl 
11 5d69a524 jcorgan
dnl GNU Radio is distributed in the hope that it will be useful,
12 5d69a524 jcorgan
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 5d69a524 jcorgan
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 5d69a524 jcorgan
dnl GNU General Public License for more details.
15 5d69a524 jcorgan
dnl 
16 5d69a524 jcorgan
dnl You should have received a copy of the GNU General Public License
17 5d69a524 jcorgan
dnl along with GNU Radio; see the file COPYING.  If not, write to
18 86f5c924 eb
dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 86f5c924 eb
dnl Boston, MA 02110-1301, USA.
20 5d69a524 jcorgan
dnl 
21 5d69a524 jcorgan
22 a1d3c023 eb
AC_DEFUN([_TRY_ADD_ALTIVEC],
23 a1d3c023 eb
[
24 a1d3c023 eb
  LF_CHECK_CC_FLAG([-mabi=altivec -maltivec])
25 a1d3c023 eb
  LF_CHECK_CXX_FLAG([-mabi=altivec -maltivec])
26 a1d3c023 eb
])
27 a1d3c023 eb
28 5d69a524 jcorgan
AC_DEFUN([GR_SET_MD_CPU],[
29 5d69a524 jcorgan
  AC_REQUIRE([AC_CANONICAL_HOST])
30 5d69a524 jcorgan
  AC_ARG_WITH(md-cpu,
31 a1d3c023 eb
	AC_HELP_STRING([--with-md-cpu=ARCH],[set machine dependent speedups (auto)]),
32 5d69a524 jcorgan
		[cf_with_md_cpu="$withval"],
33 5d69a524 jcorgan
		[cf_with_md_cpu="$host_cpu"])
34 5d69a524 jcorgan
35 5d69a524 jcorgan
  case "$cf_with_md_cpu" in
36 2c8ea58e eb
   x86 | i[[3-7]]86)	MD_CPU=x86	MD_SUBCPU=x86 ;;
37 2c8ea58e eb
   x86_64)		MD_CPU=x86	MD_SUBCPU=x86_64 ;;
38 2c8ea58e eb
   powerpc*)            MD_CPU=powerpc ;;
39 2c8ea58e eb
   *)           	MD_CPU=generic ;;
40 5d69a524 jcorgan
  esac
41 a1d3c023 eb
42 a1d3c023 eb
  AC_ARG_ENABLE(altivec,
43 a1d3c023 eb
    AC_HELP_STRING([--enable-altivec],[enable altivec on PowerPC (yes)]),
44 a1d3c023 eb
    [ if test $MD_CPU = powerpc; then
45 a1d3c023 eb
        case "$enableval" in
46 a1d3c023 eb
          (no)  MD_CPU=generic ;;
47 a1d3c023 eb
          (yes) _TRY_ADD_ALTIVEC ;;
48 a1d3c023 eb
          (*) AC_MSG_ERROR([Invalid argument ($enableval) to --enable-altivec]) ;;
49 a1d3c023 eb
        esac
50 a1d3c023 eb
      fi],
51 a1d3c023 eb
    [ if test $MD_CPU = powerpc; then _TRY_ADD_ALTIVEC fi])
52 a1d3c023 eb
53 a1d3c023 eb
54 a1d3c023 eb
  AC_MSG_CHECKING([for machine dependent speedups])
55 5d69a524 jcorgan
  AC_MSG_RESULT($MD_CPU)
56 5d69a524 jcorgan
  AC_SUBST(MD_CPU)
57 5d69a524 jcorgan
  AC_SUBST(MD_SUBCPU) 
58 5d69a524 jcorgan
59 a1fa37f5 jcorgan
  AM_CONDITIONAL(MD_CPU_x86,     test "$MD_CPU" = "x86")
60 a1fa37f5 jcorgan
  AM_CONDITIONAL(MD_SUBCPU_x86_64,  test "$MD_SUBCPU" = "x86_64")
61 2c8ea58e eb
  AM_CONDITIONAL(MD_CPU_powerpc, test "$MD_CPU" = "powerpc")
62 a1fa37f5 jcorgan
  AM_CONDITIONAL(MD_CPU_generic, test "$MD_CPU" = "generic")
63 5d69a524 jcorgan
])