aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2021-07-25 15:00:51 +0200
committerAlessio Vanni <vannilla@firemail.cc>2021-07-25 15:00:51 +0200
commitb474cdc0baffa55b700008d55cded7f11126a063 (patch)
treea134853aad8e690df3d52e25b88f02347cf7189c
parent9bdfda437e180ee9fe6d1e54b201c538086d2c48 (diff)
downloadgnunet-b474cdc0baffa55b700008d55cded7f11126a063.tar.gz
gnunet-b474cdc0baffa55b700008d55cded7f11126a063.zip
- Do not hardcode values in gnunet-config
-rw-r--r--src/util/Makefile.am5
-rw-r--r--src/util/gnunet-config.c11
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 = \
227gnunet_config_LDADD = \ 227gnunet_config_LDADD = \
228 libgnunetutil.la \ 228 libgnunetutil.la \
229 $(GN_LIBINTL) 229 $(GN_LIBINTL)
230gnunet_config_CPPFLAGS = \
231 -DINCLUDEDIR=\"$(includedir)\" \
232 -DLIBDIR=\"$(libdir)\" \
233 -DPREFIX=\"$(prefix)\" \
234 $(AM_CPPFLAGS)
235 230
236gnunet_uri_SOURCES = \ 231gnunet_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)