Make it possible to create DLLs with debug information.
diff --git a/ChangeLog b/ChangeLog
index ae687f9..ff102b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-18  Bruno Haible  <bruno@clisp.org>
+
+	* lib/Makefile.msvc (DEBUGFLAGS): New variable.
+	(iconv.lib): Use it.
+	* src/Makefile.msvc (DEBUGFLAGS): New variable.
+	* tests/Makefile.msvc (DEBUGFLAGS): New variable.
+
 2003-05-17  Bruno Haible  <bruno@clisp.org>
 
 	* Version 1.9 released.
diff --git a/lib/Makefile.msvc b/lib/Makefile.msvc
index c15240b..4280d78 100644
--- a/lib/Makefile.msvc
+++ b/lib/Makefile.msvc
@@ -65,9 +65,11 @@
 
 !if $(DEBUG)
 OPTIMFLAGS = -Od -Z7
+DEBUGFLAGS = -Z7
 !else
 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
 OPTIMFLAGS = -D_NDEBUG -O1
+DEBUGFLAGS =
 !endif
 
 CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(IIbindir)\" -DNO_XMALLOC -Dset_relocation_prefix=libiconv_set_relocation_prefix -Drelocate=libiconv_relocate
@@ -118,7 +120,7 @@
 
 # iconv.dll and iconv.lib are created together.
 iconv.lib : $(OBJECTS) $(RESOURCES)
-	$(CC) $(MFLAGS) -LD $(OBJECTS) $(RESOURCES) -Feiconv.dll
+	$(CC) $(MFLAGS) $(DEBUGFLAGS) -LD $(OBJECTS) $(RESOURCES) -Feiconv.dll
 
 iconv.res : $(srcdir)/../windows/iconv.rc
 	rc -Fo iconv.res $(srcdir)/../windows/iconv.rc
diff --git a/libcharset/lib/ChangeLog b/libcharset/lib/ChangeLog
index 14fe1f4..a8bffee 100644
--- a/libcharset/lib/ChangeLog
+++ b/libcharset/lib/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-18  Bruno Haible  <bruno@clisp.org>
+
+	* Makefile.msvc (DEBUGFLAGS): New variable.
+	(charset.lib): Use it.
+
 2003-05-07  Bruno Haible  <bruno@clisp.org>
 
 	* Makefile.vms: New file.
diff --git a/libcharset/lib/Makefile.msvc b/libcharset/lib/Makefile.msvc
index a564f42..1ceb77c 100644
--- a/libcharset/lib/Makefile.msvc
+++ b/libcharset/lib/Makefile.msvc
@@ -58,9 +58,11 @@
 
 !if $(DEBUG)
 OPTIMFLAGS = -Od -Z7
+DEBUGFLAGS = -Z7
 !else
 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
 OPTIMFLAGS = -D_NDEBUG -O1
+DEBUGFLAGS =
 !endif
 
 # -DBUILDING_LIBCHARSET: Change expansion of LIBCHARSET_DLL_EXPORTED macro.
@@ -105,7 +107,7 @@
 
 # charset.dll and charset.lib are created together.
 charset.lib : $(OBJECTS) $(RESOURCES)
-	$(CC) $(MFLAGS) -LD $(OBJECTS) $(RESOURCES) -Fecharset.dll
+	$(CC) $(MFLAGS) $(DEBUGFLAGS) -LD $(OBJECTS) $(RESOURCES) -Fecharset.dll
 
 charset.res : $(srcdir)/../windows/charset.rc
 	rc -Fo charset.res $(srcdir)/../windows/charset.rc
diff --git a/src/Makefile.msvc b/src/Makefile.msvc
index e38e3d4..c233367 100644
--- a/src/Makefile.msvc
+++ b/src/Makefile.msvc
@@ -38,9 +38,11 @@
 
 !if $(DEBUG)
 OPTIMFLAGS = -Od -Z7
+DEBUGFLAGS = -Z7
 !else
 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
 OPTIMFLAGS = -D_NDEBUG -O1
+DEBUGFLAGS =
 !endif
 
 # Set to -W3 if you want to see maximum amount of warnings, including stupid
diff --git a/tests/Makefile.msvc b/tests/Makefile.msvc
index 7c62b8a..d597e7c 100644
--- a/tests/Makefile.msvc
+++ b/tests/Makefile.msvc
@@ -26,9 +26,11 @@
 
 !if $(DEBUG)
 OPTIMFLAGS = -Od -Z7
+DEBUGFLAGS = -Z7
 !else
 # Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
 OPTIMFLAGS = -D_NDEBUG -O1
+DEBUGFLAGS =
 !endif
 
 # Directories used by "make":