Description: Apply compile flags as required by Debian
Author: Andreas Bombe <aeb@debian.org>
Last-Update: 2018-08-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.in
+++ b/Makefile.in
@@ -99,13 +99,14 @@
 #target=x86_64-apple-darwin
 #target=i386-pc-mingw32
 
+SHLIB_FLAGS=$(LDFLAGS)
 ifeq ($(SOEXT),.so)
-SHLIB_FLAGS=-Wl,-soname,$@
+SHLIB_FLAGS+=-Wl,-soname,$@
 else ifeq ($(SOEXT),.dll)
-SHLIB_FLAGS=
+SHLIB_FLAGS+=
 else ifeq ($(SOEXT),.dylib)
 # Allow the use of -rpath in executable
-SHLIB_FLAGS=-Wl,-install_name,@rpath/$@
+SHLIB_FLAGS+=-Wl,-install_name,@rpath/$@
 endif
 
 # Flags for libraries
@@ -406,10 +407,10 @@
 
 vpi_thunk.o: $(GRTSRCDIR)/vpi_thunk.c $(GRTSRCDIR)/vpi_thunk.h
 #	Do not use OPT_FLAGS (do not enable coverage)
-	$(CC) -c -o $@ $< $(PIC_FLAGS) -O $(WARN_CFLAGS)
+	$(CC) -c -g -o $@ $< $(PIC_FLAGS) -O $(WARN_CFLAGS)
 
 libghdlvpi$(SOEXT): vpi_thunk.o
-	$(CC) -o $@ $< -shared $(SHLIB_FLAGS)
+	$(CC) -g -o $@ $< -shared $(SHLIB_FLAGS)
 
 all.vpi: libghdlvpi$(SOEXT)
 
--- a/configure
+++ b/configure
@@ -16,7 +16,7 @@
 CFLAGS=${CFLAGS:--g}
 GNATMAKE=${GNATMAKE:-gnatmake}
 MAKE=${MAKE:-make}
-LDFLAGS=
+LDFLAGS=${LDFLAGS}
 prefix=/usr/local
 libdirsuffix=lib/ghdl
 incdirsuffix=include
