Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
571c75aa
Commit
571c75aa
authored
Apr 13, 2017
by
Ken Payson
Browse files
Options
Downloads
Patches
Plain Diff
Switch to Makefile based build on mac
parent
3b90055f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
PYTHON-MANIFEST.in
+1
-0
1 addition, 0 deletions
PYTHON-MANIFEST.in
setup.py
+14
-4
14 additions, 4 deletions
setup.py
src/python/grpcio/commands.py
+19
-0
19 additions, 0 deletions
src/python/grpcio/commands.py
with
34 additions
and
4 deletions
PYTHON-MANIFEST.in
+
1
−
0
View file @
571c75aa
...
@@ -17,3 +17,4 @@ include src/python/grpcio/support.py
...
@@ -17,3 +17,4 @@ include src/python/grpcio/support.py
include src/python/grpcio/README.rst
include src/python/grpcio/README.rst
include requirements.txt
include requirements.txt
include etc/roots.pem
include etc/roots.pem
include Makefile
This diff is collapsed.
Click to expand it.
setup.py
+
14
−
4
View file @
571c75aa
...
@@ -102,7 +102,7 @@ ENABLE_DOCUMENTATION_BUILD = os.environ.get(
...
@@ -102,7 +102,7 @@ ENABLE_DOCUMENTATION_BUILD = os.environ.get(
EXTRA_ENV_COMPILE_ARGS
=
os
.
environ
.
get
(
'
GRPC_PYTHON_CFLAGS
'
,
None
)
EXTRA_ENV_COMPILE_ARGS
=
os
.
environ
.
get
(
'
GRPC_PYTHON_CFLAGS
'
,
None
)
EXTRA_ENV_LINK_ARGS
=
os
.
environ
.
get
(
'
GRPC_PYTHON_LDFLAGS
'
,
None
)
EXTRA_ENV_LINK_ARGS
=
os
.
environ
.
get
(
'
GRPC_PYTHON_LDFLAGS
'
,
None
)
if
EXTRA_ENV_COMPILE_ARGS
is
None
:
if
EXTRA_ENV_COMPILE_ARGS
is
None
:
EXTRA_ENV_COMPILE_ARGS
=
'
-std=c++11
'
EXTRA_ENV_COMPILE_ARGS
=
''
if
'
win32
'
in
sys
.
platform
and
sys
.
version_info
<
(
3
,
5
):
if
'
win32
'
in
sys
.
platform
and
sys
.
version_info
<
(
3
,
5
):
# We use define flags here and don't directly add to DEFINE_MACROS below to
# We use define flags here and don't directly add to DEFINE_MACROS below to
# ensure that the expert user/builder has a way of turning it off (via the
# ensure that the expert user/builder has a way of turning it off (via the
...
@@ -114,7 +114,9 @@ if EXTRA_ENV_COMPILE_ARGS is None:
...
@@ -114,7 +114,9 @@ if EXTRA_ENV_COMPILE_ARGS is None:
EXTRA_ENV_COMPILE_ARGS
+=
'
-D_ftime=_ftime64 -D_timeb=__timeb64
'
EXTRA_ENV_COMPILE_ARGS
+=
'
-D_ftime=_ftime64 -D_timeb=__timeb64
'
elif
'
win32
'
in
sys
.
platform
:
elif
'
win32
'
in
sys
.
platform
:
EXTRA_ENV_COMPILE_ARGS
+=
'
-D_PYTHON_MSVC
'
EXTRA_ENV_COMPILE_ARGS
+=
'
-D_PYTHON_MSVC
'
elif
"
linux
"
in
sys
.
platform
or
"
darwin
"
in
sys
.
platform
:
elif
"
linux
"
in
sys
.
platform
:
EXTRA_ENV_COMPILE_ARGS
+=
'
-std=c++11 -fvisibility=hidden -fno-wrapv
'
elif
"
darwin
"
in
sys
.
platform
:
EXTRA_ENV_COMPILE_ARGS
+=
'
-fvisibility=hidden -fno-wrapv
'
EXTRA_ENV_COMPILE_ARGS
+=
'
-fvisibility=hidden -fno-wrapv
'
if
EXTRA_ENV_LINK_ARGS
is
None
:
if
EXTRA_ENV_LINK_ARGS
is
None
:
...
@@ -172,7 +174,7 @@ LDFLAGS = tuple(EXTRA_LINK_ARGS)
...
@@ -172,7 +174,7 @@ LDFLAGS = tuple(EXTRA_LINK_ARGS)
CFLAGS
=
tuple
(
EXTRA_COMPILE_ARGS
)
CFLAGS
=
tuple
(
EXTRA_COMPILE_ARGS
)
if
"
linux
"
in
sys
.
platform
or
"
darwin
"
in
sys
.
platform
:
if
"
linux
"
in
sys
.
platform
or
"
darwin
"
in
sys
.
platform
:
pymodinit_type
=
'
PyObject*
'
if
PY3
else
'
void
'
pymodinit_type
=
'
PyObject*
'
if
PY3
else
'
void
'
pymodinit
=
'
extern
"
C
"
__attribute__((visibility (
"
default
"
))) {}
'
.
format
(
pymodinit_type
)
pymodinit
=
'
__attribute__((visibility (
"
default
"
))) {}
'
.
format
(
pymodinit_type
)
DEFINE_MACROS
+=
((
'
PyMODINIT_FUNC
'
,
pymodinit
),)
DEFINE_MACROS
+=
((
'
PyMODINIT_FUNC
'
,
pymodinit
),)
# By default, Python3 distutils enforces compatibility of
# By default, Python3 distutils enforces compatibility of
...
@@ -192,14 +194,22 @@ def cython_extensions_and_necessity():
...
@@ -192,14 +194,22 @@ def cython_extensions_and_necessity():
cython_module_files
=
[
os
.
path
.
join
(
PYTHON_STEM
,
cython_module_files
=
[
os
.
path
.
join
(
PYTHON_STEM
,
name
.
replace
(
'
.
'
,
'
/
'
)
+
'
.pyx
'
)
name
.
replace
(
'
.
'
,
'
/
'
)
+
'
.pyx
'
)
for
name
in
CYTHON_EXTENSION_MODULE_NAMES
]
for
name
in
CYTHON_EXTENSION_MODULE_NAMES
]
if
"
darwin
"
in
sys
.
platform
:
extra_objects
=
[
'
libs/opt/libares.a
'
,
'
libs/opt/libboringssl.a
'
,
'
libs/opt/libgpr.a
'
,
'
libs/opt/libgrpc.a
'
]
CORE_C_FILES
=
[]
else
:
extra_objects
=
[]
extensions
=
[
extensions
=
[
_extension
.
Extension
(
_extension
.
Extension
(
name
=
module_name
,
name
=
module_name
,
language
=
'
c++
'
,
sources
=
[
module_file
]
+
list
(
CYTHON_HELPER_C_FILES
)
+
list
(
CORE_C_FILES
),
sources
=
[
module_file
]
+
list
(
CYTHON_HELPER_C_FILES
)
+
list
(
CORE_C_FILES
),
include_dirs
=
list
(
EXTENSION_INCLUDE_DIRECTORIES
),
include_dirs
=
list
(
EXTENSION_INCLUDE_DIRECTORIES
),
libraries
=
list
(
EXTENSION_LIBRARIES
),
libraries
=
list
(
EXTENSION_LIBRARIES
),
define_macros
=
list
(
DEFINE_MACROS
),
define_macros
=
list
(
DEFINE_MACROS
),
extra_objects
=
extra_objects
,
extra_compile_args
=
list
(
CFLAGS
),
extra_compile_args
=
list
(
CFLAGS
),
extra_link_args
=
list
(
LDFLAGS
),
extra_link_args
=
list
(
LDFLAGS
),
)
for
(
module_name
,
module_file
)
in
zip
(
list
(
CYTHON_EXTENSION_MODULE_NAMES
),
cython_module_files
)
)
for
(
module_name
,
module_file
)
in
zip
(
list
(
CYTHON_EXTENSION_MODULE_NAMES
),
cython_module_files
)
...
...
This diff is collapsed.
Click to expand it.
src/python/grpcio/commands.py
+
19
−
0
View file @
571c75aa
...
@@ -266,6 +266,25 @@ class BuildExt(build_ext.build_ext):
...
@@ -266,6 +266,25 @@ class BuildExt(build_ext.build_ext):
LINK_OPTIONS
=
{}
LINK_OPTIONS
=
{}
def
build_extensions
(
self
):
def
build_extensions
(
self
):
if
"
darwin
"
in
sys
.
platform
:
target_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'
..
'
,
'
..
'
,
'
..
'
,
'
libs
'
,
'
opt
'
))
targets
=
[
os
.
path
.
join
(
target_path
,
'
libboringssl.a
'
),
os
.
path
.
join
(
target_path
,
'
libares.a
'
),
os
.
path
.
join
(
target_path
,
'
libgpr.a
'
),
os
.
path
.
join
(
target_path
,
'
libgrpc.a
'
)]
make_process
=
subprocess
.
Popen
([
'
make
'
]
+
targets
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
make_out
,
make_err
=
make_process
.
communicate
()
if
make_out
and
make_process
.
returncode
!=
0
:
sys
.
stdout
.
write
(
make_out
+
'
\n
'
)
if
make_err
:
sys
.
stderr
.
write
(
make_err
+
'
\n
'
)
if
make_process
.
returncode
!=
0
:
raise
Exception
(
"
make command failed!
"
)
compiler
=
self
.
compiler
.
compiler_type
compiler
=
self
.
compiler
.
compiler_type
if
compiler
in
BuildExt
.
C_OPTIONS
:
if
compiler
in
BuildExt
.
C_OPTIONS
:
for
extension
in
self
.
extensions
:
for
extension
in
self
.
extensions
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment