From c223a53622d25f8753aa4c48313441dce512ec40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Tue, 25 Oct 2016 19:08:34 -0400 Subject: [PATCH] Fix environment before importing setuptools MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- src/python-lxc/setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 + [ -- 2.47.2