From 90c6172db9f17727b0628836d72dd50c4a09cf54 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Tue, 10 Feb 2009 20:50:28 +0000 Subject: [PATCH] Add a new flag: --disable-compiler-flags which disables *all* default compiler flags. Originally committed to SVN as r2727. --- configure.in | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index b89df9d7f..32dc8b654 100644 --- a/configure.in +++ b/configure.in @@ -203,20 +203,24 @@ CC="$PTHREAD_CC"; ###################### # Check compiler flags ###################### -AC_C_FLAG([-Wall]) -AC_C_FLAG([-O2]) -AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])]) -AC_C_FLAG([-Wno-unused-parameter]) -AC_C_FLAG([-std=gnu99]) -AC_CXX_FLAG([-Wall]) -AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])]) -AC_CXX_FLAG([-Wno-unused-parameter]) -AC_CXX_FLAG([-Wno-long-long]) -AC_CXX_FLAG([-O2]) -AC_CXX_FLAG([-fpermissive]) -AC_CXX_FLAG([-fno-strict-aliasing]) -AC_CXX_FLAG([-std=c++98]) +AC_ARG_ENABLE(compiler-flags, [ --disable-compiler-flags + Disable *all* additional compiler flags. (default=no)]) +if test "$enable_compiler_flags" != "no"; then + AC_C_FLAG([-Wall]) + AC_C_FLAG([-O2]) + AC_C_FLAG([-Wextra],[AC_C_FLAG([-W])]) + AC_C_FLAG([-Wno-unused-parameter]) + AC_C_FLAG([-std=gnu99]) + AC_CXX_FLAG([-Wall]) + AC_CXX_FLAG([-Wextra],[AC_CXX_FLAG([-W])]) + AC_CXX_FLAG([-Wno-unused-parameter]) + AC_CXX_FLAG([-Wno-long-long]) + AC_CXX_FLAG([-O2]) + AC_CXX_FLAG([-fpermissive]) + AC_CXX_FLAG([-fno-strict-aliasing]) + AC_CXX_FLAG([-std=c++98]) +fi ###################################### # Check Headers / Features / Libraries