summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/klibc/PKGBUILD
blob: 11080c06a9bc8333ce6f8f9381e51aa1124e9481 (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
# $Id: PKGBUILD 23627 2009-01-11 14:22:23Z thomas $
# Maintainer: Aaron Griffin <aaron@archlinux.org>
# Maintainer: Thomas Baechler <thomas@archlinux.org>

###
### NOTE: Do not build this package with anything except gcc - using ccache
###  forces others to use it as well as it becomes hardcoded in the klibc
###  script.
###

pkgname=klibc
pkgver=1.5.15
_klibcbranch=Testing #Stable/Testing
_kver=2.6.28-ARCH
pkgrel=30
pkgdesc="A minimal libc made for early-userspace"
arch=(i686 x86_64)
url="http://www.kernel.org/pub/linux/libs/klibc/"
license=('BSD')
groups=('base')
options=(!ccache !strip)
source=(http://www.kernel.org/pub/linux/libs/klibc/${_klibcbranch}/${pkgname}-${pkgver}.tar.gz
        klibc-compile-shared-by-default.patch
        klibc-Kbuild.patch
        klibc-x86_64-fix-io.h.patch
        klibc-fix-2.6.28-includes.patch)
md5sums=('b5527be46f24779884557b11888c8075'
         'c263a7c3fd290fcc84a4e230d456d022'
         'ff5b113024256de31af59c2f1a966516'
         'fcee75cfaa65638b07f9cc4a7719fa29'
         '85e39751debc304119eb481d6bc26d59')
                  
build()
{
  cd $startdir/src/$pkgname-$pkgver
  #INI_DEBUG causes ipconfig to fail within kinit
  sed -i "/#define INI_DEBUG/d" usr/kinit/kinit.h || return 1
  ln -sf /usr/src/linux-${_kver} linux

  # compile binaries shared by default
  patch -p1 -i ../klibc-compile-shared-by-default.patch || return 1
  # don't build gzip, cpio, kill, build shared binaries for kinit and sh
  patch -p1 -i ../klibc-Kbuild.patch || return 1
  # fix errors in io.h header
  patch -p1 -i ../klibc-x86_64-fix-io.h.patch || return 1
  # fix includes for 2.6.28 build
  patch -p1 -i ../klibc-fix-2.6.28-includes.patch || return 1
  
  make EXTRA_KLIBCFLAGS='' || return 1
  make INSTALLROOT=$startdir/pkg install || return 1
  #ln -sf asm-x86 $startdir/pkg/usr/lib/klibc/include/asm
  cp -a linux/arch/x86/include/asm/* $startdir/pkg/usr/lib/klibc/include/asm/
  
  provides[${#provides[@]}]="$(basename $startdir/pkg/lib/klibc-*.so .so)"
  export provides
}