misc/rake/cplusplus.rb in passenger-2.2.1 vs misc/rake/cplusplus.rb in passenger-2.2.2

- old
+ new

@@ -30,9 +30,16 @@ def compile_cxx(source, flags = CXXFLAGS) sh "#{CXX} #{flags} -c #{source}" end def create_static_library(target, sources) + # On OS X, 'ar cru' will sometimes fail with an obscure error: + # + # ar: foo.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) + # ar: foo.a: Inappropriate file type or format + # + # So here we delete the ar file before creating it, which bypasses this problem. + sh "rm -rf #{target}" sh "ar cru #{target} #{sources}" sh "ranlib #{target}" end def create_executable(target, sources, linkflags = LDFLAGS)