Skip to content

Commit 1f9199a

Browse files
committed
FEAT: revisited original Carl's build scripts and improving these to be able create multiple _products_ without modifying it too much.
One could spend more time in these as they were originally written to be working also with old Rebol 2 in the bootstrap phase. There is a lot of improvement possibilities, but that is not too important for now. Main change is, that I stopped using REB_CORE define and instead use REB_VIEW when I want to build Rebol with early View functionality (not much stable/useful yet).
1 parent 015bfd3 commit 1f9199a

20 files changed

+801
-187
lines changed

make/msvc/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
# But not these files...
55
!.gitignore
66
!Make-vs-project.r3
7+
!Make-vs-project-view.r3
78
!Make-vs-project.bat
89
!README.md

make/msvc/Make-vs-project-view.r3

+516
Large diffs are not rendered by default.

make/msvc/Make-vs-project.bat

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
@echo off
2-
..\prebuild\r3-make-win.exe -qs Make-vs-project.r3
2+
..\prebuild\r3-make-win.exe -qs Make-vs-project.r3
3+
..\prebuild\r3-make-win.exe -qs Make-vs-project-view.r3

make/msvc/Make-vs-project.r3

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ VS: context [
2323
AdditionalDependencies: rejoin [
2424
"wsock32.lib;comdlg32.lib;"
2525
"winmm.lib;" ;- for MIDI
26-
"Gdi32.lib;Comctl32.lib;UxTheme.lib;" ;- for View
2726
]
2827

2928
Sources: []
@@ -443,18 +442,17 @@ do %../../src/tools/file-base.r
443442
forall core [change core join %../../../src/core/ core/1]
444443
forall os [change os join %../../../src/os/ os/1]
445444
forall os-win32 [change os-win32 join %../../../src/os/win32/ os-win32/1]
446-
forall os-win32g [change os-win32g join %../../../src/os/win32/ os-win32g/1]
447445

448446
probe core
449447
vs/Sources: compose/only [
450448
"Source Core Files" (core)
451-
"Source Host Files" (union union os os-win32 os-win32g)
449+
"Source Host Files" (union os os-win32)
452450
]
453451
vs/IncludePath-x86:
454452
vs/IncludePath-x64: "..\..\..\src\include;"
455453

456-
common-definitions: {REB_EXE;ENDIAN_LITTLE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;_FILE_OFFSET_BITS=64;}
457-
optional-components: {USE_MIDI_DEVICE;USE_PNG_CODEC;USE_JPG_CODEC;USE_LZMA;} ;TEST_EXTENSIONS;
454+
common-definitions: {REB_EXE;ENDIAN_LITTLE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;_FILE_OFFSET_BITS=64;NDEBUG;}
455+
optional-components: {USE_MIDI_DEVICE;USE_LZMA;} ;TEST_EXTENSIONS;
458456
vs/PreprocessorDefinitions-x86: rejoin [
459457
common-definitions
460458
{TO_WIN32;}

make/r3-view.manifest

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
4+
<application>
5+
<!-- Windows 10 -->
6+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
7+
<!-- Windows 8.1 -->
8+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
9+
<!-- Windows Vista -->
10+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
11+
<!-- Windows 7 -->
12+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
13+
<!-- Windows 8 -->
14+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
15+
</application>
16+
</compatibility>
17+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
18+
<security>
19+
<requestedPrivileges>
20+
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
21+
</requestedPrivileges>
22+
</security>
23+
</trustInfo>
24+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
25+
<windowsSettings>
26+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
27+
</windowsSettings>
28+
</application>
29+
<dependency>
30+
<dependentAssembly>
31+
<assemblyIdentity
32+
type="win32"
33+
name="Microsoft.Windows.Common-Controls"
34+
version="6.0.0.0"
35+
processorArchitecture="*"
36+
publicKeyToken="6595b64144ccf1df"
37+
language="*"
38+
/>
39+
</dependentAssembly>
40+
</dependency>
41+
</assembly>

make/r3-view.rc

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
101 ICON "r3.ico"
2+
3+
1 VERSIONINFO
4+
FILEVERSION 3,0,0,0
5+
PRODUCTVERSION 3,0,0,0
6+
BEGIN
7+
BLOCK "StringFileInfo"
8+
BEGIN
9+
BLOCK "040904E4"
10+
BEGIN
11+
VALUE "FileDescription", "REBOL (relative expression based object language) console."
12+
VALUE "FileVersion", "3.0"
13+
VALUE "InternalName", "Rebol 3 (Oldes branch)"
14+
VALUE "LegalCopyright", "2012 REBOL Technologies"
15+
VALUE "OriginalFilename", "Rebol.exe"
16+
VALUE "ProductName", "Rebol/View"
17+
VALUE "ProductVersion", "3.0"
18+
END
19+
END
20+
BLOCK "VarFileInfo"
21+
BEGIN
22+
VALUE "Translation", 0x409, 1252
23+
END
24+
END
25+
26+
STRINGTABLE
27+
BEGIN
28+
101 "Rebol 3 (Oldes branch)"
29+
END
30+
31+
1 MANIFEST "r3-view.manifest"
32+

src/core/n-data.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1063,14 +1063,14 @@ static int Do_Ordinal(REBVAL *ds, REBINT n)
10631063
***********************************************************************/
10641064
{
10651065
REBVAL *val = D_ARG(1);
1066-
REBGOB *gob;
1066+
REBGOB *gob = NULL;
10671067
REBXYF xy;
10681068

10691069
//O: handle drop_file this way? Or maybe just don't use EVF_HAS_XY?
10701070
//gob = (VAL_EVENT_TYPE(val) == EVT_DROP_FILE) ? Gob_Root : VAL_EVENT_SER(val);
10711071
if (GET_FLAG(VAL_EVENT_FLAGS(val), EVF_HAS_DATA)) {
10721072
CLR_FLAG(VAL_EVENT_FLAGS(val), EVF_HAS_DATA);
1073-
#ifdef TO_WINDOWS
1073+
#ifdef REB_VIEW
10741074
gob = OS_GET_GOB_ROOT();
10751075
#endif
10761076
} else {

src/core/t-image.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ INLINE REBCNT ARGB_To_BGR(REBCNT i)
10361036
else if (IS_GOB(arg)) {
10371037
//originally it was returning image without content when conversion failed!
10381038
//value = Make_Image(ROUND_TO_INT(GOB_W(VAL_GOB(arg))), ROUND_TO_INT(GOB_H(VAL_GOB(arg))));
1039-
#ifndef TO_WINDOWS
1039+
#ifndef REB_VIEW
10401040
//TODO: remove this once OS_GOB_TO_IMAGE will be for all systems
10411041
Trap0(RE_FEATURE_NA);
10421042
#else

src/include/reb-config.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,23 @@ These are now obsolete (as of A107) and should be removed:
101101
#define OS_CRLF TRUE // uses CRLF as line terminator
102102
#define OS_DIR_SEP '\\' // file path separator (Thanks Bill.)
103103
#define HAS_ASYNC_DNS // supports it
104-
#define HAS_WIDGET_GOB // supports it
105104
#define ATOI // supports it
106105
#define ATOI64 // supports it
107106
#define ITOA64 // supports it
108107
#define NO_TTY_ATTRIBUTES // used in read-line.c
109108
#define FINITE _finite // name used for it
110109
#define INLINE __inline // name used for it
111110

111+
#ifdef REB_VIEW
112+
#define HAS_WIDGET_GOB // supports it
113+
// use native image codecs only in VIEW version so far
114+
#define USE_NATIVE_IMAGE_CODECS
115+
#undef USE_BMP_CODEC
116+
#undef USE_PNG_CODEC
117+
#undef USE_GIF_CODEC
118+
#undef USE_JPG_CODEC
119+
#endif
120+
112121
#ifdef THREADED
113122
#ifndef __MINGW32__
114123
#define THREAD __declspec(thread)

src/mezz/boot-files.r

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ REBOL [
4949
%mezz-crypt.r
5050
%mezz-date.r ; Internet date support
5151
%mezz-tail.r
52-
%codec-wav.r
5352
%codec-der.r
5453
%codec-crt.r
5554
%codec-gzip.r
5655
%codec-xml.r
57-
%codec-swf.r
5856
%codec-zip.r
5957
%codec-tar.r
58+
; optional files added in make-boot.r per os and product
59+
;%codec-wav.r
60+
;%codec-swf.r
61+
;%codec-image.r
6062
]
6163

6264
;-- protocols:

src/os/host-main.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ HWND Focused_Window = 0;
7373
WCHAR App_Title[MAX_TITLE_LENGTH]; //will be filled later from the resources file
7474
#endif
7575

76-
#ifndef REB_CORE
76+
#ifdef REB_GTK
77+
78+
extern void Init_Windows(void);
79+
80+
#endif
81+
82+
#ifdef REB_VIEW
7783
extern void Init_Windows(void);
7884
extern void Init_Graphics(void);
7985
#endif
@@ -288,7 +294,7 @@ int main(int argc, char **argv) {
288294
if (n == 1) Host_Crash("Host-lib wrong size");
289295
if (n == 2) Host_Crash("Host-lib wrong version/checksum");
290296

291-
#ifndef REB_CORE
297+
#ifdef REB_VIEW
292298
Init_Windows();
293299
//Init_Graphics();
294300
#endif

src/tools/common.r

+41-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,43 @@ REBOL [
1212
Author: "Carl Sassenrath"
1313
]
1414

15-
do %form-header.r
15+
; Change back to the main souce directory:
16+
change-dir %../ ;- make sure you call it just once at start!
17+
18+
; Output directory for temp files:
19+
make-dir temp-dir: join what-dir %tmp/
20+
21+
do %tools/form-header.r
22+
23+
24+
;-- Options:
25+
verbose: false
26+
27+
platform: none
28+
version: none
29+
os-name: none
30+
os-base: none
31+
product: none
32+
33+
if exists? opts: temp-dir/tmp-options.r [
34+
opts: load opts
35+
platform: opts/platform
36+
version: opts/version
37+
os-name: opts/os-name
38+
os-base: opts/os-base
39+
product: opts/product
40+
]
41+
42+
43+
1644

1745
;-- UTILITIES ----------------------------------------------------------
1846

47+
error: func[msg [string! block!]][
48+
if block? msg [msg: reform msg]
49+
make error! msg
50+
]
51+
1952
up-word: func [w] [
2053
w: uppercase form w
2154
foreach [f t] [
@@ -38,3 +71,10 @@ to-c-name: func [word] [
3871
][replace/all word f t]
3972
word
4073
]
74+
75+
write-if: func [file data] [
76+
if data <> attempt [read file][
77+
print ["UPDATE:" file]
78+
write file data
79+
]
80+
]

src/tools/file-base.r

+11-2
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,21 @@ os-win32: [
155155
dev-clipboard.c
156156
dev-midi.c
157157

158+
; host-event.c
159+
; host-window.c
160+
; host-compositor.c
161+
; host-image.c
162+
]
163+
164+
os-win32g: [
158165
host-event.c
159166
host-window.c
160167
host-compositor.c
161-
]
168+
host-image.c
169+
170+
sys-utils.c
171+
sys-codecs.cpp
162172

163-
os-win32g: [
164173
;host-graphics.c
165174
;host-draw.c
166175
;host-text.c

0 commit comments

Comments
 (0)