diff options
Diffstat (limited to 'src/util/gnunet-config.c')
-rw-r--r-- | src/util/gnunet-config.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 3932ff1bf..0a5c0712b 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -74,6 +74,21 @@ static int rewrite; | |||
74 | */ | 74 | */ |
75 | static int full; | 75 | static int full; |
76 | 76 | ||
77 | /** | ||
78 | * If printing the value of CFLAGS has been requested. | ||
79 | */ | ||
80 | static int cflags; | ||
81 | |||
82 | /** | ||
83 | * If printing the value of LIBS has been requested. | ||
84 | */ | ||
85 | static int libs; | ||
86 | |||
87 | /** | ||
88 | * If printing the value of PREFIX has been requested. | ||
89 | */ | ||
90 | static int prefix; | ||
91 | |||
77 | 92 | ||
78 | /** | 93 | /** |
79 | * Print each option in a given section. | 94 | * Print each option in a given section. |
@@ -150,6 +165,23 @@ run (void *cls, | |||
150 | 165 | ||
151 | (void) cls; | 166 | (void) cls; |
152 | (void) args; | 167 | (void) args; |
168 | if (1 == cflags || 1 == libs || 1 == prefix) | ||
169 | { | ||
170 | /* These values are defined in the makefile */ | ||
171 | if (1 == cflags) | ||
172 | { | ||
173 | fprintf (stdout, "%s\n", "-I"INCLUDEDIR); | ||
174 | } | ||
175 | if (1 == libs) | ||
176 | { | ||
177 | fprintf (stdout, "%s\n", "-L"LIBDIR" -lgnunetutil"); | ||
178 | } | ||
179 | if (1 == prefix) | ||
180 | { | ||
181 | fprintf (stdout, "%s\n", PREFIX); | ||
182 | } | ||
183 | return; | ||
184 | } | ||
153 | if (NULL != backend_check) | 185 | if (NULL != backend_check) |
154 | { | 186 | { |
155 | char *name; | 187 | char *name; |
@@ -364,6 +396,21 @@ main (int argc, char *const *argv) | |||
364 | "VALUE", | 396 | "VALUE", |
365 | gettext_noop ("value to set"), | 397 | gettext_noop ("value to set"), |
366 | &value), | 398 | &value), |
399 | GNUNET_GETOPT_option_flag ('C', | ||
400 | "cflags", | ||
401 | gettext_noop ( | ||
402 | "Provide an appropriate value for CFLAGS to applications building on top of GNUnet"), | ||
403 | &cflags), | ||
404 | GNUNET_GETOPT_option_flag ('j', | ||
405 | "libs", | ||
406 | gettext_noop ( | ||
407 | "Provide an appropriate value for LIBS to applications building on top of GNUnet"), | ||
408 | &libs), | ||
409 | GNUNET_GETOPT_option_flag ('p', | ||
410 | "prefix", | ||
411 | gettext_noop ( | ||
412 | "Provide the path under which GNUnet was installed"), | ||
413 | &prefix), | ||
367 | GNUNET_GETOPT_OPTION_END | 414 | GNUNET_GETOPT_OPTION_END |
368 | }; | 415 | }; |
369 | int ret; | 416 | int ret; |