summaryrefslogtreecommitdiff
path: root/templates/gcc/template
blob: 4d8081bd55f0685c039ca7491e8374c865f4bdbd (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
pkgname=gcc
version=16.1.0
upstream="${MIRROR_GNU_FTP}/${pkgname}/${pkgname}-${version}/${pkgname}-${version}.tar.gz"

function do_configure {
	./contrib/download_prerequisites
	mkdir -p build/
	cd build/
	
	conf_flags=(
		--prefix=/usr
		--host=${DISTRO_TC}
		--target=${DISTRO_TC}
		--enable-shared	
		--enable-threads=posix
		--enable-languages=c,c++
		--disable-multilib
		--disable-nls
		--disable-werror
		--with-build-sysroot=${CROSS_ENV_ROOT}
		--enable-stack-protector=strong
	)

	../configure "${conf_flags[@]}"	
	
	cd ..
	mkdir -p buildlib/
	cd buildlib
	
	libconf_flags=(
		--prefix=/usr
		--host=${DISTRO_TC}	
		--disable-multilib
		--disable-nls
		--disable-libstdcxx-pch
	)
}

function do_build {
	cd build/
	make -j$(nproc)	
	
	cd ..
	cd buildlib/
	make -j$(nproc)
}

function do_install {
	cd build/
	make DESTDIR="${MASTERDIR}" install
	
	cd ..
	cd buildlib/
	make DESTDIR="${MASTERDIR}" install
}