Description: improved support for build flags
 The first change makes linking makeHeader use the same CPP/CXX/LD flags as the
 rest of the sources.
 The second change stops btyacc/Makefile from ignoring CFLAGS from the
 environment.
 Both changes help compile/link with default hardening flags.
Author: Damyan Ivanov <dmn@debian.org>

--- a/builds/posix/Makefile.in
+++ b/builds/posix/Makefile.in
@@ -602,7 +602,7 @@ MAKE_HEADER_Src = $(addprefix $(SRC_ROOT
 MAKE_HEADER_Bin = ./makeHeader
 
 $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
-	$(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
+	$(STATICEXE_LINK) $(EXE_LINK_OPTIONS) $(LINK_OPTS) $(CPPFLAGS) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
 	$(CP) $^ .
 	$(MAKE_HEADER_Bin) <ibase.h >$@
 	$(RM) -f ibase.h
--- a/extern/btyacc/Makefile
+++ b/extern/btyacc/Makefile
@@ -42,7 +42,7 @@ OTHERS	      = README README.BYACC \
 all:		$(PROGRAM)
 
 $(PROGRAM):     $(OBJS) $(LIBS)
-		$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+		$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
 
 clean:;		rm -f $(OBJS)
 
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -166,8 +166,8 @@ LD =	@CXX@
 
 LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
 STATICLIB_LINK = $(AR) crus
-EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
-STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
+EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
+STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
 
 LINK_LIBS = @LIBS@
 STATICLINK_LIBS = @LIBS@
