Changeset 410

Show
Ignore:
Timestamp:
10/20/11 23:33:19 (7 months ago)
Author:
Carsten
Message:

Continuing the previous revision, properly link the freealut, openal-soft, ogg, vorbis, and mpg123 libraries to the OpenAL sound system library, rather than the Cafu executable.
This fixes a problem with program initialization under Ubuntu 11.10 (Oneiric Ocelot), which failed as the dynamic linker was not able to resolve all symbols in the OpenAL sound sys library before.

Location:
cafu/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/ExtLibs/freealut/SConscript

    r138 r410  
    2020    env_freealut.Append(CPPPATH=['include', '#/ExtLibs/openal-soft/include']) 
    2121 
    22 env_freealut.SharedLibrary( 
     22    # This library will be linked to a .so, thus we have to compile with -fpic. 
     23    env_freealut.Append(CCFLAGS=["-fpic"]) 
     24 
     25 
     26env_freealut.StaticLibrary( 
    2327    target="alut", 
    2428    source=Split("""src/alutBufferData.c src/alutCodec.c src/alutError.c src/alutInit.c src/alutInputStream.c 
  • cafu/trunk/ExtLibs/libogg/SConscript

    r33 r410  
    66env_ogg=env.Clone() 
    77 
     8if sys.platform=="linux2": 
     9    # This library will be linked to a .so, thus we have to compile with -fpic. 
     10    env_ogg.Append(CCFLAGS=["-fpic"]) 
     11 
     12 
    813env_ogg.StaticLibrary("ogg", Split("src/bitwise.c src/framing.c"), CPPPATH="include") 
  • cafu/trunk/ExtLibs/libvorbis/SConscript

    r33 r410  
    66env_vorbis=env.Clone() 
    77env_vorbis.Append(CPPPATH=["include", "lib", "#/ExtLibs/libogg/include"]) 
     8 
     9if sys.platform=="linux2": 
     10    # These libraries will be linked to a .so, thus we have to compile with -fpic. 
     11    env_vorbis.Append(CCFLAGS=["-fpic"]) 
    812 
    913 
  • cafu/trunk/ExtLibs/mpg123/src/libmpg123/SConscript

    r33 r410  
    88env_mpg123.Append(CPPDEFINES=["OPT_GENERIC"]) 
    99 
    10 if sys.platform=="win32": 
    11     env_mpg123.Append(CPPDEFINES=["BUILD_MPG123_DLL"]) 
     10if sys.platform=="linux2": 
     11    # This library will be linked to a .so, thus we have to compile with -fpic. 
     12    env_mpg123.Append(CCFLAGS=["-fpic"]) 
    1213 
    13 env_mpg123.SharedLibrary("mpg123", 
     14 
     15env_mpg123.StaticLibrary("mpg123", 
    1416    Split("""compat.c dct64.c equalizer.c format.c frame.c icy.c icy2utf8.c 
    1517             id3.c index.c layer1.c layer2.c layer3.c libmpg123.c ntom.c optimize.c 
  • cafu/trunk/ExtLibs/mpg123/src/libmpg123/debug.h

    r7 r410  
    2323*/ 
    2424 
    25 #ifdef DEBUG 
     25#ifdef PRINT_DEBUG 
    2626#include <stdio.h> 
    2727#define debug(s) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__) 
  • cafu/trunk/ExtLibs/openal-soft/SConscript

    r33 r410  
    1212envOpenALSoft.Append(CCFLAGS=['-fno-strict-aliasing'])    # '-fvisibility=hidden' 
    1313 
     14if sys.platform=="linux2": 
     15    # This library will be linked to a .so, thus we have to compile with -fpic. 
     16    envOpenALSoft.Append(CCFLAGS=["-fpic"]) 
    1417 
    15 envOpenALSoft.SharedLibrary("openal", Glob("OpenAL32/*.c") + AlcObjs, 
     18 
     19envOpenALSoft.StaticLibrary("openal", Glob("OpenAL32/*.c") + AlcObjs, 
    1620    CPPPATH=[".", "include", "OpenAL32/Include"]); 
  • cafu/trunk/LICENSE.txt

    r189 r410  
    2828  Cafu is a collection of software components, consisting of executables, 
    2929  tools, libraries, source-code and scripts. 
    30   Cafu is copyright (c) 2002-2010 Carsten Fuchs Software. 
     30  Cafu is copyright (c) 2002-2012 Carsten Fuchs Software. 
    3131 
    3232  Cafu is free software: you can redistribute it and/or modify it under 
     
    149149  are compatible with both cases. 
    150150 
    151   When your product is under the GPL (which is must when you obtained Cafu 
     151  When your product is under the GPL (which it must when you obtained Cafu 
    152152  under the GPL), your honoring of the terms of the GPL will cover the 
    153153  requirements of the external libraries automatically, as the 
  • cafu/trunk/Libs/Models/Loader.cpp

    r408 r410  
    149149    Mat.PolygonMode    =MaterialT::Wireframe; 
    150150 // Mat.DepthOffset    =-1.0f; 
    151     Mat.DiffMapComp    =MapCompositionT("file-not-found", "."); 
     151    Mat.DiffMapComp    =MapCompositionT("file-not-found", "./"); 
    152152 // Mat.RedGen         =ExpressionT(1.0f); 
    153153 // Mat.UseMeshColors  =true;       // Mesh colors aren't used for rendering models, but unfortunately required for rendering wire-frame without diffuse-map texture image. 
  • cafu/trunk/Libs/SConscript

    r409 r410  
    239239elif sys.platform=="linux2": 
    240240    envSoundSys.Append(CPPPATH=['#/ExtLibs/openal-soft/include']) 
     241    envSoundSys.Append(LIBS=Split("openal alut mpg123 vorbisfile vorbis ogg")) 
    241242    envSoundSys.Append(LINKFLAGS=["Libs/SoundSystem/Common/linker-script"]) 
    242243 
  • cafu/trunk/SConscript

    r409 r410  
    127127    # Note that this (using --whole-archive) is actually the proper strategy under Linux (vs. Windows), because this is *the* way 
    128128    # in order to make sure that the -fPIC can be handled correctly - otherwise we had to link .so libs with non-fPIC object files... 
    129     envCafu.Append(LINKCOM=" -Wl,--whole-archive -lcfsLib -lbulletdynamics -lbulletcollision -lbulletmath -lopenal -lalut -lmpg123 -logg -lvorbis -lvorbisfile -Wl,--no-whole-archive -llua -llightwave -lminizip -lcfs_jpeg -lpng -lz") 
     129    envCafu.Append(LINKCOM=" -Wl,--whole-archive -lcfsLib -lbulletdynamics -lbulletcollision -lbulletmath -Wl,--no-whole-archive -llua -llightwave -lminizip -lcfs_jpeg -lpng -lz") 
    130130 
    131131    WinResource = [] 
     
    141141if sys.platform=="linux2": 
    142142    # This is a work-around for the fact that SCons doesn't automatically add dependencies for the libraries mentioned in LINKCOM. 
    143     for LibName in Split("""cfsLib bulletdynamics bulletcollision bulletmath openal alut mpg123 ogg vorbis vorbisfile 
     143    for LibName in Split("""cfsLib bulletdynamics bulletcollision bulletmath 
    144144                            lua lightwave minizip cfs_jpeg"""):   # png and z are not in the list, because we use the system libraries. 
    145145        LibFile = envCafu.FindFile("lib" + LibName + ".so", envCafu['LIBPATH']) 
  • cafu/trunk/SConstruct

    r339 r410  
    321321        envRelease.Install(".", ["#/ExtLibs/openal-win/libs/Win64/OpenAL32.dll", "#/ExtLibs/openal-win/libs/Win64/wrap_oal.dll"]); 
    322322 
    323     if "r" in BVs: 
    324         envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_rel+"/alut.dll"]); 
    325         envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_rel+"/mpg123.dll"]); 
    326  
    327     else: 
    328         envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_dbg+"/alut.dll"]); 
    329         envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_dbg+"/mpg123.dll"]); 
    330  
    331323elif sys.platform=="linux2": 
    332324    if platform.machine()!="x86_64": 
     
    336328        envRelease.Install(".", ["#/ExtLibs/Cg/lib.x64/libCg.so", "#/ExtLibs/Cg/lib.x64/libCgGL.so"]); 
    337329 
    338     if "r" in BVs: 
    339         envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_rel+"/libalut.so"]); 
    340         envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_rel+"/libmpg123.so"]); 
    341         envRelease.Install(".", ["#/ExtLibs/openal-soft/"+my_build_dir_rel+"/libopenal.so"]); 
    342  
    343     else: 
    344         envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_dbg+"/libalut.so"]); 
    345         envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_dbg+"/libmpg123.so"]); 
    346         envRelease.Install(".", ["#/ExtLibs/openal-soft/"+my_build_dir_dbg+"/libopenal.so"]); 
    347  
    348330 
    349331############################################