зеркало из https://github.com/github/memcached.git
Revert "Use -rpath to support shared objects properly." Doesn't work on Linux.
This reverts commit d35eb27077
.
This commit is contained in:
Родитель
d35eb27077
Коммит
700ac69756
|
@ -1,6 +1,4 @@
|
|||
|
||||
v0.15.3. Switch to -rpath linker flag and use dynamic objects in the build (Matt Ingenthron).
|
||||
|
||||
v0.15.2. Don't require memcached itself to build. Fix for AUTO_EJECT_HOSTS in random and modulus pools. Support binary protocol.
|
||||
|
||||
v0.15.1. Fix build problem.
|
||||
|
|
|
@ -5,11 +5,7 @@ HERE = File.expand_path(File.dirname(__FILE__))
|
|||
BUNDLE = Dir.glob("libmemcached-*.tar.gz").first
|
||||
BUNDLE_PATH = BUNDLE.sub(".tar.gz", "")
|
||||
|
||||
TARGET = if `uname -sp` == "Darwin i386\n"
|
||||
:darwin
|
||||
else
|
||||
:linux
|
||||
end
|
||||
DARWIN = `uname -sp` == "Darwin i386\n"
|
||||
|
||||
if !ENV["EXTERNAL_LIB"]
|
||||
$includes = " -I#{HERE}/include"
|
||||
|
@ -17,9 +13,8 @@ if !ENV["EXTERNAL_LIB"]
|
|||
|
||||
$CFLAGS = "#{$includes} #{$libraries} #{$CFLAGS}"
|
||||
$LDFLAGS = "#{$libraries} #{$LDFLAGS}"
|
||||
$LIBS << " -lmemcached"
|
||||
|
||||
$CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
|
||||
|
||||
$LIBPATH = ["#{HERE}/lib"]
|
||||
$DEFLIBPATH = []
|
||||
|
||||
|
@ -30,27 +25,28 @@ if !ENV["EXTERNAL_LIB"]
|
|||
puts "Building libmemcached."
|
||||
puts(cmd = "tar xzf #{BUNDLE} 2>&1")
|
||||
raise "'#{cmd}' failed" unless system(cmd)
|
||||
|
||||
env = case TARGET
|
||||
when :solaris then "CFLAGS='-fPIC -R=#{HERE}/lib' LDFLAGS='-fPIC -rpath=#{HERE}/lib'"
|
||||
when :darwin, :linux then "CFLAGS='-fPIC -rpath=#{HERE}/lib' LDFLAGS='-fPIC -rpath=#{HERE}/lib'"
|
||||
end
|
||||
|
||||
Dir.chdir(BUNDLE_PATH) do
|
||||
puts(cmd = "env #{env} ./configure --prefix=#{HERE} --without-memcached --disable-utils 2>&1")
|
||||
puts(cmd = "env CFLAGS=-fPIC LDFLAGS=-fPIC ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils 2>&1")
|
||||
raise "'#{cmd}' failed" unless system(cmd)
|
||||
puts(cmd = "make 2>&1")
|
||||
puts(cmd = "make || true 2>&1")
|
||||
raise "'#{cmd}' failed" unless system(cmd)
|
||||
puts(cmd = "make install 2>&1")
|
||||
puts(cmd = "make install || true 2>&1")
|
||||
raise "'#{cmd}' failed" unless system(cmd)
|
||||
end
|
||||
system("rm -rf #{BUNDLE_PATH}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Absolutely prevent the linker from picking up any other libmemcached
|
||||
Dir.chdir("#{HERE}/lib") do
|
||||
system("cp -f libmemcached.a libmemcached_gem.a")
|
||||
system("cp -f libmemcached.la libmemcached_gem.la")
|
||||
end
|
||||
$LIBS << " -lmemcached_gem"
|
||||
end
|
||||
|
||||
case TARGET
|
||||
when :darwin
|
||||
if DARWIN
|
||||
$CFLAGS.gsub! /-arch \S+/, ''
|
||||
$CFLAGS << " -arch i386"
|
||||
$LDFLAGS.gsub! /-arch \S+/, ''
|
||||
|
|
Загрузка…
Ссылка в новой задаче