diff --git a/setup.py b/setup.py index 51106692d1a..c24d7bbb8ab 100755 --- a/setup.py +++ b/setup.py @@ -63,6 +63,9 @@ def _add_directory(path, subdir, where=None): else: _dbg('Inserting path %s', subdir) path.insert(where, subdir) + elif subdir in path and where is not None: + path.remove(subdir) + path.insert(where, subdir) def _find_include_file(self, include): @@ -462,6 +465,10 @@ def build_extensions(self): # Add the directory to the include path so we can include # rather than having to cope with the versioned # include path + # FIXME (melvyn-sopacua): + # At this point it's possible that best_path is already in + # self.compiler.include_dirs. Should investigate how that is + # possible. _add_directory(self.compiler.include_dirs, best_path, 0) feature.jpeg2000 = 'openjp2' feature.openjpeg_version = '.'.join(str(x) for x in best_version)