Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
32b2ca28
Commit
32b2ca28
authored
May 22, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add libresolv to the libraries needed to link c-ares on macOS.
parent
dc4b8c2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
35 deletions
+15
-35
_setupares.py
_setupares.py
+12
-12
_setuplibev.py
_setuplibev.py
+0
-5
_setuputils.py
_setuputils.py
+0
-18
docs/changes/1624.feature
docs/changes/1624.feature
+3
-0
No files found.
_setupares.py
View file @
32b2ca28
...
...
@@ -17,7 +17,6 @@ import distutils.sysconfig # to get CFLAGS to pass into c-ares configure script
from
_setuputils
import
WIN
from
_setuputils
import
quoted_dep_abspath
from
_setuputils
import
system
from
_setuputils
import
make_universal_header
from
_setuputils
import
should_embed
from
_setuputils
import
LIBRARIES
from
_setuputils
import
DEFINE_MACROS
...
...
@@ -31,24 +30,24 @@ from _setuputils import get_include_dirs
CARES_EMBED
=
should_embed
(
'c-ares'
)
# See #616, trouble building for a 32-bit python on a 64-bit platform
# (Linux).
_config_cflags
=
distutils
.
sysconfig
.
get_config_var
(
"CFLAGS"
)
cflags
=
_config_cflags
+
((
' '
+
os
.
environ
[
'CFLAGS'
])
if
'CFLAGS'
in
os
.
environ
else
''
)
cflags
=
(
'CFLAGS="%s"'
%
(
cflags
,))
if
cflags
else
''
# See #616, trouble building for a 32-bit python against a 64-bit platform
_config_vars
=
distutils
.
sysconfig
.
get_config_var
(
"CFLAGS"
)
if
_config_vars
and
"m32"
in
_config_vars
:
_m32
=
'CFLAGS="'
+
os
.
getenv
(
'CFLAGS'
,
''
)
+
' -m32" '
else
:
_m32
=
''
# Use -r, not -e, for support of old solaris. See
# https://github.com/gevent/gevent/issues/777
ares_configure_command
=
' '
.
join
([
"(cd "
,
quoted_dep_abspath
(
'c-ares'
),
" && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi "
,
" && sh ./configure --disable-dependency-tracking -C "
+
_m32
+
"CONFIG_COMMANDS= "
,
" && sh ./configure --disable-dependency-tracking -C "
+
cflags
,
" && cp ares_config.h ares_build.h
\
"
$OLDPWD
\
"
"
,
" && cat ares_build.h "
,
" && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)"
,
"> configure-output.txt"
])
"> configure-output.txt"
])
...
...
@@ -79,9 +78,6 @@ def configure_ares(bext, ext):
with
open
(
'configure-output.txt'
,
'r'
)
as
t
:
print
(
t
.
read
(),
file
=
sys
.
stderr
)
raise
if
sys
.
platform
==
'darwin'
:
make_universal_header
(
'ares_build.h'
,
'CARES_SIZEOF_LONG'
)
make_universal_header
(
'ares_config.h'
,
'SIZEOF_LONG'
,
'SIZEOF_SIZE_T'
,
'SIZEOF_TIME_T'
)
finally
:
os
.
chdir
(
cwd
)
...
...
@@ -116,6 +112,10 @@ if CARES_EMBED:
ARES
.
define_macros
+=
[(
'HAVE_CONFIG_H'
,
''
)]
if
sys
.
platform
!=
'darwin'
:
ARES
.
libraries
+=
[
'rt'
]
else
:
# libresolv dependency introduced in
# c-ares 1.16.1.
ARES
.
libraries
+=
[
'resolv'
]
ARES
.
define_macros
+=
[(
'CARES_EMBED'
,
'1'
)]
else
:
ARES
.
libraries
.
append
(
'cares'
)
...
...
_setuplibev.py
View file @
32b2ca28
...
...
@@ -8,7 +8,6 @@ it shouldn't attempt to cythonize anything.
from
__future__
import
print_function
,
absolute_import
,
division
import
sys
import
os.path
from
_setuputils
import
Extension
...
...
@@ -17,7 +16,6 @@ from _setuputils import system
from
_setuputils
import
dep_abspath
from
_setuputils
import
quoted_dep_abspath
from
_setuputils
import
WIN
from
_setuputils
import
make_universal_header
from
_setuputils
import
LIBRARIES
from
_setuputils
import
DEFINE_MACROS
from
_setuputils
import
glob_many
...
...
@@ -55,9 +53,6 @@ def configure_libev(build_command=None, extension=None): # pylint:disable=unused
return
system
(
libev_configure_command
)
if
sys
.
platform
==
'darwin'
:
make_universal_header
(
config_path
,
'SIZEOF_LONG'
,
'SIZEOF_SIZE_T'
,
'SIZEOF_TIME_T'
)
def
build_extension
():
...
...
_setuputils.py
View file @
32b2ca28
...
...
@@ -135,24 +135,6 @@ def should_embed(dep_name):
## Headers
def
make_universal_header
(
filename
,
*
defines
):
defines
=
[(
'#define %s '
%
define
,
define
)
for
define
in
defines
]
with
open
(
filename
,
'r'
)
as
f
:
lines
=
f
.
read
().
split
(
'
\
n
'
)
ifdef
=
0
with
open
(
filename
,
'w'
)
as
f
:
for
line
in
lines
:
if
line
.
startswith
(
'#ifdef'
):
ifdef
+=
1
elif
line
.
startswith
(
'#endif'
):
ifdef
-=
1
elif
not
ifdef
:
for
prefix
,
define
in
defines
:
if
line
.
startswith
(
prefix
):
line
=
'#ifdef __LP64__
\
n
#define %s 8
\
n
#else
\
n
#define %s 4
\
n
#endif'
%
(
define
,
define
)
break
print
(
line
,
file
=
f
)
def
get_include_dirs
(
*
extra_paths
):
"""
Return additional include directories that might be needed to
...
...
docs/changes/1624.feature
View file @
32b2ca28
Update
bundled
c-ares
from
1.16.0
to
1.16.1.
On
macOS,
stop
trying
to
adjust
c-ares
headers
to
make
them
universal.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment