samba/OpenBSD-Reverse-order-of-paths-added.patch
2019-01-24 20:16:15 +03:00

33 lines
2 KiB
Diff

From 66fa8e15ab47a6569e639f6c1e8d46f0cfa465c8 Mon Sep 17 00:00:00 2001
From: Vadim Zhukov <persgray@gmail.com>
Date: Fri, 17 May 2013 12:51:03 +0400
Subject: [PATCH] Reverse order of paths added to get more reliable builds
When processing configure time checks, there is a Samba-specific hook activated for each check being made. This hooks looks into CPPPATH and LIBPATH, and, if the default path supplied by configure option does not present there, adds those to respective lists in those variables. I do not know, why, but new paths are prepended to this list instead of being appended to it. As a result, the results of previous configure checks are not reliable anymore, because they were made in a different environment, not looking at the directories added later. This could (and break) some setups, especially on *BSD, when base system and additional packages install headers and/or libraries with the same name.
The patch below reverses the order of paths being appended. I suspect this could be wrong, because this seems an obvious decision for initial implementation, but there are no comments in the code describing the reasons to do this either way.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9890
---
buildtools/wafsamba/samba_conftests.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index ec98ba0..560d939 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -39,9 +39,9 @@ def check(self, *k, **kw):
def add_options_dir(dirs, env):
for x in dirs:
if not x in env.CPPPATH:
- env.CPPPATH = [os.path.join(x, 'include')] + env.CPPPATH
+ env.CPPPATH = env.CPPPATH + [os.path.join(x, 'include')]
if not x in env.LIBPATH:
- env.LIBPATH = [os.path.join(x, 'lib')] + env.LIBPATH
+ env.LIBPATH = env.LIBPATH + [os.path.join(x, 'lib')]
add_options_dir(additional_dirs, kw['env'])
--
1.8.2.2