Skip to content

Commit 74b23c9

Browse files
author
Erlend Egeberg Aasland
authored
bpo-45723: Normalise configure user communication (GH-30024)
1 parent 2fb797e commit 74b23c9

File tree

2 files changed

+75
-65
lines changed

2 files changed

+75
-65
lines changed

configure

+42-32
Original file line numberDiff line numberDiff line change
@@ -6169,8 +6169,7 @@ if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
61696169
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5
61706170
$as_echo "$ANDROID_API_LEVEL" >&6; }
61716171
if test -z "$ANDROID_API_LEVEL"; then
6172-
echo 'Fatal: you must define __ANDROID_API__'
6173-
exit 1
6172+
as_fn_error $? "Fatal: you must define __ANDROID_API__" "$LINENO" 5
61746173
fi
61756174

61766175
cat >>confdefs.h <<_ACEOF
@@ -6193,11 +6192,14 @@ fi
61936192
rm -f conftest.c conftest.out
61946193

61956194
# Check for unsupported systems
6196-
case $ac_sys_system/$ac_sys_release in
6197-
atheos*|Linux*/1*)
6198-
echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
6199-
echo See README for details.
6200-
exit 1;;
6195+
case $ac_sys_system/$ac_sys_release in #(
6196+
atheos*|Linux*/1*) :
6197+
6198+
as_fn_error $? "This system \($ac_sys_system/$ac_sys_release\) is no longer supported. See README for details." "$LINENO" 5
6199+
6200+
;; #(
6201+
*) :
6202+
;;
62016203
esac
62026204

62036205
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-suffix" >&5
@@ -13159,16 +13161,19 @@ fi
1315913161
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
1316013162
if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
1316113163
LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
13162-
echo "using lib$ipv6lib"
13164+
{ $as_echo "$as_me:${as_lineno-$LINENO}: using lib$ipv6lib" >&5
13165+
$as_echo "$as_me: using lib$ipv6lib" >&6;}
1316313166
else
13164-
if test $ipv6trylibc = "yes"; then
13165-
echo "using libc"
13166-
else
13167-
echo 'Fatal: no $ipv6lib library found. cannot continue.'
13168-
echo "You need to fetch lib$ipv6lib.a from appropriate"
13169-
echo 'ipv6 kit and compile beforehand.'
13170-
exit 1
13171-
fi
13167+
if test "x$ipv6trylibc" = xyes; then :
13168+
13169+
{ $as_echo "$as_me:${as_lineno-$LINENO}: using libc" >&5
13170+
$as_echo "$as_me: using libc" >&6;}
13171+
13172+
else
13173+
13174+
as_fn_error $? "No $ipv6lib library found; cannot continue. You need to fetch lib$ipv6lib.a from appropriate ipv6 kit and compile beforehand." "$LINENO" 5
13175+
13176+
fi
1317213177
fi
1317313178
fi
1317413179

@@ -16522,12 +16527,11 @@ fi
1652216527

1652316528
if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes
1652416529
then
16525-
if test $ipv6 = yes
16526-
then
16527-
echo 'Fatal: You must get working getaddrinfo() function.'
16528-
echo ' or you can specify "--disable-ipv6"'.
16529-
exit 1
16530-
fi
16530+
if test "x$ipv6" = xyes; then :
16531+
16532+
as_fn_error $? "You must get working getaddrinfo() function or pass the \"--disable-ipv6\" option to configure." "$LINENO" 5
16533+
16534+
fi
1653116535
else
1653216536

1653316537
$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
@@ -25071,28 +25075,34 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
2507125075
fi
2507225076

2507325077

25074-
echo "creating Modules/Setup.local" >&6
25078+
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating Modules/Setup.local" >&5
25079+
$as_echo "$as_me: creating Modules/Setup.local" >&6;}
2507525080
if test ! -f Modules/Setup.local
2507625081
then
2507725082
echo "# Edit this file for local setup changes" >Modules/Setup.local
2507825083
fi
2507925084

25080-
echo "creating Makefile" >&6
25085+
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating Makefile" >&5
25086+
$as_echo "$as_me: creating Makefile" >&6;}
2508125087
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
2508225088
-s Modules \
2508325089
Modules/Setup.local $srcdir/Modules/Setup.bootstrap $srcdir/Modules/Setup
2508425090
mv config.c Modules
2508525091

2508625092
if test -z "$PKG_CONFIG"; then
25087-
echo "" >&6
25088-
echo "pkg-config is missing. Some dependencies may not be detected correctly." >&6
25093+
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config is missing. Some dependencies may not be detected correctly." >&5
25094+
$as_echo "$as_me: WARNING: pkg-config is missing. Some dependencies may not be detected correctly." >&2;}
2508925095
fi
2509025096

2509125097
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
25092-
echo "" >&6
25093-
echo "" >&6
25094-
echo "If you want a release build with all stable optimizations active (PGO, etc)," >&6
25095-
echo "please run ./configure --enable-optimizations" >&6
25096-
echo "" >&6
25097-
echo "" >&6
25098+
{ $as_echo "$as_me:${as_lineno-$LINENO}:
25099+
25100+
If you want a release build with all stable optimizations active (PGO, etc),
25101+
please run ./configure --enable-optimizations
25102+
" >&5
25103+
$as_echo "$as_me:
25104+
25105+
If you want a release build with all stable optimizations active (PGO, etc),
25106+
please run ./configure --enable-optimizations
25107+
" >&6;}
2509825108
fi

configure.ac

+33-33
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,7 @@ if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
10371037
_arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
10381038
AC_MSG_RESULT([$ANDROID_API_LEVEL])
10391039
if test -z "$ANDROID_API_LEVEL"; then
1040-
echo 'Fatal: you must define __ANDROID_API__'
1041-
exit 1
1040+
AC_MSG_ERROR([Fatal: you must define __ANDROID_API__])
10421041
fi
10431042
AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API level.])
10441043

@@ -1054,12 +1053,14 @@ fi
10541053
rm -f conftest.c conftest.out
10551054

10561055
# Check for unsupported systems
1057-
case $ac_sys_system/$ac_sys_release in
1058-
atheos*|Linux*/1*)
1059-
echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
1060-
echo See README for details.
1061-
exit 1;;
1062-
esac
1056+
AS_CASE([$ac_sys_system/$ac_sys_release],
1057+
[atheos*|Linux*/1*], [
1058+
AC_MSG_ERROR([m4_normalize([
1059+
This system \($ac_sys_system/$ac_sys_release\) is no longer supported.
1060+
See README for details.
1061+
])])
1062+
]
1063+
)
10631064

10641065
AC_MSG_CHECKING([for --with-suffix])
10651066
AC_ARG_WITH([suffix],
@@ -3795,16 +3796,17 @@ fi
37953796
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
37963797
if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
37973798
LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
3798-
echo "using lib$ipv6lib"
3799+
AC_MSG_NOTICE([using lib$ipv6lib])
37993800
else
3800-
if test $ipv6trylibc = "yes"; then
3801-
echo "using libc"
3802-
else
3803-
echo 'Fatal: no $ipv6lib library found. cannot continue.'
3804-
echo "You need to fetch lib$ipv6lib.a from appropriate"
3805-
echo 'ipv6 kit and compile beforehand.'
3806-
exit 1
3807-
fi
3801+
AS_VAR_IF([ipv6trylibc], [yes], [
3802+
AC_MSG_NOTICE([using libc])
3803+
], [
3804+
AC_MSG_ERROR([m4_normalize([
3805+
No $ipv6lib library found; cannot continue.
3806+
You need to fetch lib$ipv6lib.a from appropriate
3807+
ipv6 kit and compile beforehand.
3808+
])])
3809+
])
38083810
fi
38093811
fi
38103812

@@ -4510,12 +4512,12 @@ dnl if ac_cv_func_getaddrinfo
45104512

45114513
if test "$ac_cv_func_getaddrinfo" = no -o "$ac_cv_buggy_getaddrinfo" = yes
45124514
then
4513-
if test $ipv6 = yes
4514-
then
4515-
echo 'Fatal: You must get working getaddrinfo() function.'
4516-
echo ' or you can specify "--disable-ipv6"'.
4517-
exit 1
4518-
fi
4515+
AS_VAR_IF([ipv6], [yes], [
4516+
AC_MSG_ERROR([m4_normalize([
4517+
You must get working getaddrinfo() function
4518+
or pass the "--disable-ipv6" option to configure.
4519+
])])
4520+
])
45194521
else
45204522
AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.])
45214523
fi
@@ -6494,28 +6496,26 @@ AC_CONFIG_FILES([Modules/Setup.stdlib])
64946496
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
64956497
AC_OUTPUT
64966498

6497-
echo "creating Modules/Setup.local" >&AS_MESSAGE_FD
6499+
AC_MSG_NOTICE([creating Modules/Setup.local])
64986500
if test ! -f Modules/Setup.local
64996501
then
65006502
echo "# Edit this file for local setup changes" >Modules/Setup.local
65016503
fi
65026504

6503-
echo "creating Makefile" >&AS_MESSAGE_FD
6505+
AC_MSG_NOTICE([creating Makefile])
65046506
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
65056507
-s Modules \
65066508
Modules/Setup.local $srcdir/Modules/Setup.bootstrap $srcdir/Modules/Setup
65076509
mv config.c Modules
65086510

65096511
if test -z "$PKG_CONFIG"; then
6510-
echo "" >&AS_MESSAGE_FD
6511-
echo "pkg-config is missing. Some dependencies may not be detected correctly." >&AS_MESSAGE_FD
6512+
AC_MSG_WARN([pkg-config is missing. Some dependencies may not be detected correctly.])
65126513
fi
65136514

65146515
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
6515-
echo "" >&AS_MESSAGE_FD
6516-
echo "" >&AS_MESSAGE_FD
6517-
echo "If you want a release build with all stable optimizations active (PGO, etc)," >&AS_MESSAGE_FD
6518-
echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD
6519-
echo "" >&AS_MESSAGE_FD
6520-
echo "" >&AS_MESSAGE_FD
6516+
AC_MSG_NOTICE([
6517+
6518+
If you want a release build with all stable optimizations active (PGO, etc),
6519+
please run ./configure --enable-optimizations
6520+
])
65216521
fi

0 commit comments

Comments
 (0)