Building NSIS with vc9
I'm trying to build NSIS with Python 2.5, scons 0.98.5 and vc9 but I get an error saying "Couldn't find a good version of libcp.lib". What am I doing wrong? I'm trying to build HEAD
39 posts
If I try to run the cl command on my own I get this:file C:\Tobbe\DevProjects\C++\nsis\SCons\Config\ms,line 37:
Configure(confdir = .sconf_temp)
.sconf_temp\conftest_0.cpp <-
|
|#include <fstream>
|int main() {
| // no change
| std:😳fstream header("test", std:😳fstream:😳ut);
| return 0;
|}
|
cl /nologo /GS- /EHsc /TP /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /c .sconf_temp\conftest_0.cpp /Fo.sconf_temp\conftest_0.obj
cl is not an internal command, external command or command file.
C:\Tobbe\DevProjects\C++\nsis>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
I don't (think) I want to compile NSIS Menu. How do I not compile it?*** error: WXWIN must be set to build NSIS Menu!
scons: *** [build\release\NSIS Menu\NSIS] Error 1
scons: building terminated because of errors.
Since I just wanted to make it work on my computer I got rid of the "if defenv" stuffimport os
defenv['ENV']['PATH'] = os.environ.get('PATH')
defenv['ENV']['HOME'] = os.environ.get('HOME')
defenv['ENV']['LIB'] = os.environ.get('LIB')
defenv['ENV']['INCLUDE'] = os.environ.get('INCLUDE')
defenv.Append(CCFLAGS = '/GS-')
Originally posted by TobbeSwedenBTW, the "NSIS Menu" util is a real pain to get compiled. It requires a lot of external things, and has to be done exactly right.
I added SKIPUTILS="NSIS Menu"
Finished without errors now 🙂
Originally posted by SheikThen again, its not something most people need to recompile
BTW, the "NSIS Menu" util is a real pain to get compiled. It requires a lot of external things, and has to be done exactly right.
Its too bad it can't be made easier to build...
SCons doesn't support Visual C++ 2008 yet. A temporary solution would be to use the environment variables to detect the compiler location.I'm not sure if this is the fix, but I'm not sure what environment variables/values Joost is referring to. It looks like the issue was in fact resolved, but it wasn't clear to me how. 😕
I have attached a copy of my current MS file in case it might help.
AttributeError: 'NoneType' object has no attribute 'split':
File "C:\downloads\Development\__INSTALLATION\nsis\source\nsis-2.38-src\SConstruct", line 364:
# For VS 2005 and up, the single threaded version of C runtime
# need not be explicitly linked.
if float(defenv['MSVS_VERSION'].replace('Exp','')) < 8.0:
libcptest = """
#include <fstream>
int main() {
// %s
std:😳fstream header("test", std:😳fstream:😳ut);
return 0;
}
"""
conf.env.PrependENVPath('LIB', Dir('#/.sconf_temp').abspath)
conf.env.Append(CCFLAGS = ['$EXCEPTION_FLAG'])
if not conf.TryLink(libcptest % 'no change', '.cpp'):
import os, shutil
libdirs = defenv['ENV']['LIB'].split(os.pathsep)
for libdir in libdirs:
try:
libcp = r'%s\libcp.lib' % libdir
shutil.copy(libcp, Dir('#/.sconf_temp').abspath)
if conf.TryLink(libcptest % (r'using %s' % libcp), '.cpp'):
defenv.PrependENVPath('LIB', Dir('#/.sconf_temp').abspath)
break
except IOError:
continue
else:
print "*** Couldn't find a good version of libcp.lib"
Exit(2)
I downloaded the NSIS sources (rev. 5767) from the subversion repository. An initial attempt to build with Visual Studio 2005 from "Visual Studio 2005 Command Prompt" resulted in the same problem (Python 2.5, Scons v1.1.0.r3603):
The generated config.log had the following content:
C:\NSIS>"%PROGRAMFILES%\Python25\Scripts\scons" SKIPUTILS="NSIS Menu"
scons: Reading SConscript files ...
Delete("nsis-17-Nov-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
*** Couldn't find a good version of libcp.lib
If I invoke the C compiler from the command prompt then the conftest_0.cpp file just builds fine.
file C:\NSIS\SCons\Config\ms,line 37:
Configure(confdir = .sconf_temp)
.sconf_temp\conftest_0.cpp <-
|
|#include <fstream>
|int main() {
| // no change
| std:😳fstream header("test", std:😳fstream:😳ut);
| return 0;
|}
|
cl /Fo.sconf_temp\conftest_0.obj /c .sconf_temp\conftest_0.cpp /nologo /GS- /EHsc /TP /nologo /GS- /EHsc /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS
'cl' is not recognized as an internal or external command,
operable program or batch file.
A comparison of the environment variables used in the command prompt and Scons revealed that Scons only takes the environment variables stored in the Windows registry.
"The default value of the PATH environment variable on a Windows system comes from the Windows registry value for the command interpreter. If you want to execute any commands--compilers, linkers, etc.--that are notAs a consequence the changes to the PATH, INCLUDE, LIB enviroment variables carried out by the "Visual Studio 2005 Prompt" batch script (vsvars32.bat) won't be propagated to Scons execution environment.
in these default locations, you need to set the PATH value in the $ENV dictionary in your construction environment."
Source: http://www.scons.org/doc/1.1.0/HTML/...ser/x1673.html
The following patch propagates the current values of the
PATH, LIB, INCLUDE enviroment variables to the Scons
execution environment.
The above patch allows me to build NSIS with Visual Studio 2005.
--- NSIS.orig/SCons/Config/ms Mon Nov 17 13:16:03 2008
+++ NSIS/SCons/Config/ms Mon Nov 17 12:53:07 2008
@@ -2,6 +2,11 @@
Import('defenv')
+import os
+defenv['ENV']['PATH'] = os.environ.get('PATH')
+defenv['ENV']['LIB'] = os.environ.get('LIB')
+defenv['ENV']['INCLUDE'] = os.environ.get('INCLUDE')
+
### flags
defenv['ENTRY_FLAG'] = lambda x: '/entry:' + x
It might be a matter of personal preference whether to take the values of the environment variables from the current running command interpreter or the Windows registry. I would give precedence to the current running command interpreter.
Sorry I did not want to register only to post my comment.
Please feel free to post it.
scons PATH=... TOOLSET=msvc