net: fix checksum offload for outer IPv4
[dpdk.git] / buildtools / gen-pmdinfo-cfile.py
1 #!/usr/bin/env python3
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright (c) 2020 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
4
5 import os
6 import subprocess
7 import sys
8 import tempfile
9
10 _, tmp_root, ar, archive, output, *pmdinfogen = sys.argv
11 with tempfile.TemporaryDirectory(dir=tmp_root) as temp:
12     run_ar = lambda command: subprocess.run(
13         [ar, command, os.path.abspath(archive)],
14         stdout=subprocess.PIPE, check=True, cwd=temp
15     )
16     # Don't use "ar p", because its output is corrupted on Windows.
17     run_ar("x")
18     names = run_ar("t").stdout.decode().splitlines()
19     paths = [os.path.join(temp, name) for name in names]
20     subprocess.run(pmdinfogen + paths + [output], check=True)