build: namespace autoconf.h with zephyr/

Namespace the generated `autoconf.h` file with `zephyr/`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-01-31 11:12:46 +08:00 committed by Henrik Brix Andersen
commit 0dac6c132b
9 changed files with 11 additions and 10 deletions

View file

@ -46,7 +46,7 @@
# CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS. # CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS.
# #
#3. The amendment function appends the defines from #3. The amendment function appends the defines from
# ${CMAKE_BINARY_DIR}/zephyr/include/generated/autoconf.h to # ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/autoconf.h to
# CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS. # CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.
# #
function(eclipse_cdt4_generator_amendment _param_defs) function(eclipse_cdt4_generator_amendment _param_defs)

View file

@ -9,7 +9,7 @@ include(python)
# <build>/zephyr/include/generated/autoconf.h. # <build>/zephyr/include/generated/autoconf.h.
# A project may request a custom location by setting AUTOCONF_H explicitly before # A project may request a custom location by setting AUTOCONF_H explicitly before
# calling 'find_package(Zephyr)' or loading this module. # calling 'find_package(Zephyr)' or loading this module.
set_ifndef(AUTOCONF_H ${PROJECT_BINARY_DIR}/include/generated/autoconf.h) set_ifndef(AUTOCONF_H ${PROJECT_BINARY_DIR}/include/generated/zephyr/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes # Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H})

View file

@ -29,6 +29,7 @@ Build System
* - Affected header files * - Affected header files
* - ``app_version.h`` * - ``app_version.h``
* - ``autoconf.h``
* - ``cmake_intdef.h`` * - ``cmake_intdef.h``
* - ``core-isa-dM.h`` * - ``core-isa-dM.h``
* - ``devicetree_generated.h`` * - ``devicetree_generated.h``

View file

@ -6,7 +6,7 @@
#include <zephyr/shell/shell.h> #include <zephyr/shell/shell.h>
#include <lvgl.h> #include <lvgl.h>
#include <autoconf.h> #include <zephyr/autoconf.h>
#ifdef CONFIG_LV_Z_MEM_POOL_SYS_HEAP #ifdef CONFIG_LV_Z_MEM_POOL_SYS_HEAP
#include "lvgl_mem.h" #include "lvgl_mem.h"

View file

@ -7,7 +7,7 @@
#ifndef __RTE_DEVICE_H #ifndef __RTE_DEVICE_H
#define __RTE_DEVICE_H #define __RTE_DEVICE_H
#include <autoconf.h> #include <zephyr/autoconf.h>
/* ARRAY_SIZE causes a conflict as it is defined both by TF-M and indirectly by devicetree.h */ /* ARRAY_SIZE causes a conflict as it is defined both by TF-M and indirectly by devicetree.h */
#undef ARRAY_SIZE #undef ARRAY_SIZE

View file

@ -7,7 +7,7 @@
#ifndef DEVICE_CFG_H__ #ifndef DEVICE_CFG_H__
#define DEVICE_CFG_H__ #define DEVICE_CFG_H__
#include <autoconf.h> #include <zephyr/autoconf.h>
/* ARRAY_SIZE causes a conflict as it is defined both by TF-M and indirectly by devicetree.h */ /* ARRAY_SIZE causes a conflict as it is defined both by TF-M and indirectly by devicetree.h */
#undef ARRAY_SIZE #undef ARRAY_SIZE

View file

@ -1419,7 +1419,7 @@ class Kconfig(object):
def write_autoconf(self, filename=None, header=None): def write_autoconf(self, filename=None, header=None):
r""" r"""
Writes out symbol values as a C header file, matching the format used Writes out symbol values as a C header file, matching the format used
by include/generated/autoconf.h in the kernel. by include/generated/zephyr/autoconf.h in the kernel.
The ordering of the #defines matches the one generated by The ordering of the #defines matches the one generated by
write_config(). The order in the C implementation depends on the hash write_config(). The order in the C implementation depends on the hash
@ -1434,7 +1434,7 @@ class Kconfig(object):
Path to write header to. Path to write header to.
If None (the default), the path in the environment variable If None (the default), the path in the environment variable
KCONFIG_AUTOHEADER is used if set, and "include/generated/autoconf.h" KCONFIG_AUTOHEADER is used if set, and "include/generated/zephyr/autoconf.h"
otherwise. This is compatible with the C tools. otherwise. This is compatible with the C tools.
header (default: None): header (default: None):
@ -1453,7 +1453,7 @@ class Kconfig(object):
""" """
if filename is None: if filename is None:
filename = os.getenv("KCONFIG_AUTOHEADER", filename = os.getenv("KCONFIG_AUTOHEADER",
"include/generated/autoconf.h") "include/generated/zephyr/autoconf.h")
if self._write_if_changed(filename, self._autoconf_contents(header)): if self._write_if_changed(filename, self._autoconf_contents(header)):
return "Kconfig header saved to '{}'".format(filename) return "Kconfig header saved to '{}'".format(filename)

View file

@ -456,7 +456,7 @@ class RimageSigner(Signer):
preproc_cmd += ['-I', str(self.sof_src_dir / 'src')] preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
preproc_cmd += ['-imacros', preproc_cmd += ['-imacros',
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'autoconf.h')] str(pathlib.Path('zephyr') / 'include' / 'generated' / 'zephyr' / 'autoconf.h')]
preproc_cmd += ['-o', str(subdir / 'rimage_config.toml')] preproc_cmd += ['-o', str(subdir / 'rimage_config.toml')]
self.command.inf(quote_sh_list(preproc_cmd)) self.command.inf(quote_sh_list(preproc_cmd))
subprocess.run(preproc_cmd, check=True, cwd=self.build_dir) subprocess.run(preproc_cmd, check=True, cwd=self.build_dir)

View file

@ -5,7 +5,7 @@
#pragma once #pragma once
#include <autoconf.h> #include <zephyr/autoconf.h>
#define IRAM_BASE (CONFIG_RT595_ADSP_TEXT_MEM_ADDR) #define IRAM_BASE (CONFIG_RT595_ADSP_TEXT_MEM_ADDR)
#define IRAM_SIZE (CONFIG_RT595_ADSP_TEXT_MEM_SIZE) #define IRAM_SIZE (CONFIG_RT595_ADSP_TEXT_MEM_SIZE)