diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-04 16:10:24 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-03-04 16:10:24 -0500 |
commit | 50119cd3346fb4049325184360e5db03d7030581 (patch) | |
tree | a6515c79b0a0fef027d6f0741c516797cd6a9f3a /src/rpath.c | |
parent | 20a3143f628dab816c167c4c7f27088d1e643874 (diff) | |
download | spmc-50119cd3346fb4049325184360e5db03d7030581.tar.gz |
Oh the multilib is killing me
Diffstat (limited to 'src/rpath.c')
-rw-r--r-- | src/rpath.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rpath.c b/src/rpath.c index 42a4c07..fbfdb18 100644 --- a/src/rpath.c +++ b/src/rpath.c @@ -209,6 +209,7 @@ char *rpath_autodetect(const char *filename) { char *start = realpath(rootdir, NULL); char *cwd = realpath(".", NULL); char *result = NULL; + int multilib_os = (exists("/lib64") == 0); // Change directory to the requested root chdir(start); @@ -228,7 +229,11 @@ char *rpath_autodetect(const char *filename) { } // Using the current visit path, check if it contains a lib directory - char *path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); + char *path = NULL; + if (multilib_os) + path = join((char *[]) {visit, "lib64", NULL}, DIRSEPS); + else + path = join((char *[]) {visit, "lib", NULL}, DIRSEPS); if (access(path, F_OK) == 0) { // Check whether the lib directory contains one of `filename`'s libraries @@ -248,7 +253,11 @@ char *rpath_autodetect(const char *filename) { // Stop processing when a good lib directory is found if (has_real_libdir != 0) { - strcat(relative, "lib"); + if (multilib_os) { + strcat(relative, "lib64"); + } else { + strcat(relative, "lib"); + } free(path); free(visit); break; |