--- a/Canna.conf
+++ b/Canna.conf
@@ -548,7 +548,7 @@
 Concat3(lib,libname,.dll):  solist					@@\
 	RemoveFile(LibraryTargetName(libname))				@@\
 	RemoveFile(Concat3(lib,libname,.dll))				@@\
-	gcc -shared -nostartfiles -Wl,--out-implib=Concat(lib,libname.a) -o Concat3(lib,libname,.dll) solist $(REQUIREDLIBS)	@@\
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -nostartfiles -Wl,--out-implib=Concat(lib,libname.a) -o Concat3(lib,libname,.dll) solist $(REQUIREDLIBS)	@@\
 									@@\
 clean::									@@\
 	RemoveFile(LibraryTargetName(libname))				@@\
--- a/canuum/Imakefile
+++ b/canuum/Imakefile
@@ -51,6 +51,8 @@
 	$(CONFIGURE_CMD)
 XCOMM Invoked from confwrapper
 cwenv.sh:
-	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
-	$(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
+	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) $(CPPFLAGS) > $@
+	$(CANNAROOT)/confwrapper mkenv CC $(CC) >> $@
+	$(CANNAROOT)/confwrapper mkenv AR $(AR) >> $@
 	$(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@
+	$(CANNAROOT)/confwrapper mkenv LDFLAGS $(LDFLAGS) >> $@
--- a/Imakefile
+++ b/Imakefile
@@ -117,9 +117,11 @@
 	$(CONFIGURE_CMD)
 XCOMM Invoked from confwrapper
 cwenv.sh:
-	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
-	$(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
+	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) $(CPPFLAGS) > $@
+	$(CANNAROOT)/confwrapper mkenv CC $(CC) >> $@
+	$(CANNAROOT)/confwrapper mkenv AR $(AR) >> $@
 	$(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@
+	$(CANNAROOT)/confwrapper mkenv LDFLAGS $(LDFLAGS) >> $@
 
 CANNAROOT = .
 SERVERDIR = server dic/phono dic/ideo
