commit adabba7acc27e9fe5a665d637627a7d66da7826c
parent f881e0530b2b2c61a77ab0206bae381ae5289cd4
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 12 Nov 2017 03:14:41 -0500
attempt to produce binaries compatible with more Linux flavors
- Arch Linux's curl uses CURL_OPENSSL_4 as symbol version.
- Linux Mint's curl uses CURL_OPENSSL_3 as symbol version.
This commit adds `rake linux-portable` as a quick and dirty hack to link
against Arch's curl-compat/lib32-curl-compat package which does not use
versioned symbols.
Diffstat:
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/Rakefile b/Rakefile
@@ -3,7 +3,7 @@ task :default => [:prepare, :build, :test]
desc 'Prepare the source code for building using prepare.rb'
task :prepare do
sources = FileList['src/*.{{h,c}pp,mm}']
- ruby 'prepare.rb', *sources, :verbose => false
+ ruby 'prepare.rb', *sources, verbose: false
end
desc 'Build ReaPack (by default both 64-bit and 32-bit builds are generated)'
@@ -15,7 +15,7 @@ task :build, [:variants] do |_, args|
raise "VCINSTALLDIR is unset. Is this Developer Command Prompt for Visual Studio?"
end
- sh 'tup', *vars, :verbose => false
+ sh 'tup', *vars, verbose: false
end
desc 'Run the test suite for all architectures'
@@ -24,3 +24,23 @@ task :test do
sh exe
}
end
+
+# HACK: Produce binaries without curl versioned symbols for quick and dirty
+# compatibility with most distributions.
+task :'linux-portable' do
+ {
+ 'x64' => '/usr/lib/libcurl-compat.so*',
+ 'x86' => '/usr/lib32/libcurl-compat.so*',
+ }.each {|variant, pattern|
+ curlso = Dir.glob(pattern).first
+
+ unless curlso
+ raise "'%s' cannot be found for %s." \
+ "Is libcurl-compat/lib32-libcurl-compat installed (on Arch Linux)?" %
+ [pattern, variant]
+ end
+
+ ENV['CURLSO'] = curlso
+ sh 'tup', variant, verbose: false
+ }
+end
diff --git a/linux.tup b/linux.tup
@@ -16,7 +16,8 @@ WDLFLAGS := -std=c++98 -w
SWELL := $(WDL)/swell
WDLSOURCE += $(SWELL)/swell-modstub-generic.cpp
-LDFLAGS := -lstdc++ -lpthread -ldl -lcurl -lsqlite3
+export CURLSO
+LDFLAGS := -lstdc++ -lpthread -ldl ${CURLSO:--lcurl} -lsqlite3
SOFLAGS := -shared
SOTARGET := bin/$(REAPACK_FILE)