Permalink
Browse files

fix linking issue under solaris

  • Loading branch information...
1 parent d7c6487 commit 46cb0bd56ab1a042e47c4224995012a70fae860d jfqd committed Jul 14, 2011
Showing with 14 additions and 5 deletions.
  1. +14 −5 ext/extconf.rb
View
19 ext/extconf.rb
@@ -40,13 +40,22 @@
system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
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')
+ if File.exists?("#{HERE}/lib/amd64/libmemcached.a")
+ # fix linking issue under solaris
+ # https://github.com/ninjudd/memcache/issues/5
+ Dir.chdir("#{HERE}/lib/amd64") do
+ system('cp -f libmemcached.a ../libmemcached_gem.a')
+ system('cp -f libmemcached.la ../libmemcached_gem.la')
+ end
+ else
+ Dir.chdir("#{HERE}/lib") do
+ system('cp -f libmemcached.a libmemcached_gem.a')
+ system('cp -f libmemcached.la libmemcached_gem.la')
+ end
end
-
+
$LIBS << " -lmemcached_gem"
end

0 comments on commit 46cb0bd

Please sign in to comment.