mirror of
https://git.yoctoproject.org/poky
synced 2026-05-22 17:27:54 +02:00
cpio is not yet buildable with C23 standard which is default with GCC 15, therefore ensure to apply needed bandage to keep it compiling in C17 mode even with GCC 15 (From OE-Core rev: 0c637099887f1be421c8e1203f99631a1e040150) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
43 lines
1.7 KiB
Python
43 lines
1.7 KiB
Python
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
import os
|
|
import tempfile
|
|
import subprocess
|
|
import unittest
|
|
|
|
from oeqa.sdk.case import OESDKTestCase
|
|
from oeqa.utils.subprocesstweak import errors_have_output
|
|
errors_have_output()
|
|
|
|
class AutotoolsTest(OESDKTestCase):
|
|
"""
|
|
Check that autotools will cross-compile correctly.
|
|
"""
|
|
def setUp(self):
|
|
libc = self.td.get("TCLIBC")
|
|
if libc in [ 'newlib' ]:
|
|
raise unittest.SkipTest("AutotoolsTest class: SDK doesn't contain a supported C library")
|
|
|
|
def test_cpio(self):
|
|
with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir:
|
|
tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz")
|
|
|
|
dirs = {}
|
|
dirs["source"] = os.path.join(testdir, "cpio-2.15")
|
|
dirs["build"] = os.path.join(testdir, "build")
|
|
dirs["install"] = os.path.join(testdir, "install")
|
|
|
|
subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT)
|
|
self.assertTrue(os.path.isdir(dirs["source"]))
|
|
os.makedirs(dirs["build"])
|
|
|
|
self._run("cd {build} && {source}/configure CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' $CONFIGURE_FLAGS".format(**dirs))
|
|
self._run("cd {build} && make CFLAGS='-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration' -j".format(**dirs))
|
|
self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
|
|
|
|
self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio"))
|