From 27520ef39b732562a6c4ffa8640b44250ad72a4a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 16 Nov 2012 11:00:22 +0000 Subject: [PATCH] -more libexec fixes for OpenSUSE --- src/util/os_installation.c | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/util/os_installation.c b/src/util/os_installation.c index b82060bca..c6dca8390 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -523,8 +523,30 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind) break; case GNUNET_OS_IPK_LIBDIR: if (isbasedir) + { dirname = DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR; + tmp = GNUNET_malloc (strlen (execpath) + strlen (dirname) + 1); + sprintf (tmp, "%s%s", execpath, dirname); + if ( (GNUNET_YES != + GNUNET_DISK_directory_test (tmp, GNUNET_YES)) && + (4 == sizeof (void *)) ) + { + GNUNET_free (tmp); + dirname = + DIR_SEPARATOR_STR "lib32" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR; + tmp = GNUNET_malloc (strlen (execpath) + strlen (dirname) + 1); + sprintf (tmp, "%s%s", execpath, dirname); + } + if ( (GNUNET_YES != + GNUNET_DISK_directory_test (tmp, GNUNET_YES)) && + (8 == sizeof (void *)) ) + { + dirname = + DIR_SEPARATOR_STR "lib64" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR; + } + GNUNET_free (tmp); + } else dirname = DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR; break; @@ -547,9 +569,33 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind) break; case GNUNET_OS_IPK_LIBEXECDIR: if (isbasedir) + { dirname = DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \ "libexec" DIR_SEPARATOR_STR; + tmp = GNUNET_malloc (strlen (execpath) + strlen (dirname) + 1); + sprintf (tmp, "%s%s", execpath, dirname); + if ( (GNUNET_YES != + GNUNET_DISK_directory_test (tmp, GNUNET_YES)) && + (4 == sizeof (void *)) ) + { + GNUNET_free (tmp); + dirname = + DIR_SEPARATOR_STR "lib32" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \ + "libexec" DIR_SEPARATOR_STR; + tmp = GNUNET_malloc (strlen (execpath) + strlen (dirname) + 1); + sprintf (tmp, "%s%s", execpath, dirname); + } + if ( (GNUNET_YES != + GNUNET_DISK_directory_test (tmp, GNUNET_YES)) && + (8 == sizeof (void *)) ) + { + dirname = + DIR_SEPARATOR_STR "lib64" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \ + "libexec" DIR_SEPARATOR_STR; + } + GNUNET_free (tmp); + } else dirname = DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \ -- 2.25.1