cx_Freeze /

"""Make the frozen base executables."""

import distutils.sysconfig
import os
import sys

CC = os.environ.get("CC", "gcc")

# define function for building a base executable
def BuildBase(name, linkerFlags = "", sharedLib = False):
    vars = distutils.sysconfig.get_config_vars()
    sourceName = name + ".c"
    objectName = name + ".o"
    targetName = name
    if sharedLib:
        if sys.platform == "win32":
            targetName += ".dll"
            targetName += vars["SO"]
        linkerFlags = "-shared %s" % linkerFlags
        targetName += vars["EXE"]
    compilerFlags = "-c -I. -I%s -I%s" % \
    linkerFlags += " -s"
    if sys.platform == "win32":
        import win32api
        linkerFlags += " " + win32api.GetModuleFileName(sys.dllhandle)
        linkerFlags += " %s %s -L%s" % \
                (vars["LDFLAGS"], vars["LINKFORSHARED"], vars["LIBPL"])
        if sys.platform == "hp-ux11":
            linkerFlags += " -lcl"
        linkerFlags += " -lpython%d.%d" % sys.version_info[:2]
        linkerFlags += " %s %s %s %s" % \
                (vars["LIBS"], vars["LIBM"], vars["LOCALMODLIBS"],
    command = "%s %s -o %s %s" % (CC, compilerFlags, objectName, sourceName)
    print command
    if os.system(command) != 0:
        raise "Failed to compile %s" % sourceName
    command = "%s -o %s %s %s" % \
            (CC, os.path.join("bases", targetName), objectName, linkerFlags)
    print command
    if os.system(command) != 0:
        raise "Failed to link %s" % sourceName

# create the directory, if necessary
if not os.path.exists("bases"):

# build the base executables
if sys.platform == "win32":
    BuildBase("Win32GUI", "-mwindows")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.