OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [aclocal.m4] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
dnl This file is duplicated in four places:
dnl This file is duplicated in four places:
dnl * gdb/aclocal.m4
dnl * gdb/aclocal.m4
dnl * gdb/testsuite/aclocal.m4
dnl * gdb/testsuite/aclocal.m4
dnl * expect/aclocal.m4
dnl * expect/aclocal.m4
dnl * dejagnu/aclocal.m4
dnl * dejagnu/aclocal.m4
dnl Consider modifying all copies in parallel.
dnl Consider modifying all copies in parallel.
dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
dnl CYGNUS LOCAL: This gets the right posix flag for gcc
dnl CYGNUS LOCAL: This gets the right posix flag for gcc
AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([to see if this is LynxOS])
AC_MSG_CHECKING([to see if this is LynxOS])
AC_CACHE_VAL(ac_cv_os_lynx,
AC_CACHE_VAL(ac_cv_os_lynx,
[AC_EGREP_CPP(yes,
[AC_EGREP_CPP(yes,
[/*
[/*
 * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
 * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
 */
 */
#if defined(__Lynx__) || defined(Lynx)
#if defined(__Lynx__) || defined(Lynx)
yes
yes
#endif
#endif
], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
#
#
if test "$ac_cv_os_lynx" = "yes" ; then
if test "$ac_cv_os_lynx" = "yes" ; then
  AC_MSG_RESULT(yes)
  AC_MSG_RESULT(yes)
  AC_DEFINE(LYNX)
  AC_DEFINE(LYNX)
  AC_MSG_CHECKING([whether -mposix or -X is available])
  AC_MSG_CHECKING([whether -mposix or -X is available])
  AC_CACHE_VAL(ac_cv_c_posix_flag,
  AC_CACHE_VAL(ac_cv_c_posix_flag,
  [AC_TRY_COMPILE(,[
  [AC_TRY_COMPILE(,[
  /*
  /*
   * This flag varies depending on how old the compiler is.
   * This flag varies depending on how old the compiler is.
   * -X is for the old "cc" and "gcc" (based on 1.42).
   * -X is for the old "cc" and "gcc" (based on 1.42).
   * -mposix is for the new gcc (at least 2.5.8).
   * -mposix is for the new gcc (at least 2.5.8).
   */
   */
  #if defined(__GNUC__) && __GNUC__ >= 2
  #if defined(__GNUC__) && __GNUC__ >= 2
  choke me
  choke me
  #endif
  #endif
  ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
  ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
  CC="$CC $ac_cv_c_posix_flag"
  CC="$CC $ac_cv_c_posix_flag"
  AC_MSG_RESULT($ac_cv_c_posix_flag)
  AC_MSG_RESULT($ac_cv_c_posix_flag)
  else
  else
  AC_MSG_RESULT(no)
  AC_MSG_RESULT(no)
fi
fi
])
])
 
 
AC_DEFUN(CY_AC_PATH_TCLH, [
AC_DEFUN(CY_AC_PATH_TCLH, [
#
#
# Ok, lets find the tcl source trees so we can use the headers
# Ok, lets find the tcl source trees so we can use the headers
# Warning: transition of version 9 to 10 will break this algorithm
# Warning: transition of version 9 to 10 will break this algorithm
# because 10 sorts before 9. We also look for just tcl. We have to
# because 10 sorts before 9. We also look for just tcl. We have to
# be careful that we don't match stuff like tclX by accident.
# be careful that we don't match stuff like tclX by accident.
# the alternative search directory is involked by --with-tclinclude
# the alternative search directory is involked by --with-tclinclude
#
#
no_tcl=true
no_tcl=true
AC_MSG_CHECKING(for Tcl private headers)
AC_MSG_CHECKING(for Tcl private headers)
AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory where tcl private headers are], with_tclinclude=${withval})
AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory where tcl private headers are], with_tclinclude=${withval})
AC_CACHE_VAL(ac_cv_c_tclh,[
AC_CACHE_VAL(ac_cv_c_tclh,[
# first check to see if --with-tclinclude was specified
# first check to see if --with-tclinclude was specified
if test x"${with_tclinclude}" != x ; then
if test x"${with_tclinclude}" != x ; then
  if test -f ${with_tclinclude}/tclInt.h ; then
  if test -f ${with_tclinclude}/tclInt.h ; then
    ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
    ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
  else
  else
    AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
    AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
  fi
  fi
fi
fi
# next check in private source directory
# next check in private source directory
#
#
# since ls returns lowest version numbers first, reverse its output
# since ls returns lowest version numbers first, reverse its output
if test x"${ac_cv_c_tclh}" = x ; then
if test x"${ac_cv_c_tclh}" = x ; then
  for i in \
  for i in \
                ${srcdir}/../tcl \
                ${srcdir}/../tcl \
                `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \
                `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \
                ${srcdir}/../../tcl \
                ${srcdir}/../../tcl \
                `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \
                `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \
                ${srcdir}/../../../tcl \
                ${srcdir}/../../../tcl \
                `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do
                `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do
    if test -f $i/tclInt.h ; then
    if test -f $i/tclInt.h ; then
      ac_cv_c_tclh=`(cd $i; pwd)`
      ac_cv_c_tclh=`(cd $i; pwd)`
      break
      break
    fi
    fi
    # Tcl 7.5 and greater puts headers in subdirectory.
    # Tcl 7.5 and greater puts headers in subdirectory.
    if test -f $i/generic/tclInt.h ; then
    if test -f $i/generic/tclInt.h ; then
      ac_cv_c_tclh=`(cd $i; pwd)`/generic
      ac_cv_c_tclh=`(cd $i; pwd)`/generic
      break
      break
    fi
    fi
  done
  done
fi
fi
# finally check in a few common install locations
# finally check in a few common install locations
#
#
# since ls returns lowest version numbers first, reverse its output
# since ls returns lowest version numbers first, reverse its output
if test x"${ac_cv_c_tclh}" = x ; then
if test x"${ac_cv_c_tclh}" = x ; then
  for i in \
  for i in \
                `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \
                /usr/local/src/tcl \
                /usr/local/src/tcl \
                /usr/local/lib/tcl \
                /usr/local/lib/tcl \
                ${prefix}/include ; do
                ${prefix}/include ; do
    if test -f $i/tclInt.h ; then
    if test -f $i/tclInt.h ; then
      ac_cv_c_tclh=`(cd $i; pwd)`
      ac_cv_c_tclh=`(cd $i; pwd)`
      break
      break
    fi
    fi
  done
  done
fi
fi
# see if one is installed
# see if one is installed
if test x"${ac_cv_c_tclh}" = x ; then
if test x"${ac_cv_c_tclh}" = x ; then
   AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
   AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
fi
fi
])
])
if test x"${ac_cv_c_tclh}" = x ; then
if test x"${ac_cv_c_tclh}" = x ; then
  TCLHDIR="# no Tcl private headers found"
  TCLHDIR="# no Tcl private headers found"
  AC_MSG_ERROR([Can't find Tcl private headers])
  AC_MSG_ERROR([Can't find Tcl private headers])
fi
fi
if test x"${ac_cv_c_tclh}" != x ; then
if test x"${ac_cv_c_tclh}" != x ; then
  no_tcl=""
  no_tcl=""
  if test x"${ac_cv_c_tclh}" = x"installed" ; then
  if test x"${ac_cv_c_tclh}" = x"installed" ; then
    AC_MSG_RESULT([is installed])
    AC_MSG_RESULT([is installed])
    TCLHDIR=""
    TCLHDIR=""
  else
  else
    AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
    AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
    # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
    # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
    TCLHDIR="-I${ac_cv_c_tclh}"
    TCLHDIR="-I${ac_cv_c_tclh}"
  fi
  fi
fi
fi
 
 
AC_MSG_CHECKING([Tcl version])
AC_MSG_CHECKING([Tcl version])
orig_includes="$CPPFLAGS"
orig_includes="$CPPFLAGS"
 
 
if test x"${TCLHDIR}" != x ; then
if test x"${TCLHDIR}" != x ; then
  CPPFLAGS="$CPPFLAGS $TCLHDIR"
  CPPFLAGS="$CPPFLAGS $TCLHDIR"
fi
fi
 
 
# Get major and minor versions of Tcl.  Use funny names to avoid
# Get major and minor versions of Tcl.  Use funny names to avoid
# clashes with eg SunOS.
# clashes with eg SunOS.
cat > conftest.c <<'EOF'
cat > conftest.c <<'EOF'
#include "tcl.h"
#include "tcl.h"
MaJor = TCL_MAJOR_VERSION
MaJor = TCL_MAJOR_VERSION
MiNor = TCL_MINOR_VERSION
MiNor = TCL_MINOR_VERSION
EOF
EOF
 
 
tclmajor=
tclmajor=
tclminor=
tclminor=
if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
   # Success.
   # Success.
   tclmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
   tclmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
   tclminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
   tclminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
fi
fi
rm -f conftest.c conftest.out
rm -f conftest.c conftest.out
 
 
if test -z "$tclmajor" || test -z "$tclminor"; then
if test -z "$tclmajor" || test -z "$tclminor"; then
   AC_MSG_RESULT([fatal error: could not find major or minor version number of Tcl])
   AC_MSG_RESULT([fatal error: could not find major or minor version number of Tcl])
   exit 1
   exit 1
fi
fi
AC_MSG_RESULT(${tclmajor}.${tclminor})
AC_MSG_RESULT(${tclmajor}.${tclminor})
 
 
CPPFLAGS="${orig_includes}"
CPPFLAGS="${orig_includes}"
 
 
AC_PROVIDE([$0])
AC_PROVIDE([$0])
AC_SUBST(TCLHDIR)
AC_SUBST(TCLHDIR)
])
])
AC_DEFUN(CY_AC_PATH_TCLLIB, [
AC_DEFUN(CY_AC_PATH_TCLLIB, [
#
#
# Ok, lets find the tcl library
# Ok, lets find the tcl library
# First, look for one uninstalled.
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-tcllib
# the alternative search directory is invoked by --with-tcllib
#
#
 
 
if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then
if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then
  installedtcllibroot=tcl$tclversion
  installedtcllibroot=tcl$tclversion
else
else
  installedtcllibroot=tcl
  installedtcllibroot=tcl
fi
fi
 
 
if test x"${no_tcl}" = x ; then
if test x"${no_tcl}" = x ; then
  # we reset no_tcl incase something fails here
  # we reset no_tcl incase something fails here
  no_tcl=true
  no_tcl=true
  AC_ARG_WITH(tcllib, [  --with-tcllib           directory where the tcl library is],
  AC_ARG_WITH(tcllib, [  --with-tcllib           directory where the tcl library is],
         with_tcllib=${withval})
         with_tcllib=${withval})
  AC_MSG_CHECKING([for Tcl library])
  AC_MSG_CHECKING([for Tcl library])
  AC_CACHE_VAL(ac_cv_c_tcllib,[
  AC_CACHE_VAL(ac_cv_c_tcllib,[
  # First check to see if --with-tcllib was specified.
  # First check to see if --with-tcllib was specified.
  # This requires checking for both the installed and uninstalled name-styles
  # This requires checking for both the installed and uninstalled name-styles
  # since we have no idea if it's installed or not.
  # since we have no idea if it's installed or not.
  if test x"${with_tcllib}" != x ; then
  if test x"${with_tcllib}" != x ; then
    if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then
    if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so
    elif test -f "${with_tcllib}/libtcl.so" ; then
    elif test -f "${with_tcllib}/libtcl.so" ; then
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so
    # then look for a freshly built statically linked library
    # then look for a freshly built statically linked library
    # if Makefile exists we assume its configured and libtcl will be built first.
    # if Makefile exists we assume its configured and libtcl will be built first.
    elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then
    elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a
    elif test -f "${with_tcllib}/libtcl.a" ; then
    elif test -f "${with_tcllib}/libtcl.a" ; then
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a
      ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a
    else
    else
      AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries])
      AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries])
    fi
    fi
  fi
  fi
  # then check for a private Tcl library
  # then check for a private Tcl library
  # Since these are uninstalled, use the simple lib name root.
  # Since these are uninstalled, use the simple lib name root.
  if test x"${ac_cv_c_tcllib}" = x ; then
  if test x"${ac_cv_c_tcllib}" = x ; then
    for i in \
    for i in \
                ../tcl \
                ../tcl \
                `ls -dr ../tcl[[0-9]]* 2>/dev/null` \
                `ls -dr ../tcl[[0-9]]* 2>/dev/null` \
                ../../tcl \
                ../../tcl \
                `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \
                `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \
                ../../../tcl \
                ../../../tcl \
                `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do
                `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do
      # Tcl 7.5 and greater puts library in subdir.  Look there first.
      # Tcl 7.5 and greater puts library in subdir.  Look there first.
      if test -f "$i/unix/libtcl.so" ; then
      if test -f "$i/unix/libtcl.so" ; then
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
         break
         break
      elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
      elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
         break
         break
      # look for a freshly built dynamically linked library
      # look for a freshly built dynamically linked library
      elif test -f "$i/libtcl.so" ; then
      elif test -f "$i/libtcl.so" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
        break
        break
 
 
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists we assume its configured and libtcl will be
      # if Makefile exists we assume its configured and libtcl will be
      # built first.
      # built first.
      elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
        break
        break
      fi
      fi
    done
    done
  fi
  fi
  # check in a few common install locations
  # check in a few common install locations
  if test x"${ac_cv_c_tcllib}" = x ; then
  if test x"${ac_cv_c_tcllib}" = x ; then
    for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
    for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
      # first look for a freshly built dynamically linked library
      # first look for a freshly built dynamically linked library
      if test -f "$i/lib$installedtcllibroot.so" ; then
      if test -f "$i/lib$installedtcllibroot.so" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so
        ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so
        break
        break
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists we assume its configured and libtcl will be built first.
      # if Makefile exists we assume its configured and libtcl will be built first.
      elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a
        ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a
        break
        break
      fi
      fi
    done
    done
  fi
  fi
  # check in a few other private locations
  # check in a few other private locations
  if test x"${ac_cv_c_tcllib}" = x ; then
  if test x"${ac_cv_c_tcllib}" = x ; then
    for i in \
    for i in \
                ${srcdir}/../tcl \
                ${srcdir}/../tcl \
                `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do
                `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do
      # Tcl 7.5 and greater puts library in subdir.  Look there first.
      # Tcl 7.5 and greater puts library in subdir.  Look there first.
      if test -f "$i/unix/libtcl.so" ; then
      if test -f "$i/unix/libtcl.so" ; then
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
         break
         break
      elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
      elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
         break
         break
      # look for a freshly built dynamically linked library
      # look for a freshly built dynamically linked library
      elif test -f "$i/libtcl.so" ; then
      elif test -f "$i/libtcl.so" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
        break
        break
 
 
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists we assume its configured and libtcl will be
      # if Makefile exists we assume its configured and libtcl will be
      # built first.
      # built first.
      elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
        ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
        break
        break
      fi
      fi
    done
    done
  fi
  fi
 
 
  # see if one is conveniently installed with the compiler
  # see if one is conveniently installed with the compiler
  if test x"${ac_cv_c_tcllib}" = x ; then
  if test x"${ac_cv_c_tcllib}" = x ; then
    orig_libs="$LIBS"
    orig_libs="$LIBS"
    LIBS="$LIBS -l$installedtcllibroot -lm"
    LIBS="$LIBS -l$installedtcllibroot -lm"
    AC_TRY_RUN([
    AC_TRY_RUN([
    Tcl_AppInit()
    Tcl_AppInit()
    { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib=""
    { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib=""
    , ac_cv_c_tclib="-l$installedtcllibroot")
    , ac_cv_c_tclib="-l$installedtcllibroot")
    LIBS="${orig_libs}"
    LIBS="${orig_libs}"
   fi
   fi
  ])
  ])
  if test x"${ac_cv_c_tcllib}" = x ; then
  if test x"${ac_cv_c_tcllib}" = x ; then
    TCLLIB="# no Tcl library found"
    TCLLIB="# no Tcl library found"
    AC_MSG_WARN(Can't find Tcl library)
    AC_MSG_WARN(Can't find Tcl library)
  else
  else
    TCLLIB=${ac_cv_c_tcllib}
    TCLLIB=${ac_cv_c_tcllib}
    AC_MSG_RESULT(found $TCLLIB)
    AC_MSG_RESULT(found $TCLLIB)
    no_tcl=
    no_tcl=
  fi
  fi
fi
fi
 
 
AC_PROVIDE([$0])
AC_PROVIDE([$0])
AC_SUBST(TCLLIB)
AC_SUBST(TCLLIB)
])
])
AC_DEFUN(CY_AC_PATH_TKH, [
AC_DEFUN(CY_AC_PATH_TKH, [
#
#
# Ok, lets find the tk source trees so we can use the headers
# Ok, lets find the tk source trees so we can use the headers
# If the directory (presumably symlink) named "tk" exists, use that one
# If the directory (presumably symlink) named "tk" exists, use that one
# in preference to any others.  Same logic is used when choosing library
# in preference to any others.  Same logic is used when choosing library
# and again with Tcl. The search order is the best place to look first, then in
# and again with Tcl. The search order is the best place to look first, then in
# decreasing significance. The loop breaks if the trigger file is found.
# decreasing significance. The loop breaks if the trigger file is found.
# Note the gross little conversion here of srcdir by cd'ing to the found
# Note the gross little conversion here of srcdir by cd'ing to the found
# directory. This converts the path from a relative to an absolute, so
# directory. This converts the path from a relative to an absolute, so
# recursive cache variables for the path will work right. We check all
# recursive cache variables for the path will work right. We check all
# the possible paths in one loop rather than many seperate loops to speed
# the possible paths in one loop rather than many seperate loops to speed
# things up.
# things up.
# the alternative search directory is invoked by --with-tkinclude
# the alternative search directory is invoked by --with-tkinclude
#
#
AC_MSG_CHECKING(for Tk private headers)
AC_MSG_CHECKING(for Tk private headers)
AC_ARG_WITH(tkinclude, [  --with-tkinclude        directory where the tk private headers are],
AC_ARG_WITH(tkinclude, [  --with-tkinclude        directory where the tk private headers are],
            with_tkinclude=${withval})
            with_tkinclude=${withval})
no_tk=true
no_tk=true
AC_CACHE_VAL(ac_cv_c_tkh,[
AC_CACHE_VAL(ac_cv_c_tkh,[
# first check to see if --with-tkinclude was specified
# first check to see if --with-tkinclude was specified
if test x"${with_tkinclude}" != x ; then
if test x"${with_tkinclude}" != x ; then
  if test -f ${with_tkinclude}/tk.h ; then
  if test -f ${with_tkinclude}/tk.h ; then
    ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
    ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
  else
  else
    AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
    AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
  fi
  fi
fi
fi
# next check in private source directory
# next check in private source directory
#
#
# since ls returns lowest version numbers first, reverse the entire list
# since ls returns lowest version numbers first, reverse the entire list
# and search for the worst fit, overwriting it with better fits as we find them
# and search for the worst fit, overwriting it with better fits as we find them
if test x"${ac_cv_c_tkh}" = x ; then
if test x"${ac_cv_c_tkh}" = x ; then
  for i in \
  for i in \
                ${srcdir}/../tk \
                ${srcdir}/../tk \
                `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \
                `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \
                ${srcdir}/../../tk \
                ${srcdir}/../../tk \
                `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \
                `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \
                ${srcdir}/../../../tk \
                ${srcdir}/../../../tk \
                `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do
                `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do
    if test -f $i/tk.h ; then
    if test -f $i/tk.h ; then
      ac_cv_c_tkh=`(cd $i; pwd)`
      ac_cv_c_tkh=`(cd $i; pwd)`
      break
      break
    fi
    fi
    # Tk 4.1 and greater puts this in a subdir.
    # Tk 4.1 and greater puts this in a subdir.
    if test -f $i/generic/tk.h; then
    if test -f $i/generic/tk.h; then
       ac_cv_c_tkh=`(cd $i; pwd)`/generic
       ac_cv_c_tkh=`(cd $i; pwd)`/generic
    fi
    fi
  done
  done
fi
fi
# finally check in a few common install locations
# finally check in a few common install locations
#
#
# since ls returns lowest version numbers first, reverse the entire list
# since ls returns lowest version numbers first, reverse the entire list
# and search for the worst fit, overwriting it with better fits as we find them
# and search for the worst fit, overwriting it with better fits as we find them
if test x"${ac_cv_c_tkh}" = x ; then
if test x"${ac_cv_c_tkh}" = x ; then
  for i in \
  for i in \
                `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \
                `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \
                /usr/local/src/tk \
                /usr/local/src/tk \
                /usr/local/lib/tk \
                /usr/local/lib/tk \
                ${prefix}/include ; do
                ${prefix}/include ; do
    if test -f $i/tk.h ; then
    if test -f $i/tk.h ; then
      ac_cv_c_tkh=`(cd $i; pwd)`
      ac_cv_c_tkh=`(cd $i; pwd)`
      break
      break
    fi
    fi
  done
  done
fi
fi
# see if one is installed
# see if one is installed
if test x"${ac_cv_c_tkh}" = x ; then
if test x"${ac_cv_c_tkh}" = x ; then
  AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed)
  AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed)
fi
fi
])
])
if test x"${ac_cv_c_tkh}" != x ; then
if test x"${ac_cv_c_tkh}" != x ; then
  no_tk=""
  no_tk=""
  if test x"${ac_cv_c_tkh}" = x"installed" ; then
  if test x"${ac_cv_c_tkh}" = x"installed" ; then
    AC_MSG_RESULT([is installed])
    AC_MSG_RESULT([is installed])
    TKHDIR=""
    TKHDIR=""
  else
  else
    AC_MSG_RESULT([found in $ac_cv_c_tkh])
    AC_MSG_RESULT([found in $ac_cv_c_tkh])
    # this hack is cause the TKHDIR won't print if there is a "-I" in it.
    # this hack is cause the TKHDIR won't print if there is a "-I" in it.
    TKHDIR="-I${ac_cv_c_tkh}"
    TKHDIR="-I${ac_cv_c_tkh}"
  fi
  fi
else
else
  TKHDIR="# no Tk directory found"
  TKHDIR="# no Tk directory found"
  AC_MSG_WARN([Can't find Tk private headers])
  AC_MSG_WARN([Can't find Tk private headers])
  no_tk=true
  no_tk=true
fi
fi
 
 
# if Tk is installed, extract the major/minor version
# if Tk is installed, extract the major/minor version
if test x"${no_tk}" = x ; then
if test x"${no_tk}" = x ; then
AC_MSG_CHECKING([Tk version])
AC_MSG_CHECKING([Tk version])
orig_includes="$CPPFLAGS"
orig_includes="$CPPFLAGS"
 
 
if test x"${TCLHDIR}" != x ; then
if test x"${TCLHDIR}" != x ; then
  CPPFLAGS="$CPPFLAGS $TCLHDIR"
  CPPFLAGS="$CPPFLAGS $TCLHDIR"
fi
fi
if test x"${TKHDIR}" != x ; then
if test x"${TKHDIR}" != x ; then
  CPPFLAGS="$CPPFLAGS $TKHDIR"
  CPPFLAGS="$CPPFLAGS $TKHDIR"
fi
fi
if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then
if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then
  CPPFLAGS="$CPPFLAGS -I$x_includes"
  CPPFLAGS="$CPPFLAGS -I$x_includes"
fi
fi
 
 
# Get major and minor versions of Tk.  Use funny names to avoid
# Get major and minor versions of Tk.  Use funny names to avoid
# clashes with eg SunOS.
# clashes with eg SunOS.
cat > conftest.c <<'EOF'
cat > conftest.c <<'EOF'
#include "tk.h"
#include "tk.h"
MaJor = TK_MAJOR_VERSION
MaJor = TK_MAJOR_VERSION
MiNor = TK_MINOR_VERSION
MiNor = TK_MINOR_VERSION
EOF
EOF
 
 
tkmajor=
tkmajor=
tkminor=
tkminor=
if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
   # Success.
   # Success.
   tkmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
   tkmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
   tkminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
   tkminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
fi
fi
rm -f conftest.c conftest.out
rm -f conftest.c conftest.out
 
 
if test -z "$tkmajor" || test -z "$tkminor"; then
if test -z "$tkmajor" || test -z "$tkminor"; then
   AC_MSG_RESULT([fatal error: could not find major or minor version number of Tk])
   AC_MSG_RESULT([fatal error: could not find major or minor version number of Tk])
   exit 1
   exit 1
fi
fi
AC_MSG_RESULT(${tkmajor}.${tkminor})
AC_MSG_RESULT(${tkmajor}.${tkminor})
 
 
CPPFLAGS="${orig_includes}"
CPPFLAGS="${orig_includes}"
fi
fi
 
 
AC_PROVIDE([$0])
AC_PROVIDE([$0])
AC_SUBST(TKHDIR)
AC_SUBST(TKHDIR)
])
])
AC_DEFUN(CY_AC_PATH_TKLIB, [
AC_DEFUN(CY_AC_PATH_TKLIB, [
AC_REQUIRE([CY_AC_PATH_TCL])
AC_REQUIRE([CY_AC_PATH_TCL])
#
#
# Ok, lets find the tk library
# Ok, lets find the tk library
# First, look for the latest private (uninstalled) copy
# First, look for the latest private (uninstalled) copy
# Notice that the destinations in backwards priority since the tests have
# Notice that the destinations in backwards priority since the tests have
# no break.
# no break.
# Then we look for either .a, .so, or Makefile.  A Makefile is acceptable
# Then we look for either .a, .so, or Makefile.  A Makefile is acceptable
# is it indicates the target has been configured and will (probably)
# is it indicates the target has been configured and will (probably)
# soon be built.  This allows an entire tree of Tcl software to be
# soon be built.  This allows an entire tree of Tcl software to be
# configured at once and then built.
# configured at once and then built.
# the alternative search directory is invoked by --with-tklib
# the alternative search directory is invoked by --with-tklib
#
#
 
 
if test x"${no_tk}" = x ; then
if test x"${no_tk}" = x ; then
  # reset no_tk incase something fails here
  # reset no_tk incase something fails here
  no_tk="true"
  no_tk="true"
 
 
  if test $tkmajor -ge 4 ; then
  if test $tkmajor -ge 4 ; then
    installedtklibroot=tk$tkversion
    installedtklibroot=tk$tkversion
  else
  else
    installedtkllibroot=tk
    installedtkllibroot=tk
  fi
  fi
 
 
  AC_ARG_WITH(tklib, [  --with-tklib            directory where the tk library is],
  AC_ARG_WITH(tklib, [  --with-tklib            directory where the tk library is],
              with_tklib=${withval})
              with_tklib=${withval})
  AC_MSG_CHECKING([for Tk library])
  AC_MSG_CHECKING([for Tk library])
  AC_CACHE_VAL(ac_cv_c_tklib,[
  AC_CACHE_VAL(ac_cv_c_tklib,[
  # first check to see if --with-tklib was specified
  # first check to see if --with-tklib was specified
  # This requires checking for both the installed and uninstalled name-styles
  # This requires checking for both the installed and uninstalled name-styles
  # since we have no idea if it's installed or not.
  # since we have no idea if it's installed or not.
  if test x"${with_tklib}" != x ; then
  if test x"${with_tklib}" != x ; then
    if test -f "${with_tklib}/lib$installedtklibroot.so" ; then
    if test -f "${with_tklib}/lib$installedtklibroot.so" ; then
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so
      no_tk=""
      no_tk=""
    elif test -f "${with_tklib}/libtk.so" ; then
    elif test -f "${with_tklib}/libtk.so" ; then
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so
      no_tk=""
      no_tk=""
    # then look for a freshly built statically linked library
    # then look for a freshly built statically linked library
    # if Makefile exists we assume its configured and libtk will be built
    # if Makefile exists we assume its configured and libtk will be built
    elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then
    elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a
      no_tk=""
      no_tk=""
    elif test -f "${with_tklib}/libtk.a" ; then
    elif test -f "${with_tklib}/libtk.a" ; then
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a
      ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a
      no_tk=""
      no_tk=""
    else
    else
      AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries])
      AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries])
    fi
    fi
  fi
  fi
  # then check for a private Tk library
  # then check for a private Tk library
  # Since these are uninstalled, use the simple lib name root.
  # Since these are uninstalled, use the simple lib name root.
  if test x"${ac_cv_c_tklib}" = x ; then
  if test x"${ac_cv_c_tklib}" = x ; then
    for i in \
    for i in \
                ../tk \
                ../tk \
                `ls -dr ../tk[[0-9]]* 2>/dev/null` \
                `ls -dr ../tk[[0-9]]* 2>/dev/null` \
                ../../tk \
                ../../tk \
                `ls -dr ../../tk[[0-9]]* 2>/dev/null` \
                `ls -dr ../../tk[[0-9]]* 2>/dev/null` \
                ../../../tk \
                ../../../tk \
                `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do
                `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do
      # Tk 4.1 and greater puts things in subdirs.  Check these first.
      # Tk 4.1 and greater puts things in subdirs.  Check these first.
      if test -f "$i/unix/libtk.so" ; then
      if test -f "$i/unix/libtk.so" ; then
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
         no_tk=
         no_tk=
         break
         break
      elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
      elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a
         no_tk=
         no_tk=
         break
         break
      # look for a freshly built dynamically linked library
      # look for a freshly built dynamically linked library
      elif test -f "$i/libtk.so" ; then
      elif test -f "$i/libtk.so" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
        no_tk=
        no_tk=
        break
        break
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists we assume its configured and libtk will be built
      # if Makefile exists we assume its configured and libtk will be built
      elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
        no_tk=""
        no_tk=""
        break
        break
      fi
      fi
    done
    done
  fi
  fi
  # finally check in a few common install locations
  # finally check in a few common install locations
  if test x"${ac_cv_c_tklib}" = x ; then
  if test x"${ac_cv_c_tklib}" = x ; then
    for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
    for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
      # first look for a freshly built dynamically linked library
      # first look for a freshly built dynamically linked library
      if test -f "$i/lib$installedtklibroot.so" ; then
      if test -f "$i/lib$installedtklibroot.so" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so
        ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so
        no_tk=""
        no_tk=""
        break
        break
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists, we assume it's configured and libtcl will be built
      # if Makefile exists, we assume it's configured and libtcl will be built
      elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a
        ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a
        no_tk=""
        no_tk=""
        break
        break
      fi
      fi
    done
    done
  fi
  fi
  # check in a few other private locations
  # check in a few other private locations
  if test x"${ac_cv_c_tklib}" = x ; then
  if test x"${ac_cv_c_tklib}" = x ; then
    for i in \
    for i in \
                ${srcdir}/../tk \
                ${srcdir}/../tk \
                `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do
                `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do
      # Tk 4.1 and greater puts things in subdirs.  Check these first.
      # Tk 4.1 and greater puts things in subdirs.  Check these first.
      if test -f "$i/unix/libtk.so" ; then
      if test -f "$i/unix/libtk.so" ; then
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
         ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
         no_tk=
         no_tk=
         break
         break
      elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
      elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a
         ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a
         no_tk=
         no_tk=
         break
         break
      # look for a freshly built dynamically linked library
      # look for a freshly built dynamically linked library
      elif test -f "$i/libtk.so" ; then
      elif test -f "$i/libtk.so" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
        no_tk=""
        no_tk=""
        break
        break
      # then look for a freshly built statically linked library
      # then look for a freshly built statically linked library
      # if Makefile exists, we assume it's configured and libtcl will be built
      # if Makefile exists, we assume it's configured and libtcl will be built
      elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
      elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
        ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
        no_tk=""
        no_tk=""
        break
        break
      fi
      fi
    done
    done
  fi
  fi
  # see if one is conveniently installed with the compiler
  # see if one is conveniently installed with the compiler
  if test x"${ac_cv_c_tklib}" = x ; then
  if test x"${ac_cv_c_tklib}" = x ; then
       AC_REQUIRE([AC_PATH_X])
       AC_REQUIRE([AC_PATH_X])
       orig_libs="$LIBS"
       orig_libs="$LIBS"
       LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm"
       LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm"
       AC_TRY_RUN([
       AC_TRY_RUN([
       Tcl_AppInit()
       Tcl_AppInit()
       { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib=""
       { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib=""
       , ac_cv_c_tklib="-l$installedtklibroot")
       , ac_cv_c_tklib="-l$installedtklibroot")
       LIBS="${orig_libs}"
       LIBS="${orig_libs}"
   fi
   fi
  ])
  ])
  if test x"${ac_cv_c_tklib}" = x ; then
  if test x"${ac_cv_c_tklib}" = x ; then
    TKLIB="# no Tk library found"
    TKLIB="# no Tk library found"
    AC_MSG_WARN(Can't find Tk library)
    AC_MSG_WARN(Can't find Tk library)
  else
  else
    TKLIB=$ac_cv_c_tklib
    TKLIB=$ac_cv_c_tklib
    AC_MSG_RESULT(found $TKLIB)
    AC_MSG_RESULT(found $TKLIB)
    no_tk=
    no_tk=
  fi
  fi
fi
fi
AC_PROVIDE([$0])
AC_PROVIDE([$0])
AC_SUBST(TKLIB)
AC_SUBST(TKLIB)
])
])
AC_DEFUN(CY_AC_PATH_TK, [
AC_DEFUN(CY_AC_PATH_TK, [
  CY_AC_PATH_TKH
  CY_AC_PATH_TKH
  CY_AC_PATH_TKLIB
  CY_AC_PATH_TKLIB
])
])
AC_DEFUN(CY_AC_PATH_TCL, [
AC_DEFUN(CY_AC_PATH_TCL, [
  CY_AC_PATH_TCLH
  CY_AC_PATH_TCLH
  CY_AC_PATH_TCLLIB
  CY_AC_PATH_TCLLIB
])
])
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.