<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,16 @@ PATCH_MIRROR=&quot;http://www.iphonelinux.org&quot;
 PATCH_GCC411_ARMELF=&quot;t-arm-elf.patch&quot;
 PATCH_NEWLIB_MAKEINFO=&quot;newlib-1.14.0-missing-makeinfo.patch&quot;
 
+NEEDROOT=0
+
+if [ -z &quot;$IPHONELINUXDEV&quot; ]; then
+	PREFIX=/usr/local
+	NEEDROOT=1
+else
+	PREFIX=&quot;$IPHONELINUXDEV&quot;
+fi
+
+export PATH=&quot;$PATH:$PREFIX/bin&quot;
 
 #LOG FILE
 BUILDLOG=build.log
@@ -25,9 +35,9 @@ BUILDLOG=build.log
 # display usage
 Usage () 
 { 
-	if [ &quot;$(id -u)&quot; != &quot;0&quot; ]; then
-   echo &quot;This script must be run as root&quot; 1&gt;&amp;2
-   exit 1
+	if [ &quot;$NEEDROOT&quot; == &quot;1&quot; -a &quot;$(id -u)&quot; != &quot;0&quot; ]; then
+		echo &quot;This script must be run as root&quot; 1&gt;&amp;2
+		exit 1
 	fi
 
 	if [ -z &quot;$1&quot; ];
@@ -144,7 +154,7 @@ checkRet $? &quot;Failed to extract package $PKG_BINUTILS&quot; $EXIT_TRUE
 
 echo -en &quot;- Doing binutils configure\n&quot;
 cd $TOOLCHAIN_PATH/binutils-build
-../binutils-2.17/configure --target=arm-elf --prefix=/usr/local \
+../binutils-2.17/configure --target=arm-elf --prefix=$PREFIX \
 	--enable-interwork --enable-multilib --disable-werror &gt;&gt; $TOOLCHAIN_PATH/$BUILDLOG 2&gt;&amp;1
 checkRet $? &quot;Failed to configure binutils&quot; $EXIT_TRUE
 
@@ -174,7 +184,7 @@ patch -p0 &lt; $PATCH_GCC411_ARMELF &gt;&gt; $TOOLCHAIN_PATH/$BUILDLOG 2&gt;&amp;1
 checkRet $? &quot;Failed to apply patch for t-arm-elf&quot; $EXIT_TRUE
 echo -en &quot;- Doing GCC configure\n&quot;
 cd gcc-build
-../gcc-4.1.1/configure --target=arm-elf --prefix=/usr/local \
+../gcc-4.1.1/configure --target=arm-elf --prefix=$PREFIX \
     --enable-interwork --enable-multilib \
     --enable-languages=&quot;c,c++&quot; --with-newlib \
     --with-headers=../newlib-1.14.0/newlib/libc/include --disable-werror &gt;&gt; $TOOLCHAIN_PATH/$BUILDLOG 2&gt;&amp;1
@@ -198,7 +208,7 @@ checkRet $? &quot;Failed to apply patch for newlib makeinfo&quot; $EXIT_TRUE
 echo -en &quot;- Doing NewLib configure\n&quot;
 cd newlib-build
 checkRet $? &quot;Failed to configure newlib&quot; $EXIT_TRUE
-../newlib-1.14.0/configure --target=arm-elf --prefix=/usr/local \
+../newlib-1.14.0/configure --target=arm-elf --prefix=$PREFIX \
 	--enable-interwork --enable-multilib --disable-werror &gt;&gt; $TOOLCHAIN_PATH/$BUILDLOG 2&gt;&amp;1
 
 echo -en &quot;- Making arm-elf-cc symlink\n&quot;</diff>
      <filename>toolchain/build-toolchain.sh</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b40cc4d09cdf543ed2221709c3a81e4d08c172ff</id>
    </parent>
  </parents>
  <author>
    <name>Hector Martin</name>
    <email>hector@marcansoft.com</email>
  </author>
  <url>http://github.com/planetbeing/iphonelinux/commit/9b8d27ef00f82f751149e72b7921d42f9a77fa3b</url>
  <id>9b8d27ef00f82f751149e72b7921d42f9a77fa3b</id>
  <committed-date>2009-06-23T22:12:53-07:00</committed-date>
  <authored-date>2009-06-23T22:12:53-07:00</authored-date>
  <message>Make toolchain prefix configurable to avoid root requirement</message>
  <tree>77b4d07f1201cf9f8605f9ac37b13cda5bccc2ea</tree>
  <committer>
    <name>Hector Martin</name>
    <email>hector@marcansoft.com</email>
  </committer>
</commit>
