diff --git a/m4/curses.m4 b/m4/curses.m4 index 792159c..572d321 100644 --- a/m4/curses.m4 +++ b/m4/curses.m4 @@ -1,144 +1,140 @@ dnl IU_LIB_NCURSES, IU_LIB_CURSES and IU_LIB_TERMCAP are: dnl Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. dnl Written by Miles Bader dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2, or (at your option) dnl any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl dnl IU_LIB_NCURSES -- check for, and configure, ncurses dnl dnl If libncurses is found to exist on this system and the --disable-ncurses dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate dnl -I flag to get access to ncurses include files. dnl AC_DEFUN([IU_LIB_NCURSES], [ AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses], , enable_ncurses=yes) if test "$enable_ncurses" = yes; then PKG_CHECK_MODULES([NCURSES], [ncursesw], [LIBNCURSES="${NCURSES_LIBS}" have_ncursesw=yes], [ PKG_CHECK_MODULES([NCURSES], [ncurses], [LIBNCURSES="${NCURSES_LIBS}" have_ncursesw=no], [ AC_CHECK_LIB(ncursesw, initscr, LIBNCURSES="-lncursesw", AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")) if test "$ac_cv_lib_ncursesw_initscr" = yes; then have_ncursesw=yes else have_ncursesw=no fi ]) ]) if test "$LIBNCURSES"; then # Use ncurses header files instead of the ordinary ones, if possible; # is there a better way of doing this, that avoids looking in specific # directories? - AC_ARG_WITH(ncurses-include-dir, -[ --with-ncurses-include-dir=DIR - Set directory containing the include files for + AC_ARG_WITH([ncurses-include-dir], + AS_HELP_STRING([--with-ncurses-include-dir=DIR], + [Set directory containing the include files for use with -lncurses, when it isn't installed as the default curses library. If DIR is "none", - then no special ncurses include files are used. - --without-ncurses-include-dir - Equivalent to --with-ncurses-include-dir=none])dnl + then no special ncurses include files are used.])) if test "${with_ncurses_include_dir+set}" = set; then AC_MSG_CHECKING(for ncurses include dir) case "$with_ncurses_include_dir" in no|none) inetutils_cv_includedir_ncurses=none;; *) inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; esac AC_MSG_RESULT($inetutils_cv_includedir_ncurses) else AC_CACHE_CHECK(for ncurses include dir, inetutils_cv_includedir_ncurses, if test "$have_ncursesw" = yes; then ncursesdir=ncursesw else ncursesdir=ncurses fi for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do if test -d $D/$ncursesdir; then inetutils_cv_includedir_ncurses="$D/$ncursesdir" break fi test "$inetutils_cv_includedir_ncurses" \ || inetutils_cv_includedir_ncurses=none done) fi if test "$inetutils_cv_includedir_ncurses" = none; then NCURSES_INCLUDE="" else NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" fi fi if test $have_ncursesw = yes; then AC_DEFINE(HAVE_NCURSESW, 1, [Define if you have working ncursesw]) fi fi AC_SUBST(NCURSES_INCLUDE) AC_SUBST(LIBNCURSES)])dnl dnl IU_LIB_TERMCAP -- check for various termcap libraries dnl dnl Checks for various common libraries implementing the termcap interface, dnl including ncurses (unless --disable ncurses is specified), curses (which dnl does on some systems), termcap, and termlib. If termcap is found, then dnl LIBTERMCAP is defined with the appropriate linker specification. dnl AC_DEFUN([IU_LIB_TERMCAP], [ AC_REQUIRE([IU_LIB_NCURSES]) if test "$LIBNCURSES"; then LIBTERMCAP="$LIBNCURSES" else AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses) if test "$ac_cv_lib_curses_tgetent" = no; then AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap) fi if test "$ac_cv_lib_termcap_tgetent" = no; then AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib) fi fi AC_SUBST(LIBTERMCAP)])dnl -dnl IU_LIB_CURSES -- checke for curses, and associated libraries +dnl IU_LIB_CURSES -- check for curses, and associated libraries dnl -dnl Checks for varions libraries implementing the curses interface, and if +dnl Checks for various libraries implementing the curses interface, and if dnl found, defines LIBCURSES to be the appropriate linker specification, dnl *including* any termcap libraries if needed (some versions of curses dnl don't need termcap). dnl AC_DEFUN([IU_LIB_CURSES], [ AC_REQUIRE([IU_LIB_TERMCAP]) AC_REQUIRE([IU_LIB_NCURSES]) if test "$LIBNCURSES"; then LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap else _IU_SAVE_LIBS="$LIBS" LIBS="$LIBTERMCAP" AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses") if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then AC_CACHE_CHECK(whether curses needs $LIBTERMCAP, inetutils_cv_curses_needs_termcap, LIBS="$LIBCURSES" - AC_TRY_LINK([#include ], [initscr ();], - [inetutils_cv_curses_needs_termcap=no], - [inetutils_cv_curses_needs_termcap=yes])) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[initscr ();]])],[inetutils_cv_curses_needs_termcap=no],[inetutils_cv_curses_needs_termcap=yes])) if test $inetutils_cv_curses_needs_termcap = yes; then LIBCURSES="$LIBCURSES $LIBTERMCAP" fi fi LIBS="$_IU_SAVE_LIBS" fi AC_SUBST(LIBCURSES)])dnl diff --git a/m4/qt.m4 b/m4/qt.m4 index bf77266..642312f 100644 --- a/m4/qt.m4 +++ b/m4/qt.m4 @@ -1,161 +1,161 @@ dnl qt.m4 dnl Copyright (C) 2015 Intevation GmbH dnl dnl This file is part of PINENTRY. dnl dnl PINENTRY is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl PINENTRY is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA dnl Autoconf macro to find either Qt4 or Qt5 dnl dnl sets PINENTRY_QT_LIBS and PINENTRY_QT_CFLAGS dnl dnl if QT5 was found have_qt5_libs is set to yes dnl if QT4 was found have_qt4_libs is set to yes dnl dnl The moc lookup code is based on libpoppler (rev. d821207) AC_DEFUN([FIND_QT], [ AC_ARG_ENABLE(pinentry-qt5, - AC_HELP_STRING([--disable-pinentry-qt5], + AS_HELP_STRING([--disable-pinentry-qt5], [Don't use qt5 even if it is available.]), enable_pinentry_qt5=$enableval, enable_pinentry_qt5="try") have_qt5_libs="no"; require_qt_cpp11="no"; if test "$enable_pinentry_qt5" != "no"; then PKG_CHECK_MODULES(PINENTRY_QT, Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0, [have_qt5_libs="yes"], [have_qt5_libs="no"]) if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic" fi fi if test "$have_qt5_libs" = "yes"; then PKG_CHECK_MODULES(PINENTRY_QT_REQUIRE_CPP11, Qt5Core >= 5.7.0, [require_qt_cpp11="yes"], [require_qt_cpp11="no"]) if test "${require_qt_cpp11}" = "yes"; then PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -std=c++11" fi qtlibdir=`"$PKG_CONFIG" --variable libdir Qt5Core` if test -n "$qtlibdir"; then if test "$enable_rpath" != "no"; then PINENTRY_QT_LDFLAGS="$PINENTRY_QT_LDFLAGS -Wl,-rpath \"$qtlibdir\"" fi fi if test "$have_x11" = "yes"; then PKG_CHECK_MODULES( PINENTRY_QT_X11_EXTRAS, Qt5X11Extras >= 5.1.0, [have_qt5_x11extras="yes"], [ AC_MSG_WARN([pinentry-qt will be built without Caps Lock warning on X11]) have_qt5_x11extras="no" ]) if test "$have_qt5_x11extras" = "yes"; then PINENTRY_QT_CFLAGS="$LIBX11_CFLAGS $PINENTRY_QT_CFLAGS $PINENTRY_QT_X11_EXTRAS_CFLAGS" PINENTRY_QT_LIBS="$LIBX11_LIBS $PINENTRY_QT_LIBS $PINENTRY_QT_X11_EXTRAS_LIBS" fi fi AC_CHECK_TOOL(MOC, moc) AC_MSG_CHECKING([moc version]) mocversion=`$MOC -v 2>&1` mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` if test x"$mocversiongrep" != x"$mocversion"; then AC_MSG_RESULT([no]) # moc was not the qt5 one, try with moc-qt5 AC_CHECK_TOOL(MOC2, moc-qt5) mocversion=`$MOC2 -v 2>&1` mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` if test x"$mocversiongrep" != x"$mocversion"; then AC_CHECK_TOOL(QTCHOOSER, qtchooser) qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` mocversion=`$qt5tooldir/moc -v 2>&1` mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` if test x"$mocversiongrep" != x"$mocversion"; then # no valid moc found have_qt5_libs="no"; else MOC=$qt5tooldir/moc fi else MOC=$MOC2 fi fi AC_CHECK_TOOL(RCC, rcc) AC_MSG_CHECKING([rcc version]) rccversion=`$RCC -v 2>&1` rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"` if test x"$rccversiongrep" != x"$rccversion"; then AC_MSG_RESULT([no]) # rcc was not the qt5 one, try with rcc-qt5 AC_CHECK_TOOL(RCC2, rcc-qt5) rccversion=`$RCC2 -v 2>&1` rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc-qt5 5|rcc 5"` if test x"$rccversiongrep" != x"$rccversion"; then AC_CHECK_TOOL(QTCHOOSER, qtchooser) qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` rccversion=`$qt5tooldir/rcc -v 2>&1` rccversiongrep=`echo $rccversion | grep -E "Qt 5|rcc 5"` if test x"$rccversiongrep" != x"$rccversion"; then # no valid rcc found have_qt5_libs="no"; else RCC=$qt5tooldir/rcc fi else RCC=$RCC2 fi fi fi if test "$have_qt5_libs" != "yes"; then PKG_CHECK_MODULES(PINENTRY_QT, QtCore >= 4.6.0 QtGui >= 4.6.0, [have_qt4_libs="yes"], [have_qt4_libs="no"]) if test "$have_qt4_libs" = "yes"; then AC_CHECK_TOOL(MOC, moc) AC_MSG_CHECKING([moc version]) mocversion=`$MOC -v 2>&1` mocversiongrep=`echo $mocversion | grep "Qt 4"` if test x"$mocversiongrep" != x"$mocversion"; then AC_MSG_RESULT([no]) # moc was not the qt4 one, try with moc-qt4 AC_CHECK_TOOL(MOC2, moc-qt4) mocversion=`$MOC2 -v 2>&1` mocversiongrep=`echo $mocversion | grep "Qt 4"` if test x"$mocversiongrep" != x"$mocversion"; then # no valid moc found have_qt4_libs="no"; MOC="not found" else MOC=$MOC2 fi fi fi fi ])