Commit 62585bfd authored by Brett Cannon's avatar Brett Cannon

Switch from getting LDFLAGS and CPPFLAGS from the environment to the Makefile.

This is to avoid a problem that inconsistently comes up where the environment
variable is unset while the Makefile clearly has the values set and are used
during ``make``.

Closes bug #1081045.
parent 1c7ade92
...@@ -244,14 +244,14 @@ class PyBuildExt(build_ext): ...@@ -244,14 +244,14 @@ class PyBuildExt(build_ext):
# Add paths specified in the environment variables LDFLAGS and # Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS. # CPPFLAGS.
# Since this file tends to be executed by ``make install`` its # We must get the values from the Makefile and not the environment
# environment variables are those that the Makefile sets and not what # directly since an inconsistently reproducible issue comes up where
# the shell has. The Makefile must keep the shell's values somewhere # the environment variable is not set even though the value were passed
# in order to be able to reach them at execution time. # into configure and stored in the Makefile.
for env_var, arg_name, dir_list in ( for env_var, arg_name, dir_list in (
('LDFLAGS', '-L', self.compiler.library_dirs), ('LDFLAGS', '-L', self.compiler.library_dirs),
('CPPFLAGS', '-I', self.compiler.include_dirs)): ('CPPFLAGS', '-I', self.compiler.include_dirs)):
env_val = os.getenv(env_var) env_val = sysconfig.get_config_var(env_var)
if env_val: if env_val:
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option(arg_name, dest="dirs", action="append") parser.add_option(arg_name, dest="dirs", action="append")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment