[hatari-devel] cmake doesn't find readline

npomarede at corp.free.fr npomarede at corp.free.fr
Sun Feb 21 15:06:37 CET 2010


On Sun, 21 Feb 2010, npomarede at corp.free.fr wrote:

>
>
> I have the feeling that unless with X11 for example where -lX11 is added, 
> here we don't have -lreadline added to gcc, which would explain why ldd is 
> exiting with an error.
>
> In the end HAVE_READLINE is not defined in config.h
>
> Thomas, do you have an idea (or maybe others encountered this too) ?
>

Replying to myself, I used CMAKE_REQUIRED_LIBRARIES before the call to 
check_function_exists :

diff -r db449c77e9b2 CMakeLists.txt
--- a/CMakeLists.txt    Sun Feb 21 12:03:53 2010 +0200
+++ b/CMakeLists.txt    Sun Feb 21 15:00:50 2010 +0100
@@ -46,6 +46,7 @@

  find_package(Readline)
  if(READLINE_FOUND)
+       set(CMAKE_REQUIRED_LIBRARIES "readline")
         check_function_exists(rl_filename_completion_function HAVE_RL_COMPLETION_FUNCTION)
         if(HAVE_RL_COMPLETION_FUNCTION)
                 set(HAVE_LIBREADLINE 1)


I don't know if this is the most efficient way to fix this, but it fixed 
the problem and readline is working under the debugger.


Another "problem" : after running cmake, "hg diff" is now reporting all 
the Makefile files in the various subdirs as being modified (as they were 
replaced by the cmake version). Which means a "hg ci/push" would overwrite 
the original Makefile files on berlios, which may not be what we want.

Is there a way to handle this ?


Nicolas



More information about the hatari-devel mailing list