ext/extconf.rb in memcached-seanl-0.19.5.5 vs ext/extconf.rb in memcached-seanl-0.19.5.6

- old
+ new

@@ -3,11 +3,15 @@ HERE = File.expand_path(File.dirname(__FILE__)) BUNDLE = Dir.glob("libmemcached-*.tar.gz").first BUNDLE_PATH = BUNDLE.sub(".tar.gz", "") +SOLARIS_32 = RbConfig::CONFIG['target'] == "i386-pc-solaris2.10" + $CFLAGS = "#{RbConfig::CONFIG['CFLAGS']} #{$CFLAGS}".gsub("$(cflags)", "").gsub("-fno-common", "") +$CFLAGS << " -std=gnu99" if SOLARIS_32 +$EXTRA_CONF = " --disable-64bit" if SOLARIS_32 $LDFLAGS = "#{RbConfig::CONFIG['LDFLAGS']} #{$LDFLAGS}".gsub("$(ldflags)", "").gsub("-fno-common", "") $CXXFLAGS = " -std=gnu++98 #{$CFLAGS}" $CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = "" if ENV['DEBUG'] @@ -23,31 +27,33 @@ $defines = " -DLIBMEMCACHED_WITH_SASL_SUPPORT" $libraries = " -L#{HERE}/lib" $CFLAGS = "#{$includes} #{$libraries} #{$CFLAGS}" $LDFLAGS = "#{$libraries} #{$LDFLAGS}" $LIBPATH = ["#{HERE}/lib"] - $DEFLIBPATH = [] + $DEFLIBPATH = [] unless SOLARIS_32 Dir.chdir(HERE) do if File.exist?("lib") puts "Libmemcached already built; run 'rake clean' first if you need to rebuild." else + tar = SOLARIS_32 ? 'gtar' : 'tar' + patch = SOLARIS_32 ? 'gpatch' : 'patch' # have_sasl check may fail on OSX, skip it # unless RUBY_PLATFORM =~ /darwin/ or have_library('sasl2') # raise "SASL2 not found. You need the libsasl2-dev library, which should be provided through your system's package manager." # end puts "Building libmemcached." - puts(cmd = "tar xzf #{BUNDLE} 2>&1") + puts(cmd = "#{tar} xzf #{BUNDLE} 2>&1") raise "'#{cmd}' failed" unless system(cmd) puts "Patching libmemcached source." - puts(cmd = "patch -p1 -Z < libmemcached.patch") + puts(cmd = "#{patch} -p1 -Z < libmemcached.patch") raise "'#{cmd}' failed" unless system(cmd) puts "Patching libmemcached with SASL support." - puts(cmd = "patch -p1 -Z < sasl.patch") + puts(cmd = "#{patch} -p1 -Z < sasl.patch") raise "'#{cmd}' failed" unless system(cmd) puts "Touching aclocal.m4 in libmemcached." puts(cmd = "touch -r #{BUNDLE_PATH}/m4/visibility.m4 #{BUNDLE_PATH}/configure.ac #{BUNDLE_PATH}/m4/pandora_have_sasl.m4") raise "'#{cmd}' failed" unless system(cmd)