gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] Fixes building with ncurses on FreeBSD (#47349).


From: Fred Wright
Subject: [gpsd-dev] [PATCH] Fixes building with ncurses on FreeBSD (#47349).
Date: Sat, 5 Mar 2016 16:31:31 -0800

This makes the change suggested in the bug, where the "--libs" option
to pkg-config is replaced with "--libs-only-L --libs-only-l", in order
to suppress the "-rpath" flag that crashes scons.

TESTED:
Built "build-all check" on three versions of OSX, as well as Linux,
FreeBSD, OpenBSD, and NetBSD.  NetBSD still has unresolved issues with
both dbus and ncurses, requiring those options to be turned off, but
otherwise everything passes.
---
 SConstruct | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/SConstruct b/SConstruct
index dec9ea1..e52095f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -546,10 +546,14 @@ else:
 
     # define a helper function for pkg-config - we need to pass
     # --static for static linking, too.
+    #
+    # Using "--libs-only-L --libs-only-l" instead of "--libs" avoids
+    # a superfluous "-rpath" option in some FreeBSD cases, and the resulting 
+    # scons crash.
     if env["shared"]:
-        pkg_config = lambda pkg: ['!%s --cflags --libs %s' % 
(env['PKG_CONFIG'], pkg, )]
+        pkg_config = lambda pkg: ['!%s --cflags --libs-only-L --libs-only-l 
%s' % (env['PKG_CONFIG'], pkg, )]
     else:
-        pkg_config = lambda pkg: ['!%s --cflags --libs --static %s' % 
(env['PKG_CONFIG'], pkg, )]
+        pkg_config = lambda pkg: ['!%s --cflags --libs-only-L --libs-only-l 
--static %s' % (env['PKG_CONFIG'], pkg, )]
 
     # The actual distinction here is whether the platform has ncurses in the
     # base system or not. If it does, pkg-config is not likely to tell us
@@ -561,6 +565,8 @@ else:
             ncurseslibs = pkg_config('ncurses')
             if config.CheckPKG('tinfo'):
                 ncurseslibs += pkg_config('tinfo')
+        # It's not yet known whether the above "--libs" tweak is appropriate
+        # for ncurses5-config.
         elif WhereIs('ncurses5-config'):
             ncurseslibs = ['!ncurses5-config --libs --cflags']
         elif WhereIs('ncursesw5-config'):
-- 
2.7.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]