glibc-cmds.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. set +h
  3. source "$basedir/build-helpers.sh"
  4. patch_commands() {
  5. patchfile="$pkgver"-upstream_i386_fix-1.patch
  6. patch_md5=$(md5sum "$patchfile" | cut -d' ' -f1)
  7. check_md5=$(awk "/[[:space:]]+$patchfile$/ {print \$1}" md5sums)
  8. [[ $check_md5 = $patch_md5 ]] || {
  9. >&2 printf 'Incorrect md5sums: %s != %s\n' $patch_md5 $check_md5
  10. exit 1
  11. }
  12. cd "$srcdir"
  13. patch -Np1 -i ../"$patchfile"
  14. }
  15. configure_commands() {
  16. cd "$builddir"
  17. local build=$($srcdir/scripts/config.guess)
  18. "$srcdir"/configure \
  19. --prefix=/tools \
  20. --host="$LFS_TGT" \
  21. --build="$build" \
  22. --disable-profile \
  23. --enable-kernel=2.6.32 \
  24. --enable-obsolete-rpc \
  25. --with-headers=/tools/include \
  26. libc_cv_forced_unwind=yes \
  27. libc_cv_ctors_header=yes \
  28. libc_cv_c_cleanup=yes
  29. }
  30. test_commands() {
  31. cd /tmp
  32. testfile=dummy.c
  33. echo 'int main(){}' > $testfile
  34. $LFS_TGT-gcc -v $testfile -o a.out
  35. [[ -f a.out ]] || {
  36. >&2 echo $LFS_TGT-gcc failed to produce a.out
  37. exit 1
  38. }
  39. readelf -l a.out | grep ': /tools'
  40. }