Extra changes to make it compile under OS4

This commit is contained in:
George Sokianos 2022-03-27 22:11:26 +01:00
parent f363c34499
commit 893fbfc43f
4 changed files with 112 additions and 96 deletions

View File

@ -5,22 +5,22 @@
# #
LiteXL_OBJ := \ LiteXL_OBJ := \
src/dirmonitor.o src/main.o src/rencache.o src/renderer.o \ src/dirmonitor.o src/fontdesc.o src/main.o src/rencache.o src/renderer.o \
src/renwindow.o src/api/api.o src/api/regex.o \ src/renwindow.o src/api/api.o src/api/cp_replace.o src/api/regex.o \
src/api/renderer.o src/api/system.o src/platform/amigaos4.o src/api/renderer.o src/api/renderer_font.o src/api/system.o src/platform/amigaos4.o
outfile := lite outfile := lite
compiler := gcc compiler := gcc
cxxcompiler := g++ cxxcompiler := g++
INCPATH := -Isrc -Ilib/dmon -I/sdk/local/newlib/include/SDL2 -I/sdk/local/common/include/freetype2 INCPATH := -Isrc -Ilib/dmon -Ilib/font_renderer -I/sdk/local/newlib/include/SDL2 -I/sdk/local/common/include/freetype2
DFLAGS := -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR DFLAGS := -D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR
# -DLITE_USE_SDL_RENDERER # -DLITE_USE_SDL_RENDERER
# -Wextra -Wall # -Wextra -Wall
CFLAGS := -Werror -Wwrite-strings -O3 -g -std=gnu11 -fno-strict-aliasing CFLAGS := -Werror -Wwrite-strings -O3 -g -std=gnu11 -fno-strict-aliasing
# "-gstabs -finstrument-functions -fno-inline -DPROFILING" # "-gstabs -finstrument-functions -fno-inline -DPROFILING"
LFLAGS := -mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lpcre2 -lSDL2 -llua -lagg -lfreetype -lm -lunix -lpthread -athread=native LFLAGS := -mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lpcre2 -lSDL2 -llua -lfontrenderer -lagg -lfreetype -lm -lunix -lpthread -athread=native
# " -lprofyle" # " -lprofyle"
@ -79,3 +79,4 @@ release:
cp README_OS4.md release/LiteXL/ cp README_OS4.md release/LiteXL/
cp LICENSE release/LiteXL/ cp LICENSE release/LiteXL/
lha -aeqr3 a LiteXL.lha release/ lha -aeqr3 a LiteXL.lha release/

14
lib/font_renderer/os4build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
cxxcompiler="c++"
cxxflags="-Wall -O3 -g -std=c++03 -fno-exceptions -fno-rtti -Isrc -Ilib/font_renderer -DFONT_RENDERER_HEIGHT_HACK -lagg -lfreetype -I/sdk/local/common/include/agg -I/sdk/local/common/include/freetype2"
echo "compiling font renderer library..."
c++ -c $cxxflags agg_font_freetype.cpp -o agg_font_freetype.o
c++ -c $cxxflags font_renderer.cpp -o font_renderer.o
ar -rcs libfontrenderer.a *.o
rm *.o
echo "font renderer library created"

View File

@ -1,88 +1,88 @@
#define MyAppName "Lite XL" #define MyAppName "Lite XL"
#define MyAppVersion "@PROJECT_VERSION@" #define MyAppVersion "@PROJECT_VERSION@"
#define MyAppPublisher "Lite XL Team" #define MyAppPublisher "Lite XL Team"
#define MyAppURL "https://lite-xl.github.io" #define MyAppURL "https://lite-xl.github.io"
#define MyAppExeName "lite-xl.exe" #define MyAppExeName "lite-xl.exe"
#define BuildDir "@PROJECT_BUILD_DIR@" #define BuildDir "@PROJECT_BUILD_DIR@"
#define SourceDir "@PROJECT_SOURCE_DIR@" #define SourceDir "@PROJECT_SOURCE_DIR@"
; Use /dArch option to create a setup for a different architecture, e.g.: ; Use /dArch option to create a setup for a different architecture, e.g.:
; iscc /dArch=x86 innosetup.iss ; iscc /dArch=x86 innosetup.iss
#ifndef Arch #ifndef Arch
#define Arch "x64" #define Arch "x64"
#endif #endif
[Setup] [Setup]
; NOTE: The value of AppId uniquely identifies this application. ; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications. ; Do not use the same AppId value in installers for other applications.
; To generate a new GUID, click Tools | Generate GUID inside the InnoSetup IDE. ; To generate a new GUID, click Tools | Generate GUID inside the InnoSetup IDE.
AppId={{06761240-D97C-43DE-B9ED-C15F765A2D65} AppId={{06761240-D97C-43DE-B9ED-C15F765A2D65}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher} AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL} AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL} AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL} AppUpdatesURL={#MyAppURL}
#if Arch=="x64" #if Arch=="x64"
ArchitecturesAllowed=x64 ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64 ArchitecturesInstallIn64BitMode=x64
#define ArchInternal "x86_64" #define ArchInternal "x86_64"
#else #else
#define ArchInternal "i686" #define ArchInternal "i686"
#endif #endif
AllowNoIcons=yes AllowNoIcons=yes
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes
DefaultDirName={autopf}/{#MyAppName} DefaultDirName={autopf}/{#MyAppName}
DefaultGroupName={#MyAppPublisher} DefaultGroupName={#MyAppPublisher}
UninstallFilesDir={app} UninstallFilesDir={app}
; Uncomment the following line to run in non administrative install mode ; Uncomment the following line to run in non administrative install mode
; (install for current user only.) ; (install for current user only.)
;PrivilegesRequired=lowest ;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog PrivilegesRequiredOverridesAllowed=dialog
; The [Icons] "quicklaunchicon" entry uses {userappdata} ; The [Icons] "quicklaunchicon" entry uses {userappdata}
; but its [Tasks] entry has a proper IsAdminInstallMode Check. ; but its [Tasks] entry has a proper IsAdminInstallMode Check.
UsedUserAreasWarning=no UsedUserAreasWarning=no
OutputDir=. OutputDir=.
OutputBaseFilename=LiteXL-{#MyAppVersion}-{#ArchInternal}-setup OutputBaseFilename=LiteXL-{#MyAppVersion}-{#ArchInternal}-setup
;DisableDirPage=yes ;DisableDirPage=yes
;DisableProgramGroupPage=yes ;DisableProgramGroupPage=yes
LicenseFile={#SourceDir}/LICENSE LicenseFile={#SourceDir}/LICENSE
SetupIconFile={#SourceDir}/resources/icons/icon.ico SetupIconFile={#SourceDir}/resources/icons/icon.ico
WizardImageFile="{#SourceDir}/scripts/innosetup/wizard-modern-image.bmp" WizardImageFile="{#SourceDir}/scripts/innosetup/wizard-modern-image.bmp"
WizardSmallImageFile="{#SourceDir}/scripts/innosetup/litexl-55px.bmp" WizardSmallImageFile="{#SourceDir}/scripts/innosetup/litexl-55px.bmp"
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl" Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks] [Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
Name: "portablemode"; Description: "Portable Mode"; Flags: unchecked Name: "portablemode"; Description: "Portable Mode"; Flags: unchecked
[Files] [Files]
Source: "{#BuildDir}/src/lite-xl.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#BuildDir}/src/lite-xl.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BuildDir}/mingwLibs{#Arch}/*"; DestDir: "{app}"; Flags: ignoreversion ; Check: DirExists(ExpandConstant('{#BuildDir}/mingwLibs{#Arch}')) Source: "{#BuildDir}/mingwLibs{#Arch}/*"; DestDir: "{app}"; Flags: ignoreversion ; Check: DirExists(ExpandConstant('{#BuildDir}/mingwLibs{#Arch}'))
Source: "{#SourceDir}/data/*"; DestDir: "{app}/data"; Flags: ignoreversion recursesubdirs Source: "{#SourceDir}/data/*"; DestDir: "{app}/data"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons] [Icons]
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: not WizardIsTaskSelected('portablemode') Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: not WizardIsTaskSelected('portablemode')
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Check: not WizardIsTaskSelected('portablemode') Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Check: not WizardIsTaskSelected('portablemode')
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Check: not WizardIsTaskSelected('portablemode') Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Check: not WizardIsTaskSelected('portablemode')
; Name: "{usersendto}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ; Name: "{usersendto}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
[Run] [Run]
Filename: "{app}/{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Filename: "{app}/{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Setup] [Setup]
Uninstallable=not WizardIsTaskSelected('portablemode') Uninstallable=not WizardIsTaskSelected('portablemode')

View File

@ -763,9 +763,9 @@ static int f_watch_dir(lua_State *L) {
} }
static int f_unwatch_dir(lua_State *L) { static int f_unwatch_dir(lua_State *L) {
dmon_watch_id watch_id; // dmon_watch_id watch_id;
watch_id.id = luaL_checkinteger(L, 1); // watch_id.id = luaL_checkinteger(L, 1);
dmon_unwatch(watch_id); // dmon_unwatch(watch_id);
return 0; return 0;
} }
@ -903,3 +903,4 @@ int luaopen_system(lua_State *L) {
luaL_newlib(L, lib); luaL_newlib(L, lib);
return 1; return 1;
} }