mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
docs: fix generation of toolchain links
Closes https://github.com/espressif/esp-idf/issues/3609
This commit is contained in:
parent
d0ed0d3f9c
commit
517c61a4ec
@ -9,6 +9,15 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
PlatformInfo = namedtuple("PlatformInfo", [
|
||||||
|
"platform_name",
|
||||||
|
"platform_archive_suffix",
|
||||||
|
"extension",
|
||||||
|
"unpack_cmd",
|
||||||
|
"unpack_code"
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -44,35 +53,33 @@ def main():
|
|||||||
scratch_build_code_linux_macos = """
|
scratch_build_code_linux_macos = """
|
||||||
::
|
::
|
||||||
|
|
||||||
git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
|
git clone https://github.com/espressif/crosstool-NG.git
|
||||||
cd crosstool-NG
|
cd crosstool-NG
|
||||||
|
git checkout {}
|
||||||
./bootstrap && ./configure --enable-local && make install
|
./bootstrap && ./configure --enable-local && make install
|
||||||
"""
|
"""
|
||||||
|
|
||||||
platform_info = [["linux64", "tar.gz", "z", unpack_code_linux_macos],
|
platform_info = [
|
||||||
["linux32", "tar.gz", "z", unpack_code_linux_macos],
|
PlatformInfo("linux64", "linux-amd64", "tar.gz", "z", unpack_code_linux_macos),
|
||||||
["osx", "tar.gz", "z", unpack_code_linux_macos],
|
PlatformInfo("linux32", "linux-i686","tar.gz", "z", unpack_code_linux_macos),
|
||||||
["win32", "zip", None, None]]
|
PlatformInfo("osx", "macos", "tar.gz", "z", unpack_code_linux_macos),
|
||||||
|
PlatformInfo("win32", "win32", "zip", None, None)
|
||||||
|
]
|
||||||
|
|
||||||
with open(os.path.join(out_dir, 'download-links.inc'), "w") as links_file:
|
with open(os.path.join(out_dir, 'download-links.inc'), "w") as links_file:
|
||||||
for p in platform_info:
|
for p in platform_info:
|
||||||
platform_name = p[0]
|
archive_name = 'xtensa-esp32-elf-gcc{}-{}-{}.{}'.format(
|
||||||
extension = p[1]
|
gcc_version.replace('.', '_'), toolchain_desc, p.platform_archive_suffix, p.extension)
|
||||||
unpack_cmd = p[2]
|
|
||||||
unpack_code = p[3]
|
|
||||||
|
|
||||||
archive_name = 'xtensa-esp32-elf-{}-{}-{}.{}'.format(
|
|
||||||
platform_name, toolchain_desc, gcc_version, extension)
|
|
||||||
|
|
||||||
print('.. |download_link_{}| replace:: {}{}'.format(
|
print('.. |download_link_{}| replace:: {}{}'.format(
|
||||||
platform_name, base_url, archive_name), file=links_file)
|
p.platform_name, base_url, archive_name), file=links_file)
|
||||||
|
|
||||||
if unpack_code is not None:
|
if p.unpack_code is not None:
|
||||||
with open(os.path.join(out_dir, 'unpack-code-%s.inc' % platform_name), "w") as f:
|
with open(os.path.join(out_dir, 'unpack-code-%s.inc' % p.platform_name), "w") as f:
|
||||||
print(unpack_code.format(unpack_cmd, archive_name), file=f)
|
print(p.unpack_code.format(p.unpack_cmd, archive_name), file=f)
|
||||||
|
|
||||||
with open(os.path.join(out_dir, 'scratch-build-code.inc'), "w") as code_file:
|
with open(os.path.join(out_dir, 'scratch-build-code.inc'), "w") as code_file:
|
||||||
print(scratch_build_code_linux_macos, file=code_file)
|
print(scratch_build_code_linux_macos.format(toolchain_desc), file=code_file)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user