Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19d1734

Browse files
committed
Patch #752671: NetBSD needs to link libintl to _locale.so.
1 parent 61e2c9a commit 19d1734

5 files changed

Lines changed: 77 additions & 3 deletions

File tree

Modules/Setup.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ GLHACK=-Dclear=__GLclear
173173

174174
#unicodedata unicodedata.c # static Unicode character database
175175

176-
#_locale _localemodule.c # access to ISO C locale support
176+
# access to ISO C locale support
177+
#_locale _localemodule.c # -lintl
177178

178179

179180
# Modules with some UNIX dependencies -- on by default:

configure

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 1.416 .
2+
# From configure.in Revision: 1.417 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.53 for python 2.3.
55
#
@@ -9930,6 +9930,70 @@ fi
99309930
# 'Real Time' functions on Solaris
99319931
# posix4 on Solaris 2.6
99329932
# pthread (first!) on Linux
9933+
# check if we need libintl for locale functions
9934+
echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5
9935+
echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6
9936+
if test "${ac_cv_lib_intl_textdomain+set}" = set; then
9937+
echo $ECHO_N "(cached) $ECHO_C" >&6
9938+
else
9939+
ac_check_lib_save_LIBS=$LIBS
9940+
LIBS="-lintl $LIBS"
9941+
cat >conftest.$ac_ext <<_ACEOF
9942+
#line $LINENO "configure"
9943+
#include "confdefs.h"
9944+
9945+
/* Override any gcc2 internal prototype to avoid an error. */
9946+
#ifdef __cplusplus
9947+
extern "C"
9948+
#endif
9949+
/* We use char because int might match the return type of a gcc2
9950+
builtin and then its argument prototype would still apply. */
9951+
char textdomain ();
9952+
#ifdef F77_DUMMY_MAIN
9953+
# ifdef __cplusplus
9954+
extern "C"
9955+
# endif
9956+
int F77_DUMMY_MAIN() { return 1; }
9957+
#endif
9958+
int
9959+
main ()
9960+
{
9961+
textdomain ();
9962+
;
9963+
return 0;
9964+
}
9965+
_ACEOF
9966+
rm -f conftest.$ac_objext conftest$ac_exeext
9967+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9968+
(eval $ac_link) 2>&5
9969+
ac_status=$?
9970+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
9971+
(exit $ac_status); } &&
9972+
{ ac_try='test -s conftest$ac_exeext'
9973+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9974+
(eval $ac_try) 2>&5
9975+
ac_status=$?
9976+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
9977+
(exit $ac_status); }; }; then
9978+
ac_cv_lib_intl_textdomain=yes
9979+
else
9980+
echo "$as_me: failed program was:" >&5
9981+
cat conftest.$ac_ext >&5
9982+
ac_cv_lib_intl_textdomain=no
9983+
fi
9984+
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9985+
LIBS=$ac_check_lib_save_LIBS
9986+
fi
9987+
echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5
9988+
echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6
9989+
if test $ac_cv_lib_intl_textdomain = yes; then
9990+
9991+
cat >>confdefs.h <<\_ACEOF
9992+
#define WITH_LIBINTL 1
9993+
_ACEOF
9994+
9995+
fi
9996+
99339997
99349998
# checks for system dependent C++ extensions support
99359999
case "$ac_sys_system" in

configure.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,10 @@ AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
13461346
AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
13471347
# posix4 on Solaris 2.6
13481348
# pthread (first!) on Linux
1349+
# check if we need libintl for locale functions
1350+
AC_CHECK_LIB(intl, textdomain,
1351+
AC_DEFINE(WITH_LIBINTL, 1,
1352+
[Define to 1 if libintl is needed for locale functions.]))
13491353

13501354
# checks for system dependent C++ extensions support
13511355
case "$ac_sys_system" in

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,9 @@
781781
Dyld is necessary to support frameworks. */
782782
#undef WITH_DYLD
783783

784+
/* Define to 1 if libintl is needed for locale functions. */
785+
#undef WITH_LIBINTL
786+
784787
/* Define if you want to produce an OpenStep/Rhapsody framework (shared
785788
library plus accessory files). */
786789
#undef WITH_NEXT_FRAMEWORK

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ def detect_modules(self):
339339
if have_unicode:
340340
exts.append( Extension('unicodedata', ['unicodedata.c']) )
341341
# access to ISO C locale support
342-
if platform in ['cygwin', 'aix4']:
342+
data = open('pyconfig.h').read()
343+
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
344+
if m is not None:
343345
locale_libs = ['intl']
344346
else:
345347
locale_libs = []

0 commit comments

Comments
 (0)