Skip to content

Commit

Permalink
Fix Makefile path for Lua 5.1.5
Browse files Browse the repository at this point in the history
The Lua GitHub repository doesn't have the 5.1.5 tag, and the code
downloaded from https://www.lua.org/ftp has different directory layout.
  • Loading branch information
xxyzz committed Apr 12, 2023
1 parent 64222f7 commit ea51be0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,17 @@ def use_bundled_lua(path, macros):

print('Using bundled Lua in %s' % libname)

# Parse .o files from 'makefile'
makefile = os.path.join(path, "makefile")
# Find Makefile in subrepos and downloaded sources.
for makefile_path in [os.path.join("src", "makefile"), os.path.join("src", "Makefile"), "makefile", "Makefile"]:
makefile = os.path.join(path, makefile_path)
if os.path.exists(makefile):
break
else:
raise RuntimeError("Makefile not found in " + path)

# Parse .o files from Makefile
match_var = re.compile(r"(CORE|AUX|LIB|ALL)_O\s*=(.*)").match
is_indented = re.compile(r"\s+").match

obj_files = []
continuing = False
with open(makefile) as f:
Expand Down Expand Up @@ -300,7 +306,7 @@ def use_bundled_lua(path, macros):
os.path.splitext(obj_file)[0] + '.c' if obj_file != 'lj_vm.o' else 'lj_vm.s'
for obj_file in obj_files
]
if 'lua52' in path:
if libname == 'lua52':
lua_sources.extend(['lbitlib.c', 'lcorolib.c', 'lctype.c'])
src_dir = os.path.dirname(makefile)
ext_libraries = [
Expand Down

0 comments on commit ea51be0

Please sign in to comment.