Abdelrazak Younes wrote:
I have fixed with brute force the manifest problem. Feel free to find a better solution.

Patch attached.

Sorry, this patch was against my branch. Please find attached the patch against trunk.

Abdel.

Index: SConstruct
===================================================================
--- SConstruct  (revision 14145)
+++ SConstruct  (working copy)
@@ -337,6 +337,9 @@
 # all built libraries will go to build_dir/libs
 # (This is different from the make file approach)
 env['LOCALLIBPATH'] = '$BUILDDIR/libs'
+#
+# each build has its own config.h
+env['LOCALCONFIGPATH'] = '$BUILDDIR/config'
 env.AppendUnique(LIBPATH = ['$LOCALLIBPATH'])
 
 
@@ -649,9 +652,15 @@
 # now, if msvc2005 is used, we will need that QT_LIB_PATH/QT_LIB.manifest file
 if use_vc:
   # glob file xxx.dll.manifest (msvc 2003 may not have it)
-  manifests = glob.glob(os.path.join(qt_lib_path, '*.dll.manifest'))
-  if manifests != []:
-    env['LINKCOM'] = [env['LINKCOM'], 'mt.exe /MANIFEST %s 
/outputresource:$TARGET;1' % manifests[0]]
+  #manifests = glob.glob(os.path.join(qt_lib_path, '*.dll.manifest'))
+  #if manifests != []:
+  #  env['LINKCOM'] = [env['LINKCOM'], 'mt.exe /MANIFEST %s 
/outputresource:$TARGET;1' % manifests[0]]
+  if mode == 'debug':
+    manifest = os.path.join(qt_lib_path, 'QtGuid4.dll.manifest')
+  else:
+    manifest = os.path.join(qt_lib_path, 'QtGui4.dll.manifest')
+  env['LINKCOM'] = [env['LINKCOM'], 'mt.exe /MANIFEST %s 
/outputresource:$TARGET;1' % manifest]
+    
 
 # check socket libs
 if not fast_start:
@@ -762,12 +771,84 @@
 #----------------------------------------------------------
 aspell_lib = 'aspell'
 # assume that we use aspell, aspelld compiled for msvc
-if platform_name == 'win32' and mode == 'debug':
+if platform_name == 'win32' and mode == 'debug' and use_vc:
   aspell_lib = 'aspelld'
 
 if not fast_start:
-  print "Generating src/config.h..."
+  #
+  boost_config_h = os.path.join(env.Dir('$LOCALCONFIGPATH').path, 
'boost_config.h')
+  #
+  print "Creating %s..." % boost_config_h
+  #
+  utils.createConfigFile(conf,
+    config_file = boost_config_h,
+    config_pre = '''/* boost_config.h.  Generated by SCons.  */
 
+/* -*- C++ -*- */
+/*
+ * \file config.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * This is the compilation configuration file for LyX.
+ * It was generated by scon.
+ * You might want to change some of the defaults if something goes wrong
+ * during the compilation.
+ */
+
+#ifndef _BOOST_CONFIG_H
+#define _BOOST_CONFIG_H
+''',
+    headers = [
+      ('ostream', 'HAVE_OSTREAM', 'cxx'),
+      ('locale', 'HAVE_LOCALE', 'cxx'),
+      ('sstream', 'HAVE_SSTREAM', 'cxx'),
+#      ('newapis.h', 'HAVE_NEWAPIS_H', 'c'),
+    ],
+    custom_tests = [
+      (env.has_key('assertions') and env['assertions'],
+        'ENABLE_ASSERTIONS',
+        'Define if you want assertions to be enabled in the code'
+      ),
+    ],
+    config_post = '''
+
+#define BOOST_USER_CONFIG <boost_config.h>
+
+#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
+#  define USE_BOOST_FORMAT 1
+#else
+#  define USE_BOOST_FORMAT 0
+#endif
+
+#if !defined(ENABLE_ASSERTIONS)
+#  define BOOST_DISABLE_ASSERTS 1
+#endif
+#define BOOST_ENABLE_ASSERT_HANDLER 1
+
+#define BOOST_DISABLE_THREADS 1
+#define BOOST_NO_WREGEX 1
+#define BOOST_NO_WSTRING 1
+
+#ifdef __CYGWIN__
+#  define BOOST_POSIX 1
+#endif
+
+#define BOOST_ALL_NO_LIB 1
+
+#if defined(HAVE_NEWAPIS_H)
+#  define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
+#endif
+
+#endif
+'''
+  )
+  #
+  # config.h for each build
+  config_h = os.path.join(env.Dir('$LOCALCONFIGPATH').path, 'config.h')
+  
+  print "Generating %s..." % config_h
+
   # AIKSAURUS_H_LOCATION
   if (conf.CheckCXXHeader("Aiksaurus.h")):
     aik_location = '<Aiksaurus.h>'
@@ -805,7 +886,7 @@
   #
   # create config.h
   result = utils.createConfigFile(conf,
-    config_file = os.path.join(top_src_dir, 'src', 'config.h'),
+    config_file = config_h,
     config_pre = '''/* src/config.h.  Generated by SCons.  */
 
 /* -*- C++ -*- */
@@ -827,7 +908,6 @@
       ('io.h', 'HAVE_IO_H', 'c'),
       ('limits.h', 'HAVE_LIMITS_H', 'c'),
       ('locale.h', 'HAVE_LOCALE_H', 'c'),
-      ('locale', 'HAVE_LOCALE', 'cxx'),
       ('process.h', 'HAVE_PROCESS_H', 'c'),
       ('stdlib.h', 'HAVE_STDLIB_H', 'c'),
       ('sys/stat.h', 'HAVE_SYS_STAT_H', 'c'),
@@ -839,7 +919,6 @@
       ('utime.h', 'HAVE_UTIME_H', 'c'),
       ('direct.h', 'HAVE_DIRECT_H', 'c'),
       ('istream', 'HAVE_ISTREAM', 'cxx'),
-      ('ostream', 'HAVE_OSTREAM', 'cxx'),
       ('ios', 'HAVE_IOS', 'cxx'),
     ],
     functions = [
@@ -859,13 +938,13 @@
       ('mkstemp', 'HAVE_MKSTEMP', None),
       ('strerror', 'HAVE_STRERROR', None),
       ('count', 'HAVE_STD_COUNT', '''
-  #include <algorithm>
-  int count()
-  {
-    char a[] = "hello";
-    return std::count(a, a+5, 'l');
-  }
-  '''),
+#include <algorithm>
+int count()
+{
+  char a[] = "hello";
+  return std::count(a, a+5, 'l');
+}
+'''),
       ('getcwd', 'HAVE_GETCWD', None),
       ('setenv', 'HAVE_SETENV', None),
       ('putenv', 'HAVE_PUTENV', None),
@@ -900,10 +979,6 @@
         'Define if your <locale.h> file defines LC_MESSAGES.'
       ),
       (devel_version, 'DEVEL_VERSION', 'Whether or not a development version'),
-      (env.has_key('assertions') and env['assertions'],
-        'ENABLE_ASSERTIONS',
-        'Define if you want assertions to be enabled in the code'
-      ),
       (env.has_key('nls') and env['nls'],
         'ENABLE_NLS',
         "Define to 1 if translation of program messages to the user's native 
anguage is requested.",
@@ -916,7 +991,7 @@
         '_GLIBCXX_CONCEPT_CHECKS',
         'libstdc++ concept checking'
       ),
-      (os.name != 'nt', 'BOOST_POSIZ',
+      (os.name != 'nt', 'BOOST_POSIX',
         'Indicates to boost which API to use (posix or windows).'
       ),
       (spell_engine is not None, spell_engine,
@@ -968,32 +1043,9 @@
 #endif
 #endif
 
-#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
-#  define USE_BOOST_FORMAT 1
-#else
-#  define USE_BOOST_FORMAT 0
-#endif
+#include <boost_config.h>
 
-#define BOOST_USER_CONFIG <config.h>
-
-#if !defined(ENABLE_ASSERTIONS)
-#  define BOOST_DISABLE_ASSERTS 1
 #endif
-#define BOOST_ENABLE_ASSERT_HANDLER 1
-
-#define BOOST_DISABLE_THREADS 1
-#define BOOST_NO_WREGEX 1
-#define BOOST_NO_WSTRING 1
-
-#ifdef __CYGWIN__
-#  define BOOST_POSIX 1
-#endif
-
-#if defined(HAVE_NEWAPIS_H)
-#  define WANT_GETFILEATTRIBUTESEX_WRAPPER 1
-#endif
-
-#endif
 '''
   )
 
@@ -1040,7 +1092,7 @@
     qt_libs = ['QtCore', 'QtGui']
     # set the right lib names
     if platform_name == 'win32':
-      if mode == 'debug':
+      if mode == 'debug' and use_vc:
         qt_lib_suffix = 'd4'
       else:
         qt_lib_suffix = '4'
@@ -1090,11 +1142,12 @@
   env.AppendUnique(LIBPATH = ['/usr/X11R6/lib'])
 
 #
-# boost is always in, src is needed for config.h
+# boost is always in, $LOCALCONFIGPATH is needed for config.h
+# TOP_SRCDIR/src is used by everyone.
 #
 # QT_INC_PATH is not needed for *every* source file
 env['CPPPATH'].remove(qt_inc_path)
-env['CPPPATH'] += ['$TOP_SRCDIR/boost', '$TOP_SRCDIR/src']
+env['CPPPATH'] += ['$TOP_SRCDIR/boost', '$LOCALCONFIGPATH', '$TOP_SRCDIR/src']
 
 #
 # Customized builders
@@ -1286,132 +1339,10 @@
 
   boostenv = env.Copy()
   #
-  boost_config_h = os.path.join(top_src_dir, 'boost', 'libs', 'config.h')
-  if not os.path.isfile(boost_config_h) or not fast_start:
-    #
-    print "Creating boost/config.h..."
-    #
-    # start another configuration session.
-    conf = Configure(boostenv, 
-      custom_tests = {'CheckMkdirOneArg' : utils.checkMkdirOneArg},
-    )      
-    #
-    # create config.h
-    result = utils.createConfigFile(conf,
-      config_file = boost_config_h,
-      config_pre = '''/* boost/libs/config.h.  Generated by SCons.  */
-
-/* -*- C++ -*- */
-/*
- * \file config.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * This is the compilation configuration file for LyX.
- * It was generated by scon.
- * You might want to change some of the defaults if something goes wrong
- * during the compilation.
- */
-
-#ifndef _CONFIG_H
-#define _CONFIG_H
-''',
-      headers = [
-        ('io.h', 'HAVE_IO_H', 'c'),
-        ('limits.h', 'HAVE_LIMITS_H', 'c'),
-        ('locale.h', 'HAVE_LOCALE_H', 'c'),
-        ('locale', 'HAVE_LOCALE', 'cxx'),
-        ('process.h', 'HAVE_PROCESS_H', 'c'),
-        ('stdlib.h', 'HAVE_STDLIB_H', 'c'),
-        ('sys/stat.h', 'HAVE_SYS_STAT_H', 'c'),
-        ('sys/time.h', 'HAVE_SYS_TIME_H', 'c'),
-        ('sys/types.h', 'HAVE_SYS_TYPES_H', 'c'),
-        ('sys/utime.h', 'HAVE_SYS_UTIME_H', 'c'),
-        ('sys/socket.h', 'HAVE_SYS_SOCKET_H', 'c'),
-        ('unistd.h', 'HAVE_UNISTD_H', 'c'),
-        ('utime.h', 'HAVE_UTIME_H', 'c'),
-        ('direct.h', 'HAVE_DIRECT_H', 'c'),
-        ('istream', 'HAVE_ISTREAM', 'cxx'),
-        ('ostream', 'HAVE_OSTREAM', 'cxx'),
-        ('ios', 'HAVE_IOS', 'cxx'),
-      ],
-      functions = [
-        ('open', 'HAVE_OPEN', None),
-        ('close', 'HAVE_CLOSE', None),
-        ('popen', 'HAVE_POPEN', None),
-        ('pclose', 'HAVE_PCLOSE', None),
-        ('_open', 'HAVE__OPEN', None),
-        ('_close', 'HAVE__CLOSE', None),
-        ('_popen', 'HAVE__POPEN', None),
-        ('_pclose', 'HAVE__PCLOSE', None),
-        ('getpid', 'HAVE_GETPID', None),
-        ('_getpid', 'HAVE__GETPID', None),
-        ('mkdir', 'HAVE_MKDIR', None),
-        ('_mkdir', 'HAVE__MKDIR', None),
-        ('mktemp', 'HAVE_MKTEMP', None),
-        ('mkstemp', 'HAVE_MKSTEMP', None),
-        ('strerror', 'HAVE_STRERROR', None),
-        ('getcwd', 'HAVE_GETCWD', None),
-        ('setenv', 'HAVE_SETENV', None),
-        ('putenv', 'HAVE_PUTENV', None),
-        ('fcntl', 'HAVE_FCNTL', None),
-      ],
-      custom_tests = [
-        (conf.CheckMkdirOneArg(),
-          'MKDIR_TAKES_ONE_ARG',
-          'Define if mkdir takes only one argument.'
-        ),
-        (env.has_key('assertions') and env['assertions'],
-          'ENABLE_ASSERTIONS',
-          'Define if you want assertions to be enabled in the code'
-        ),
-        (env.has_key('warnings') and env['warnings'],
-          'WITH_WARNINGS',
-          'Define this if you want to see the warning directives put here and 
there by the developpers to get attention'
-        ),
-        (env.has_key('concept_checks') and env['concept_checks'],
-          '_GLIBCXX_CONCEPT_CHECKS',
-          'libstdc++ concept checking'
-        ),
-        (os.name != 'nt', 'BOOST_POSIZ',
-          'Indicates to boost which API to use (posix or windows).'
-        ),
-      ],
-      extra_items = [
-        ('#define BOOST_ALL_NO_LIB 1',
-          'disable automatic linking of boost libraries.'),
-      ],
-      config_post = '''
-
-#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
-#  define USE_BOOST_FORMAT 1
-#else
-#  define USE_BOOST_FORMAT 0
-#endif
-
-#define BOOST_USER_CONFIG <config.h>
-
-#if !defined(ENABLE_ASSERTIONS)
-#  define BOOST_DISABLE_ASSERTS 1
-#endif
-#define BOOST_ENABLE_ASSERT_HANDLER 1
-
-#define BOOST_DISABLE_THREADS 1
-#define BOOST_NO_WREGEX 1
-#define BOOST_NO_WSTRING 1
-
-#ifdef __CYGWIN__
-#  define BOOST_POSIX 1
-#endif
-
-#endif
-'''
-    )
-    conf.Finish()
   # 
   # boost use its own config.h
-  boostenv['CPPPATH'] = ['$TOP_SRCDIR/boost', '$TOP_SRCDIR/boost/libs'] + 
extra_inc_paths
-  boostenv.AppendUnique(CCFLAGS = ['-DBOOST_USER_CONFIG="<config.h>"'])
+  boostenv['CPPPATH'] = ['$TOP_SRCDIR/boost', '$LOCALCONFIGPATH'] + 
extra_inc_paths
+  boostenv.AppendUnique(CCFLAGS = ['-DBOOST_USER_CONFIG="<boost_config.h>"'])
 
   for lib in boost_libs:
     print 'Processing files in boost/libs/%s/src...' % lib
@@ -2040,7 +1971,7 @@
   print "Processing files in src/tex2lyx..."
 
   tex2lyx_env = env.Copy()
-  # the order is important here.
+  #
   tex2lyx_env.Prepend(CPPPATH = ['$BUILDDIR/common/tex2lyx'])
   tex2lyx_env.AppendUnique(LIBPATH = ['#$LOCALLIBPATH'])
 

Reply via email to