gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]