diff --git a/bin/BuildSystem/AutoToolsBuildSystem.py b/bin/BuildSystem/AutoToolsBuildSystem.py --- a/bin/BuildSystem/AutoToolsBuildSystem.py +++ b/bin/BuildSystem/AutoToolsBuildSystem.py @@ -48,14 +48,15 @@ if self.subinfo.options.configure.bootstrap and os.path.exists(autogen): self.shell.execute(self.sourceDir(), autogen) elif self.subinfo.options.configure.autoreconf: - includes = [] - for i in [f"{CraftCore.standardDirs.craftRoot()}/dev-utils/cmake/share", CraftCore.standardDirs.locations.data]: - aclocalDir = self.shell.toNativePath(i) + "/aclocal" - if os.path.isdir(aclocalDir): - includes += [f" -I'{aclocalDir}'"] - - args = "".join(includes) - self.shell.execute(self.sourceDir(), "autoreconf", self.subinfo.options.configure.autoreconfArgs + args) + includesArgs = "" + if self.subinfo.options.configure.useDefaultAutoreconfIncludes: + includes = [] + for i in [f"{CraftCore.standardDirs.craftRoot()}/dev-utils/cmake/share", CraftCore.standardDirs.locations.data]: + aclocalDir = self.shell.toNativePath(i) + "/aclocal" + if os.path.isdir(aclocalDir): + includes += [f" -I'{aclocalDir}'"] + includesArgs = "".join(includes) + self.shell.execute(self.sourceDir(), "autoreconf", self.subinfo.options.configure.autoreconfArgs + includesArgs) if not self.subinfo.options.useShadowBuild: ret = self.shell.execute(self.sourceDir(), configure, self.configureOptions(self)) diff --git a/bin/options.py b/bin/options.py --- a/bin/options.py +++ b/bin/options.py @@ -317,6 +317,10 @@ ## optional arguments for autoreconf self.autoreconfArgs = "-vfi" + ## Whether to add the default -I flags when running autoreconf + ## This is needed since some packages fail if we pass -I to autoreconf + self.useDefaultAutoreconfIncludes = True + # do not use default include path self.noDefaultInclude = False