From ba359623e03cc7d5f5baea37db899743e474480a Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 9 Dec 2008 23:42:28 +0000 Subject: [PATCH] Fix a few places where we didn't properly escape []; consolidate all debug/optimization flag checking to use AC quadrigraphs properly This commit was SVN r20097. --- config/ompi_check_optflags.m4 | 19 ++++++++------ config/ompi_make_stripped_flags.m4 | 40 ++++++++---------------------- config/ompi_setup_cc.m4 | 14 ++++++----- 3 files changed, 29 insertions(+), 44 deletions(-) diff --git a/config/ompi_check_optflags.m4 b/config/ompi_check_optflags.m4 index 4c599a09ee..28b8d6778e 100644 --- a/config/ompi_check_optflags.m4 +++ b/config/ompi_check_optflags.m4 @@ -11,6 +11,7 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2007-2008 Sun Microsystems, Inc. All rights reserved. +dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -33,15 +34,17 @@ AC_DEFUN([OMPI_CHECK_OPTFLAGS],[ co_arg="$1" co_found=0 for co_word in $co_arg; do + # See http://www.gnu.org/software/autoconf/manual/html_node/Quadrigraphs.html#Quadrigraphs + # for an explanation of @<:@ and @:>@ -- they m4 expand to [ and ] case $co_word in - -g) co_found=1 ;; - -g[1-3]) co_found=1 ;; - +K[0-5]) co_found=1 ;; - -O) co_found=1 ;; - -O[0-9]) co_found=1 ;; - -xO) co_found=1 ;; - -xO[0-9]) co_found=1 ;; - -fast) co_found=1 ;; + -g) co_found=1 ;; + -g@<:@1-3@:>@) co_found=1 ;; + +K@<:@0-5@:>@) co_found=1 ;; + -O) co_found=1 ;; + -O@<:@0-9@:>@) co_found=1 ;; + -xO) co_found=1 ;; + -xO@<:@0-9@:>@) co_found=1 ;; + -fast) co_found=1 ;; # The below Sun Studio flags require or # trigger -xO optimization diff --git a/config/ompi_make_stripped_flags.m4 b/config/ompi_make_stripped_flags.m4 index 18900a60a4..5b88be23d1 100644 --- a/config/ompi_make_stripped_flags.m4 +++ b/config/ompi_make_stripped_flags.m4 @@ -27,37 +27,17 @@ AC_DEFUN([OMPI_MAKE_STRIPPED_FLAGS],[ s_arg="$1" s_result= for s_word in $s_arg; do + # See http://www.gnu.org/software/autoconf/manual/html_node/Quadrigraphs.html#Quadrigraphs + # for an explanation of @<:@ and @:>@ -- they m4 expand to [ and ] case $s_word in - -g) ;; - +K0) ;; - +K1) ;; - +K2) ;; - +K3) ;; - +K4) ;; - +K5) ;; - -O) ;; - -O0) ;; - -O1) ;; - -O2) ;; - -O3) ;; - -O4) ;; - -O5) ;; - -O6) ;; - -O7) ;; - -O8) ;; - -O9) ;; - -xO) ;; - -xO0) ;; - -xO1) ;; - -xO2) ;; - -xO3) ;; - -xO4) ;; - -xO5) ;; - -xO6) ;; - -xO7) ;; - -xO8) ;; - -xO9) ;; - -fast) ;; + -g) ;; + -g@<:@1-3@:>@) ;; + +K@<:@0-5@:>@) ;; + -O) ;; + -O@<:@0-9@:>@) ;; + -xO) ;; + -xO@<:@0-9@:>@) ;; + -fast) ;; # The below Sun Studio flags require or # trigger -xO optimization diff --git a/config/ompi_setup_cc.m4 b/config/ompi_setup_cc.m4 index dcf8956714..38799724d1 100644 --- a/config/ompi_setup_cc.m4 +++ b/config/ompi_setup_cc.m4 @@ -276,13 +276,15 @@ AC_DEFUN([OMPI_SETUP_CC],[ CFLAGS_WITHOUT_OPTFLAGS="" for co_word in $CFLAGS ; do co_found=0 + # See http://www.gnu.org/software/autoconf/manual/html_node/Quadrigraphs.html#Quadrigraphs + # for an explanation of @<:@ and @:>@ -- they m4 expand to [ and ] case $co_word in - +K[0-5]) co_found=1 ;; - -O) co_found=1 ;; - -O[0-9]) co_found=1 ;; - -xO) co_found=1 ;; - -xO[0-9]) co_found=1 ;; - -fast) co_found=1 ;; + +K@<:@0-5@:>@) co_found=1 ;; + -O) co_found=1 ;; + -O@<:@0-9@:>@) co_found=1 ;; + -xO) co_found=1 ;; + -xO@<:@0-9@:>@) co_found=1 ;; + -fast) co_found=1 ;; # The below Sun Studio flags require or # trigger -xO optimization