Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: c

sudo: required
dist: trusty
dist: xenial

compiler:
- gcc
Expand All @@ -11,11 +11,12 @@ env:
- LUA_ENV=lua5.3 PY_ENV=python2.7 m_SUFFIX=
- LUA_ENV=lua5.1 PY_ENV=python3.6 m_SUFFIX=m
- LUA_ENV=lua5.3 PY_ENV=python3.6 m_SUFFIX=m
- LUA_ENV=lua5.1 PY_ENV=python3.8 m_SUFFIX=
- LUA_ENV=lua5.3 PY_ENV=python3.8 m_SUFFIX=


before_install:
- sudo add-apt-repository -y "deb http://ppa.launchpad.net/grilo-team/travis/ubuntu trusty main"
- sudo add-apt-repository -y "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main"
- sudo add-apt-repository -y ppa:deadsnakes/ppa
- sudo apt-get update -qq

install:
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if (WIN32)
target_compile_definitions(src PRIVATE LUA_BUILD_AS_DLL)
endif (WIN32)

if (UNIX)
get_filename_component(PYTHON_LIBRT ${PYTHON_LIBRARIES} NAME)
target_compile_definitions(src PRIVATE PYTHON_LIBRT=${PYTHON_LIBRT})
endif (UNIX)

if (CMAKE_COMPILER_IS_GNUCC)
target_compile_options(src PUBLIC -Wall -pedantic -std=c99)
endif (CMAKE_COMPILER_IS_GNUCC)
10 changes: 5 additions & 5 deletions src/pythoninlua.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,12 @@ LUA_API int luaopen_python(lua_State *L)
*/
#if defined(__linux__)
# define STR(s) #s
#if PY_MAJOR_VERSION < 3
# define PYLIB_STR(major, minor) "libpython" STR(major) "." STR(minor) ".so"
#else
# define PYLIB_STR(major, minor) "libpython" STR(major) "." STR(minor) "m.so"
# define PYLIB_STR(s) STR(s)
#if !defined(PYTHON_LIBRT)
# error PYTHON_LIBRT must be defined when building under Linux!
#endif
dlopen(PYLIB_STR(PY_MAJOR_VERSION, PY_MINOR_VERSION), RTLD_NOW | RTLD_GLOBAL);
void *ok = dlopen(PYLIB_STR(PYTHON_LIBRT), RTLD_NOW | RTLD_GLOBAL);
assert(ok); (void) ok;
#endif

Py_Initialize();
Expand Down