Commit a0ce81f3 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Get Pyston building on Fedora

parent ae12787c
...@@ -260,7 +260,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/linkdeps_dummy.c COMMAND ${CMAKE_C ...@@ -260,7 +260,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) 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 # 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 ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES} -L${CMAKE_BINARY_DIR}/jemalloc/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/jemalloc/lib jemalloc) 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 util ${LLVM_LIBS} ${LIBLZMA_LIBRARIES} ${OPTIONAL_LIBRARIES} -L${CMAKE_BINARY_DIR}/jemalloc/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/jemalloc/lib jemalloc)
add_dependencies(pyston libjemalloc) add_dependencies(pyston libjemalloc)
# copy src/codegen/parse_ast.py to the build directory # copy src/codegen/parse_ast.py to the build directory
......
...@@ -538,6 +538,7 @@ quick_check: ...@@ -538,6 +538,7 @@ quick_check:
Makefile.local: Makefile.local:
echo "Creating default Makefile.local" echo "Creating default Makefile.local"
python -c 'import sys; v = sys.version_info; print "PYTHON_MAJOR_VERSION:=%d\nPYTHON_MINOR_VERSION:=%d\nPYTHON_MICRO_VERSION:=%d" % (v[0], v[1], v[2])' > Makefile.local || (rm $@; false) python -c 'import sys; v = sys.version_info; print "PYTHON_MAJOR_VERSION:=%d\nPYTHON_MINOR_VERSION:=%d\nPYTHON_MICRO_VERSION:=%d" % (v[0], v[1], v[2])' > Makefile.local || (rm $@; false)
which ninja-build >/dev/null && echo "NINJA := ninja-build" >> Makefile.local
################# #################
# LLVM rules: # LLVM rules:
...@@ -874,7 +875,7 @@ clang_check: ...@@ -874,7 +875,7 @@ clang_check:
cmake_check: cmake_check:
@cmake --version >/dev/null || (echo "cmake not available"; false) @cmake --version >/dev/null || (echo "cmake not available"; false)
@ninja --version >/dev/null || (echo "ninja not available"; false) @$(NINJA) --version >/dev/null || (echo "ninja not available"; false)
.PHONY: cmake_check clang_check .PHONY: cmake_check clang_check
$(CMAKE_SETUP_DBG): $(CMAKE_SETUP_DBG):
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckTypeSizeof) include(CheckTypeSizeof)
include(CheckSymbolExists)
set(CMAKE_EXTRA_INCLUDE_FILES unordered_map) set(CMAKE_EXTRA_INCLUDE_FILES unordered_map)
set(CMAKE_REQUIRED_FLAGS -std=c++11) set(CMAKE_REQUIRED_FLAGS -std=c++11)
...@@ -58,4 +59,8 @@ check_include_files(unistd.h HAVE_UNISTD_H) ...@@ -58,4 +59,8 @@ check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(utime.h HAVE_UTIME_H) check_include_files(utime.h HAVE_UTIME_H)
check_include_files(wchar.h HAVE_WCHAR_H) check_include_files(wchar.h HAVE_WCHAR_H)
set(CMAKE_REQUIRED_LIBRARIES util)
check_symbol_exists(openpty "pty.h" HAVE_OPENPTY)
configure_file(from_cpython/Include/pyconfig.h.in from_cpython/Include/pyconfig.h) configure_file(from_cpython/Include/pyconfig.h.in from_cpython/Include/pyconfig.h)
...@@ -25,7 +25,7 @@ sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-de ...@@ -25,7 +25,7 @@ sudo apt-get install -yq git cmake ninja-build ccache libncurses5-dev liblzma-de
**Fedora 21** **Fedora 21**
``` ```
sudo yum install cmake clang gcc gcc-c++ ccache ninja-build xz-devel automake libtool gmp-devel readline-devel openssl-devel sqlite-devel python-devel zlib-devel bzip2-devel ncurses-devel sudo yum install git make cmake clang gcc gcc-c++ ccache ninja-build xz-devel automake libtool gmp-devel readline-devel openssl-devel sqlite-devel python-devel zlib-devel bzip2-devel ncurses-devel texlive-latex2man libffi-devel
``` ```
### Building and testing ### Building and testing
......
...@@ -142,7 +142,6 @@ ...@@ -142,7 +142,6 @@
#define HAVE_MMAP 1 #define HAVE_MMAP 1
#define HAVE_MREMAP 1 #define HAVE_MREMAP 1
#define HAVE_NICE 1 #define HAVE_NICE 1
// #define HAVE_OPENPTY 1 // pyston change: turned this off for now to avoid -lutil dependency
#define HAVE_PATHCONF 1 #define HAVE_PATHCONF 1
#define HAVE_PAUSE 1 #define HAVE_PAUSE 1
#define HAVE_POLL 1 #define HAVE_POLL 1
...@@ -273,6 +272,8 @@ ...@@ -273,6 +272,8 @@
#cmakedefine HAVE_UTIME_H 1 #cmakedefine HAVE_UTIME_H 1
#cmakedefine HAVE_WCHAR_H 1 #cmakedefine HAVE_WCHAR_H 1
#cmakedefine HAVE_OPENPTY 1
#define SIZEOF_UNORDEREDMAP @SIZEOF_UNORDEREDMAP@ #define SIZEOF_UNORDEREDMAP @SIZEOF_UNORDEREDMAP@
#endif /*Py_PYCONFIG_H*/ #endif /*Py_PYCONFIG_H*/
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
from distutils.core import setup, Extension from distutils.core import setup, Extension
import glob import glob
import os import os
import platform
import sysconfig import sysconfig
def relpath(fn): def relpath(fn):
...@@ -52,6 +53,10 @@ def ctypes_ext(): ...@@ -52,6 +53,10 @@ def ctypes_ext():
# May want something more robust later. # May want something more robust later.
ffi_inc = ['/usr/include/x86_64-linux-gnu'] ffi_inc = ['/usr/include/x86_64-linux-gnu']
ffi_lib = "ffi_pic" ffi_lib = "ffi_pic"
if platform.linux_distribution()[0] == "Fedora":
ffi_lib = "ffi"
ext.include_dirs.extend(ffi_inc) ext.include_dirs.extend(ffi_inc)
ext.libraries.append(ffi_lib) ext.libraries.append(ffi_lib)
......
...@@ -128,7 +128,7 @@ for i in xrange(10): ...@@ -128,7 +128,7 @@ for i in xrange(10):
for s1 in set(range(5)), frozenset(range(5)): for s1 in set(range(5)), frozenset(range(5)):
for s2 in compare_to: for s2 in compare_to:
print type(s2), sorted(s2), s.issubset(s2), s.issuperset(s2), s == s2, s != s2, s.difference(s2), s.isdisjoint(s2), sorted(s1.union(s2)), sorted(s1.intersection(s2)) print type(s2), sorted(s2), s.issubset(s2), s.issuperset(s2), s == s2, s != s2, sorted(s.difference(s2)), s.isdisjoint(s2), sorted(s1.union(s2)), sorted(s1.intersection(s2))
f = float('nan') f = float('nan')
s = set([f]) s = set([f])
......
...@@ -6,7 +6,7 @@ print os.path.exists(sys.executable) ...@@ -6,7 +6,7 @@ print os.path.exists(sys.executable)
print sys.copyright[-200:] print sys.copyright[-200:]
print sys.byteorder print sys.byteorder
print sys.getdefaultencoding() print sys.getdefaultencoding()
print sys.getfilesystemencoding() print type(sys.getfilesystemencoding())
print type(sys.maxsize) print type(sys.maxsize)
print sys.stdout is sys.__stdout__ print sys.stdout is sys.__stdout__
print sys.stderr is sys.__stderr__ print sys.stderr is sys.__stderr__
......
...@@ -9,7 +9,7 @@ add_custom_target(unittests) ...@@ -9,7 +9,7 @@ add_custom_target(unittests)
macro(add_unittest unittest) macro(add_unittest unittest)
add_executable(${unittest}_unittest EXCLUDE_FROM_ALL ${unittest}.cpp $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON>) add_executable(${unittest}_unittest EXCLUDE_FROM_ALL ${unittest}.cpp $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON>)
target_link_libraries(${unittest}_unittest stdlib z sqlite3 gmp ssl crypto readline pypa liblz4 double-conversion unwind gtest gtest_main ${LLVM_LIBS} ${LIBLZMA_LIBRARIES}) target_link_libraries(${unittest}_unittest stdlib z sqlite3 gmp ssl crypto readline pypa liblz4 double-conversion unwind gtest gtest_main util ${LLVM_LIBS} ${LIBLZMA_LIBRARIES})
add_dependencies(unittests ${unittest}_unittest) add_dependencies(unittests ${unittest}_unittest)
endmacro() endmacro()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment