aboutsummaryrefslogtreecommitdiff
path: root/src/libargot.m4
blob: 3fd51f9c76c4b832563a63d9d69b53aca858ef5e (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
# libargot.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_LIBARGOT([minversion],[if-found],[if-notfound])
AC_DEFUN([AM_LIBARGOT],[
 cv_libargot=no
 save_LIBS=$LIBS
 AC_CHECK_LIB([argot],[argot_parse],
   [AC_CHECK_HEADER([argot.h], [cv_libargot=yes])])
 if test "$cv_libargot" = "yes"; then
   LIBS="$save_LIBS -largot"
   m4_if($1,,,[
     AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
       #include <argot.h>
       ]],
       [exit(argot_version_ok("[libargot ]$1"));])],
       [],
       [cv_libargot=no])])
   if test "$cv_libargot" = "yes"; then
     m4_if($2,,[
       AC_DEFINE([HAVE_ARGOT_H],[1],
                 [Define if <argot.h> is available])
       AC_DEFINE([HAVE_LIBARGOT],[1],
                 [Define if libargot 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.