autoreconf, don't find tools
This commit is contained in:
parent
6bc0c4aa3b
commit
5bf5c7445d
1 changed files with 45 additions and 42 deletions
|
|
@ -225,6 +225,9 @@ proc configure*(path, check: string, flags = "") =
|
||||||
## If a `configure` script is not present and an `autogen.sh` script
|
## If a `configure` script is not present and an `autogen.sh` script
|
||||||
## is present, it will be run before attempting `configure`.
|
## is present, it will be run before attempting `configure`.
|
||||||
##
|
##
|
||||||
|
## Next, if `configure.ac` or `configure.in` exist, `autoreconf` will
|
||||||
|
## be executed.
|
||||||
|
##
|
||||||
## `check` is a file that will be generated by the `configure` command.
|
## `check` is a file that will be generated by the `configure` command.
|
||||||
## This is required to prevent configure from running on every build. It
|
## This is required to prevent configure from running on every build. It
|
||||||
## is relative to the `path` and should not be an absolute path.
|
## is relative to the `path` and should not be an absolute path.
|
||||||
|
|
@ -236,11 +239,20 @@ proc configure*(path, check: string, flags = "") =
|
||||||
echo "# Configuring " & path
|
echo "# Configuring " & path
|
||||||
|
|
||||||
if not fileExists(path / "configure"):
|
if not fileExists(path / "configure"):
|
||||||
for i in @[path / "autogen.sh", path / "build" / "autogen.sh"]:
|
for i in @["autogen.sh", "build" / "autogen.sh"]:
|
||||||
if fileExists(i):
|
if fileExists(path / i):
|
||||||
echo "# Running autogen.sh"
|
echo "# Running autogen.sh"
|
||||||
|
|
||||||
discard execAction(&"cd {i.parentDir().quoteShell} && bash autogen.sh")
|
echo execAction(&"cd {(path / i).parentDir().quoteShell} && bash autogen.sh")
|
||||||
|
|
||||||
|
break
|
||||||
|
|
||||||
|
if not fileExists(path / "configure"):
|
||||||
|
for i in @["configure.ac", "configure.in"]:
|
||||||
|
if fileExists(path / i):
|
||||||
|
echo "# Running autoreconf"
|
||||||
|
|
||||||
|
echo execAction(&"cd {path.quoteShell} && autoreconf -fi")
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
@ -438,54 +450,45 @@ proc buildLibrary(lname, outdir, conFlags, cmakeFlags, makeFlags: string): strin
|
||||||
cmakeDepStr = ""
|
cmakeDepStr = ""
|
||||||
lpath = findFile(re(lname), outdir)
|
lpath = findFile(re(lname), outdir)
|
||||||
makeFlagsProc = &"-j {getNumProcs()} {makeFlags}"
|
makeFlagsProc = &"-j {getNumProcs()} {makeFlags}"
|
||||||
|
made = false
|
||||||
|
makePath = outdir
|
||||||
|
|
||||||
if lpath.len != 0:
|
if lpath.len != 0:
|
||||||
return lpath
|
return lpath
|
||||||
|
|
||||||
if fileExists(outdir / "CMakeLists.txt"):
|
if not fileExists(outdir / "Makefile"):
|
||||||
if findExe("cmake").len != 0:
|
if fileExists(outdir / "CMakeLists.txt"):
|
||||||
var
|
if findExe("cmake").len != 0:
|
||||||
gen = ""
|
var
|
||||||
when defined(windows):
|
gen = ""
|
||||||
if findExe("sh").len != 0:
|
when defined(windows):
|
||||||
gen = "MSYS Makefiles"
|
if findExe("sh").len != 0:
|
||||||
else:
|
gen = "MSYS Makefiles"
|
||||||
gen = "MinGW Makefiles"
|
|
||||||
else:
|
|
||||||
gen = "Unix Makefiles"
|
|
||||||
cmake(outdir / "build", "Makefile", &".. -G {gen.quoteShell} {cmakeFlags}")
|
|
||||||
cmakeDeps = true
|
|
||||||
make(outdir / "build", re(lname), makeFlagsProc)
|
|
||||||
else:
|
|
||||||
cmakeDepStr &= "cmake executable missing"
|
|
||||||
|
|
||||||
template cfgCommon() {.dirty.} =
|
|
||||||
configure(outdir, "Makefile", conFlags)
|
|
||||||
conDeps = true
|
|
||||||
make(outdir, re(lname), makeFlagsProc)
|
|
||||||
|
|
||||||
if not cmakeDeps:
|
|
||||||
if not fileExists(outdir / "configure"):
|
|
||||||
if fileExists(outdir / "autogen.sh") or fileExists(outdir / "build" / "autogen.sh"):
|
|
||||||
if findExe("aclocal").len != 0:
|
|
||||||
if findExe("autoconf").len != 0:
|
|
||||||
if findExe("libtoolize").len != 0 or findExe("glibtoolize").len != 0:
|
|
||||||
if findExe("autopoint").len != 0:
|
|
||||||
cfgCommon()
|
|
||||||
else:
|
|
||||||
conDepStr &= "autopoint executable missing"
|
|
||||||
else:
|
|
||||||
conDepStr &= "libtoolize executable missing"
|
|
||||||
else:
|
else:
|
||||||
conDepStr &= "autoconf executable missing"
|
gen = "MinGW Makefiles"
|
||||||
else:
|
else:
|
||||||
conDepStr &= "aclocal executable missing"
|
gen = "Unix Makefiles"
|
||||||
else:
|
cmake(outdir / "build", "Makefile", &".. -G {gen.quoteShell} {cmakeFlags}")
|
||||||
|
cmakeDeps = true
|
||||||
|
makePath = outdir / "build"
|
||||||
|
else:
|
||||||
|
cmakeDepStr &= "cmake executable missing"
|
||||||
|
|
||||||
|
if not cmakeDeps:
|
||||||
if findExe("bash").len != 0:
|
if findExe("bash").len != 0:
|
||||||
cfgCommon()
|
for file in @["configure", "configure.ac", "configure.in", "autogen.sh", "build/autogen.sh"]:
|
||||||
|
if fileExists(outdir / file):
|
||||||
|
configure(outdir, "Makefile", conFlags)
|
||||||
|
conDeps = true
|
||||||
|
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
conDepStr &= "bash executable missing"
|
conDepStr &= "bash executable missing"
|
||||||
|
|
||||||
|
if fileExists(makePath / "Makefile"):
|
||||||
|
make(makePath, re(lname), makeFlagsProc)
|
||||||
|
made = true
|
||||||
|
|
||||||
var
|
var
|
||||||
error = ""
|
error = ""
|
||||||
if not cmakeDeps and cmakeDepStr.len != 0:
|
if not cmakeDeps and cmakeDepStr.len != 0:
|
||||||
|
|
@ -494,7 +497,7 @@ proc buildLibrary(lname, outdir, conFlags, cmakeFlags, makeFlags: string): strin
|
||||||
error &= &"configure capable but {conDepStr}\n"
|
error &= &"configure capable but {conDepStr}\n"
|
||||||
if error.len == 0:
|
if error.len == 0:
|
||||||
error = "No build files found in " & outdir
|
error = "No build files found in " & outdir
|
||||||
doAssert cmakeDeps or conDeps, &"\n# Build configuration failed - {error}\n"
|
doAssert cmakeDeps or conDeps or made, &"\n# Build configuration failed - {error}\n"
|
||||||
|
|
||||||
result = findFile(re(lname), outdir)
|
result = findFile(re(lname), outdir)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue