Issue #1253 has been updated by Charlie Savage.


1.  Makefiles for extension libraries use DLDFLAGS instead.

But that doesn't work when compiling the conftest programs.  For example, say you want to compile the curses extension:

Add this to Makefile:

DLDFLAGS = -libpath:C:\Development\msvc\lib -incremental:no -debug -opt:ref -opt:icf

Then look at mkmf.log for building the extension:

"cl -nologo -Feconftest -I../../.ext/include/i386-mswin32_90 -I../.././../include -I../.././../ext/curses -I../.././../include -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -I. -I./.. -I./../missing -IC:\Development\msvc\include -DLIBRUBY_SO=\"ruby19.dll\" -nologo -MD -RTC1 -Zi -Od -W3 -wd4996 -Od  -Zm600 conftest.c   ruby19-static.lib tinfo.lib  unicows.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib   -link    -libpath:"." -libpath:"../.." "

Notice that neither LDFLAGS or DLDFLAGS are passed to it?  Looking at Makefile.sub:

s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t

It uses LDFLAGS, not DLDFLAGS.  But since LDFLAGS is not set, the conftest does not pass, thus the extension is not built.

5. Warnings.

> -W3?

Yes, good catch.

> Possibly, do you mean CRTDEFFLAGS?

Ah, didn't know about that.  Looks like it does the same thing as -wd4996.

So that leaves the LDFLAGS issue, updating setup.mak, and the -W3 issue.  Would you like me to put together separate, updated patches for those?



----------------------------------------
http://redmine.ruby-lang.org/issues/show/1253

----------------------------------------
http://redmine.ruby-lang.org