summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/HOWTO.OSX23
1 files changed, 19 insertions, 4 deletions
diff --git a/doc/HOWTO.OSX b/doc/HOWTO.OSX
index 326cb70..90c1aed 100644
--- a/doc/HOWTO.OSX
+++ b/doc/HOWTO.OSX
@@ -1,17 +1,28 @@
Followed: http://wiki.osdev.org/How_to_develop_on_Mac_OS_X
-brew uninstall binutils
+
lynx ftp://ftp.gnu.org/gnu/binutils/
lynx ftp://ftp.gnu.org/gnu/gcc/
tar zxvf binutils-2.28.tar.gz
tar zxvf gcc-6.3.0.tar.gz
cd gcc-6.3.0
contrib/download_prerequisites
+
+# new MacOS (brew)
+brew uninstall binutils
brew install gcc
export CC=/usr/local/bin/gcc-6
export CXX=/usr/local/bin/g++-6
export CPP=/usr/local/bin/cpp-6
export LD=/usr/local/bin/gcc-6
+
+# old MacOS (macports)
+sudo port install gcc
+sudo port select --set gcc mp-gcc7
+export CC=/opt/local/bin/gcc
+export CXX=/opt/local/bin/g++
+export CPP=/opt/local/bin/cpp
+export LD=/opt/local/bin/gcc
export PREFIX="$HOME/opt/cross"
export TARGET=i486-elf
export PATH="$PREFIX/bin:$PATH"
@@ -21,16 +32,20 @@ mv gcc-6.3.0* src
cd src/
mkdir build-binutils
cd build-binutils
-../binutils-2.28/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
+../binutils-2.28/configure --target=$TARGET --prefix="$PREFIX" \
+ --with-sysroot --disable-nls --disable-werror
make
make install
which -- $TARGET-as || echo $TARGET-as is not in the PATH
mkdir build-gcc
cd build-gcc
-../gcc-6.3.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
+../gcc-6.3.0/configure --target=$TARGET --prefix="$PREFIX" \
+ --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
-make CC=~/opt/cross/bin/i486-elf-gcc LD=~/opt/cross/bin/i486-elf-ld
+make TRUNCATE=gtruncate OBJCOPY=~/opt/cross/bin/i486-elf-objcopy \
+ CC=~/opt/cross/bin/i486-elf-gcc LD=~/opt/cross/bin/i486-elf-ld \
+ clean all run-qemu