home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / scanner / nmapNTsp1 / Win_2000.exe / nmapNT-src / nmapfe / aclocal.m4 next >
Encoding:
M4 Source File  |  2000-05-08  |  8.8 KB  |  208 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.4a
  2.  
  3. dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  4. dnl This file is free software; the Free Software Foundation
  5. dnl gives unlimited permission to copy and/or distribute it,
  6. dnl with or without modifications, as long as this notice is preserved.
  7.  
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  10. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11. dnl PARTICULAR PURPOSE.
  12.  
  13. # Configure paths for GTK+
  14. # Owen Taylor     97-11-3
  15.  
  16. dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  17. dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
  18. dnl
  19. AC_DEFUN(AM_PATH_GTK,
  20. [dnl 
  21. dnl Get the cflags and libraries from the gtk-config script
  22. dnl
  23. AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
  24.             gtk_config_prefix="$withval", gtk_config_prefix="")
  25. AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
  26.             gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
  27. AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
  28.             , enable_gtktest=yes)
  29.  
  30.   for module in . $4
  31.   do
  32.       case "$module" in
  33.          gthread) 
  34.              gtk_config_args="$gtk_config_args gthread"
  35.          ;;
  36.       esac
  37.   done
  38.  
  39.   if test x$gtk_config_exec_prefix != x ; then
  40.      gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
  41.      if test x${GTK_CONFIG+set} != xset ; then
  42.         GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
  43.      fi
  44.   fi
  45.   if test x$gtk_config_prefix != x ; then
  46.      gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
  47.      if test x${GTK_CONFIG+set} != xset ; then
  48.         GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
  49.      fi
  50.   fi
  51.  
  52.   AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  53.   min_gtk_version=ifelse([$1], ,0.99.7,$1)
  54.   AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
  55.   no_gtk=""
  56.   if test "$GTK_CONFIG" = "no" ; then
  57.     no_gtk=yes
  58.   else
  59.     GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
  60.     GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
  61.     gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
  62.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  63.     gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
  64.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  65.     gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
  66.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  67.     if test "x$enable_gtktest" = "xyes" ; then
  68.       ac_save_CFLAGS="$CFLAGS"
  69.       ac_save_LIBS="$LIBS"
  70.       CFLAGS="$CFLAGS $GTK_CFLAGS"
  71.       LIBS="$GTK_LIBS $LIBS"
  72. dnl
  73. dnl Now check if the installed GTK is sufficiently new. (Also sanity
  74. dnl checks the results of gtk-config to some extent
  75. dnl
  76.       rm -f conf.gtktest
  77.       AC_TRY_RUN([
  78. #include <gtk/gtk.h>
  79. #include <stdio.h>
  80. #include <stdlib.h>
  81.  
  82. int 
  83. main ()
  84. {
  85.   int major, minor, micro;
  86.   char *tmp_version;
  87.  
  88.   system ("touch conf.gtktest");
  89.  
  90.   /* HP/UX 9 (%@#!) writes to sscanf strings */
  91.   tmp_version = g_strdup("$min_gtk_version");
  92.   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
  93.      printf("%s, bad version string\n", "$min_gtk_version");
  94.      exit(1);
  95.    }
  96.  
  97.   if ((gtk_major_version != $gtk_config_major_version) ||
  98.       (gtk_minor_version != $gtk_config_minor_version) ||
  99.       (gtk_micro_version != $gtk_config_micro_version))
  100.     {
  101.       printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
  102.              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
  103.              gtk_major_version, gtk_minor_version, gtk_micro_version);
  104.       printf ("*** was found! If gtk-config was correct, then it is best\n");
  105.       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
  106.       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  107.       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  108.       printf("*** required on your system.\n");
  109.       printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
  110.       printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
  111.       printf("*** before re-running configure\n");
  112.     } 
  113. #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
  114.   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
  115.        (gtk_minor_version != GTK_MINOR_VERSION) ||
  116.            (gtk_micro_version != GTK_MICRO_VERSION))
  117.     {
  118.       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
  119.          GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
  120.       printf("*** library (version %d.%d.%d)\n",
  121.          gtk_major_version, gtk_minor_version, gtk_micro_version);
  122.     }
  123. #endif /* defined (GTK_MAJOR_VERSION) ... */
  124.   else
  125.     {
  126.       if ((gtk_major_version > major) ||
  127.         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
  128.         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
  129.       {
  130.         return 0;
  131.        }
  132.      else
  133.       {
  134.         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
  135.                gtk_major_version, gtk_minor_version, gtk_micro_version);
  136.         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
  137.            major, minor, micro);
  138.         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
  139.         printf("***\n");
  140.         printf("*** If you have already installed a sufficiently new version, this error\n");
  141.         printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
  142.         printf("*** being found. The easiest way to fix this is to remove the old version\n");
  143.         printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
  144.         printf("*** correct copy of gtk-config. (In this case, you will have to\n");
  145.         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  146.         printf("*** so that the correct libraries are found at run-time))\n");
  147.       }
  148.     }
  149.   return 1;
  150. }
  151. ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  152.        CFLAGS="$ac_save_CFLAGS"
  153.        LIBS="$ac_save_LIBS"
  154.      fi
  155.   fi
  156.   if test "x$no_gtk" = x ; then
  157.      AC_MSG_RESULT(yes)
  158.      ifelse([$2], , :, [$2])     
  159.   else
  160.      AC_MSG_RESULT(no)
  161.      if test "$GTK_CONFIG" = "no" ; then
  162.        echo "*** The gtk-config script installed by GTK could not be found"
  163.        echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
  164.        echo "*** your path, or set the GTK_CONFIG environment variable to the"
  165.        echo "*** full path to gtk-config."
  166.      else
  167.        if test -f conf.gtktest ; then
  168.         :
  169.        else
  170.           echo "*** Could not run GTK test program, checking why..."
  171.           CFLAGS="$CFLAGS $GTK_CFLAGS"
  172.           LIBS="$LIBS $GTK_LIBS"
  173.           AC_TRY_LINK([
  174. #include <gtk/gtk.h>
  175. #include <stdio.h>
  176. ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
  177.         [ echo "*** The test program compiled, but did not run. This usually means"
  178.           echo "*** that the run-time linker is not finding GTK or finding the wrong"
  179.           echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
  180.           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  181.           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
  182.           echo "*** is required on your system"
  183.       echo "***"
  184.           echo "*** If you have an old version installed, it is best to remove it, although"
  185.           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  186.           echo "***"
  187.           echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  188.           echo "*** came with the system with the command"
  189.           echo "***"
  190.           echo "***    rpm --erase --nodeps gtk gtk-devel" ],
  191.         [ echo "*** The test program failed to compile or link. See the file config.log for the"
  192.           echo "*** exact error that occured. This usually means GTK was incorrectly installed"
  193.           echo "*** or that you have moved GTK since it was installed. In the latter case, you"
  194.           echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
  195.           CFLAGS="$ac_save_CFLAGS"
  196.           LIBS="$ac_save_LIBS"
  197.        fi
  198.      fi
  199.      GTK_CFLAGS=""
  200.      GTK_LIBS=""
  201.      ifelse([$3], , :, [$3])
  202.   fi
  203.   AC_SUBST(GTK_CFLAGS)
  204.   AC_SUBST(GTK_LIBS)
  205.   rm -f conf.gtktest
  206. ])
  207.  
  208.