diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2021-09-17 18:59:13 +0200 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2021-09-17 18:59:13 +0200 |
commit | ad9c10e6e660c45c8da630a7ea0f8c013a6661e2 (patch) | |
tree | 454a5c1f86bffe60308bcf8ceb309a8388fc50b1 /src | |
parent | 5df20a349cabc2ebd3747292be97239fdf837386 (diff) | |
parent | c7ed99ce83e15bab7fc7240a77da703d98a06edd (diff) | |
download | gnunet-ad9c10e6e660c45c8da630a7ea0f8c013a6661e2.tar.gz gnunet-ad9c10e6e660c45c8da630a7ea0f8c013a6661e2.zip |
Merge branch 'dev/vanni/build-info' into 'master'
Diffstat (limited to 'src')
-rw-r--r-- | src/util/gnunet-config.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 797de0b0d..2ca78577e 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -36,6 +36,25 @@ static char *backend_check; | |||
36 | 36 | ||
37 | 37 | ||
38 | /** | 38 | /** |
39 | * If printing the value of CFLAGS has been requested. | ||
40 | */ | ||
41 | static int cflags; | ||
42 | |||
43 | |||
44 | /** | ||
45 | * If printing the value of LIBS has been requested. | ||
46 | */ | ||
47 | static int libs; | ||
48 | |||
49 | |||
50 | /** | ||
51 | * If printing the value of PREFIX has been requested. | ||
52 | */ | ||
53 | static int prefix; | ||
54 | |||
55 | |||
56 | /** | ||
57 | * Print each option in a given section. | ||
39 | * Main task to run to perform operations typical for | 58 | * Main task to run to perform operations typical for |
40 | * gnunet-config as per the configuration settings | 59 | * gnunet-config as per the configuration settings |
41 | * given in @a cls. | 60 | * given in @a cls. |
@@ -54,6 +73,28 @@ run (void *cls, | |||
54 | { | 73 | { |
55 | struct GNUNET_CONFIGURATION_ConfigSettings *cs = cls; | 74 | struct GNUNET_CONFIGURATION_ConfigSettings *cs = cls; |
56 | 75 | ||
76 | if (1 == cflags || 1 == libs || 1 == prefix) | ||
77 | { | ||
78 | char *prefixdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX); | ||
79 | char *libdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR); | ||
80 | |||
81 | if (1 == cflags) | ||
82 | { | ||
83 | fprintf (stdout, "-I%sinclude\n", prefixdir); | ||
84 | } | ||
85 | if (1 == libs) | ||
86 | { | ||
87 | fprintf (stdout, "-L%s -lgnunetutil\n", libdir); | ||
88 | } | ||
89 | if (1 == prefix) | ||
90 | { | ||
91 | fprintf (stdout, "%s\n", prefixdir); | ||
92 | } | ||
93 | cs->global_ret = 0; | ||
94 | GNUNET_free (prefixdir); | ||
95 | GNUNET_free (libdir); | ||
96 | return; | ||
97 | } | ||
57 | if (NULL != backend_check) | 98 | if (NULL != backend_check) |
58 | { | 99 | { |
59 | char *name; | 100 | char *name; |
@@ -97,6 +138,24 @@ main (int argc, | |||
97 | gettext_noop ( | 138 | gettext_noop ( |
98 | "test if the current installation supports the specified BACKEND"), | 139 | "test if the current installation supports the specified BACKEND"), |
99 | &backend_check)), | 140 | &backend_check)), |
141 | GNUNET_GETOPT_option_flag ( | ||
142 | 'C', | ||
143 | "cflags", | ||
144 | gettext_noop ( | ||
145 | "Provide an appropriate value for CFLAGS to applications building on top of GNUnet"), | ||
146 | &cflags), | ||
147 | GNUNET_GETOPT_option_flag ( | ||
148 | 'j', | ||
149 | "libs", | ||
150 | gettext_noop ( | ||
151 | "Provide an appropriate value for LIBS to applications building on top of GNUnet"), | ||
152 | &libs), | ||
153 | GNUNET_GETOPT_option_flag ( | ||
154 | 'p', | ||
155 | "prefix", | ||
156 | gettext_noop ( | ||
157 | "Provide the path under which GNUnet was installed"), | ||
158 | &prefix), | ||
100 | GNUNET_CONFIGURATION_CONFIG_OPTIONS (&cs), | 159 | GNUNET_CONFIGURATION_CONFIG_OPTIONS (&cs), |
101 | GNUNET_GETOPT_OPTION_END | 160 | GNUNET_GETOPT_OPTION_END |
102 | }; | 161 | }; |