do-wrapper 772 B

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