blob: 08c675649a86acf94a3cec5cb56227877c67a509 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
pkgname=ghdl
pkgver=0.36
pkgrel=1
_gccver=8.3.0
_islver=0.20
arch=('aarch64' 'x86_64')
pkgdesc='VHDL simulator'
url='https://github.com/ghdl/ghdl'
license=('GPLv2')
makedepends=('gcc-ada' 'git')
install=ghdl.install
options=(!emptydirs staticlibs)
source=(
"git+https://github.com/ghdl/ghdl#tag=v${pkgver}"
"https://gcc.gnu.org/pub/gcc/releases/gcc-${_gccver}/gcc-${_gccver}.tar.xz"
"http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2"
)
sha256sums=(
'SKIP'
'64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c'
'b587e083eb65a8b394e833dea1744f21af3f0e413a448c17536b5549ae42a4c2'
)
prepare() {
[[ ! -d gcc ]] && ln -s gcc-${_gccver/+/-} gcc
cd ghdl
./configure --prefix=/usr --with-gcc="${srcdir}/gcc"
make copy-sources
cd ..
cd gcc
# link isl for in-tree build
ln -s ../isl-${_islver} isl
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
# Arch Linux installs x86_64 libraries /lib
sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
# Arch Linux ARM installs aarch64 libraries /lib
sed -i '/lp64=/s/lib64/lib/' gcc/config/aarch64/t-aarch64-linux
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
mkdir -p "$srcdir/gcc-build"
}
build() {
cd gcc-build
# using -pipe causes spurious test-suite failures
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
"$srcdir/gcc/configure" --prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-shared \
--enable-threads=posix \
--with-system-zlib \
--with-isl \
--enable-__cxa_atexit \
--disable-libunwind-exceptions \
--enable-clocale=gnu \
--disable-libstdcxx-pch \
--disable-libssp \
--enable-gnu-unique-object \
--enable-linker-build-id \
--enable-lto \
--enable-plugin \
--enable-install-libiberty \
--with-linker-hash-style=gnu \
--enable-gnu-indirect-function \
--disable-werror \
--enable-checking=release \
--enable-default-pie \
--enable-default-ssp \
\
--enable-languages=vhdl \
--disable-bootstrap \
--disable-multilib \
--disable-libgomp \
--disable-libquadmath
make
cd "${srcdir}/ghdl"
make -j1 \
GHDL_GCC_BIN="${srcdir}/gcc-build/gcc/ghdl" \
GHDL1_GCC_BIN="--GHDL1=${srcdir}/gcc-build/gcc/ghdl1" \
ghdllib
}
package() {
local _xgcc="${srcdir}/gcc-build/gcc/xgcc"
local _machine=$(${_xgcc} -dumpmachine)
local _version=$(${_xgcc} -dumpversion)
cd "${srcdir}/gcc-build"
# make a full install ...
make DESTDIR="${pkgdir}" install
# and remove files not specific to ghdl
cd "${pkgdir}"
rm -rf "usr/"{include,share/{locale,man}}
find "usr/lib" \
-maxdepth 1 -mindepth 1 -not -name 'gcc' -not -name 'ghdl' \
-exec rm -rf {} +
find "usr/lib/gcc/${_machine}/${_version}" \
-maxdepth 1 -mindepth 1 -not -name 'ghdl*' \
-exec rm -rf {} +
find "usr/bin" "usr/share/info" \
-maxdepth 1 -mindepth 1 -not -name 'ghdl*' \
-exec rm -rf {} +
# install ghdl-lib
cd "${srcdir}/ghdl"
make DESTDIR="${pkgdir}" install
}
|