commit adf910274647666a46c548761fa618932f177753
parent fcca38b64f49a1541e4c56530c9ae3f2e0ff1bcc
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 30 Jul 2018 11:05:56 -0400
provide a better way to link against a custom curl
Diffstat:
3 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
@@ -37,7 +37,16 @@ Install GCC/G++ (multilib version if building for both 64-bit and 32-bit),
tup, Ruby and PHP.
Install libraries and development files for Boost (1.56 or newer), Catch2,
-curl (7.52 or newer), SQLite3 and zlib matching the target architecture(s).
+libcurl (7.52 or newer), SQLite3 and zlib matching the target architecture(s).
+
+#### Custom libcurl
+
+Set the `CURLSO` environment variable to override the system default libcurl
+used for linking. Some older distributions still ship libcurl with the old
+pre-7.16 SONAME. Consider using a libcurl built with `--disable-versioned-symbols`
+to produce more compatible binaries (`libcurl-compat` on Arch Linux).
+
+ CURLSO=:libcurl.so.3 tup
### macOS
diff --git a/Rakefile b/Rakefile
@@ -24,23 +24,3 @@ task :test do
sh exe
}
end
-
-# HACK: Produce binaries without curl versioned symbols for quick and dirty
-# compatibility with most distributions.
-task :'libcurl-compat' 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. " \
- "Are libcurl-compat and lib32-libcurl-compat installed (Arch Linux)?" %
- [pattern, variant]
- end
-
- ENV['CURLSO'] = curlso
- sh 'tup', variant, verbose: false
- }
-end
diff --git a/linux.tup b/linux.tup
@@ -17,7 +17,7 @@ SWELL := $(WDL)/swell
WDLSOURCE += $(SWELL)/swell-modstub-generic.cpp
export CURLSO
-LDFLAGS := -lstdc++ -lpthread -ldl ${CURLSO:--lcurl} -lsqlite3 -lz
+LDFLAGS := -lstdc++ -lpthread -ldl -l${CURLSO:-curl} -lsqlite3 -lz
SOFLAGS := -shared
SOTARGET := bin/$(REAPACK_FILE)