configure: Add new _MY_CXX_CHECK_SET. No functional change.
This commit is contained in:
parent
0ac116bb4e
commit
3261a45ec1
32
configure.ac
32
configure.ac
|
|
@ -106,17 +106,18 @@ AC_TYPE_SIZE_T
|
||||||
# Checks for compiler characteristics.
|
# Checks for compiler characteristics.
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
|
||||||
AC_DEFUN([_MY_CXX_CHECK_OPT],
|
AC_DEFUN([_MY_CXX_CHECK_FLAG],
|
||||||
[# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
|
[# _MY_CXX_CHECK_FLAG(flag) -- Check if compiler supports specific options
|
||||||
|
# Set $_my_result appropriately
|
||||||
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
|
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
|
||||||
# -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
|
# -Werror needed otherwise unknown -Wno-div-by-zero won't report problems
|
||||||
CXXFLAGS="$CXXFLAGS $2 -Werror"
|
CXXFLAGS="$CXXFLAGS $1 -Werror"
|
||||||
AC_MSG_CHECKING([whether $CXX accepts $2])
|
AC_MSG_CHECKING([whether $CXX accepts $1])
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM([],[])],
|
[AC_LANG_PROGRAM([],[])],
|
||||||
[_my_result=yes
|
[_my_result=yes
|
||||||
if test -s conftest.err; then
|
if test -s conftest.err; then
|
||||||
if grep -e "$2" conftest.err >/dev/null; then
|
if grep -e "$1" conftest.err >/dev/null; then
|
||||||
_my_result=no
|
_my_result=no
|
||||||
fi
|
fi
|
||||||
fi],
|
fi],
|
||||||
|
|
@ -129,16 +130,31 @@ AC_DEFUN([_MY_CXX_CHECK_OPT],
|
||||||
]],[])],
|
]],[])],
|
||||||
[], # Ignore ok exit
|
[], # Ignore ok exit
|
||||||
[if test -s conftest.err; then
|
[if test -s conftest.err; then
|
||||||
if grep -e "$2" conftest.err >/dev/null; then
|
if grep -e "$1" conftest.err >/dev/null; then
|
||||||
_my_result=no
|
_my_result=no
|
||||||
fi
|
fi
|
||||||
fi])
|
fi])
|
||||||
AC_MSG_RESULT($_my_result)
|
AC_MSG_RESULT($_my_result)
|
||||||
|
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([_MY_CXX_CHECK_SET],
|
||||||
|
[# _MY_CXX_CHECK_SET(variable,flag) -- Check if compiler supports specific options
|
||||||
|
# If it does, set variable to flag
|
||||||
|
_MY_CXX_CHECK_FLAG($2)
|
||||||
if test "$_my_result" = "yes" ; then
|
if test "$_my_result" = "yes" ; then
|
||||||
$1="$$1 $2"
|
$1="$$1 $2"
|
||||||
fi
|
fi
|
||||||
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
|
])
|
||||||
])# _MY_CXX_CHECK_OPT
|
|
||||||
|
AC_DEFUN([_MY_CXX_CHECK_OPT],
|
||||||
|
[# _MY_CXX_CHECK_OPT(flag) -- Check if compiler supports specific options
|
||||||
|
# If it does, append flag to variable
|
||||||
|
_MY_CXX_CHECK_FLAG($2)
|
||||||
|
if test "$_my_result" = "yes" ; then
|
||||||
|
$1="$$1 $2"
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
# Flags for compiling Verilator internals including parser, and Verilated files
|
# Flags for compiling Verilator internals including parser, and Verilated files
|
||||||
# These turn on extra warnings and are only used with 'configure --enable-ccwarn'
|
# These turn on extra warnings and are only used with 'configure --enable-ccwarn'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue