build: namespace the generated headers with `zephyr/`
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.
Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.
Updated the includes path of in-tree sources accordingly.
Most of the changes here are scripted, check the PR for more
info.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
diff --git a/lib/libc/arcmwdt/libc-hooks.c b/lib/libc/arcmwdt/libc-hooks.c
index babf24e..8e094d2 100644
--- a/lib/libc/arcmwdt/libc-hooks.c
+++ b/lib/libc/arcmwdt/libc-hooks.c
@@ -59,7 +59,7 @@
K_OOPS(K_SYSCALL_MEMORY_READ(buf, nbytes));
return z_impl_zephyr_write_stdout(buf, nbytes);
}
-#include <syscalls/zephyr_write_stdout_mrsh.c>
+#include <zephyr/syscalls/zephyr_write_stdout_mrsh.c>
#endif
#ifndef CONFIG_POSIX_API
diff --git a/lib/libc/minimal/source/stdout/stdout_console.c b/lib/libc/minimal/source/stdout/stdout_console.c
index 33ea7ff..e3d5a37 100644
--- a/lib/libc/minimal/source/stdout/stdout_console.c
+++ b/lib/libc/minimal/source/stdout/stdout_console.c
@@ -35,7 +35,7 @@
{
return z_impl_zephyr_fputc(c, stream);
}
-#include <syscalls/zephyr_fputc_mrsh.c>
+#include <zephyr/syscalls/zephyr_fputc_mrsh.c>
#endif
int fputc(int c, FILE *stream)
@@ -105,7 +105,7 @@
return z_impl_zephyr_fwrite((const void *ZRESTRICT)ptr, size,
nitems, (FILE *ZRESTRICT)stream);
}
-#include <syscalls/zephyr_fwrite_mrsh.c>
+#include <zephyr/syscalls/zephyr_fwrite_mrsh.c>
#endif
size_t fwrite(const void *ZRESTRICT ptr, size_t size, size_t nitems,
diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c
index 5e8629d..75a2859 100644
--- a/lib/libc/newlib/libc-hooks.c
+++ b/lib/libc/newlib/libc-hooks.c
@@ -184,7 +184,7 @@
K_OOPS(K_SYSCALL_MEMORY_WRITE(buf, nbytes));
return z_impl_zephyr_read_stdin((char *)buf, nbytes);
}
-#include <syscalls/zephyr_read_stdin_mrsh.c>
+#include <zephyr/syscalls/zephyr_read_stdin_mrsh.c>
#endif
int z_impl_zephyr_write_stdout(const void *buffer, int nbytes)
@@ -207,7 +207,7 @@
K_OOPS(K_SYSCALL_MEMORY_READ(buf, nbytes));
return z_impl_zephyr_write_stdout((const void *)buf, nbytes);
}
-#include <syscalls/zephyr_write_stdout_mrsh.c>
+#include <zephyr/syscalls/zephyr_write_stdout_mrsh.c>
#endif
#ifndef CONFIG_POSIX_API
diff --git a/lib/libc/picolibc/libc-hooks.c b/lib/libc/picolibc/libc-hooks.c
index e7539bc..cefb0d4 100644
--- a/lib/libc/picolibc/libc-hooks.c
+++ b/lib/libc/picolibc/libc-hooks.c
@@ -39,7 +39,7 @@
{
return z_impl_zephyr_fputc(c, stream);
}
-#include <syscalls/zephyr_fputc_mrsh.c>
+#include <zephyr/syscalls/zephyr_fputc_mrsh.c>
#endif
static int picolibc_put(char a, FILE *f)