Skip to content

Commit

Permalink
FEAT: revisited original Carl's build scripts and improving these to …
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
Oldes committed Aug 30, 2019
1 parent 015bfd3 commit 1f9199a
Show file tree
Hide file tree
Showing 20 changed files with 801 additions and 187 deletions.
1 change: 1 addition & 0 deletions make/msvc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
# But not these files...
!.gitignore
!Make-vs-project.r3
!Make-vs-project-view.r3
!Make-vs-project.bat
!README.md
516 changes: 516 additions & 0 deletions make/msvc/Make-vs-project-view.r3

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion make/msvc/Make-vs-project.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@echo off
..\prebuild\r3-make-win.exe -qs Make-vs-project.r3
..\prebuild\r3-make-win.exe -qs Make-vs-project.r3
..\prebuild\r3-make-win.exe -qs Make-vs-project-view.r3
8 changes: 3 additions & 5 deletions make/msvc/Make-vs-project.r3
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ VS: context [
AdditionalDependencies: rejoin [
"wsock32.lib;comdlg32.lib;"
"winmm.lib;" ;- for MIDI
"Gdi32.lib;Comctl32.lib;UxTheme.lib;" ;- for View
]

Sources: []
Expand Down Expand Up @@ -443,18 +442,17 @@ do %../../src/tools/file-base.r
forall core [change core join %../../../src/core/ core/1]
forall os [change os join %../../../src/os/ os/1]
forall os-win32 [change os-win32 join %../../../src/os/win32/ os-win32/1]
forall os-win32g [change os-win32g join %../../../src/os/win32/ os-win32g/1]

probe core
vs/Sources: compose/only [
"Source Core Files" (core)
"Source Host Files" (union union os os-win32 os-win32g)
"Source Host Files" (union os os-win32)
]
vs/IncludePath-x86:
vs/IncludePath-x64: "..\..\..\src\include;"

common-definitions: {REB_EXE;ENDIAN_LITTLE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;_FILE_OFFSET_BITS=64;}
optional-components: {USE_MIDI_DEVICE;USE_PNG_CODEC;USE_JPG_CODEC;USE_LZMA;} ;TEST_EXTENSIONS;
common-definitions: {REB_EXE;ENDIAN_LITTLE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;_FILE_OFFSET_BITS=64;NDEBUG;}
optional-components: {USE_MIDI_DEVICE;USE_LZMA;} ;TEST_EXTENSIONS;
vs/PreprocessorDefinitions-x86: rejoin [
common-definitions
{TO_WIN32;}
Expand Down
41 changes: 41 additions & 0 deletions make/r3-view.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
</windowsSettings>
</application>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
32 changes: 32 additions & 0 deletions make/r3-view.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
101 ICON "r3.ico"

1 VERSIONINFO
FILEVERSION 3,0,0,0
PRODUCTVERSION 3,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "REBOL (relative expression based object language) console."
VALUE "FileVersion", "3.0"
VALUE "InternalName", "Rebol 3 (Oldes branch)"
VALUE "LegalCopyright", "2012 REBOL Technologies"
VALUE "OriginalFilename", "Rebol.exe"
VALUE "ProductName", "Rebol/View"
VALUE "ProductVersion", "3.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

STRINGTABLE
BEGIN
101 "Rebol 3 (Oldes branch)"
END

1 MANIFEST "r3-view.manifest"

4 changes: 2 additions & 2 deletions src/core/n-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,14 +1063,14 @@ static int Do_Ordinal(REBVAL *ds, REBINT n)
***********************************************************************/
{
REBVAL *val = D_ARG(1);
REBGOB *gob;
REBGOB *gob = NULL;
REBXYF xy;

//O: handle drop_file this way? Or maybe just don't use EVF_HAS_XY?
//gob = (VAL_EVENT_TYPE(val) == EVT_DROP_FILE) ? Gob_Root : VAL_EVENT_SER(val);
if (GET_FLAG(VAL_EVENT_FLAGS(val), EVF_HAS_DATA)) {
CLR_FLAG(VAL_EVENT_FLAGS(val), EVF_HAS_DATA);
#ifdef TO_WINDOWS
#ifdef REB_VIEW
gob = OS_GET_GOB_ROOT();
#endif
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/core/t-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ INLINE REBCNT ARGB_To_BGR(REBCNT i)
else if (IS_GOB(arg)) {
//originally it was returning image without content when conversion failed!
//value = Make_Image(ROUND_TO_INT(GOB_W(VAL_GOB(arg))), ROUND_TO_INT(GOB_H(VAL_GOB(arg))));
#ifndef TO_WINDOWS
#ifndef REB_VIEW
//TODO: remove this once OS_GOB_TO_IMAGE will be for all systems
Trap0(RE_FEATURE_NA);
#else
Expand Down
11 changes: 10 additions & 1 deletion src/include/reb-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,23 @@ These are now obsolete (as of A107) and should be removed:
#define OS_CRLF TRUE // uses CRLF as line terminator
#define OS_DIR_SEP '\\' // file path separator (Thanks Bill.)
#define HAS_ASYNC_DNS // supports it
#define HAS_WIDGET_GOB // supports it
#define ATOI // supports it
#define ATOI64 // supports it
#define ITOA64 // supports it
#define NO_TTY_ATTRIBUTES // used in read-line.c
#define FINITE _finite // name used for it
#define INLINE __inline // name used for it

#ifdef REB_VIEW
#define HAS_WIDGET_GOB // supports it
// use native image codecs only in VIEW version so far
#define USE_NATIVE_IMAGE_CODECS
#undef USE_BMP_CODEC
#undef USE_PNG_CODEC
#undef USE_GIF_CODEC
#undef USE_JPG_CODEC
#endif

#ifdef THREADED
#ifndef __MINGW32__
#define THREAD __declspec(thread)
Expand Down
6 changes: 4 additions & 2 deletions src/mezz/boot-files.r
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ REBOL [
%mezz-crypt.r
%mezz-date.r ; Internet date support
%mezz-tail.r
%codec-wav.r
%codec-der.r
%codec-crt.r
%codec-gzip.r
%codec-xml.r
%codec-swf.r
%codec-zip.r
%codec-tar.r
; optional files added in make-boot.r per os and product
;%codec-wav.r
;%codec-swf.r
;%codec-image.r
]

;-- protocols:
Expand Down
10 changes: 8 additions & 2 deletions src/os/host-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ HWND Focused_Window = 0;
WCHAR App_Title[MAX_TITLE_LENGTH]; //will be filled later from the resources file
#endif

#ifndef REB_CORE
#ifdef REB_GTK

extern void Init_Windows(void);

#endif

#ifdef REB_VIEW
extern void Init_Windows(void);
extern void Init_Graphics(void);
#endif
Expand Down Expand Up @@ -288,7 +294,7 @@ int main(int argc, char **argv) {
if (n == 1) Host_Crash("Host-lib wrong size");
if (n == 2) Host_Crash("Host-lib wrong version/checksum");

#ifndef REB_CORE
#ifdef REB_VIEW
Init_Windows();
//Init_Graphics();
#endif
Expand Down
42 changes: 41 additions & 1 deletion src/tools/common.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,43 @@ REBOL [
Author: "Carl Sassenrath"
]

do %form-header.r
; Change back to the main souce directory:
change-dir %../ ;- make sure you call it just once at start!

; Output directory for temp files:
make-dir temp-dir: join what-dir %tmp/

do %tools/form-header.r


;-- Options:
verbose: false

platform: none
version: none
os-name: none
os-base: none
product: none

if exists? opts: temp-dir/tmp-options.r [
opts: load opts
platform: opts/platform
version: opts/version
os-name: opts/os-name
os-base: opts/os-base
product: opts/product
]




;-- UTILITIES ----------------------------------------------------------

error: func[msg [string! block!]][
if block? msg [msg: reform msg]
make error! msg
]

up-word: func [w] [
w: uppercase form w
foreach [f t] [
Expand All @@ -38,3 +71,10 @@ to-c-name: func [word] [
][replace/all word f t]
word
]

write-if: func [file data] [
if data <> attempt [read file][
print ["UPDATE:" file]
write file data
]
]
13 changes: 11 additions & 2 deletions src/tools/file-base.r
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,21 @@ os-win32: [
dev-clipboard.c
dev-midi.c

; host-event.c
; host-window.c
; host-compositor.c
; host-image.c
]

os-win32g: [
host-event.c
host-window.c
host-compositor.c
]
host-image.c

sys-utils.c
sys-codecs.cpp

os-win32g: [
;host-graphics.c
;host-draw.c
;host-text.c
Expand Down
Loading

0 comments on commit 1f9199a

Please sign in to comment.