Commits

Michael Granger committed 8496c62

Add experimental -rpath to the LDFLAGS

Comments (0)

Files changed (1)

 if pgconfig = ( with_config('pg-config') || with_config('pg_config') || find_executable('pg_config') )
 	$stderr.puts "Using config values from %s" % [ pgconfig ]
 	$CPPFLAGS << " -I%s" % [ `"#{pgconfig}" --includedir`.chomp ]
-	$LDFLAGS << " -L%s" % [ `"#{pgconfig}" --libdir`.chomp ]
+
+	libdir = `"#{pgconfig}" --libdir`.chomp
+	$LDFLAGS << " -L%s -Wl,-rpath,%s" % [ libdir, libdir ]
 else
 	$stderr.puts "No pg_config... trying anyway. If building fails, please try again with",
 		" --with-pg-config=/path/to/pg_config"