2002-08-14 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / acinclude.m4
index deea88abf5a3a17eb8d81c41c1cf901b9183120a..12f4c483a6b5305adf38dc25fa4929b26aa84922 100644 (file)
@@ -4,8 +4,8 @@ dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
 dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
 sinclude(../bfd/acinclude.m4)
 
-dnl CY_AC_PATH_TCLCONFIG and CY_AC_LOAD_TCLCONFIG should be invoked
-dnl (in that order) before any other TCL macros.  Similarly for TK.
+dnl This gets the standard macros, like the TCL, TK, etc ones.
+sinclude(../config/acinclude.m4)
 
 dnl CYGNUS LOCAL: This gets the right posix flag for gcc
 AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
@@ -493,7 +493,7 @@ AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
 if test x"${no_itcl}" = x ; then
   # we reset no_itcl in case something fails here
   no_itcl=true
-  AC_ARG_WITH(itclconfig, [  --with-itclconfig           directory containing itcl configuration (itclConfig.sh)],
+  AC_ARG_WITH(itclconfig, [  --with-itclconfig       Directory containing itcl configuration (itclConfig.sh)],
          with_itclconfig=${withval})
   AC_MSG_CHECKING([for Itcl configuration])
   AC_CACHE_VAL(ac_cv_c_itclconfig,[
@@ -516,8 +516,8 @@ if test x"${no_itcl}" = x ; then
                `ls -dr ../../itcl[[4-9]]*/itcl 2>/dev/null` \
                ../../../itcl \
                `ls -dr ../../../itcl[[4-9]]*/itcl 2>/dev/null` ; do
-      if test -f "$i/${configdir}/itclConfig.sh" ; then
-        ac_cv_c_itclconfig=`(cd $i/${configdir}; pwd)`
+      if test -f "$i/itclConfig.sh" ; then
+        ac_cv_c_itclconfig=`(cd $i; pwd)`
        break
       fi
     done
@@ -536,8 +536,8 @@ if test x"${no_itcl}" = x ; then
     for i in \
                ${srcdir}/../itcl/itcl \
                `ls -dr ${srcdir}/../itcl[[4-9]]*/itcl 2>/dev/null` ; do
-      if test -f "$i/${configdir}/itclConfig.sh" ; then
-        ac_cv_c_itclconfig=`(cd $i/${configdir}; pwd)`
+      if test -f "$i/itclConfig.sh" ; then
+        ac_cv_c_itclconfig=`(cd $i; pwd)`
        break
       fi
     done
@@ -552,7 +552,6 @@ if test x"${no_itcl}" = x ; then
     AC_MSG_RESULT(found $ITCLCONFIG)
   fi
 fi
-
 ])
 
 # Defined as a separate macro so we don't have to cache the values
@@ -620,7 +619,7 @@ AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
 if test x"${no_itk}" = x ; then
   # we reset no_itk in case something fails here
   no_itk=true
-  AC_ARG_WITH(itkconfig, [  --with-itkconfig           directory containing itk configuration (itkConfig.sh)],
+  AC_ARG_WITH(itkconfig, [  --with-itkconfig        Directory containing itk configuration (itkConfig.sh)],
          with_itkconfig=${withval})
   AC_MSG_CHECKING([for Itk configuration])
   AC_CACHE_VAL(ac_cv_c_itkconfig,[
@@ -643,8 +642,8 @@ if test x"${no_itk}" = x ; then
                `ls -dr ../../itcl[[4-9]]*/itk 2>/dev/null` \
                ../../../itk \
                `ls -dr ../../../itcl[[4-9]]*/itk 2>/dev/null` ; do
-      if test -f "$i/${configdir}/itkConfig.sh" ; then
-        ac_cv_c_itkconfig=`(cd $i/${configdir}; pwd)`
+      if test -f "$i/itkConfig.sh" ; then
+        ac_cv_c_itkconfig=`(cd $i; pwd)`
        break
       fi
     done
@@ -663,8 +662,8 @@ if test x"${no_itk}" = x ; then
     for i in \
                ${srcdir}/../itcl/itk \
                `ls -dr ${srcdir}/../itcl[[4-9]]*/itk 2>/dev/null` ; do
-      if test -f "$i/${configdir}/itkConfig.sh" ; then
-        ac_cv_c_itkconfig=`(cd $i/${configdir}; pwd)`
+      if test -f "$i/itkConfig.sh" ; then
+        ac_cv_c_itkconfig=`(cd $i; pwd)`
        break
       fi
     done
@@ -736,7 +735,7 @@ AC_SUBST(ITKHDIR)
 
 # check for Tix headers. 
 
-AC_DEFUN(CY_AC_PATH_TIX, [
+AC_DEFUN(CY_AC_PATH_TIXH, [
 AC_MSG_CHECKING(for Tix private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_tixh}" = x ; then
   for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
@@ -755,3 +754,225 @@ if test x"${ac_cv_c_tixh}" != x ; then
 fi
 AC_SUBST(TIXHDIR)
 ])
+
+AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
+#
+# Ok, lets find the tix configuration
+# First, look for one uninstalled.  
+# the alternative search directory is invoked by --with-itkconfig
+#
+
+if test x"${no_tix}" = x ; then
+  # we reset no_tix in case something fails here
+  no_tix=true
+  AC_ARG_WITH(tixconfig, [  --with-tixconfig        Directory containing tix configuration (tixConfig.sh)],
+         with_tixconfig=${withval})
+  AC_MSG_CHECKING([for Tix configuration])
+  AC_CACHE_VAL(ac_cv_c_tixconfig,[
+
+  # First check to see if --with-tixconfig was specified.
+  if test x"${with_tixconfig}" != x ; then
+    if test -f "${with_tixconfig}/tixConfig.sh" ; then
+      ac_cv_c_tixconfig=`(cd ${with_tixconfig}; pwd)`
+    else
+      AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh])
+    fi
+  fi
+
+  # then check for a private Tix library
+  if test x"${ac_cv_c_tixconfig}" = x ; then
+    for i in \
+               ../tix \
+               `ls -dr ../tix 2>/dev/null` \
+               ../../tix \
+               `ls -dr ../../tix 2>/dev/null` \
+               ../../../tix \
+               `ls -dr ../../../tix 2>/dev/null` ; do
+      echo "**** Looking at $i - with ${configdir}"
+      if test -f "$i/tixConfig.sh" ; then
+        ac_cv_c_tixconfig=`(cd $i; pwd)`
+       break
+      fi
+    done
+  fi
+  # check in a few common install locations
+  if test x"${ac_cv_c_tixconfig}" = x ; then
+    for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+      echo "**** Looking at $i"
+      if test -f "$i/tixConfig.sh" ; then
+        ac_cv_c_tixconfig=`(cd $i; pwd)`
+       break
+      fi
+    done
+  fi
+  # check in a few other private locations
+  echo "**** Other private locations"
+  if test x"${ac_cv_c_tixconfig}" = x ; then
+    for i in \
+               ${srcdir}/../tix \
+               `ls -dr ${srcdir}/../tix 2>/dev/null` ; do
+      echo "**** Looking at $i - with ${configdir}"
+      if test -f "$i/${configdir}/tixConfig.sh" ; then
+        ac_cv_c_tixconfig=`(cd $i/${configdir}; pwd)`
+       break
+      fi
+    done
+  fi
+  ])
+  if test x"${ac_cv_c_tixconfig}" = x ; then
+    TIXCONFIG="# no Tix configs found"
+    AC_MSG_WARN(Can't find Tix configuration definitions)
+  else
+    no_tix=
+    TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
+    AC_MSG_RESULT(found $TIXCONFIG)
+  fi
+fi
+
+])
+
+# Defined as a separate macro so we don't have to cache the values
+# from PATH_TIXCONFIG (because this can also be cached).
+AC_DEFUN(CY_AC_LOAD_TIXCONFIG, [
+    if test -f "$TIXCONFIG" ; then
+      . $TIXCONFIG
+    fi
+
+    AC_SUBST(TIX_VERSION)
+dnl not actually used, don't export to save symbols
+dnl    AC_SUBST(TIX_MAJOR_VERSION)
+dnl    AC_SUBST(TIX_MINOR_VERSION)
+dnl    AC_SUBST(TIX_DEFS)
+
+dnl not used, don't export to save symbols
+dnl    dnl AC_SUBST(TIX_LIB_FILE)
+
+dnl not used outside of configure
+dnl    AC_SUBST(TIX_LIBS)
+dnl not used, don't export to save symbols
+dnl    AC_SUBST(TIX_PREFIX)
+
+dnl not used, don't export to save symbols
+dnl    AC_SUBST(TIX_EXEC_PREFIX)
+
+dnl    AC_SUBST(TIX_BUILD_INCLUDES)
+    AC_SUBST(TIX_BUILD_LIB_SPEC)
+dnl    AC_SUBST(TIX_LIB_SPEC)
+])
+
+dnl sinclude(../gettext.m4) already included by bfd/acinclude.m4
+dnl The lines below arrange for aclocal not to bring gettext.m4's
+dnl CY_GNU_GETTEXT into aclocal.m4.
+ifelse(yes,no,[
+AC_DEFUN([CY_GNU_GETTEXT],)
+])
+
+## ----------------------------------------- ##
+## ANSIfy the C compiler whenever possible.  ##
+## From Franc,ois Pinard                     ##
+## ----------------------------------------- ##
+
+# Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so.  This macro tries various
+# options that select ANSI C on some system or another.  It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX                  -qlanglvl=ansi
+# Ultrix and OSF/1     -std1
+# HP-UX 10.20 and later        -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4                 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+  AC_MSG_RESULT([none needed])
+else
+  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
+fi
+case "x$am_cv_prog_cc_stdc" in
+  x|xno) ;;
+  *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
This page took 0.028729 seconds and 4 git commands to generate.