title: How to install PL/R on Mountain Lion? make searching wrong path?
body: <p>I'm trying to install PL/R on Mountain Lion 10.8.2, I've installed R 2.15.3 from r-project and PostgreSQL 9.1 from KyngChaos. I've got PL/R 8.3.0.14 from <a href="http://www.joeconway.com/plr/" rel="nofollow">http://www.joeconway.com/plr/</a>. I've put the expanded folder in /usr/local/pgsql/share/contrib and cd'd into that folder.</p>
  
  <p>The environment variables $R_HOME and $CUSTOM_COPT are set as instructed at <a href="http://www.joeconway.com/web/guest/pl/r/-/wiki/Main/Installation_Mac" rel="nofollow">http://www.joeconway.com/web/guest/pl/r/-/wiki/Main/Installation_Mac</a> by writing them into .bash_profile, and also added /library/frameworks/r.framework/resources/bin to my path by writing to the same file.</p>
  
  <p>XCode 4.6 and the Command Line Tools are installed. There are multiple copies of standard C header files, including stdio.h, for example there is /usr/include/stdio.h.</p>
  
  <p>Next step seems to be:</p>
  
  <pre><code>DiMac:plr duncan$ make    
  Makefile:40: ../../src/Makefile.global: No such file or directory
  Makefile:41: /contrib/contrib-global.mk: No such file or directory
  make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.
  </code></pre>
  
  <p>That didn't work, and then I try:</p>
  
  <pre><code>DiMac:plr duncan$ make USE_PGXS=1
  gcc -Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -arch x86_64  -I"." -I"-I/library/frameworks/r.framework/resources/include" -I/library/frameworks/r.framework/resources/include -I. -I. -I/usr/local/pgsql-9.1/include/server -I/usr/local/pgsql-9.1/include/internal -I/usr/include/libxml2 -DPKGLIBDIR=\"/usr/local/pgsql-9.1/lib\" -DDLSUFFIX=\".so\" -DR_HOME_DEFAULT=\"/library/frameworks/r.framework/resources\"  -c -o plr.o plr.c
  In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
                   from plr.h:38,
                   from plr.c:33:
  /usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
  /usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
  ...
  </code></pre>
  
  <p>and then pages more of errors.</p>
  
  <p>It seems to me that <em>make</em> is looking in the wrong place for the standard header files and can't find them.From my reading around it seems that the flag <code>-isysroot</code> is telling <em>gcc</em> to look for header files by prepending the normal search path(s) with the <code>/developer.../macosx10.6.sdk</code> path and this path does not exist on my machine, which I believe is standard with the current version of Xcode.</p>
  
  <p>So, the question:</p>
  
  <p>Is this flag set somehow by the <em>Makefile</em> within /plr, or is it set somewhere else? Either way, how do I change it to get <em>make</em> to find the header files that it needs? If changing it is, indeed, the correct thing to do?</p>