2008-03-03 08:22:58 +01:00
|
|
|
AC_DEFUN([AC_C_FLAG], [{
|
|
|
|
AC_LANG_PUSH(C)
|
|
|
|
ac_c_flag_save="$CFLAGS"
|
2014-01-03 00:17:49 +01:00
|
|
|
CFLAGS="$CFLAGS -Werror $1"
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_CHECKING([[whether $CC supports $1]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]])],
|
|
|
|
[
|
2014-01-03 00:17:49 +01:00
|
|
|
CFLAGS="$ac_c_flag_save $1"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
2008-03-03 08:22:58 +01:00
|
|
|
CFLAGS="$ac_c_flag_save"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
$2
|
|
|
|
])
|
|
|
|
AC_LANG_POP(C)
|
|
|
|
}])
|
|
|
|
AC_DEFUN([AC_CXX_FLAG], [{
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
ac_cxx_flag_save="$CXXFLAGS"
|
2014-01-03 00:17:49 +01:00
|
|
|
CXXFLAGS="$CXXFLAGS -Werror $1"
|
2008-03-03 08:22:58 +01:00
|
|
|
AC_MSG_CHECKING([[whether $CXX supports $1]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]])],
|
2014-01-03 00:17:49 +01:00
|
|
|
[
|
|
|
|
CXXFLAGS="$ac_cxx_flag_save $1"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],
|
2008-03-03 08:22:58 +01:00
|
|
|
[
|
|
|
|
CXXFLAGS="$ac_cxx_flag_save"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
$2
|
|
|
|
])
|
|
|
|
AC_LANG_POP(C++)
|
|
|
|
}])
|
2012-06-23 19:22:08 +02:00
|
|
|
AC_DEFUN([AC_PCH_FLAG], [{
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
ac_cxx_flag_save="$CXXFLAGS"
|
|
|
|
ac_cxx_werror_flag_save="$ac_cxx_werror_flag"
|
|
|
|
ac_cxx_werror_flag=yes
|
|
|
|
CXXFLAGS="$CXXFLAGS -Werror $1"
|
|
|
|
AC_MSG_CHECKING([[whether $CXX supports $1]])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[]])],
|
|
|
|
[
|
|
|
|
PCHFLAGS="$PCHFLAGS $1"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
$2
|
|
|
|
])
|
|
|
|
CXXFLAGS="$ac_cxx_flag_save"
|
|
|
|
ac_cxx_werror_flag="$ac_cxx_werror_flag_save"
|
|
|
|
AC_LANG_POP(C++)
|
|
|
|
}])
|