mhd2.m4 (1833B)
1 # mhd2.m4 2 3 # This file is part of GNU libmicrohttpd 4 # Copyright (C) 2025 Taler Systems SA 5 # 6 # GNU libmicrohttpd is free software; you can redistribute it and/or modify it under the 7 # terms of the GNU Lesser General Public License as published by the Free Software 8 # Foundation; either version 3, or (at your option) any later version. 9 # 10 # GNU libmicrohttpd is distributed in the hope that it will be useful, but WITHOUT ANY 11 # WARRANTY; without even the implied warranty of MERCHANTABILITY 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 Lesser General Public License along with 15 # GNU libmicrohttpd; see the file COPYING. If not, If not, see <http://www.gnu.org/license> 16 17 # serial 1 18 19 dnl MHD2_VERSION_AT_LEAST([VERSION]) 20 dnl 21 dnl Check that microhttpd2.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([MHD2_VERSION_AT_LEAST], 30 [AC_CACHE_CHECK([libmicrohttpd2 version],[mhd2_cv_version], 31 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 32 #include <stdio.h> 33 #include <microhttpd2.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 [mhd2_cv_version=$(./conftest)], 42 [mhd2_cv_version=0])]) 43 AX_COMPARE_VERSION([$mhd2_cv_version],[ge],[$1], 44 [libmhd2=1], 45 [libmhd2=0]) 46 AM_CONDITIONAL([HAVE_MHD2], [test "x$libmhd2" = "x1"]) 47 AC_DEFINE_UNQUOTED([HAVE_MHD2], [$libmhd2], 48 [Defined to 1 if libmicrohttpd2 is available]) 49 ]) 50 # mhd2.m4 ends here