title: How can I link the source path of a compiled library to a different location in Eclipse?
body: <p>I've installed the msp430-gcc compiler and associated tools to do some open-source msp430 development at home using Eclipse. I'm developing on a slightly older Macbook Pro running OS X Lion and installed the tools using MacPorts. I'm running Eclipse 3.7.2 with the CDT and GCC Cross Compiler Support plug-ins. I have a simple empty main() written that compiles and links just fine.</p>
  
  <p>The ELF parser lets me view the contents of the ELF binary just fine with the exception of one component; when I try to view the contents of the startup code in crt0.S, it gives me a blank file. When I click on the crt0.S component of the ELF, the filename bar at the bottom of the Eclipse window shows <code>"/opt/local/var/macports/build/_Volumes_work_mports_dports_cross_msp430-gcc/msp430-gcc/work/gcc-4.6.3/gcc/config/msp430/crt0.S"</code>. This makes sense because of my MacPorts install of msp430-gcc. <code>crt0.S</code> is archived into <code>/opt/local/lib/gcc/msp430/4.6.3/libcrt0.a on my machine.</code></p>
  
  <p>What I want to be able to do is tell Eclipse to look elsewhere for the source files for the libraries that are automatically linked when I build with the msp430-gcc toolchain.  This would presumably include everything in <code>/opt/local/lib/gcc/msp430/4.6.3/</code>. I started by downloading the source for mspgcc-20120406 (the version in my MacPorts install) and applying the gcc patchfile to an empty directory tree. This created the <code>gcc/config/msp430</code> directory, including the <code>crt0.S</code> and <code>crt0ivtbl.S</code> files.</p>
  
  <p>What I have had no luck accomplishing is telling Eclipse to look in <code>~/Developer/mspgcc-20120406/gcc-4.6.3/config/msp430/</code> instead of the path that's in the already-built <code>libcrt0.a</code>. I tried playing around with the <code>Project Preferences-&gt;Paths and Symbols-&gt;Source Location</code> window, but didn't have much luck. I searched through this website and on Google and the closest thing I came up with was <a href="https://stackoverflow.com/questions/6784543/how-to-attach-source-to-the-libraries-on-eclipse-cdt">this question</a> but it doesn't "smell" like the right answer.</p>
  
  <p>I would like to avoid solutions that involve moving the library source into my project. I'd rather have a solution that will work for multiple projects.</p>
  
  <p>All help is greatly appreciated! Thanks in advance.</p>