donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

mhd.m4 (1653B)


      1 # mhd.m4
      2 
      3 #  This file is part of TALER
      4 #  Copyright (C) 2022 Taler Systems SA
      5 #
      6 #  TALER is free software; you can redistribute it and/or modify it under the
      7 #  terms of the GNU General Public License as published by the Free Software
      8 #  Foundation; either version 3, or (at your option) any later version.
      9 #
     10 #  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     11 #  WARRANTY; without even the implied warranty of CHARITYABILITY or FITNESS FOR
     12 #  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     13 #
     14 #  You should have received a copy of the GNU General Public License along with
     15 #  TALER; see the file COPYING.  If not, If not, see <http://www.gnu.org/license>
     16 
     17 # serial 1
     18 
     19 dnl MHD_VERSION_AT_LEAST([VERSION])
     20 dnl
     21 dnl Check that microhttpd.h can be used to build a program that prints out
     22 dnl the MHD_VERSION tuple in X.Y.Z format, and that X.Y.Z is greater or equal
     23 dnl to VERSION.  If not, display message and cause the configure script to
     24 dnl exit failurefully.
     25 dnl
     26 dnl This uses AX_COMPARE_VERSION to do the job.
     27 dnl It sets shell var mhd_cv_version, as well.
     28 dnl
     29 AC_DEFUN([MHD_VERSION_AT_LEAST],
     30 [AC_CACHE_CHECK([libmicrohttpd version],[mhd_cv_version],
     31  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
     32   #include <stdio.h>
     33   #include <microhttpd.h>
     34 ]],[[
     35   int v = MHD_VERSION;
     36   printf ("%x.%x.%x\n",
     37           (v >> 24) & 0xff,
     38           (v >> 16) & 0xff,
     39           (v >>  8) & 0xff);
     40 ]])],
     41   [mhd_cv_version=$(./conftest)],
     42   [mhd_cv_version=0])])
     43 AX_COMPARE_VERSION([$mhd_cv_version],[ge],[$1],,
     44   [AC_MSG_ERROR([[
     45 ***
     46 *** You need libmicrohttpd >= $1 to build this program.
     47 *** ]])])])
     48 
     49 # mhd.m4 ends here