rp-pppoe does not use dh but includes /usr/share/dpkg/buildflags.mk which calls `dpkg-buildflags --get LDFLAGS`. This command only exports LDFLAGS but does not expose the needed environment variables.
So we need to expose them in /usr/share/dpkg/buildflags.mk as well.
I found the reason:
rp-pppoe does not use dh but includes /usr/share/ dpkg/buildflags .mk which calls `dpkg-buildflags --get LDFLAGS`. This command only exports LDFLAGS but does not expose the needed environment variables.
So we need to expose them in /usr/share/ dpkg/buildflags .mk as well.