Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
update compiling on debian patch
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf authored and Matthias Koeppe committed Feb 18, 2022
1 parent db32a42 commit 3bcfde1
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ diff --git a/setup.py b/setup.py
index 8fb8ea5c47..783d20bdcd 100644
--- a/setup.py
+++ b/setup.py
@@ -663,9 +663,26 @@ def add_multiarch_paths(self):
@@ -663,9 +663,30 @@ def add_multiarch_paths(self):
# Debian/Ubuntu multiarch support.
# https://wiki.ubuntu.com/MultiarchSpec
cc = sysconfig.get_config_var('CC')
Expand All @@ -34,6 +34,10 @@ index 8fb8ea5c47..783d20bdcd 100644
+ # if the sysroot is not /, then we are not using
+ # the compiler from debian/ubuntu
+ if sysroot not in ['', '/']:
+ add_dir_to_list(self.compiler.library_dirs,
+ sysroot + '/usr/lib')
+ add_dir_to_list(self.compiler.include_dirs,
+ sysroot + '/usr/include')
+ return
+ finally:
+ os.unlink(tmpfile_sysroot)
Expand All @@ -43,6 +47,18 @@ index 8fb8ea5c47..783d20bdcd 100644
ret = run_command(
'%s -print-multiarch > %s 2> /dev/null' % (cc, tmpfile))
multiarch_path_component = ''
--- a/setup.py 2021-09-28 23:49:53.193868987 -0700
+++ b/setup.py 2021-09-28 23:50:13.554098642 -0700
@@ -738,7 +738,8 @@
for env_var, arg_name, dir_list in (
('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
('LDFLAGS', '-L', self.compiler.library_dirs),
- ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ ('CPPFLAGS', '-I', self.compiler.include_dirs),
+ ('CPPFLAGS', '-isystem', self.compiler.include_dirs)):
env_val = sysconfig.get_config_var(env_var)
if env_val:
parser = argparse.ArgumentParser()
--
2.30.2

0 comments on commit 3bcfde1

Please sign in to comment.