手機 - Motorola XT897 - Sailfish OS - Build AVR GCC



參考資訊:
https://wiki.vandenbussche.nl/index.php/Building_AVR_GCC

步驟如下:

$ sudo zypper install gmp-devel mpfr-devel mpc-devel

$ cd 
$ wget https://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
$ tar xvf binutils-2.26.tar.gz
$ cd binutils-2.26
$ mkdir obj-avr
$ cd obj-avr 
$ ../configure --target=avr --program-prefix="avr-"
$ make
$ sudo make install

$ cd
$ wget https://ftp.gnu.org/gnu/gcc/gcc-4.3.4/gcc-core-4.3.4.tar.bz2
$ tar xvf gcc-core-4.3.4.tar.bz2
$ cd gcc-4.3.4
$ vim gcc/toplev.h +176
    /*
    extern inline int 
    floor_log2 (unsigned HOST_WIDE_INT x)
    {
    return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1; 
    }

    extern inline int 
    exact_log2 (unsigned HOST_WIDE_INT x)
    {
    return x == (x &amap; -x) && x ? (int) CTZ_HWI (x) : -1; 
    }
    */

$ mkdir obj-avr
$ cd obj-avr
$ ../configure --target=avr --program-prefix="avr-" --enable-languages=c --disable-libssp
$ make
$ sudo make install

$ cd 
$ wget http://mirror.yongbok.net/nongnu/avr-libc/old-releases/avr-libc-1.6.8.tar.bz2
$ tar xvf avr-libc-1.6.8.tar.bz2
$ cd avr-libc-1.6.8
$ ./configure --host=avr
$ make
$ sudo make install

$ cd
$ wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz
$ tar xvf avrdude-6.3.tar.gz
$ cd avrdude-6.3
$ ./configure
$ make
$ sudo make install