aboutsummaryrefslogtreecommitdiff
path: root/m4/check-libheader.m4
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2021-11-11 00:56:30 +0100
committerAlessio Vanni <vannilla@firemail.cc>2021-11-21 18:42:34 +0100
commit20ffa0aa543853fb0d395167fb0a090c0e369db0 (patch)
tree0f6b0ae7414790cf6fc525c8b8e62446e37efc6d /m4/check-libheader.m4
parentd744d49e13fa6175016e8dcfc0f9506b9f170759 (diff)
downloadgnunet-20ffa0aa543853fb0d395167fb0a090c0e369db0.tar.gz
gnunet-20ffa0aa543853fb0d395167fb0a090c0e369db0.zip
Update configure.ac and a few macros used by it
The changes done to configure.ac are essentially divided in two categories: the first is made of changes to improve existing checks, even if it's merely in the message being printed during the check; the second category is made of updates aimed at bringing this file closer to Autoconf 2.71, which deprecated or even removed some stuff that was otherwise present either directly in configure.ac or in one of the macros it includes, which have been updated in this commit too. Actually, the generated configure script was created by Autoconf 2.71 during deveopment, so in a way it's already compatible with the latest version.
Diffstat (limited to 'm4/check-libheader.m4')
-rw-r--r--m4/check-libheader.m435
1 files changed, 12 insertions, 23 deletions
diff --git a/m4/check-libheader.m4 b/m4/check-libheader.m4
index 1e24d8a97..4e0285336 100644
--- a/m4/check-libheader.m4
+++ b/m4/check-libheader.m4
@@ -11,30 +11,19 @@ dnl HEADER-NAME - header file name as in AC_CHECK_HEADER
11dnl ACTION-IF-FOUND - when feature is found then execute given action 11dnl ACTION-IF-FOUND - when feature is found then execute given action
12dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action 12dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
13dnl EXTRA-LDFLAGS - extra linker flags (-L or -l) 13dnl EXTRA-LDFLAGS - extra linker flags (-L or -l)
14dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include 14dnl EXTRA-CPPFLAGS - extra C preprocessor flags, e.g. -I/usr/X11R6/include
15dnl 15dnl
16dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1.
17dnl 16dnl
18AC_DEFUN([CHECK_LIBHEADER], 17AC_DEFUN([CHECK_LIBHEADER],
19[ 18[m4_if([$7], ,:,[LDFLAGS="$7 $LDFLAGS"])
20 AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7]) 19 m4_if([$8], ,:,[CPPFLAGS="$8 $CPPFLAGS"])
21 check_libheader_feature_name=translit([$1], A-Z, a-z)
22
23 if test "x$HAVE_[$1]" = "xyes"; then
24 check_libheader_save_CPPFLAGS=$CPPFLAGS
25 CPPFLAGS="[$8] $CPPFLAGS"
26 AC_CHECK_HEADER([$4], :, HAVE_[$1]=no)
27 CPPFLAGS=$check_libheader_save_CPPFLAGS
28 fi
29
30 if test "x$HAVE_[$1]" = "xyes"; then
31 ifelse([$5], , :, [$5])
32 AC_MSG_NOTICE($check_libheader_feature_name was found)
33 else
34 ifelse([$6], , :, [$6])
35 AC_MSG_WARN($check_libheader_feature_name not found)
36 fi
37 AC_SUBST(HAVE_[$1])
38]
39)
40 20
21 AC_CHECK_HEADERS([$4],
22 [AC_CHECK_LIB([$2], [$3],
23 [eval "HAVE_]AS_TR_SH([$1])[=yes"]
24 m4_if([$5], ,:,[$5]),
25 [eval "HAVE_]AS_TR_SH([$1])[=no"]
26 m4_if([$6], ,:,[$6]))],
27 [eval "HAVE_]AS_TR_SH([$1])[=no"]
28 m4_if([$6], ,:,[$6]))
29])dnl