Remove BLP_INT_DIGITS. Now we use the intprops.h header file instead.
[pspp-builds.git] / acinclude.m4
1 dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
2 dnl This file is free software; the Free Software Foundation
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
5
6 dnl Check for readline and history libraries.
7
8 dnl Modified for PSPP by Ben Pfaff, based on readline.m4 serial 3 from
9 dnl gnulib, which was written by Simon Josefsson, with help from Bruno
10 dnl Haible and Oskar Liljeblad.
11
12 AC_DEFUN([PSPP_READLINE],
13 [
14   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
15   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
16   AC_REQUIRE([AC_LIB_RPATH])
17
18   dnl Search for libreadline and define LIBREADLINE, LTLIBREADLINE and
19   dnl INCREADLINE accordingly.
20   AC_LIB_LINKFLAGS_BODY([readline])
21   AC_LIB_LINKFLAGS_BODY([history])
22
23   dnl Add $INCREADLINE to CPPFLAGS before performing the following checks,
24   dnl because if the user has installed libreadline and not disabled its use
25   dnl via --without-libreadline-prefix, he wants to use it. The AC_TRY_LINK
26   dnl will then succeed.
27   am_save_CPPFLAGS="$CPPFLAGS"
28   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCREADLINE $INCHISTORY])
29
30   AC_CACHE_CHECK(for readline, gl_cv_lib_readline, [
31     gl_cv_lib_readline=no
32     am_save_LIBS="$LIBS"
33     dnl On some systems, -lreadline doesn't link without an additional
34     dnl -lncurses or -ltermcap.
35     dnl Try -lncurses before -ltermcap, because libtermcap is unsecure
36     dnl by design and obsolete since 1994. Try -lcurses last, because
37     dnl libcurses is unusable on some old Unices.
38     for extra_lib in "" ncurses termcap curses; do
39       LIBS="$am_save_LIBS $LIBREADLINE $LIBHISTORY"
40       if test -n "$extra_lib"; then
41         LIBS="$LIBS -l$extra_lib"
42       fi
43       AC_TRY_LINK([#include <stdio.h>
44 #include <readline/readline.h>
45 #include <readline/history.h>],
46         [readline((char*)0); add_history((char*)0);],
47         gl_cv_lib_readline=yes)
48       if test "$gl_cv_lib_readline" = yes; then
49         if test -n "$extra_lib"; then
50           LIBREADLINE="$LIBREADLINE $LIBHISTORY -l$extra_lib"
51           LTLIBREADLINE="$LTLIBREADLINE $LTLIBHISTORY -l$extra_lib"
52         fi
53         break
54       fi
55     done
56     LIBS="$am_save_LIBS"
57   ])
58
59   if test "$gl_cv_lib_readline" = yes; then
60     AC_DEFINE(HAVE_READLINE, 1, [Define if you have the readline library.])
61   fi
62
63   if test "$gl_cv_lib_readline" = yes; then
64     AC_MSG_CHECKING([how to link with libreadline])
65     AC_MSG_RESULT([$LIBREADLINE])
66   else
67     dnl If $LIBREADLINE didn't lead to a usable library, we don't
68     dnl need $INCREADLINE either.
69     CPPFLAGS="$am_save_CPPFLAGS"
70     LIBREADLINE=
71     LTLIBREADLINE=
72     LIBHISTORY=
73     LTLIBHISTORY=
74   fi
75   AC_SUBST(LIBREADLINE)
76   AC_SUBST(LTLIBREADLINE)
77 ])
78
79 dnl aclocal.m4 ends here