Changeset 151

Show
Ignore:
Timestamp:
09/06/10 14:51:15 (17 months ago)
Author:
Carsten
Message:

Linux/GCC: Various compile and link fixes.

Location:
cafu/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Ca3DE/AppCafu.cpp

    r149 r151  
    2929#include "ConsoleCommands/ConsoleComposite.hpp" 
    3030#include "ConsoleCommands/ConsoleFile.hpp" 
     31#include "ConsoleCommands/ConsoleStdout.hpp" 
    3132#include "ConsoleCommands/ConsoleStringBuffer.hpp" 
    3233#include "ConsoleCommands/ConVar.hpp" 
     
    172173{ 
    173174    s_CompositeConsole.Attach(m_ConBuffer); 
     175 
     176    #ifdef __WXGTK__ 
     177    { 
     178        static cf::ConsoleStdoutT s_ConStdout; 
     179        s_CompositeConsole.Attach(&s_ConStdout); 
     180    } 
     181    #endif 
    174182 
    175183    // All global convars and confuncs have registered themselves in linked lists. 
  • cafu/trunk/Libs/ConsoleCommands/Console.cpp

    r149 r151  
    2323 
    2424#include "Console.hpp" 
     25#include <stdio.h> 
    2526#include <stdarg.h> 
    2627 
  • cafu/trunk/SConscript

    r150 r151  
    101101    envCafu.Append(LIBS=Split("lightwave"))     # For the GuiSys::ModelWindowT class. 
    102102 
    103     WinResource = envCafu.RES("Ca3DE/Cafu.rc")  # + envCafu.RES("Ca3DE/Dialog1.rc") 
     103    WinResource = envCafu.RES("Ca3DE/Cafu.rc") 
    104104 
    105105elif sys.platform=="linux2": 
     
    107107    # -Wl,--export-dynamic   is so that the exe exports its symbols so that the MatSys, SoundSys and game .so libs can in turn resolve theirs. 
    108108    envCafu.Append(LINKFLAGS=['-Wl,-rpath,.', '-Wl,--export-dynamic']) 
    109     envCafu.Append(LIBS=Split("MatSys SoundSys SceneGraph cfsLib cfs_png cfs_jpeg bulletdynamics bulletcollision bulletmath openal alut mpg123 ogg vorbis vorbisfile minizip z lua lightwave ClipSys GuiSysNullEditor")) 
     109    envCafu.Append(LIBS=Split("MatSys SoundSys SceneGraph ClipSys cfs_png")) 
    110110 
    111111    # We need GLU for e.g. gluBuild2DMipmaps() in the renderers. 
     
    124124    # See my post "Having the GNU linker *not* remove unused symbols..." to the gnu.g++.help newsgroup on 2006-04-07, 
    125125    # and the replies by Maett and Paul Pluzhnikov. 
    126     # Implementing this by appending to LINKCOM and using --allow-multiple-definition is a SCons-specific hack though, 
     126    # Implementing this by appending to LINKCOM is a SCons-specific hack though, 
    127127    # because SCons currently does not support such kind of "wrapping". See my post to the scons-users mailing list on 2006-04-09 
    128128    # at http://scons.tigris.org/servlets/BrowseList?list=users&by=thread&from=455553. 
     
    131131    # Note that this (using --whole-archive) is actually the proper strategy under Linux (vs. Windows), because this is *the* way 
    132132    # in order to make sure that the -fPIC can be handled correctly - otherwise we had to link .so libs with non-fPIC object files... 
    133     envCafu.Append(LINKCOM=" -Wl,--allow-multiple-definition -Wl,--whole-archive -lcfsLib -lbulletdynamics -lbulletcollision -lbulletmath -lopenal -lalut -lmpg123 -logg -lvorbis -lvorbisfile -Wl,--no-whole-archive -llightwave -lz") 
     133    envCafu.Append(LINKCOM=" -Wl,--whole-archive -lcfsLib -lbulletdynamics -lbulletcollision -lbulletmath -lopenal -lalut -lmpg123 -logg -lvorbis -lvorbisfile -Wl,--no-whole-archive -lGuiSysNullEditor -llua -llightwave -lminizip -lz -lcfs_jpeg") 
    134134 
    135135    WinResource = [] 
     
    139139    Ca3DE/Server/Server.cpp Ca3DE/Server/ServerWorld.cpp Ca3DE/Server/ClientInfo.cpp""")) 
    140140 
    141 envCafu.Program('Ca3DE/Cafu', 
     141appCafu = envCafu.Program('Ca3DE/Cafu', 
    142142    EngineCommonAndServerObjs + CommonWorldObject + ["Common/WorldMan.cpp"] + WinResource + 
    143143    Glob("Ca3DE/Client/*.cpp")) 
     144 
     145if sys.platform=="linux2": 
     146    # This is a work-around for the fact that SCons doesn't automatically add dependencies for the libraries mentioned in LINKCOM. 
     147    for LibName in Split("cfsLib bulletdynamics bulletcollision bulletmath openal alut mpg123 ogg vorbis vorbisfile GuiSysNullEditor lua lightwave minizip z cfs_jpeg"): 
     148        LibFile = envCafu.FindFile("lib" + LibName + ".so", envCafu['LIBPATH']) 
     149        if LibFile==None: 
     150            LibFile = envCafu.FindFile("lib" + LibName + ".a", envCafu['LIBPATH']) 
     151        # print "appCafu depends on: ", LibFile 
     152        envCafu.Depends(appCafu, LibFile) 
    144153 
    145154 
  • cafu/trunk/SConstruct

    r150 r151  
    1 import os, shutil, sys 
     1import os, platform, shutil, sys 
    22 
    33 
     
    282282 
    283283elif sys.platform=="linux2": 
    284     envRelease.Install(".", ["#/ExtLibs/Cg/lib/libCg.so", "#/ExtLibs/Cg/lib/libCgGL.so"]); 
    285     envRelease.Install(".", ["#/ExtLibs/fmod/api/libfmod-3.75.so"]); 
     284    if platform.machine()!="x86_64": 
     285        envRelease.Install(".", ["#/ExtLibs/Cg/lib/libCg.so", "#/ExtLibs/Cg/lib/libCgGL.so"]); 
     286        envRelease.Install(".", ["#/ExtLibs/fmod/api/libfmod-3.75.so"]); 
     287    else: 
     288        envRelease.Install(".", ["#/ExtLibs/Cg/lib.x64/libCg.so", "#/ExtLibs/Cg/lib.x64/libCgGL.so"]); 
    286289 
    287290    if "r" in BVs: