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
--- configure.in
+++ configure.in
@@ -477,8 +477,8 @@
 
 if test $opt_readline = yes; then
 	AC_DEFINE(READLINE)
-	READLINE_LIB=-lreadline
 	if test "$opt_with_installed_readline" != "no" ; then
+		READLINE_LIB=-lreadline
 		case "$opt_with_installed_readline" in
 		yes)	RL_INCLUDE= ;;
 		*)	case "$RL_INCLUDEDIR" in
@@ -490,6 +490,7 @@
 		READLINE_DEP=
 	else
 		RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
+		READLINE_LIB='$(RL_LIBDIR)/libreadline.a'
 		READLINE_DEP='$(READLINE_LIBRARY)'
 	fi
 else
@@ -503,8 +504,8 @@
 	if test $opt_bang_history = yes; then
 		AC_DEFINE(BANG_HISTORY)
 	fi
-	HISTORY_LIB=-lhistory
  	if test "$opt_with_installed_readline" != "no"; then
+		HISTORY_LIB=-lhistory
 		HIST_LIBDIR=$RL_LIBDIR
 		HISTORY_DEP=
 		case "$opt_with_installed_readline" in
@@ -517,6 +518,7 @@
 		esac
 	else
 		HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
+		HISTORY_LIB='$(HIST_LIBDIR)/libhistory.a'
 		HISTORY_DEP='$(HISTORY_LIBRARY)'
 	fi
 else
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to