wok-6.x annotate linld/receipt @ rev 21986
linld: x86 support (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Oct 14 14:56:58 2019 +0200 (2019-10-14) |
parents | 642355b9b9fd |
children | 46921aca812b |
rev | line source |
---|---|
pascal@2330 | 1 # SliTaz package receipt. |
pascal@2330 | 2 |
pascal@2330 | 3 PACKAGE="linld" |
pascal@2330 | 4 VERSION="0.97" |
pascal@2330 | 5 CATEGORY="system-tools" |
pascal@2330 | 6 SHORT_DESC="Boot loader for DOS/Win9x." |
pascal@2330 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15379 | 8 LICENSE="GPL" |
pascal@20453 | 9 SUFFIX="${VERSION/./}" |
pascal@19410 | 10 TARBALL="${PACKAGE}${SUFFIX}devel.tar.bz2" |
pascal@20669 | 11 BASE_SITE="https://busybox.net/~vda/$PACKAGE" |
pascal@2330 | 12 WEB_SITE="$BASE_SITE/README.txt" |
pascal@2330 | 13 WGET_URL="$BASE_SITE/$TARBALL" |
pascal@20458 | 14 EXTRA_TOOL_URL="ftp://ftp.ibiblio.org/pub/micro/pc-stuff/freedos/gnuish/mawk122x.zip" |
pascal@20458 | 15 EXTRA_TOOL="$(basename $EXTRA_TOOL_URL)" |
pascal@20458 | 16 EXTRA_SOURCE_FILES="$EXTRA_TOOL" |
pascal@2330 | 17 |
pascal@19410 | 18 BUILD_DEPENDS="dosbox upx" |
pascal@17446 | 19 |
pascal@2330 | 20 # Rules to configure and make the package. |
pascal@2330 | 21 compile_rules() |
pascal@2330 | 22 { |
pascal@20458 | 23 [ -s $SRC/$EXTRA_TOOL ] || |
pascal@20458 | 24 busybox wget -O $SRC/$EXTRA_TOOL $EXTRA_TOOL_URL |
pascal@2330 | 25 mv DIST $src 2> /dev/null |
pascal@2330 | 26 cd $src |
pascal@20459 | 27 unzip $SRC/$EXTRA_TOOL > /dev/null |
pascal@20427 | 28 rm LINLD$SUFFIX/CRTL.CPP LINLD$SUFFIX/INT15_88.ASM |
pascal@19515 | 29 cp $stuff/src/* LINLD$SUFFIX/ |
pascal@21986 | 30 sed -i 's/-3/-DNO386/' LINLD$SUFFIX/BCCOPT.OPT |
pascal@19515 | 31 cp -a LINLD$SUFFIX TAZBOOT |
pascal@17446 | 32 unix2dos > MAKE.BAT <<EOT |
pascal@17446 | 33 d: |
pascal@19410 | 34 cd linld$SUFFIX |
pascal@19515 | 35 $(cat LINLD$SUFFIX/!COMPILE.BAT) |
pascal@19515 | 36 cd .. |
pascal@19515 | 37 cd tazboot |
pascal@19515 | 38 $(cat TAZBOOT/!COMPILEX.BAT) |
pascal@17446 | 39 EOT |
pascal@19736 | 40 SDL_VIDEODRIVER=dummy dosbox MAKE.BAT -exit -c "mount D $src" \ |
pascal@19736 | 41 2>&1 | grep -v 'ALSA lib' |
pascal@21623 | 42 grep '^Fatal[ :]' */LNK.LOG */CPP.LOG && return 1 |
pascal@21623 | 43 grep '*Fatal*' */*.LST && return 1 |
pascal@20550 | 44 grep '^Error[ :]' */LNK.LOG */CPP.LOG && return 1 |
pascal@20550 | 45 grep '*Error*' */*.LST && return 1 |
pascal@21363 | 46 grep '^Warning[ :]' */LNK.LOG */CPP.LOG |
pascal@21363 | 47 grep '*Warning*' */*.LST |
pascal@19410 | 48 cp LINLD$SUFFIX/LINLD.COM linld.com |
pascal@19515 | 49 cp TAZBOOT/TAZBOOT.COM tazboot.com |
pascal@19414 | 50 objdump -D -b binary -mi386 -Maddr16,data16 --adjust-vma=0x100 \ |
pascal@19414 | 51 linld.com > linld.lst |
pascal@21623 | 52 linld=linld.com |
pascal@21623 | 53 [ $(stat -c %s $linld) -le 4096 ] && ls -l $linld && linld= |
pascal@20794 | 54 for f in $linld tazboot.com ; do |
pascal@20457 | 55 cp $f tmp.com |
pascal@20457 | 56 for i in $(seq 1 9); do |
pascal@20457 | 57 upx -$i --8086 tmp.com |
pascal@20457 | 58 [ $(stat -c "%s" $f) -gt $(stat -c "%s" tmp.com) ] && |
pascal@20457 | 59 cp tmp.com $f |
pascal@20457 | 60 upx -d tmp.com |
pascal@20457 | 61 done > /dev/null 2>&1 |
pascal@20457 | 62 rm tmp.com |
pascal@20457 | 63 done |
pascal@20794 | 64 upx -l $linld tazboot.com |
pascal@18230 | 65 cc -o tobzimage.o -Wa,-algms=tobzimage.lst -c $stuff/tobzimage.S |
pascal@18230 | 66 objcopy -O binary tobzimage.o tobzimage.bin |
pascal@18230 | 67 cp $stuff/tobzimage . |
pascal@18230 | 68 ./tobzimage --build |
pascal@2330 | 69 } |
pascal@2330 | 70 |
pascal@2330 | 71 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@2330 | 72 genpkg_rules() |
pascal@2330 | 73 { |
pascal@19494 | 74 mkdir -p $fs/usr/share/boot $fs/usr/bin $install/usr/share/doc |
pascal@19410 | 75 cp $src/linld.com $stuff/linld.txt $fs/usr/share/boot/ |
pascal@19494 | 76 cp $stuff/linld.txt $install/usr/share/doc |
pascal@19465 | 77 #cp $src/tobzimage $fs/usr/bin |
pascal@2330 | 78 } |