aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newlib/Makefile.am8
-rwxr-xr-xnewlib/configure2
-rw-r--r--newlib/configure.host12
-rw-r--r--newlib/libc/sys/esp/include/sys/dirent.h49
4 files changed, 63 insertions, 8 deletions
diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 87a7f85..00088b6 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -312,10 +312,10 @@ install-data-local: install-toollibLIBRARIES install-multi $(INSTALL_DATA_LOCAL)
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
else true; fi ; \
done ; \
- for i in $(srcdir)/libc/machine/$(machine_dir)/include/*.h; do \
- if [ -f $$i ]; then \
- $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \
- else true; fi ; \
+ for i in $(call rwildcard,$(srcdir)/libc/machine/$(machine_dir)/include/,*.h); do \
+ f=`echo $$i | sed s:^$(srcdir)/libc/machine/$(machine_dir)/::`; \
+ $(MKDIR_P) $(DESTDIR)$(tooldir)/`dirname $$f`; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/`dirname $$f`; \
done ; \
for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
if [ -f $$i ]; then \
diff --git a/newlib/configure b/newlib/configure
index cb47478..e7158c0 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -6263,7 +6263,7 @@ else
/* end confdefs.h. */
#define _LIBM
// targ-include does not exist yet, use relative path
-#include "../sys/xtensa/include/xtensa/config/core-isa.h"
+#include "../machine/xtensa/include/xtensa/config/core-isa.h"
#if (!XCHAL_HAVE_FP_SQRT)
# error "Have not XCHAL_HAVE_FP_SQRT"
#endif
diff --git a/newlib/configure.host b/newlib/configure.host
index a8a73f9..ff2e512 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -446,6 +446,15 @@ case "${host}" in
sys_dir=tirtos
have_crt0="no"
;;
+ *-esp-*)
+ sys_dir=esp
+ have_crt0="no"
+ posix_dir=posix
+ newlib_cflags="${newlib_cflags} -D_NO_GLOB -D_NO_EXECVE -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT"
+ newlib_cflags="${newlib_cflags} -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -D_NO_POSIX_SPAWN"
+ newlib_cflags="${newlib_cflags} -DHAVE_FCNTL -DHAVE_BLKSIZE -DHAVE_OPENDIR -DHAVE_RENAME"
+ newlib_cflags="${newlib_cflags} -DGETREENT_PROVIDED -DSIGNAL_PROVIDED"
+ ;;
a29k-*-*)
sys_dir=a29khif
signal_dir=
@@ -579,9 +588,6 @@ case "${host}" in
w65-*-*)
sys_dir=w65
;;
- xtensa*-*-*)
- sys_dir=xtensa
- ;;
z8k-*-coff)
sys_dir=z8ksim
;;
diff --git a/newlib/libc/sys/esp/include/sys/dirent.h b/newlib/libc/sys/esp/include/sys/dirent.h
new file mode 100644
index 0000000..0e0c2f5
--- /dev/null
+++ b/newlib/libc/sys/esp/include/sys/dirent.h
@@ -0,0 +1,49 @@
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _INO_T_DECLARED
+typedef __ino_t ino_t;
+#define _INO_T_DECLARED
+#endif
+
+struct dirent {
+ ino_t d_ino; /* file number */
+ __uint8_t d_type; /* file type, see below */
+ char d_name[255 + 1]; /* zero-terminated file name */
+};
+
+typedef struct {
+ __uint16_t dd_vfs_idx; /*!< VFS index, not to be used by applications */
+ __uint16_t dd_rsv; /*!< field reserved for future extension */
+ /* remaining fields are defined by VFS implementation */
+} DIR;
+
+#if __BSD_VISIBLE
+#define MAXNAMLEN 255
+
+/* File types */
+#define DT_UNKNOWN 0
+#define DT_REG 1
+#define DT_DIR 2
+
+/* File types which are not defined for ESP.
+ * But must be present to build libstd++ */
+#define DT_CHR 4
+#define DT_BLK 6
+#define DT_FIFO 8
+#define DT_LNK 10
+#define DT_SOCK 12
+#define DT_WHT 14
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif