1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
dnl
dnl Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
dnl Copyright (C) INRIA - 2008 - Sylvestre Ledru
dnl
dnl This file must be used under the terms of the CeCILL.
dnl This source file is licensed as described in the file COPYING, which
dnl you should have received as part of this distribution. The terms
dnl are also available at
dnl http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
dnl
dnl AC_FFTW
dnl ------------------------------------------------------
dnl Check if FFTW is usable and working
dnl
AC_DEFUN([AC_FFTW], [
AC_ARG_WITH(fftw_include,
AC_HELP_STRING([--with-fftw-include=DIR],[Set the path to the FFTW headers]),
[with_fftw_include=$withval],
[with_fftw_include='yes']
)
AC_ARG_WITH(fftw_library,
AC_HELP_STRING([--with-fftw-library=DIR],[Set the path to the FFTW libraries]),
[with_fftw_library=$withval],
[with_fftw_library='yes']
)
if test "x$with_fftw_include" != "xyes"; then
save_CFLAGS="$CFLAGS"
CFLAGS="-I$with_fftw_include"
AC_CHECK_HEADER([fftw3.h],
[FFTW3_CFLAGS="$CFLAGS"],
[AC_MSG_ERROR([Cannot find headers (fftw3.h) of the library FFTW in $with_fftw_include. Please install the dev package (Debian : libfftw3-dev)])]
)
CFLAGS="$save_CFLAGS"
else
if $WITH_DEVTOOLS; then # Scilab thirdparties
FFTW3_CFLAGS="-I$DEVTOOLS_INCDIR"
else
AC_CHECK_HEADER([fftw3.h],
[FFTW3_CFLAGS=""],
[AC_MSG_ERROR([Cannot find headers (fftw3.h) of the library fftw. Please install the dev package (Debian : libfftw3-dev)])])
fi
fi
# --with-fftw-library set then check in this dir
if test "x$with_fftw_library" != "xyes"; then
save_LIBS="$LIBS"
LIBS="-L$with_fftw_library -lfftw3"
AC_CHECK_LIB([fftw3], [fftw_plan_dft_r2c],
[FFTW3_LIB="-L$with_fftw_library -lfftw3"],
[AC_MSG_ERROR([libfftw3 : library missing. (Cannot find symbol fftw_plan_dft_r2c) in $with_fftw_library. Check if libfftw3 is installed and if the version is correct])]
)
LIBS="$save_LIBS"
else
save_LIBS="$LIBS"
if $WITH_DEVTOOLS; then # Scilab thirdparties
FFTW3_LIB="-L$DEVTOOLS_LIBDIR -lfftw3"
else
AC_CHECK_LIB([fftw3], [fftw_plan_dft_r2c],
[FFTW3_LIB="-lfftw3"],
[AC_MSG_ERROR([libfftw3 : library missing. (Cannot find symbol fftw_plan_dft_r2c). Check if libfftw3 is installed and if the version is correct])]
)
fi
LIBS="$save_LIBS"
fi
AC_SUBST(FFTW3_LIB)
AC_DEFINE([WITH_FFTW], [], [With the FFTW library])
])
|