From 74e8dd7c5c88ed83f1ddf7ed160a098931d85f8d Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 30 Jul 2012 00:24:07 +0000 Subject: [PATCH] Hopefully improved support for building DLLs on Windows --- src/makefile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/makefile.c b/src/makefile.c index 6da80b3..6e2dc11 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -616,6 +616,7 @@ static void _binary_ldflags(Configure * configure, FILE * fp, static void _variables_library(Configure * configure, FILE * fp, char * done) { String const * libdir; + String const * ccshared = "$(CC) -shared"; String const * p; if(!done[TT_LIBRARY] && !done[TT_SCRIPT]) @@ -647,7 +648,12 @@ static void _variables_library(Configure * configure, FILE * fp, char * done) else _makefile_output_variable(fp, "RANLIB", p, 1); if((p = config_get(configure->config, "", "ld")) == NULL) - _makefile_output_variable(fp, "CCSHARED", "$(CC) -shared", 0); + { + if(configure->os == HO_WIN32) + ccshared = "$(CC) -shared -Wl,-no-undefined" + " -Wl,--enable-runtime-pseudo-reloc"; + _makefile_output_variable(fp, "CCSHARED", ccshared, 0); + } else _makefile_output_variable(fp, "CCSHARED", p, 1); }