Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Building JS engine with static Windows CRT libraries (Option /MT instead of /MD not using msvcr90.dll) ?

31 views
Skip to first unread message

samuel...@bluecall.ch

unread,
Jan 9, 2012, 5:07:42 AM1/9/12
to
Dear All

What config / make / build fieles must be changed to build the JS
engine with static Windows CRT libraries?

Per default js build seems to use the option /MD for dynamic link to
CRT libs.

What Options in What file must be changed to build with Option /MT so
that mozjs185-1.0.dll does not depend on MSVCR90.DLL ?

From config.mk of mozjs185-1.0

# We don't build a static CRT when building a custom CRT,
# it appears to be broken. So don't link to jemalloc if
# the Makefile wants static CRT linking.
ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_)
# Disable default CRT libs and add the right lib path for the linker
OS_LDFLAGS += $(MOZ_MEMORY_LDFLAGS)
endif

Question: Is there a newer stable version what can be build with
static Windows CRT libraries ?


Thanks for any help and Best Regards
Samuel

Masquerade

unread,
Feb 18, 2012, 5:24:00 AM2/18/12
to
Have you figure out how? I want to do the same thing.

As a workaround, I am able to create a VC2010 project for the js1.8.5
src code and compile them as static a library inside the IDE. With
VS2010, you are able to switch the MT/MD project setting easily.

samuel...@bluecall.ch

unread,
Feb 20, 2012, 5:38:38 AM2/20/12
to
> VS2010, you are able to switch the MT/MD project setting easily.- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

The reason for this is that the application also uses other APIs what
are built with statically linked CRTs.
In Windows all CRT Stuff must be loaded the same way. So we can not
have one API using statically linked CRTs and an other API using
dynamically linked CRTs.

For the moment we have made a compile of js-1.8.5 using the -MT
instead of -MD flag. So far it seems to work. (Also x64 with Win2008)

For future releases of the js engine it would be appreciate to have on
officicial build parameter like --enable-static-crt what decides to
link with static or dynamic Windows CRTs.

Samuel
0 new messages