configure is confused by "modern" libedit
When I try building fcron on a system that has libedit installed, which looks like:
libedit-dev-20210910.3.1-r0 contains:
usr/lib/libedit.a
usr/lib/libedit.so
usr/include/histedit.h
usr/include/editline/readline.h
usr/lib/pkgconfig/libedit.pc
m4/ax_lib_readline.m4 correctly identifies -ledit as a library it can link, but it doesn't know to look in editline/ for readline.h, so we get compiler failures:
fcrondyn.c: In function ‘rl_cmpl_fcrondyn’:
fcrondyn.c:651:19: warning: implicit declaration of function ‘rl_completion_matches’ [-Wimplicit-function-declaration]
651 | matches = rl_completion_matches(text, rl_cmpl_command_generator);
| ^~~~~~~~~~~~~~~~~~~~~
fcrondyn.c:651:17: warning: assignment to ‘char **’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
651 | matches = rl_completion_matches(text, rl_cmpl_command_generator);
| ^
fcrondyn.c: In function ‘interactive_mode’:
fcrondyn.c:706:5: error: ‘rl_readline_name’ undeclared (first use in this function)
706 | rl_readline_name = "fcrondyn";
| ^~~~~~~~~~~~~~~~
fcrondyn.c:706:5: note: each undeclared identifier is reported only once for each function it appears in
fcrondyn.c:709:5: error: ‘rl_attempted_completion_function’ undeclared (first use in this function)
709 | rl_attempted_completion_function = rl_cmpl_fcrondyn;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fcrondyn.c:712:21: warning: implicit declaration of function ‘readline’; did you mean ‘readlink’? [-Wimplicit-function-declaratio]
712 | line_read = readline("fcrondyn> ");
| ^~~~~~~~
| readlink
fcrondyn.c:712:19: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
712 | line_read = readline("fcrondyn> ");
| ^
fcrondyn.c:724:13: warning: implicit declaration of function ‘add_history’ [-Wimplicit-function-declaration]
724 | add_history(line_read);
| ^~~~~~~~~~~
make: *** [Makefile:124: fcrondyn.o] Error 1
Looks fairly simple to fix, but wanted to log an issue before working on it.
Thanks for raising. I am not aware of anyone working on this. A PR would be very welcome.
On Tue, 27 May 2025 at 06:52, A. Wilcox @.***> wrote:
awilfox created an issue (yo8192/fcron#40) https://github.com/yo8192/fcron/issues/40
When I try building fcron on a system that has libedit installed, which looks like:
libedit-dev-20210910.3.1-r0 contains: usr/lib/libedit.a usr/lib/libedit.so usr/include/histedit.h usr/include/editline/readline.h usr/lib/pkgconfig/libedit.pc
m4/ax_lib_readline.m4 correctly identifies -ledit as a library it can link, but it doesn't know to look in editline/ for readline.h, so we get compiler failures:
fcrondyn.c: In function ‘rl_cmpl_fcrondyn’: fcrondyn.c:651:19: warning: implicit declaration of function ‘rl_completion_matches’ [-Wimplicit-function-declaration] 651 | matches = rl_completion_matches(text, rl_cmpl_command_generator); | ^~~~~~~~~~~~~~~~~~~~~ fcrondyn.c:651:17: warning: assignment to ‘char **’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 651 | matches = rl_completion_matches(text, rl_cmpl_command_generator); | ^ fcrondyn.c: In function ‘interactive_mode’: fcrondyn.c:706:5: error: ‘rl_readline_name’ undeclared (first use in this function) 706 | rl_readline_name = "fcrondyn"; | ^~~~~~~~~~~~~~~~ fcrondyn.c:706:5: note: each undeclared identifier is reported only once for each function it appears in fcrondyn.c:709:5: error: ‘rl_attempted_completion_function’ undeclared (first use in this function) 709 | rl_attempted_completion_function = rl_cmpl_fcrondyn; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fcrondyn.c:712:21: warning: implicit declaration of function ‘readline’; did you mean ‘readlink’? [-Wimplicit-function-declaratio] 712 | line_read = readline("fcrondyn> "); | ^~~~~~~~ | readlink fcrondyn.c:712:19: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 712 | line_read = readline("fcrondyn> "); | ^ fcrondyn.c:724:13: warning: implicit declaration of function ‘add_history’ [-Wimplicit-function-declaration] 724 | add_history(line_read); | ^~~~~~~~~~~ make: *** [Makefile:124: fcrondyn.o] Error 1
Looks fairly simple to fix, but wanted to log an issue before working on it.
— Reply to this email directly, view it on GitHub https://github.com/yo8192/fcron/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPHBIQP2CN7W3UCOSC6CT33AP4QZAVCNFSM6AAAAAB57AUF4SVHI2DSMVQWIX3LMV43ASLTON2WKOZTGA4TENRWGY3DIMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>