Changeset 18759

Show
Ignore:
Timestamp:
04/25/06 10:33:00 (3 years ago)
Author:
patrick
Message:

SF Bug#: 1475715

Handle the use of OpenAL 1.1 and Free ALUT 1.0.1 on Windows.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/buildwin32.py

    r18651 r18759  
    221221                               'OpenAL SDK installation directory', '', 
    222222                               required = False)) 
     223   optional.append(BuildOption('ALUT_ROOT', 'ALUT SDK installation directory', 
     224                               '', required = False)) 
    223225   optional.append(BuildOption('TRACKD_API_ROOT', 
    224226                               'TrackdAPI installation directory', '', 
     
    329331            os.environ['OMNITHREAD_VERSION'] = match.group(1) 
    330332            break 
     333 
     334   # Determine if al.h is in the base include directory or in include\AL. 
     335   if os.environ['OPENAL_ROOT'] != '': 
     336      # TODO: Extend for Win64. 
     337      lib_dirs = [os.path.join(os.environ['OPENAL_ROOT'], 'libs'), 
     338                  os.path.join(os.environ['OPENAL_ROOT'], 'libs', 'Win32')] 
     339 
     340      for l in lib_dirs: 
     341         openal_lib = os.path.join(l, 'OpenAL32.lib') 
     342         if os.path.exists(openal_lib): 
     343            os.environ['OPENAL_LIB_DIR'] = l 
     344            break 
     345 
     346      header_file = os.path.join(os.environ['OPENAL_ROOT'], 'include', 'AL', 
     347                                 'al.h') 
     348      # If the file is include\AL\al.h, then set the environment variable 
     349      # %HAVE_AL_AL_H% to the preprocessor symbol 'HAVE_AL_AL_H'. 
     350      # See modules/sonix/plugins/OpenAL/OpenALSoundImplementation.cpp. 
     351      if os.path.exists(header_file): 
     352         os.environ['HAVE_AL_AL_H'] = 'HAVE_AL_AL_H' 
     353 
     354   # Determine if alut.h is in the base include directory or in include\AL. 
     355   openal_envs = ['ALUT_ROOT', 'OPENAL_ROOT'] 
     356   for env in openal_envs: 
     357      if os.environ[env] != '': 
     358         header_file = os.path.join(os.environ[env], 'include', 'AL', 'alut.h') 
     359         # If the file is include\AL\alut.h, then set the environment variable 
     360         # %HAVE_AL_ALUT_H% to the preprocessor symbol 'HAVE_AL_ALUT_H'. 
     361         # See modules/sonix/plugins/OpenAL/OpenALSoundImplementation.cpp. 
     362         if os.path.exists(header_file): 
     363            os.environ['HAVE_AL_ALUT_H'] = 'HAVE_AL_ALUT_H' 
     364 
     365   # If the ALUT installation directory is not set, then assume that it is the 
     366   # same as the OpenAL installation directory. 
     367   if os.environ['ALUT_ROOT'] == '' and os.environ['OPENAL_ROOT'] != '': 
     368      os.environ['ALUT_ROOT'] = os.environ['OPENAL_ROOT'] 
    331369 
    332370   if os.environ['TRACKD_API_ROOT'] != '' and os.path.exists(os.environ['TRACKD_API_ROOT']): 
     
    14361474 
    14371475def installOpenAL(prefix): 
    1438    printStatus("Installing OpenAL DLL") 
    1439    srcdir  = os.environ['OPENAL_ROOT'] 
     1476   srcdir = os.environ['OPENAL_ROOT'] 
     1477 
    14401478   if srcdir != "": 
    1441        destdir = os.path.join(prefix, 'bin') 
    1442        shutil.copy2(os.path.join(srcdir, 'dll', 'OpenAL32.dll'), destdir) 
     1479      printStatus("Installing OpenAL DLL") 
     1480      destdir = os.path.join(prefix, 'bin') 
     1481 
     1482      # OpenAL 1.0 and 1.1 put the redistributable DLL in different places. 
     1483      dll_dirs = [os.path.join(srcdir, 'dll'), 
     1484                  os.path.join(r'C:\windows', 'system32')] 
     1485 
     1486      for d in dll_dirs: 
     1487         dll = os.path.join(d, 'OpenAL32.dll') 
     1488         if os.path.exists(dll): 
     1489            shutil.copy2(dll, destdir) 
     1490 
     1491   srcdir = os.environ['ALUT_ROOT'] 
     1492   if srcdir != "": 
     1493      printStatus("Installing ALUT DLL") 
     1494      destdir = os.path.join(prefix, 'bin') 
     1495 
     1496      alut_dll = os.path.join(srcdir, 'lib', 'alut.dll') 
     1497      if os.path.exists(alut_dll): 
     1498         shutil.copy2(dll, destdir) 
    14431499 
    14441500def installOmniORB(prefix): 
  • juggler/trunk/vc7/README.html

    r18361 r18759  
    252252    The root directory of an 
    253253    <a href="http://www.openal.org/downloads.html">OpenAL SDK</a> 1.0 or newer 
    254     installation.  The SDK can be 
    255     <a href="http://developer.creative.com/landing.asp?cat=1&sbcat=31&top=38">downloaded 
    256     from Creative Labs</a>. 
     254    installation. 
     255  </dd> 
     256  <dt><tt>ALUT_ROOT</tt></dt> 
     257  <dd> 
     258    The root directory of an 
     259    <a href="http://www.openal.org/downloads.html">ALUT SDK</a> 1.0 or newer 
     260    installation. With OpenAL 1.1 and newer, ALUT is distributed as a 
     261    separate package with its own DLL. 
     262 
     263    <blockquote> 
     264      <b>NOTE:</b> Free ALUT 1.0 includes the OpenAL headers relative to 
     265      the <tt>AL</tt> directory, but the OpenAL 1.1 SDK on Windows does not 
     266      put its header files in the <tt>AL</tt> subdirectory of 
     267      <tt>%OPENAL_ROOT%\include</tt>. It appears that the usal workaround 
     268      for this is to move or copy the OpenAL 1.1 SDK header files into the 
     269      directory <tt>%OPENAL_ROOT%\include\AL</tt> or to change the Free ALUT 
     270      headers. The Juggler build will handle either of these workarounds. 
     271    </blockquote> 
    257272  </dd> 
    258273  <dt><tt>TRACKD_API_ROOT</tt></dt> 
  • juggler/trunk/vc7/Sonix/OpenAL/OpenAL.vcproj

    r18423 r18759  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="&quot;$(OPENAL_ROOT)\include&quot;;&quot;$(NSPR_ROOT)\include&quot;;&quot;$(BOOST_INCLUDES)&quot;;&quot;$(CPPDOM_ROOT)\include&quot;;&quot;$(GMTL_ROOT)\include&quot;;..;..\..\..\modules\vapor;..\..\VPR;..\..\..\modules\sonix;..\..\..\modules\sonix\plugins" 
    23                                 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USRDLL;_SNX_PLUGIN_BUILD_;NO_SELF_REGISTER
     22                                AdditionalIncludeDirectories="&quot;$(OPENAL_ROOT)\include&quot;;&quot;$(ALUT_ROOT)\include&quot;;&quot;$(NSPR_ROOT)\include&quot;;&quot;$(BOOST_INCLUDES)&quot;;&quot;$(CPPDOM_ROOT)\include&quot;;&quot;$(GMTL_ROOT)\include&quot;;..;..\..\..\modules\vapor;..\..\VPR;..\..\..\modules\sonix;..\..\..\modules\sonix\plugins" 
     23                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USRDLL;_SNX_PLUGIN_BUILD_;NO_SELF_REGISTER;$(HAVE_AL_AL_H);$(HAVE_AL_ALUT_H)
    2424                                MinimalRebuild="FALSE" 
    2525                                BasicRuntimeChecks="3" 
     
    4040                                Version="1.1.1" 
    4141                                LinkIncremental="1" 
    42                                 AdditionalLibraryDirectories="&quot;$(OPENAL_ROOT)\libs&quot;;&quot;$(NSPR_ROOT)\lib&quot;;&quot;$(BOOST_ROOT)\lib&quot;;&quot;..\..\Sonix\$(OutDir)&quot;;&quot;..\..\VPR\$(OutDir)&quot;" 
     42                                AdditionalLibraryDirectories="&quot;$(OPENAL_LIB_DIR)&quot;;&quot;$(ALUT_ROOT)\lib&quot;;&quot;$(NSPR_ROOT)\lib&quot;;&quot;$(BOOST_ROOT)\lib&quot;;&quot;..\..\Sonix\$(OutDir)&quot;;&quot;..\..\VPR\$(OutDir)&quot;" 
    4343                                GenerateDebugInformation="TRUE" 
    4444                                ProgramDatabaseFile="$(OutDir)/OpenALPlugin.pdb" 
     
    7272                                InlineFunctionExpansion="1" 
    7373                                OmitFramePointers="TRUE" 
    74                                 AdditionalIncludeDirectories="&quot;$(OPENAL_ROOT)\include&quot;;&quot;$(NSPR_ROOT)\include&quot;;&quot;$(BOOST_INCLUDES)&quot;;&quot;$(CPPDOM_ROOT)\include&quot;;&quot;$(GMTL_ROOT)\include&quot;;..;..\..\..\modules\vapor;..\..\VPR;..\..\..\modules\sonix;..\..\..\modules\sonix\plugins" 
    75                                 PreprocessorDefinitions="WIN32;_OPT;NDEBUG;_CONSOLE;_USRDLL;_SNX_PLUGIN_BUILD_;NO_SELF_REGISTER
     74                                AdditionalIncludeDirectories="&quot;$(OPENAL_ROOT)\include&quot;;&quot;$(ALUT_ROOT)\include&quot;;&quot;$(NSPR_ROOT)\include&quot;;&quot;$(BOOST_INCLUDES)&quot;;&quot;$(CPPDOM_ROOT)\include&quot;;&quot;$(GMTL_ROOT)\include&quot;;..;..\..\..\modules\vapor;..\..\VPR;..\..\..\modules\sonix;..\..\..\modules\sonix\plugins" 
     75                                PreprocessorDefinitions="WIN32;_OPT;NDEBUG;_CONSOLE;_USRDLL;_SNX_PLUGIN_BUILD_;NO_SELF_REGISTER;$(HAVE_AL_AL_H);$(HAVE_AL_ALUT_H)
    7676                                StringPooling="TRUE" 
    7777                                MinimalRebuild="FALSE" 
     
    9393                                Version="1.1.1" 
    9494                                LinkIncremental="1" 
    95                                 AdditionalLibraryDirectories="&quot;$(OPENAL_ROOT)\libs&quot;;&quot;$(NSPR_ROOT)\lib&quot;;&quot;$(BOOST_ROOT)\lib&quot;;&quot;..\..\Sonix\$(OutDir)&quot;;&quot;..\..\VPR\$(OutDir)&quot;" 
     95                                AdditionalLibraryDirectories="&quot;$(OPENAL_LIB_DIR)&quot;;&quot;$(ALUT_ROOT)\lib&quot;;&quot;$(NSPR_ROOT)\lib&quot;;&quot;$(BOOST_ROOT)\lib&quot;;&quot;..\..\Sonix\$(OutDir)&quot;;&quot;..\..\VPR\$(OutDir)&quot;" 
    9696                                GenerateDebugInformation="TRUE" 
    9797                                ProgramDatabaseFile="$(OutDir)/OpenALPlugin.pdb"