From 383ddd969897cf1ba2dd0f5b9351b2e4425d752e Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Fri, 30 Oct 2020 21:24:24 -0700 Subject: Apply premake5 patch Set to use -j1 and -flto=1 --- O3-support.patch | 12 +- PKGBUILD | 23 +-- premake5.patch | 457 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 473 insertions(+), 19 deletions(-) create mode 100644 premake5.patch diff --git a/O3-support.patch b/O3-support.patch index 2728810..bfdeec9 100644 --- a/O3-support.patch +++ b/O3-support.patch @@ -1,11 +1,7 @@ ---- a/premake4.lua -+++ b/premake4.lua -@@ -88,7 +88,7 @@ - configuration "Release" - defines { "NDEBUG=1" } - flags { "Optimize", "NoFramePointer" } +--- a/premake5.lua ++++ b/premake5.lua +@@ -88,3 +88,3 @@ + omitframepointer "On" - buildoptions { "-O2" } + buildoptions { "-O3" } targetdir "bin/Release" - - diff --git a/PKGBUILD b/PKGBUILD index 708f532..c4e36de 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -12,7 +12,7 @@ pkgname=tome4 pkgver=1.7.0 -pkgrel=1 +pkgrel=1.2 _offlinever=1.7 _ashesver=1.1.0 _orcsver=1.1.7 @@ -23,14 +23,14 @@ arch=('i686' 'x86_64' 'aarch64') url="https://te4.org/" license=('custom' 'GPL3') depends=(glu openal libvorbis sdl2_ttf sdl2_image) -makedepends=(premake4 zip unzip) -options=(emptydirs) +makedepends=(premake zip unzip) +options=(emptydirs !makeflags) source=("${url}dl/t-engine/t-engine4-src-${pkgver}.tar.bz2" ashes-urhrok_${_ashesver}.teaac orcs_${_orcsver}.teaac cults_${_cultsver}.teaac offline-donator_${_offlinever}.patch - sdl2-path-fix.patch + premake5.patch O3-support.patch tome4 tome4.desktop) @@ -40,8 +40,8 @@ b2sums=('7eb525879836b5127e9b5eb56dfccf409cd2f1ed2ee5a7e45b819f1d39ca961c1bdb684 '465353d7df5e7edaf56367fbee7c77c649b13a2f18c25c444e660f2be56efd3808cafa98f876046ec1f048607a38cb59e6b18e7083a236df46db4fa191e7780d' '9542c57215860628e55485728fc98129857e9231305742e0e31c03ea20fc1947f5100b6aee27191367b9f66e823c3eb75d2fe16e4a2258e012087bc38a423bb2' 'ac66d8cd615d8f5cf9cf8dce140670ebf7b30fdf2d0b84b3d66160ffd740c29324b81dfb589435802308fdcdc5d357f9b09fdab28c43e682e5317acebeb9d49d' - '200b22bee34c8afce01210cd13cda13997514461249f934b38be48ab346e8df13002379a44c99ebc2d5d5fbf7cf21c07961e202f396a5eb1b9284b0611165e2b' - '54e069a67db8911f003e60da3496455bd21466a3dc6d4253fa14e513cfc4eee6dbe3d3165fb93aeb9bd097f26b2035d1c60cfa171020325d695af1392300faa6' + 'e20806e077ef7bdb832040e235739fe6dc2fc7973fcb73628838b2a4b1a5e570379f4b2b4d09806d3bcf7941d276cdd458b4cd17d006deeb3cb23c4d67c6a638' + '3bab61310c08a6d5a1eab31783e7b0492979008723edbef17a96c9e7b273c96b2ba3e146aff8fc577909776284f40c5c48092b825a3ece48c0b9ac38e5515fe1' 'd32a8d25c7cdd7d13d530272e880381153fa86a5e99135481559eb81b0c1188dec2aabc1ef7a024b3791da17e2e9e1112a267261b43d49043dc81fb5622645cb' '763a8a8a27d8bb94f895489fe2f622f72eee3c7116ab8507235197ba9e3ab996aa2a16ce5f726eab47d361d35b044654b91bdca5742678417116ef18dcb07989') @@ -56,7 +56,8 @@ prepare() { cp "${srcdir}/orcs_${_orcsver}.teaac" "${srcdir}/t-engine4-src-${pkgver}/game/addons/orcs.teaac" cp "${srcdir}/cults_${_cultsver}.teaac" "${srcdir}/t-engine4-src-${pkgver}/game/addons/cults.teaac" patch -p1 -i "${srcdir}/offline-donator_${_offlinever}.patch" - patch -p1 -i "${srcdir}/sdl2-path-fix.patch" + mv premake4.lua premake5.lua + patch -p1 -i "${srcdir}/premake5.patch" patch -p1 -i "${srcdir}/O3-support.patch" } @@ -67,10 +68,10 @@ prepare() { build() { cd t-engine4-src-${pkgver} - premake4 gmake - # lto breaks compiling - export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIE" - export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIE" + premake5 gmake + # higher than -j1 or -flto=1 breaks compiling + export CFLAGS="$CFLAGS -O3 -fstack-protector-all -flto=1 -fPIE" + export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -flto=1 -fPIE" export LDFLAGS="$LDFLAGS,-pie" make config=release } diff --git a/premake5.patch b/premake5.patch new file mode 100644 index 0000000..7c24269 --- /dev/null +++ b/premake5.patch @@ -0,0 +1,457 @@ +diff -Naur orig/build/runner.lua new/build/runner.lua +--- orig/build/runner.lua 2014-05-19 10:42:12.000000000 +0200 ++++ new/build/runner.lua 2020-10-30 23:01:51.861023690 +0100 +@@ -24,28 +24,28 @@ + files { "../src/runner/main.c", "../src/getself.c" } + links { "m" } + +- configuration "linux" ++ filter "system:linux" + links { "dl", "SDL", "SDL_ttf", "SDL_image", "SDL_mixer", "GL", "GLU", "m", "pthread" } +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_LINUX' } ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_LINUX' } + +- configuration "bsd" ++ filter "system:bsd" + links { "SDL", "SDL_ttf", "SDL_image", "SDL_mixer", "GL", "GLU", "m", "pthread" } +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_BSD' } ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_BSD' } + +- configuration "windows" ++ filter "system:windows" + links { "mingw32", "SDLmain", "SDL", "SDL_ttf", "SDL_image", "SDL_mixer", "OPENGL32", "GLU32", "wsock32" } +- defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' } ++ defines { [[TENGINE_HOME_PATH="T-Engine"]], 'SELFEXE_WINDOWS' } + prebuildcommands { "windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res" } + linkoptions { "../src/windows/icon.res" } + +- configuration "macosx" +- defines { [[TENGINE_HOME_PATH='".t-engine"']], "USE_TENGINE_MAIN", 'SELFEXE_MACOSX' } ++ filter "system:macosx" ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], "USE_TENGINE_MAIN", 'SELFEXE_MACOSX' } + linkoptions { "-framework SDL", "-framework SDL_image", "-framework SDL_ttf", "-framework SDL_mixer", "-framework Cocoa", "-framework OpenGL" } + links { "IOKit" } + +- configuration {"Debug"} ++ filter {"Debug"} + postbuildcommands { "cp ../bin/Debug/t-engine ../t-engine", } +- configuration {"Release"} ++ filter {"Release"} + postbuildcommands { "cp ../bin/Release/t-engine ../t-engine", } + + project "te4runner" +@@ -58,19 +58,19 @@ + files { "../src/runner/runner.c", "../src/physfs.c", "../src/auxiliar.c" } + links { "runner-physfs", "runner-lua", "m" } + +- configuration "linux" +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_LINUX' } +- configuration "bsd" +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_BSD' } +- +- configuration "windows" +- defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' } +- configuration "macosx" +- defines { [[TENGINE_HOME_PATH='".t-engine"']], "USE_TENGINE_MAIN", 'SELFEXE_MACOSX' } ++ filter "system:linux" ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_LINUX' } ++ filter "system:bsd" ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_BSD' } ++ ++ filter "system:windows" ++ defines { [[TENGINE_HOME_PATH="T-Engine"]], 'SELFEXE_WINDOWS' } ++ filter "system:macosx" ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], "USE_TENGINE_MAIN", 'SELFEXE_MACOSX' } + +- configuration {"Debug"} ++ filter {"Debug"} + postbuildcommands { "cp ../bin/Debug/te4runner.tec ../", } +- configuration {"Release"} ++ filter {"Release"} + postbuildcommands { "cp ../bin/Release/te4runner.tec ../", } + + project "runner-physfs" +@@ -83,13 +83,13 @@ + + files { "../src/physfs/*.c", "../src/zlib/*.c", "../src/physfs/archivers/*.c", } + +- configuration "linux" ++ filter "system:linux" + files { "../src/physfs/platform/unix.c", "../src/physfs/platform/posix.c", } +- configuration "bsd" ++ filter "system:bsd" + files { "../src/physfs/platform/unix.c", "../src/physfs/platform/posix.c", } +- configuration "windows" ++ filter "system:windows" + files { "../src/physfs/platform/windows.c", } +- configuration "macosx" ++ filter "system:macosx" + files { "../src/physfs/platform/macosx.c", "../src/physfs/platform/posix.c", } + includedirs { "/Library/Frameworks/SDL.framework/Headers" } + +diff -Naur orig/build/te4core.lua new/build/te4core.lua +--- orig/build/te4core.lua 2019-10-03 15:35:43.000000000 +0200 ++++ new/build/te4core.lua 2020-10-30 23:05:15.066698600 +0100 +@@ -40,11 +40,11 @@ + links { "physfs", "lua".._OPTIONS.lua, "fov", "luasocket", "luaprofiler", "lpeg", "tcodimport", "lxp", "expatstatic", "luamd5", "luazlib", "luabitop", "te4-bzip", "te4-wfc", "utf8proc" } + if _OPTIONS.discord then defines { "DISCORD_TE4" } end + defines { "_DEFAULT_VIDEOMODE_FLAGS_='SDL_HWSURFACE|SDL_DOUBLEBUF'" } +- defines { [[TENGINE_HOME_PATH='".t-engine"']], "TE4CORE_VERSION="..TE4CORE_VERSION } ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], "TE4CORE_VERSION="..TE4CORE_VERSION } + buildoptions { "-O3" } + +- if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN/lib "} end +- if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN/lib64 "} end ++ if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN/lib "} end ++ if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN/lib64 "} end + + if _OPTIONS.relpath == "32" then defines{"TE4_RELPATH32"} end + if _OPTIONS.relpath == "64" then defines{"TE4_RELPATH64"} end +@@ -63,7 +63,7 @@ + prelinkcommands { "i686-pc-mingw32-ranlib ../bin/Debug/*.a" } + end + +- configuration "macosx" ++ filter "system:macosx" + files { "../src/mac/SDL*" } + includedirs { + "/System/Library/Frameworks/OpenGL.framework/Headers", +@@ -84,7 +84,7 @@ + "/usr/local/include", + "/usr/local/opt/libpng12/include", + } +- defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX', [[TENGINE_HOME_PATH='"/Library/Application Support/T-Engine/"']] } ++ defines { "USE_TENGINE_MAIN", 'SELFEXE_MACOSX', [[TENGINE_HOME_PATH="/Library/Application Support/T-Engine/"]] } + linkoptions { + "-framework Cocoa", + "-framework OpenGL", +@@ -108,9 +108,9 @@ + targetdir "." + links { "IOKit" } + +- configuration "windows" ++ filter "system:windows" + links { "mingw32", "SDL2main", "SDL2", "SDL2_ttf", "SDL2_image", "OpenAL32", "vorbisfile", "opengl32", "glu32", "wsock32", "png" } +- defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' } ++ defines { [[TENGINE_HOME_PATH="T-Engine"]], 'SELFEXE_WINDOWS' } + if _OPTIONS.wincross then + prebuildcommands { "i686-pc-mingw32-windres ../src/windows/icon.rc -O coff -o ../src/windows/icon.res" } + else +@@ -118,33 +118,33 @@ + end + linkoptions { "../src/windows/icon.res" } + linkoptions { "-mwindows" } +- defines { [[TENGINE_HOME_PATH='"T-Engine"']], 'SELFEXE_WINDOWS' } ++ defines { [[TENGINE_HOME_PATH="T-Engine"]], 'SELFEXE_WINDOWS' } + +- configuration "linux" ++ filter "system:linux" + libdirs {"/opt/SDL-2.0/lib/"} + links { "dl", "SDL2", "SDL2_ttf", "SDL2_image", "png", "openal", "vorbisfile", "GL", "GLU", "m", "pthread" } + linkoptions { "-Wl,-E" } +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_LINUX' } ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_LINUX' } + if steamlin64 then steamlin64() end + +- configuration "bsd" ++ filter "system:bsd" + libdirs {"/usr/local/lib/"} + links { "SDL2", "SDL2_ttf", "SDL2_image", "png", "openal", "vorbisfile", "GL", "GLU", "m", "pthread" } +- defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_BSD' } ++ defines { [[TENGINE_HOME_PATH=".t-engine"]], 'SELFEXE_BSD' } + +- configuration {"Debug"} ++ filter {"Debug"} + if _OPTIONS.wincross then + postbuildcommands { "cp ../bin/Debug/t-engine.exe ../", } + else +- if os.get() ~= "macosx" then postbuildcommands { "cp ../bin/Debug/t-engine ../", } ++ if os.target() ~= "macosx" then postbuildcommands { "cp ../bin/Debug/t-engine ../", } + else postbuildcommands { "cp ../build/t-engine.app/Contents/MacOS/t-engine ../mac/base_app/Contents/MacOS", } + end + end +- configuration {"Release"} ++ filter {"Release"} + if _OPTIONS.wincross then + postbuildcommands { "cp ../bin/Release/t-engine.exe ../", } + else +- if os.get() ~= "macosx" then postbuildcommands { "cp ../bin/Release/t-engine ../", } ++ if os.target() ~= "macosx" then postbuildcommands { "cp ../bin/Release/t-engine ../", } + else postbuildcommands { "cp ../build/t-engine.app/Contents/MacOS/t-engine ../mac/base_app/Contents/MacOS", } + end + end +@@ -165,13 +165,13 @@ + + files { "../src/physfs/*.c", "../src/zlib/*.c", "../src/physfs/archivers/*.c", } + +- configuration "linux" ++ filter "system:linux" + files { "../src/physfs/platform/unix.c", "../src/physfs/platform/posix.c", } +- configuration "bsd" ++ filter "system:bsd" + files { "../src/physfs/platform/unix.c", "../src/physfs/platform/posix.c", } +- configuration "windows" ++ filter "system:windows" + files { "../src/physfs/platform/windows.c", } +- configuration "macosx" ++ filter "system:macosx" + files { "../src/physfs/platform/macosx.c", "../src/physfs/platform/posix.c", } + includedirs { "/Library/Frameworks/SDL2.framework/Headers" } + +@@ -230,7 +230,7 @@ + defines { "LJ_ABI_SOFTFP=0" } + end + +- configuration {"Debug"} ++ filter {"Debug"} + if _OPTIONS.wincross then + postbuildcommands { + 'gcc -MMD -MP -DGLEW_STATIC -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I../src/luajit2/src -I../src/luajit2/dynasm -g -m32 -ggdb -o "../obj/Debug/minilua/minilua.cross.o" -c "../src/luajit2/src/host/minilua.c"', +@@ -238,7 +238,7 @@ + } + end + postbuildcommands { "cp ../bin/Debug/minilua ../src/luajit2/src/host/", } +- configuration {"Release"} ++ filter {"Release"} + if _OPTIONS.wincross then + postbuildcommands { + 'gcc -MMD -MP -DGLEW_STATIC -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I../src/luajit2/src -I../src/luajit2/dynasm -g -m32 -ggdb -o "../obj/Release/minilua/minilua.cross.o" -c "../src/luajit2/src/host/minilua.c"', +@@ -332,7 +332,7 @@ + + files { "../src/luajit2/src/host/buildvm*.c" } + +- configuration {"Debug"} ++ filter {"Debug"} + if _OPTIONS.wincross then + postbuildcommands { + 'gcc -MMD -MP -DGLEW_STATIC -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I../src/luajit2/src -I../src/luajit2/dynasm -g -m32 -ggdb -o "../obj/Debug/buildvm/buildvm_lib.cross.o" -c "../src/luajit2/src/host/buildvm_lib.c"', +@@ -344,7 +344,7 @@ + } + end + postbuildcommands { "cp ../bin/Debug/buildvm ../src/luajit2/src/", } +- configuration {"Release"} ++ filter {"Release"} + if _OPTIONS.wincross then + postbuildcommands { + 'gcc -MMD -MP -DGLEW_STATIC -DLUAJIT_TARGET=LUAJIT_ARCH_x86 -DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I../src/luajit2/src -I../src/luajit2/dynasm -g -m32 -ggdb -o "../obj/Release/buildvm/buildvm_lib.cross.o" -c "../src/luajit2/src/host/buildvm_lib.c"', +@@ -367,7 +367,7 @@ + files { "../src/luajit2/src/*.c", "../src/luajit2/src/*.s", "../src/luajit2/src/lj_vm.s", "../src/luajit2/src/lj_bcdef.h", "../src/luajit2/src/lj_ffdef.h", "../src/luajit2/src/lj_ffdef.h", "../src/luajit2/src/lj_libdef.h", "../src/luajit2/src/lj_recdef.h", "../src/luajit2/src/lj_folddef.h" } + excludes { "../src/luajit2/src/buildvm*.c", "../src/luajit2/src/luajit.c", "../src/luajit2/src/ljamalg.c" } + +- configuration "linux" ++ filter "system:linux" + if not _OPTIONS["no-cleanup-jit2"] then + local list = "../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c" + prebuildcommands{ +@@ -381,7 +381,7 @@ + } + end + +- configuration "bsd" ++ filter "system:bsd" + if not _OPTIONS["no-cleanup-jit2"] then + local list = "../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c" + prebuildcommands{ +@@ -395,7 +395,7 @@ + } + end + +- configuration "macosx" ++ filter "system:macosx" + local list = "../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c" + prebuildcommands{ + "../src/luajit2/src/buildvm -m machasm -o ../src/luajit2/src/lj_vm.s", +@@ -407,7 +407,7 @@ + "../src/luajit2/src/buildvm -m folddef -o ../src/luajit2/src/lj_folddef.h ../src/luajit2/src/lj_opt_fold.c", + } + +- configuration "windows" ++ filter "system:windows" + if not _OPTIONS["no-cleanup-jit2"] then + local list = "../src/luajit2/src/lib_base.c ../src/luajit2/src/lib_math.c ../src/luajit2/src/lib_bit.c ../src/luajit2/src/lib_string.c ../src/luajit2/src/lib_table.c ../src/luajit2/src/lib_io.c ../src/luajit2/src/lib_os.c ../src/luajit2/src/lib_package.c ../src/luajit2/src/lib_debug.c ../src/luajit2/src/lib_jit.c ../src/luajit2/src/lib_ffi.c" + prebuildcommands{ +@@ -429,7 +429,7 @@ + targetname "luasocket" + buildoptions { "-O2" } + +- configuration "not windows" ++ filter "system:not windows" + files { + "../src/luasocket/auxiliar.c", + "../src/luasocket/buffer.c", +@@ -445,7 +445,7 @@ + "../src/luasocket/usocket.c", + "../src/luasocket/mime.c", + } +- configuration "windows" ++ filter "system:windows" + files { + "../src/luasocket/auxiliar.c", + "../src/luasocket/buffer.c", +@@ -583,21 +583,21 @@ + buildoptions { "-O3", "-std=c++11" } + cppconfig("web") + +- if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN "} end +- if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN "} end ++ if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN "} end ++ if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN "} end + + files { "../src/web-cef3/*.cpp", } + +- configuration "macosx" ++ filter "system:macosx" + defines { 'SELFEXE_MACOSX' } + libdirs {"/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/xcodebuild/Release/", "/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/Release/"} + includedirs {"/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/include/", "/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/"} + links { "cef", "cef_dll_wrapper" } + +- configuration "windows" ++ filter "system:windows" + defines { 'SELFEXE_WINDOWS' } + +- configuration "linux" ++ filter "system:linux" + buildoptions{"-Wall -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm"} + libdirs {"/opt/cef3/1547/out/Release/obj.target/", "/opt/cef3/1547/Release/"} + includedirs {"/opt/cef3/1547/include/", "/opt/cef3/1547/"} +@@ -619,19 +619,19 @@ + "../src/web-cef3/spawn.cpp", + } + +- configuration "macosx" ++ filter "system:macosx" + defines { 'SELFEXE_MACOSX' } + libdirs {"/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/xcodebuild/Release/", "/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/Release/"} + includedirs {"/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/include/", "/Users/darkmac/libs/CEF/cef_binary_3.1547.1597_macosx64/"} + links { "cef", "cef_dll_wrapper" } + +- configuration "linux" ++ filter "system:linux" + buildoptions{"-Wall -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm"} + libdirs {"/opt/cef3/1547/out/Release/obj.target/", "/opt/cef3/1547/Release/"} + includedirs {"/opt/cef3/1547/include/", "/opt/cef3/1547/"} + links { "cef", "cef_dll_wrapper" } +- if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN/lib "} end +- if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\\$\$ORIGIN/lib64 "} end ++ if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN/lib "} end ++ if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath -Wl,\\$$ORIGIN/lib64 "} end + defines { 'SELFEXE_LINUX' } + end + +@@ -641,7 +641,7 @@ + + if _OPTIONS.discord and not _OPTIONS['discord-nolib'] then + project "te4-discord" +- configuration "linux" ++ filter "system:linux" + kind "SharedLib" + language "C++" + targetname "discord-rpc" +@@ -654,11 +654,11 @@ + files { "../src/discord-rpc/src/discord-rpc.cpp", "../src/discord-rpc/src/rpc_connection.cpp", "../src/discord-rpc/src/serialization.cpp", } + files { "../src/discord-rpc/src/connection_unix.cpp", "../src/discord-rpc/src/discord_register_linux.cpp", } + +- configuration "windows" ++ filter "system:windows" + kind "SharedLib" + -- Empty + +- configuration "macosx" ++ filter "system:macosx" + kind "SharedLib" + -- Empty + end +diff -Naur orig/premake5.lua new/premake5.lua +--- orig/premake5.lua 2019-09-13 11:46:14.000000000 +0200 ++++ new/premake5.lua 2020-10-30 23:04:41.500196031 +0100 +@@ -1,6 +1,6 @@ + dofile("build/options.lua") + +-solution "TEngine" ++workspace "TEngine" + configurations { "Debug", "Release" } + objdir "obj" + defines {"GLEW_STATIC"} +@@ -30,7 +30,7 @@ + } + else + includedirs { +- "/opt/SDL-2.0/include/SDL2", ++ "/usr/include/SDL2", + "/usr/include/GL", + } + end +@@ -42,7 +42,7 @@ + dofile("steamworks/build/steam-def.lua") + end + +-configuration "bsd" ++filter "system:bsd" + libdirs { + "/usr/local/lib", + } +@@ -51,7 +51,7 @@ + } + + if _OPTIONS.wincross then +-configuration "windows" ++filter "system:windows" + libdirs { + "/Test/xcompile/local//lib", + } +@@ -60,7 +60,7 @@ + "/Test/xcompile/local/include", + } + else +-configuration "windows" ++filter "system:windows" + libdirs { + "/c/code/SDL/lib", + } +@@ -72,7 +72,7 @@ + end + + cppconfig = function(what) +- if os.get() == "macosx" then ++ if os.target() == "macosx" then + if what == "web" then + buildoptions { "-stdlib=libstdc++" } + linkoptions { "-stdlib=libstdc++" } +@@ -84,9 +84,8 @@ + -- links { "stdc++" } + end + +-configuration "macosx" +- premake.gcc.cc = 'clang' +- premake.gcc.cxx = 'clang++' ++filter "system:macosx" ++ toolset("clang") + + buildoptions { "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk", "-mmacosx-version-min=10.7" } + includedirs { +@@ -95,9 +94,9 @@ + "/Library/Frameworks/SDL2_ttf.framework/Headers", + } + +-configuration "Debug" ++filter "Debug" + defines { } +- flags { "Symbols" } ++ symbols "On" + buildoptions { "-ggdb" } + -- buildoptions { "-O3" } + targetdir "bin/Debug" +@@ -105,9 +104,10 @@ + if _OPTIONS.pedantic then buildoptions { "-Wall" } end + defines {"TE4_LUA_ALLOW_GENERIC_IO"} + +-configuration "Release" ++filter "Release" + defines { "NDEBUG=1" } +- flags { "Optimize", "NoFramePointer" } ++ optimize "On" ++ omitframepointer "On" + buildoptions { "-O2" } + targetdir "bin/Release" + -- cgit v1.2.1