<br><br><div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">paul beard</b> &lt;<a href="mailto:paulbeard@gmail.com">paulbeard@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div><span class="q"><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Sylvain</b> &lt;<a href="mailto:sylgar@ifrance.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">sylgar@ifrance.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br><br>How do I set the freshly installed gcc42 as the default compiler on my<br>system? Or at least make new ports compile with gcc42.</blockquote><div><br>&nbsp;</div></span><div>I assume you can edit the gcc_select command, since it&#39;s a shell script: I wondered about the same thing myself.&nbsp;
</div><div><br>&nbsp;</div><div>[/Users/paul]:: file `which gcc_select`</div><div>/usr/sbin/gcc_select: Bourne shell script text executable</div><div>&nbsp;</div></div></blockquote></div><div><br class="webkit-block-placeholder"></div>
Having said that (and looked at the script&#39;s guts), it doesn&#39;t look trivial to do ;-)&nbsp;<div><br class="webkit-block-placeholder"></div><div>However, running gcc_select with the -n flag gives you all the steps and you could build your own gcc selector/switcher, instead of hacking on the system script.&nbsp;
</div><div><br class="webkit-block-placeholder"></div><div><div>[/Users/paul]:: /usr/sbin/gcc_select -n 3.3</div><div>Commands that would be executed if &quot;-n&quot; were not specified:</div><div>&nbsp;&nbsp;mkdir -p /usr/bin</div>
<div>&nbsp;&nbsp;rm -f /usr/bin/cc /usr/bin/c++</div><div>&nbsp;&nbsp;rm -f /usr/bin/cc.real</div><div>&nbsp;&nbsp;rm -f /usr/bin/c++.real</div><div>&nbsp;&nbsp;rm -f /usr/bin/gcc.real</div><div>&nbsp;&nbsp;rm -f /usr/bin/g++.real</div><div>&nbsp;&nbsp;rm -f /usr/bin/gcov.real</div>
<div>&nbsp;&nbsp;ln -sf gcc-3.3 /usr/bin/cc</div><div>&nbsp;&nbsp;ln -sf g++-3.3 /usr/bin/c++</div><div>&nbsp;&nbsp;rm -f /usr/bin/gcc</div><div>&nbsp;&nbsp;ln -sf gcc-3.3 /usr/bin/gcc</div><div>&nbsp;&nbsp;rm -f /usr/bin/g++</div><div>&nbsp;&nbsp;ln -sf g++-3.3 /usr/bin/g++</div>
<div>&nbsp;&nbsp;rm -f /usr/bin/gcov</div><div>&nbsp;&nbsp;ln -sf gcov-3.3 /usr/bin/gcov</div><div>&nbsp;&nbsp;mkdir -p /usr/include/gcc/darwin</div><div>&nbsp;&nbsp;rm -f /usr/include/gcc/darwin/default</div><div>&nbsp;&nbsp;ln -sf 3.3 /usr/include/gcc/darwin/default</div>
<div>&nbsp;&nbsp;mkdir -p /usr/libexec/gcc/darwin/i386</div><div>&nbsp;&nbsp;rm -f /usr/libexec/gcc/darwin/i386/default</div><div>&nbsp;&nbsp;ln -sf 3.3 /usr/libexec/gcc/darwin/i386/default</div><div>&nbsp;&nbsp;mkdir -p /usr/libexec/gcc/darwin/ppc</div><div>&nbsp;&nbsp;rm -f /usr/libexec/gcc/darwin/ppc/default
</div><div>&nbsp;&nbsp;ln -sf 3.3 /usr/libexec/gcc/darwin/ppc/default</div><div>&nbsp;&nbsp;mkdir -p /usr/lib/gcc/darwin</div><div>&nbsp;&nbsp;rm -f /usr/lib/gcc/darwin/default</div><div>&nbsp;&nbsp;ln -sf 3.3 /usr/lib/gcc/darwin/default</div><div>&nbsp;&nbsp;mkdir -p /usr/lib
</div><div>&nbsp;&nbsp;rm -f /usr/lib/libcc_dynamic.a</div><div>&nbsp;&nbsp;rm -f /usr/lib/libcc_kext.a</div><div>&nbsp;&nbsp;rm -f /usr/lib/libgcc.a</div><div>&nbsp;&nbsp;rm -f /usr/lib/libcc.a</div><div>&nbsp;&nbsp;rm -f /usr/lib/libstdc++.a</div><div>&nbsp;&nbsp;mkdir -p /usr/local/lib
</div><div>&nbsp;&nbsp;rm -f /usr/local/lib/libcc_noc++.a</div><div>&nbsp;&nbsp;ln -sf gcc/darwin/default/libgcc.a /usr/lib/libcc_dynamic.a</div><div>&nbsp;&nbsp;mkdir -p /usr/include</div><div>&nbsp;&nbsp;rm -f /usr/include/stdint.h</div><div>&nbsp;&nbsp;ln -sf gcc/darwin/default/stdint.h /usr/include/stdint.h
</div><div>&nbsp;&nbsp;mkdir -p /usr/share/man/man1</div><div>&nbsp;&nbsp;rm -f /usr/share/man/man1/c++.1</div><div>&nbsp;&nbsp;ln -sf c++-3.3.1 /usr/share/man/man1/c++.1</div><div>&nbsp;&nbsp;rm -f /usr/share/man/man1/g++.1</div><div>&nbsp;&nbsp;ln -sf g++-3.3.1 /usr/share/man/man1/g++.1
</div><div>&nbsp;&nbsp;rm -f /usr/share/man/man1/gcc.1</div><div>&nbsp;&nbsp;ln -sf gcc-3.3.1 /usr/share/man/man1/gcc.1</div><div>&nbsp;&nbsp;rm -f /usr/share/man/man1/gcov.1</div><div>&nbsp;&nbsp;ln -sf gcov-3.3.1 /usr/share/man/man1/gcov.1</div><div>&nbsp;&nbsp;rm -f /usr/share/man/man1/cpp.1
</div><div>&nbsp;&nbsp;ln -sf cpp-3.3.1 /usr/share/man/man1/cpp.1</div><div>&nbsp;&nbsp;rm -rf /usr/share/man/man1/cc.1</div><div>&nbsp;&nbsp;ln -sf gcc.1 /usr/share/man/man1/cc.1</div><div><br class="webkit-block-placeholder"></div><br>-- <br>Paul Beard / 
<a href="http://www.paulbeard.org/">www.paulbeard.org/</a><br>&lt;<a href="http://paulbeard@gmail.com/paulbeard@mac.com">paulbeard@gmail.com/paulbeard@mac.com</a>&gt;<br>
</div>