summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 71f6fc4b4be4a40484a2640c6f51232e58a306d6 (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
# Maintainer: Huayu Zhang <zhanghuayu.dev@gmail.com>
# Contributor: Jonathon Fernyhough <jonathon+m2x+dev>
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
# Contributor: Frederik Schwan <freswa at archlinux dot org>
# Contributor:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Daniel Kozak <kozzi11@gmail.com>

pkgname=gcc-11
pkgver=11.1.0
pkgrel=1
pkgdesc='The GNU Compiler Collection (version 11.1.0) for remote debugging compability of clion'
arch=(x86_64)
license=(GPL LGPL FDL custom)
url='https://gcc.gnu.org'
#makedepends=(binutils doxygen git libmpc python)
makedepends=(binutils git libmpc python)
checkdepends=(dejagnu inetutils)
#options=(!emptydirs !lto)
source=(https://sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz)
sha256sums=("4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf")
_ins_path=/opt/gcc-11

build() {
	CFLAGS=${CFLAGS/-Werror=format-security/}
	CXXFLAGS=${CXXFLAGS/-Werror=format-security/}
	cd gcc-${pkgver}
	
	if [ -d "build" ] 
	then
		echo "exist"
	else
		mkdir build
	fi
	if [ -d "${_ins_path}" ] 
	then
		sudo rm -rf ${_ins_path}
		sudo mkdir ${_ins_path}
	else
		sudo mkdir ${_ins_path}
	fi
	
	cd build
	../configure \
	--prefix=/opt/gcc-11 \
	--enable-languages=c,c++ \
	--disable-build-format-warnings \
	--disable-werror

	make -j$(nproc)
	# make -j$(nproc) all-target-libgcc
}

package() {
	 cd gcc-${pkgver}
	 cd "build"
     make install-gcc DESTDIR=$pkgdir
     make install-target-libgcc DESTDIR=$pkgdir
     # Remove conflicting files
     rm -rf $pkgdir/usr/share/info
     rm -rf $pkgdir/usr/share/man/man7
	 echo "
	 add PATH by YOURSELF!!!
	 echo 'export PATH=/opt/gcc-11/bin:$PATH' >> /home/$(whoami)/.zshrc"
}