summaryrefslogtreecommitdiff
path: root/cross-mips64el-unknown-linux-gnu-eglibc1/PKGBUILD
blob: 23ffa2f8043e59593a222faa2afea66aba2f8513 (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
# Maintainer: Nicolas Reynolds <fauno@kiwwwi.com.ar>
#

_pkgname=eglibc
_target=mips64el-unknown-linux-gnu
_sysroot=/usr/lib/cross-${_target}

pkgname=cross-${_target}-${_pkgname}1
pkgver=2.13
_svnrev=13055
pkgrel=1
pkgdesc="Embedded GNU C Library for $_target stage1"
license=('GPL' 'LGPL')
arch=(i686 x86_64)
options=(!strip)
depends=("cross-${_target}-linux-api-headers" "tzdata")
makedepends=('subversion' "cross-${_target}-binutils" "cross-${_target}-gcc1")
source=(http://repo.parabolagnulinux.org/other/eglibc-${pkgver}-${_svnrev}.tar.xz)
md5sums=('4b6d70ac23e40b2c60d6f9d5f63afe23')

mksource() {
    if [ -d eglibc ] ; then
        cd eglibc
        svn up
    else
        svn co http://www.eglibc.org/svn/branches/eglibc-2_13/libc eglibc
        # TODO: might be nice to  skip this if the target is supported in-tree.
        cd eglibc
        svn co http://www.eglibc.org/svn/branches/eglibc-2_13/ports ports
    fi

    rev=$(LC_ALL=C svn info | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')

    cd ..
    tar cJf eglibc-sources-$pkgver-${rev}.tar.xz eglibc/
}

build() {
    cd $srcdir

    [[ $NOEXTRACT -eq 1 ]] || mkdir headers
    cd headers

    unset CFLAGS CXXFLAGS LDFLAGS

# Points to gcc1 and binutils binaries
    BUILD_CC=gcc \
    CC=$_sysroot/bin/$_target-gcc \
    CXX=$_sysroot/bin/$_target-g++ \
    AR=$_sysroot/bin/$_target-ar \
    RANLIB=$_sysroot/bin/$_target-ranlib \
    ../eglibc/configure \
        --prefix=$_sysroot \
        --build=$CHOST \
        --host=$_target \
        --with-headers=$_sysroot/include \
        --disable-profile \
        --without-gd \
        --without-cvs \
        --enable-add-ons
}

package() {
    cd $srcdir/headers

    make install-headers \
        install_root=$pkgdir \
        install-bootstrap-headers=yes

    mkdir -p ${pkgdir}${_sysroot}/lib

    make csu/subdir_lib
    cp csu/crt1.o csu/crti.o csu/crtn.o $pkgdir${_sysroot}/lib/

    $_sysroot/bin/$_target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \
        -o $pkgdir${_sysroot}/lib/libc.so
}