aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2014-05-06 20:16:04 -0700
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2014-05-06 20:32:57 -0700
commit5f6a7949fac2d57643aa93017cbb9b7731a975ff (patch)
tree99366a48248946db7a5ca7d861d58c9528302a24
parent6ced3888a697688b14dd51cccb5d847dc5d4823c (diff)
downloadpaludis-5f6a7949fac2d57643aa93017cbb9b7731a975ff.tar.gz
paludis-5f6a7949fac2d57643aa93017cbb9b7731a975ff.tar.xz
build: tweak build flag selection
Use the standard C++ compiler flag support check mechanism for -fno-deduce-init-list and -Wno-non-virtual-dtors. Both of them are supported by the minimum supported version of GCC (4.7).
-rw-r--r--configure.ac47
1 files changed, 6 insertions, 41 deletions
diff --git a/configure.ac b/configure.ac
index fd070dc..cf41407 100644
--- a/configure.ac
+++ b/configure.ac
@@ -359,6 +359,11 @@ if test "x${cxx_compiler_icc}" = "xyes" ; then
CHECK_CXXFLAG([-wd1418])
CHECK_CXXFLAG([-wd1419])
elif test "x${ac_cv_cxx_compiler_gnu}" = "xyes" ; then
+ CHECK_CXXFLAG([-fno-deduce-init-list])
+ if test x"$cxxflag_success" = x"yes" ; then
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -fno-deduce-init-list"
+ fi
+
CHECK_CXXFLAG([-Wall])
CHECK_CXXFLAG([-Wextra])
if ! test "x$cxxflag_success" = "xyes" ; then
@@ -398,57 +403,17 @@ elif test "x${ac_cv_cxx_compiler_gnu}" = "xyes" ; then
PALUDIS_CXXFLAGS_NO_WWRITE_STRINGS=-Wno-write-strings
fi
CHECK_CXXFLAG([-Wno-ignored-qualifiers])
+ CHECK_CXXFLAG([-Wno-non-virtual-dtor])
else
CHECK_CXXFLAG([-Wall])
fi
AC_MSG_RESULT([${cxxflags_message}])
-AC_MSG_CHECKING([whether we want -Wno-non-virtual-dtor to work around compiler silliness])
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([
-#ifndef __GNUC__
-# error not gcc
-#endif
-
-#if __GNUC__ != 4
-# error not gcc 4
-#endif
-
-#if __GNUC_MINOR__ != 1
-# error not gcc 4.1
-#endif
-])],
- [AC_MSG_RESULT([yes])
- PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -Wno-non-virtual-dtor"
- ],
- [AC_MSG_RESULT([no])])
-
CHECK_CXXFLAG([-std=c++11])
if test x"$cxxflag_success" = x"no" ; then
CHECK_CXXFLAG([-std=c++0x])
fi
-AC_MSG_CHECKING([whether we need -fno-deduce-init-list])
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([
-#ifndef __GNUC__
-# error not gcc
-#endif
-
-#if __GNUC__ != 4
-# error not gcc 4
-#endif
-
-#if __GNUC_MINOR__ == 4
-#elif __GNUC_MINOR__ == 5 && __GNUC_PATCHLEVEL__ == 0
-#else
-# error not 4.4 or 4.5.0
-#endif
-])],
- [AC_MSG_RESULT([yes])
- PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -fno-deduce-init-list"
- PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -fno-deduce-init-list"
- ],
- [AC_MSG_RESULT([no])])
-
PALUDIS_CXXFLAGS_WITHOUT_PEDANTIC=$PALUDIS_CXXFLAGS
AC_MSG_CHECKING([for 'extern template' support])