On Thu, May 11, 2006 at 06:30:49PM -0500, Bo Peng wrote: > >Please, find attached a small bug fix for lyxclient. > > So socket_libs should be separated from system_libs anyway? You know, > for lyxclient, system_libs has more stuff than socket_libs... > > Please, if you think socket_libs should be separated, provide an > updated patch that > > 1. lyxclient only uses sockets > 2. lyx uses sockets and systems
Done. > >On cygwin: > > > >scons: done reading SConscript files. > >scons: Building targets ... > >scons: *** [Errno 2] No such file or directory: > >'/usr/local/src/lyx/lyx-1.5.0svn/release/qt3/lyx' > >scons: building terminated because of errors. > > > >I think this is due to the fact that on Windows executables have > >a .exe extension. > > Please try to use env.install instead of env.fileCopy for wherever > this happens. env.install(desti, fileobject) hides .exe etc. > fileobject should be the object that returned by StaticLibrary, > Program etc. I introduced an exe_suffix. > >On solaris scons uses gcc for linking, so there are tons of undefined > >references: > > > >gcc -o release/qt3/lyx -Lrelease/libs -L/opt/qt/lib -L/opt/qt/lib > >-L/opt/lib -L/usr/X11/lib -L. -llyxbase_pre -lmathed -linsets -lfrontends > >-lqt3 -lcontrollers -lgraphics -lsupports -llyxbase_post -lboost_signals > >-lboost_regex -lboost_filesystem -lboost_iostreams -lAiksaurus -laspell > >-lqt-mt -lsocket -lnsl -lz > /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../../libstdc++.so.6) > >[...] > >ld: fatal: Symbol referencing errors. No output written to release/qt3/lyx > >collect2: ld returned 1 exit status > >scons: *** [release/qt3/lyx] Error 1 > >scons: building terminated because of errors. > >This is probably due to the fact that no sources are now present on the > >command line but only libraries. > > If Solaris will be happier with a file, give it one. I think > re-compile main.C (link main.o) should not cost anything. I don't think this can be done without multiple defined references. > There should not be many such big changes any more. I would appreciate > it if you can fix these problems. Please, attached find a patch comprehending the previous two patches, too. -- Enrico
Index: development/scons/SConscript =================================================================== --- development/scons/SConscript (revision 13835) +++ development/scons/SConscript (working copy) @@ -14,6 +14,7 @@ Import('env') targets = env['BUILD_TARGETS'] build_lyx = (targets == [] or 'lyx' in targets or 'install' in targets) +exe = env['exe_suffix'] # # boost libraries @@ -901,8 +902,8 @@ if 'client' in targets or 'install' in t print "Processing files in src/client" client = env.Program( - target = '$BUILDDIR/common/client/lyxclient', - LIBS = env['BOOST_LIBRARIES'] + env['socket_libs'] + ['supports'], + target = '$BUILDDIR/common/client/lyxclient$exe', + LIBS = env['BOOST_LIBRARIES'] + env['SOCKET_LIBS'] + ['supports'], source = ["$BUILDDIR/common/client/%s" % x for x in Split(''' boost.C client.C @@ -911,7 +912,7 @@ if 'client' in targets or 'install' in t messages.C ''')] ) - Alias('client', env.fileCopy('$BUILDDIR/lyxclient', '$BUILDDIR/common/client/lyxclient')) + Alias('client', env.fileCopy('$BUILDDIR/lyxclient$exe', '$BUILDDIR/common/client/lyxclient$exe')) Alias('client', client) @@ -938,7 +939,7 @@ if 'tex2lyx' in targets or 'install' in tex2lyx_env.fileCopy('$BUILDDIR/common/tex2lyx/lyxlex_pimpl.C', '$TOP_SRC_DIR/src/lyxlex_pimpl.C') tex2lyx = tex2lyx_env.Program( - target = '$BUILDDIR/common/tex2lyx/tex2lyx', + target = '$BUILDDIR/common/tex2lyx/tex2lyx$exe', LIBS = ['supports'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'], source = ["$BUILDDIR/common/tex2lyx/%s" % x for x in Split(''' FloatList.C @@ -961,7 +962,7 @@ if 'tex2lyx' in targets or 'install' in text.C ''')] ) - Alias('tex2lyx', env.fileCopy('$BUILDDIR/tex2lyx', '$BUILDDIR/common/tex2lyx/tex2lyx')) + Alias('tex2lyx', env.fileCopy('$BUILDDIR/tex2lyx$exe', '$BUILDDIR/common/tex2lyx/tex2lyx$exe')) Alias('tex2lyx', tex2lyx) # # src/ @@ -1089,11 +1090,11 @@ if build_lyx or 'lyxbase' in targets: ''') if env.has_key('USE_ASPELL') and env['USE_ASPELL']: - lyx_source_pre.append('aspell.C') + lyx_source_post.append('aspell.C') elif env.has_key('USE_PSPELL') and env['USE_PSPELL']: - lyx_source_pre.append('pspell.C') + lyx_source_post.append('pspell.C') elif env.has_key('USE_ISPELL') and env['USE_ISPELL']: - lyx_source_pre.append('ispell.C') + lyx_source_post.append('ispell.C') lyxbase_pre = env.StaticLibrary( target = '$LOCALLIBPATH/lyxbase_pre', @@ -1112,7 +1113,7 @@ if build_lyx or 'lyx' in targets: # Build lyx with given frontend # lyx = env.Program( - target = '$BUILDDIR/$frontend/lyx', + target = '$BUILDDIR/$frontend/lyx$exe', source = [], LIBS = [ 'lyxbase_pre', @@ -1127,9 +1128,10 @@ if build_lyx or 'lyx' in targets: ] + env['BOOST_LIBRARIES'] + env['EXTRA_LIBS'] + + env['SOCKET_LIBS'] + env['SYSTEM_LIBS'] ) - Alias('lyx', env.fileCopy('$BUILDDIR/lyx-$frontend', '$BUILDDIR/$frontend/lyx')) + Alias('lyx', env.fileCopy('$BUILDDIR/lyx-$frontend$exe', '$BUILDDIR/$frontend/lyx$exe')) Alias('lyx', lyx) Index: development/scons/SConstruct =================================================================== --- development/scons/SConstruct (revision 13835) +++ development/scons/SConstruct (working copy) @@ -140,6 +140,7 @@ if os.name == 'nt': # If not specified, boost tries to figure out by itself, but it may fail. boost_posix = False packaging_method = 'windows' + exe_suffix = '.exe' elif os.name == 'posix' and sys.platform != 'cygwin': platform_name = sys.platform default_frontend = 'qt3' @@ -150,6 +151,7 @@ elif os.name == 'posix' and sys.platform default_with_x = True boost_posix = True packaging_method = 'posix' + exe_suffix = '' elif os.name == 'posix' and sys.platform == 'cygwin': platform_name = 'cygwin' default_frontend = 'qt3' @@ -160,6 +162,7 @@ elif os.name == 'posix' and sys.platform default_with_x = True boost_posix = True packaging_method = 'posix' + exe_suffix = '.exe' elif os.name == 'darwin': platform_name = 'mac' default_frontend = 'qt3' @@ -170,6 +173,7 @@ elif os.name == 'darwin': default_with_x = False boost_posix = True packaging_method = 'msc' + exe_suffix = '' else: # unsupported system platform_name = 'others' default_frontend = 'qt3' @@ -180,6 +184,7 @@ else: # unsupported system default_with_x = True boost_posix = False packaging_method = 'posix' + exe_suffix = '' #--------------------------------------------------------- # Handling options @@ -329,13 +334,14 @@ getEnvVariable(env, 'LDFLAGS') # under windows, scons is confused by .C/.c and uses gcc instead of # g++. I am forcing the use of g++ here. This is expected to change # after lyx renames all .C files to .cpp -if platform_name == 'cygwin': +if platform_name == 'cygwin': env['CC'] = 'g++' env['LINK'] = 'g++' # # frontend, mode, BUILDDIR and LOCALLIBPATH=BUILDDIR/libs # +env['exe_suffix'] = exe_suffix env['frontend'] = frontend env['mode'] = env.get('mode', default_build_mode) # lyx will be built to $build/build_dir so it is possible @@ -469,14 +475,14 @@ elif env['frontend'] == 'qt4': Exit(1) # check socket libs -env['SYSTEM_LIBS'] = [] +env['SOCKET_LIBS'] = [] if conf.CheckLib('socket'): - env['SYSTEM_LIBS'].append('socket') + env['SOCKET_LIBS'].append('socket') # EF: This is the network services library and provides a # transport-level interface to networking services. if conf.CheckLib('nsl'): - env['SYSTEM_LIBS'].append('nsl') + env['SOCKET_LIBS'].append('nsl') # check boost libraries boost_opt = ARGUMENTS.get('boost', default_boost_opt) @@ -771,7 +777,8 @@ except: print "What I get is " print " QTDIR: ", env['QTDIR'] -if platform_name in ['win32', 'cygwin']: +env['SYSTEM_LIBS'] = [] +if platform_name in ['win32', 'cygwin']: env['SYSTEM_LIBS'] += ['shlwapi', 'z'] else: env['SYSTEM_LIBS'] += ['z']