configure.in 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. AC_PREREQ(2.50)
  2. AC_INIT
  3. AC_CONFIG_SRCDIR([readline.c])
  4. . $srcdir/../GUILE-VERSION
  5. PACKAGE=guile-readline
  6. AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
  7. AC_PROG_CC
  8. AM_PROG_CC_STDC
  9. AM_PROG_LIBTOOL
  10. dnl Should we check for curses, terminfo, and termlib, too?
  11. for termlib in ncurses termcap ; do
  12. AC_CHECK_LIB(${termlib}, tgoto,
  13. [LIBS="-l${termlib} $LIBS"; break])
  14. done
  15. AC_CHECK_LIB(readline, main)
  16. if test $ac_cv_lib_readline_main = no; then
  17. AC_MSG_WARN([libreadline was not found on your system.])
  18. fi
  19. AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal rl_pre_input_hook)
  20. AC_MSG_CHECKING(if readline clears SA_RESTART flag for SIGWINCH)
  21. AC_CACHE_VAL(guile_cv_sigwinch_sa_restart_cleared,
  22. AC_TRY_RUN([#include <signal.h>
  23. #include <stdio.h>
  24. #include <readline/readline.h>
  25. int
  26. hook ()
  27. {
  28. struct sigaction action;
  29. sigaction (SIGWINCH, NULL, &action);
  30. rl_cleanup_after_signal();
  31. /* exit with 0 if readline disabled SA_RESTART */
  32. exit (action.sa_flags & SA_RESTART);
  33. }
  34. int
  35. main ()
  36. {
  37. struct sigaction action;
  38. sigaction (SIGWINCH, NULL, &action);
  39. action.sa_flags |= SA_RESTART;
  40. sigaction (SIGWINCH, &action, NULL);
  41. rl_pre_input_hook = hook;
  42. readline ("");
  43. }],
  44. guile_cv_sigwinch_sa_restart_cleared=yes,
  45. guile_cv_sigwinch_sa_restart_cleared=no,
  46. guile_cv_sigwinch_sa_restart_cleared=yes))
  47. AC_MSG_RESULT($guile_cv_sigwinch_sa_restart_cleared)
  48. if test $guile_cv_sigwinch_sa_restart_cleared = yes; then
  49. AC_DEFINE(GUILE_SIGWINCH_SA_RESTART_CLEARED)
  50. fi
  51. AC_CACHE_CHECK([for rl_getc_function pointer in readline],
  52. ac_cv_var_rl_getc_function,
  53. [AC_TRY_LINK([
  54. #include <stdio.h>
  55. #include <readline/readline.h>],
  56. [printf ("%ld", (long) rl_getc_function)],
  57. [ac_cv_var_rl_getc_function=yes],
  58. [ac_cv_var_rl_getc_function=no])])
  59. if test "${ac_cv_var_rl_getc_function}" = "yes"; then
  60. AC_DEFINE(HAVE_RL_GETC_FUNCTION)
  61. fi
  62. if test $ac_cv_lib_readline_main = yes \
  63. -a $ac_cv_var_rl_getc_function = no; then
  64. AC_MSG_WARN([*** libreadline is too old on your system.])
  65. AC_MSG_WARN([*** You need readline version 2.1 or later.])
  66. fi
  67. AC_CHECK_FUNCS(strdup)
  68. . $srcdir/LIBGUILEREADLINE-VERSION
  69. AC_SUBST(LIBGUILEREADLINE_INTERFACE_CURRENT)
  70. AC_SUBST(LIBGUILEREADLINE_INTERFACE_REVISION)
  71. AC_SUBST(LIBGUILEREADLINE_INTERFACE_AGE)
  72. AC_SUBST(LIBGUILEREADLINE_INTERFACE)
  73. AC_CONFIG_FILES(Makefile)
  74. AC_OUTPUT