summaryrefslogtreecommitdiffabout
path: root/src/libgrecs.m4
blob: 774c1a0dfeda65a51665f3a23afec2e5904cc973 (plain)
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
# libgrecs.m4 serial 1
dnl This file is part of Grecs
dnl Copyright (C) 2007-2016 Sergey Poznyakoff
dnl
dnl Grecs is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl Grecs is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with Grecs.  If not, see <http://www.gnu.org/licenses/>.

dnl AM_LIBGRECS([minversion],[if-found],[if-notfound])
AC_DEFUN([AM_LIBGRECS],[
 cv_libgrecs=no
 save_LIBS=$LIBS
 AC_CHECK_LIB([grecs],[grecs_parse],
   [AC_CHECK_HEADER([grecs.h], [cv_libgrecs=yes])])
 if test "$cv_libgrecs" = "yes"; then
   LIBS="$save_LIBS -lgrecs"
   m4_if($1,,,[
     AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
       #include <grecs.h>
       ]],
       [exit(grecs_version_ok("[libgrecs ]$1"));])],
       [],
       [cv_libgrecs=no])])
   if test "$cv_libgrecs" = "yes"; then
     m4_if($2,,[
       AC_DEFINE([HAVE_GRECS_H],[1],
                 [Define if <grecs.h> is available])
       AC_DEFINE([HAVE_LIBGRECS],[1],
                 [Define if libgrecs is available])
       save_LIBS=$LIBS
      ],[
       $2])
    else
     m4_if($3,,:,[$3])
    fi
    LIBS=$save_LIBS
  fi
  ])

Return to:

Send suggestions and report system problems to the System administrator.