~vojtech-horky/helenos/coastline-qemu

« back to all changes in this revision

Viewing changes to pcc/HARBOUR

  • Committer: Vojtech Horky
  • Date: 2017-08-07 14:28:40 UTC
  • mfrom: (104.1.27 coastline)
  • Revision ID: vojtechhorky@users.sourceforge.net-20170807142840-nj7i0b2i0py5o5qh
MergeĀ upstreamĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
 
# Copyright (c) 2014 Jakub Jermar 
 
2
# Copyright (c) 2014 Jakub Jermar
 
3
# Copyright (c) 2017 Vojtech Horky
3
4
# All rights reserved.
4
5
#
5
6
# Redistribution and use in source and binary forms, with or without
29
30
shipname=pcc
30
31
shipversion=1.0.0
31
32
mirror_="ftp://pcc.ludd.ltu.se/pub/pcc-releases"
32
 
shipsources="$mirror_/$shipname-$shipversion.tgz pcc-helenos.patch"
 
33
shipsources="$mirror_/$shipname-$shipversion.tgz pcc-helenos.patch ccconfig.h"
33
34
shiptugs=""
34
35
shipfunnels=1
35
36
 
36
 
shipapps="cc/cc/cc cc/ccom/ccom cc/ccom/mkext/cc_mkext cc/cpp/cpp"
37
 
 
38
37
build() {
39
38
        run tar xzf ${shipname}-${shipversion}.tgz
40
39
        
41
40
        msg "Patching sources..."
42
 
        # Apply the single pcc HelenOS patch  
43
41
        patch -p0 <pcc-helenos.patch
44
 
 
45
 
        # Rename directories in arch/ to match HelenOS names
46
 
        run mv ${shipname}-${shipversion}/arch/arm ${shipname}-${shipversion}/arch/arm32
47
 
        run mv ${shipname}-${shipversion}/arch/i386 ${shipname}-${shipversion}/arch/ia32
48
 
        run mv ${shipname}-${shipversion}/arch/mips ${shipname}-${shipversion}/arch/mips32
49
 
        run mv ${shipname}-${shipversion}/arch/powerpc ${shipname}-${shipversion}/arch/ppc32
 
42
        
 
43
        msg "Providing HelenOS configuration..."
 
44
        run mkdir ${shipname}-${shipversion}/os/helenos
 
45
        run cp ccconfig.h ${shipname}-${shipversion}/os/helenos
 
46
                
 
47
        cd ${shipname}-${shipversion}
 
48
        
 
49
        msg "Configuring..."
 
50
        run ./configure \
 
51
                --host="$HSCT_GNU_TARGET" \
 
52
                --bindir=/app \
 
53
                --libexecdir=/app \
 
54
                --with-incdir=/inc/c \
 
55
                --with-libdir=/lib/ \
 
56
                --with-assembler=/app/as \
 
57
                --with-linker=/app/ld \
 
58
                "CC=$HSCT_CC" \
 
59
                "CFLAGS=$HSCT_CFLAGS" \
 
60
                "CPP=$HSCT_CC -E" \
 
61
                "CPPFLAGS=$HSCT_CFLAGS" \
 
62
                "LD=$HSCT_CC" \
 
63
                || return 1
 
64
        
 
65
        msg "Setting PCC version manually..."
 
66
        run sed "s:#define VERSSTR.*:#define VERSSTR \"$shipname $shipversion for HelenOS, built at \" __DATE__ \", \" __TIME__:" -i config.h
 
67
        
 
68
        msg "Fixing in-build CC invocation..."
 
69
        run sed '/CC_FOR_BUILD/s/[$](CFLAGS)//g' -i cc/ccom/Makefile
50
70
 
51
71
        msg "Building..."
52
 
        
53
 
        for app in ${shipapps}; do
54
 
                dir=`dirname $app`
55
 
                run make -C ${shipname}-${shipversion}/$dir \
56
 
                        STATIC_ONLY=y \
57
 
                        USPACE_PREFIX=$HSTC_HELENOS_ROOT/uspace \
58
 
                        PLATFORM=$HSCT_UARCH \
59
 
                        -j$shipfunnels \
60
 
                        || return 1
61
 
        done
 
72
        make -j$shipfunnels
62
73
}
63
74
 
64
75
package() {
 
76
        cd "${shipname}-${shipversion}"
 
77
        
 
78
        run make install "DESTDIR=$PWD/PKG"
 
79
 
65
80
        mkdir -p "$HSCT_MY_DIR/app"
66
 
        for app in ${shipapps}; do
67
 
                run cp ${shipname}-${shipversion}/$app "$HSCT_MY_DIR/app/" \
68
 
                        || return 1
 
81
        for app in pcc cpp ccom; do
 
82
                run cp "PKG/app/$app" "$HSCT_MY_DIR/app/" || return 1
69
83
        done
70
84
}