From: Brett Cannon Date: Sun, 3 Feb 2008 09:58:02 +0000 (+0000) Subject: Backport r60537: have order of CPPFLAGS and LDFLAGS be honored. X-Git-Tag: v2.5.2c1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=912ba54394107b16865501e8f02f424accc2da80;p=python Backport r60537: have order of CPPFLAGS and LDFLAGS be honored. --- diff --git a/Misc/NEWS b/Misc/NEWS index d83b9cf49c..5f28bd3b05 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -260,6 +260,9 @@ Documentation Build ----- +- Have the search path for building extensions follow the declared order in + $CPPFLAGS and $LDFLAGS. + - Bug #1234: Fixed semaphore errors on AIX 5.2 - Bug #1699: Define _BSD_SOURCE only on OpenBSD. diff --git a/setup.py b/setup.py index 99ad7e3c26..22fc2b1e5c 100644 --- a/setup.py +++ b/setup.py @@ -277,7 +277,7 @@ class PyBuildExt(build_ext): parser.add_option(arg_name, dest="dirs", action="append") options = parser.parse_args(env_val.split())[0] if options.dirs: - for directory in options.dirs: + for directory in reversed(options.dirs): add_dir_to_list(dir_list, directory) if os.path.normpath(sys.prefix) != '/usr':