Skip to content

Commit 6c044d6

Browse files
committed
Rename MG_ARCH_NEWLIB -> MG_ARCH_ARM_GCC
1 parent 8bfd0c2 commit 6c044d6

36 files changed

Lines changed: 67 additions & 63 deletions

File tree

mongoose.h

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
#define MG_ARCH_FREERTOS 5 // FreeRTOS
3636
#define MG_ARCH_THREADX 6 // Eclipse ThreadX (former MS Azure RTOS)
3737
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
38-
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
38+
#define MG_ARCH_ARMGCC 8 // Plain ARM GCC
3939
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
4040
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
4141
#define MG_ARCH_PICOSDK 11 // Raspberry Pi Pico-SDK (RP2040, RP2350)
@@ -44,6 +44,8 @@ extern "C" {
4444
#define MG_ARCH_RTTHREAD 14 // RT-Thread RTOS
4545
#define MG_ARCH_ARMCGT 15 // Texas Semi ARM-CGT
4646

47+
#define MG_ARCH_NEWLIB MG_ARCH_ARMGCC // Alias, deprecate in 2025
48+
4749
#if !defined(MG_ARCH)
4850
#if defined(__unix__) || defined(__APPLE__)
4951
#define MG_ARCH MG_ARCH_UNIX
@@ -97,6 +99,29 @@ extern "C" {
9799
#endif
98100

99101

102+
#if MG_ARCH == MG_ARCH_ARMGCC
103+
#define _POSIX_TIMERS
104+
105+
#include <ctype.h>
106+
#include <errno.h>
107+
#include <stdarg.h>
108+
#include <stdbool.h>
109+
#include <stdio.h>
110+
#include <stdlib.h>
111+
#include <string.h>
112+
#include <sys/stat.h>
113+
#include <sys/time.h>
114+
#include <sys/types.h>
115+
#include <time.h>
116+
#include <unistd.h>
117+
118+
#define MG_PATH_MAX 100
119+
#define MG_ENABLE_SOCKET 0
120+
#define MG_ENABLE_DIRLIST 0
121+
122+
#endif
123+
124+
100125
#if MG_ARCH == MG_ARCH_ESP32
101126

102127
#include <ctype.h>
@@ -206,29 +231,6 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
206231
#endif // MG_ARCH == MG_ARCH_FREERTOS
207232

208233

209-
#if MG_ARCH == MG_ARCH_NEWLIB
210-
#define _POSIX_TIMERS
211-
212-
#include <ctype.h>
213-
#include <errno.h>
214-
#include <stdarg.h>
215-
#include <stdbool.h>
216-
#include <stdio.h>
217-
#include <stdlib.h>
218-
#include <string.h>
219-
#include <sys/stat.h>
220-
#include <sys/time.h>
221-
#include <sys/types.h>
222-
#include <time.h>
223-
#include <unistd.h>
224-
225-
#define MG_PATH_MAX 100
226-
#define MG_ENABLE_SOCKET 0
227-
#define MG_ENABLE_DIRLIST 0
228-
229-
#endif
230-
231-
232234
#if MG_ARCH == MG_ARCH_PICOSDK
233235
#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP
234236
#include <errno.h>
@@ -622,8 +624,8 @@ typedef int socklen_t;
622624

623625
#if MG_ARCH == MG_ARCH_ZEPHYR
624626

625-
#include <zephyr/version.h>
626627
#include <zephyr/kernel.h>
628+
#include <zephyr/version.h>
627629

628630
#include <ctype.h>
629631
#include <errno.h>

src/arch.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define MG_ARCH_FREERTOS 5 // FreeRTOS
99
#define MG_ARCH_THREADX 6 // Eclipse ThreadX (former MS Azure RTOS)
1010
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
11-
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
11+
#define MG_ARCH_ARMGCC 8 // Plain ARM GCC
1212
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
1313
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
1414
#define MG_ARCH_PICOSDK 11 // Raspberry Pi Pico-SDK (RP2040, RP2350)
@@ -17,6 +17,8 @@
1717
#define MG_ARCH_RTTHREAD 14 // RT-Thread RTOS
1818
#define MG_ARCH_ARMCGT 15 // Texas Semi ARM-CGT
1919

20+
#define MG_ARCH_NEWLIB MG_ARCH_ARMGCC // Alias, deprecate in 2025
21+
2022
#if !defined(MG_ARCH)
2123
#if defined(__unix__) || defined(__APPLE__)
2224
#define MG_ARCH MG_ARCH_UNIX
@@ -39,7 +41,7 @@
3941
#include "arch_esp32.h"
4042
#include "arch_esp8266.h"
4143
#include "arch_freertos.h"
42-
#include "arch_newlib.h"
44+
#include "arch_armgcc.h"
4345
#include "arch_rtx.h"
4446
#include "arch_unix.h"
4547
#include "arch_win32.h"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#if MG_ARCH == MG_ARCH_NEWLIB
3+
#if MG_ARCH == MG_ARCH_ARMGCC
44
#define _POSIX_TIMERS
55

66
#include <ctype.h>

test/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ s390: CC = $(DOCKER) mdashnet/s390 cc
178178
s390: RUN = $(DOCKER) mdashnet/s390
179179
s390: test
180180

181-
arm: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIVER_INIT=0 -DMG_ARCH=MG_ARCH_NEWLIB -DNO_SLEEP_ABORT
181+
arm: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIVER_INIT=0 -DMG_ARCH=MG_ARCH_ARMGCC -DNO_SLEEP_ABORT
182182
arm: mongoose.h $(SRCS)
183183
$(DOCKER) mdashnet/armgcc arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test -nostartfiles --specs nosys.specs -e 0
184184

185-
riscv: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIVER_INIT=0 -DMG_ARCH=MG_ARCH_NEWLIB -DNO_SLEEP_ABORT
185+
riscv: DEFS += -DMG_ENABLE_POSIX_FS=0 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_TCPIP_DRIVER_INIT=0 -DMG_ARCH=MG_ARCH_ARMGCC -DNO_SLEEP_ABORT
186186
riscv: mongoose.h $(SRCS)
187187
$(DOCKER) mdashnet/riscv riscv-none-elf-gcc -march=rv32imc -mabi=ilp32 $(SRCS) $(OPTS) $(WARN) $(INCS) $(DEFS) $(TFLAGS) -o unit_test
188188

test/mongoose_config_template.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
// Full list of options is at https://mongoose.ws/documentation/#build-options
4-
#define MG_ARCH MG_ARCH_NEWLIB // Build env: ARM GCC + Newlib C library
4+
#define MG_ARCH MG_ARCH_ARMGCC // Build env: ARM GCC + Newlib C library
55
#define MG_TLS MG_TLS_BUILTIN // MG_TLS_NONE, MG_TLS_MBED, MG_TLS_OPENSSL, MG_TLS_CUSTOM
66
#define MG_ENABLE_TCPIP 1 // Enable built-in TCP/IP stack
77

test/tls_multirec/mongoose.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
#define MG_ARCH_FREERTOS 5 // FreeRTOS
3636
#define MG_ARCH_AZURERTOS 6 // MS Azure RTOS
3737
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
38-
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
38+
#define MG_ARCH_ARMGCC 8 // Bare metal ARM
3939
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
4040
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
4141
#define MG_ARCH_PICOSDK 11 // Raspberry Pi Pico-SDK (RP2040, RP2350)
@@ -220,7 +220,7 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
220220
#endif // MG_ARCH == MG_ARCH_FREERTOS
221221

222222

223-
#if MG_ARCH == MG_ARCH_NEWLIB
223+
#if MG_ARCH == MG_ARCH_ARMGCC
224224
#define _POSIX_TIMERS
225225

226226
#include <ctype.h>

tutorials/http/device-dashboard/microchip/same54-xpro/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SOURCES = main.c syscalls.c startup.c
1010

1111
# Mongoose-specific source code files and build options. See https://mongoose.ws/documentation/#build-options
1212
SOURCES += mongoose.c net.c packed_fs.c
13-
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1
13+
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_ARMGCC -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1
1414
CFLAGS += -DMG_ENABLE_DRIVER_SAME54=1 -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_PACKED_FS=1 $(CFLAGS_EXTRA)
1515

1616
# Example specific build options. See README.md

tutorials/http/http-server/arduino/teensy41-http/mongoose_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#define MG_ARCH MG_ARCH_NEWLIB // Use ARM toolchain
3+
#define MG_ARCH MG_ARCH_ARMGCC // Use ARM toolchain
44
#define MG_ENABLE_TCPIP 1 // Enable built-in network stack
55
#define MG_ENABLE_DRIVER_IMXRT10 1 // Enable RTxx driver
66
#define MG_ENABLE_CUSTOM_MILLIS 1 // Let user implement mg_millis()

tutorials/mqtt/mqtt-client/microchip/same54-xpro/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SOURCES = main.c syscalls.c startup.c
1010

1111
# Mongoose-specific source code files and build options. See https://mongoose.ws/documentation/#build-options
1212
SOURCES += mongoose.c
13-
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1
13+
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_ARMGCC -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1
1414
CFLAGS += -DMG_ENABLE_DRIVER_SAME54=1 -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_PACKED_FS=1 $(CFLAGS_EXTRA)
1515

1616
# Example specific build options. See README.md

tutorials/nxp/rt1060-evk-xpresso-baremetal-builtin/source/mongoose_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
// See https://mongoose.ws/documentation/#build-options
4-
#define MG_ARCH MG_ARCH_NEWLIB
4+
#define MG_ARCH MG_ARCH_ARMGCC
55
#define MG_ENABLE_TCPIP 1
66
#define MG_ENABLE_DRIVER_IMXRT10 1
77
#define MG_ENABLE_CUSTOM_MILLIS 1

0 commit comments

Comments
 (0)