aboutsummaryrefslogtreecommitdiff
path: root/src/libgrecs.m4
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgrecs.m4')
-rw-r--r--src/libgrecs.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/src/libgrecs.m4 b/src/libgrecs.m4
new file mode 100644
index 0000000..88ce312
--- /dev/null
+++ b/src/libgrecs.m4
@@ -0,0 +1,47 @@
1# libgrecs.m4 serial 1
2dnl This file is part of Grecs
3dnl Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
4dnl
5dnl Grecs is free software; you can redistribute it and/or modify
6dnl it under the terms of the GNU General Public License as published by
7dnl the Free Software Foundation; either version 3, or (at your option)
8dnl any later version.
9dnl
10dnl Grecs is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13dnl GNU General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU General Public License
16dnl along with Grecs. If not, see <http://www.gnu.org/licenses/>.
17
18dnl AM_LIBGRECS([minversion],[if-found],[if-notfound])
19AC_DEFUN([AM_LIBGRECS],[
20 cv_libgrecs=no
21 save_LIBS=$LIBS
22 AC_CHECK_LIB([grecs],[grecs_parse],
23 [AC_CHECK_HEADER([grecs.h], [cv_libgrecs=yes])])
24 if test "$cv_libgrecs" = "yes"; then
25 LIBS="$save_LIBS -lgrecs"
26 m4_if($1,,,[
27 AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
28 #include <grecs.h>
29 ]],
30 [exit(grecs_version_cmp("[libgrecs ]$1"));])],
31 [],
32 [cv_libgrecs=no])])
33 if test "$cv_libgrecs" = "yes"; then
34 m4_if($2,,[
35 AC_DEFINE([HAVE_GRECS_H],[1],
36 [Define if <grecs.h> is available])
37 AC_DEFINE([HAVE_LIBGRECS],[1],
38 [Define if libgrecs is available])
39 save_LIBS=$LIBS
40 ],[
41 $2])
42 else
43 m4_if($3,,:,[$3])
44 fi
45 LIBS=$save_LIBS
46 fi
47 ])

Return to:

Send suggestions and report system problems to the System administrator.