recipe 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Build recipe for pcc
  2. #
  3. # Copyright 2016,2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. #
  5. # This recipe is free software, under the terms of the Apache License 2.0
  6. program=pcc
  7. version=$(date +%Y%m%d)
  8. release=1
  9. description="
  10. The pcc compiler is based on the original Portable C Compiler by
  11. S. C. Johnson, written in the late 70's. About 50% of the frontend
  12. code and 80% of the backend code has been modified.The compiler is
  13. based on the original Portable C Compiler by S. C. Johnson, written in
  14. the late 70's. About 50% of the frontend code and 80% of the backend
  15. code has been modified.
  16. The project goal is to write a C99 compiler while still keeping it
  17. small, simple, fast and understandable. PCC is not affiliated with any
  18. other project, but the compiler has been imported into the OpenBSD and
  19. NetBSD base systems.
  20. "
  21. homepage=http://pcc.ludd.ltu.se/
  22. license=BSD
  23. tarname=${program}-${version}.tgz
  24. # Remote source(s)
  25. fetch=http://pcc.ludd.ltu.se/ftp/pub/pcc/$tarname
  26. build() {
  27. unpack "${tardir}/$tarname"
  28. cd "$srcdir"
  29. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS"\
  30. $configure_args \
  31. --libdir=/usr/lib${libSuffix} \
  32. --mandir=$mandir \
  33. --docdir=$docdir \
  34. --enable-tls \
  35. --build="$(cc -dumpmachine)"
  36. make -j${jobs}
  37. make -j${jobs} install DESTDIR="$destdir"
  38. # Compress and link man pages (if needed)
  39. if [ -d "${destdir}/$mandir" ] ; then
  40. (
  41. cd "${destdir}/$mandir"
  42. find . -type f -exec lzip -9 '{}' +
  43. find . -type l | while read -r file
  44. do
  45. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  46. rm -- "$file"
  47. done
  48. )
  49. fi
  50. }