do-wrapper 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. # This is a wrapper for ./do that sets architecture variables properly
  3. # I've failed to implement this in debian/rules
  4. export PLATFORM="${DEB_BUILD_ARCH_OS}"
  5. export MARCH="${DEB_HOST_GNU_CPU}"
  6. # work around cjdns being unspecific about x86 compiler targets such as i686
  7. echo "${DEB_HOST_GNU_CPU}" | grep -q 'i.86' && export MARCH="x86"
  8. if [[ "${DEB_BUILD_OPTIONS}" =~ nocheck ]]; then
  9. export NO_TEST=1
  10. fi
  11. # Pass through prefix overrides if they are set
  12. if [[ ${DEB_ADDRESS_PREFIX} && ${DEB_ADDRESS_PREFIX-x} ]]; then
  13. export ADDRESS_PREFIX="${DEB_ADDRESS_PREFIX}"
  14. fi
  15. if [[ ${DEB_ADDRESS_PREFIX_BITS} && ${DEB_ADDRESS_PREFIX_BITS-x} ]]; then
  16. export ADDRESS_PREFIX_BITS="${DEB_ADDRESS_PREFIX_BITS}"
  17. fi
  18. # Unset CFLAGS set by debhelper to fix a number of issues.
  19. # It usually contains something like this:
  20. # -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
  21. # The problems with this are:
  22. # -g is already passed
  23. # -O2 and optimizations in general are not yet supported upstream
  24. # -fstack-protector breaks build because it's passed AFTER -fstack-protector-all
  25. export CFLAGS=""
  26. ./do