diff --git a/ext/extconf.rb b/ext/extconf.rb index 64df863..72c6836 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -130,4 +130,8 @@ end $CPPFLAGS += " -DRUBY19" if RUBY_VERSION =~ /1.9/ -create_makefile("mysql") \ No newline at end of file +if hard_mysql_path = $libs[%r{-L(/[^ ]+)}, 1] + $LDFLAGS << " -Wl,-rpath,#{hard_mysql_path}" +end + +create_makefile("mysql")