bug-bash
[Top][All Lists]
Advanced

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

[patch] make sure static linking with included libs always works


From: Mike Frysinger
Subject: [patch] make sure static linking with included libs always works
Date: Tue, 2 Aug 2005 22:49:13 -0400
User-agent: KMail/1.8.2

some compilers (like Darwin's gcc-4) will attempt to locate a shared library 
in the lib search path before searching for a static one ... the default 
behavior of gcc on linux is to search all library paths for static or shared 
versions of a library and use whichever it finds first (defaulting to shared 
if a path contains both static and shared)

so, doing '-L./lib/readline -lreadline' on Darwin will have the compiler 
search ./lib/readline then the system paths looking for a shared version of 
libreadline ... if it fails, it restarts looking for a static lib.  gcc would 
find libreadline.a in ./lib/readline first and just use that.  who knows what 
different compilers do :).

find attached a patch that will cause the build system to do -lreadline if 
building against the system readline or use ./lib/readline/libreadline.a if 
building against the included version ... no complications this way
-mike

Attachment: included-readline-linking.patch
Description: Text Data


reply via email to

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