OSDN Git Service

2001-11-07 David O'Brien <obrien@FreeBSD.org>
[pf3gnuchains/gcc-fork.git] / libchill / configure.in
index babc64e..cd08ba1 100644 (file)
@@ -1,24 +1,25 @@
 # Process this file with autoconf to produce a configure script.
-#   Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
 #   Contributed by Dave Love (d.love@dl.ac.uk).
 #
 #This file is part of GNU CC.
 #
-#GNU Fortran is free software; you can redistribute it and/or modify
+#GNU CHILL 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.
 #
-#GNU Fortran is distributed in the hope that it will be useful,
+#GNU CHILL 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 GNU Fortran; see the file COPYING.  If not, write to
+#along with GNU CHILL; see the file COPYING.  If not, write to
 #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #02111-1307, USA.
 
+AC_PREREQ(2.13)
 AC_INIT(chillrt0.c)
 
 if test "${srcdir}" = "." ; then
@@ -30,6 +31,37 @@ if test "${srcdir}" = "." ; then
 else
   topsrcdir=${srcdir}/..
 fi
+dnl This is needed for a multilibbed build in the source tree so
+dnl that install-sh and config.sub get found.
+AC_CONFIG_AUX_DIR($topsrcdir)
+
+# If the language specific compiler does not exist, but the "gcc" directory 
+# does, we do not build anything. Note, $r is set by the top-level Makefile.
+# Note that when we look for the compiler, we search both with and without
+# extension to handle cross and canadian cross builds. 
+compiler_name=cc1chill
+rm -f skip-this-dir
+AC_MSG_CHECKING(if compiler $compiler_name has been built)
+AC_CACHE_VAL(chill_cv_compiler_exists,
+[chill_cv_compiler_exists=yes
+if test -n "$r"; then
+  if test -d "$r"/gcc; then
+    if test -f "$r"/gcc/$compiler_name \
+       || test -f "$r"/gcc/$compiler_name.exe; then
+      true
+    else
+      chill_cv_compiler_exists=no
+      echo "rm -f config.cache config.log multilib.out" > skip-this-dir
+    fi
+  fi
+fi
+])
+AC_MSG_RESULT($chill_cv_compiler_exists)
+if test x$chill_cv_compiler_exists = xno
+then
+  rm -f Makefile conftest* confdefs* core
+  exit 0
+fi
 
 dnl Checks for programs.
 # For chill we'll set CC to point at the built gcc, but this will get it into
@@ -38,6 +70,11 @@ AC_PROG_CC
 
 test "$AR" || AR=ar
 AC_SUBST(AR)
+if test "$RANLIB"; then :
+  AC_SUBST(RANLIB)
+else
+  AC_PROG_RANLIB
+fi
 AC_PROG_MAKE_SET
 
 dnl Checks for libraries.
@@ -91,6 +128,10 @@ AC_CHECK_FUNC(atexit,
      AC_DEFINE(onexit,on_exit),)])])
 else true
 fi
+AC_CHECK_FUNC(memmove,
+  MEMMOVE_O='',
+  MEMMOVE_O=memmove.o)
+AC_SUBST(MEMMOVE_O)
 
 # We need multilib support, but only if configuring for the target.
 AC_OUTPUT(Makefile,