Michael Gerz wrote:

Hi Bo!

I get the following error message:

[EMAIL PROTECTED]:~/lyx-1.4.X/development/scons> scons fast_start=no CPPFLAGS="-gstabs -O" frontend=qt2 prefix=/home/software/lyx-bin
scons: Reading SConscript files ...
TypeError: cannot concatenate 'str' and 'list' objects:
 File "SConstruct", line 562:
   setEnvVariable(env, 'CPPFLAGS')
 File "SConstruct", line 550:
   env[name] += default

Bo,

I made a diff between SConstruct in the trunk and in the 1.4.X branch. There are some differences that make sense but others look suspicious.

Enclosed please find a reduced diff file that MAY indicate some inconsistencies. It seems that the 1.4.X version is sometimes ahead of the trunk version and sometimes it is vice versa.

Regards,

Michael

--- ./SConstruct	2006-10-03 19:37:06.000000000 +0200
+++ /home/software/lyx-trunk/development/scons/SConstruct	2006-10-04 18:54:28.000000000 +0200
@@ -57,14 +57,10 @@
 # not have to change SConstruct during lyx release
 package_version = utils.getVerFromConfigure(top_src_dir)
 package_cygwin_version = '%s-1' % package_version
-boost_version = '1_32'
+boost_version = '1_33_1'
 
-if 'svn' in package_version:
-    devel_version = True
-    default_build_mode = 'debug'
-else:
-    devel_version = False
-    default_build_mode = 'release'
+devel_version = True
+default_build_mode = 'debug'
 
 package = 'lyx'
 package_bugreport = '[email protected]'
@@ -472,7 +468,13 @@
     #   in the current code page (number)
     # C4996: foo was decleared deprecated
     CCFLAGS_required.extend(['/TP', '/EHsc'])
-    CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo', '/MD'])
+    if mode == 'debug':
+        CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo', '/MDd'])
+        # the flags are also needed in C mode (for intl lib)
+        C_CCFLAGS.extend(['/wd4819', '/wd4996', '/nologo', '/MDd'])
+    else:
+        CCFLAGS_default.extend(['/wd4819', '/wd4996', '/nologo', '/MD'])
+        C_CCFLAGS.extend(['/wd4819', '/wd4996', '/nologo', '/MD'])
 else:
     if env.has_key('CXX') and env['CXX']:
         env['CC'] = env.subst('$CXX')
@@ -531,25 +533,37 @@
                 environment variables
             split: whether or not split obtained variable like '-02 -g'
     '''
-    # first try command line argument (override environment settings)
+    # 1. ARGUMENTS is already set to env[name], override default.
     if ARGUMENTS.has_key(name):
-        default = ARGUMENTS[name]
-        if split:
-            default = default.split()
+        # env[name] may be rewritten when building tools are reloaded
+        # if that is the case, commandline option will override it.
+        env[name] = ARGUMENTS[name]
+        default = None
     # then use environment default
     elif os.environ.has_key(name):
-        print "Acquiring varaible %s from system environment: %s" % (name, os.environ[name])
+        print "Acquiring variable %s from system environment: %s" % (name, os.environ[name])
         default = os.environ[name]
         if split:
             default = default.split()
-    # set variable
-    if required is not None:
-        env[name] = required
-    if default is not None:
-        if env.has_key(name) and env[name] != default:
-            env[name] += default
-        else:
-            env[name] = default
+    # the real value should be env[name] + default + required
+    if split:
+        value = []
+        if env.has_key(name):
+            value = str(env[name]).split()
+        if required is not None:
+            value += required
+        if default is not None:
+            value += default
+    else:
+        value = ""
+        if env.has_key(name):
+            value = str(env[name])
+        if required is not None:
+            value += " " + required
+        if default is not None:
+            value += " " + default
+    env[name] = value
+    # print name, env[name]
 
 setEnvVariable(env, 'DESTDIR', split=False)
 setEnvVariable(env, 'CC')
@@ -672,24 +685,67 @@
         or (use_vc and not conf.CheckLibWithHeader('zdll', 'zlib.h', 'C')):
         print 'Did not find zdll.lib or zlib.h, exiting!'
         Exit(1)
+    if conf.CheckLib('iconv'):
+        env['ICONV_LIB'] = 'iconv'
+    elif conf.CheckLib('libiconv'):
+        env['ICONV_LIB'] = 'libiconv'
+    elif conf.CheckFunc('iconv_open'):
+        env['ICONV_LIB'] = None
+    else:
+        print 'Did not find iconv or libiconv, exiting!'
+        Exit(1)
+    env_cache['ICONV_LIB'] = env['ICONV_LIB']
+else:
+    env['ICONV_LIB'] = env_cache['ICONV_LIB']
 
 # qt libraries?
 if not fast_start:
@@ -887,6 +946,8 @@
 
 #ifdef __CYGWIN__
 #  define BOOST_POSIX 1
+#  define BOOST_POSIX_API 1
+#  define BOOST_POSIX_PATH 1
 #endif
 
 #define BOOST_ALL_NO_LIB 1
@@ -932,23 +993,16 @@
             print "Warning: Can not locate specified spell checker:", spell_opt
             Exit(1)
 
-    # check for iconv function/lib
-    if conf.CheckLib('iconv'):
-        env['ICONV_LIB'] = 'iconv'
-        env['HAVE_ICONV'] = True
-    elif conf.CheckLib('libiconv'):
-        env['ICONV_LIB'] = 'libiconv'
-        env['HAVE_ICONV'] = True
-    elif conf.CheckFunc('iconv_open'):
-        env['ICONV_LIB'] = None
-        env['HAVE_ICONV'] = True
-    else:
-        env['ICONV_LIB'] = None
-        env['HAVE_ICONV'] = False
-
     # check arg types of select function
     (select_arg1, select_arg234, select_arg5) = conf.CheckSelectArgType()
 
@@ -1039,15 +1094,17 @@
                 'MKDIR_TAKES_ONE_ARG',
                 'Define if mkdir takes only one argument.'
             ),
+            (conf.CheckIconvConst(),
+                'ICONV_CONST',
+                'Define as const if the declaration of iconv() needs const.',
+                '#define ICONV_CONST const',
+                '#define ICONV_CONST',
+            ),
             (conf.CheckLC_MESSAGES(),
                 'HAVE_LC_MESSAGES',
                 'Define if your <locale.h> file defines LC_MESSAGES.'
             ),
             (devel_version, 'DEVEL_VERSION', 'Whether or not a development version'),
-            (env['HAVE_ICONV'],
-                'HAVE_ICONV',
-                'Define to 1 if function iconv exists'
-            ),
             (env['nls'],
                 'ENABLE_NLS',
                 "Define to 1 if translation of program messages to the user's native anguage is requested.",
@@ -1132,8 +1201,7 @@
 
     # these keys are needed in env
     for key in ['USE_ASPELL', 'USE_PSPELL', 'USE_ISPELL', 'HAVE_FCNTL',\
-        'HAVE_ICONV', 'HAVE_LIBGDI32', 'HAVE_LIBAIKSAURUS',
-        'ICONV_LIB', 'AIKSAURUS_LIB']:
+        'HAVE_LIBGDI32', 'HAVE_LIBAIKSAURUS', 'AIKSAURUS_LIB']:
         # USE_ASPELL etc does not go through result
         if result.has_key(key):
             env[key] = result[key]
@@ -1236,17 +1304,18 @@
                     'ENABLE_NLS',
                     "Define to 1 if translation of program messages to the user's native anguage is requested.",
                 ),
-                (env['HAVE_ICONV'],
-                    'HAVE_ICONV',
-                    'Define to 1 if function iconv exists',
-                ),
+            ],
+            extra_items = [
+                ('#define HAVE_ICONV 1', 'Define if iconv or libiconv is found'),
+                ('#define SIZEOF_WCHAR_T %d' % sizeof_wchar_t,
+                    'Define to be the size of type wchar_t'),
             ],
             config_post = '#endif'
         )
 
         # these keys are needed in env
         for key in ['HAVE_ASPRINTF', 'HAVE_WPRINTF', 'HAVE_SNPRINTF', \
-            'HAVE_POSIX_PRINTF', 'HAVE_ICONV', 'HAVE_LIBC']:
+            'HAVE_POSIX_PRINTF', 'HAVE_LIBC']:
             # USE_ASPELL etc does not go through result
             if result.has_key(key):
                 env[key] = result[key]
@@ -1261,15 +1330,14 @@
     conf.CheckCHeader('io.h')
     # only a few variables need to be rescanned
     for key in ['USE_ASPELL', 'USE_PSPELL', 'USE_ISPELL', 'HAVE_FCNTL',\
-        'HAVE_ICONV', 'HAVE_LIBGDI32', 'HAVE_LIBAIKSAURUS',
-        'ICONV_LIB', 'AIKSAURUS_LIB']:
+        'HAVE_LIBGDI32', 'HAVE_LIBAIKSAURUS', 'AIKSAURUS_LIB']:
         env[key] = env_cache[key]
     #
     # nls related keys
     if env['nls'] and included_gettext:
         # only a few variables need to be rescanned
         for key in ['HAVE_ASPRINTF', 'HAVE_WPRINTF', 'HAVE_SNPRINTF', \
-            'HAVE_POSIX_PRINTF', 'HAVE_ICONV', 'HAVE_LIBC']:
+            'HAVE_POSIX_PRINTF', 'HAVE_LIBC']:
             env[key] = env_cache[key]
 
 # this looks misplaced, but intl/libintl.h is needed by src/message.C
@@ -1293,31 +1361,48 @@
 
 
+if env['ICONV_LIB'] is None:
+    system_libs = []
+else:
+    system_libs = [env['ICONV_LIB']]
 if platform_name in ['win32', 'cygwin']:
     # the final link step needs stdc++ to succeed under mingw
     # FIXME: shouldn't g++ automatically link to stdc++?
     if use_vc:
-        system_libs = ['ole32', 'shlwapi', 'shell32', 'advapi32', 'zdll']
+        system_libs += ['ole32', 'shlwapi', 'shell32', 'advapi32', 'zdll']
     else:
-        system_libs = ['shlwapi', 'stdc++', 'z']
+        system_libs += ['shlwapi', 'stdc++', 'z']
 elif platform_name == 'cygwin' and env['X11']:
-    system_libs = ['GL',  'Xmu', 'Xi', 'Xrender', 'Xrandr', 'Xcursor',
-        'Xft', 'freetype', 'fontconfig', 'Xext', 'X11', 'SM', 'ICE', 'resolv',
-        'pthread', 'z']
+    system_libs += ['GL',  'Xmu', 'Xi', 'Xrender', 'Xrandr',
+        'Xcursor', 'Xft', 'freetype', 'fontconfig', 'Xext', 'X11', 'SM', 'ICE', 
+        'resolv', 'pthread', 'z']
 else:
-    system_libs = ['z']
+    system_libs += ['z']
 
 libs = [
-    ('HAVE_ICONV', env['ICONV_LIB']),
     ('HAVE_LIBGDI32', 'gdi32'),
     ('HAVE_LIBAIKSAURUS', env['AIKSAURUS_LIB']),
     ('USE_ASPELL', aspell_lib),
@@ -1326,7 +1411,7 @@
 ]
 
 for lib in libs:
-    if env[lib[0]] and lib[1] is not None:
+    if env[lib[0]]:
         system_libs.append(lib[1])
 
 #
@@ -2109,6 +2281,12 @@
         env.Install(postinstall_script, tmp_script)
         Alias('install', postinstall_script)
 
+    # subst and install lyx2lyx_version.py which is not in scons_manifest.py
+    env.Depends(share_dest_dir + '/lyx2lyx/lyx2lyx_version.py', '$BUILDDIR/common/config.h')
+    env.substFile(share_dest_dir + '/lyx2lyx/lyx2lyx_version.py',
+        '$TOP_SRCDIR/lib/lyx2lyx/lyx2lyx_version.py.in')
+    Alias('install', share_dest_dir + '/lyx2lyx/lyx2lyx_version.py')
+
     # man
     env.InstallAs(os.path.join(man_dest_dir, 'lyx' + version_suffix + '.1'),
         env.subst('$TOP_SRCDIR/lyx.man'))

Reply via email to