Votre Nom 2 years ago
parent
commit
1fd23f7385
9 changed files with 44 additions and 6 deletions
  1. 20 0
      .gitignore
  2. 1 0
      build-avr-binutils
  3. 3 3
      build-avr-gcc
  4. 1 0
      build-avr-gdb
  5. 6 0
      build-avr-libc
  6. 3 0
      build-avrdude
  7. 2 1
      build-simulavr
  8. 7 1
      prerequise.sh
  9. 1 1
      release_package.sh

+ 20 - 0
.gitignore

@@ -0,0 +1,20 @@
+.prereq
+binutils-2.37
+binutils-2.37_bld
+swig-3.0.12
+gcc-7.5.0
+gcc-7.5.0_bld
+gdb-8.1.1
+gdb-8.1.1_bld
+avrdude-6.3_bld
+avrdude-6.3
+avr-libc-2.0.0_bld
+avr-libc-2.0.0
+simulavr
+avrdude-6.3.tar.xz
+avr-libc-2.0.0.tar.xz
+binutils-2.37.tar.xz
+gdb-8.1.1.tar.xz
+simulavr.tar.xz
+gcc-7.5.0.tar.xz
+avr_toolchain.tar.xz

+ 1 - 0
build-avr-binutils

@@ -4,6 +4,7 @@
 
 # Stop on errors
 set -e
+if [ ! -f .prereq ];then ./prerequise.sh;fi
 
 source avr-file-names
 

+ 3 - 3
build-avr-gcc

@@ -4,6 +4,7 @@
 
 # Stop on errors
 set -e
+if [ ! -f .prereq ];then ./prerequise.sh;fi
 
 source avr-file-names
 
@@ -38,10 +39,9 @@ cd ..
 
 makeDir $NAME_GCC_BLD
 cd $NAME_GCC_BLD
-../$NAME_GCC/configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --disable-libada \
---with-dwarf2 --disable-shared --enable-static
+../$NAME_GCC/configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --disable-libada --with-dwarf2 --disable-shared --enable-static
 make -j $JOBCOUNT
-sudo make -j4 install-strip
+sudo make install-strip
 cd ..
 
 

+ 1 - 0
build-avr-gdb

@@ -4,6 +4,7 @@
 
 # Stop on errors
 set -e
+if [ ! -f .prereq ];then ./prerequise.sh;fi
 
 source avr-file-names
 

+ 6 - 0
build-avr-libc

@@ -4,6 +4,7 @@
 
 # Stop on errors
 set -e
+if [ ! -f .prereq ];then ./prerequise.sh;fi
 
 source avr-file-names
 
@@ -31,6 +32,11 @@ rm -rf $NAME_LIBC/
 tar xJf $NAME_LIBC.tar.xz
 
 makeDir $NAME_LIBC_BLD
+AR='avr-ar'
+AS='avr-as'
+CC='avr-gcc'
+CCAS='gcc'
+
 cd $NAME_LIBC_BLD
 ../$NAME_LIBC/configure --prefix=$PREFIX --build=$(../$NAME_LIBC/config.guess) --host=avr
 make -j $JOBCOUNT

+ 3 - 0
build-avrdude

@@ -5,6 +5,9 @@
 # Stop on errors
 set -e
 
+if [ ! -f .prereq ];then ./prerequise.sh;fi
+
+
 source avr-file-names
 
 TIME_START=$(date +%s)

+ 2 - 1
build-simulavr

@@ -5,6 +5,7 @@
 
 # Stop on errors
 set -e
+if [ ! -f .prereq ];then ./prerequise.sh;fi
 
 source avr-file-names
 
@@ -12,7 +13,7 @@ TIME_START=$(date +%s)
 
 echo "Downloading sources..."
 wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/simulavr.tar.xz
-tar xfJ pack/simulavr.tar.xz
+tar xfJ simulavr.tar.xz
 
 # Make simulavr
 echo "Making simulavr in $NAME_SIMULAVR..."

+ 7 - 1
prerequise.sh

@@ -1,7 +1,12 @@
 #!/bin/bash
-sudo apt-get install wget bzip2 texinfo flex babeltrace python expat bison tk-dev tcl-dev -y
+echo -e "$(tput setaf 10)AVR Toolchain builder prerequises install :$(tput setaf 7)\n"
+sudo apt-get install wget bzip2 texinfo flex babeltrace python expat bison tk-dev tcl-dev pixz pv libtool-bin -y
 if ! [ -x "$(command -v swig)" ]
 then
+	if ! [ -x "$(command -v pcre-config)" ]
+	then
+	sudo apt-get install libpcre++-dev -y
+	fi
 wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/swig-3.0.12.tar.xz
 tar xvfJ swig-3.0.12.tar.xz
 cd swig-3.0.12
@@ -19,3 +24,4 @@ if ! grep "/usr/local/avr/bin" ~/.bashrc >/dev/null
 	source ~/.bashrc
 fi
 
+touch .prereq

+ 1 - 1
release_package.sh

@@ -2,7 +2,7 @@
 cwd=$(pwd)
 echo -e "AVR Toolchain packer v1.0\n"
 if (( $EUID != 0 )); then
-   echo -e "\n$(tput setaf 11)This must be run as root. Try 'sudo bash $0'.$(tput setaf 7)\n"
+   echo -e "$(tput setaf 11)This must be run as root. Try 'sudo bash $0'.$(tput setaf 7)\n"
    exit 1
 fi
 if ! [ -x "$(command -v pv)" ]