[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 03/09: - Do not hardcode values in gnunet-config
From: |
gnunet |
Subject: |
[gnunet] 03/09: - Do not hardcode values in gnunet-config |
Date: |
Fri, 17 Sep 2021 19:03:19 +0200 |
This is an automated email from the git hooks/post-receive script.
alessio-vanni pushed a commit to branch master
in repository gnunet.
commit b474cdc0baffa55b700008d55cded7f11126a063
Author: Alessio Vanni <vannilla@firemail.cc>
AuthorDate: Sun Jul 25 15:00:51 2021 +0200
- Do not hardcode values in gnunet-config
---
src/util/Makefile.am | 5 -----
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 = \
gnunet_config_LDADD = \
libgnunetutil.la \
$(GN_LIBINTL)
-gnunet_config_CPPFLAGS = \
- -DINCLUDEDIR=\"$(includedir)\" \
- -DLIBDIR=\"$(libdir)\" \
- -DPREFIX=\"$(prefix)\" \
- $(AM_CPPFLAGS)
gnunet_uri_SOURCES = \
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,
(void) args;
if (1 == cflags || 1 == libs || 1 == prefix)
{
- /* These values are defined in the makefile */
+ char *prefixdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_PREFIX);
+ char *libdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
if (1 == cflags)
{
- fprintf (stdout, "%s\n", "-I"INCLUDEDIR);
+ fprintf (stdout, "-I%sinclude\n", prefixdir);
}
if (1 == libs)
{
- fprintf (stdout, "%s\n", "-L"LIBDIR" -lgnunetutil");
+ fprintf (stdout, "-L%s -lgnunetutil\n", libdir);
}
if (1 == prefix)
{
- fprintf (stdout, "%s\n", PREFIX);
+ fprintf (stdout, "%s\n", prefixdir);
}
+ GNUNET_free (prefixdir);
+ GNUNET_free (libdir);
return;
}
if (NULL != backend_check)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (5df20a349 -> ad9c10e6e), gnunet, 2021/09/17
- [gnunet] 07/09: -indentation, gnunet, 2021/09/17
- [gnunet] 03/09: - Do not hardcode values in gnunet-config,
gnunet <=
- [gnunet] 04/09: Autoconf macro to detect GNUnet installations, gnunet, 2021/09/17
- [gnunet] 05/09: gnunet.m4: add flag to disable debug messages, gnunet, 2021/09/17
- [gnunet] 01/09: 5708: allow gnunet-config to output build config informations, gnunet, 2021/09/17
- [gnunet] 06/09: -Merge branch 'master' into dev/vanni/build-info, gnunet, 2021/09/17
- [gnunet] 08/09: -set return value following the current API, gnunet, 2021/09/17
- [gnunet] 09/09: Merge branch 'dev/vanni/build-info' into 'master', gnunet, 2021/09/17
- [gnunet] 02/09: gnunet-config manpage: Document the new flags, gnunet, 2021/09/17