Commit 3bbd5a19 by Paolo Bonzini Committed by Paolo Bonzini

acinclude.m4 (gcc_AC_CHECK_PROG_VER): Remove.

gcc:
2007-06-14  Paolo Bonzini  <bonzini@gnu.org>

        * acinclude.m4 (gcc_AC_CHECK_PROG_VER): Remove.
        * aclocal.m4: Regenerate.
        * configure.ac: Use ACX_PROG_CC_WARNING_OPTS,
        ACX_PROG_CC_WARNINGS_ARE_ERRORS,
        ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_CHECK_PROG_VER.
	* configure: Regenerate.
        * Makefile.in (LOOSE_WARN): Subst loose_warn.

        * Makefile.in (quickstrap): Build libgcc too.

libiberty:
2007-06-14  Paolo Bonzini  <bonzini@gnu.org>

        * aclocal.m4: Include config/warnings.m4.
        * configure.ac: Use ACX_PROG_CC_WARNING_OPTS.
	* configure: Regenerate.

config:
2007-06-14  Paolo Bonzini  <bonzini@gnu.org>

        * acx.m4 (ACX_CHECK_PROG_VER): Remove duplicate lines.

From-SVN: r125700
parent ab28cc38
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* acx.m4 (ACX_CHECK_PROG_VER): Remove duplicate lines.
2007-06-04 Olivier Hainque <hainque@adacore.com>
* mh-ppc-aix: Add default ADAFLAGS to BOOT_ADAFLAGS.
......
......@@ -540,10 +540,6 @@ AC_DEFUN([ACX_CHECK_PROG_VER],[
$5) gcc_cv_prog_$2_modern=yes;;
*) gcc_cv_prog_$2_modern=no;;
esac]
if test $gcc_cv_prog_$2_modern = no; then
$1="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing $2"
fi
])
else
gcc_cv_prog_$2_modern=no
......
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* acinclude.m4 (gcc_AC_CHECK_PROG_VER): Remove.
* aclocal.m4: Regenerate.
* configure.ac: Use ACX_PROG_CC_WARNING_OPTS,
ACX_PROG_CC_WARNINGS_ARE_ERRORS,
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_CHECK_PROG_VER.
* configure: Regenerate.
* Makefile.in (LOOSE_WARN): Subst loose_warn.
* Makefile.in (quickstrap): Build libgcc too.
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Add --enable-checking=df. Explicitly mention that
the variables are initialized as for "release".
* df-core.c: Use it.
......
......@@ -31,10 +31,6 @@
# "all.cross" to build a cross compiler.
all: @ALL@
# Provide quickstrap as a target that people can type into the gcc directory,
# and that fails if you're not into it.
quickstrap: all
# Depend on this to specify a phony target portably.
force:
......@@ -83,22 +79,27 @@ abs_docdir = @abs_srcdir@/doc
# Top build directory for this package, relative to here.
top_builddir = .
# objdir is set by configure.
# It's normally the absolute path to the current directory.
objdir = @objdir@
host_subdir=@host_subdir@
build_subdir=@build_subdir@
target_subdir=@target_subdir@
build_libsubdir=@build_libsubdir@
# Top build directory for the "Cygnus tree", relative to $(top_builddir).
ifeq ($(host_subdir),.)
build_objdir := ../$(build_subdir)
build_libobjdir := ../$(build_libsubdir)
toplevel_builddir := ..
else
build_objdir := ../../$(build_subdir)
build_libobjdir := ../../$(build_libsubdir)
toplevel_builddir := ../..
endif
build_objdir := $(toplevel_builddir)/$(build_subdir)
build_libobjdir := $(toplevel_builddir)/$(build_libsubdir)
target_objdir := $(toplevel_builddir)/$(target_subdir)
# --------
# Defined vpaths
# --------
......@@ -166,7 +167,7 @@ coverageexts = .{gcda,gcno}
# apply to the back end and the C front end, which may be compiled
# with other compilers.
# CXX_COMPAT_WARN are C++ source compatibility warnings.
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
LOOSE_WARN = @loose_warn@
STRICT_WARN = @strict_warn@
CXX_COMPAT_WARN = @cxx_compat_warn@
......@@ -1424,6 +1425,11 @@ config.status: $(srcdir)/configure $(srcdir)/config.gcc
# UNSORTED
# --------
# Provide quickstrap as a target that people can type into the gcc directory,
# and that fails if you're not into it.
quickstrap: all
cd $(toplevel_builddir) && $(MAKE) all-target-libgcc
all.internal: start.encap rest.encap doc
# This is what to compile if making a cross-compiler.
all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
......
......@@ -295,34 +295,6 @@ if test $gcc_cv_func_mmap_anon = yes; then
fi
])
dnl Locate a program and check that its version is acceptable.
dnl AC_PROG_CHECK_VER(var, name, version-switch,
dnl version-extract-regexp, version-glob)
AC_DEFUN([gcc_AC_CHECK_PROG_VER],
[AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
AC_CHECK_PROG([$1], [$2], [$2])
if test -n "[$]$1"; then
# Found it, now check the version.
AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern,
[changequote(<<,>>)dnl
ac_prog_version=`<<$>>$1 $3 2>&1 |
sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'`
changequote([,])dnl
echo "configure:__oline__: version of $2 is $ac_prog_version" >&AS_MESSAGE_LOG_FD
changequote(<<,>>)dnl
case $ac_prog_version in
'') gcc_cv_prog_$2_modern=no;;
<<$5>>)
gcc_cv_prog_$2_modern=yes;;
*) gcc_cv_prog_$2_modern=no;;
esac
changequote([,])dnl
])
else
gcc_cv_prog_$2_modern=no
fi
])
dnl Determine if enumerated bitfields are unsigned. ISO C says they can
dnl be either signed or unsigned.
dnl
......
......@@ -101,4 +101,5 @@ m4_include([../config/lib-ld.m4])
m4_include([../config/lib-link.m4])
m4_include([../config/lib-prefix.m4])
m4_include([../config/progtest.m4])
m4_include([../config/warnings.m4])
m4_include([acinclude.m4])
......@@ -319,105 +319,18 @@ AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
# * overlong strings
# So, we only use -pedantic if we can disable those warnings.
AC_CACHE_CHECK(
[whether ${CC} accepts -Wno-long-long],
[ac_cv_prog_cc_w_no_long_long],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wno-long-long"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_no_long_long=yes],
[ac_cv_prog_cc_w_no_long_long=no])
CFLAGS="$save_CFLAGS"
])
AC_CACHE_CHECK(
[whether ${CC} accepts -Wno-variadic-macros],
[ac_cv_prog_cc_w_no_variadic_macros],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wno-variadic-macros"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_no_variadic_macros=yes],
[ac_cv_prog_cc_w_no_variadic_macros=no])
CFLAGS="$save_CFLAGS"
])
AC_CACHE_CHECK(
[whether ${CC} accepts -Wno-overlength-strings],
[ac_cv_prog_cc_w_no_overlength_strings],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wno-overlength-strings"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_no_overlength_strings=yes],
[ac_cv_prog_cc_w_no_overlength_strings=no])
CFLAGS="$save_CFLAGS"
])
strict_warn=
if test $ac_cv_prog_cc_w_no_long_long = yes \
&& test $ac_cv_prog_cc_w_no_variadic_macros = yes \
&& test $ac_cv_prog_cc_w_no_overlength_strings = yes ; then
strict_warn="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings"
fi
# Add -Wold-style-definition if it's accepted
AC_CACHE_CHECK(
[whether ${CC} accepts -Wold-style-definition],
[ac_cv_prog_cc_w_old_style_definition],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wold-style-definition"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_old_style_definition=yes],
[ac_cv_prog_cc_w_old_style_definition=no])
CFLAGS="$save_CFLAGS"
])
if test $ac_cv_prog_cc_w_old_style_definition = yes ; then
strict_warn="${strict_warn} -Wold-style-definition"
fi
# Add -Wmissing-format-attribute if it's accepted
AC_CACHE_CHECK(
[whether ${CC} accepts -Wmissing-format-attribute],
[ac_cv_prog_cc_w_missing_format_attribute],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wmissing-format-attribute"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_missing_format_attribute=yes],
[ac_cv_prog_cc_w_missing_format_attribute=no])
CFLAGS="$save_CFLAGS"
])
if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then
strict_warn="${strict_warn} -Wmissing-format-attribute"
fi
# Enable -Werror, period.
AC_ARG_ENABLE(werror_always,
[ --enable-werror-always enable -Werror always], [],
[enable_werror_always=no])
if test x${enable_werror_always} = xyes ; then
strict_warn="${strict_warn} -Werror"
fi
AC_SUBST(strict_warn)
# Get C++ compatibility warning flag, if supported.
AC_CACHE_CHECK(
[whether ${CC} accepts -Wc++-compat],
[ac_cv_prog_cc_w_cxx_compat],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wc++-compat"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_cxx_compat=yes],
[ac_cv_prog_cc_w_cxx_compat=no])
CFLAGS="$save_CFLAGS"
])
if test x${ac_cv_prog_cc_w_cxx_compat} = xyes; then
cxx_compat_warn="-Wc++-compat"
fi
AC_SUBST(cxx_compat_warn)
# 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'.
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
-Wmissing-prototypes], [loose_warn])
ACX_PROG_CC_WARNING_OPTS([-Wc++-compat], [cxx_compat_warn])
ACX_PROG_CC_WARNING_OPTS([-Wold-style-definition \
-Wmissing-format-attribute], [strict_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long -Wno-variadic-macros \
-Wno-overlength-strings], [strict_warn])
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn])
# The above macros do nothing if the compiler is not GCC. However, the
# Makefile has more goo to add other flags, so this variabl is used to
# enables warnings only for GCC.
warn_cflags=
if test "x$GCC" = "xyes"; then
warn_cflags='$(GCC_WARN_CFLAGS)'
......@@ -888,15 +801,12 @@ gcc_AC_PROG_CMP_IGNORE_INITIAL
# See if we have the mktemp command.
AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
MISSING="${CONFIG_SHELL-/bin/sh} $srcdir/../missing"
# See if makeinfo has been installed and is modern enough
# that we can use it.
gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
ACX_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
[4.[4-9]*])
if test $gcc_cv_prog_makeinfo_modern = no; then
MAKEINFO="$MISSING makeinfo"
AC_MSG_WARN([
*** Makeinfo is missing or too old.
*** Info documentation will not be built.])
......@@ -917,6 +827,8 @@ else
fi
AC_SUBST(GENERATED_MANPAGES)
MISSING="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing"
# How about lex?
dnl Don't use AC_PROG_LEX; we insist on flex.
dnl LEXLIB is not useful in gcc.
......
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* aclocal.m4: Include config/warnings.m4.
* configure.ac: Use ACX_PROG_CC_WARNING_OPTS.
* configure: Regenerate.
2007-06-07 Geoffrey Keating <geoffk@apple.com>
* configure.ac: Non-default multilibs can be cross compilations.
......
sinclude(../config/acx.m4)
sinclude(../config/no-executables.m4)
sinclude(../config/warnings.m4)
dnl See whether strncmp reads past the end of its string parameters.
dnl On some versions of SunOS4 at least, strncmp reads a word at a time
......
......@@ -2953,15 +2953,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_c_preproc_warn_flag=yes
# Warn C++ incompatibilities if supported.
echo "$as_me:$LINENO: checking whether ${CC} accepts -Wc++-compat" >&5
echo $ECHO_N "checking whether ${CC} accepts -Wc++-compat... $ECHO_C" >&6
if test "${ac_cv_prog_cc_w_cxx_compat+set}" = set; then
ac_libiberty_warn_cflags=
save_CFLAGS="$CFLAGS"
for option in -W -Wall -pedantic -Wwrite-strings -Wc++-compat \
-Wstrict-prototypes; do
as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
echo "$as_me:$LINENO: checking whether $CC supports $option" >&5
echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6
if eval "test \"\${$as_acx_Woption+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
save_CFLAGS="$CFLAGS"
CFLAGS="-Wc++-compat"
CFLAGS="$option"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
......@@ -2969,6 +2973,13 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
......@@ -2992,28 +3003,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_w_cxx_compat=yes
eval "$as_acx_Woption=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_prog_cc_w_cxx_compat=no
eval "$as_acx_Woption=no"
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$save_CFLAGS"
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_cxx_compat" >&5
echo "${ECHO_T}$ac_cv_prog_cc_w_cxx_compat" >&6
if test x$GCC = xyes; then
ac_libiberty_warn_cflags='-W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes'
fi
if test $ac_cv_prog_cc_w_cxx_compat = yes ; then
ac_libiberty_warn_cflags="${ac_libiberty_warn_cflags} -Wc++-compat"
echo "$as_me:$LINENO: result: `eval echo '${'$as_acx_Woption'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_acx_Woption'}'`" >&6
if test `eval echo '${'$as_acx_Woption'}'` = yes; then
ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$option"
fi
done
CFLAGS="$save_CFLAGS"
if test "x$CC" != xcc; then
echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
......
......@@ -132,26 +132,8 @@ GCC_NO_EXECUTABLES
AC_PROG_CC
AC_PROG_CPP_WERROR
# Warn C++ incompatibilities if supported.
AC_CACHE_CHECK(
[whether ${CC} accepts -Wc++-compat],
[ac_cv_prog_cc_w_cxx_compat],
[save_CFLAGS="$CFLAGS"
CFLAGS="-Wc++-compat"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
[ac_cv_prog_cc_w_cxx_compat=yes],
[ac_cv_prog_cc_w_cxx_compat=no])
CFLAGS="$save_CFLAGS"
])
if test x$GCC = xyes; then
ac_libiberty_warn_cflags='-W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes'
fi
if test $ac_cv_prog_cc_w_cxx_compat = yes ; then
ac_libiberty_warn_cflags="${ac_libiberty_warn_cflags} -Wc++-compat"
fi
AC_SUBST(ac_libiberty_warn_cflags)
ACX_PROG_CC_WARNING_OPTS([-W -Wall -pedantic -Wwrite-strings -Wc++-compat \
-Wstrict-prototypes], [ac_libiberty_warn_cflags])
AC_PROG_CC_C_O
# autoconf is lame and doesn't give us any substitution variable for this.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment