Skip to content

[2.7] bpo-14353: Fix detection of bind_textdomain_codeset in libintl #13265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix detection of the bind_textdomain_codeset function for building gettext
support into the locale module.
60 changes: 59 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -9051,6 +9051,64 @@ $as_echo "#define WITH_LIBINTL 1" >>confdefs.h

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
$as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char bind_textdomain_codeset ();
int
main ()
{
return bind_textdomain_codeset ();
;
return 0;
}
_ACEOF
for ac_lib in '' intl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_bind_textdomain_codeset=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
break
fi
done
if ${ac_cv_search_bind_textdomain_codeset+:} false; then :

else
ac_cv_search_bind_textdomain_codeset=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
$as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
ac_res=$ac_cv_search_bind_textdomain_codeset
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

$as_echo "#define HAVE_BIND_TEXTDOMAIN_CODESET 1" >>confdefs.h

fi


# checks for system dependent C++ extensions support
case "$ac_sys_system" in
Expand Down Expand Up @@ -10588,7 +10646,7 @@ fi
$as_echo "MACHDEP_OBJS" >&6; }

# checks for library functions
for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \
for ac_func in alarm setitimer getitimer chown \
clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
getentropy \
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,9 @@ fi
AC_CHECK_LIB(intl, textdomain,
AC_DEFINE(WITH_LIBINTL, 1,
[Define to 1 if libintl is needed for locale functions.]))
AC_SEARCH_LIBS(bind_textdomain_codeset, intl,
AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1,
[Define to 1 if bind_textdomain_codeset is available.]))

# checks for system dependent C++ extensions support
case "$ac_sys_system" in
Expand Down Expand Up @@ -3117,7 +3120,7 @@ fi
AC_MSG_RESULT(MACHDEP_OBJS)

# checks for library functions
AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
AC_CHECK_FUNCS(alarm setitimer getitimer chown \
clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
getentropy \
Expand Down
2 changes: 1 addition & 1 deletion pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */
#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE

/* Define to 1 if you have the `bind_textdomain_codeset' function. */
/* Define to 1 if bind_textdomain_codeset is available. */
#undef HAVE_BIND_TEXTDOMAIN_CODESET

/* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
Expand Down