* debugger/mcs51/sdcdb.c: replaced hardcoded "/" with DIR_SEPARATOR_STRING
[fw/sdcc] / debugger / mcs51 / acinclude.m4
1 dnl This macro will check for the presence of the readline library.
2 dnl To get it into the aclocal.m4 dnl file, do this:
3 dnl   aclocal -I . --verbose
4 dnl
5 dnl The --verbose will show all of the files that are searched
6 dnl for .m4 macros.
7
8 AC_DEFUN([wi_LIB_READLINE], [
9   dnl check for the readline.h header file
10   AC_CHECK_HEADER(readline/readline.h)
11
12   if test "$ac_cv_header_readline_readline_h" = yes; then
13     dnl check for the readline library
14
15     ac_save_LIBS="$LIBS"
16     # Note: $LIBCURSES is permitted to be empty.
17
18     for LIBREADLINE in "-lreadline.dll" "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
19     do
20       AC_MSG_CHECKING([for GNU Readline library])
21
22       LIBS="$ac_save_LIBS $LIBREADLINE"
23
24       AC_TRY_LINK([
25         /* includes */
26         #include <stdio.h>
27         #include <readline/readline.h>
28       ],[
29         /* function-body */
30         readline(NULL);
31         rl_function_of_keyseq(NULL, NULL, NULL);
32       ],[
33         wi_cv_lib_readline=yes
34         wi_cv_lib_readline_result="$LIBREADLINE"
35       ],[
36         wi_cv_lib_readline=no
37         wi_cv_lib_readline_result=no
38       ])
39
40       if test "$wi_cv_lib_readline" = yes; then
41         AC_MSG_RESULT($wi_cv_lib_readline_result)
42         AC_SUBST(LIBREADLINE)
43         AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, 1, [Readline])
44         break
45       fi
46     done
47
48     LIBS="$ac_save_LIBS"
49   fi
50 ])