authorgravatar for sentrycraft123@gmail.comJan200101 <sentrycraft123@gmail.com> 2020-08-31 18:10:44+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-31 17:44:43-04:00
log2148336a8145c5db66bb0ea11ad02dd0813942f0
tree5636abef3f73d2750b4fc386ec0c662ed6772604
parent8dc58a4e944e5d319079a56802ce0824096bd7b5

follow filesystem hierarchy standard when adding lib directories


1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/zig/system.zig+4-3
......@@ -88,6 +88,7 @@ pub const NativePaths = struct {
8888
8989 if (!is_windows) {
9090 const triple = try Target.current.linuxTriple(allocator);
91 const qual = Target.current.cpu.arch.ptrBitWidth();
9192
9293 // TODO: $ ld --verbose | grep SEARCH_DIR
9394 // the output contains some paths that end with lib64, maybe include them too?
......@@ -95,17 +96,17 @@ pub const NativePaths = struct {
9596 // TODO: some of these are suspect and should only be added on some systems. audit needed.
9697
9798 try self.addIncludeDir("/usr/local/include");
99 try self.addLibDirFmt("/usr/local/lib{}", .{qual});
98100 try self.addLibDir("/usr/local/lib");
99 try self.addLibDir("/usr/local/lib64");
100101
101102 try self.addIncludeDirFmt("/usr/include/{}", .{triple});
102103 try self.addLibDirFmt("/usr/lib/{}", .{triple});
103104
104105 try self.addIncludeDir("/usr/include");
106 try self.addLibDirFmt("/lib{}", .{qual});
105107 try self.addLibDir("/lib");
106 try self.addLibDir("/lib64");
108 try self.addLibDirFmt("/usr/lib{}", .{qual});
107109 try self.addLibDir("/usr/lib");
108 try self.addLibDir("/usr/lib64");
109110
110111 // example: on a 64-bit debian-based linux distro, with zlib installed from apt:
111112 // zlib.h is in /usr/include (added above)