I got a package with:
$ apt-get source
and now I am trying to build it with:
$ dpkg-buildpackage -uc -us -
the package you are trying to rebuild, sets (read: overrides) the *FLAGS with hardening-specifics flags retrieved from dpkg-buildflags
.
if you need to override those flags for your own purposes, you should tell dpkg-buildflags
to provide the flags you want, rather than the (hardening) defaults.
looking at man dpkg-buildflags
, you find the section about environment variables, esp. see DEB_flag_SET
and DEB_flag_APPEND
so this should do the trick (fill in your own *FLAGS):
$ DEB_CPPFLAGS_SET="-I/foo/bar/baz" DEB_CFLAGS_SET="-g -O6" DEB_LDFLAGS_SET="-L/fruzzel/frazzel/" dpkg-buildpackage -uc -us -j8 -rfakeroot