diff options
author | Marco Sirabella <marco@sirabella.org> | 2021-11-03 11:30:39 -0700 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2021-11-07 11:36:59 -0500 |
commit | bea73492114c95149733405205483ce56d11125a (patch) | |
tree | b73561d67e42b46aeda6856825f67e4ba2518746 | |
parent | 154339b5f1ea33e05b0a878e530a72a1d6da5008 (diff) | |
download | calcurse-bea73492114c95149733405205483ce56d11125a.tar.gz calcurse-bea73492114c95149733405205483ce56d11125a.zip |
Use AX_WITH_CURSES for curses library discovery
Properly discovers libtinfow for customized systems (e.g., Gentoo) while
offloading search handling to autoconf builtins.
Additionally adds autoconf-archive as a buildtime dependency.
Fixes #250.
Signed-off-by: Marco Sirabella <marco@sirabella.org>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r-- | .github/workflows/make.yml | 3 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | configure.ac | 27 |
3 files changed, 9 insertions, 22 deletions
diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index cbbe996..c9fe273 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install dependencies (Ubuntu) - run: sudo apt-get install asciidoc autopoint gettext xmlto + run: sudo apt-get install asciidoc autopoint gettext xmlto autoconf-archive if: matrix.os == 'ubuntu-latest' - name: Install dependencies (MacOS) run: | @@ -33,6 +33,7 @@ jobs: brew install asciidoc brew install gettext brew install xmlto + brew install autoconf-archive brew link --force gettext sudo mkdir /etc/xml sudo ln -s /usr/local/etc/xml/catalog /etc/xml/catalog @@ -14,6 +14,7 @@ files from core packages (i.e., \*-devel or \*-dev packages), you may need to install those as well: * gcc +* autoconf-archive * automake * autopoint * asciidoc diff --git a/configure.ac b/configure.ac index 1f6ec61..7405450 100644 --- a/configure.ac +++ b/configure.ac @@ -29,27 +29,12 @@ AC_CHECK_HEADERS([ctype.h getopt.h locale.h math.h signal.h stdio.h stdlib.h \ #------------------------------------------------------------------------------- # Checks for system libs #------------------------------------------------------------------------------- -AC_CHECK_FUNC(initscr,, -[ - available_ncurses="none" - for lib in ncursesw ncurses - do - AC_CHECK_LIB($lib, initscr, - [available_ncurses="$lib"; break]) - done - if test "$available_ncurses" = none; then - AC_MSG_ERROR(Either ncurses or ncursesw library is required to build calcurse!) - elif test "$available_ncurses" = ncursesw; then - AC_CHECK_HEADERS([ncursesw/ncurses.h],, - [AC_CHECK_HEADERS([ncurses.h],, - AC_MSG_ERROR([Missing ncursesw header file]))]) - else - AC_CHECK_HEADERS([ncurses/ncurses.h],, - [AC_CHECK_HEADERS([ncurses.h],, - AC_MSG_ERROR([Missing ncurses header file]))]) - fi - LIBS="$LIBS -l$available_ncurses" -]) +AX_WITH_CURSES +if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then + AC_MSG_ERROR(Either ncurses or ncursesw library is required to build calcurse!) +fi + +LIBS="$LIBS $CURSES_LIBS" AC_CHECK_HEADERS([pthread.h], [ AC_CHECK_LIB(pthread, pthread_create, [ |