From b99e0a057a27af8e9af10467e9082a5e2e7468bd Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 7 Dec 2010 10:24:30 -0500 Subject: [PATCH] add LD_RUN_PATH when using hard coded mysql paths --- ext/mysql2/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/mysql2/extconf.rb b/ext/mysql2/extconf.rb index a99fe73..413ba1b 100644 --- a/ext/mysql2/extconf.rb +++ b/ext/mysql2/extconf.rb @@ -62,4 +62,8 @@ unless RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /sparc/ end # $CFLAGS << ' -O0 -ggdb3 -Wextra' +if hard_mysql_path = $libs[%r{-L(/[^ ]+)}, 1] + $LDFLAGS << " -Wl,-rpath,#{hard_mysql_path}" +end + create_makefile('mysql2/mysql2')