1
0

do-wrapper 949 B

1234567891011121314151617181920212223242526
  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. export ADDRESS_PREFIX="${DEB_ADDRESS_PREFIX}"
  12. export ADDRESS_PREFIX_BITS="${DEB_ADDRESS_PREFIX_BITS}"
  13. # Unset CFLAGS set by debhelper to fix a number of issues.
  14. # It usually contains something like this:
  15. # -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
  16. # The problems with this are:
  17. # -g is already passed
  18. # -O2 and optimizations in general are not yet supported upstream
  19. # -fstack-protector breaks build because it's passed AFTER -fstack-protector-all
  20. export CFLAGS=""
  21. ./do