Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
733660f8
Commit
733660f8
authored
Jun 16, 2015
by
Chris Toshok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build these as extension modules instead of as part of the pyston executable
parent
0ef87733
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
14 deletions
+30
-14
CMakeLists.txt
CMakeLists.txt
+1
-1
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+8
-4
from_cpython/setup.py
from_cpython/setup.py
+21
-1
src/runtime/types.cpp
src/runtime/types.cpp
+0
-8
No files found.
CMakeLists.txt
View file @
733660f8
...
...
@@ -213,7 +213,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/linkdeps_dummy.c COMMAND ${CMAKE_C
add_executable
(
pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON> linkdeps_dummy.c
)
# Wrap the stdlib in --whole-archive to force all the symbols to be included and eventually exported
target_link_libraries
(
pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m z readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion
bz2 curses
${
LLVM_LIBS
}
${
LIBLZMA_LIBRARIES
}
${
OPTIONAL_LIBRARIES
}
)
target_link_libraries
(
pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m z readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion
${
LLVM_LIBS
}
${
LIBLZMA_LIBRARIES
}
${
OPTIONAL_LIBRARIES
}
)
# copy src/codegen/parse_ast.py to the build directory
add_custom_command
(
TARGET pyston POST_BUILD COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
CMAKE_SOURCE_DIR
}
/src/codegen/parse_ast.py
${
CMAKE_BINARY_DIR
}
/src/codegen/parse_ast.py
)
...
...
from_cpython/CMakeLists.txt
View file @
733660f8
...
...
@@ -20,7 +20,6 @@ file(GLOB_RECURSE STDMODULE_SRCS Modules
_codecsmodule.c
_collectionsmodule.c
_csv.c
_cursesmodule.c
_functoolsmodule.c
_iomodule.c
_math.c
...
...
@@ -33,7 +32,6 @@ file(GLOB_RECURSE STDMODULE_SRCS Modules
binascii.c
bufferedio.c
bytesio.c
bz2module.c
cache.c
connection.c
cStringIO.c
...
...
@@ -43,7 +41,6 @@ file(GLOB_RECURSE STDMODULE_SRCS Modules
fcntlmodule.c
fileio.c
getpath.c
grpmodule.c
iobase.c
itertoolsmodule.c
mathmodule.c
...
...
@@ -66,7 +63,6 @@ file(GLOB_RECURSE STDMODULE_SRCS Modules
statement.c
stringio.c
stropmodule.c
termios.c
textio.c
threadmodule.c
timemodule.c
...
...
@@ -121,6 +117,10 @@ add_custom_command(OUTPUT
${
CMAKE_BINARY_DIR
}
/lib_pyston/_multiprocessing.pyston.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/pyexpat.pyston.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/_elementtree.pyston.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/bz2.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/grp.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/termios.so
${
CMAKE_BINARY_DIR
}
/lib_pyston/_curses.so
COMMAND
${
CMAKE_BINARY_DIR
}
/pyston setup.py build --build-lib
${
CMAKE_BINARY_DIR
}
/lib_pyston
DEPENDS
pyston
...
...
@@ -136,5 +136,9 @@ add_custom_command(OUTPUT
Modules/expat/xmltok_ns.c
Modules/pyexpat.c
Modules/_elementtree.c
Modules/bz2module.c
Modules/grpmodule.c
Modules/termios.c
Modules/_cursesmodule.c
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_custom_target
(
sharedmods DEPENDS
${
CMAKE_BINARY_DIR
}
/lib_pyston/_multiprocessing.pyston.so
)
from_cpython/setup.py
View file @
733660f8
...
...
@@ -14,6 +14,26 @@ def multiprocessing_ext():
"Modules/_multiprocessing/semaphore.c"
,
]))
def
bz2_ext
():
return
Extension
(
"bz2"
,
sources
=
map
(
relpath
,
[
"Modules/bz2module.c"
,
]),
libraries
=
[
'bz2'
])
def
grp_ext
():
return
Extension
(
"grp"
,
sources
=
map
(
relpath
,
[
"Modules/grpmodule.c"
,
]))
def
curses_ext
():
return
Extension
(
"_curses"
,
sources
=
map
(
relpath
,
[
"Modules/_cursesmodule.c"
,
]),
libraries
=
[
'curses'
])
def
termios_ext
():
return
Extension
(
"termios"
,
sources
=
map
(
relpath
,
[
"Modules/termios.c"
,
]))
def
pyexpat_ext
():
define_macros
=
[(
'HAVE_EXPAT_CONFIG_H'
,
'1'
),]
expat_sources
=
map
(
relpath
,
[
'Modules/expat/xmlparse.c'
,
...
...
@@ -56,5 +76,5 @@ def elementtree_ext():
setup
(
name
=
"Pyston"
,
version
=
"1.0"
,
description
=
"Pyston shared modules"
,
ext_modules
=
[
multiprocessing_ext
(),
pyexpat_ext
(),
elementtree_ext
()]
ext_modules
=
[
multiprocessing_ext
(),
pyexpat_ext
(),
elementtree_ext
()
,
bz2_ext
(),
grp_ext
(),
curses_ext
(),
termios_ext
()
]
)
src/runtime/types.cpp
View file @
733660f8
...
...
@@ -84,10 +84,6 @@ extern "C" void init_ssl();
extern
"C"
void
init_sqlite3
();
extern
"C"
void
PyMarshal_Init
();
extern
"C"
void
initstrop
();
extern
"C"
void
initgrp
();
extern
"C"
void
initbz2
();
extern
"C"
void
init_curses
();
extern
"C"
void
inittermios
();
namespace
pyston
{
...
...
@@ -3386,10 +3382,6 @@ void setupRuntime() {
init_sqlite3
();
PyMarshal_Init
();
initstrop
();
initgrp
();
initbz2
();
init_curses
();
inittermios
();
// some additional setup to ensure weakrefs participate in our GC
BoxedClass
*
weakref_ref_cls
=
&
_PyWeakref_RefType
;
...
...
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