1 | ## $Id: yat_gsl.m4 2016 2009-08-02 14:22:09Z peter $ |
---|
2 | |
---|
3 | # Copyright (C) 2009 Peter Johansson |
---|
4 | # |
---|
5 | # This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
6 | # |
---|
7 | # The yat library is free software; you can redistribute it and/or |
---|
8 | # modify it under the terms of the GNU General Public License as |
---|
9 | # published by the Free Software Foundation; either version 3 of the |
---|
10 | # License, or (at your option) any later version. |
---|
11 | # |
---|
12 | # The yat library is distributed in the hope that it will be useful, |
---|
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 | # General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License |
---|
18 | # along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | |
---|
21 | # |
---|
22 | # serial 1 |
---|
23 | # |
---|
24 | # see http://www.gnu.org/software/automake/manual/automake.html#Serials |
---|
25 | |
---|
26 | |
---|
27 | # |
---|
28 | # |
---|
29 | # |
---|
30 | AC_DEFUN([YAT_CHECK_GSL], |
---|
31 | [ |
---|
32 | yat_gsl_status="ok" |
---|
33 | AX_PATH_GSL([$1],,[yat_gsl_status="no"]) |
---|
34 | |
---|
35 | AS_IF([test "x$yat_gsl_status" = "xok"], |
---|
36 | [YAT_CHECK_GSL_HEADER([gsl/gsl_version.h],, |
---|
37 | [yat_gsl_status="no-header"]) |
---|
38 | ]) |
---|
39 | |
---|
40 | AS_IF([test "x$yat_gsl_status" = "xok"], |
---|
41 | [# grep words startinging with '-L' in other words LDFLAGS |
---|
42 | for i in $GSL_LIBS; do |
---|
43 | AS_IF([test ${i:0:2} = "-L"], |
---|
44 | [YAT_LD_ADD_FLAG([LDFLAGS], [$i])]) |
---|
45 | done |
---|
46 | ]) |
---|
47 | |
---|
48 | AS_IF([test "x$yat_gsl_status" = "xok"], |
---|
49 | [m4_default([$2], [:])], |
---|
50 | [m4_default([$3], [:])]) |
---|
51 | |
---|
52 | |
---|
53 | ]) # YAT_CHECK_GSL |
---|
54 | |
---|
55 | AC_DEFUN([YAT_CHECK_GSL_HEADER], |
---|
56 | [ |
---|
57 | save_CPPFLAGS=$CPPFLAGS |
---|
58 | YAT_CPP_ADD_FLAG([CPPFLAGS],[`$GSL_CONFIG --cflags`]) |
---|
59 | AC_CHECK_HEADER([$1], [$2], [$3]) |
---|
60 | ]) # YAT_CHECK_GSL_HEADER |
---|