Skip to content

Commit 4ac3e55

Browse files
author
Kevin Pyle
committed
Build: generate-config-h.py: reuse plugindir from Makefile
The Makefile already computes the gcc plugin directory. Reuse that instead of computing it again.
1 parent 600060c commit 4ac3e55

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ clean:
129129
$(RM) -r docs/_build
130130

131131
autogenerated-config.h: $(addprefix $(srcdir),generate-config-h.py configbuilder.py)
132-
$(PYTHON) $< -o $@ --gcc=$(CC)
132+
$(PYTHON) $< -o $@ --gcc="$(CC)" --plugindir="$(GCCPLUGINS_DIR)"
133133

134134
autogenerated-%.txt: $(srcdir)%.txt.in
135135
$(CPP) $(CPPFLAGS) -x c-header $^ -o $@

generate-config-h.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ def __init__(self, argv):
2525
import argparse
2626
parser = argparse.ArgumentParser()
2727
parser.add_argument('--gcc')
28+
parser.add_argument('--plugindir')
2829
args, argv = parser.parse_known_args(argv)
2930
ConfigBuilder.__init__(self, argv)
3031
self.gcc = args.gcc
32+
self.plugindir = args.plugindir
3133

3234
def main(self):
3335
prefix = 'GCC_PYTHON_PLUGIN_CONFIG_'
34-
plugindir = self.capture_shell_output('locating plugin directory for %s' % self.gcc,
36+
if self.plugindir:
37+
plugindir = self.plugindir
38+
else:
39+
plugindir = self.capture_shell_output('locating plugin directory for %s' % self.gcc,
3540
'%s --print-file-name=plugin' % self.gcc).strip()
3641
extraargs = ['-I%s' % os.path.join(plugindir, 'include')]
3742
self.test_for_mandatory_c_header('gcc-plugin.h', extraargs)

0 commit comments

Comments
 (0)