[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 04/09: Autoconf macro to detect GNUnet installations
From: |
gnunet |
Subject: |
[gnunet] 04/09: Autoconf macro to detect GNUnet installations |
Date: |
Fri, 17 Sep 2021 19:03:20 +0200 |
This is an automated email from the git hooks/post-receive script.
alessio-vanni pushed a commit to branch master
in repository gnunet.
commit 649d10b2756bda49694d380e82154a96dde98670
Author: Alessio Vanni <vannilla@firemail.cc>
AuthorDate: Tue Jul 27 16:27:14 2021 +0200
Autoconf macro to detect GNUnet installations
---
contrib/Makefile.am | 4 ++++
contrib/gnunet.m4 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index f42fb684d..150e47ff0 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -53,6 +53,7 @@ EXTRA_DIST = \
conf/gnunet/gnunet-user.conf \
conf/nss/nssswitch.conf \
conf/wireshark/wireshark.lua \
+ gnunet.m4 \
$(PACKAGES_FILES) \
$(INITD_FILES) \
Makefile.inc \
@@ -77,3 +78,6 @@ test_gnunet_prefix_LDADD = \
$(LTLIBICONV) \
$(GN_LIBINTL) \
$(LIBLTDL) -lunistring $(XLIB)
+
+aclocaldir = $(datadir)/aclocal
+aclocal_DATA = gnunet.m4
diff --git a/contrib/gnunet.m4 b/contrib/gnunet.m4
new file mode 100644
index 000000000..fe70fbde1
--- /dev/null
+++ b/contrib/gnunet.m4
@@ -0,0 +1,63 @@
+# Autoconf macro for working with GNUnet
+# This file is in the public domain.
+#
+# AM_PATH_GNUNET([MINIMUM-VERSION = 0.14.2, [ACTION-IF-FOUND,
[ACTION-IF-NOT-FOUND]]])
+# Find the GNUnet installation, either automatically or through the
+# --with-gnunet-prefix flag
+#
+# This macro runs the pkg-config and, if needed, the gnunet-config tool
+# provided by GNUnet itself.
+#
+# The gnunet-config tool can be overridden by setting the GNUNET_CONFIG
+# variable before executing the configure script.
+#
+# The variables GNUNET_CFLAGS and GNUNET_LIBS will be set to appropriate
+# values and are made available to Automake.
+AC_DEFUN([AM_PATH_GNUNET],
+[AC_ARG_WITH([gnunet-prefix],
+ [AS_HELP_STRING([--with-gnunet-prefix=PATH],
+ [PATH to the GNUnet installation])],
+ [gnunet_prefix="$withval"],
+ [gnunet_prefix=""])
+ AC_ARG_VAR([GNUNET_CONFIG],[The gnunet-config tool])
+ min_gnunet_version=m4_if([$1], ,0.14.2,$1)
+ # Make sure the specified version is at least the version with
+ # the features required to use this macro
+ AS_VERSION_COMPARE([$min_gnunet_version],[0.14.2],
+ [AC_MSG_WARN([The specified GNUnet version
$min_gnunet_version is too old.])
+ AC_MSG_WARN([The minimum version has been set to 0.14.2])
+ min_gnunet_version="0.14.2"])
+ AS_IF([test "x${GNUNET_CONFIG+set}" != "xset"],
+ [PKG_CHECK_MODULES([GNUNET],[gnunetutil >= $min_gnunet_version],
+ [gnunet_pkgconfig=yes],[gnunet_pkgconfig=no])
+ AS_IF([test "x$gnunet_pkgconfig" = "xno" && test "x$gnunet_prefix" !=
"x"],
+ [gnunet_PATH="$PATH"
+ AS_IF([test "x$prefix" != "xNONE"],
+
[gnunet_PATH="$prefix/bin${PATH_SEPARATOR}$prefix/usr/bin"])
+
AC_PATH_PROG([GNUNET_CONFIG],[gnunet-config],[no],[$gnunet_PATH])
+ AS_UNSET([gnunet_PATH])],
+ [GNUNET_CONFIG="pkg-config gnunetutil"])])
+ AC_MSG_CHECKING([if GNUnet version is >= $min_gnunet_version])
+ gnunet_result=no
+ AS_IF([test "x$GNUNET_CONFIG" != "xno" && test -n "$GNUNET_CONFIG"],
+ [gnunet_version=`$GNUNET_CONFIG --version | tr ' ' '\n' | sed -n '2p'`
+ AS_VERSION_COMPARE([$gnunet_version],[$min_gnunet_version],
+ [gnunet_result=no],
+ [gnunet_result=yes],
+ [gnunet_result=yes])
+ AS_UNSET([gnunet_version])])
+ AS_IF([test "x$gnunet_result" != "xyes"],
+ [AC_MSG_RESULT([no])
+ m4_if([$3], ,:,[$3])],
+ [AC_MSG_RESULT([yes])
+ m4_if([$2], ,:,[$2])
+ AC_CHECK_HEADERS([sys/socket.h netinet/in.h byteswap.h])
+ AS_IF([test "x${GNUNET_CFLAGS+set}" != "xset"],
+ [GNUNET_CFLAGS=`$GNUNET_CONFIG --cflags`
+ AC_SUBST([GNUNET_CFLAGS])])
+ AS_IF([test "x${GNUNET_LIBS+set}" != "xset"],
+ [GNUNET_LIBS=`$GNUNET_CONFIG --libs`
+ AC_SUBST([GNUNET_LIBS])])])
+ AS_UNSET([gnunet_result])
+ AS_UNSET([min_gnunet_version])
+])
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (5df20a349 -> ad9c10e6e), gnunet, 2021/09/17
- [gnunet] 07/09: -indentation, gnunet, 2021/09/17
- [gnunet] 03/09: - Do not hardcode values in gnunet-config, gnunet, 2021/09/17
- [gnunet] 04/09: Autoconf macro to detect GNUnet installations,
gnunet <=
- [gnunet] 05/09: gnunet.m4: add flag to disable debug messages, gnunet, 2021/09/17
- [gnunet] 01/09: 5708: allow gnunet-config to output build config informations, gnunet, 2021/09/17
- [gnunet] 06/09: -Merge branch 'master' into dev/vanni/build-info, gnunet, 2021/09/17
- [gnunet] 08/09: -set return value following the current API, gnunet, 2021/09/17
- [gnunet] 09/09: Merge branch 'dev/vanni/build-info' into 'master', gnunet, 2021/09/17
- [gnunet] 02/09: gnunet-config manpage: Document the new flags, gnunet, 2021/09/17