2022-06-06 13:09:32 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
def exists(env):
|
|
|
|
return os.name == "nt"
|
|
|
|
|
|
|
|
|
|
|
|
# Workaround for MinGW. See:
|
|
|
|
# http://www.scons.org/wiki/LongCmdLinesOnWin32
|
|
|
|
def configure(env):
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
def mySubProcess(cmdline, env):
|
2023-03-31 12:57:17 +00:00
|
|
|
# print("SPAWNED: " + cmdline)
|
|
|
|
proc = subprocess.run(
|
|
|
|
args=cmdline,
|
|
|
|
shell=True,
|
2022-06-06 13:09:32 +00:00
|
|
|
env=env,
|
|
|
|
)
|
2023-03-31 12:57:17 +00:00
|
|
|
rv = proc.returncode
|
2022-06-06 13:09:32 +00:00
|
|
|
if rv:
|
|
|
|
print("=====")
|
2023-03-31 12:57:17 +00:00
|
|
|
print(rv, "(", hex(rv), ")")
|
2022-06-06 13:09:32 +00:00
|
|
|
print("=====")
|
|
|
|
return rv
|
|
|
|
|
|
|
|
def mySpawn(sh, escape, cmd, args, env):
|
|
|
|
|
|
|
|
newargs = " ".join(args[1:])
|
|
|
|
cmdline = cmd + " " + newargs
|
|
|
|
|
|
|
|
rv = 0
|
|
|
|
if len(cmdline) > 32000 and cmd.endswith("ar"):
|
|
|
|
cmdline = cmd + " " + args[1] + " " + args[2] + " "
|
|
|
|
for i in range(3, len(args)):
|
|
|
|
rv = mySubProcess(cmdline + args[i], env)
|
|
|
|
if rv:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
rv = mySubProcess(cmdline, env)
|
|
|
|
|
|
|
|
return rv
|
|
|
|
|
|
|
|
env["SPAWN"] = mySpawn
|
|
|
|
env.Replace(ARFLAGS=["q"])
|