@@ -143,26 +143,22 @@ def collect_build_config() -> dict[str, list[str] | list[tuple[str, str | None]]
143143
144144 extend_env_paths (libraries , "PCRE2_LIBRARIES" )
145145
146- if not library_files :
147- for path in find_library_with_pkg_config ():
148- extend_unique (library_files , path )
149-
150- if not library_files :
151- directory_candidates = [Path (p ) for p in library_dirs ]
152- directory_candidates .extend (Path (p ) for p in discover_library_dirs ())
153- for directory in directory_candidates :
154- located = locate_library_file (directory )
155- if located is not None :
156- extend_unique (library_files , str (located ))
157- break
158-
159- if not library_files :
160- for path in find_library_with_ldconfig ():
161- extend_unique (library_files , path )
162-
163- if not library_files :
164- for path in find_library_with_brew ():
165- extend_unique (library_files , path )
146+ directory_candidates = [Path (p ) for p in library_dirs ]
147+ directory_candidates .extend (Path (p ) for p in discover_library_dirs ())
148+ for directory in directory_candidates :
149+ located = locate_library_file (directory )
150+ if located is not None :
151+ extend_unique (library_files , str (located ))
152+ break
153+
154+ for path in find_library_with_pkg_config ():
155+ extend_unique (library_files , path )
156+
157+ for path in find_library_with_ldconfig ():
158+ extend_unique (library_files , path )
159+
160+ for path in find_library_with_brew ():
161+ extend_unique (library_files , path )
166162
167163 env_cflags = os .environ .get ("PCRE2_CFLAGS" )
168164 if env_cflags :
@@ -224,6 +220,11 @@ def collect_build_config() -> dict[str, list[str] | list[tuple[str, str | None]]
224220 RUNTIME_LIBRARY_FILES .clear ()
225221 RUNTIME_LIBRARY_FILES .extend (runtime_libraries )
226222
223+ if sys .platform .startswith ("sunos" ) or sys .platform .startswith ("solaris" ):
224+ extra_link_args_x64 = [path for path in extra_link_args if '64' in path ]
225+ if not platform .machine () in ['x86_64' , 'AMD64' , 'amd64' , 'x64' ] and extra_link_args_x64 :
226+ extra_link_args = extra_link_args_x64
227+
227228 config = {
228229 "include_dirs" : include_dirs ,
229230 "library_dirs" : library_dirs ,
@@ -245,3 +246,4 @@ def collect_build_config() -> dict[str, list[str] | list[tuple[str, str | None]]
245246)
246247
247248setup (ext_modules = [EXTENSION ], cmdclass = {"build_ext" : build_ext })
249+
0 commit comments