aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-09-29 14:06:42 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-09-29 14:06:42 +0900
commitc31abdb6dc1b6da4c23b203ffb96db0aa5646915 (patch)
treee6e2782e6acd7b07d7fa40d1fabfedf25ad42c1a
parentf7a9e4199e1f036811765f7ca855a513117a1997 (diff)
downloadgnunet-c31abdb6dc1b6da4c23b203ffb96db0aa5646915.tar.gz
gnunet-c31abdb6dc1b6da4c23b203ffb96db0aa5646915.zip
UTIL: gnunet-config can now print experimental status. Issue #5708
-rw-r--r--configure.ac8
-rw-r--r--src/util/gnunet-config.c19
2 files changed, 24 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c6e580c8b..1941c01a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1182,6 +1182,8 @@ AC_ARG_ENABLE([experimental],
1182 [enable_experimental=1])], 1182 [enable_experimental=1])],
1183 [enable_experimental=0]) 1183 [enable_experimental=0])
1184AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "x1"]) 1184AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "x1"])
1185AS_IF([test "x$enable_experimental" = "x1"],
1186 AC_DEFINE([GNUNET_EXPERIMENTAL], 1, [Set to 1 is this is an experimental build]))
1185 1187
1186# check if malicious code should be compiled (for testing) 1188# check if malicious code should be compiled (for testing)
1187AC_ARG_ENABLE([malicious], 1189AC_ARG_ENABLE([malicious],
@@ -1501,8 +1503,8 @@ AS_IF([test "x$png" = "x1"],
1501 [libpng_msg="no"]) 1503 [libpng_msg="no"])
1502 1504
1503AS_IF([test "x$curl_gnutls" = "x0"], 1505AS_IF([test "x$curl_gnutls" = "x0"],
1504 [http_client="curl (OpenSSL)"], 1506 [curl_tls_backend="OpenSSL"],
1505 [http_client="curl (GnuTLS)"]) 1507 [curl_tls_backend="GnuTLS"])
1506 1508
1507# ifconfig 1509# ifconfig
1508AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"], 1510AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"],
@@ -1581,7 +1583,7 @@ sqlite3: ${sqlite_msg}
1581MySQL: ${mysql_msg} 1583MySQL: ${mysql_msg}
1582PostgreSQL: ${postgres_msg} 1584PostgreSQL: ${postgres_msg}
1583 1585
1584HTTP Client: ${http_client} 1586cURL TLS backend: ${curl_tls_backend}
1585Bluetooth: ${bluetooth_msg} 1587Bluetooth: ${bluetooth_msg}
1586iptables: ${iptables_msg} 1588iptables: ${iptables_msg}
1587ifconfig: ${ifconfig_msg} 1589ifconfig: ${ifconfig_msg}
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 2ca78577e..7fda209da 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -40,6 +40,11 @@ static char *backend_check;
40 */ 40 */
41static int cflags; 41static int cflags;
42 42
43/**
44 * Check if this is an experimental build
45 */
46static int is_experimental;
47
43 48
44/** 49/**
45 * If printing the value of LIBS has been requested. 50 * If printing the value of LIBS has been requested.
@@ -73,6 +78,15 @@ run (void *cls,
73{ 78{
74 struct GNUNET_CONFIGURATION_ConfigSettings *cs = cls; 79 struct GNUNET_CONFIGURATION_ConfigSettings *cs = cls;
75 80
81 if (1 == is_experimental)
82 {
83#ifdef GNUNET_EXPERIMENTAL
84 cs->global_ret = 0;
85#else
86 cs->global_ret = 1;
87#endif
88 return;
89 }
76 if (1 == cflags || 1 == libs || 1 == prefix) 90 if (1 == cflags || 1 == libs || 1 == prefix)
77 { 91 {
78 char *prefixdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX); 92 char *prefixdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX);
@@ -145,6 +159,11 @@ main (int argc,
145 "Provide an appropriate value for CFLAGS to applications building on top of GNUnet"), 159 "Provide an appropriate value for CFLAGS to applications building on top of GNUnet"),
146 &cflags), 160 &cflags),
147 GNUNET_GETOPT_option_flag ( 161 GNUNET_GETOPT_option_flag (
162 'E',
163 "is-experimental",
164 gettext_noop ("Is this an experimental build of GNUnet"),
165 &is_experimental),
166 GNUNET_GETOPT_option_flag (
148 'j', 167 'j',
149 "libs", 168 "libs",
150 gettext_noop ( 169 gettext_noop (