[hatari-devel] cmake doesn't find readline

npomarede at corp.free.fr npomarede at corp.free.fr
Sun Feb 21 14:43:07 CET 2010


Hello,

as I never tried cmake before, I gave it a try today. It works fine, 
except it doesn't correctly detect readline in my case.
The library is detected (and it works, as I used it before with make), but 
the rl_filename_completion_function detection doesn't work :

-- Found READLINE: /lib/libreadline.so
-- Looking for rl_filename_completion_function
-- Looking for rl_filename_completion_function - not found

in CMakeError.log :

Determining if the function rl_filename_completion_function exists failed 
with the following output:
Change Dir: /home/npomarede/src/hatari-work/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: entrant dans le répertoire « 
/home/npomarede/src/hatari-work/CMakeFiles/CMakeTmp »
/usr/bin/cmake -E cmake_progress_report 
/home/npomarede/src/hatari-work/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o
/usr/bin/gcc   -DCHECK_FUNCTION_EXISTS=rl_filename_completion_function 
-o CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c 
/usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script 
CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/usr/bin/gcc     -DCHECK_FUNCTION_EXISTS=rl_filename_completion_function 
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o  -o 
cmTryCompileExec -rdynamic
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o: In function 
`main':
CheckFunctionExists.c:(.text+0x7): undefined reference to 
`rl_filename_completion_function'
collect2: ld a retourné 1 code d'état d'exécution
gmake[1]: quittant le répertoire « 
/home/npomarede/src/hatari-work/CMakeFiles/CMakeTmp »
gmake[1]: *** [cmTryCompileExec] Erreur 1
gmake: *** [cmTryCompileExec/fast] Erreur 2


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) ?


Nicolas


More information about the hatari-devel mailing list