title: How to do runtime linking in make using LDFLAGS -R option, or some other way
body: <p>This is a question on run time linking in make, in general.</p>
  
  <p>I am trying to install tmux from source, on a linux system. It has dependency on "libevent" which I have installed in home dir. I am not the root on this system so I can't install it in system wide area.</p>
  
  <p>DIR=$HOME/libevent
  ./configure --prefix=$HOME/site/tmux/ CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib/" </p>
  
  <p>Though above command works but I need to have $HOME/libevent included in the LD_LIBRARY_PATH all the time for tmux to work. I think there should be a better way.</p>
  
  <p>I need a run time linking so that I don't have to mess with LD_LIBRARY_PATH. I read here <a href="http://www.ilkda.com/compile/Environment_Variables.htm" rel="nofollow">http://www.ilkda.com/compile/Environment_Variables.htm</a> that, this can be achieved using "-R" option.</p>
  
  <p>./configure --prefix=$HOME/site/tmux/ CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib/" LDFLAGS="-R$DIR/lib/"</p>
  
  <p>But this is not working and produces the following error:
  configure: error: "libevent not found"</p>
  
  <p>Can someone let me know how to do run time linking in make while running configure script.</p>