Skip to content

Commit 304f780

Browse files
author
Erlend E. Aasland
committed
Address review
- Use AS_VAR_IF() a couple of more times - Use CFLAGS iso. CC when overriding compiler flags
1 parent 1db815e commit 304f780

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

configure

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7085,8 +7085,8 @@ yes)
70857085
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can add -Wextra" >&5
70867086
$as_echo_n "checking if we can add -Wextra... " >&6; }
70877087

7088-
py_cc=$CC
7089-
CC="$CC -Wextra -Werror"
7088+
py_cflags=$CFLAGS
7089+
CFLAGS="$CFLAGS -Wextra -Werror"
70907090
if ${ac_cv_enable_extra_warning+:} false; then :
70917091
$as_echo_n "(cached) " >&6
70927092
else
@@ -7110,7 +7110,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
71107110

71117111
fi
71127112

7113-
CC=$py_cc
7113+
CFLAGS=$py_cflags
71147114
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_extra_warning" >&5
71157115
$as_echo "$ac_cv_enable_extra_warning" >&6; }
71167116

@@ -7197,8 +7197,8 @@ fi
71977197
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can disable $CC unused-result warning" >&5
71987198
$as_echo_n "checking if we can disable $CC unused-result warning... " >&6; }
71997199

7200-
py_cc=$CC
7201-
CC="$CC -Wunused-result -Werror"
7200+
py_cflags=$CFLAGS
7201+
CFLAGS="$CFLAGS -Wunused-result -Werror"
72027202
if ${ac_cv_disable_unused_result_warning+:} false; then :
72037203
$as_echo_n "(cached) " >&6
72047204
else
@@ -7222,15 +7222,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
72227222

72237223
fi
72247224

7225-
CC=$py_cc
7225+
CFLAGS=$py_cflags
72267226
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5
72277227
$as_echo "$ac_cv_disable_unused_result_warning" >&6; }
72287228

72297229
;; #(
72307230
*) :
72317231
;;
72327232
esac
7233-
72347233
if test "x$ac_cv_disable_unused_result_warning" = xyes; then :
72357234
BASECFLAGS="$BASECFLAGS -Wno-unused-result"
72367235
CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"
@@ -7240,8 +7239,8 @@ fi
72407239
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can disable $CC unused-parameter warning" >&5
72417240
$as_echo_n "checking if we can disable $CC unused-parameter warning... " >&6; }
72427241

7243-
py_cc=$CC
7244-
CC="$CC -Wunused-parameter -Werror"
7242+
py_cflags=$CFLAGS
7243+
CFLAGS="$CFLAGS -Wunused-parameter -Werror"
72457244
if ${ac_cv_disable_unused_parameter_warning+:} false; then :
72467245
$as_echo_n "(cached) " >&6
72477246
else
@@ -7265,7 +7264,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
72657264

72667265
fi
72677266

7268-
CC=$py_cc
7267+
CFLAGS=$py_cflags
72697268
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_parameter_warning" >&5
72707269
$as_echo "$ac_cv_disable_unused_parameter_warning" >&6; }
72717270

@@ -7278,8 +7277,8 @@ fi
72787277
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can disable $CC missing-field-initializers warning" >&5
72797278
$as_echo_n "checking if we can disable $CC missing-field-initializers warning... " >&6; }
72807279

7281-
py_cc=$CC
7282-
CC="$CC -Wmissing-field-initializers -Werror"
7280+
py_cflags=$CFLAGS
7281+
CFLAGS="$CFLAGS -Wmissing-field-initializers -Werror"
72837282
if ${ac_cv_disable_missing_field_initializers_warning+:} false; then :
72847283
$as_echo_n "(cached) " >&6
72857284
else
@@ -7303,7 +7302,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
73037302

73047303
fi
73057304

7306-
CC=$py_cc
7305+
CFLAGS=$py_cflags
73077306
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_missing_field_initializers_warning" >&5
73087307
$as_echo "$ac_cv_disable_missing_field_initializers_warning" >&6; }
73097308

@@ -7316,8 +7315,8 @@ fi
73167315
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can enable $CC sign-compare warning" >&5
73177316
$as_echo_n "checking if we can enable $CC sign-compare warning... " >&6; }
73187317

7319-
py_cc=$CC
7320-
CC="$CC -Wsign-compare -Werror"
7318+
py_cflags=$CFLAGS
7319+
CFLAGS="$CFLAGS -Wsign-compare -Werror"
73217320
if ${ac_cv_enable_sign_compare_warning+:} false; then :
73227321
$as_echo_n "(cached) " >&6
73237322
else
@@ -7341,7 +7340,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
73417340

73427341
fi
73437342

7344-
CC=$py_cc
7343+
CFLAGS=$py_cflags
73457344
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_sign_compare_warning" >&5
73467345
$as_echo "$ac_cv_enable_sign_compare_warning" >&6; }
73477346

@@ -7354,8 +7353,8 @@ fi
73547353
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can enable $CC unreachable-code warning" >&5
73557354
$as_echo_n "checking if we can enable $CC unreachable-code warning... " >&6; }
73567355

7357-
py_cc=$CC
7358-
CC="$CC -Wunreachable-code -Werror"
7356+
py_cflags=$CFLAGS
7357+
CFLAGS="$CFLAGS -Wunreachable-code -Werror"
73597358
if ${ac_cv_enable_unreachable_code_warning+:} false; then :
73607359
$as_echo_n "(cached) " >&6
73617360
else
@@ -7379,7 +7378,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
73797378

73807379
fi
73817380

7382-
CC=$py_cc
7381+
CFLAGS=$py_cflags
73837382
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
73847383
$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }
73857384

@@ -7404,8 +7403,8 @@ $as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }
74047403
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can enable $CC strict-prototypes warning" >&5
74057404
$as_echo_n "checking if we can enable $CC strict-prototypes warning... " >&6; }
74067405

7407-
py_cc=$CC
7408-
CC="$CC -Wstrict-prototypes -Werror"
7406+
py_cflags=$CFLAGS
7407+
CFLAGS="$CFLAGS -Wstrict-prototypes -Werror"
74097408
if ${ac_cv_enable_strict_prototypes_warning+:} false; then :
74107409
$as_echo_n "(cached) " >&6
74117410
else
@@ -7429,7 +7428,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
74297428

74307429
fi
74317430

7432-
CC=$py_cc
7431+
CFLAGS=$py_cflags
74337432
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5
74347433
$as_echo "$ac_cv_enable_strict_prototypes_warning" >&6; }
74357434

@@ -7474,7 +7473,7 @@ fi
74747473
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5
74757474
$as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; }
74767475

7477-
if test $ac_cv_enable_implicit_function_declaration_error = yes; then :
7476+
if test "x$ac_cv_enable_implicit_function_declaration_error" = xyes; then :
74787477
CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
74797478
fi
74807479

@@ -7514,7 +7513,7 @@ fi
75147513
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_visibility" >&5
75157514
$as_echo "$ac_cv_enable_visibility" >&6; }
75167515

7517-
if test $ac_cv_enable_visibility = yes; then :
7516+
if test "x$ac_cv_enable_visibility" = xyes; then :
75187517
CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"
75197518
fi
75207519

configure.ac

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,8 +1644,8 @@ dnl PY_CHECK_CC_WARNING(ENABLE, WARNING, [MSG])
16441644
AC_DEFUN([PY_CHECK_CC_WARNING], [
16451645
AC_MSG_CHECKING(m4_ifblank([$3], [if we can $1 $CC $2 warning], [$3]))
16461646
AS_VAR_PUSHDEF([py_var], [ac_cv_$1_]m4_normalize($2)[_warning])
1647-
AS_VAR_COPY([py_cc], [CC])
1648-
AS_VAR_SET([CC], ["$CC -W$2 -Werror"])
1647+
AS_VAR_COPY([py_cflags], [CFLAGS])
1648+
AS_VAR_SET([CFLAGS], ["$CFLAGS -W$2 -Werror"])
16491649
AC_CACHE_VAL(
16501650
[py_var],
16511651
[AC_COMPILE_IFELSE(
@@ -1654,7 +1654,7 @@ AC_DEFUN([PY_CHECK_CC_WARNING], [
16541654
[AS_VAR_SET([py_var], [no])],
16551655
)]
16561656
)
1657-
AS_VAR_COPY([CC], [py_cc])
1657+
AS_VAR_COPY([CFLAGS], [py_cflags])
16581658
AC_MSG_RESULT([$py_var])
16591659
AS_VAR_POPDEF([py_var])
16601660
])
@@ -1758,8 +1758,8 @@ yes)
17581758
CC="$ac_save_cc"
17591759
AC_MSG_RESULT($ac_cv_enable_implicit_function_declaration_error)
17601760

1761-
AS_IF([test $ac_cv_enable_implicit_function_declaration_error = yes],
1762-
[CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"])
1761+
AS_VAR_IF([ac_cv_enable_implicit_function_declaration_error], [yes],
1762+
[CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"])
17631763

17641764
AC_MSG_CHECKING(if we can use visibility in $CC)
17651765
ac_save_cc="$CC"
@@ -1776,8 +1776,8 @@ yes)
17761776
CC="$ac_save_cc"
17771777
AC_MSG_RESULT($ac_cv_enable_visibility)
17781778

1779-
AS_IF([test $ac_cv_enable_visibility = yes],
1780-
[CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"])
1779+
AS_VAR_IF([ac_cv_enable_visibility], [yes],
1780+
[CFLAGS_NODIST="$CFLAGS_NODIST -fvisibility=hidden"])
17811781

17821782
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
17831783
# support. Without this, treatment of subnormals doesn't follow

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy