Fixed Remaining Shared Objects in Static Lua (#15787)

Fixed removal of remaining references and symlinks to so files when
building lua with static libraries
This commit is contained in:
Robert Pavel 2020-04-01 11:31:01 -06:00 committed by GitHub
parent 917c0a0efd
commit 6ad717cc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,7 @@ def install(self, spec, prefix):
# compatibility with ax_lua.m4 from autoconf-archive
# https://www.gnu.org/software/autoconf-archive/ax_lua.html
if '+shared' in spec:
with working_dir(prefix.lib):
# e.g., liblua.so.5.1.5
src_path = 'liblua.{0}.{1}'.format(dso_suffix,
@ -96,6 +97,7 @@ def install(self, spec, prefix):
def append_paths(self, paths, cpaths, path):
paths.append(os.path.join(path, '?.lua'))
paths.append(os.path.join(path, '?', 'init.lua'))
if '+shared' in self.spec:
cpaths.append(os.path.join(path, '?.so'))
def _setup_dependent_env_helper(self, env, dependent_spec):
@ -126,6 +128,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
env, dependent_spec)
env.set('LUA_PATH', ';'.join(lua_patterns), separator=';')
if '+shared' in self.spec:
env.set('LUA_CPATH', ';'.join(lua_cpatterns), separator=';')
def setup_dependent_run_environment(self, env, dependent_spec):
@ -136,6 +139,7 @@ def setup_dependent_run_environment(self, env, dependent_spec):
if dependent_spec.package.extends(self.spec):
env.prepend_path('LUA_PATH', ';'.join(lua_patterns), separator=';')
if '+shared' in spec:
env.prepend_path('LUA_CPATH', ';'.join(lua_cpatterns),
separator=';')
@ -156,6 +160,7 @@ def setup_run_environment(self, env):
'LUA_PATH',
os.path.join(self.spec.prefix, self.lua_lib_dir, '?', 'init.lua'),
separator=';')
if '+shared' in self.spec:
env.prepend_path(
'LUA_CPATH',
os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),