diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2021-07-25 15:00:51 +0200 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2021-07-25 15:00:51 +0200 |
commit | b474cdc0baffa55b700008d55cded7f11126a063 (patch) | |
tree | a134853aad8e690df3d52e25b88f02347cf7189c | |
parent | 9bdfda437e180ee9fe6d1e54b201c538086d2c48 (diff) | |
download | gnunet-b474cdc0baffa55b700008d55cded7f11126a063.tar.gz gnunet-b474cdc0baffa55b700008d55cded7f11126a063.zip |
- Do not hardcode values in gnunet-config
-rw-r--r-- | src/util/Makefile.am | 5 | ||||
-rw-r--r-- | src/util/gnunet-config.c | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am index ab66756b4..e720112be 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am | |||
@@ -227,11 +227,6 @@ gnunet_config_SOURCES = \ | |||
227 | gnunet_config_LDADD = \ | 227 | gnunet_config_LDADD = \ |
228 | libgnunetutil.la \ | 228 | libgnunetutil.la \ |
229 | $(GN_LIBINTL) | 229 | $(GN_LIBINTL) |
230 | gnunet_config_CPPFLAGS = \ | ||
231 | -DINCLUDEDIR=\"$(includedir)\" \ | ||
232 | -DLIBDIR=\"$(libdir)\" \ | ||
233 | -DPREFIX=\"$(prefix)\" \ | ||
234 | $(AM_CPPFLAGS) | ||
235 | 230 | ||
236 | gnunet_uri_SOURCES = \ | 231 | gnunet_uri_SOURCES = \ |
237 | gnunet-uri.c | 232 | gnunet-uri.c |
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 0a5c0712b..11682daea 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -167,19 +167,22 @@ run (void *cls, | |||
167 | (void) args; | 167 | (void) args; |
168 | if (1 == cflags || 1 == libs || 1 == prefix) | 168 | if (1 == cflags || 1 == libs || 1 == prefix) |
169 | { | 169 | { |
170 | /* These values are defined in the makefile */ | 170 | char *prefixdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX); |
171 | char *libdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR); | ||
171 | if (1 == cflags) | 172 | if (1 == cflags) |
172 | { | 173 | { |
173 | fprintf (stdout, "%s\n", "-I"INCLUDEDIR); | 174 | fprintf (stdout, "-I%sinclude\n", prefixdir); |
174 | } | 175 | } |
175 | if (1 == libs) | 176 | if (1 == libs) |
176 | { | 177 | { |
177 | fprintf (stdout, "%s\n", "-L"LIBDIR" -lgnunetutil"); | 178 | fprintf (stdout, "-L%s -lgnunetutil\n", libdir); |
178 | } | 179 | } |
179 | if (1 == prefix) | 180 | if (1 == prefix) |
180 | { | 181 | { |
181 | fprintf (stdout, "%s\n", PREFIX); | 182 | fprintf (stdout, "%s\n", prefixdir); |
182 | } | 183 | } |
184 | GNUNET_free (prefixdir); | ||
185 | GNUNET_free (libdir); | ||
183 | return; | 186 | return; |
184 | } | 187 | } |
185 | if (NULL != backend_check) | 188 | if (NULL != backend_check) |