diff options
Diffstat (limited to 'src/libargot.m4')
-rw-r--r-- | src/libargot.m4 | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/libargot.m4 b/src/libargot.m4 new file mode 100644 index 0000000..3fd51f9 --- /dev/null +++ b/src/libargot.m4 @@ -0,0 +1,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 + ]) |