summaryrefslogtreecommitdiffstats
path: root/uclibc/Pkgfile
blob: 8b7700b7a282705e52d9b96f35890c977f0e7393 (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
description="Lightweight C library."
longdesc="uClibc (aka µClibc/pronounced yew-see-lib-see) is a C library for
developing embedded Linux systems.  It is much smaller than the
GNU C Library, but nearly all applications supported by glibc
also work perfectly with uClibc.  Porting applications from glibc
to uClibc typically involves just recompiling the source code.
uClibc even supports shared libraries and threading.  It currently
runs on standard Linux and MMU-less (also known as µClinux)
systems with support for alpha, ARM, cris, e1, h8300, i386, i960,
m68k, microblaze, mips/mipsel, PowerPC, SH, SPARC, and v850
processors."
packager="Lukc <lukc AT upyum DOT com>"
maintainer="Lukc <lukc AT upyum DOT com>"
url=http://www.uclibc.org

name=uclibc
version=0.9.31
release=1
source=( 
	http://www.uclibc.org/downloads/${name/c/C}-$version.tar.xz
)
lastver="wcat http://www.uclibc.org/downloads/ | 
grep uClibc | sed -e 's/.*>uClibc-//;s/.tar.xz<.*//' | 
grep -v '<' | sort -k3 | tail -n 1"
license=LGPL

function build {
	local UCLIBC_MAKE_OPTS=
	if [[ "$CROSS" = yes ]]; then
		UCLIBC_CROSS=${CHOST}-
	fi
	case $CHOST in
		i?86-*)
			if [[ -z "$UCLIBC_CPU" ]]; then
				UCLIBC_CPU=${CHOST%%-*}
				UCLIBC_CPU=${UCLIBC_CPU#i}
			fi
		;;
	esac
	cd ${name/c/C}-$version
	gmake CROSS=${UCLIBC_CROSS} defconfig
	# XXX: Largement au dessus de 80 caractères et dépend de gsed.
		info "Configuring for $UCLIBC_CPU."
	if [[ -n "$UCLIBC_CPU" ]]; then
		sed -i -e "s/^CONFIG_GENERIC_386=y$/# CONFIG_GENERIC_386 is not set/;s/# CONFIG_$UCLIBC_CPU is not set/CONFIG_$UCLIBC_CPU=y/" .config
	fi
	# Installation dans un $prefix… standard ?
	sed -i -e "s:^RUNTIME_PREFIX=.*:RUNTIME_PREFIX=\"\":" .config
	sed -i -e "s:^DEVEL_PREFIX=.*:DEVEL_PREFIX=\"$prefix\":" .config
	# XXX: Volé de Gentoo, mais insuffisant. Il faut voler plus de code 
	#      pour que ça marche mieux. (et nettoyer, après)
	for def in LINUXTHREADS_OLD UCLIBC_HAS_THREADS UCLIBC_HAS_IPV6 MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC  UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do
		sed -i -e "s/^${def}=.*/${def}=y/;s/# ${def} is not set/${def}=y/" .config
	done
	sed -i -e "s/^HAS_NO_THREADS=.*/# HAS_NO_THREADS is not set/" .config
	yes "" | gmake oldconfig
	gmake CROSS=${UCLIBC_CROSS} DESTDIR=$PKG install
}

function check {
	cd ${name/c/C}-$version
	make check
}