From 0fdd6c7632a070fc3f6251f44c520fa324155a7d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Feb 2012 12:36:44 +1100 Subject: build: fixed a link order problem this fixes a problem found by obnox where the -L path for CUPS was put before the path to internal libraries. The install path for CUPS happened to be the same as for a old system libtevent, which meant we linked against the old tevent instead of the correct one from our private library paths. The problem was that we were adding the -L paths directly to the ldflags. The waf core code (in ccroot.py) only adds more paths if they are not there already. So by adding it in ldflags it was not added at the end of the list. The fix is just to not do the -L processing in wafsamba and let the waf core do it in the right order Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Feb 2 06:54:42 CET 2012 on sn-devel-104 --- buildtools/wafsamba/samba_autoconf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 1ea818ef30..6ed719a80a 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -471,7 +471,9 @@ def library_flags(self, libs): inc_path = getattr(self.env, 'CPPPATH_%s' % lib.upper(), []) lib_path = getattr(self.env, 'LIBPATH_%s' % lib.upper(), []) ccflags.extend(['-I%s' % i for i in inc_path]) - ldflags.extend(['-L%s' % l for l in lib_path]) + # note that we do not add the -L in here, as that is added by the waf + # core. Adding it here would just change the order that it is put on the link line + # which can cause system paths to be added before internal libraries extra_ccflags = TO_LIST(getattr(self.env, 'CCFLAGS_%s' % lib.upper(), [])) extra_ldflags = TO_LIST(getattr(self.env, 'LDFLAGS_%s' % lib.upper(), [])) ccflags.extend(extra_ccflags) -- cgit