Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 9th April 2010, 00:08   #1
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 301
Building NSIS for various compiler (VC6,VC7,VC8...)

I am really having a hard time having SCons build NSIS source for various compilers on my machine where VC6, VC7 (VC++ Toolkit 2003), VC8 (VC++ Express 2005) are installed.
If I run SCons without any changes, it compiles perfectly with VC8. Now I'd like to run it with other compilers.

I tried a lot of various thing and option switches, or even tried to tweak SConstruct, but I get various type of errors, most of the time before it even starts compiling!
Here are some examples of the errors I get:
Quote:
AttributeError: SConsEnvironment instance has no attribute 'Program':
File "D:\Prog\extern\NSIS\SCons\Config\ms", line 67:
if not conf.TryLink(libcptest % 'no change', '.cpp'):
File "C:\Programs\Python26\Lib\site-packages\scons-1.3.0\SCons\SConf.py", line 618:
return self.TryBuild(self.env.Program, text, extension )
Quote:
Checking for C library zdll... no
Checking for C library z... no
zlib (win32) is missing!
Quote:
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [build\release\AdvSplash\AdvSplash.dll] AttributeError : 'NoneType' object has no attribute '__dict__'
So my question is:
How to make this work?! Was someone able to achieve that on a single machine?
What is the set of environment variables needed for each compiler?
I have already:
MSDevDir=C:\Program Files\Microsoft Visual Studio\Common\MSDev98
VCToolkitInstallDir=C:\Program Files\Microsoft Visual C++ Toolkit 2003\
VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
ZLIB_W32=D:\Prog\extern\zlib
How to force SCons into using a specific compiler?
I already tried forcing values like:
defenv['MSVS_VERSION'] = "6.0"
defenv["MSVS"] = {"VERSION": "6.0"}
defenv["MSVC_VERSION"] = "6.0"
in SConstruct, without success... checking the effect with a print defenv.Dump()
Is the only solution to not have compilers in the standard installation path in order for SCons not to find those compilers?
Wizou is offline   Reply With Quote
Old 9th April 2010, 11:23   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
I used to be able to compile with VC6 and SCons 0.98 just fine, now with the need for a updated SCons (Why??) it no longer compiles without problems.

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 9th April 2010, 15:14   #3
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 301
I use Python 2.6 and SCons 1.3.0 ...
Wizou is offline   Reply With Quote
Old 9th April 2010, 16:07   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
I'm using VC6 SP5+PP and PlatformSDK2003Feb, IIRC the new scons screws up the include directory order for me so I had to override the include and lib dirs in my scons command

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 10th April 2010, 18:15   #5
f0rt
Junior Member
 
Join Date: Jul 2009
Posts: 33
The following patch should allow you to select a specific Microsoft compiler.
See also www.scons.org/wiki/MsvsMultipleVersions

PHP Code:
IndexSConstruct
===================================================================
--- 
SConstruct    (revision 6046)
+++ 
SConstruct    (working copy)
@@ -
151,+151,@@
 
opts.Add(('PATH''A colon-separated list of system paths instead of the default - TEMPORARY AND MAY DEPRECATE'None))
 
opts.Add(('TOOLSET''A comma-separated list of specific tools used for building instead of the default'None))
 
opts.Add(BoolVariable('MSTOOLKIT''Use Microsoft Visual C++ Toolkit''no'))
+
opts.Add(EnumVariable('MSVS_VERSION''MS Visual C++ version'os.environ.get('MSVS_VERSION'), allowed_values=('6.0''7.0''7.1''8.0''8.0Exp''9.0''9.0Exp''10.0''10.0Exp')))
 
opts.Add(BoolVariable('CHMDOCS''Build CHM documentation, requires hhc.exe'hhc))
 
opts.Add(PathVariable('APPEND_CPPPATH''Additional paths to search for include files'None))
 
opts.Add(PathVariable('APPEND_LIBPATH''Additional paths to search for libraries'None)) 
After you applied the patch you would either set the MSVS_VERSION environment variable or provide MSVS_VERSION as option to scons.

For example to select "Microsoft Visual C++ 2008 Express Edition":
PHP Code:
set MSVS_VERSION=9.0Exp
scons 
or
PHP Code:
scons MSVS_VERSION=9.0Exp 
scons 1.2.0 has difficulties to detect the Platform SDK installed with VC++ 2008 Express Edition. So in that case you would need to upgrade to scons 1.3.0.
f0rt is offline   Reply With Quote
Old 10th April 2010, 19:27   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
f0rt, I have been telling you for weeks now, VC6 SP5+PP and PlatformSDK2003Feb is the "default" setup and it is currently broken, so can you please fix it, or revert to older scons? I can't remember if it was you or Wizou that made 1.x a requirement, but something broke when that change was made, either with scons itself or our build script

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 13th April 2010, 18:22   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
If I change from scons 1.3 to 1.2, my VC6 setup builds, so I guess my problem is with scons itself. So, somebody (f0rt?) should file a bug with scons about platform sdk detection (I know they have done some changes there)

IntOp $PostCount $PostCount + 1
Anders is online now   Reply With Quote
Old 14th April 2010, 00:26   #8
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 301
mmmh using f0rt changes, I was able to compile under VC6

and then moving from scons 1.3.0 to 1.2.0, I was able to compile under MSToolkit VC2003, but no longer under VC6 !

grrrr!

(at least, it teaches us that if Nightly builds are made under MSToolkit 2003, they should use SCons 1.2.0)
Wizou is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump