X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fcpp2%2Fconfigure.in;h=4532c6bd9d6dfc834050df63ad15cb2e02d1198b;hb=334d46c82420b40682d224b62f2930eb7d77af75;hp=b6deb5381a30c64aab993dd1d06ef4d1cb13d0bb;hpb=5372e7e52b0a5044ad4c7a969f47d3996b06f66f;p=fw%2Fsdcc diff --git a/support/cpp2/configure.in b/support/cpp2/configure.in index b6deb538..4532c6bd 100644 --- a/support/cpp2/configure.in +++ b/support/cpp2/configure.in @@ -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 ],[ -#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. @@ -206,26 +204,10 @@ AC_CHECK_PROG(STRIP, strip, strip, :) # preprocessor stringification operator. (Used by symcat.h.) AC_C_STRINGIZE -# Use only if it exists, -# doesn't clash with , and declares intmax_t. -AC_MSG_CHECKING(for inttypes.h) -AC_CACHE_VAL(gcc_cv_header_inttypes_h, -[AC_TRY_COMPILE( - [#include -#include ], - [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 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) @@ -235,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 -#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 -#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 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 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 @@ -336,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 @@ -345,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 @@ -385,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 <