@@ -13,75 +13,123 @@ const PATH_list = String[]
1313const LIBPATH = Ref (" " )
1414const LIBPATH_list = String[]
1515artifact_dir:: String = " "
16- libgcc_s_path:: String = " "
17- libgfortran_path:: String = " "
18- libstdcxx_path:: String = " "
19- libgomp_path:: String = " "
2016
21- if Sys. iswindows ()
22- const _libatomic_path = BundledLazyLibraryPath (" libatomic-1.dll" )
23- const _libquadmath_path = BundledLazyLibraryPath (" libquadmath-0.dll" )
24- if arch (HostPlatform ()) == " x86_64"
25- const _libgcc_s_path = BundledLazyLibraryPath (" libgcc_s_seh-1.dll" )
26- else
27- const _libgcc_s_path = BundledLazyLibraryPath (" libgcc_s_sjlj-1.dll" )
28- end
29- const _libgfortran_path = BundledLazyLibraryPath (string (" libgfortran-" , libgfortran_version (HostPlatform ()). major, " .dll" ))
30- const _libstdcxx_path = BundledLazyLibraryPath (" libstdc++-6.dll" )
31- const _libgomp_path = BundledLazyLibraryPath (" libgomp-1.dll" )
32- const _libssp_path = BundledLazyLibraryPath (" libssp-0.dll" )
33- elseif Sys. isapple ()
34- const _libatomic_path = BundledLazyLibraryPath (" libatomic.1.dylib" )
35- const _libquadmath_path = BundledLazyLibraryPath (" libquadmath.0.dylib" )
36- if arch (HostPlatform ()) == " aarch64" || libgfortran_version (HostPlatform ()) == v " 5"
37- const _libgcc_s_path = BundledLazyLibraryPath (" libgcc_s.1.1.dylib" )
38- else
39- const _libgcc_s_path = BundledLazyLibraryPath (" libgcc_s.1.dylib" )
40- end
41- const _libgfortran_path = BundledLazyLibraryPath (string (" libgfortran." , libgfortran_version (HostPlatform ()). major, " .dylib" ))
42- const _libstdcxx_path = BundledLazyLibraryPath (" libstdc++.6.dylib" )
43- const _libgomp_path = BundledLazyLibraryPath (" libgomp.1.dylib" )
44- const _libssp_path = BundledLazyLibraryPath (" libssp.0.dylib" )
45- else
46- if Sys. isfreebsd ()
47- const _libatomic_path = BundledLazyLibraryPath (" libatomic.so.3" )
17+ libatomic_path:: String = " "
18+ const libatomic = LazyLibrary (
19+ if Sys. iswindows ()
20+ BundledLazyLibraryPath (" libatomic-1.dll" )
21+ elseif Sys. isapple ()
22+ BundledLazyLibraryPath (" libatomic.1.dylib" )
23+ elseif Sys. isfreebsd ()
24+ BundledLazyLibraryPath (" libatomic.so.3" )
25+ elseif Sys. islinux ()
26+ BundledLazyLibraryPath (" libatomic.so.1" )
4827 else
49- const _libatomic_path = BundledLazyLibraryPath (" libatomic.so.1" )
50- end
51- const _libgcc_s_path = BundledLazyLibraryPath (" libgcc_s.so.1" )
52- const _libgfortran_path = BundledLazyLibraryPath (string (" libgfortran.so." , libgfortran_version (HostPlatform ()). major))
53- const _libstdcxx_path = BundledLazyLibraryPath (" libstdc++.so.6" )
54- const _libgomp_path = BundledLazyLibraryPath (" libgomp.so.1" )
55- if libc (HostPlatform ()) != " musl"
56- const _libssp_path = BundledLazyLibraryPath (" libssp.so.0" )
28+ error (" CompilerSupportLibraries_jll: Library 'libatomic' is not available for $(Sys. KERNEL) " )
5729 end
58- if arch (HostPlatform ()) ∈ (" x86_64" , " i686" )
59- const _libquadmath_path = BundledLazyLibraryPath (" libquadmath.so.0" )
60- end
61- end
30+ )
6231
63- if @isdefined (_libatomic_path)
64- const libatomic = LazyLibrary (_libatomic_path)
32+ if Sys. iswindows () || Sys. isapple () || arch (HostPlatform ()) ∈ (" x86_64" , " i686" )
33+ global libquadmath_path:: String = " "
34+ const libquadmath = LazyLibrary (
35+ if Sys. iswindows ()
36+ BundledLazyLibraryPath (" libquadmath-0.dll" )
37+ elseif Sys. isapple ()
38+ BundledLazyLibraryPath (" libquadmath.0.dylib" )
39+ elseif (Sys. islinux () || Sys. isfreebsd ()) && arch (HostPlatform ()) ∈ (" x86_64" , " i686" )
40+ BundledLazyLibraryPath (" libquadmath.so.0" )
41+ else
42+ error (" CompilerSupportLibraries_jll: Library 'libquadmath' is not available for $(Sys. KERNEL) " )
43+ end
44+ )
6545end
66- const libgcc_s = LazyLibrary (_libgcc_s_path)
6746
68- _libgfortran_deps = [libgcc_s]
69- if @isdefined _libquadmath_path
70- const libquadmath = LazyLibrary (_libquadmath_path)
71- push! (_libgfortran_deps, libquadmath)
72- end
47+ libgcc_s_path:: String = " "
48+ const libgcc_s = LazyLibrary (
49+ if Sys. iswindows ()
50+ if arch (HostPlatform ()) == " x86_64"
51+ BundledLazyLibraryPath (" libgcc_s_seh-1.dll" )
52+ else
53+ BundledLazyLibraryPath (" libgcc_s_sjlj-1.dll" )
54+ end
55+ elseif Sys. isapple ()
56+ if arch (HostPlatform ()) == " aarch64" || libgfortran_version (HostPlatform ()) == v " 5"
57+ BundledLazyLibraryPath (" libgcc_s.1.1.dylib" )
58+ else
59+ BundledLazyLibraryPath (" libgcc_s.1.dylib" )
60+ end
61+ elseif Sys. islinux () || Sys. isfreebsd ()
62+ BundledLazyLibraryPath (" libgcc_s.so.1" )
63+ else
64+ error (" CompilerSupportLibraries_jll: Library 'libgcc_s' is not available for $(Sys. KERNEL) " )
65+ end
66+ )
7367
74- const libgfortran = LazyLibrary (_libgfortran_path, dependencies= _libgfortran_deps)
68+ libgfortran_path:: String = " "
69+ const libgfortran = LazyLibrary (
70+ if Sys. iswindows ()
71+ BundledLazyLibraryPath (string (" libgfortran-" , libgfortran_version (HostPlatform ()). major, " .dll" ))
72+ elseif Sys. isapple ()
73+ BundledLazyLibraryPath (string (" libgfortran." , libgfortran_version (HostPlatform ()). major, " .dylib" ))
74+ elseif Sys. islinux () || Sys. isfreebsd ()
75+ BundledLazyLibraryPath (string (" libgfortran.so." , libgfortran_version (HostPlatform ()). major))
76+ else
77+ error (" CompilerSupportLibraries_jll: Library 'libgfortran' is not available for $(Sys. KERNEL) " )
78+ end ;
79+ dependencies = @static if @isdefined (libquadmath)
80+ LazyLibrary[libgcc_s, libquadmath]
81+ else
82+ LazyLibrary[libgcc_s]
83+ end
84+ )
7585
76- _libstdcxx_dependencies = LazyLibrary[libgcc_s]
77- const libstdcxx = LazyLibrary (_libstdcxx_path, dependencies= _libstdcxx_dependencies)
86+ libstdcxx_path:: String = " "
87+ const libstdcxx = LazyLibrary (
88+ if Sys. iswindows ()
89+ BundledLazyLibraryPath (" libstdc++-6.dll" )
90+ elseif Sys. isapple ()
91+ BundledLazyLibraryPath (" libstdc++.6.dylib" )
92+ elseif Sys. islinux () || Sys. isfreebsd ()
93+ BundledLazyLibraryPath (" libstdc++.so.6" )
94+ else
95+ error (" CompilerSupportLibraries_jll: Library 'libstdcxx' is not available for $(Sys. KERNEL) " )
96+ end ;
97+ dependencies = LazyLibrary[libgcc_s]
98+ )
7899
79- const libgomp = LazyLibrary (_libgomp_path)
100+ libgomp_path:: String = " "
101+ const libgomp = LazyLibrary (
102+ if Sys. iswindows ()
103+ BundledLazyLibraryPath (" libgomp-1.dll" )
104+ elseif Sys. isapple ()
105+ BundledLazyLibraryPath (" libgomp.1.dylib" )
106+ elseif Sys. islinux () || Sys. isfreebsd ()
107+ BundledLazyLibraryPath (" libgomp.so.1" )
108+ else
109+ error (" CompilerSupportLibraries_jll: Library 'libgomp' is not available for $(Sys. KERNEL) " )
110+ end ;
111+ dependencies = if Sys. iswindows ()
112+ LazyLibrary[libgcc_s]
113+ else
114+ LazyLibrary[]
115+ end
116+ )
80117
81- # Some installations (such as those from-source) may not have `libssp`
82- # So let's do a compile-time check to see if we've got it.
83- if @isdefined (_libssp_path) && isfile (string (_libssp_path))
84- const libssp = LazyLibrary (_libssp_path)
118+ # only define if isfile
119+ let
120+ if Sys. iswindows () || Sys. isapple () || libc (HostPlatform ()) != " musl"
121+ _libssp_path = if Sys. iswindows ()
122+ BundledLazyLibraryPath (" libssp-0.dll" )
123+ elseif Sys. isapple ()
124+ BundledLazyLibraryPath (" libssp.0.dylib" )
125+ elseif Sys. islinux () && libc (HostPlatform ()) != " musl"
126+ BundledLazyLibraryPath (" libssp.so.0" )
127+ end
128+ if isfile (string (_libssp_path))
129+ global libssp_path:: String = " "
130+ @eval const libssp = LazyLibrary ($ (_libssp_path))
131+ end
132+ end
85133end
86134
87135# Conform to LazyJLLWrappers API
@@ -103,19 +151,17 @@ end
103151is_available () = true
104152
105153function __init__ ()
106- if @isdefined _libatomic_path
107- global libatomic_path = string (_libatomic_path)
108- end
109- global libgcc_s_path = string (_libgcc_s_path)
110- global libgomp_path = string (_libgomp_path)
111- if @isdefined _libquadmath_path
112- global libquadmath_path = string (_libquadmath_path)
154+ global libatomic_path = string (libatomic. path)
155+ global libgcc_s_path = string (libgcc_s. path)
156+ global libgomp_path = string (libgomp. path)
157+ if @isdefined libquadmath_path
158+ global libquadmath_path = string (libquadmath. path)
113159 end
114- if @isdefined _libssp_path
115- global libssp_path = string (_libssp_path )
160+ if @isdefined libssp_path
161+ global libssp_path = string (libssp . path )
116162 end
117- global libgfortran_path = string (_libgfortran_path )
118- global libstdcxx_path = string (_libstdcxx_path )
163+ global libgfortran_path = string (libgfortran . path )
164+ global libstdcxx_path = string (libstdcxx . path )
119165 global artifact_dir = dirname (Sys. BINDIR)
120166 LIBPATH[] = dirname (libgcc_s_path)
121167 push! (LIBPATH_list, LIBPATH[])
0 commit comments