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

@ -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;
} }