From: Christian Grothoff Date: Fri, 16 Nov 2012 11:00:22 +0000 (+0000) Subject: -more libexec fixes for OpenSUSE X-Git-Tag: initial-import-from-subversion-38251~10826 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=27520ef39b732562a6c4ffa8640b44250ad72a4a;p=oweals%2Fgnunet.git -more libexec fixes for OpenSUSE --- 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 \