diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-03-12 11:49:28 -0700 |
---|---|---|
committer | Chase Douglas <chase.douglas@canonical.com> | 2012-03-12 15:18:08 -0700 |
commit | 51f69514e65637f575df901ef942515e70314f6a (patch) | |
tree | 446faf94bc261c91d6ecd496c10da75f1ecbbe43 | |
parent | a1fec11ca3de6774fb70052f5f5ab167bf658690 (diff) |
Separate unknown warning options by language
If XORG_COMPILER_FLAGS is called more than once with separate languages,
the unknown warning options used internally for unknown warning checking
will be set the first time and then the cached value will be used for
subsequent languages. This is a problem if the compilers differ between
the languages.
This change ensures that the unknown warning options are namespaced so
multiple XORG_COMPILER_FLAGS calls with different languages are checked
separately.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Gaetan Nadon<memsize@videotron.ca>
-rw-r--r-- | xorg-macros.m4.in | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index 863513e..9c8ba84 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -1515,28 +1515,28 @@ AC_LANG_CASE( [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" -if test "x$xorg_testset_unknown_warning_option" = "x" ; then +if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" - AC_CACHE_CHECK([if compiler supports -Werror=unknown-warning-option], - xorg_cv_compiler_flag_unknown_warning_option, + AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], + [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], - [xorg_cv_compiler_flag_unknown_warning_option=yes], - [xorg_cv_compiler_flag_unknown_warning_option=no])) - xorg_testset_unknown_warning_option=$xorg_cv_compiler_flag_unknown_warning_option + [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], + [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) + [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi -if test "x$xorg_testset_unused_command_line_argument" = "x" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then +if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then + if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" - AC_CACHE_CHECK([if compiler supports -Werror=unused-command-line-argument], - xorg_cv_compiler_flag_unused_command_line_argument, + AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], + [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], - [xorg_cv_compiler_flag_unused_command_line_argument=yes], - [xorg_cv_compiler_flag_unused_command_line_argument=no])) - xorg_testset_unused_command_line_argument=$xorg_cv_compiler_flag_unused_command_line_argument + [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], + [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) + [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi |