2004-09-27 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Mon, 27 Sep 2004 20:27:52 +0000 (20:27 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Mon, 27 Sep 2004 20:27:52 +0000 (20:27 +0000)
* acinclude.m4 (IU_LIB_NCURSES, IU_LIB_CURSES, IU_LIB_TERMCAP):
Moved to m4/curses.m4.
(AM_ICONV): Moved to m4/iconv.m4.
(AM_PATH_GLIB): Moved to m4/glib.m4.
(QT_FIND_FILE, QT_PATH_MOC, QT_PATH_X, QT_PRINT_PROGRAM,
QT_CHECK_VERSION, QT_PATH_1_3, QT_PATH, QT_CHECK_COMPILER_FLAG,
QT_REMOVE_FORBIDDEN, QT_VALIDIFY_CXXFLAGS, QT_CHECK_COMPILERS,
QT_CHECK_RPATH, QT_CHECK_LIBPTHREAD, QT_CHECK_PTHREAD_OPTION,
QT_CHECK_THREADING): Move to m4/qt.m4.

m4/
2004-09-27  Marcus Brinkmann  <marcus@g10code.de>

* curses.m4, glib.m4, gtk.m4, iconv.m4, qt.m4: New files.

ChangeLog
acinclude.m4
m4/ChangeLog
m4/curses.m4 [new file with mode: 0644]
m4/glib.m4 [new file with mode: 0644]
m4/gtk.m4 [new file with mode: 0644]
m4/iconv.m4 [new file with mode: 0644]
m4/qt.m4 [new file with mode: 0644]

index 8cd44ad..19de385 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-09-27  Marcus Brinkmann  <marcus@g10code.de>
+
+       * acinclude.m4 (IU_LIB_NCURSES, IU_LIB_CURSES, IU_LIB_TERMCAP):
+       Moved to m4/curses.m4.
+       (AM_ICONV): Moved to m4/iconv.m4.
+       (AM_PATH_GLIB): Moved to m4/glib.m4.
+       (QT_FIND_FILE, QT_PATH_MOC, QT_PATH_X, QT_PRINT_PROGRAM,
+       QT_CHECK_VERSION, QT_PATH_1_3, QT_PATH, QT_CHECK_COMPILER_FLAG,
+       QT_REMOVE_FORBIDDEN, QT_VALIDIFY_CXXFLAGS, QT_CHECK_COMPILERS,
+       QT_CHECK_RPATH, QT_CHECK_LIBPTHREAD, QT_CHECK_PTHREAD_OPTION,
+       QT_CHECK_THREADING): Move to m4/qt.m4.
+
 2004-09-21  Marcus Brinkmann  <marcus@g10code.de>
 
        * qt/Makefile.am (pinentry_qt_LDFLAGS): Add $(QT_RPATH).
index 7587ea7..3ab5240 100644 (file)
@@ -2,208 +2,6 @@ dnl Autoconf macros used by PINENTRY
 dnl
 dnl Copyright (C) 2002 g10 Code GmbH
 dnl
-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 <miles@gnu.ai.mit.edu>
-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
-    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
-    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
-                          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
-      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,
-         for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do
-           if test -d $D/ncurses; then
-             inetutils_cv_includedir_ncurses="$D/ncurses"
-             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
-  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
-dnl Checks for varions 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 <curses.h>], [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
-dnl additional configure macros
-
-#
-# From /usr/share/aclocal/iconv.m4.
-#
-#serial AM2
-
-dnl From Bruno Haible.
-
-AC_DEFUN([AM_ICONV],
-[
-  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
-  dnl those with the standalone portable GNU libiconv installed).
-
-  AC_ARG_WITH([libiconv-prefix],
-[  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
-    for dir in `echo "$withval" | tr : ' '`; do
-      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
-      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
-    done
-   ])
-
-  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
-    am_cv_func_iconv="no, consider installing GNU libiconv"
-    am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
-      am_cv_func_iconv=yes)
-    if test "$am_cv_func_iconv" != yes; then
-      am_save_LIBS="$LIBS"
-      LIBS="$LIBS -liconv"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-        am_cv_lib_iconv=yes
-        am_cv_func_iconv=yes)
-      LIBS="$am_save_LIBS"
-    fi
-  ])
-  if test "$am_cv_func_iconv" = yes; then
-    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
-    AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL(am_cv_proto_iconv, [
-      AC_TRY_COMPILE([
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
-    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([$]{ac_t:-
-         }[$]am_cv_proto_iconv)
-    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
-      [Define as const if the declaration of iconv() needs const.])
-  fi
-  LIBICONV=
-  if test "$am_cv_lib_iconv" = yes; then
-    LIBICONV="-liconv"
-  fi
-  AC_SUBST(LIBICONV)
-])
-
-
 dnl
 dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME)
 dnl Check whether a typedef exists and create a #define $2 if it exists
@@ -317,1102 +115,3 @@ define(GNUPG_CHECK_MLOCK,
          fi
     fi
   ])
-
-# Configure paths for GLIB
-# Owen Taylor     97-11-3
-
-dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
-dnl gthread is specified in MODULES, pass to glib-config
-dnl
-AC_DEFUN(AM_PATH_GLIB,
-[dnl 
-dnl Get the cflags and libraries from the glib-config script
-dnl
-AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
-            glib_config_prefix="$withval", glib_config_prefix="")
-AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
-            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
-AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
-                   , enable_glibtest=yes)
-
-  if test x$glib_config_exec_prefix != x ; then
-     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
-     if test x${GLIB_CONFIG+set} != xset ; then
-        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
-     fi
-  fi
-  if test x$glib_config_prefix != x ; then
-     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
-     if test x${GLIB_CONFIG+set} != xset ; then
-        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
-     fi
-  fi
-
-  for module in . $4
-  do
-      case "$module" in
-         gmodule) 
-             glib_config_args="$glib_config_args gmodule"
-         ;;
-         gthread) 
-             glib_config_args="$glib_config_args gthread"
-         ;;
-      esac
-  done
-
-  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
-  min_glib_version=ifelse([$1], ,0.99.7,$1)
-  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
-  no_glib=""
-  if test "$GLIB_CONFIG" = "no" ; then
-    no_glib=yes
-  else
-    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
-    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
-    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_glibtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GLIB_CFLAGS"
-      LIBS="$GLIB_LIBS $LIBS"
-dnl
-dnl Now check if the installed GLIB is sufficiently new. (Also sanity
-dnl checks the results of glib-config to some extent
-dnl
-      rm -f conf.glibtest
-      AC_TRY_RUN([
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int 
-main ()
-{
-  int major, minor, micro;
-  char *tmp_version;
-
-  system ("touch conf.glibtest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = g_strdup("$min_glib_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_glib_version");
-     exit(1);
-   }
-
-  if ((glib_major_version != $glib_config_major_version) ||
-      (glib_minor_version != $glib_config_minor_version) ||
-      (glib_micro_version != $glib_config_micro_version))
-    {
-      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
-             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
-             glib_major_version, glib_minor_version, glib_micro_version);
-      printf ("*** was found! If glib-config was correct, then it is best\n");
-      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
-      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
-      printf("*** before re-running configure\n");
-    } 
-  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
-          (glib_minor_version != GLIB_MINOR_VERSION) ||
-           (glib_micro_version != GLIB_MICRO_VERSION))
-    {
-      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
-            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
-      printf("*** library (version %d.%d.%d)\n",
-            glib_major_version, glib_minor_version, glib_micro_version);
-    }
-  else
-    {
-      if ((glib_major_version > major) ||
-        ((glib_major_version == major) && (glib_minor_version > minor)) ||
-        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
-               glib_major_version, glib_minor_version, glib_micro_version);
-        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
-              major, minor, micro);
-        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
-        printf("*** correct copy of glib-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_glib" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-     if test "$GLIB_CONFIG" = "no" ; then
-       echo "*** The glib-config script installed by GLIB could not be found"
-       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
-       echo "*** full path to glib-config."
-     else
-       if test -f conf.glibtest ; then
-        :
-       else
-          echo "*** Could not run GLIB test program, checking why..."
-          CFLAGS="$CFLAGS $GLIB_CFLAGS"
-          LIBS="$LIBS $GLIB_LIBS"
-          AC_TRY_LINK([
-#include <glib.h>
-#include <stdio.h>
-],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
-          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-         echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***"
-          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
-          echo "*** came with the system with the command"
-          echo "***"
-          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
-          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
-          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     GLIB_CFLAGS=""
-     GLIB_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(GLIB_CFLAGS)
-  AC_SUBST(GLIB_LIBS)
-  rm -f conf.glibtest
-])
-
-
-# Configure paths for GTK+
-# Owen Taylor     97-11-3
-
-dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
-dnl
-AC_DEFUN(AM_PATH_GTK,
-[dnl 
-dnl Get the cflags and libraries from the gtk-config script
-dnl
-AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
-            gtk_config_prefix="$withval", gtk_config_prefix="")
-AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
-            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
-AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
-                   , enable_gtktest=yes)
-
-  for module in . $4
-  do
-      case "$module" in
-         gthread) 
-             gtk_config_args="$gtk_config_args gthread"
-         ;;
-      esac
-  done
-
-  if test x$gtk_config_exec_prefix != x ; then
-     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
-     if test x${GTK_CONFIG+set} != xset ; then
-        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
-     fi
-  fi
-  if test x$gtk_config_prefix != x ; then
-     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
-     if test x${GTK_CONFIG+set} != xset ; then
-        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
-     fi
-  fi
-
-  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
-  min_gtk_version=ifelse([$1], ,0.99.7,$1)
-  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
-  no_gtk=""
-  if test "$GTK_CONFIG" = "no" ; then
-    no_gtk=yes
-  else
-    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
-    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
-    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    if test "x$enable_gtktest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GTK_CFLAGS"
-      LIBS="$GTK_LIBS $LIBS"
-dnl
-dnl Now check if the installed GTK is sufficiently new. (Also sanity
-dnl checks the results of gtk-config to some extent
-dnl
-      rm -f conf.gtktest
-      AC_TRY_RUN([
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int 
-main ()
-{
-  int major, minor, micro;
-  char *tmp_version;
-
-  system ("touch conf.gtktest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = g_strdup("$min_gtk_version");
-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_gtk_version");
-     exit(1);
-   }
-
-  if ((gtk_major_version != $gtk_config_major_version) ||
-      (gtk_minor_version != $gtk_config_minor_version) ||
-      (gtk_micro_version != $gtk_config_micro_version))
-    {
-      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
-             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
-             gtk_major_version, gtk_minor_version, gtk_micro_version);
-      printf ("*** was found! If gtk-config was correct, then it is best\n");
-      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
-      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
-      printf("*** before re-running configure\n");
-    } 
-#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
-  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
-          (gtk_minor_version != GTK_MINOR_VERSION) ||
-           (gtk_micro_version != GTK_MICRO_VERSION))
-    {
-      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
-            GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
-      printf("*** library (version %d.%d.%d)\n",
-            gtk_major_version, gtk_minor_version, gtk_micro_version);
-    }
-#endif /* defined (GTK_MAJOR_VERSION) ... */
-  else
-    {
-      if ((gtk_major_version > major) ||
-        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
-        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
-               gtk_major_version, gtk_minor_version, gtk_micro_version);
-        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
-              major, minor, micro);
-        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
-        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_gtk" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])     
-  else
-     AC_MSG_RESULT(no)
-     if test "$GTK_CONFIG" = "no" ; then
-       echo "*** The gtk-config script installed by GTK could not be found"
-       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the GTK_CONFIG environment variable to the"
-       echo "*** full path to gtk-config."
-     else
-       if test -f conf.gtktest ; then
-        :
-       else
-          echo "*** Could not run GTK test program, checking why..."
-          CFLAGS="$CFLAGS $GTK_CFLAGS"
-          LIBS="$LIBS $GTK_LIBS"
-          AC_TRY_LINK([
-#include <gtk/gtk.h>
-#include <stdio.h>
-],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GTK or finding the wrong"
-          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-         echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***"
-          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
-          echo "*** came with the system with the command"
-          echo "***"
-          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
-          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
-          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     GTK_CFLAGS=""
-     GTK_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(GTK_CFLAGS)
-  AC_SUBST(GTK_LIBS)
-  rm -f conf.gtktest
-])
-##   -*- autoconf -*-
-
-
-dnl    This file is part of the KDE libraries/packages
-dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
-dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
-dnl              (C) 2002 g10 Code GmbH
-dnl              Modified for PINENTRY by Marcus Brinkmann.
-dnl
-dnl    This file is free software; you can redistribute it and/or
-dnl    modify it under the terms of the GNU Library General Public
-dnl    License as published by the Free Software Foundation; either
-dnl    version 2 of the License, or (at your option) any later version.
-
-dnl    This library 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 GNU
-dnl    Library General Public License for more details.
-
-dnl    You should have received a copy of the GNU Library General Public License
-dnl    along with this library; see the file COPYING.LIB.  If not, write to
-dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-dnl    Boston, MA 02111-1307, USA.
-
-dnl ------------------------------------------------------------------------
-dnl Find a file (or one of more files in a list of dirs)
-dnl ------------------------------------------------------------------------
-dnl
-AC_DEFUN(QT_FIND_FILE,
-[
-$3=NO
-for i in $2;
-do
-  for j in $1;
-  do
-    echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD
-    if test -r "$i/$j"; then
-      echo "taking that" >&AS_MESSAGE_LOG_FD
-      $3=$i
-      break 2
-    fi
-  done
-done
-])
-
-dnl ------------------------------------------------------------------------
-dnl Find the meta object compiler in the PATH,
-dnl in $QTDIR/bin, and some more usual places
-dnl ------------------------------------------------------------------------
-dnl
-AC_DEFUN(QT_PATH_MOC,
-[
-   qt_bindirs=""
-   for dir in $qt_dirs; do
-      qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc"
-   done
-   qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin"
-   if test ! "$ac_qt_bindir" = "NO"; then
-      qt_bindirs="$ac_qt_bindir:$qt_bindirs"
-   fi
-
-   AC_PATH_PROG(MOC, moc, no, [$qt_bindirs])
-   if test "$MOC" = no; then
-    #AC_MSG_ERROR([No Qt meta object compiler (moc) found!
-    #Please check whether you installed Qt correctly.
-    #You need to have a running moc binary.
-    #configure tried to run $ac_cv_path_moc and the test didn't
-    #succeed. If configure shouldn't have tried this one, set
-    #the environment variable MOC to the right one before running
-    #configure.
-    #])
-    have_moc="no"
-   else
-    have_moc="yes"
-    AC_SUBST(MOC)
-   fi
-])
-
-
-dnl ------------------------------------------------------------------------
-dnl Find the header files and libraries for the X Window System.
-dnl Extended the macro AC_PATH_XTRA.
-dnl ------------------------------------------------------------------------
-dnl
-AC_DEFUN(QT_PATH_X,
-[
-AC_ARG_ENABLE(
-  embedded,
-  [  --enable-embedded       link to Qt-embedded, don't use X],
-  qt_use_emb=$enableval,
-  qt_use_emb=no
-)
-
-AC_ARG_ENABLE(
-  palmtop,
-  [  --enable-palmtop       link to Qt-embedded, don't use X, link to the Qt Palmtop Environment],
-  qt_use_emb_palm=$enableval,
-  qt_use_emb_palm=no
-)
-
-if test "$qt_use_emb" = "no"; then
-  AC_PATH_X
-  AC_PATH_XTRA
-  if test "$no_x" = yes; then
-    AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!])
-  fi
-  QT_CXXFLAGS="$X_CFLAGS"
-  QT_LDFLAGS="$X_LIBS"
-  QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
-  QTE_NORTTI=""
-else
-  dnl We're using QT Embedded
-  QT_CXXFLAGS="-fno-rtti -DQWS"
-  QT_LDFLAGS="-DQWS"
-  QT_LIBS=""
-  QTE_NORTTI="-fno-rtti -DQWS"
-fi
-AC_SUBST(QT_CXXFLAGS)
-AC_SUBST(QT_LDFLAGS)
-AC_SUBST(QT_LIBS)
-AC_SUBST(QTE_NORTTI)
-])
-
-AC_DEFUN(QT_PRINT_PROGRAM,
-[
-AC_REQUIRE([QT_CHECK_VERSION])
-cat > conftest.$ac_ext <<EOF
-#include "confdefs.h"
-#include <qglobal.h>
-#include <qapplication.h>
-EOF
-if test "$qt_ver" = "2"; then
-cat >> conftest.$ac_ext <<EOF
-#include <qevent.h>
-#include <qstring.h>
-#include <qstyle.h>
-EOF
-
-if test $qt_subver -gt 0; then
-cat >> conftest.$ac_ext <<EOF
-#include <qiconview.h>
-EOF
-fi
-fi
-
-if test "$qt_ver" = "3"; then
-cat >> conftest.$ac_ext <<EOF
-#include <qcursor.h>
-#include <qstylefactory.h>
-#include <private/qucomextra_p.h>
-EOF
-fi
-
-echo "#if ! ($qt_verstring)" >> conftest.$ac_ext
-cat >> conftest.$ac_ext <<EOF
-#error 1
-#endif
-
-int main() {
-EOF
-if test "$qt_ver" = "2"; then
-cat >> conftest.$ac_ext <<EOF
-    QStringList *t = new QStringList();
-    Q_UNUSED(t);
-EOF
-if test $qt_subver -gt 0; then
-cat >> conftest.$ac_ext <<EOF
-    QIconView iv(0);
-    iv.setWordWrapIconText(false);
-    QString s;
-    s.setLatin1("Elvis is alive", 14);
-EOF
-fi
-fi
-if test "$qt_ver" = "3"; then
-cat >> conftest.$ac_ext <<EOF
-    (void)QStyleFactory::create(QString::null);
-    QCursor c(Qt::WhatsThisCursor);
-EOF
-fi
-cat >> conftest.$ac_ext <<EOF
-    return 0;
-}
-EOF
-])
-
-
-AC_DEFUN(QT_CHECK_VERSION,
-[
-if test -z "$1"; then
-  qt_ver=3
-  qt_subver=1
-else
-  qt_subver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
-  # following is the check if subversion isn´t found in passed argument
-  if test "$qt_subver" = "$1"; then
-    qt_subver=1
-  fi
-  qt_ver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
-  if test "$qt_ver" = "1"; then
-    qt_subver=42
-  fi
-fi
-
-if test -z "$2"; then
-  if test "$qt_ver" = "2"; then
-    if test $qt_subver -gt 0; then
-      qt_minversion=">= Qt 2.2.2"
-    else
-      qt_minversion=">= Qt 2.0.2"
-    fi
-  fi
-  if test "$qt_ver" = "3"; then
-    qt_minversion=">= Qt 3.0.1"
-  fi
-  if test "$qt_ver" = "1"; then
-    qt_minversion=">= 1.42 and < 2.0"
-  fi
-else
-   qt_minversion=$2
-fi
-
-if test -z "$3"; then
-   if test $qt_ver = 3; then
-     qt_verstring="QT_VERSION >= 301"
-   fi
-   if test $qt_ver = 2; then
-     if test $qt_subver -gt 0; then
-       qt_verstring="QT_VERSION >= 222"
-     else
-       qt_verstring="QT_VERSION >= 200"
-     fi
-   fi
-   if test $qt_ver = 1; then
-    qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
-   fi
-else
-   qt_verstring=$3
-fi
-
-if test $qt_ver = 3; then
-  qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
-fi
-if test $qt_ver = 2; then
-  qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
-fi
-if test $qt_ver = 1; then
-  qt_dirs="$QTDIR /usr/lib/qt"
-fi
-])
-
-
-dnl ------------------------------------------------------------------------
-dnl Try to find the Qt headers and libraries.
-dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
-dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
-dnl ------------------------------------------------------------------------
-dnl
-AC_DEFUN(QT_PATH_1_3,
-[
-AC_REQUIRE([QT_PATH_X])
-AC_REQUIRE([QT_CHECK_VERSION])
-
-dnl ------------------------------------------------------------------------
-dnl Add configure flag to enable linking to MT version of Qt library.
-dnl ------------------------------------------------------------------------
-
-AC_ARG_ENABLE(
-  mt,
-  [  --disable-mt            link to non-threaded Qt (deprecated)],
-  qt_use_mt=$enableval,
-  [
-    if test $qt_ver = 3; then
-      qt_use_mt=yes
-    else
-      qt_use_mt=no
-    fi
-  ]
-)
-
-USING_QT_MT=""
-
-dnl ------------------------------------------------------------------------
-dnl If we not get --disable-qt-mt then adjust some vars for the host.
-dnl ------------------------------------------------------------------------
-
-QT_MT_LDFLAGS=
-QT_MT_LIBS=
-if test "x$qt_use_mt" = "xyes"; then
-  QT_CHECK_THREADING
-  if test "x$qt_use_threading" = "xyes"; then
-    QT_CXXFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $QT_CXXFLAGS"
-    QT_MT_LDFLAGS="$USE_THREADS"
-    QT_MT_LIBS="$LIBPTHREAD"
-  else
-    qt_use_mt=no
-  fi
-fi
-AC_SUBST(QT_MT_LDFLAGS)
-AC_SUBST(QT_MT_LIBS)
-
-dnl ------------------------------------------------------------------------
-dnl If we haven't been told how to link to Qt, we work it out for ourselves.
-dnl ------------------------------------------------------------------------
-if test -z "$LIBQT_GLOB"; then
-  if test "x$qt_use_emb" = "xyes"; then
-    LIBQT_GLOB="libqte.*"
-  else
-    LIBQT_GLOB="libqt.*"
-  fi
-fi
-
-if test -z "$LIBQT"; then
-dnl ------------------------------------------------------------
-dnl If we got --enable-embedded then adjust the Qt library name.
-dnl ------------------------------------------------------------
-  if test "x$qt_use_emb" = "xyes"; then
-    qtlib="qte"
-  else
-    qtlib="qt"
-  fi
-fi
-
-if test -z "$LIBQPE"; then
-dnl ------------------------------------------------------------
-dnl If we got --enable-palmtop then add -lqpe to the link line
-dnl ------------------------------------------------------------
-  if test "x$qt_use_emb" = "xyes"; then
-    if test "x$qt_use_emb_palm" = "xyes"; then
-      LIB_QPE="-lqpe"
-    else
-      LIB_QPE=""
-    fi
-  else
-    LIB_QPE=""
-  fi
-fi
-
-dnl ------------------------------------------------------------------------
-dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
-dnl ------------------------------------------------------------------------
-
-if test "x$qt_use_mt" = "xyes"; then
-  if test -z "$LIBQT"; then
-    LIBQT="-l$qtlib-mt"
-  else
-    LIBQT="$qtlib-mt"
-  fi
-  LIBQT_GLOB="lib$qtlib-mt.*"
-  USING_QT_MT="using -mt"
-else
-  LIBQT="-l$qtlib"
-fi
-
-AC_MSG_CHECKING([for Qt])
-
-QT_LIBS="$LIBQT $QT_LIBS"
-test -z "$QT_MT_LIBS" || QT_LIBS="$QT_LIBS $QT_MT_LIBS"
-
-ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
-qt_libraries=""
-qt_includes=""
-AC_ARG_WITH(qt-dir,
-    [  --with-qt-dir=DIR       where the root of Qt is installed ],
-    [  ac_qt_includes="$withval"/include
-       ac_qt_libraries="$withval"/lib
-       ac_qt_bindir="$withval"/bin
-    ])
-
-AC_ARG_WITH(qt-includes,
-    [  --with-qt-includes=DIR  where the Qt includes are. ],
-    [
-       ac_qt_includes="$withval"
-    ])
-
-kde_qt_libs_given=no
-
-AC_ARG_WITH(qt-libraries,
-    [  --with-qt-libraries=DIR where the Qt library is installed.],
-    [  ac_qt_libraries="$withval"
-       kde_qt_libs_given=yes
-    ])
-
-AC_CACHE_VAL(ac_cv_have_qt,
-[#try to guess Qt locations
-
-qt_incdirs=""
-for dir in $qt_dirs; do
-   qt_incdirs="$qt_incdirs $dir/include $dir"
-done
-qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include  /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
-if test ! "$ac_qt_includes" = "NO"; then
-   qt_incdirs="$ac_qt_includes $qt_incdirs"
-fi
-
-if test "$qt_ver" != "1"; then
-  kde_qt_header=qstyle.h
-else
-  kde_qt_header=qglobal.h
-fi
-
-QT_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
-ac_qt_includes="$qt_incdir"
-
-qt_libdirs=""
-for dir in $qt_dirs; do
-   qt_libdirs="$qt_libdirs $dir/lib $dir"
-done
-qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
-if test ! "$ac_qt_libraries" = "NO"; then
-  qt_libdir=$ac_qt_libraries
-else
-  qt_libdirs="$ac_qt_libraries $qt_libdirs"
-  # if the Qt was given, the chance is too big that libqt.* doesn't exist
-  qt_libdir=NONE
-  for dir in $qt_libdirs; do
-    try="ls -1 $dir/${LIBQT_GLOB}"
-    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi
-  done
-fi
-
-ac_qt_libraries="$qt_libdir"
-
-AC_LANG_PUSH(C++)
-
-ac_cxxflags_safe="$CXXFLAGS"
-ac_ldflags_safe="$LDFLAGS"
-ac_libs_safe="$LIBS"
-
-CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS"
-LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS"
-LIBS="$LIBS $QT_LIBS"
-
-QT_PRINT_PROGRAM
-
-if AC_TRY_EVAL(ac_link) && test -s conftest; then
-  rm -f conftest*
-else
-  echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
-  cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-  ac_qt_libraries="NO"
-fi
-rm -f conftest*
-CXXFLAGS="$ac_cxxflags_safe"
-LDFLAGS="$ac_ldflags_safe"
-LIBS="$ac_libs_safe"
-
-AC_LANG_POP(C++)
-if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
-  ac_cv_have_qt="have_qt=no"
-  ac_qt_notfound=""
-  missing_qt_mt=""
-  if test "$ac_qt_includes" = NO; then
-    if test "$ac_qt_libraries" = NO; then
-      ac_qt_notfound="(headers and libraries)";
-    else
-      ac_qt_notfound="(headers)";
-    fi
-  else
-    if test "x$qt_use_mt" = "xyes"; then
-       missing_qt_mt="
-Make sure that you have compiled Qt with thread support!"
-       ac_qt_notfound="(library $qtlib-mt)";
-    else
-       ac_qt_notfound="(library $qtlib)";
-    fi
-  fi
-
-  #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation!
-  #For more details about this problem, look at the end of config.log.$missing_qt_mt])
-  have_qt="no"
-else
-  have_qt="yes"
-fi
-])
-
-eval "$ac_cv_have_qt"
-
-if test "$have_qt" != yes; then
-  AC_MSG_RESULT([$have_qt]);
-else
-  ac_cv_have_qt="have_qt=yes \
-    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
-  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
-
-  qt_libraries="$ac_qt_libraries"
-  qt_includes="$ac_qt_includes"
-fi
-
-AC_SUBST(qt_libraries)
-AC_SUBST(qt_includes)
-
-if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
- QT_INCLUDES=""
-else
- QT_INCLUDES="-I$qt_includes"
-fi
-
-if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then
- QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries"
-fi
-test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS"
-
-AC_SUBST(QT_INCLUDES)
-QT_PATH_MOC
-
-
-AC_SUBST(LIB_QPE)
-])
-
-AC_DEFUN(QT_PATH,
-[
-QT_PATH_1_3
-QT_CHECK_RPATH
-])
-
-
-AC_DEFUN(QT_CHECK_COMPILER_FLAG,
-[
-AC_MSG_CHECKING(whether $CXX supports -$1)
-kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
-AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
-[
-  AC_LANG_PUSH(C++)
-  save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS -$1"
-  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
-  CXXFLAGS="$save_CXXFLAGS"
-  AC_LANG_POP(C++)
-])
-if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
- AC_MSG_RESULT(yes)
- :
- $2
-else
- AC_MSG_RESULT(no)
- :
- $3
-fi
-])
-
-dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables
-dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
-dnl it's all white-space separated
-AC_DEFUN(QT_REMOVE_FORBIDDEN,
-[ __val=$$1
-  __forbid=" $2 "
-  if test -n "$__val"; then
-    __new=""
-    ac_save_IFS=$IFS
-    IFS="      "
-    for i in $__val; do
-      case "$__forbid" in
-        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
-       *) # Careful to not add spaces, where there were none, because otherwise
-          # libtool gets confused, if we change e.g. CXX
-          if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
-      esac
-    done
-    IFS=$ac_save_IFS
-    $1=$__new
-  fi
-])
-
-dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
-AC_DEFUN(QT_VALIDIFY_CXXFLAGS,
-[dnl
-if test "x$qt_use_emb" != "xyes"; then
- QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
- QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
-else
- QT_REMOVE_FORBIDDEN(CXX, [-rpath])
- QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
-fi
-])
-
-AC_DEFUN(QT_CHECK_COMPILERS,
-[
-  AC_PROG_CXX
-
-  QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"])
-
-  case "$host" in
-      *-*-irix*)  test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;;
-      *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";;
-      *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";;
-      *-*-solaris*) 
-        if test "$GXX" = yes; then
-          libstdcpp=`$CXX -print-file-name=libstdc++.so`
-          if test ! -f $libstdcpp; then
-             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so])
-          fi
-        fi
-        ;;
-  esac
-
-  QT_VALIDIFY_CXXFLAGS
-
-  AC_PROG_CXXCPP
-])
-
-AC_DEFUN(QT_CHECK_RPATH,
-[
-AC_MSG_CHECKING(for rpath)
-AC_ARG_ENABLE(rpath,
-      [  --disable-rpath         do not use the rpath feature of ld],
-      USE_RPATH=$enableval, USE_RPATH=yes)
-
-if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then
-
-  QT_RPATH=""
-  if test -n "$qt_libraries"; then
-    QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)"
-  fi
-  dnl $x_libraries is set to /usr/lib in case
-  if test -n "$X_LIBS"; then
-    QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)"
-  fi
-fi
-AC_SUBST(x_libraries)
-AC_SUBST(QT_RPATH)
-AC_MSG_RESULT($USE_RPATH)
-])
-
-
-AC_DEFUN(QT_CHECK_LIBPTHREAD,
-[
-AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
-AC_SUBST(LIBPTHREAD)
-])
-
-AC_DEFUN(QT_CHECK_PTHREAD_OPTION,
-[
-    AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
-       kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
-
-    if test "$kde_use_kernthreads" = "yes"; then
-      ac_save_CXXFLAGS="$CXXFLAGS"
-      ac_save_CFLAGS="$CXXFLAGS"
-      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
-      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
-      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
-      CXXFLAGS="$ac_save_CXXFLAGS"
-      CFLAGS="$ac_save_CFLAGS"
-      if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
-        kde_use_kernthreads=no
-      else
-        dnl Add proper -I and -l statements
-        AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
-        if test "x$LIBPTHREAD" = "x"; then
-          kde_use_kernthreads=no
-        else
-          USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
-        fi
-      fi
-    else 
-      USE_THREADS=""
-      if test -z "$LIBPTHREAD"; then
-        QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
-      fi
-    fi
-
-    case $host_os in
-       solaris*)
-               QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
-                QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
-               ;;
-        freebsd*)
-                QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
-                ;;
-        aix*)
-                QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
-                LIBPTHREAD="$LIBPTHREAD -lc_r"
-                ;;
-        linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT"
-                if test "$CXX" = "KCC"; then
-                  QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe"
-                fi
-                ;;
-       *)
-               ;;
-    esac
-    AC_SUBST(USE_THREADS)
-    AC_SUBST(LIBPTHREAD)
-])
-
-AC_DEFUN(QT_CHECK_THREADING,
-[
-  AC_REQUIRE([QT_CHECK_LIBPTHREAD])
-  AC_REQUIRE([QT_CHECK_PTHREAD_OPTION])
-  dnl default is yes if libpthread is found and no if no libpthread is available
-  if test -z "$LIBPTHREAD"; then
-    if test -z "$USE_THREADS"; then
-      kde_check_threading_default=no
-    else
-      kde_check_threading_default=yes
-    fi
-  else
-    kde_check_threading_default=yes
-  fi
-  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
-   qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default)
-  if test "x$qt_use_threading" = "xyes"; then
-    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
-  fi
-])
index e69de29..6f041c9 100644 (file)
@@ -0,0 +1,5 @@
+2004-09-27  Marcus Brinkmann  <marcus@g10code.de>
+
+       * curses.m4, glib.m4, gtk.m4, iconv.m4, qt.m4: New files.
+       
+
diff --git a/m4/curses.m4 b/m4/curses.m4
new file mode 100644 (file)
index 0000000..1e1cb4f
--- /dev/null
@@ -0,0 +1,126 @@
+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 <miles@gnu.ai.mit.edu>
+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
+    AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses")
+    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
+                          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
+      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,
+         for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do
+           if test -d $D/ncurses; then
+             inetutils_cv_includedir_ncurses="$D/ncurses"
+             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
+  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
+dnl Checks for varions 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 <curses.h>], [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/glib.m4 b/m4/glib.m4
new file mode 100644 (file)
index 0000000..b8094bb
--- /dev/null
@@ -0,0 +1,196 @@
+# Configure paths for GLIB
+# Owen Taylor     97-11-3
+
+dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
+dnl gthread is specified in MODULES, pass to glib-config
+dnl
+AC_DEFUN(AM_PATH_GLIB,
+[dnl 
+dnl Get the cflags and libraries from the glib-config script
+dnl
+AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
+            glib_config_prefix="$withval", glib_config_prefix="")
+AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
+            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
+                   , enable_glibtest=yes)
+
+  if test x$glib_config_exec_prefix != x ; then
+     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
+     fi
+  fi
+  if test x$glib_config_prefix != x ; then
+     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
+     if test x${GLIB_CONFIG+set} != xset ; then
+        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
+     fi
+  fi
+
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             glib_config_args="$glib_config_args gmodule"
+         ;;
+         gthread) 
+             glib_config_args="$glib_config_args gthread"
+         ;;
+      esac
+  done
+
+  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
+  min_glib_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+  no_glib=""
+  if test "$GLIB_CONFIG" = "no" ; then
+    no_glib=yes
+  else
+    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
+    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
+    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of glib-config to some extent
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If glib-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
+      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+          (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+            glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
+        printf("*** correct copy of glib-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GLIB_CONFIG" = "no" ; then
+       echo "*** The glib-config script installed by GLIB could not be found"
+       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
+       echo "*** full path to glib-config."
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
+          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
+          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  rm -f conf.glibtest
+])
diff --git a/m4/gtk.m4 b/m4/gtk.m4
new file mode 100644 (file)
index 0000000..b8cf402
--- /dev/null
+++ b/m4/gtk.m4
@@ -0,0 +1,194 @@
+# Configure paths for GTK+
+# Owen Taylor     97-11-3
+
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
+dnl
+AC_DEFUN(AM_PATH_GTK,
+[dnl 
+dnl Get the cflags and libraries from the gtk-config script
+dnl
+AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
+            gtk_config_prefix="$withval", gtk_config_prefix="")
+AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
+            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
+AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
+                   , enable_gtktest=yes)
+
+  for module in . $4
+  do
+      case "$module" in
+         gthread) 
+             gtk_config_args="$gtk_config_args gthread"
+         ;;
+      esac
+  done
+
+  if test x$gtk_config_exec_prefix != x ; then
+     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+     fi
+  fi
+  if test x$gtk_config_prefix != x ; then
+     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+     if test x${GTK_CONFIG+set} != xset ; then
+        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+     fi
+  fi
+
+  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
+  min_gtk_version=ifelse([$1], ,0.99.7,$1)
+  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
+  no_gtk=""
+  if test "$GTK_CONFIG" = "no" ; then
+    no_gtk=yes
+  else
+    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gtktest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GTK_CFLAGS"
+      LIBS="$GTK_LIBS $LIBS"
+dnl
+dnl Now check if the installed GTK is sufficiently new. (Also sanity
+dnl checks the results of gtk-config to some extent
+dnl
+      rm -f conf.gtktest
+      AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gtktest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_gtk_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gtk_version");
+     exit(1);
+   }
+
+  if ((gtk_major_version != $gtk_config_major_version) ||
+      (gtk_minor_version != $gtk_config_minor_version) ||
+      (gtk_micro_version != $gtk_config_micro_version))
+    {
+      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
+             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+             gtk_major_version, gtk_minor_version, gtk_micro_version);
+      printf ("*** was found! If gtk-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
+  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
+          (gtk_minor_version != GTK_MINOR_VERSION) ||
+           (gtk_micro_version != GTK_MICRO_VERSION))
+    {
+      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
+            GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+            gtk_major_version, gtk_minor_version, gtk_micro_version);
+    }
+#endif /* defined (GTK_MAJOR_VERSION) ... */
+  else
+    {
+      if ((gtk_major_version > major) ||
+        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+               gtk_major_version, gtk_minor_version, gtk_micro_version);
+        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gtk" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GTK_CONFIG" = "no" ; then
+       echo "*** The gtk-config script installed by GTK could not be found"
+       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GTK_CONFIG environment variable to the"
+       echo "*** full path to gtk-config."
+     else
+       if test -f conf.gtktest ; then
+        :
+       else
+          echo "*** Could not run GTK test program, checking why..."
+          CFLAGS="$CFLAGS $GTK_CFLAGS"
+          LIBS="$LIBS $GTK_LIBS"
+          AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GTK or finding the wrong"
+          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+          echo "*** came with the system with the command"
+          echo "***"
+          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GTK_CFLAGS=""
+     GTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GTK_CFLAGS)
+  AC_SUBST(GTK_LIBS)
+  rm -f conf.gtktest
+])
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644 (file)
index 0000000..c5f3579
--- /dev/null
@@ -0,0 +1,103 @@
+# iconv.m4 serial AM4 (gettext-0.11.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+  dnl those with the standalone portable GNU libiconv installed).
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libiconv and not disabled its use
+  dnl via --without-libiconv-prefix, he wants to use it. The first
+  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  am_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+      [iconv_t cd = iconv_open("","");
+       iconv(cd,NULL,NULL,NULL,NULL);
+       iconv_close(cd);],
+      am_cv_func_iconv=yes)
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+        [iconv_t cd = iconv_open("","");
+         iconv(cd,NULL,NULL,NULL,NULL);
+         iconv_close(cd);],
+        am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes)
+      LIBS="$am_save_LIBS"
+    fi
+  ])
+  if test "$am_cv_func_iconv" = yes; then
+    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    AC_MSG_CHECKING([how to link with libiconv])
+    AC_MSG_RESULT([$LIBICONV])
+  else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+  AC_SUBST(LIBICONV)
+  AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+  AM_ICONV_LINK
+  if test "$am_cv_func_iconv" = yes; then
+    AC_MSG_CHECKING([for iconv declaration])
+    AC_CACHE_VAL(am_cv_proto_iconv, [
+      AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+    AC_MSG_RESULT([$]{ac_t:-
+         }[$]am_cv_proto_iconv)
+    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+      [Define as const if the declaration of iconv() needs const.])
+  fi
+])
diff --git a/m4/qt.m4 b/m4/qt.m4
new file mode 100644 (file)
index 0000000..2f1a7d0
--- /dev/null
+++ b/m4/qt.m4
@@ -0,0 +1,706 @@
+##   -*- autoconf -*-
+
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
+dnl              (C) 2002 g10 Code GmbH
+dnl              Modified for PINENTRY by Marcus Brinkmann.
+dnl
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library 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 GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl    Boston, MA 02111-1307, USA.
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(QT_FIND_FILE,
+[
+$3=NO
+for i in $2;
+do
+  for j in $1;
+  do
+    echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD
+    if test -r "$i/$j"; then
+      echo "taking that" >&AS_MESSAGE_LOG_FD
+      $3=$i
+      break 2
+    fi
+  done
+done
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(QT_PATH_MOC,
+[
+   qt_bindirs=""
+   for dir in $qt_dirs; do
+      qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir:$qt_bindirs"
+   fi
+
+   AC_PATH_PROG(MOC, moc, no, [$qt_bindirs])
+   if test "$MOC" = no; then
+    #AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+    #Please check whether you installed Qt correctly.
+    #You need to have a running moc binary.
+    #configure tried to run $ac_cv_path_moc and the test didn't
+    #succeed. If configure shouldn't have tried this one, set
+    #the environment variable MOC to the right one before running
+    #configure.
+    #])
+    have_moc="no"
+   else
+    have_moc="yes"
+    AC_SUBST(MOC)
+   fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for the X Window System.
+dnl Extended the macro AC_PATH_XTRA.
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(QT_PATH_X,
+[
+AC_ARG_ENABLE(
+  embedded,
+  [  --enable-embedded       link to Qt-embedded, don't use X],
+  qt_use_emb=$enableval,
+  qt_use_emb=no
+)
+
+AC_ARG_ENABLE(
+  palmtop,
+  [  --enable-palmtop       link to Qt-embedded, don't use X, link to the Qt Palmtop Environment],
+  qt_use_emb_palm=$enableval,
+  qt_use_emb_palm=no
+)
+
+if test "$qt_use_emb" = "no"; then
+  AC_PATH_X
+  AC_PATH_XTRA
+  if test "$no_x" = yes; then
+    AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!])
+  fi
+  QT_CXXFLAGS="$X_CFLAGS"
+  QT_LDFLAGS="$X_LIBS"
+  QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
+  QTE_NORTTI=""
+else
+  dnl We're using QT Embedded
+  QT_CXXFLAGS="-fno-rtti -DQWS"
+  QT_LDFLAGS="-DQWS"
+  QT_LIBS=""
+  QTE_NORTTI="-fno-rtti -DQWS"
+fi
+AC_SUBST(QT_CXXFLAGS)
+AC_SUBST(QT_LDFLAGS)
+AC_SUBST(QT_LIBS)
+AC_SUBST(QTE_NORTTI)
+])
+
+AC_DEFUN(QT_PRINT_PROGRAM,
+[
+AC_REQUIRE([QT_CHECK_VERSION])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+EOF
+if test "$qt_ver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $qt_subver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#include <qiconview.h>
+EOF
+fi
+fi
+
+if test "$qt_ver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qcursor.h>
+#include <qstylefactory.h>
+#include <private/qucomextra_p.h>
+EOF
+fi
+
+echo "#if ! ($qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$qt_ver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+    Q_UNUSED(t);
+EOF
+if test $qt_subver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QIconView iv(0);
+    iv.setWordWrapIconText(false);
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+EOF
+fi
+fi
+if test "$qt_ver" = "3"; then
+cat >> conftest.$ac_ext <<EOF
+    (void)QStyleFactory::create(QString::null);
+    QCursor c(Qt::WhatsThisCursor);
+EOF
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+])
+
+
+AC_DEFUN(QT_CHECK_VERSION,
+[
+if test -z "$1"; then
+  qt_ver=3
+  qt_subver=1
+else
+  qt_subver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
+  # following is the check if subversion isn´t found in passed argument
+  if test "$qt_subver" = "$1"; then
+    qt_subver=1
+  fi
+  qt_ver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
+  if test "$qt_ver" = "1"; then
+    qt_subver=42
+  fi
+fi
+
+if test -z "$2"; then
+  if test "$qt_ver" = "2"; then
+    if test $qt_subver -gt 0; then
+      qt_minversion=">= Qt 2.2.2"
+    else
+      qt_minversion=">= Qt 2.0.2"
+    fi
+  fi
+  if test "$qt_ver" = "3"; then
+    qt_minversion=">= Qt 3.0.1"
+  fi
+  if test "$qt_ver" = "1"; then
+    qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   qt_minversion=$2
+fi
+
+if test -z "$3"; then
+   if test $qt_ver = 3; then
+     qt_verstring="QT_VERSION >= 301"
+   fi
+   if test $qt_ver = 2; then
+     if test $qt_subver -gt 0; then
+       qt_verstring="QT_VERSION >= 222"
+     else
+       qt_verstring="QT_VERSION >= 200"
+     fi
+   fi
+   if test $qt_ver = 1; then
+    qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+   fi
+else
+   qt_verstring=$3
+fi
+
+if test $qt_ver = 3; then
+  qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt"
+fi
+if test $qt_ver = 2; then
+  qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+fi
+if test $qt_ver = 1; then
+  qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(QT_PATH_1_3,
+[
+AC_REQUIRE([QT_PATH_X])
+AC_REQUIRE([QT_CHECK_VERSION])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  mt,
+  [  --disable-mt            link to non-threaded Qt (deprecated)],
+  qt_use_mt=$enableval,
+  [
+    if test $qt_ver = 3; then
+      qt_use_mt=yes
+    else
+      qt_use_mt=no
+    fi
+  ]
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we not get --disable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+QT_MT_LDFLAGS=
+QT_MT_LIBS=
+if test "x$qt_use_mt" = "xyes"; then
+  QT_CHECK_THREADING
+  if test "x$qt_use_threading" = "xyes"; then
+    QT_CXXFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $QT_CXXFLAGS"
+    QT_MT_LDFLAGS="$USE_THREADS"
+    QT_MT_LIBS="$LIBPTHREAD"
+  else
+    qt_use_mt=no
+  fi
+fi
+AC_SUBST(QT_MT_LDFLAGS)
+AC_SUBST(QT_MT_LIBS)
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+if test -z "$LIBQT_GLOB"; then
+  if test "x$qt_use_emb" = "xyes"; then
+    LIBQT_GLOB="libqte.*"
+  else
+    LIBQT_GLOB="libqt.*"
+  fi
+fi
+
+if test -z "$LIBQT"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-embedded then adjust the Qt library name.
+dnl ------------------------------------------------------------
+  if test "x$qt_use_emb" = "xyes"; then
+    qtlib="qte"
+  else
+    qtlib="qt"
+  fi
+fi
+
+if test -z "$LIBQPE"; then
+dnl ------------------------------------------------------------
+dnl If we got --enable-palmtop then add -lqpe to the link line
+dnl ------------------------------------------------------------
+  if test "x$qt_use_emb" = "xyes"; then
+    if test "x$qt_use_emb_palm" = "xyes"; then
+      LIB_QPE="-lqpe"
+    else
+      LIB_QPE=""
+    fi
+  else
+    LIB_QPE=""
+  fi
+fi
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$qt_use_mt" = "xyes"; then
+  if test -z "$LIBQT"; then
+    LIBQT="-l$qtlib-mt"
+  else
+    LIBQT="$qtlib-mt"
+  fi
+  LIBQT_GLOB="lib$qtlib-mt.*"
+  USING_QT_MT="using -mt"
+else
+  LIBQT="-l$qtlib"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+QT_LIBS="$LIBQT $QT_LIBS"
+test -z "$QT_MT_LIBS" || QT_LIBS="$QT_LIBS $QT_MT_LIBS"
+
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+    [  --with-qt-dir=DIR       where the root of Qt is installed ],
+    [  ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib
+       ac_qt_bindir="$withval"/bin
+    ])
+
+AC_ARG_WITH(qt-includes,
+    [  --with-qt-includes=DIR  where the Qt includes are. ],
+    [
+       ac_qt_includes="$withval"
+    ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+    [  --with-qt-libraries=DIR where the Qt library is installed.],
+    [  ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include  /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$qt_ver" != "1"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+QT_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi
+  done
+fi
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_PUSH(C++)
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS"
+LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS"
+LIBS="$LIBS $QT_LIBS"
+
+QT_PRINT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+  cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_POP(C++)
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  missing_qt_mt=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    if test "x$qt_use_mt" = "xyes"; then
+       missing_qt_mt="
+Make sure that you have compiled Qt with thread support!"
+       ac_qt_notfound="(library $qtlib-mt)";
+    else
+       ac_qt_notfound="(library $qtlib)";
+    fi
+  fi
+
+  #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation!
+  #For more details about this problem, look at the end of config.log.$missing_qt_mt])
+  have_qt="no"
+else
+  have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  AC_MSG_RESULT([$have_qt]);
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES=""
+else
+ QT_INCLUDES="-I$qt_includes"
+fi
+
+if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then
+ QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries"
+fi
+test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS"
+
+AC_SUBST(QT_INCLUDES)
+QT_PATH_MOC
+
+
+AC_SUBST(LIB_QPE)
+])
+
+AC_DEFUN(QT_PATH,
+[
+QT_PATH_1_3
+QT_CHECK_RPATH
+])
+
+
+AC_DEFUN(QT_CHECK_COMPILER_FLAG,
+[
+AC_MSG_CHECKING(whether $CXX supports -$1)
+kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+  AC_LANG_PUSH(C++)
+  save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -$1"
+  AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
+  CXXFLAGS="$save_CXXFLAGS"
+  AC_LANG_POP(C++)
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN(QT_REMOVE_FORBIDDEN,
+[ __val=$$1
+  __forbid=" $2 "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS="      "
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+       *) # Careful to not add spaces, where there were none, because otherwise
+          # libtool gets confused, if we change e.g. CXX
+          if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    $1=$__new
+  fi
+])
+
+dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN(QT_VALIDIFY_CXXFLAGS,
+[dnl
+if test "x$qt_use_emb" != "xyes"; then
+ QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+else
+ QT_REMOVE_FORBIDDEN(CXX, [-rpath])
+ QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
+fi
+])
+
+AC_DEFUN(QT_CHECK_COMPILERS,
+[
+  AC_PROG_CXX
+
+  QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"])
+
+  case "$host" in
+      *-*-irix*)  test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;;
+      *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";;
+      *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`$CXX -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+          fi
+        fi
+        ;;
+  esac
+
+  QT_VALIDIFY_CXXFLAGS
+
+  AC_PROG_CXXCPP
+])
+
+AC_DEFUN(QT_CHECK_RPATH,
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+      [  --disable-rpath         do not use the rpath feature of ld],
+      USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  QT_RPATH=""
+  if test -n "$qt_libraries"; then
+    QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)"
+  fi
+  dnl $x_libraries is set to /usr/lib in case
+  if test -n "$X_LIBS"; then
+    QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)"
+  fi
+fi
+AC_SUBST(x_libraries)
+AC_SUBST(QT_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+
+AC_DEFUN(QT_CHECK_LIBPTHREAD,
+[
+AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
+AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(QT_CHECK_PTHREAD_OPTION,
+[
+    AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
+       kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
+
+    if test "$kde_use_kernthreads" = "yes"; then
+      ac_save_CXXFLAGS="$CXXFLAGS"
+      ac_save_CFLAGS="$CXXFLAGS"
+      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
+      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
+      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
+      CXXFLAGS="$ac_save_CXXFLAGS"
+      CFLAGS="$ac_save_CFLAGS"
+      if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
+        kde_use_kernthreads=no
+      else
+        dnl Add proper -I and -l statements
+        AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
+        if test "x$LIBPTHREAD" = "x"; then
+          kde_use_kernthreads=no
+        else
+          USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
+        fi
+      fi
+    else 
+      USE_THREADS=""
+      if test -z "$LIBPTHREAD"; then
+        QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
+      fi
+    fi
+
+    case $host_os in
+       solaris*)
+               QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+                QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
+               ;;
+        freebsd*)
+                QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
+                ;;
+        aix*)
+                QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE"
+                LIBPTHREAD="$LIBPTHREAD -lc_r"
+                ;;
+        linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT"
+                if test "$CXX" = "KCC"; then
+                  QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe"
+                fi
+                ;;
+       *)
+               ;;
+    esac
+    AC_SUBST(USE_THREADS)
+    AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(QT_CHECK_THREADING,
+[
+  AC_REQUIRE([QT_CHECK_LIBPTHREAD])
+  AC_REQUIRE([QT_CHECK_PTHREAD_OPTION])
+  dnl default is yes if libpthread is found and no if no libpthread is available
+  if test -z "$LIBPTHREAD"; then
+    if test -z "$USE_THREADS"; then
+      kde_check_threading_default=no
+    else
+      kde_check_threading_default=yes
+    fi
+  else
+    kde_check_threading_default=yes
+  fi
+  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
+   qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default)
+  if test "x$qt_use_threading" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+  fi
+])