summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-17 13:17:40 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-17 13:17:40 +0200
commita01e951d0fa452fea10a9faca0fbdc9c7cacff23 (patch)
tree50237bd88313411a00d0129c600e55b7942a731d /configure.ac
parentb845ea097c285f17641d60df3dea4d3e820a1475 (diff)
One more configure cleanup
Simplify BIRD client library checks, add proper devel header checks and prefer dependency on just tinfo than full ncurses.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac54
1 files changed, 33 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index 7910c196..2569a766 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,10 +303,7 @@ case $sysdesc in
AC_CHECK_HEADER([linux/rtnetlink.h],
[],
[AC_MSG_ERROR([Appropriate version of Linux kernel headers not found.])],
- [
- #include <asm/types.h>
- #include <sys/socket.h>
- ]
+ [] dnl Force new AC_CHECK_HEADER semantics
)
;;
esac
@@ -334,36 +331,51 @@ CLIENT=
CLIENT_LIBS=
if test "$enable_client" = yes ; then
CLIENT=birdc
- AC_CHECK_LIB([history], [add_history], [CLIENT_LIBS="-lhistory"])
- AC_CHECK_LIB([ncurses], [tgetent], [USE_TERMCAP_LIB=-lncurses],
- AC_CHECK_LIB([curses], [tgetent], [USE_TERMCAP_LIB=-lcurses],
- AC_CHECK_LIB([tinfow], [tgetent], [USE_TERMCAP_LIB=-ltinfow],
- AC_CHECK_LIB([tinfo], [tgetent], [USE_TERMCAP_LIB=-ltinfo],
- AC_CHECK_LIB([termcap], [tgetent], [USE_TERMCAP_LIB=-ltermcap],
- [AC_MSG_ERROR([The client requires ncurses library. Either install the library or use --disable-client to compile without the client.])]
- )
- )
- )
- )
+ BASE_LIBS="$LIBS"
+ LIBS=""
+
+ AC_CHECK_HEADERS([curses.h],
+ [],
+ [AC_MSG_ERROR([The client requires ncurses library. Either install the library or use --disable-client to compile without the client.])],
+ [] dnl Force new AC_CHECK_HEADER semantics
)
- AC_CHECK_LIB([readline], [rl_callback_read_char],
- [CLIENT_LIBS="-lreadline $CLIENT_LIBS $USE_TERMCAP_LIB"],
- [AC_MSG_ERROR([The client requires GNU readline library 2.1 or newer. Either install the library or use --disable-client to compile without the client.])],
- [$USE_TERMCAP_LIB]
+ AC_SEARCH_LIBS([tgetent], [tinfo tinfow ncurses curses termcap],
+ [TINFO_LIBS="$LIBS"; LIBS=""],
+ [AC_MSG_ERROR([The client requires ncurses library. Either install the library or use --disable-client to compile without the client.])],
+ )
+
+ AC_CHECK_HEADERS([readline/readline.h readline/history.h],
+ [],
+ [AC_MSG_ERROR([The client requires GNU Readline library. Either install the library or use --disable-client to compile without the client.])],
+ [] dnl Force new AC_CHECK_HEADER semantics
+ )
+
+ AC_SEARCH_LIBS([add_history], [history],
+ [HISTORY_LIBS="$LIBS"; LIBS=""],
+ [AC_MSG_ERROR([The client requires GNU Readline library. Either install the library or use --disable-client to compile without the client.])],
+ )
+
+ AC_SEARCH_LIBS([rl_callback_read_char], [readline],
+ [READLINE_LIBS="$LIBS"; LIBS=""],
+ [AC_MSG_ERROR([The client requires GNU Readline library. Either install the library or use --disable-client to compile without the client.])],
+ [$TINFO_LIBS]
)
AC_CHECK_LIB([readline], [rl_crlf],
[AC_DEFINE([HAVE_RL_CRLF], [1], [Define to 1 if you have rl_crlf()])],
[],
- [$USE_TERMCAP_LIB]
+ [$TINFO_LIBS]
)
AC_CHECK_LIB([readline], [rl_ding],
[AC_DEFINE([HAVE_RL_DING], [1], [Define to 1 if you have rl_ding()])],
[],
- [$USE_TERMCAP_LIB]
+ [$TINFO_LIBS]
)
+
+ LIBS="$BASE_LIBS"
+ CLIENT_LIBS="$READLINE_LIBS $HISTORY_LIBS $TINFO_LIBS"
fi
AC_SUBST([CLIENT])
AC_SUBST([CLIENT_LIBS])