reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 27f57993b269296a8083d36d367e63ebd576044b
parent 10ec7813655f99af227b53ca1896f72ff1a3de4e
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sat, 16 Sep 2017 22:17:16 -0400

support 32-bit Linux builds using gcc-multilib

Diffstat:
MREADME.md | 14++++++++------
MRakefile | 2--
Mlinux.tup | 8++------
Msrc/platform.cpp | 22++++++++++++----------
Msrc/platform.hpp | 1+
Mtest/platform.cpp | 26++++++++++++++++----------
6 files changed, 39 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md @@ -38,10 +38,12 @@ vendor ### Linux -1. Install gcc, tup, ruby and php +1. Install gcc-multilib, tup, ruby and php 2. Install boost, curl and sqlite3 development files + (32-bit and 64-bit versions depending on your vendor) 3. Build using `rake` -4. Copy or link `x64/bin/reaper_reapack64.so` to `~/.REAPER/UserPlugins` +4. Copy or link `x64/bin/reaper_reapack64.so` or `x86/bin/reaper_reapack32.so` + to `~/.REAPER/UserPlugins` ### macOS @@ -55,7 +57,7 @@ vendor - [shellexecute-https](https://github.com/cfillion/WDL/commit/0424a87047470aefbeef98526622e5af5f919ac9.patch) 3. Build using `rake` 5. Copy or link `x64/bin/reaper_reapack64.dylib` or `x86/bin/reaper_reapack32.dylib` - to REAPER's extension directory + to REAPER's extension directory ### Windows @@ -65,9 +67,9 @@ vendor thread](https://groups.google.com/d/topic/tup-users/UNUSE15PQdA/discussion)) and [Visual Studio 2017, with C++ support](https://www.visualstudio.com/vs/community/) 2. Prevent Microsoft's C++ compiler from saving telemetry outside of the build directory: - [instructions here](https://msdn.microsoft.com/en-us/library/ee225238.aspx#Anchor_5) - or set the `OptIn` registry key to `0` in - `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VSCommon\15.0\SQM` + [instructions here](https://msdn.microsoft.com/en-us/library/ee225238.aspx#Anchor_5) + or set the `OptIn` registry key to `0` in + `HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VSCommon\15.0\SQM` 3. Download the latest [boost](http://www.boost.org/) and copy the `boost` subdirectory into `vendor` 4. Download the latest [curl](http://curl.haxx.se/download.html) source diff --git a/Rakefile b/Rakefile @@ -11,8 +11,6 @@ task :build, [:variants] do |_, args| vars = Array(args[:variants]) + args.extras vars.reject &:empty? - vars = ['x64'] if vars.empty? && RUBY_PLATFORM.include?('linux') - if Gem.win_platform? && ENV['VCINSTALLDIR'].nil? raise "VCINSTALLDIR is unset. Is this Developer Command Prompt for Visual Studio?" end diff --git a/linux.tup b/linux.tup @@ -1,8 +1,4 @@ -ifeq (@(ARCH),x86_64) - CXX := gcc -else - CXX := echo 'Unsupported architecture: @(ARCH)' && false -endif +CXX := gcc REAPACK_FILE = reaper_reapack@(SUFFIX).so @@ -10,7 +6,7 @@ CXXFLAGS := -Wall -Wextra -Werror CXXFLAGS += -Wno-unused-parameter -Wno-missing-field-initializers CXXFLAGS += -Wno-unused-function -Wno-missing-braces CXXFLAGS += -fdiagnostics-color -fstack-protector-strong -fvisibility=hidden -CXXFLAGS += -pipe -fPIC -O2 -std=c++14 +CXXFLAGS += -pipe -fPIC -O2 -std=c++14 -m@(SUFFIX) CXXFLAGS += -Ivendor -Ivendor/WDL -Ivendor/WDL/WDL -Ivendor/WDL/WDL/swell CXXFLAGS += -DWDL_NO_DEFINE_MINMAX -DSWELL_PROVIDED_BY_APP -DSWELL_TARGET_GDK CXXFLAGS += -DREAPACK_FILE=\"$(REAPACK_FILE)\" diff --git a/src/platform.cpp b/src/platform.cpp @@ -37,6 +37,8 @@ auto Platform::parse(const char *platform) -> Enum return Darwin64Platform; else if(!strcmp(platform, "linux")) return LinuxPlatform; + else if(!strcmp(platform, "linux32")) + return Linux32Platform; else if(!strcmp(platform, "linux64")) return Linux64Platform; else @@ -49,25 +51,25 @@ bool Platform::test() const case GenericPlatform: #ifdef __APPLE__ case DarwinPlatform: -#ifdef __x86_64__ +# ifdef __x86_64__ case Darwin64Platform: -#else +# else case Darwin32Platform: -#endif - +# endif #elif __linux__ case LinuxPlatform: -#ifdef __x86_64__ +# ifdef __x86_64__ case Linux64Platform: -#endif - +# else + case Linux32Platform: +# endif #elif _WIN32 case WindowsPlatform: -#ifdef _WIN64 +# ifdef _WIN64 case Win64Platform: -#else +# else case Win32Platform: -#endif +# endif #endif return true; default: diff --git a/src/platform.hpp b/src/platform.hpp @@ -33,6 +33,7 @@ public: Darwin64Platform, LinuxPlatform, + Linux32Platform, Linux64Platform, }; diff --git a/test/platform.cpp b/test/platform.cpp @@ -42,6 +42,9 @@ TEST_CASE("platform from string", M) { SECTION("generic linux") REQUIRE(Platform("linux") == Platform::LinuxPlatform); + SECTION("linux 32-bit") + REQUIRE(Platform("linux32") == Platform::Linux32Platform); + SECTION("linux 64-bit") REQUIRE(Platform("linux64") == Platform::Linux64Platform); } @@ -58,14 +61,13 @@ TEST_CASE("test platform", M) { {Platform::Win64Platform, false}, {Platform::DarwinPlatform, true}, -#ifdef __x86_64__ +# ifdef __x86_64__ {Platform::Darwin32Platform, false}, {Platform::Darwin64Platform, true}, -#else +# else {Platform::Darwin32Platform, true}, {Platform::Darwin64Platform, false}, -#endif - +# endif #elif __linux__ {Platform::DarwinPlatform, false}, {Platform::Darwin32Platform, false}, @@ -75,8 +77,13 @@ TEST_CASE("test platform", M) { {Platform::Win64Platform, false}, {Platform::LinuxPlatform, true}, +# ifdef __x86_64__ + {Platform::Linux32Platform, false}, {Platform::Linux64Platform, true}, - +# else + {Platform::Linux32Platform, true}, + {Platform::Linux64Platform, false}, +# endif #elif _WIN32 {Platform::DarwinPlatform, false}, {Platform::Darwin32Platform, false}, @@ -85,16 +92,15 @@ TEST_CASE("test platform", M) { {Platform::Linux64Platform, false}, {Platform::WindowsPlatform, true}, -#ifdef _WIN64 +# ifdef _WIN64 {Platform::Win32Platform, false}, {Platform::Win64Platform, true}, -#else +# else {Platform::Win32Platform, true}, {Platform::Win64Platform, false}, -#endif - +# endif #else -#error Untested platform +# error Untested platform #endif };