From: Stéphane Graber Date: Tue, 25 Oct 2016 23:08:34 +0000 (-0400) Subject: Fix environment before importing setuptools X-Git-Tag: lxc-2.1.0~288^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1252%2Fhead;p=thirdparty%2Flxc.git Fix environment before importing setuptools Signed-off-by: Stéphane Graber --- diff --git a/src/python-lxc/setup.py b/src/python-lxc/setup.py index 39e16c4a5..bf0d74a0c 100644 --- a/src/python-lxc/setup.py +++ b/src/python-lxc/setup.py @@ -25,10 +25,7 @@ import os import subprocess -from setuptools import setup, Extension -from setuptools.command.build_ext import build_ext as BuildExtCommand - -# Fix build when PIE is enabled +# Fix build when PIE is enabled (must run before setuptools import) for var in ("LDFLAGS", "CFLAGS"): current = os.environ.get(var, None) if not current: @@ -44,6 +41,9 @@ for var in ("LDFLAGS", "CFLAGS"): os.environ[var] = " ".join(new) +from setuptools import setup, Extension +from setuptools.command.build_ext import build_ext as BuildExtCommand + class LxcBuildExtCommand(BuildExtCommand): user_options = BuildExtCommand.user_options + [