From a7be6822ea03ca1abafacbbde8ec2585b0908c3a Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 5 Apr 2006 18:42:30 +0000 Subject: [PATCH] automatically pass makensis build settings to script git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4632 212acab6-be3b-0410-9dea-997c60f758d6 --- SConstruct | 17 +++-- Source/build.cpp | 171 ++--------------------------------------------- 2 files changed, 18 insertions(+), 170 deletions(-) diff --git a/SConstruct b/SConstruct index 40801eff..b95e5255 100644 --- a/SConstruct +++ b/SConstruct @@ -147,14 +147,21 @@ if defenv['PLATFORM'] != 'win32': defenv.Append(NSIS_CPPDEFINES = [('PREFIX_CONF', '"%s"' % defenv.subst('$PREFIX_CONF'))]) defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DATA', '"%s"' % defenv.subst('$PREFIX_DATA'))]) -# write configuration into sconf.h -f = open(File('#Source/exehead/sconf.h').abspath, 'w') +# write configuration into sconf.h and defines.h +sconf_h = open(File('#Source/exehead/sconf.h').abspath, 'w') +defines_h = open(File('#Source/defines.h').abspath, 'w') for i in defenv['NSIS_CPPDEFINES']: if type(i) is not str: - f.write('#define %s %s\n' % (i[0], i[1])) + sconf_h.write('#define %s %s\n' % (i[0], i[1])) + if type(i[1]) is int: + defines_h.write('definedlist.add("%s", "%s");\n' % (i[0], i[1])) + else: + defines_h.write('definedlist.add("%s", %s);\n' % (i[0], i[1])) else: - f.write('#define %s\n' % (i)) -f.close() + sconf_h.write('#define %s\n' % (i)) + defines_h.write('definedlist.add("%s");\n' % (i)) +sconf_h.close() +defines_h.close() # write version into version.h f = open(File('#Source/version.h').abspath, 'w') diff --git a/Source/build.cpp b/Source/build.cpp index 6b9765dd..ce1788a5 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -89,172 +89,13 @@ CEXEBuild::CEXEBuild() : definedlist.add("NSIS_VERSION", NSIS_VERSION); -#define intdef2str_(x) #x -#define intdef2str(x) intdef2str_(x) - definedlist.add("NSIS_MAX_INST_TYPES", intdef2str(NSIS_MAX_INST_TYPES)); - definedlist.add("NSIS_MAX_STRLEN", intdef2str(NSIS_MAX_STRLEN)); - definedlist.add("NSIS_DEFAULT_LANG", intdef2str(NSIS_DEFAULT_LANG)); - definedlist.add("NSIS_COMPRESS_BZIP2_LEVEL", intdef2str(NSIS_COMPRESS_BZIP2_LEVEL)); -#undef intdef2str -#undef intdef2str_ -#ifdef NSIS_BZIP2_COMPRESS_WHOLE - definedlist.add("NSIS_BZIP2_COMPRESS_WHOLE"); -#endif -#ifdef NSIS_COMPRESS_BZIP2_SMALLMODE - definedlist.add("NSIS_COMPRESS_BZIP2_SMALLMODE"); -#endif -#ifdef NSIS_LZMA_COMPRESS_WHOLE - definedlist.add("NSIS_LZMA_COMPRESS_WHOLE"); -#endif -#ifdef NSIS_CONFIG_COMPONENTPAGE - definedlist.add("NSIS_CONFIG_COMPONENTPAGE"); -#endif -#ifdef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE - definedlist.add("NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE"); -#endif -#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT - definedlist.add("NSIS_CONFIG_COMPRESSION_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_CRC_ANAL - definedlist.add("NSIS_CONFIG_CRC_ANAL"); -#endif -#ifdef NSIS_CONFIG_CRC_SUPPORT - definedlist.add("NSIS_CONFIG_CRC_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT - definedlist.add("NSIS_CONFIG_ENHANCEDUI_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_LICENSEPAGE - definedlist.add("NSIS_CONFIG_LICENSEPAGE"); -#endif -#ifdef NSIS_CONFIG_LOG - definedlist.add("NSIS_CONFIG_LOG"); -#endif -#ifdef NSIS_CONFIG_LOG_ODS - definedlist.add("NSIS_CONFIG_LOG_ODS"); -#endif -#ifdef NSIS_CONFIG_LOG_STDOUT - definedlist.add("NSIS_CONFIG_LOG_STDOUT"); -#endif -#ifdef NSIS_CONFIG_PLUGIN_SUPPORT - definedlist.add("NSIS_CONFIG_PLUGIN_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_SILENT_SUPPORT - definedlist.add("NSIS_CONFIG_SILENT_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT - definedlist.add("NSIS_CONFIG_UNINSTALL_SUPPORT"); -#endif -#ifdef NSIS_CONFIG_VISIBLE_SUPPORT - definedlist.add("NSIS_CONFIG_VISIBLE_SUPPORT"); -#endif -#ifdef NSIS_SUPPORT_ACTIVEXREG - definedlist.add("NSIS_SUPPORT_ACTIVEXREG"); -#endif -#ifdef NSIS_SUPPORT_BGBG - definedlist.add("NSIS_SUPPORT_BGBG"); -#endif -#ifdef NSIS_SUPPORT_CODECALLBACKS - definedlist.add("NSIS_SUPPORT_CODECALLBACKS"); -#endif -#ifdef NSIS_SUPPORT_COPYFILES - definedlist.add("NSIS_SUPPORT_COPYFILES"); -#endif -#ifdef NSIS_SUPPORT_CREATESHORTCUT - definedlist.add("NSIS_SUPPORT_CREATESHORTCUT"); -#endif -#ifdef NSIS_SUPPORT_DELETE - definedlist.add("NSIS_SUPPORT_DELETE"); -#endif -#ifdef NSIS_SUPPORT_ENVIRONMENT - definedlist.add("NSIS_SUPPORT_ENVIRONMENT"); -#endif -#ifdef NSIS_SUPPORT_EXECUTE - definedlist.add("NSIS_SUPPORT_EXECUTE"); -#endif -#ifdef NSIS_SUPPORT_FILE - definedlist.add("NSIS_SUPPORT_FILE"); -#endif -#ifdef NSIS_SUPPORT_FILEFUNCTIONS - definedlist.add("NSIS_SUPPORT_FILEFUNCTIONS"); -#endif -#ifdef NSIS_SUPPORT_FINDFIRST - definedlist.add("NSIS_SUPPORT_FINDFIRST"); -#endif -#ifdef NSIS_SUPPORT_FNUTIL - definedlist.add("NSIS_SUPPORT_FNUTIL"); -#endif -#ifdef NSIS_SUPPORT_GETDLLVERSION - definedlist.add("NSIS_SUPPORT_GETDLLVERSION"); -#endif -#ifdef NSIS_SUPPORT_GETFILETIME - definedlist.add("NSIS_SUPPORT_GETFILETIME"); -#endif -#ifdef NSIS_SUPPORT_HWNDS - definedlist.add("NSIS_SUPPORT_HWNDS"); -#endif -#ifdef NSIS_SUPPORT_INIFILES - definedlist.add("NSIS_SUPPORT_INIFILES"); -#endif -#ifdef NSIS_SUPPORT_INTOPTS - definedlist.add("NSIS_SUPPORT_INTOPTS"); -#endif -#ifdef NSIS_SUPPORT_MESSAGEBOX - definedlist.add("NSIS_SUPPORT_MESSAGEBOX"); -#endif -#ifdef NSIS_SUPPORT_MOVEONREBOOT - definedlist.add("NSIS_SUPPORT_MOVEONREBOOT"); -#endif -#ifdef NSIS_SUPPORT_REBOOT - definedlist.add("NSIS_SUPPORT_REBOOT"); -#endif -#ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS - definedlist.add("NSIS_SUPPORT_REGISTRYFUNCTIONS"); -#endif -#ifdef NSIS_SUPPORT_RENAME - definedlist.add("NSIS_SUPPORT_RENAME"); -#endif -#ifdef NSIS_SUPPORT_RMDIR - definedlist.add("NSIS_SUPPORT_RMDIR"); -#endif -#ifdef NSIS_SUPPORT_SHELLEXECUTE - definedlist.add("NSIS_SUPPORT_SHELLEXECUTE"); -#endif -#ifdef NSIS_SUPPORT_STACK - definedlist.add("NSIS_SUPPORT_STACK"); -#endif -#ifdef NSIS_SUPPORT_STROPTS - definedlist.add("NSIS_SUPPORT_STROPTS"); -#endif -#ifdef NSIS_ZLIB_COMPRESS_WHOLE - definedlist.add("NSIS_ZLIB_COMPRESS_WHOLE"); -#endif -#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES - // Added by Sunil Kamath 11 June 2003 + // automatically generated header file containing all defines +#include "defines.h" + + // no longer optional definedlist.add("NSIS_SUPPORT_STANDARD_PREDEFINES"); -#endif -#ifdef NSIS_FIX_COMMENT_HANDLING - // Added by Sunil Kamath 15 October 2005 - definedlist.add("NSIS_FIX_COMMENT_HANDLING"); -#endif - -// no more optional -definedlist.add("NSIS_SUPPORT_NAMED_USERVARS"); - -#ifdef NSIS_SUPPORT_VERSION_INFO - definedlist.add("NSIS_SUPPORT_VERSION_INFO"); -#endif - -// no more optional -definedlist.add("NSIS_SUPPORT_LANG_IN_STRINGS"); - -#ifdef NSIS_FIX_DEFINES_IN_STRINGS - definedlist.add("NSIS_FIX_DEFINES_IN_STRINGS"); -#endif - -#ifdef NSIS_CONFIG_CONST_DATA_PATH - definedlist.add("NSIS_CONFIG_CONST_DATA_PATH"); -#endif + definedlist.add("NSIS_SUPPORT_NAMED_USERVARS"); + definedlist.add("NSIS_SUPPORT_LANG_IN_STRINGS"); #ifdef _WIN32 definedlist.add("NSIS_WIN32_MAKENSIS");