Commit 83a45adc authored by Reuben Thomas's avatar Reuben Thomas
Browse files

Remove AC_CXX_FLAGS, CXXFLAGS_{OPTIMIZE,DEBUG} (closes #183).

	* build-aux/vcsn.m4: Remove AC_CXX_FLAGS and VCSN_WARN_CXXFLAGS.
	* configure.ac: Don't call AC_CXX_FLAGS.
	* doc/README.txt: Remove documentation for CXXFLAGS_{OPTIMIZE,DEBUG}.
parent ad3c036e
2008-10-09 Reuben Thomas <rrt@sc3d.org>
Remove AC_CXX_FLAGS, CXXFLAGS_{OPTIMIZE,DEBUG} (closes #183).
* build-aux/vcsn.m4: Remove AC_CXX_FLAGS and VCSN_WARN_CXXFLAGS.
* configure.ac: Don't call AC_CXX_FLAGS.
* doc/README.txt: Remove documentation for CXXFLAGS_{OPTIMIZE,DEBUG}.
2008-10-09 Reuben Thomas <rrt@sc3d.org>
 
Fix realtime good and proper.
......
......@@ -283,185 +283,6 @@ AC_DEFUN([AC_CXX_FLOAT_MATH],
])
# AC_CXX_FLAGS
# ------------
# Attempts to recognize specific compilers to set, if availables, extra
# flags for debugging, optimization and strict conformance to language
# specifications.
# This macro checks for the following compilers :
# - GNU C++ (g++)
# - Sun WorkShop C++ (Sun/CC)
# - Intel C++ (icc)
# - Comeau C++ (como)
# and sets the following autoconf variables:
# CXXFLAGS_DEBUG
# CXXFLAGS_STRICT
# CXXFLAGS_STRICT_ERRORS
# CXXFLAGS_OPTIMIZE
AC_DEFUN([AC_CXX_FLAGS],
[dnl
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH([C++])
AC_CACHE_CHECK([for C++ compiler-specific extra flags],
[ac_cv_cxx_style],
[ac_cv_cxx_style=unknown
if $CXX -V 2>&1 | grep -i "Intel(R) C++">/dev/null 2>&1;
then
ac_cv_cxx_style=Intel
elif test "x$ac_compiler_gnu" != xno; then
if $CXX --version | grep '^2\.' >/dev/null ; then
ac_cv_cxx_style=weakGNU
else
ac_cv_cxx_style=GNU
fi
elif $CXX -V 2>&1 | grep -i "WorkShop">/dev/null 2>&1; then
ac_cv_cxx_style=Sun
else
echo "int main() {}" >conftest.cc
if $CXX --version conftest.cc 2>&1 \
| grep -i "Comeau C/C++" >/dev/null 2>&1; then
ac_cv_cxx_style=Comeau
fi
rm -f conftest.*
fi])
AC_LANG_POP([C++])
case $ac_cv_cxx_style in
GNU)
_CXXFLAGS_DEBUG="-g"
_CXXFLAGS_OPTIMIZE="-O3 -finline-limit-1500"
_CXXFLAGS_STRICT="-W -Wall"
_CXXFLAGS_STRICT_ERRORS="-W -Wall -Werror"
;;
weakGNU)
_CXXFLAGS_DEBUG="-g"
_CXXFLAGS_OPTIMIZE="-O2 -felide-constructors -funroll-loops"
_CXXFLAGS_STRICT="-W -Wall"
_CXXFLAGS_STRICT_ERRORS="-W -Wall -Werror"
;;
Sun)
_CXXFLAGS_DEBUG="-g"
_CXXFLAGS_OPTIMIZE="-fast"
_CXXFLAGS_STRICT="-v"
_CXXFLAGS_STRICT_ERRORS="-v -xwe"
;;
Comeau)
_CXXFLAGS_DEBUG="-g"
_CXXFLAGS_STRICT="-r"
_CXXFLAGS_STRICT_ERRORS="-r"
;;
Intel)
_CXXFLAGS_OPTIMIZE="-O3"
_CXXFLAGS_DEBUG="-g"
_CXXFLAGS_STRICT="-wd111,193,279,383,444,654,810,981,1418,327"
_CXXFLAGS_STRICT_ERRORS="-wd111,193,279,383,444,654,810,981,1418,327"
# This is so that ICC no longer complain that
#
# scantiger.ll(177): remark #111: statement is unreachable
# break;
# ^
#
# ./../ast/seqexp.hh(36): remark #193:
# zero used for undefined preprocessing identifier
# #if STUDENT
# ^
#
# scantiger.cc(924): remark #279: controlling expression is constant
# while ( 1 ) /* loops until end-of-file is reached */
# ^
#
# ../../src/task/task.hh(38): remark #383:
# value copied to temporary, reference to
# temporary used
# int key = 0, const std::string& deps = "");
# ^
# /intel/compiler70/ia32/include/xstring(41): remark #444:
# destructor for base class "std::_String_val<_Elem, _Ax>" is not virtual
# : public _String_val<_Elem, _Ax>
# ^
#
# ./../ast/print-visitor.hh(21): warning #654:
# overloaded virtual function "ast::GenVisitor<K>::visit
# [with K=ast::const_kind]"
# is only partially overridden in class "ast::PrintVisitor"
# class PrintVisitor : public DefaultVisitor<const_kind>
# ^
#
# /intel/compiler70/ia32/include/xlocale(1381): remark #810:
# conversion from "int" to "char" may lose significant bits
# return (widen((char)_Tolower((unsigned char)narrow(_Ch),
# ^
#
#
# ./../ast/print-visitor.hh(331): remark #981:
# operands are evaluated in unspecified order
# _ostr << "type " << e.name_get () << " = ";
# ^
#
# scantiger.cc(324): remark #1418:
# external definition with no prior declaration
# static char yy_hold_char;
#
# ^
# foo.cc(4): warning #327: NULL reference is not allowed
# int& foo = *static_cast<int*> (0);
#
;;
esac
if test "x$CXXFLAGS_OPTIMIZE" = "x"; then
CXXFLAGS_OPTIMIZE=$_CXXFLAGS_OPTIMIZE
fi
if test "x$CXXFLAGS_DEBUG" = "x"; then
CXXFLAGS_DEBUG=$_CXXFLAGS_DEBUG
fi
if test "x$CXXFLAGS_STRICT" = "x"; then
CXXFLAGS_STRICT=$_CXXFLAGS_STRICT
fi
if test "x$CXXFLAGS_STRICT_ERRORS" = "x"; then
CXXFLAGS_STRICT_ERRORS=$_CXXFLAGS_STRICT_ERRORS
fi
AC_SUBST([CXXFLAGS_DEBUG])
AC_SUBST([CXXFLAGS_OPTIMIZE])
AC_SUBST([CXXFLAGS_STRICT])
AC_SUBST([CXXFLAGS_STRICT_ERRORS])
])
# VCSN_WARN_CXXFLAGS
# ------------------
# Check that the variable CXXFLAGS does not contain debug or
# optimization flags
AC_DEFUN([VCSN_WARN_CXXFLAGS],
[dnl
vcsn_cxxflags_clean=yes
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH([C++])dnl force initialization of default CXXFLAGS
AC_MSG_CHECKING([for debbuging options in CXXFLAGS ($CXXFLAGS)])
if echo "$CXXFLAGS" | grep -- "-g" >/dev/null 2>&1; then
AC_MSG_RESULT([yes])
AC_MSG_WARN([CXXFLAGS seems to contain debugging options, which is known to conflict with Vaucanson optimizations.])
AC_MSG_NOTICE([please cleanup CXXFLAGS and use CXXFLAGS_DEBUG instead for your own options.])
vcsn_cxxflags_clean=no
else
AC_MSG_RESULT([no, good])
fi
AC_MSG_CHECKING([for optimization options in CXXFLAGS ($CXXFLAGS)])
if echo "$CXXFLAGS" | grep -- "-O" >/dev/null 2>&1; then
AC_MSG_RESULT([yes])
AC_MSG_WARN([CXXFLAGS seems to contain optimization options, while Vaucanson provides its own optimization flags.])
AC_MSG_NOTICE([please cleanup CXXFLAGS and use CXXFLAGS_OPTIMIZE instead for your own options.])
vcsn_cxxflags_clean=no
else
AC_MSG_RESULT([no, good])
fi
AC_LANG_POP([C++])
])
# AC_WITH_VCSN
# ------------
# Invoke configuration code to test for Vaucanson and set a collection
......@@ -472,5 +293,4 @@ AC_DEFUN([AC_WITH_VCSN],
AC_REQUIRE([AC_CXX_NUMERIC_LIMITS])
AC_REQUIRE([AC_CXX_FLOAT_MATH])
AC_REQUIRE([VCSN_PATH_HEADERS])
AC_REQUIRE([VCSN_WARN_CXXFLAGS])
])
......@@ -106,9 +106,6 @@ AC_PROG_LIBTOOL
# Where to install Emacs files.
AM_PATH_LISPDIR
# Attempt to use strict language conformance checking.
AC_CXX_FLAGS
VCSN_XML
if test "${with_xerces+set}" = set; then
......
......@@ -102,20 +102,6 @@ For further configure options, type::
./configure --help
Tweaking compilation options
----------------------------
Use ``CXXFLAGS_DEBUG`` or ``CXXFLAGS_OPTIMIZE`` to pass debug or
optimization flags, not ``CXXFLAGS``. For example::
./configure CXXFLAGS_DEBUG='-fstack-check -fbounds-check -ggdb'
This is because Vaucanson tries to use some particular default flags
with some specific compilers such as GCC or ICC. Using ``CXXFLAGS``
conflicts with those specific flags; ``CXXFLAGS_DEBUG`` and
``CXXFLAGS_OPTIMIZE`` override these default flags.
Layout of the tarball
---------------------
......
Supports Markdown
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