srcanamdw/codescanner/pyinstaller/source/Sconscript
changeset 1 22878952f6e2
equal deleted inserted replaced
0:509e4801c378 1:22878952f6e2
       
     1 # Sconscript file to build the bootloader
       
     2 # Copyright (C) 2005, Giovanni Bajo
       
     3 #
       
     4 # This program is free software; you can redistribute it and/or
       
     5 # modify it under the terms of the GNU General Public License
       
     6 # as published by the Free Software Foundation; either version 2
       
     7 # of the License, or (at your option) any later version.
       
     8 #
       
     9 # This program is distributed in the hope that it will be useful,
       
    10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 # GNU General Public License for more details.
       
    13 #
       
    14 # You should have received a copy of the GNU General Public License
       
    15 # along with this program; if not, write to the Free Software
       
    16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
       
    17 
       
    18 Import("env")
       
    19 
       
    20 env.Append(CPPPATH = [ "zlib", "common" ])
       
    21 
       
    22 if env["PYINST_FLAVOUR"] == "debug":
       
    23     # launch.c prints some debug messages to the console if this macro is defined
       
    24     env.Append(CPPDEFINES = ["LAUNCH_DEBUG"])
       
    25 
       
    26 if Platform().name == "win32":
       
    27     # We use a prebuilt binary version of zlib [http://www.winimage.com/zLibDll/].
       
    28     # It was compiled with the WINAPI convention.
       
    29     env.Append(CPPDEFINES = [ "ZLIB_WINAPI" ])
       
    30 
       
    31     if env["PYINST_MODE"] == "cons":
       
    32         resfile = env.RES("windows/run.rc")
       
    33     else:
       
    34         resfile = env.RES("windows/runw.rc")
       
    35 
       
    36 zlib = env.Library("zlib",
       
    37                     ["zlib/inflate.c",
       
    38                      "zlib/crc32.c",
       
    39                      "zlib/adler32.c",
       
    40                      "zlib/zutil.c",
       
    41                      "zlib/inffast.c",
       
    42                      "zlib/inftrees.c"])
       
    43 run = env.Program("run",
       
    44                  ["common/launch.c", "windows/winmain.c", zlib, resfile])
       
    45 dll = env.SharedLibrary("inprocsrvr",
       
    46                         ["common/launch.c", "windows/dllmain.c", zlib])
       
    47 
       
    48 Return("run", "dll")