building NSS for tools like certutil and pk12util

Hi Experts,
I want to build Mozilla NSS with its dependencies statically linked so that I don't need to install the VC runtime in order to use the NSS tools (on client computers).  Can someone help me to get this done on Windows 7 using VS2008?

Thank you!
Mike
LVL 1
threadyAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
It is allowed and MS even offers downloads for all runtimes to be redistributed: http://www.microsoft.com/en-us/download/details.aspx?id=26999 -

Just 'run' that package during the setup in 'silent' mode.
0
 
jkrCommented:
You'd basically have to change the 'Code Generation' settings for each .vcproj. Open the solution, right click on every project, choose "Properties|Configuration Properties|C/C++|Code Generation" and change "Multi-threaded DLL" to "Multi-threaded" and rebuild.
0
 
threadyAuthor Commented:
There are no vcproj files for this - the project uses makefiles...  So I've got 2 challenges here...

1-  Figure out how to build on windows with make....  (do I use minGW for this)?
2-  Patch the source so that I don't get build errors when building statically:
        (https://bugzilla.mozilla.org/show_bug.cgi?id=534471)

Thanks,
Mike
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
jkrCommented:
Ah, OK. In that case, open the Makefile and replace all '/MD' options with '/MT' .
And yes, you could use MinGW, but then the VC runtime does not matter anyway...
0
 
threadyAuthor Commented:
I looked for /MD somewhere in the source tree for NSS - not a single one of them unfortunately.  The first makefile includes other makefiles and you soon realize you're going much deeper down the rabbit hole than you'd ever care to know.  And then you forget what you were looking for in the first place.

I'm wondering if there's not a better way to do this.. I've got all this .c code... Would it be easier to create my own vcproj?  I'm doubting that too.  But Chrome supposedly builds this stuff in its build (statically).  Maybe that's my best bet....

Maybe build Chrome and grab the output of the statically linked NSS outputted files and use them in a new Visual Studio project of my own...  What do you think?
0
 
jkrCommented:
I'd check the 'configure' script that creates the makefiles. But anyway, after reading over the Bugzilla entry again, I'd rather not do that - seriously, what is that patch/build orgy worth compared to installing a runtime on the client computers? Especially the paragraph

WARNING: NSS uses shared libraries heavily.  The NSS team
only supports NSS in shared library form.  I'm providing
these patches without support.  The patches in this bug
could be hard to maintain as NSS evolves.

would make me refrain from that...
0
 
threadyAuthor Commented:
Yeah. I know.  Read that too.  But I figured you were jkr and you'd have a magic button that takes care of things like this.  But I guess not even you can create a rock you can't lift...  ;-)
0
 
threadyAuthor Commented:
I wonder if there would be a way to create a sort of general purpose wrapper around an exe that would static-librify it by placing all its dependencies in the same folder where they'd all be redistributable...

The problem is, we can't elevate to admin on standard users machines...
0
 
jkrCommented:
Oh, we could do that, yet I am just not sure that it's worth the efford - by far. And, sorry, as an engineer, that is against my most basic principles ;o)

Err, well, on the other hand... *duck*
0
 
threadyAuthor Commented:
Just copying the dlls required is a big no no right?   Just brainstorming here...
0
 
jkrCommented:
Err, it is actually a big YES. Adding some DLLs to your installer will cost you a couple of minutes. Patching and maintaing that code will cost you quite a couple of hours, not taking into account what the future might bring. Talk efficiency ;o)
0
 
threadyAuthor Commented:
Hang on, I'm talking about dlls from VS2010 runtime....  it's that allowed?  Would that even work?
0
 
threadyAuthor Commented:
Are you saying that's supposed to work even for non admin users? I did try to run the vs2010 runtime on a standard user machine and it wouldn't let me do the install.... I had to login as admin for it to work.  although I didn't try it in silent mode...
0
 
threadyAuthor Commented:
Haven't tried it yet, but even if I can't run the full silent mode install, I am allowed to copy individual dlls needed in my application folder.  Sweet.  Thanks again jkr.  http://msdn.microsoft.com/en-us/library/dd293565.aspx
0
 
threadyAuthor Commented:
Confirmed - one cannot run the VC++2010 redist as standard user.  Now I'm trying to find the DLLs needed and placing them directly in the same folder as the exe.  I'm posting another question shortly about dependency walker soon...  (I've copied mfc100.dll, mfc100u.dll, msvcr100.dll, msvcp100.dll and msvcr100_clr0400.dll to the same folder and getting Exception 0xc000007b when starting...)
0
 
jkrCommented:
What installer are you using? (Sorry, that was a bit late yesterday) Most of them allow to specify 'Admin' as the required privilege, which is definitely necessary for the runtime as you noticed...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.