Add git-man/buster to git install and minor shell line fix
[dev-env-setup.git] / ghdl-install
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root using 'sudo bash'"
4 exit
5 fi
6
7 apt-get update -y
8 apt-get install -y git gnat gcc g++ make file texinfo zlib1g-dev
9
10 # change into $SUDO_USER home directory
11 cd /home/$SUDO_USER
12 mkdir -p src/ghdl
13 cd src/ghdl
14
15 git clone https://github.com/ghdl/ghdl.git
16 wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
17 wget https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
18 wget https://www.mpfr.org/mpfr-4.1.0/mpfr-4.1.0.tar.xz
19 wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2
20 wget https://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz
21
22 tar -xf gcc-10.3.0.tar.xz
23 cd gcc-10.3.0
24 tar -xf ../gmp-6.2.1.tar.xz
25 mv gmp-6.2.1 gmp
26 tar -xf ../mpc-1.2.1.tar.gz
27 mv mpc-1.2.1 mpc
28 tar -xf ../mpfr-4.1.0.tar.xz
29 mv mpfr-4.1.0 mpfr
30 tar -xf ../isl-0.18.tar.bz2
31 mv isl-0.18 isl
32 cd ..
33
34 cd ghdl
35 git checkout v1.0.0
36 mkdir build
37 cd build
38 ../configure --with-gcc=../../gcc-10.3.0 --prefix=/usr/local/ghdl
39 make copy-sources
40 mkdir gcc-objs; cd gcc-objs
41 ../../../gcc-10.3.0/configure --prefix=/usr/local/ghdl \
42 --enable-languages=c,vhdl --disable-bootstrap --disable-lto \
43 --disable-multilib --disable-libssp --disable-libgomp \
44 --disable-libquadmath --enable-default-pie
45 make -j$(nproc)
46 make install
47 cd ..
48 make ghdllib
49 make install
50
51 cd /home/$SUDO_USER/src/ghdl
52 chown -R $SUDO_USER .
53 chgrp -R $SUDO_USER .
54