X-Git-Url: https://git.octo.it/?p=liboping.git;a=blobdiff_plain;f=configure.ac;h=6ac83f9d9638197ed8bb688367e172cb1fce11e4;hp=ac067e99c20267858c4df09712a6b8bd858a8999;hb=HEAD;hpb=e2e3792234afd45625dba679ddbb661efc47f705 diff --git a/configure.ac b/configure.ac index ac067e9..6ac83f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,11 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([liboping],[1.7.0],[ff@octo.it],,[http://github.com/octo/liboping/]) +AC_INIT([liboping], + [1.10.0], + [liboping@verplant.org], + [], + [http://noping.cc/]) AC_CONFIG_SRCDIR([src/liboping.c]) AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -19,9 +23,9 @@ AC_SUBST(LIBOPING_MINOR) AC_SUBST(LIBOPING_PATCH) # ABI version -LIBOPING_CURRENT=2 -LIBOPING_REVISION=10 -LIBOPING_AGE=2 +LIBOPING_CURRENT=3 +LIBOPING_REVISION=0 +LIBOPING_AGE=3 AC_SUBST(LIBOPING_CURRENT) AC_SUBST(LIBOPING_REVISION) AC_SUBST(LIBOPING_AGE) @@ -46,7 +50,8 @@ AC_ARG_VAR(PERL, [Perl interpreter command]) LT_INIT([dlopen]) # pkg-config interface -PKG_INSTALLDIR +# PKG_INSTALLDIR is only available for pkg-config >= 0.27 +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], []) AC_ARG_WITH(pkgconfigdir, AC_HELP_STRING([--with-pkgconfigdir], [Use the specified pkgconfig dir (default is libdir/pkgconfig)]), @@ -195,34 +200,33 @@ fi AC_SUBST(LIBOPING_PC_LIBS_PRIVATE) -nanosleep_needs_rt="no" -AC_CHECK_FUNCS(nanosleep, [], - AC_CHECK_LIB(rt, nanosleep, - [nanosleep_needs_rt="yes"], - AC_MSG_ERROR(cannot find nanosleep))) -AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") +AC_SEARCH_LIBS([nanosleep],[rt],[], + [AC_MSG_ERROR([cannot find nanosleep])]) -with_ncurses="no" -AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], []) -if test "x$with_ncurses" = "xyes" -then - have_ncursesw="no" - have_ncurses="no" - NCURSES_LIB="" +AC_ARG_WITH(ncurses, AS_HELP_STRING([--with-ncurses], [Build oping CLI tool with ncurses support])) +AS_IF([test "x$with_ncurses" != "xno"], [ + can_build_with_ncurses="no" + PKG_CHECK_MODULES([NCURSES], [ncursesw], [can_build_with_ncurses=yes], [ + PKG_CHECK_MODULES([NCURSES], [ncurses], [can_build_with_ncurses=yes], [ + AC_CHECK_LIB(ncursesw, mvwprintw, [NCURSES_LIBS="-lncursesw"; can_build_with_ncurses=yes], [ + AC_CHECK_LIB(ncurses, mvwprintw, [NCURSES_LIBS="-lncurses"; can_build_with_ncurses=yes]) + ]) + ]) + ]) - AC_CHECK_LIB(ncursesw, mvwprintw, [have_ncursesw="yes"], [have_ncursesw="no"]) - AC_CHECK_LIB(ncurses, mvwprintw, [have_ncurses="yes"], [have_ncurses="no"]) + AS_IF([test "x$can_build_with_ncurses" = "xyes"], [ + AC_CHECK_HEADERS([ncursesw/curses.h ncursesw.h ncurses/curses.h ncurses.h], [can_build_with_ncurses=yes; break;], [can_build_with_ncurses=no]) + ]) - if test "x$have_ncursesw" = "xyes"; then - NCURSES_LIB="-lncursesw" - else if test "x$have_ncurses" = "xyes"; then - NCURSES_LIB="-lncurses" - else - with_ncurses="no" - fi; fi - AC_SUBST(NCURSES_LIB) -fi -AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" = "xyes") + AS_IF([test "x$can_build_with_ncurses" = "xno" && test "x$with_ncurses" = "xyes"], [ + AC_MSG_ERROR([ncurses not found but explicit enabled]) + ], + [test "x$can_build_with_ncurses" = "xno"], [ + AC_MSG_WARN([Will not build oping with ncurses support -- no suiteable ncurses installation found]) + ]) +]) + +AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" != "xno" && test "x$can_build_with_ncurses" = "xyes") AC_FUNC_STRERROR_R