Blame acinclude.m4

Packit 47f805
dnl acinclude.m4. Change *this* file to add new or change macros.
Packit 47f805
dnl When changes have been made, delete aclocal.m4 and run
Packit 47f805
dnl "aclocal".
Packit 47f805
dnl
Packit 47f805
dnl DO NOT change aclocal.m4 !
Packit 47f805
dnl
Packit 47f805
Packit 47f805
dnl * LA_SEARCH_FILE(variable, filename, PATH)
Packit 47f805
dnl * Search "filename" in the specified "PATH", "variable" will 
Packit 47f805
dnl * contain the full pathname or the empty string
Packit 47f805
dnl * PATH is space-separated list of directories.
Packit 47f805
dnl * by Florian Bomers
Packit 47f805
Packit 47f805
AC_DEFUN([LA_SEARCH_FILE],[
Packit 47f805
  $1=
Packit 47f805
  dnl hack: eliminate line feeds in $2
Packit 47f805
  for FILE in $2; do
Packit 47f805
    for DIR in $3; do
Packit 47f805
      dnl use PATH in order
Packit 47f805
      if test ".$1"="." && test -f "$DIR/$FILE"; then
Packit 47f805
        $1=$DIR
Packit 47f805
      fi
Packit 47f805
    done
Packit 47f805
  done
Packit 47f805
])
Packit 47f805
Packit 47f805
dnl * LA_SEARCH_LIB(lib-variable, include-variable, lib-filename, header-filename, prefix)
Packit 47f805
dnl * looks for "lib-filename" and "header-filename" in the area of "prefix".
Packit 47f805
dnl * if found, "lib-variable" and "include-variable" are set to the
Packit 47f805
dnl * respective paths.
Packit 47f805
dnl * prefix is a single path
Packit 47f805
dnl * libs are searched in prefix, prefix/lib, prefix/.., prefix/../lib
Packit 47f805
dnl * headers are searched in prefix, prefix/include, prefix/.., prefix/../include
Packit 47f805
dnl * 
Packit 47f805
dnl * If one of them is not found, both "lib-variable", "include-variable" are 
Packit 47f805
dnl * set to the empty string.
Packit 47f805
dnl *
Packit 47f805
dnl * TODO: assert function call to verify lib
Packit 47f805
dnl *
Packit 47f805
dnl * by Florian Bomers
Packit 47f805
Packit 47f805
AC_DEFUN([LA_SEARCH_LIB],[
Packit 47f805
  dnl look for lib
Packit 47f805
  LA_SEARCH_FILE($1, $3, $5 $5/lib $5/.. $5/../lib)
Packit 47f805
  dnl look for header.
Packit 47f805
  LA_SEARCH_FILE($2, $4, $5 $5/include $5/.. $5/../include)
Packit 47f805
  if test ".$1" = "." || test ".$2" = "."; then
Packit 47f805
    $1=
Packit 47f805
    $2=
Packit 47f805
  fi
Packit 47f805
])
Packit 47f805
Packit 47f805
Packit 47f805
 
Packit 47f805
Packit 47f805
# alex_IEEE854_FLOAT80
Packit 47f805
# ------------
Packit 47f805
AC_DEFUN([alex_IEEE854_FLOAT80],
Packit 47f805
[AC_CACHE_CHECK(for IEEE854 compliant 80 bit floats, alex_cv_ieee854_float80,
Packit 47f805
[AC_TRY_RUN([
Packit 47f805
int   float2long_IEEE_compliance ( void )
Packit 47f805
{
Packit 47f805
    struct {
Packit 47f805
        long padding; /* to prevent unaligned access */
Packit 47f805
        float  f;
Packit 47f805
    } s;
Packit 47f805
    s.f = 12582912.; if ( *(long*)(&s.f) != 1262485504l ) return 0;
Packit 47f805
    s.f = 12615679.; if ( *(long*)(&s.f) != 1262518271l ) return 0;
Packit 47f805
    s.f = 13582912.; if ( *(long*)(&s.f) != 1263485504l ) return 0;
Packit 47f805
    s.f = 12550145.; if ( *(long*)(&s.f) != 1262452737l ) return 0;
Packit 47f805
    s.f = 11582912.; if ( *(long*)(&s.f) != 1261485504l ) return 0;
Packit 47f805
    return 1;
Packit 47f805
}
Packit 47f805
Packit 47f805
int main(void)
Packit 47f805
{
Packit 47f805
    int retval;
Packit 47f805
Packit 47f805
    retval = float2long_IEEE_compliance();
Packit 47f805
Packit 47f805
    /* no error return -> success */
Packit 47f805
    return !retval;
Packit 47f805
}
Packit 47f805
], alex_cv_ieee854_float80=yes, alex_cv_ieee854_float80=no,
Packit 47f805
[AC_MSG_WARN(can't check for IEEE854 compliant 80 bit floats)]
Packit 47f805
)])]) # alex_IEEE854_FLOAT80
Packit 47f805
Packit 47f805
# Configure paths for GTK+
Packit 47f805
# Owen Taylor     97-11-3
Packit 47f805
Packit 47f805
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
Packit 47f805
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
Packit 47f805
dnl
Packit 47f805
AC_DEFUN([AM_PATH_GTK],
Packit 47f805
[dnl
Packit 47f805
dnl Get the cflags and libraries from the gtk-config script
Packit 47f805
dnl
Packit 47f805
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
Packit 47f805
            gtk_config_prefix="$withval", gtk_config_prefix="")
Packit 47f805
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
Packit 47f805
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
Packit 47f805
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
Packit 47f805
        , enable_gtktest=yes)
Packit 47f805
Packit 47f805
  for module in . $4
Packit 47f805
  do
Packit 47f805
      case "$module" in
Packit 47f805
         gthread)
Packit 47f805
             gtk_config_args="$gtk_config_args gthread"
Packit 47f805
         ;;
Packit 47f805
      esac
Packit 47f805
  done
Packit 47f805
Packit 47f805
  if test x$gtk_config_exec_prefix != x ; then
Packit 47f805
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
Packit 47f805
     if test x${GTK_CONFIG+set} != xset ; then
Packit 47f805
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
Packit 47f805
     fi
Packit 47f805
  fi
Packit 47f805
  if test x$gtk_config_prefix != x ; then
Packit 47f805
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
Packit 47f805
     if test x${GTK_CONFIG+set} != xset ; then
Packit 47f805
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
Packit 47f805
     fi
Packit 47f805
  fi
Packit 47f805
Packit 47f805
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
Packit 47f805
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
Packit 47f805
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
Packit 47f805
  no_gtk=""
Packit 47f805
  if test "$GTK_CONFIG" = "no" ; then
Packit 47f805
    no_gtk=yes
Packit 47f805
  else
Packit 47f805
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
Packit 47f805
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
Packit 47f805
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
Packit 47f805
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
Packit 47f805
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
Packit 47f805
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
Packit 47f805
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
Packit 47f805
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
Packit 47f805
    if test "x$enable_gtktest" = "xyes" ; then
Packit 47f805
      ac_save_CFLAGS="$CFLAGS"
Packit 47f805
      ac_save_LIBS="$LIBS"
Packit 47f805
      CFLAGS="$CFLAGS $GTK_CFLAGS"
Packit 47f805
      LIBS="$GTK_LIBS $LIBS"
Packit 47f805
dnl
Packit 47f805
dnl Now check if the installed GTK is sufficiently new. (Also sanity
Packit 47f805
dnl checks the results of gtk-config to some extent
Packit 47f805
dnl
Packit 47f805
      rm -f conf.gtktest
Packit 47f805
      AC_TRY_RUN([
Packit 47f805
#include <gtk/gtk.h>
Packit 47f805
#include <stdio.h>
Packit 47f805
#include <stdlib.h>
Packit 47f805
Packit 47f805
int
Packit 47f805
main ()
Packit 47f805
{
Packit 47f805
  int major, minor, micro;
Packit 47f805
  char *tmp_version;
Packit 47f805
Packit 47f805
  system ("touch conf.gtktest");
Packit 47f805
Packit 47f805
  /* HP/UX 9 (%@#!) writes to sscanf strings */
Packit 47f805
  tmp_version = g_strdup("$min_gtk_version");
Packit 47f805
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
Packit 47f805
     printf("%s, bad version string\n", "$min_gtk_version");
Packit 47f805
     exit(1);
Packit 47f805
   }
Packit 47f805
Packit 47f805
  if ((gtk_major_version != $gtk_config_major_version) ||
Packit 47f805
      (gtk_minor_version != $gtk_config_minor_version) ||
Packit 47f805
      (gtk_micro_version != $gtk_config_micro_version))
Packit 47f805
    {
Packit 47f805
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
Packit 47f805
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
Packit 47f805
             gtk_major_version, gtk_minor_version, gtk_micro_version);
Packit 47f805
      printf ("*** was found! If gtk-config was correct, then it is best\n");
Packit 47f805
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
Packit 47f805
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
Packit 47f805
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
Packit 47f805
      printf("*** required on your system.\n");
Packit 47f805
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
Packit 47f805
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
Packit 47f805
      printf("*** before re-running configure\n");
Packit 47f805
    }
Packit 47f805
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
Packit 47f805
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
Packit 47f805
     (gtk_minor_version != GTK_MINOR_VERSION) ||
Packit 47f805
           (gtk_micro_version != GTK_MICRO_VERSION))
Packit 47f805
    {
Packit 47f805
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
Packit 47f805
       GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
Packit 47f805
      printf("*** library (version %d.%d.%d)\n",
Packit 47f805
       gtk_major_version, gtk_minor_version, gtk_micro_version);
Packit 47f805
    }
Packit 47f805
#endif /* defined (GTK_MAJOR_VERSION) ... */
Packit 47f805
  else
Packit 47f805
    {
Packit 47f805
      if ((gtk_major_version > major) ||
Packit 47f805
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
Packit 47f805
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
Packit 47f805
      {
Packit 47f805
        return 0;
Packit 47f805
       }
Packit 47f805
     else
Packit 47f805
      {
Packit 47f805
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
Packit 47f805
               gtk_major_version, gtk_minor_version, gtk_micro_version);
Packit 47f805
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
Packit 47f805
         major, minor, micro);
Packit 47f805
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
Packit 47f805
        printf("***\n");
Packit 47f805
        printf("*** If you have already installed a sufficiently new version, this error\n");
Packit 47f805
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
Packit 47f805
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
Packit 47f805
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
Packit 47f805
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
Packit 47f805
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
Packit 47f805
        printf("*** so that the correct libraries are found at run-time))\n");
Packit 47f805
      }
Packit 47f805
    }
Packit 47f805
  return 1;
Packit 47f805
}
Packit 47f805
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Packit 47f805
       CFLAGS="$ac_save_CFLAGS"
Packit 47f805
       LIBS="$ac_save_LIBS"
Packit 47f805
     fi
Packit 47f805
  fi
Packit 47f805
  if test "x$no_gtk" = x ; then
Packit 47f805
     AC_MSG_RESULT(yes)
Packit 47f805
     ifelse([$2], , :, [$2])
Packit 47f805
  else
Packit 47f805
     AC_MSG_RESULT(no)
Packit 47f805
     if test "$GTK_CONFIG" = "no" ; then
Packit 47f805
       echo "*** The gtk-config script installed by GTK could not be found"
Packit 47f805
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
Packit 47f805
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
Packit 47f805
       echo "*** full path to gtk-config."
Packit 47f805
     else
Packit 47f805
       if test -f conf.gtktest ; then
Packit 47f805
        :
Packit 47f805
       else
Packit 47f805
          echo "*** Could not run GTK test program, checking why..."
Packit 47f805
          CFLAGS="$CFLAGS $GTK_CFLAGS"
Packit 47f805
          LIBS="$LIBS $GTK_LIBS"
Packit 47f805
          AC_TRY_LINK([
Packit 47f805
#include <gtk/gtk.h>
Packit 47f805
#include <stdio.h>
Packit 47f805
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
Packit 47f805
        [ echo "*** The test program compiled, but did not run. This usually means"
Packit 47f805
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
Packit 47f805
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
Packit 47f805
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
Packit 47f805
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
Packit 47f805
          echo "*** is required on your system"
Packit 47f805
    echo "***"
Packit 47f805
          echo "*** If you have an old version installed, it is best to remove it, although"
Packit 47f805
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
Packit 47f805
          echo "***"
Packit 47f805
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
Packit 47f805
          echo "*** came with the system with the command"
Packit 47f805
          echo "***"
Packit 47f805
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
Packit 47f805
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
Packit 47f805
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
Packit 47f805
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
Packit 47f805
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
Packit 47f805
          CFLAGS="$ac_save_CFLAGS"
Packit 47f805
          LIBS="$ac_save_LIBS"
Packit 47f805
       fi
Packit 47f805
     fi
Packit 47f805
     GTK_CFLAGS=""
Packit 47f805
     GTK_LIBS=""
Packit 47f805
     ifelse([$3], , :, [$3])
Packit 47f805
  fi
Packit 47f805
  AC_SUBST(GTK_CFLAGS)
Packit 47f805
  AC_SUBST(GTK_LIBS)
Packit 47f805
  rm -f conf.gtktest
Packit 47f805
])