* src/mcs51/ralloc.c (isSpiltOnStack): fixed bug 1565152
[fw/sdcc] / support / cpp2 / configure.in
index 0821743427f1cf8e9ea5b737406688974efc14e1..4532c6bd9d6dfc834050df63ad15cb2e02d1198b 100644 (file)
@@ -1,28 +1,28 @@
-# configure.in for GNU CC
+# configure.in for GCC
 # Process this file with autoconf to generate a configuration script.
 
-# Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
-#This file is part of GNU CC.
+#This file is part of GCC.
 
-#GNU CC 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.
+#GCC 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 CC 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.
+#GCC 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 CC; see the file COPYING.  If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA.
+#along with GCC; see the file COPYING.  If not, write to the Free
+#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
 
 # Initialization and defaults
-AC_PREREQ(2.13)
-AC_INIT(cppmain.c)
+AC_PREREQ(2.60)
+AC_INIT(sdcpp.c)
 AC_CONFIG_HEADER(auto-host.h:config.in)
 
 remove=rm
@@ -98,6 +98,8 @@ if test x$local_prefix = x; then
        local_prefix=/usr/local
 fi
 
+AC_ARG_PROGRAM
+
 # Enable Multibyte Characters for C/C++
 AC_ARG_ENABLE(c-mbchar,
 [  --enable-c-mbchar       enable multibyte characters for C and C++],
@@ -106,7 +108,7 @@ if test x$enable_c_mbchar != xno; then
   [Define if you want the C and C++ compilers to support multibyte
    character sets for source code.])
 fi)
-  
+
 # Find the native compiler
 AC_PROG_CC
 AC_PROG_CC_C_O
@@ -122,6 +124,8 @@ AC_SUBST(OUTPUT_OPTION)
 AC_PROG_CPP
 AC_C_INLINE
 
+gcc_AC_C__BOOL
+
 # sizeof(char) is 1 by definition.
 gcc_AC_COMPILE_CHECK_SIZEOF(short)
 gcc_AC_COMPILE_CHECK_SIZEOF(int)
@@ -129,7 +133,7 @@ gcc_AC_COMPILE_CHECK_SIZEOF(long)
 
 gcc_AC_C_CHARSET
 
-# If the native compiler is GCC, we can enable warnings even in stage1.  
+# If the native compiler is GCC, we can enable warnings even in stage1.
 # That's useful for people building cross-compilers, or just running a
 # quick `make'.
 warn_cflags=
@@ -162,21 +166,14 @@ else
     AC_MSG_RESULT(no)
 fi
 
-AC_MSG_CHECKING(for GNU C library)
-AC_CACHE_VAL(gcc_cv_glibc,
-[AC_TRY_COMPILE(
-  [#include <features.h>],[
-#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
-#error Not a GNU C library system
-#endif], 
-  [gcc_cv_glibc=yes], 
-  gcc_cv_glibc=no)])
-AC_MSG_RESULT($gcc_cv_glibc)
-if test $gcc_cv_glibc = yes; then
-  AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
-fi
-
 # Find some useful tools
+AC_PROG_AWK
+# We need awk to run opts.sh (to create options.c and options.h).
+# Bail out if it's missing.
+case ${AWK} in
+  "") AC_MSG_ERROR([can't build without awk, bailing out]) ;;
+esac
+
 gcc_AC_PROG_LN
 gcc_AC_PROG_LN_S
 AC_PROG_RANLIB
@@ -184,12 +181,13 @@ gcc_AC_PROG_INSTALL
 
 AC_HEADER_STDC
 AC_HEADER_TIME
+gcc_AC_HEADER_STDBOOL
 gcc_AC_HEADER_STRING
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
                 fcntl.h unistd.h sys/file.h sys/time.h \
-                sys/resource.h sys/param.h sys/times.h sys/stat.h \
-                direct.h malloc.h langinfo.h)
+                sys/param.h sys/stat.h \
+                direct.h malloc.h)
 
 # Check for thread headers.
 
@@ -200,30 +198,16 @@ gcc_AC_C_COMPILE_ENDIAN
 # See if we have the mktemp command.
 AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
 
+AC_CHECK_PROG(STRIP, strip, strip, :)
+
 # See if the stage1 system preprocessor understands the ANSI C
 # preprocessor stringification operator.  (Used by symcat.h.)
 AC_C_STRINGIZE
 
-# Use <inttypes.h> only if it exists,
-# doesn't clash with <sys/types.h>, and declares intmax_t.
-AC_MSG_CHECKING(for inttypes.h)
-AC_CACHE_VAL(gcc_cv_header_inttypes_h,
-[AC_TRY_COMPILE(
-  [#include <sys/types.h>
-#include <inttypes.h>],
-  [intmax_t i = -1;],
-  [gcc_cv_header_inttypes_h=yes],
-  gcc_cv_header_inttypes_h=no)])
-AC_MSG_RESULT($gcc_cv_header_inttypes_h)
-if test $gcc_cv_header_inttypes_h = yes; then
-  AC_DEFINE(HAVE_INTTYPES_H, 1,
-       [Define if you have a working <inttypes.h> header file.])
-fi
-
 dnl Disabled until we have a complete test for buggy enum bitfields.
 dnl gcc_AC_C_ENUM_BF_UNSIGNED
 
-AC_CHECK_FUNCS(times clock strchr strrchr lstat)
+AC_CHECK_FUNCS(clock strsignal strchr strrchr lstat)
 
 AC_CHECK_TYPE(ssize_t, int)
 
@@ -233,49 +217,15 @@ AC_FUNC_MMAP_FILE
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
-gcc_AC_CHECK_DECLS(getenv abort errno \
-       malloc realloc calloc free getopt clock, , ,[
+gcc_AC_CHECK_DECLS(getenv abort strsignal errno \
+       malloc realloc calloc free clock, , ,[
 #include "ansidecl.h"
 #include "system.h"])
 
-gcc_AC_CHECK_DECLS(times, , ,[
-#include "ansidecl.h"
-#include "system.h"
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-])
-
-# More time-related stuff.
-AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
-AC_TRY_COMPILE([
-#include "ansidecl.h"
-#include "system.h"
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)])
-if test $ac_cv_struct_tms = yes; then
-  AC_DEFINE(HAVE_STRUCT_TMS, 1,
-  [Define if <sys/times.h> defines struct tms.])
-fi
-
-# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
-# revisit after autoconf 2.50.
-AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [
-AC_TRY_COMPILE([
-#include "ansidecl.h"
-#include "system.h"
-], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)])
-if test $gcc_cv_type_clock_t = yes; then
-  AC_DEFINE(HAVE_CLOCK_T, 1,
-  [Define if <time.h> defines clock_t.])
-fi
-
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
-# mkdir takes a single argument on some systems. 
+# mkdir takes a single argument on some systems.
 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
 
 # File extensions
@@ -334,7 +284,7 @@ fi
 # auto-host.h is the file containing items generated by autoconf and is
 # the first file included by config.h.
 # If host=build, it is correct to have hconfig include auto-host.h
-# as well.  If host!=build, we are in error and need to do more 
+# as well.  If host!=build, we are in error and need to do more
 # work to find out the build config parameters.
 if test x$host = x$build
 then
@@ -343,7 +293,7 @@ else
        # We create a subdir, then run autoconf in the subdir.
        # To prevent recursion we set host and build for the new
        # invocation of configure to the build for this invocation
-       # of configure. 
+       # of configure.
        tempdir=build.$$
        rm -rf $tempdir
        mkdir $tempdir
@@ -383,19 +333,6 @@ changequote(,)dnl
 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
 
-# Compile in configure arguments.
-if test -f configargs.h ; then
-       # Being re-configured.
-       gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
-       gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
-else
-       gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
-fi
-cat > configargs.h <<EOF
-/* Generated automatically. */
-static const char configuration_arguments[] = "$gcc_config_arguments";
-static const char thread_model[] = "$thread_file";
-EOF
 changequote([,])dnl
 
 # Internationalization
@@ -562,7 +499,7 @@ fi
 AC_SUBST(build_canonical)
 AC_SUBST(host_canonical)
 AC_SUBST(target_subdir)
-       
+
 # Nothing to do for FLOAT_H, float_format already handled.
 objdir=`pwd`
 AC_SUBST(objdir)
@@ -599,11 +536,11 @@ AC_SUBST(symbolic_link)
 AC_SUBST(thread_file)
 AC_SUBST(c_target_objs)
 
-AC_SUBST_FILE(target_overrides)
-AC_SUBST_FILE(host_overrides)
-AC_SUBST(cross_defines)
-AC_SUBST_FILE(cross_overrides)
-AC_SUBST_FILE(build_overrides)
+#AC_SUBST_FILE(target_overrides)
+#AC_SUBST_FILE(host_overrides)
+#AC_SUBST(cross_defines)
+#AC_SUBST_FILE(cross_overrides)
+#AC_SUBST_FILE(build_overrides)
 
 # Create the Makefile
 # and configure language subdirectories