Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
5aa60bcd
Commit
5aa60bcd
authored
Dec 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e4567bb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
56 deletions
+58
-56
setup.py
setup.py
+58
-56
No files found.
setup.py
View file @
5aa60bcd
...
...
@@ -29,8 +29,9 @@ import os
import
sys
# XXX doc
def
_with_includes
(
what
,
*
argv
,
**
kw
):
# _with_defaults calls what(*argv, **kw) with kw amended with default build flags.
# e.g. _with_defaults(_DSO, *argv, **kw)
def
_with_defaults
(
what
,
*
argv
,
**
kw
):
kw
=
kw
.
copy
()
kw
[
'include_dirs'
]
=
[
'.'
,
...
...
@@ -38,27 +39,12 @@ def _with_includes(what, *argv, **kw):
'./3rdparty/ccan'
,
'./3rdparty/include'
,
]
return
what
(
*
argv
,
**
kw
)
def
PyGoExt
(
*
argv
,
**
kw
):
return
_with_includes
(
_PyGoExt
,
*
argv
,
**
kw
)
def
DSO
(
*
argv
,
**
kw
):
return
_with_includes
(
_DSO
,
*
argv
,
**
kw
)
#_bigfile = Extension('wendelin.bigfile._bigfile',
_bigfile
=
PyGoExt
(
'wendelin.bigfile._bigfile'
,
sources
=
[
'bigfile/_bigfile.c'
,
],
define_macros
=
[(
'_GNU_SOURCE'
,
None
)],
language
=
'c'
,
extra_compile_args
=
[
ccdefault
=
[]
if
kw
.
get
(
'language'
)
==
'c'
:
ccdefault
+=
[
'-std=gnu99'
,
# declarations inside for-loop
'-fplan9-extensions'
,
# anonymous-structs + simple inheritance
'-fvisibility=hidden'
,
# by default symbols not visible outside DSO
# in C99 declaration after statement is ok, and we explicitly compile with -std=gnu99.
# Python >= 3.4 however adds -Werror=declaration-after-statement even for extension
...
...
@@ -69,16 +55,43 @@ _bigfile = PyGoExt('wendelin.bigfile._bigfile',
# ensure there is no warnings / errors for decl-after-statements.
'-Wno-declaration-after-statement'
,
'-Wno-error=declaration-after-statement'
,
],
]
else
:
ccdefault
.
append
(
'-std=gnu++11'
)
# not c++11 since we use typeof
# DSOs are not yet annoated for visibility
# XXX pyext besides _bigfile.so also cannot do this because PyMODINIT_FUNC
# does not include export in it. TODO reenable for _bigfile.so
"""
if what != _DSO:
ccdefault.append('-fvisibility=hidden') # by default symbols not visible outside DSO
"""
_
=
kw
.
get
(
'extra_compile_args'
,
[])[:]
_
[
0
:
0
]
=
ccdefault
kw
[
'extra_compile_args'
]
=
_
# XXX link default: no-undefined (only for DSO)
lddefault
=
[]
# python extensions cannot be built with -Wl,--no-undefined: at runtime
# they links with either python (without libpython) or libpython. linking
# with both libpython and python would be wrong
if
what
==
_DSO
:
lddefault
.
append
(
'-Wl,--no-undefined'
)
# check DSO for undefined symbols at link time
_
=
kw
.
get
(
'extra_link_args'
,
[])[:]
_
[
0
:
0
]
=
lddefault
kw
[
'extra_link_args'
]
=
_
# can't - at runtime links with either python (without libpython) or libpython
# linking with both libpython and python would be wrong
#extra_link_args = [
# '-Wl,--no-undefined', # check DSO for undefined symbols at link time
#]
dsos
=
[
'wendelin.bigfile.libvirtmem'
],
)
return
what
(
*
argv
,
**
kw
)
def
PyGoExt
(
*
argv
,
**
kw
):
return
_with_defaults
(
_PyGoExt
,
*
argv
,
**
kw
)
def
DSO
(
*
argv
,
**
kw
):
return
_with_defaults
(
_DSO
,
*
argv
,
**
kw
)
# build_py that
...
...
@@ -250,26 +263,18 @@ setup(
'lib/bug.c'
,
'lib/utils.c'
],
define_macros
=
[(
'_GNU_SOURCE'
,
None
),
(
'BUILDING_LIBVIRTMEM'
,
None
)],
# XXX dup
language
=
'c'
,
extra_compile_args
=
[
# XXX dup
'-std=gnu99'
,
# declarations inside for-loop
'-fplan9-extensions'
,
# anonymous-structs + simple inheritance
# TODO reenable
#'-fvisibility=hidden', # by default symbols not visible outside DSO
],
extra_link_args
=
[
'-Wl,--no-undefined'
,
# check DSO for undefined symbols at link time
])],
language
=
'c'
)],
ext_modules
=
[
_bigfile
,
PyGoExt
(
'wendelin.bigfile._bigfile'
,
[
'bigfile/_bigfile.c'
],
define_macros
=
[(
'_GNU_SOURCE'
,
None
)],
language
=
'c'
,
dsos
=
[
'wendelin.bigfile.libvirtmem'
],
),
PyGoExt
(
'wendelin.bigfile._file_zodb'
,
[
'bigfile/_file_zodb.pyx'
],
extra_compile_args
=
[
'-std=gnu++11'
,
# not c++11 since we use typeof
],
dsos
=
[
'wendelin.bigfile.libvirtmem'
]),
# XXX needed?
PyGoExt
(
'wendelin.wcfs.internal._wcfs'
,
...
...
@@ -278,9 +283,6 @@ setup(
'wcfs/internal/wcfs_watchlink.cpp'
,
'wcfs/internal/wcfs_misc.cpp'
,
],
extra_compile_args
=
[
'-std=gnu++11'
,
# not c++11 since we use typeof
],
dsos
=
[
'wendelin.bigfile.libvirtmem'
]),
PyGoExt
(
'wendelin.wcfs.internal.wcfs_test'
,
...
...
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