Autotools: setup configure command if it did not exist

since 'configure' file does not exist before 'autoreconf' is
executed first time, it is possible that initially 'configure'
does not exist. Therefore command need to be recalculated again
when step is about to be executed

Change-Id: I7eeeaefd6d41adb2bcb247e35a3de5862899c8db
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Petar Perisin
2021-12-17 11:05:21 +01:00
parent 7d92375b2f
commit 32ed2df2f9

View File

@@ -86,6 +86,8 @@ public:
private: private:
void doRun() final; void doRun() final;
CommandLine getCommandLine(const QString &arguments);
bool m_runConfigure = false; bool m_runConfigure = false;
}; };
@@ -105,11 +107,7 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id)
setWorkingDirectoryProvider([this] { return project()->projectDirectory(); }); setWorkingDirectoryProvider([this] { return project()->projectDirectory(); });
setCommandLineProvider([this, arguments] { setCommandLineProvider([this, arguments] {
BuildConfiguration *bc = buildConfiguration(); return getCommandLine(arguments->value());
return CommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
arguments->value(),
CommandLine::Raw});
}); });
setSummaryUpdater([this] { setSummaryUpdater([this] {
@@ -120,6 +118,15 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl, Id id)
}); });
} }
CommandLine ConfigureStep::getCommandLine(const QString &arguments)
{
BuildConfiguration *bc = buildConfiguration();
return CommandLine({FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure"),
arguments,
CommandLine::Raw});
}
void ConfigureStep::doRun() void ConfigureStep::doRun()
{ {
//Check whether we need to run configure //Check whether we need to run configure
@@ -138,6 +145,12 @@ void ConfigureStep::doRun()
return; return;
} }
ProcessParameters *param = processParameters();
if (!param->effectiveCommand().exists()) {
param->setCommandLine(getCommandLine(param->command().arguments()));
setSummaryText(param->summaryInWorkdir(displayName()));
}
m_runConfigure = false; m_runConfigure = false;
AbstractProcessStep::doRun(); AbstractProcessStep::doRun();
} }