Skip to content

Commit 3913056

Browse files
committed
configure: Fix handling of directories with compats only source lists
Reviewer: Jeroen Ketema Signed-off-by: Jan Vesely <[email protected]> llvm-svn: 315018
1 parent 6ae8826 commit 3913056

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libclc/configure.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def llvm_config(args):
185185

186186
incdirs = filter(os.path.isdir,
187187
[os.path.join(srcdir, subdir, 'include') for subdir in subdirs])
188-
libdirs = filter(lambda d: os.path.isfile(os.path.join(d, 'SOURCES')),
188+
libdirs = filter(lambda d: os.path.isfile(os.path.join(d, 'SOURCES')) or
189+
os.path.isfile(os.path.join(d, 'SOURCES_' + llvm_string_version)),
189190
[os.path.join(srcdir, subdir, 'lib') for subdir in subdirs])
190191

191192
# The above are iterables in python3 but we might use them multiple times
@@ -218,7 +219,8 @@ def llvm_config(args):
218219

219220
for libdir in libdirs:
220221
subdir_list_file = os.path.join(libdir, 'SOURCES')
221-
manifest_deps.add(subdir_list_file)
222+
if os.path.exists(subdir_list_file):
223+
manifest_deps.add(subdir_list_file)
222224
override_list_file = os.path.join(libdir, 'OVERRIDES')
223225
compat_list_file = os.path.join(libdir,
224226
'SOURCES_' + llvm_string_version)
@@ -227,6 +229,7 @@ def llvm_config(args):
227229

228230
# Build compat list
229231
if os.path.exists(compat_list_file):
232+
manifest_deps.add(compat_list_file)
230233
for compat in open(compat_list_file).readlines():
231234
compat = compat.rstrip()
232235
compats.append(compat)
@@ -243,7 +246,8 @@ def llvm_config(args):
243246
override = override.rstrip()
244247
sources_seen.add(override)
245248

246-
for src in open(subdir_list_file).readlines() + compats:
249+
files = open(subdir_list_file).readlines() if os.path.exists(subdir_list_file) else []
250+
for src in files + compats:
247251
src = src.rstrip()
248252
if src not in sources_seen:
249253
sources_seen.add(src)

0 commit comments

Comments
 (0)