]> Repos - portaudio/commitdiff
Get rid of the Scons-based build system. edechamps-remove-scons
authorEtienne Dechamps <etienne@edechamps.fr>
Sun, 25 Nov 2018 13:52:29 +0000 (13:52 +0000)
committerEtienne Dechamps <etienne@edechamps.fr>
Sat, 15 Dec 2018 15:14:51 +0000 (15:14 +0000)
There is no reason not to use CMake at this point, and keeping this
around is a maintenance burden. In fact, it was already broken at
the time of this commit. A quick Google search doesn't provide any
evidence that anyone actually cares about this.

SConstruct [deleted file]
bindings/cpp/SConscript [deleted file]
build/scons/SConscript_common [deleted file]
build/scons/SConscript_opts [deleted file]
src/SConscript [deleted file]

diff --git a/SConstruct b/SConstruct
deleted file mode 100644 (file)
index 37e67ba..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-import sys, os.path
-
-def rsplit(toSplit, sub, max=-1):
-    """ str.rsplit seems to have been introduced in 2.4 :( """
-    l = []
-    i = 0
-    while i != max:
-        try: idx = toSplit.rindex(sub)
-        except ValueError: break
-
-        toSplit, splitOff = toSplit[:idx], toSplit[idx + len(sub):]
-        l.insert(0, splitOff)
-        i += 1
-
-    l.insert(0, toSplit)
-    return l
-
-sconsDir = os.path.join("build", "scons")
-SConscript(os.path.join(sconsDir, "SConscript_common"))
-Import("Platform", "Posix", "ApiVer")
-
-# SConscript_opts exports PortAudio options
-optsDict = SConscript(os.path.join(sconsDir, "SConscript_opts"))
-optionsCache = os.path.join(sconsDir, "options.cache")   # Save options between runs in this cache
-options = Options(optionsCache, args=ARGUMENTS)
-for k in ("Installation Dirs", "Build Targets", "Host APIs", "Build Parameters", "Bindings"):
-    options.AddOptions(*optsDict[k])
-# Propagate options into environment
-env = Environment(options=options)
-# Save options for next run
-options.Save(optionsCache, env)
-# Generate help text for options
-env.Help(options.GenerateHelpText(env))
-
-buildDir = os.path.join("#", sconsDir, env["PLATFORM"])
-
-# Determine parameters to build tools
-if Platform in Posix:
-    threadCFlags = ''
-    if Platform != 'darwin':
-        threadCFlags = "-pthread "
-    baseLinkFlags = threadCFlags
-    baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags
-    debugCxxFlags = debugCFlags = "-g"
-    optCxxFlags = optCFlags  = "-O2"
-env.Append(CCFLAGS = baseCFlags)
-env.Append(CXXFLAGS = baseCxxFlags)
-env.Append(LINKFLAGS = baseLinkFlags)
-if env["enableDebug"]:
-    env.AppendUnique(CCFLAGS=debugCFlags.split())
-    env.AppendUnique(CXXFLAGS=debugCxxFlags.split())
-if env["enableOptimize"]:
-    env.AppendUnique(CCFLAGS=optCFlags.split())
-    env.AppendUnique(CXXFLAGS=optCxxFlags.split())
-if not env["enableAsserts"]:
-    env.AppendUnique(CPPDEFINES=["-DNDEBUG"])
-if env["customCFlags"]:
-    env.Append(CCFLAGS=Split(env["customCFlags"]))
-if env["customCxxFlags"]:
-    env.Append(CXXFLAGS=Split(env["customCxxFlags"]))
-if env["customLinkFlags"]:
-    env.Append(LINKFLAGS=Split(env["customLinkFlags"]))
-
-env.Append(CPPPATH=[os.path.join("#", "include"), "common"])
-
-# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files
-env.SConsignFile(os.path.join(sconsDir, ".sconsign"))
-
-env.SConscriptChdir(False)
-sources, sharedLib, staticLib, tests, portEnv, hostApis = env.SConscript(os.path.join("src", "SConscript"),
-        build_dir=buildDir, duplicate=False, exports=["env"])
-
-if Platform in Posix:
-    prefix = env["prefix"]
-    includeDir = os.path.join(prefix, "include")
-    libDir = os.path.join(prefix, "lib")
-    env.Alias("install", includeDir)
-    env.Alias("install", libDir)
-
-    # pkg-config
-
-    def installPkgconfig(env, target, source):
-        tgt = str(target[0])
-        src = str(source[0])
-        f = open(src)
-        try: txt = f.read()
-        finally: f.close()
-        txt = txt.replace("@prefix@", prefix)
-        txt = txt.replace("@exec_prefix@", prefix)
-        txt = txt.replace("@libdir@", libDir)
-        txt = txt.replace("@includedir@", includeDir)
-        txt = txt.replace("@LIBS@", " ".join(["-l%s" % l for l in portEnv["LIBS"]]))
-        txt = txt.replace("@THREAD_CFLAGS@", threadCFlags)
-
-        f = open(tgt, "w")
-        try: f.write(txt)
-        finally: f.close()
-
-    pkgconfigTgt = "portaudio-%d.0.pc" % int(ApiVer.split(".", 1)[0])
-    env.Command(os.path.join(libDir, "pkgconfig", pkgconfigTgt),
-        os.path.join("#", pkgconfigTgt + ".in"), installPkgconfig)
-
-# Default to None, since if the user disables all targets and no Default is set, all targets
-# are built by default
-env.Default(None)
-if env["enableTests"]:
-    env.Default(tests)
-if env["enableShared"]:
-    env.Default(sharedLib)
-
-    if Platform in Posix:
-        def symlink(env, target, source):
-            trgt = str(target[0])
-            src = str(source[0])
-
-            if os.path.islink(trgt) or os.path.exists(trgt):
-                os.remove(trgt)
-            os.symlink(os.path.basename(src), trgt)
-
-        major, minor, micro = [int(c) for c in ApiVer.split(".")]
-        
-        soFile = "%s.%s" % (os.path.basename(str(sharedLib[0])), ApiVer)
-        env.InstallAs(target=os.path.join(libDir, soFile), source=sharedLib)
-        # Install symlinks
-        symTrgt = os.path.join(libDir, soFile)
-        env.Command(os.path.join(libDir, "libportaudio.so.%d.%d" % (major, minor)),
-            symTrgt, symlink)
-        symTrgt = rsplit(symTrgt, ".", 1)[0]
-        env.Command(os.path.join(libDir, "libportaudio.so.%d" % major), symTrgt, symlink)
-        symTrgt = rsplit(symTrgt, ".", 1)[0]
-        env.Command(os.path.join(libDir, "libportaudio.so"), symTrgt, symlink)
-
-if env["enableStatic"]:
-    env.Default(staticLib)
-    env.Install(libDir, staticLib)
-
-env.Install(includeDir, os.path.join("include", "portaudio.h"))
-
-
-if env["enableCxx"]:
-    env.SConscriptChdir(True)
-    cxxEnv = env.Copy()
-    sharedLibs, staticLibs, headers = env.SConscript(os.path.join("bindings", "cpp", "SConscript"),
-            exports={"env": cxxEnv, "buildDir": buildDir}, build_dir=os.path.join(buildDir, "portaudiocpp"), duplicate=False)
-    if env["enableStatic"]:
-        env.Default(staticLibs)
-        env.Install(libDir, staticLibs)
-    if env["enableShared"]:
-        env.Default(sharedLibs)
-        env.Install(libDir, sharedLibs)
-    env.Install(os.path.join(includeDir, "portaudiocpp"), headers)
-
-# Generate portaudio_config.h header with compile-time definitions of which PA
-# back-ends are available, and which includes back-end extension headers
-
-# Host-specific headers
-hostApiHeaders = {"ALSA": "pa_linux_alsa.h",
-                    "ASIO": "pa_asio.h",
-                    "COREAUDIO": "pa_mac_core.h",
-                    "JACK": "pa_jack.h",
-                    "WMME": "pa_winwmme.h",
-                    }
-
-def buildConfigH(target, source, env):
-    """builder for portaudio_config.h"""
-    global hostApiHeaders, hostApis
-    out = ""
-    for hostApi in hostApis:
-        out += "#define PA_HAVE_%s\n" % hostApi
-
-        hostApiSpecificHeader = hostApiHeaders.get(hostApi, None)
-        if hostApiSpecificHeader:
-            out += "#include \"%s\"\n" % hostApiSpecificHeader
-
-        out += "\n"
-    # Strip the last newline
-    if out and out[-1] == "\n":
-        out = out[:-1]
-
-    f = file(str(target[0]), 'w')
-    try: f.write(out)
-    finally: f.close()
-    return 0
-
-# Define the builder for the config header
-env.Append(BUILDERS={"portaudioConfig": env.Builder(
-            action=Action(buildConfigH), target_factory=env.fs.File)})
-
-confH = env.portaudioConfig(File("portaudio_config.h", "include"),
-        File("portaudio.h", "include"))
-env.Default(confH)
-env.Install(os.path.join(includeDir, "portaudio"), confH)
-
-for api in hostApis:
-    if api in hostApiHeaders:
-        env.Install(os.path.join(includeDir, "portaudio"),
-                File(hostApiHeaders[api], "include"))
diff --git a/bindings/cpp/SConscript b/bindings/cpp/SConscript
deleted file mode 100644 (file)
index e69b93a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-import os.path
-
-Import("env", "buildDir")
-env.Append(CPPPATH="include")
-
-ApiVer = "0.0.12"
-Major, Minor, Micro = [int(c) for c in ApiVer.split(".")]
-
-sharedLibs = []
-staticLibs = []
-Import("Platform", "Posix")
-if Platform in Posix:
-    env["SHLIBSUFFIX"] = ".so.%d.%d.%d" % (Major, Minor, Micro)
-    soFile = "libportaudiocpp.so"
-    if Platform != 'darwin':
-        env.AppendUnique(SHLINKFLAGS="-Wl,-soname=%s.%d" % (soFile, Major))
-
-    # Create symlinks
-    def symlink(env, target, source):
-        trgt = str(target[0])
-        src = str(source[0])
-        if os.path.islink(trgt) or os.path.exists(trgt):
-            os.remove(trgt)
-        os.symlink(os.path.basename(src), trgt)
-    lnk0 = env.Command(soFile + ".%d" % (Major), soFile + ".%d.%d.%d" % (Major, Minor, Micro), symlink)
-    lnk1 = env.Command(soFile, soFile + ".%d" % (Major), symlink)
-    sharedLibs.append(lnk0)
-    sharedLibs.append(lnk1)
-
-src = [os.path.join("source", "portaudiocpp", "%s.cxx" % f) for f in ("BlockingStream", "CallbackInterface", \
-    "CallbackStream", "CFunCallbackStream","CppFunCallbackStream", "Device",
-    "DirectionSpecificStreamParameters", "Exception", "HostApi", "InterfaceCallbackStream",
-    "MemFunCallbackStream", "Stream", "StreamParameters", "System", "SystemDeviceIterator",
-    "SystemHostApiIterator")]
-env.Append(LIBS="portaudio", LIBPATH=buildDir)
-sharedLib = env.SharedLibrary("portaudiocpp", src, LIBS=["portaudio"])
-staticLib = env.Library("portaudiocpp", src, LIBS=["portaudio"])
-sharedLibs.append(sharedLib)
-staticLibs.append(staticLib)
-
-headers = Split("""AutoSystem.hxx                         
-                   BlockingStream.hxx                     
-                   CallbackInterface.hxx                  
-                   CallbackStream.hxx
-                   CFunCallbackStream.hxx                 
-                   CppFunCallbackStream.hxx               
-                   Device.hxx                             
-                   DirectionSpecificStreamParameters.hxx  
-                   Exception.hxx                           
-                   HostApi.hxx
-                   InterfaceCallbackStream.hxx
-                   MemFunCallbackStream.hxx
-                   PortAudioCpp.hxx
-                   SampleDataFormat.hxx
-                   Stream.hxx
-                   StreamParameters.hxx
-                   SystemDeviceIterator.hxx
-                   SystemHostApiIterator.hxx
-                   System.hxx
-                   """)
-if env["PLATFORM"] == "win32":
-    headers.append("AsioDeviceAdapter.hxx") 
-headers = [File(os.path.join("include", "portaudiocpp", h)) for h in headers]
-
-Return("sharedLibs", "staticLibs", "headers")
diff --git a/build/scons/SConscript_common b/build/scons/SConscript_common
deleted file mode 100644 (file)
index eaf4e3c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-import os.path, sys
-
-class ConfigurationError(Exception):
-    def __init__(self, reason):
-        Exception.__init__(self, "Configuration failed: %s" % reason)
-
-env = Environment()
-
-# sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant
-Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos", "netbsd")
-Windows = ("win32", "cygwin")
-
-if env["PLATFORM"] == "posix":
-    if sys.platform[:5] == "linux":
-        Platform = "linux"
-    elif sys.platform[:6] == "netbsd":
-       Platform = "netbsd"
-    else:
-        raise ConfigurationError("Unknown platform %s" % sys.platform)
-else:
-    if not env["PLATFORM"] in ("win32", "cygwin") + Posix:
-        raise ConfigurationError("Unknown platform %s" % env["PLATFORM"])
-    Platform = env["PLATFORM"]
-
-# Inspired by the versioning scheme followed by Qt, it seems sensible enough. There are three components: major, minor
-# and micro. Major changes with each subtraction from the API (backward-incompatible, i.e. V19 vs. V18), minor changes
-# with each addition to the API (backward-compatible), micro changes with each revision of the source code.
-ApiVer = "2.0.0"
-
-Export("Platform", "Posix", "ConfigurationError", "ApiVer")
diff --git a/build/scons/SConscript_opts b/build/scons/SConscript_opts
deleted file mode 100644 (file)
index 6a4b0a9..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-import os.path, sys
-
-def _PackageOption(pkgName, default=1):
-    """ Allow user to choose whether a package should be used if available. This results in a commandline option use<Pkgname>,
-    where Pkgname is the name of the package with a capitalized first letter.
-    @param pkgName: Name of package.
-    @param default: The default value for this option ("yes"/"no").
-    """
-    return BoolOption("use%s" % pkgName[0].upper() + pkgName[1:], "use %s if available" % (pkgName), default)
-
-def _BoolOption(opt, explanation, default=1):
-    """ Allow user to enable/disable a certain option. This results in a commandline option enable<Option>, where Option
-    is the name of the option with a capitalized first letter.
-    @param opt: Name of option.
-    @param explanation: Explanation of option.
-    @param default: The default value for this option (1/0).
-    """
-    return BoolOption("enable%s" % opt[0].upper() + opt[1:], explanation, default)
-
-def _EnumOption(opt, explanation, allowedValues, default):
-    """ Allow the user to choose among a set of values for an option. This results in a commandline option with<Option>,
-    where Option is the name of the option with a capitalized first letter.
-    @param opt: The name of the option.
-    @param explanation: Explanation of option.
-    @param allowedValues: The set of values to choose from.
-    @param default: The default value.
-    """
-    assert default in allowedValues
-    return EnumOption("with%s" % opt[0].upper() + opt[1:], explanation, default, allowed_values=allowedValues)
-
-def _DirectoryOption(opt, explanation, default):
-    """ Allow the user to configure the location for a certain directory, for instance the prefix. This results in a
-    commandline option which is simply the name of this option.
-    @param opt: The configurable directory, for instance "prefix".
-    @param explanation: Explanation of option.
-    @param default: The default value for this option.
-    """
-    return PathOption(opt, explanation, default)
-    # Incompatible with the latest stable SCons
-    # return PathOption(path, help, default, PathOption.PathIsDir)
-
-import SCons.Errors
-try:
-    Import("Platform", "Posix")
-except SCons.Errors.UserError:
-    # The common objects must be exported first
-    SConscript("SConscript_common")
-    Import("Platform", "Posix")
-
-# Expose the options as a dictionary of sets of options
-opts = {}
-
-if Platform in Posix:
-    opts["Installation Dirs"] = [_DirectoryOption("prefix", "installation prefix", "/usr/local")]
-elif Platform in Windows:
-    if Platform == "cygwin":
-        opts["Installation Dirs"] = [_DirectoryOption("prefix", "installation prefix", "/usr/local")]
-
-opts["Build Targets"] = [_BoolOption("shared", "create shared library"), _BoolOption("static", "create static library"),
-        _BoolOption("tests", "build test programs")]
-
-apis = []
-if Platform in Posix:
-    apis.append(_PackageOption("OSS"))
-    apis.append(_PackageOption("JACK"))
-    apis.append(_PackageOption("ALSA", Platform == "linux"))
-    apis.append(_PackageOption("ASIHPI", Platform == "linux"))
-    apis.append(_PackageOption("COREAUDIO", Platform == "darwin"))
-elif Platform in Windows:
-    if Platform == "cygwin":
-        apis.append(_EnumOption("winAPI", "Windows API to use", ("wmme", "directx", "asio"), "wmme"))
-
-opts["Host APIs"] = apis
-
-opts["Build Parameters"] = [\
-        _BoolOption("debug", "compile with debug symbols"),
-        _BoolOption("optimize", "compile with optimization", default=0),
-        _BoolOption("asserts", "runtime assertions are helpful for debugging, but can be detrimental to performance",
-                default=1),
-        _BoolOption("debugOutput", "enable debug output", default=0),
-        # _BoolOption("python", "create Python binding"),
-        ("customCFlags", "customize compilation of C code", ""),
-        ("customCxxFlags", "customize compilation of C++ code", ""),
-        ("customLinkFlags", "customize linking", ""),
-        ]
-
-opts["Bindings"] = [\
-        _BoolOption("cxx", "build Merlijn Blaauw's PA C++ wrapper", default=0)
-        ]
-    
-Return("opts")
diff --git a/src/SConscript b/src/SConscript
deleted file mode 100644 (file)
index 5cc9152..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-import os.path, copy, sys
-
-def checkSymbol(conf, header, library=None, symbol=None, autoAdd=True, critical=False, pkgName=None):
-    """ Check for symbol in library, optionally look only for header.
-    @param conf: Configure instance.
-    @param header: The header file where the symbol is declared.
-    @param library: The library in which the symbol exists, if None it is taken to be the standard C library.
-    @param symbol: The symbol to look for, if None only the header will be looked up.
-    @param autoAdd: Automatically link with this library if check is positive.
-    @param critical: Raise on error?
-    @param pkgName: Optional name of pkg-config entry for library, to determine build parameters.
-    @return: True/False
-    """
-    origEnv = conf.env.Copy() # Copy unmodified environment so we can restore it upon error
-    env = conf.env
-    if library is None:
-        library = "c"   # Standard library
-        autoAdd = False
-
-    if pkgName is not None:
-        origLibs = copy.copy(env.get("LIBS", None))
-
-        try: env.ParseConfig("pkg-config --silence-errors %s --cflags --libs" % pkgName)
-        except: pass
-        else:
-            # I see no other way of checking that the parsing succeeded, if it did add no more linking parameters
-            if env.get("LIBS", None) != origLibs:
-                autoAdd = False
-
-    try:
-        if not conf.CheckCHeader(header, include_quotes="<>"):
-            raise ConfigurationError("missing header %s" % header)
-        if symbol is not None and not conf.CheckLib(library, symbol, language="C", autoadd=autoAdd):
-            raise ConfigurationError("missing symbol %s in library %s" % (symbol, library))
-    except ConfigurationError:
-        conf.env = origEnv
-        if not critical:
-            return False
-        raise
-
-    return True
-
-import SCons.Errors
-
-# Import common variables
-
-# Could use '#' to refer to top-level SConstruct directory, but looks like env.SConsignFile doesn't interpret this at least :(
-sconsDir = os.path.abspath(os.path.join("build", "scons"))
-
-try:
-    Import("Platform", "Posix", "ConfigurationError", "ApiVer")
-except SCons.Errors.UserError:
-    # The common objects must be exported first
-    SConscript(os.path.join(sconsDir, "SConscript_common"))
-    Import("Platform", "Posix", "ConfigurationError", "ApiVer")
-
-Import("env")
-
-# This will be manipulated
-env = env.Copy()
-
-# We operate with a set of needed libraries and optional libraries, the latter stemming from host API implementations.
-# For libraries of both types we record a set of values that is used to look for the library in question, during
-# configuration. If the corresponding library for a host API implementation isn't found, the implementation is left out.
-neededLibs = []
-optionalImpls = {}
-if Platform in Posix:
-    env.Append(CPPPATH=os.path.join("os", "unix"))
-    neededLibs += [("pthread", "pthread.h", "pthread_create"), ("m", "math.h", "sin")]
-    if env["useALSA"]:
-        optionalImpls["ALSA"] = ("asound", "alsa/asoundlib.h", "snd_pcm_open")
-    if env["useJACK"]:
-        optionalImpls["JACK"] = ("jack", "jack/jack.h", "jack_client_new")
-    if env["useOSS"]:
-        # TODO: It looks like the prefix for soundcard.h depends on the platform
-        optionalImpls["OSS"] = ("oss", "sys/soundcard.h", None)
-       if Platform == 'netbsd':
-               optionalImpls["OSS"] = ("ossaudio", "sys/soundcard.h", "_oss_ioctl")
-    if env["useASIHPI"]:
-        optionalImpls["ASIHPI"] = ("hpi", "asihpi/hpi.h", "HPI_SubSysCreate")
-    if env["useCOREAUDIO"]:
-        optionalImpls["COREAUDIO"] = ("CoreAudio", "CoreAudio/CoreAudio.h", None)
-else:
-    raise ConfigurationError("unknown platform %s" % Platform)
-
-if Platform == "darwin":
-    env.Append(LINKFLAGS="-framework CoreFoundation -framework CoreServices -framework CoreAudio -framework AudioToolBox -framework AudioUnit")
-elif Platform == "cygwin":
-    env.Append(LIBS=["winmm"])
-elif Platform == "irix":
-    neededLibs +=  [("audio", "dmedia/audio.h", "alOpenPort"), ("dmedia", "dmedia/dmedia.h", "dmGetUST")]
-    env.Append(CPPDEFINES=["PA_USE_SGI"])
-
-def CheckCTypeSize(context, tp):
-    """ Check size of C type.
-    @param context: A configuration context.
-    @param tp: The type to check.
-    @return: Size of type, in bytes.
-    """
-    context.Message("Checking the size of C type %s..." % tp)
-    ret = context.TryRun("""
-#include <stdio.h>
-
-int main() {
-    printf("%%d", sizeof(%s));
-    return 0;
-}
-""" % tp, ".c")
-    if not ret[0]:
-        context.Result(" Couldn't obtain size of type %s!" % tp)
-        return None
-
-    assert ret[1]
-    sz = int(ret[1])
-    context.Result("%d" % sz)
-    return sz
-
-"""
-if sys.byteorder == "little":
-    env.Append(CPPDEFINES=["PA_LITTLE_ENDIAN"])
-elif sys.byteorder == "big":
-    env.Append(CPPDEFINES=["PA_BIG_ENDIAN"])
-else:
-    raise ConfigurationError("unknown byte order: %s" % sys.byteorder)
-"""
-if env["enableDebugOutput"]:
-    env.Append(CPPDEFINES=["PA_ENABLE_DEBUG_OUTPUT"])
-
-# Start configuration
-
-# Use an absolute path for conf_dir, otherwise it gets created both relative to current directory and build directory
-conf = env.Configure(log_file=os.path.join(sconsDir, "sconf.log"), custom_tests={"CheckCTypeSize": CheckCTypeSize},
-        conf_dir=os.path.join(sconsDir, ".sconf_temp"))
-conf.env.Append(CPPDEFINES=["SIZEOF_SHORT=%d" % conf.CheckCTypeSize("short")])
-conf.env.Append(CPPDEFINES=["SIZEOF_INT=%d" % conf.CheckCTypeSize("int")])
-conf.env.Append(CPPDEFINES=["SIZEOF_LONG=%d" % conf.CheckCTypeSize("long")])
-if checkSymbol(conf, "time.h", "rt", "clock_gettime"):
-    conf.env.Append(CPPDEFINES=["HAVE_CLOCK_GETTIME"])
-if checkSymbol(conf, "time.h", symbol="nanosleep"):
-    conf.env.Append(CPPDEFINES=["HAVE_NANOSLEEP"])
-if conf.CheckCHeader("sys/soundcard.h"):
-    conf.env.Append(CPPDEFINES=["HAVE_SYS_SOUNDCARD_H"])
-if conf.CheckCHeader("linux/soundcard.h"):
-    conf.env.Append(CPPDEFINES=["HAVE_LINUX_SOUNDCARD_H"])
-if conf.CheckCHeader("machine/soundcard.h"):
-    conf.env.Append(CPPDEFINES=["HAVE_MACHINE_SOUNDCARD_H"])
-
-# Look for needed libraries and link with them
-for lib, hdr, sym in neededLibs:
-    checkSymbol(conf, hdr, lib, sym, critical=True)
-# Look for host API libraries, if a library isn't found disable corresponding host API implementation.
-for name, val in optionalImpls.items():
-    lib, hdr, sym = val
-    if checkSymbol(conf, hdr, lib, sym, critical=False, pkgName=name.lower()):
-        conf.env.Append(CPPDEFINES=["PA_USE_%s=1" % name.upper()])
-    else:
-        del optionalImpls[name]
-
-# Configuration finished
-env = conf.Finish()
-
-# PA infrastructure
-CommonSources = [os.path.join("common", f) for f in "pa_allocation.c pa_converters.c pa_cpuload.c pa_dither.c pa_front.c \
-        pa_process.c pa_stream.c pa_trace.c pa_debugprint.c pa_ringbuffer.c".split()]
-CommonSources.append(os.path.join("hostapi", "skeleton", "pa_hostapi_skeleton.c"))
-
-# Host APIs implementations
-ImplSources = []
-if Platform in Posix:
-    ImplSources += [os.path.join("os", "unix", f) for f in "pa_unix_hostapis.c pa_unix_util.c".split()]
-
-if "ALSA" in optionalImpls:
-    ImplSources.append(os.path.join("hostapi", "alsa", "pa_linux_alsa.c"))
-if "JACK" in optionalImpls:
-    ImplSources.append(os.path.join("hostapi", "jack", "pa_jack.c"))
-if "OSS" in optionalImpls:
-    ImplSources.append(os.path.join("hostapi", "oss", "pa_unix_oss.c"))
-if "ASIHPI" in optionalImpls:
-    ImplSources.append(os.path.join("hostapi", "asihpi", "pa_linux_asihpi.c"))
-if "COREAUDIO" in optionalImpls:
-    ImplSources.append([os.path.join("hostapi", "coreaudio", f) for f in """
-       pa_mac_core.c  pa_mac_core_blocking.c  pa_mac_core_utilities.c 
-    """.split()])
-
-
-sources = CommonSources + ImplSources
-
-sharedLibEnv = env.Copy()
-if Platform in Posix:
-    # Add soname to library, this is so a reference is made to the versioned library in programs linking against libportaudio.so
-    if Platform != 'darwin':
-        sharedLibEnv.AppendUnique(SHLINKFLAGS="-Wl,-soname=libportaudio.so.%d" % int(ApiVer.split(".")[0]))
-sharedLib = sharedLibEnv.SharedLibrary(target="portaudio", source=sources)
-
-staticLib = env.StaticLibrary(target="portaudio", source=sources)
-
-if Platform in Posix:
-    prefix = env["prefix"]
-    includeDir = os.path.join(prefix, "include")
-    libDir = os.path.join(prefix, "lib")
-
-testNames = ["patest_sine", "paqa_devs", "paqa_errs", "patest1", "patest_buffer", "patest_callbackstop", "patest_clip", \
-        "patest_dither", "patest_hang", "patest_in_overflow", "patest_latency", "patest_leftright", "patest_longsine", \
-        "patest_many", "patest_maxsines", "patest_multi_sine", "patest_out_underflow", "patest_pink", "patest_prime", \
-        "patest_read_record", "patest_record", "patest_ringmix", "patest_saw", "patest_sine8", "patest_sine", \
-        "patest_sine_time", "patest_start_stop", "patest_stop", "patest_sync", "patest_toomanysines", \
-        "patest_underflow", "patest_wire", "patest_write_sine", "pa_devs", "pa_fuzz", "pa_minlat", \
-        "patest_sine_channelmaps",]
-
-# The test directory ("bin") should be in the top-level PA directory
-tests = [env.Program(target=os.path.join("#", "bin", name), source=[os.path.join("#", "test", name + ".c"),
-        staticLib]) for name in testNames]
-
-# Detect host APIs
-hostApis = []
-for cppdef in env["CPPDEFINES"]:
-    if cppdef.startswith("PA_USE_"):
-        hostApis.append(cppdef[7:-2])
-
-Return("sources", "sharedLib", "staticLib", "tests", "env", "hostApis")