From 2eb503a89d58e8ed93897ae220e621505df740f2 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 17 Nov 2010 11:18:42 -0500 Subject: [PATCH] when a mysql directory is specified in the lib list, tell the linker to add that directory to the compiled library's LD_RUN_PATH --- ext/extconf.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")