Skip to content

Commit 9a327d3

Browse files
committed
CHANGE: simplified use of TO_<os> defines and included Linux armv6 targets (and using armv7 instead of arm32 now)
1 parent da0a7ce commit 9a327d3

File tree

10 files changed

+66
-75
lines changed

10 files changed

+66
-75
lines changed

make/old-makefiles/makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ R= $S/core
3939
INCL ?= .
4040
I= -I$(INCL) -I$S/include/
4141

42-
TO_OS?= TO_WIN32_X64
42+
TO_OS?= TO_WINDOWS
4343
OS_ID?= 0.3.40
4444
BIN_SUFFIX= .exe
4545
LIB_SUFFIX= .dll

make/old-makefiles/makefile.vc

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ T= $(UP)\src\tools
99
CD= ./
1010

1111
I= /I..\src\include
12-
TO_OS= TO_WIN32
12+
TO_OS= TO_WINDOWS
1313
OS_ID= 0.3.1
1414

1515

16-
CFLAGS=/c /Os /W3 /GR- /Zi /GS /Gy /GF /EHs-c- /GL /D "REB_EXE" /D "ENDIAN_LITTLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /D "_FILE_OFFSET_BITS=64" /D "NDEBUG" /D "TO_WIN32" /D "USE_MIDI_DEVICE" /D "USE_LZMA" /D "USE_IMAGE_NATIVES"
16+
CFLAGS=/c /Os /W3 /GR- /Zi /GS /Gy /GF /EHs-c- /GL /D "REB_EXE" /D "ENDIAN_LITTLE" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE" /D "_FILE_OFFSET_BITS=64" /D "NDEBUG" /D "TO_WINDOWS" /D "USE_MIDI_DEVICE" /D "USE_LZMA" /D "USE_IMAGE_NATIVES"
1717

1818

1919
RAPI_FLAGS= $(CFLAGS)

make/old-makefiles/makefile_0.4.40.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ R= $S/core
3939
INCL ?= .
4040
I= -I$(INCL) -I$S/include/
4141

42-
TO_OS?= TO_LINUX_X64
42+
TO_OS?= TO_LINUX
4343
OS_ID?= 0.4.40
4444
BIN_SUFFIX=
4545
LIB_SUFFIX= .so

make/rebol3.nest

+46-36
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ optimize: 2
2020

2121
version: 3.10.3
2222

23+
#if Linux? [ defines: TO_LINUX ]
24+
#if Windows? [ defines: TO_WINDOWS ]
25+
#if OpenBSD? [ defines: TO_OPENBSD ]
26+
#if FreeBSD? [ defines: TO_FREEBSD ]
27+
2328
target-windows: [
2429
os: windows
2530
sys: win32
@@ -906,48 +911,34 @@ arch-x64: [
906911
define: _FILE_OFFSET_BITS=64
907912
#if Linux? [
908913
library: %dl
909-
defines: TO_LINUX_X64
910914
defines: __LP64__ ; has long (integer) 64 bits
911915
]
912916
#if Windows? [
913-
defines: TO_WIN32_X64
914917
defines: _WIN32
915918
defines: __LLP64__ ; 64-bit, long (integer) has 32 bits and 'void *' is sizeof(long long)
916919
]
917920
#if macOS? [
918-
defines: TO_OSX_X64
919921
defines: __LP64__ ; same like LLP64, but long (integer) has 64 bits instead of 32
920922
]
921-
#if OpenBSD? [
922-
defines: TO_OPENBSD
923-
]
924-
#if FreeBSD? [
925-
defines: TO_FREEBSD
926-
]
927923
]
928924
arch-x86: [
929925
arch: x86
930-
#if Linux? [
926+
#if Windows? [ resource-options: "--target=pe-i386" ]
927+
]
928+
arch-armv6: [
929+
arch: armv6
930+
#if linux? [
931+
flag: "-marm"
932+
flag: "-march=native" ;; expects, that the host system is arm32!
931933
library: %dl
932-
defines: TO_LINUX_X86
933-
]
934-
#if Windows? [
935-
resource-options: "--target=pe-i386"
936-
defines: TO_WIN32
937-
]
938-
#if OpenBSD? [
939-
defines: TO_OPENBSD
940-
]
941-
#if FreeBSD? [
942-
defines: TO_FREEBSD
943934
]
944935
]
945-
arch-arm32: [
946-
:arch-x86
947-
arch: arm32
948-
#if linux? [ flag: "-march=native" ] ;; expects, that the host system is arm32!
936+
arch-armv7: [
937+
:arch-armv6
938+
arch: armv7
949939
]
950-
arch-arm64: [
940+
941+
arch-arm64: [ ;= armv8
951942
:arch-x64
952943
arch: arm64
953944
#if macOS? [ flag: "-arch arm64" ]
@@ -1000,7 +991,8 @@ make-exe: [
1000991
]
1001992
make-x86-exe: [:arch-x86 :make-exe ]
1002993
make-x64-exe: [:arch-x64 :make-exe ]
1003-
make-arm32-exe: [:arch-arm32 :make-exe ]
994+
make-armv6-exe: [:arch-armv6 :make-exe ]
995+
make-armv7-exe: [:arch-armv7 :make-exe ]
1004996
make-arm64-exe: [:arch-arm64 :make-exe ]
1005997

1006998
; for making Rebol as a shared library
@@ -1165,22 +1157,40 @@ eggs: [
11651157
:make-x64-exe
11661158
]
11671159

1168-
"Rebol/Base linux-arm32" [
1169-
name: %rebol3-base-linux-arm32
1160+
"Rebol/Base linux-armv6" [
1161+
name: %rebol3-base-linux-armv6
1162+
:target-linux
1163+
:make-armv6-exe
1164+
]
1165+
"Rebol/Core linux-armv6" [
1166+
name: %rebol3-core-linux-armv6
1167+
:target-linux
1168+
:include-rebol-core
1169+
:make-armv6-exe
1170+
]
1171+
"Rebol/Bulk linux-armv6" [
1172+
name: %rebol3-bulk-linux-armv6
1173+
:target-linux
1174+
:include-rebol-bulk
1175+
:make-armv6-exe
1176+
]
1177+
1178+
"Rebol/Base linux-armv7" [
1179+
name: %rebol3-base-linux-armv7
11701180
:target-linux
1171-
:make-arm32-exe
1181+
:make-armv7-exe
11721182
]
1173-
"Rebol/Core linux-arm32" [
1174-
name: %rebol3-core-linux-arm32
1183+
"Rebol/Core linux-armv7" [
1184+
name: %rebol3-core-linux-armv7
11751185
:target-linux
11761186
:include-rebol-core
1177-
:make-arm32-exe
1187+
:make-armv7-exe
11781188
]
1179-
"Rebol/Bulk linux-arm32" [
1180-
name: %rebol3-bulk-linux-arm32
1189+
"Rebol/Bulk linux-armv7" [
1190+
name: %rebol3-bulk-linux-armv7
11811191
:target-linux
11821192
:include-rebol-bulk
1183-
:make-arm32-exe
1193+
:make-armv7-exe
11841194
]
11851195

11861196
"Rebol/Base linux-arm64" [

src/core/deprecated/u-poly1305.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
** REBOL [R3] Language Interpreter and Run-time Environment
55
**
66
** Copyright 2012 REBOL Technologies
7-
** Copyright 2012-2019 Rebol Open Source Developers
7+
** Copyright 2012-2023 Rebol Open Source Developers
88
** REBOL is a trademark of REBOL Technologies
99
**
1010
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,7 +32,7 @@
3232

3333
#include "sys-poly1305.h"
3434

35-
#if (defined(__LP64__) || defined(TO_WIN32_X64))
35+
#if (defined(__LP64__) || defined(__LLP64__))
3636
#include "poly1305/poly1305-donna-64.h"
3737
#else
3838
#include "poly1305/poly1305-donna-32.h"

src/core/deprecated/u-rsa.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include <time.h>
4242
#include <stdlib.h>
4343

44-
#if defined(TO_OSX_X64) || defined(TO_OSXI) || defined(TO_OSX)
44+
#ifdef TO_MACOS
4545
#include <sys/malloc.h>
4646
#elif defined(TO_OPENBSD)
4747
/* malloc(3) is inside stdlib.h */

src/core/u-iconv.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
**
3838
***********************************************************************/
3939

40-
#if defined(TO_WIN32) || defined(TO_WIN32_X64)
40+
#ifdef TO_WINDOWS
4141
#include <windows.h>
4242
#undef IS_ERROR
4343
#else

src/include/reb-config.h

+7-26
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** REBOL [R3] Language Interpreter and Run-time Environment
44
**
55
** Copyright 2012 REBOL Technologies
6-
** Copyright 2012-2021 Rebol Open Source Developers
6+
** Copyright 2012-2023 Rebol Open Source Developers
77
** REBOL is a trademark of REBOL Technologies
88
**
99
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +34,7 @@
3434
3535
The primary target system is defined by:
3636
37-
TO_target - for example TO_WIN32 or TO_LINUX
37+
TO_target - for example TO_WINDOWS or TO_LINUX
3838
3939
The default config builds an R3 HOST executable program.
4040
@@ -98,13 +98,6 @@ These are now obsolete (as of A107) and should be removed:
9898

9999
//* MS Windows *********************************************************
100100

101-
#ifdef TO_WIN32
102-
#define TO_WINDOWS
103-
#endif
104-
#ifdef TO_WIN32_X64
105-
#define TO_WINDOWS
106-
#endif
107-
108101
#ifdef TO_WINDOWS // Win32/Intel
109102

110103
#define WIN32_LEAN_AND_MEAN // trim down the Win32 headers
@@ -166,8 +159,7 @@ These are now obsolete (as of A107) and should be removed:
166159
#define AGG_FREETYPE //use freetype2 library for fonts by default
167160
#define INLINE
168161

169-
#ifdef TO_OSX_X64
170-
#define TO_OSX
162+
#ifdef TO_MACOS
171163
#define FINITE isfinite
172164
#else
173165
#define FINITE finite
@@ -184,24 +176,13 @@ These are now obsolete (as of A107) and should be removed:
184176
#define API_IMPORT
185177
#endif
186178

187-
#ifdef TO_LINUX
188-
#define TO_ANY_LINUX
189-
#endif
190-
191-
#ifdef TO_LINUX_X64
192-
#define TO_ANY_LINUX
193-
#endif
194179

195-
#ifdef TO_LINUX_MIPS
196-
#define TO_ANY_LINUX
197-
#endif
198-
199-
#ifdef TO_LINUX_ARM
200-
#define TO_ANY_LINUX
180+
#ifdef TO_LINUX
181+
#undef INCLUDE_MIDI_DEVICE // Not implemented!
182+
#define USE_SETENV
201183
#endif
202184

203-
#ifdef TO_ANY_LINUX
204-
#undef INCLUDE_MIDI_DEVICE // Not implemented!
185+
#ifdef TO_MACOS // macOS
205186
#define USE_SETENV
206187
#endif
207188

src/os/osx/dev-midi.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** REBOL [R3] Language Interpreter and Run-time Environment
44
**
55
** Copyright 2012 REBOL Technologies
6-
** Copyright 2012-2021 Rebol Open Source Developers
6+
** Copyright 2012-2023 Rebol Open Source Developers
77
** REBOL is a trademark of REBOL Technologies
88
**
99
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -47,7 +47,7 @@
4747

4848
#ifdef INCLUDE_MIDI_DEVICE
4949

50-
#if defined(TO_OSX) || defined(TO_OSX_X64) || defined(TO_OSXI) //!!! could be made better!
50+
#ifdef TO_MACOS
5151

5252
// NOTE: this will be useful for higher level launchpad schemes:
5353
// https://github.com/FMMT666/launchpad.py/blob/master/launchpad_py/launchpad.py
@@ -489,5 +489,5 @@ static DEVICE_CMD_FUNC Dev_Cmds[RDC_MAX] =
489489

490490
DEFINE_DEV(Dev_MIDI, "MIDI", 1, Dev_Cmds, RDC_MAX, 0);
491491

492-
#endif //defined(TO_OSX) || defined(TO_OSX_X64)
492+
#endif //TO_MACOS
493493
#endif //INCLUDE_MIDI_DEVICE

src/os/posix/host-lib.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ RL_LIB *RL; // Link back to reb-lib from embedded extensions (like for now: host
442442
**
443443
***********************************************************************/
444444
{
445-
#ifdef TO_OSX
445+
#ifdef TO_MACOS
446446
REBCNT size = 0;
447447
REBINT rv;
448448
REBCHR *buf;
@@ -1350,7 +1350,7 @@ static int Try_Browser(char *browser, REBCHR *url)
13501350
***********************************************************************/
13511351
{
13521352
if (
1353-
#if defined(TO_OSX) || defined(TO_OSXI) || defined(TO_OSX_X64)
1353+
#ifdef TO_MACOS
13541354
Try_Browser("/usr/bin/open", url)
13551355
#else
13561356
Try_Browser("xdg-open", url)

0 commit comments

Comments
 (0)