Changeset 1354 for portaudio/branches

Show
Ignore:
Timestamp:
02/21/08 15:42:43 (10 months ago)
Author:
jpgrayson
Message:

Modify scons build system to now work on MacOSX (darwin). Thanks Jorge Maciá.

Location:
portaudio/branches/v19-devel
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/SConstruct

    r1278 r1354  
    3737# Determine parameters to build tools 
    3838if Platform in Posix: 
    39     baseLinkFlags = threadCFlags = "-pthread" 
     39    threadCFlags = '' 
     40    if Platform != 'darwin': 
     41        threadCFlags = "-pthread " 
     42    baseLinkFlags = threadCFlags 
    4043    baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags 
    4144    debugCxxFlags = debugCFlags = "-g" 
    4245    optCxxFlags = optCFlags  = "-O2" 
    43 env["CCFLAGS"] = baseCFlags.split() 
    44 env["CXXFLAGS"] = baseCxxFlags.split() 
    45 env["LINKFLAGS"] = baseLinkFlags.split() 
     46env.Append(CCFLAGS = baseCFlags) 
     47env.Append(CXXFLAGS = baseCxxFlags) 
     48env.Append(LINKFLAGS = baseLinkFlags) 
    4649if env["enableDebug"]: 
    4750    env.AppendUnique(CCFLAGS=debugCFlags.split()) 
     
    181184 
    182185# Define the builder for the config header 
    183 env.Append(BUILDERS={"portaudioConfig": env.Builder(action=Action(buildConfigH, 
    184         "generating '$TARGET'"), target_factory=env.fs.File,)}) 
     186env.Append(BUILDERS={"portaudioConfig": env.Builder( 
     187            action=Action(buildConfigH), target_factory=env.fs.File)}) 
    185188 
    186189confH = env.portaudioConfig(File("portaudio_config.h", "include"), 
  • portaudio/branches/v19-devel/bindings/cpp/SConscript

    r1047 r1354  
    1313    env["SHLIBSUFFIX"] = ".so.%d.%d.%d" % (Major, Minor, Micro) 
    1414    soFile = "libportaudiocpp.so" 
    15     env.AppendUnique(SHLINKFLAGS="-Wl,-soname=%s.%d" % (soFile, Major)) 
     15    if Platform != 'darwin': 
     16        env.AppendUnique(SHLINKFLAGS="-Wl,-soname=%s.%d" % (soFile, Major)) 
    1617 
    1718    # Create symlinks 
  • portaudio/branches/v19-devel/build/scons/SConscript_opts

    r1061 r1354  
    6464    apis.append(_PackageOption("OSS")) 
    6565    apis.append(_PackageOption("JACK")) 
    66     if Platform == "linux": 
    67         apis.append(_PackageOption("ALSA")) 
    68         apis.append(_PackageOption("ASIHPI")) 
     66    apis.append(_PackageOption("ALSA", Platform == "linux")) 
     67    apis.append(_PackageOption("ASIHPI", Platform == "linux")) 
     68    apis.append(_PackageOption("COREAUDIO", Platform == "darwin")) 
    6969elif Platform in Windows: 
    7070    if Platform == "cygwin": 
    7171        apis.append(_EnumOption("winAPI", "Windows API to use", ("wmme", "directx", "asio"), "wmme")) 
    72 elif Platform == "darwin": 
    73     apis.append(_EnumOption("macAPI", "Mac API to use", ("asio", "core", "sm"), "core")) 
     72 
    7473opts["Host APIs"] = apis 
    7574 
  • portaudio/branches/v19-devel/src/SConscript

    r1278 r1354  
    7777    if env["useASIHPI"]: 
    7878        optionalImpls["ASIHPI"] = ("hpi", "asihpi/hpi.h", "HPI_SubSysCreate") 
     79    if env["useCOREAUDIO"]: 
     80        optionalImpls["COREAUDIO"] = ("CoreAudio", "CoreAudio/CoreAudio.h", None) 
    7981else: 
    8082    raise ConfigurationError("unknown platform %s" % Platform) 
    8183 
    8284if Platform == "darwin": 
    83     env.Append(LINKFLAGS=["-framework CoreAudio", "-framework AudioToolBox"]) 
    84     env.Append(CPPDEFINES=["PA_USE_COREAUDIO"]) 
     85    env.Append(LINKFLAGS="-framework CoreFoundation -framework CoreServices -framework CoreAudio -framework AudioToolBox -framework AudioUnit") 
    8586elif Platform == "cygwin": 
    8687    env.Append(LIBS=["winmm"]) 
     
    161162        pa_process.c pa_skeleton.c pa_stream.c pa_trace.c pa_debugprint.c pa_ringbuffer.c".split()] 
    162163 
    163 # Host API implementations 
     164# Host APIs implementations 
    164165ImplSources = [] 
    165166if Platform in Posix: 
     
    174175if "ASIHPI" in optionalImpls: 
    175176    ImplSources.append(os.path.join("hostapi", "asihpi", "pa_linux_asihpi.c")) 
     177if "COREAUDIO" in optionalImpls: 
     178    ImplSources.append([os.path.join("hostapi", "coreaudio", f) for f in """ 
     179        pa_mac_core.c  pa_mac_core_blocking.c  pa_mac_core_utilities.c  
     180    """.split()]) 
    176181 
    177182 
     
    181186if Platform in Posix: 
    182187    # Add soname to library, this is so a reference is made to the versioned library in programs linking against libportaudio.so 
    183     sharedLibEnv.AppendUnique(SHLINKFLAGS="-Wl,-soname=libportaudio.so.%d" % int(ApiVer.split(".")[0])) 
     188    if Platform != 'darwin': 
     189        sharedLibEnv.AppendUnique(SHLINKFLAGS="-Wl,-soname=libportaudio.so.%d" % int(ApiVer.split(".")[0])) 
    184190sharedLib = sharedLibEnv.SharedLibrary(target="portaudio", source=sources) 
    185191