ext/libgecode3/extconf.rb in dep-selector-libgecode-1.0.0.rc.0 vs ext/libgecode3/extconf.rb in dep-selector-libgecode-1.0.0.rc.1

- old
+ new

@@ -46,18 +46,39 @@ def self.setup_env if windows? ENV['CC'] = 'gcc' ENV['CXX'] = 'g++' end + + # Configure the gecode libraries to look for other gecode libraries in the + # installed lib dir. This isn't needed for dep-selector to correctly link + # the libraries it uses, but if you check the libraries with `ldd`, they + # will appear to have missing deps or to link to system installed gecode. + # When used inside an Omnibus project, this will make the health checker + # report an error. + libpath = File.join(PREFIX, "lib") + ENV['LD_RUN_PATH'] = libpath end + # Depending on the version of mingw we're using, g++ may or may not fail when + # given the -pthreads option. When testing with `gcc version 4.6.2 (GCC)` + # mingw, this patch is required for the build to succeed. + def self.patch_configure + if windows? + original_configure = IO.read(configure) + original_configure.gsub!('pthread', 'mthread') + File.open(configure, "w+") { |f| f.print(original_configure) } + end + end + def self.system(*args) print("-> #{args.join(' ')}\n") super(*args) end def self.run_build_commands setup_env + patch_configure system(*configure_cmd) && system("make", "clean") && system("make", "-j", "5") && system("make", "install") end