|
@ -53,10 +53,15 @@ def isExecutableFile(path): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def which(prog): |
|
|
def which(prog): |
|
|
# for thisPath in os.environ["PATH"].split(os.pathsep): |
|
|
""" |
|
|
for thisPath in sys.path: |
|
|
Check for the given file within os.environ["PATH"], which contains |
|
|
# ^ sys.path includes BINDIR added before calling this! |
|
|
paths separated by os.pathsep. |
|
|
|
|
|
NOTE: sys.path is NOT applicable, since it only has Python paths. |
|
|
|
|
|
""" |
|
|
|
|
|
for thisPath in os.environ["PATH"].split(os.pathsep): |
|
|
sub_path = os.path.join(thisPath, prog) |
|
|
sub_path = os.path.join(thisPath, prog) |
|
|
|
|
|
if os.path.isfile(sub_path): |
|
|
|
|
|
return sub_path |
|
|
return "" |
|
|
return "" |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -189,7 +194,7 @@ Option switches: |
|
|
Aliases: --usage |
|
|
Aliases: --usage |
|
|
For full documentation, see "linux-minetest-kit.txt". |
|
|
For full documentation, see "linux-minetest-kit.txt". |
|
|
|
|
|
|
|
|
--minetest=<minetest> # Set the minetest source path to a |
|
|
--MT_SRC=<minetest> # Set the minetest source path to a |
|
|
# locally-modified copy, such as |
|
|
# locally-modified copy, such as |
|
|
# $HOME/git/minetest |
|
|
# $HOME/git/minetest |
|
|
|
|
|
|
|
@ -254,7 +259,7 @@ else: |
|
|
|
|
|
|
|
|
GITURL = 'http://git.minetest.org/minetest/minetest.git' |
|
|
GITURL = 'http://git.minetest.org/minetest/minetest.git' |
|
|
IE = 'Internal error' |
|
|
IE = 'Internal error' |
|
|
FlagMinetest = None |
|
|
Flags = {} |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# global variables |
|
|
# global variables |
|
@ -312,7 +317,11 @@ def popd(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def RunCmd(cmdParts, exitOnFail=True): |
|
|
def RunCmd(cmdParts, exitOnFail=True): |
|
|
child = subprocess.Popen(openRTSP+opts.split(), |
|
|
# Popen can get confused when arguments contain quotes |
|
|
|
|
|
# (see <https://stackoverflow.com/questions/14928860/passing-double- |
|
|
|
|
|
# quote-shell-commands-in-python-to-subprocess-popen>) such as |
|
|
|
|
|
# in "-DCMAKE_CXX_FLAG="+XCFLAGS where XCFLAGS contains quotes. |
|
|
|
|
|
child = subprocess.Popen(cmdParts, shell=True, |
|
|
stdout=subprocess.PIPE) |
|
|
stdout=subprocess.PIPE) |
|
|
streamdata = child.communicate()[0] |
|
|
streamdata = child.communicate()[0] |
|
|
rc = child.returncode |
|
|
rc = child.returncode |
|
@ -339,16 +348,14 @@ def GetProgDir(): |
|
|
return os.getcwd() |
|
|
return os.getcwd() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def GetOptions(nonBoolNames=[], TitleCaseAndFlag=False, bareArgs=[]): |
|
|
def GetOptions(nonBoolNames=[], bareArgs=[]): |
|
|
""" |
|
|
""" |
|
|
Convert command-line arguments to globals. |
|
|
Convert command-line arguments to values in the global Flags dict. |
|
|
|
|
|
|
|
|
Keyword Arguments: |
|
|
Keyword Arguments: |
|
|
nonBoolNames -- You should set all of these to None in the global |
|
|
nonBoolNames -- Specify which arguments can have values. All others |
|
|
namespace before calling this so that you can check them against |
|
|
are considered boolean, and will end the program if they contain |
|
|
None later without getting an undefined variable error. |
|
|
'='. |
|
|
TitleCaseAndFlag -- Change '--something' to 'FlagSomething' if |
|
|
|
|
|
TitleCaseAndFlag, otherwise change it to 'something'. |
|
|
|
|
|
bareArgs -- allowed arguments without "--" at the beginning. |
|
|
bareArgs -- allowed arguments without "--" at the beginning. |
|
|
|
|
|
|
|
|
Returns: |
|
|
Returns: |
|
@ -371,9 +378,10 @@ def GetOptions(nonBoolNames=[], TitleCaseAndFlag=False, bareArgs=[]): |
|
|
" {}.".format(nonBoolNames)) |
|
|
" {}.".format(nonBoolNames)) |
|
|
return False |
|
|
return False |
|
|
val = arg[signI+1:] |
|
|
val = arg[signI+1:] |
|
|
if TitleCaseAndFlag: |
|
|
# if TitleCaseAndFlag: |
|
|
name = "Flag" + name.title() |
|
|
# name = "Flag" + name.title() |
|
|
globals()[name] = val |
|
|
print("* {} = {}".format(name, val)) |
|
|
|
|
|
Flags[name] = val |
|
|
else: |
|
|
else: |
|
|
print("The option is unknown: {}".format(arg)) |
|
|
print("The option is unknown: {}".format(arg)) |
|
|
return False |
|
|
return False |
|
@ -387,7 +395,7 @@ USAGE_FMT = """ |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def UsageText(): |
|
|
def UsageText(msg=""): |
|
|
""" |
|
|
""" |
|
|
"UsageText" prints usage text for the current program, then termin- |
|
|
"UsageText" prints usage text for the current program, then termin- |
|
|
ates the program with exit status one. |
|
|
ates the program with exit status one. |
|
@ -401,6 +409,10 @@ def UsageText(): |
|
|
)) |
|
|
)) |
|
|
# USAGE_TEXT = evalSed('s@\s*\z@\n@s') |
|
|
# USAGE_TEXT = evalSed('s@\s*\z@\n@s') |
|
|
print(THIS_USAGE) |
|
|
print(THIS_USAGE) |
|
|
|
|
|
print("") |
|
|
|
|
|
print(msg) |
|
|
|
|
|
print("") |
|
|
|
|
|
print("") |
|
|
exit(1) |
|
|
exit(1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -425,23 +437,23 @@ def main(): |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Command-line option flags. |
|
|
# Command-line option flags. |
|
|
|
|
|
|
|
|
FlagBuild = False |
|
|
Flags["build"] = False |
|
|
FlagClient = False |
|
|
Flags["client"] = False |
|
|
FlagDebug = False |
|
|
Flags["debug"] = False |
|
|
FlagEdgy = False |
|
|
Flags["edgy"] = False |
|
|
FlagGitPull = False |
|
|
Flags["gitpull"] = False |
|
|
FlagGitReset = False |
|
|
Flags["gitreset"] = False |
|
|
FlagHelp = False |
|
|
Flags["help"] = False |
|
|
FlagMakeProd = False |
|
|
Flags["makeprod"] = False |
|
|
FlagFakeMT4 = False |
|
|
Flags["fakemt4"] = False |
|
|
FlagNoClean = False |
|
|
Flags["noclean"] = False |
|
|
FlagPortable = False |
|
|
Flags["portable"] = False |
|
|
FlagPostgres = False |
|
|
Flags["postgres"] = False |
|
|
FlagRedis = False |
|
|
Flags["redis"] = False |
|
|
FlagSafe = False |
|
|
Flags["safe"] = False |
|
|
FlagServer = False |
|
|
Flags["server"] = False |
|
|
|
|
|
|
|
|
FlagOldProto = True |
|
|
Flags["oldproto"] = True |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Initial setup. |
|
|
# Initial setup. |
|
@ -461,21 +473,35 @@ def main(): |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Parse command-line arguments. |
|
|
# Parse command-line arguments. |
|
|
|
|
|
|
|
|
if not GetOptions(nonBoolNames=["minetest"], TitleCaseAndFlag=True, |
|
|
if not GetOptions(nonBoolNames=["MT_SRC"], bareArgs=["build"]): |
|
|
bareArgs=["build"]): |
|
|
|
|
|
UsageText() |
|
|
UsageText() |
|
|
|
|
|
mapLongArgs = {} |
|
|
|
|
|
mapLongArgs["edgytest"] = "edgy" |
|
|
|
|
|
mapLongArgs["notidy"] = "noclean" |
|
|
|
|
|
mapLongArgs["oldprotocol"] = "oldproto" |
|
|
|
|
|
mapLongArgs["postgresql"] = "postgres" |
|
|
|
|
|
mapLongArgs["usage"] = "help" |
|
|
|
|
|
for k, v in mapLongArgs.items(): |
|
|
|
|
|
old_v = Flags.get(k) |
|
|
|
|
|
if old_v is not None: |
|
|
|
|
|
Flags[v] = old_v |
|
|
|
|
|
del Flags[k] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Handle usage-text exit |
|
|
# Handle usage-text exit |
|
|
if (not FlagBuild) or FlagHelp: |
|
|
if (not Flags["build"]) or Flags["help"]: |
|
|
UsageText() |
|
|
if not Flags["build"]: |
|
|
|
|
|
msg = ("You did not specify build or --build (got:{})." |
|
|
|
|
|
"".format(Flags)) |
|
|
|
|
|
UsageText(msg=msg) |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle misc. flag issues. |
|
|
# Handle misc. flag issues. |
|
|
if FlagEdgy: |
|
|
if Flags["edgy"]: |
|
|
FlagFakeMT4 = True |
|
|
Flags["fakemt4"] = True |
|
|
if FlagEdgy or FlagFakeMT4: |
|
|
if Flags["edgy"] or Flags["fakemt4"]: |
|
|
FlagOldProto = True |
|
|
Flags["oldproto"] = True |
|
|
if FlagEdgy and FlagGitPull: |
|
|
if Flags["edgy"] and Flags["gitpull"]: |
|
|
customExit("Error: Can't use both --edgy and --gitpull") |
|
|
customExit("Error: Can't use both --edgy and --gitpull") |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
@ -502,15 +528,16 @@ which contains the "mtsrc" directory. |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Misc. setup. |
|
|
# Misc. setup. |
|
|
sys.path.insert(0, BINDIR) |
|
|
if not BINDIR in os.environ["PATH"]: |
|
|
|
|
|
os.environ["PATH"] = BINDIR + os.pathsep + os.environ["PATH"] |
|
|
which("g++") |
|
|
which("g++") |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle some of the option flags. |
|
|
# Handle some of the option flags. |
|
|
if FlagDebug: |
|
|
if Flags["debug"]: |
|
|
MAKEDEBUG = True |
|
|
MAKEDEBUG = True |
|
|
if FlagMakeProd: |
|
|
if Flags["makeprod"]: |
|
|
MAKEPROD = True |
|
|
MAKEPROD = True |
|
|
if FlagNoClean: |
|
|
if Flags["noclean"]: |
|
|
TIDYUP = False |
|
|
TIDYUP = False |
|
|
|
|
|
|
|
|
if MAKEPROD: |
|
|
if MAKEPROD: |
|
@ -521,11 +548,11 @@ which contains the "mtsrc" directory. |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle "--gitreset". |
|
|
# Handle "--gitreset". |
|
|
|
|
|
|
|
|
if FlagGitReset: |
|
|
if Flags["gitreset"]: |
|
|
if FlagGitPull: |
|
|
if Flags["gitpull"]: |
|
|
customExit("Error: Can't use both --gitreset and --gitpull\n") |
|
|
customExit("Error: Can't use both --gitreset and --gitpull\n") |
|
|
|
|
|
|
|
|
if FlagSafe and os.path.isdir('minetest'): |
|
|
if Flags["safe"] and os.path.isdir('minetest'): |
|
|
print(""" |
|
|
print(""" |
|
|
Error: "minetest" directory exists and "--gitreset" needs to delete |
|
|
Error: "minetest" directory exists and "--gitreset" needs to delete |
|
|
it. But can't because "--safe" was specified. If you wish to proceed, |
|
|
it. But can't because "--safe" was specified. If you wish to proceed, |
|
@ -547,8 +574,8 @@ move or rename the directory. |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle "--gitpull". |
|
|
# Handle "--gitpull". |
|
|
|
|
|
|
|
|
if FlagGitPull: |
|
|
if Flags["gitpull"]: |
|
|
if FlagGitReset: |
|
|
if Flags["gitreset"]: |
|
|
customExit("Error: Can't use both --gitreset and --gitpull\n") |
|
|
customExit("Error: Can't use both --gitreset and --gitpull\n") |
|
|
|
|
|
|
|
|
TIDYUP = False |
|
|
TIDYUP = False |
|
@ -593,11 +620,11 @@ automatically. |
|
|
client_line = "-DBUILD_CLIENT=1" |
|
|
client_line = "-DBUILD_CLIENT=1" |
|
|
server_line = "-DBUILD_SERVER=1" |
|
|
server_line = "-DBUILD_SERVER=1" |
|
|
|
|
|
|
|
|
if FlagClient and not FlagServer: |
|
|
if Flags["client"] and not Flags["server"]: |
|
|
client_line = "-DBUILD_CLIENT=1" |
|
|
client_line = "-DBUILD_CLIENT=1" |
|
|
server_line = "-DBUILD_SERVER=0" |
|
|
server_line = "-DBUILD_SERVER=0" |
|
|
|
|
|
|
|
|
if not FlagClient and FlagServer: |
|
|
if not Flags["client"] and Flags["server"]: |
|
|
client_line = "-DBUILD_CLIENT=0" |
|
|
client_line = "-DBUILD_CLIENT=0" |
|
|
server_line = "-DBUILD_SERVER=1" |
|
|
server_line = "-DBUILD_SERVER=1" |
|
|
|
|
|
|
|
@ -616,7 +643,7 @@ automatically. |
|
|
|
|
|
|
|
|
postgres_line = "-DENABLE_POSTGRESQL=0" |
|
|
postgres_line = "-DENABLE_POSTGRESQL=0" |
|
|
|
|
|
|
|
|
if FlagPostgres: |
|
|
if Flags["postgres"]: |
|
|
print("* postgres (due to --postgresql)") |
|
|
print("* postgres (due to --postgresql)") |
|
|
postgres_line = "-DENABLE_POSTGRESQL=1" |
|
|
postgres_line = "-DENABLE_POSTGRESQL=1" |
|
|
else: |
|
|
else: |
|
@ -627,7 +654,7 @@ automatically. |
|
|
|
|
|
|
|
|
redis_line = "-DENABLE_REDIS=0" |
|
|
redis_line = "-DENABLE_REDIS=0" |
|
|
|
|
|
|
|
|
if FlagRedis: |
|
|
if Flags["redis"]: |
|
|
print("* redis (due to --redis)") |
|
|
print("* redis (due to --redis)") |
|
|
redis_line = "-DENABLE_REDIS=1" |
|
|
redis_line = "-DENABLE_REDIS=1" |
|
|
else: |
|
|
else: |
|
@ -662,11 +689,12 @@ gcc-bootstrap mode enabled. |
|
|
RESETDIR = (not os.path.isdir(PRODDIR)) or TIDYUP |
|
|
RESETDIR = (not os.path.isdir(PRODDIR)) or TIDYUP |
|
|
|
|
|
|
|
|
if RESETDIR: |
|
|
if RESETDIR: |
|
|
if FlagSafe and os.path.isdir('minetest'): |
|
|
if Flags["safe"] and os.path.isdir('minetest'): |
|
|
print(""" |
|
|
print(""" |
|
|
|
|
|
|
|
|
Error: We need to delete the existing "minetest" directory, but |
|
|
Error: We need to delete the existing "minetest" directory, but |
|
|
"--safe" is specified. If you'd like to preserve the directory, move#or rename it. Otherwise, drop the "--safe" switch. |
|
|
"--safe" is specified. If you'd like to preserve the directory, move |
|
|
|
|
|
or rename it. Otherwise, drop the "--safe" switch. |
|
|
""") |
|
|
""") |
|
|
exit(1) |
|
|
exit(1) |
|
|
# PRODDIR is THISDIR/minetest |
|
|
# PRODDIR is THISDIR/minetest |
|
@ -679,19 +707,23 @@ Error: We need to delete the existing "minetest" directory, but |
|
|
continue |
|
|
continue |
|
|
if sub_path == PRODDIR: |
|
|
if sub_path == PRODDIR: |
|
|
# ^ sub_path must be generated the same way as |
|
|
# ^ sub_path must be generated the same way as |
|
|
# PRODDIR (from THISDIR) for this to work. |
|
|
# PRODDIR (from THISDIR) for this to work (to |
|
|
|
|
|
# remove the linux-minetest-kit/minetest directory). |
|
|
|
|
|
print("* removing old \"{}\"".format(sub_path)) |
|
|
shutil.rmtree(sub_path) |
|
|
shutil.rmtree(sub_path) |
|
|
elif sub.startswith("minetest-newline"): |
|
|
elif sub.startswith("minetest-newline"): |
|
|
shutil.rmtree(sub_path) |
|
|
shutil.rmtree(sub_path) |
|
|
print("* extracting in " + os.getcwd()) |
|
|
print("* extracting in " + os.getcwd()) |
|
|
mtNewLine = "minetest-newline" |
|
|
mtNewLine = "minetest-newline" |
|
|
if FlagEdgy: |
|
|
if Flags["edgy"]: |
|
|
mtNewLine = "minetest-newline" |
|
|
mtNewLine = "minetest-newline" |
|
|
if FlagMinetest is not None: |
|
|
if Flags.get("MT_SRC") is not None: |
|
|
if not os.path.isdir(FlagMinetest): |
|
|
if not os.path.isdir(Flags["MT_SRC"]): |
|
|
customExit("{} does not exist.".format(FlagMinetest)) |
|
|
customExit("{} does not exist.".format(Flags["MT_SRC"])) |
|
|
print("* using \"{}\"".format(FlagMinetest)) |
|
|
print("* using \"{}\" (copying to \"{}\")" |
|
|
shutil.copytree(FlagMinetest, PRODDIR, copy_function=copy2) |
|
|
"".format(Flags["MT_SRC"], PRODDIR)) |
|
|
|
|
|
shutil.copytree(Flags["MT_SRC"], PRODDIR, |
|
|
|
|
|
copy_function=shutil.copy2) |
|
|
else: |
|
|
else: |
|
|
tarPath = os.path.join(BALLDIR, mtNewLine + ".tar.bz2") |
|
|
tarPath = os.path.join(BALLDIR, mtNewLine + ".tar.bz2") |
|
|
tar = tarfile.open(tarPath) |
|
|
tar = tarfile.open(tarPath) |
|
@ -776,14 +808,14 @@ again. |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Set "$XCFLAGS" (extra compiler flags). |
|
|
# Set "$XCFLAGS" (extra compiler flags). |
|
|
|
|
|
|
|
|
XCFLAGS = "-O2 -I" + INCDIR + "" |
|
|
XCFLAGS = "-O2 -I" + INCDIR |
|
|
if MAKEDEBUG: |
|
|
if MAKEDEBUG: |
|
|
XCFLAGS = XCFLAGS + " -g" |
|
|
XCFLAGS += " -g" |
|
|
if not PORTABLE: |
|
|
if not PORTABLE: |
|
|
XCFLAGS = "-march=native " + XCFLAGS |
|
|
XCFLAGS = "-march=native " + XCFLAGS |
|
|
XCFLAGS = XCFLAGS + " -Wl,-L" + LIBDIR + " -Wl,-R" + LIBDIR |
|
|
XCFLAGS += " -Wl,-L" + LIBDIR + " -Wl,-R" + LIBDIR |
|
|
if os.path.isdir(LIB64DIR): |
|
|
if os.path.isdir(LIB64DIR): |
|
|
XCFLAGS = "$XCFLAGS -Wl,-L" + LIB64DIR + " -Wl,-R" + LIB64DIR |
|
|
XCFLAGS += " -Wl,-L" + LIB64DIR + " -Wl,-R" + LIB64DIR |
|
|
|
|
|
|
|
|
print("XCFLAGS="+XCFLAGS) |
|
|
print("XCFLAGS="+XCFLAGS) |
|
|
|
|
|
|
|
@ -793,17 +825,23 @@ again. |
|
|
WHICH_GCC = which("gcc") |
|
|
WHICH_GCC = which("gcc") |
|
|
WHICH_GPP = which("g++") |
|
|
WHICH_GPP = which("g++") |
|
|
if not isExecutableFile(WHICH_GCC): |
|
|
if not isExecutableFile(WHICH_GCC): |
|
|
customExit("gcc is not present or not executable.") |
|
|
if WHICH_GCC is not None: |
|
|
|
|
|
print("gcc: {}".format(WHICH_GCC)) |
|
|
|
|
|
customExit("gcc is not present or not executable in {}." |
|
|
|
|
|
"".format(os.environ["PATH"])) |
|
|
if not isExecutableFile(WHICH_GPP): |
|
|
if not isExecutableFile(WHICH_GPP): |
|
|
customExit("g++ is not present or not executable.") |
|
|
if WHICH_GPP is not None: |
|
|
|
|
|
print("g++: {}".format(WHICH_GPP)) |
|
|
|
|
|
customExit("g++ is not present or not executable in {}." |
|
|
|
|
|
"".format(os.environ["PATH"])) |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle another "--edgy step". |
|
|
# Handle another "--edgy step". |
|
|
|
|
|
|
|
|
if FlagEdgy: |
|
|
if Flags["edgy"]: |
|
|
CM = 'src/defaultsettings.cpp' |
|
|
CM = 'src/defaultsettings.cpp' |
|
|
# TODO: finish converting this from perl |
|
|
# TODO: finish converting this from perl |
|
|
print("FlagEdgy changing {} is not yet implemented." |
|
|
print("edgy changing {} is not yet implemented." |
|
|
"".format(CM)) |
|
|
"".format(CM)) |
|
|
data = None |
|
|
data = None |
|
|
try: |
|
|
try: |
|
@ -825,10 +863,10 @@ again. |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle "--fakemt4". |
|
|
# Handle "--fakemt4". |
|
|
|
|
|
|
|
|
if FlagFakeMT4: |
|
|
if Flags["fakemt4"]: |
|
|
|
|
|
|
|
|
CM = 'CMakeLists.txt' |
|
|
CM = 'CMakeLists.txt' |
|
|
print("FlagFakeMT4 changing {} is not yet implemented." |
|
|
print("fakemt4 changing {} is not yet implemented." |
|
|
"".format(CM)) |
|
|
"".format(CM)) |
|
|
# TODO: handle fakemt4 |
|
|
# TODO: handle fakemt4 |
|
|
# data = None |
|
|
# data = None |
|
@ -855,9 +893,9 @@ again. |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Handle "--oldproto". |
|
|
# Handle "--oldproto". |
|
|
|
|
|
|
|
|
if FlagOldProto: |
|
|
if Flags["oldproto"]: |
|
|
CM = 'src/network/networkprotocol.h' |
|
|
CM = 'src/network/networkprotocol.h' |
|
|
print("FlagOldProto changing {} is not yet implemented." |
|
|
print("oldproto changing {} is not yet implemented." |
|
|
"".format(CM)) |
|
|
"".format(CM)) |
|
|
# TODO: change protocol in CM: |
|
|
# TODO: change protocol in CM: |
|
|
# data = None |
|
|
# data = None |
|
@ -902,27 +940,33 @@ again. |
|
|
cmdParts.append("-DCMAKE_CXX_FLAGS=\"{}\"".format(XCFLAGS)) |
|
|
cmdParts.append("-DCMAKE_CXX_FLAGS=\"{}\"".format(XCFLAGS)) |
|
|
cmdParts.append("-DCMAKE_C_FLAGS_RELEASE=\"{}\"".format(XCFLAGS)) |
|
|
cmdParts.append("-DCMAKE_C_FLAGS_RELEASE=\"{}\"".format(XCFLAGS)) |
|
|
cmdParts.append("-DCMAKE_CXX_FLAGS_RELEASE=\"{}\"".format(XCFLAGS)) |
|
|
cmdParts.append("-DCMAKE_CXX_FLAGS_RELEASE=\"{}\"".format(XCFLAGS)) |
|
|
|
|
|
print("") |
|
|
|
|
|
print("") |
|
|
|
|
|
print("Running cmake in {}:".format(os.getcwd())) |
|
|
|
|
|
print(" ".join(cmdParts)) |
|
|
|
|
|
print("") |
|
|
|
|
|
print("") |
|
|
RunCmd(cmdParts); |
|
|
RunCmd(cmdParts); |
|
|
|
|
|
|
|
|
# TODO: use some absolute pathnames as the Perl version does |
|
|
# TODO: use some absolute pathnames as the Perl version does |
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Replace some "-l..." switches with absolute pathnames. |
|
|
# Replace some "-l..." switches with absolute pathnames. |
|
|
|
|
|
|
|
|
#cmd = << "END" |
|
|
# cmd = << "END" |
|
|
#sed -e "s:-lIrrlicht:$IRRLICHT_LIBRARY:g" |
|
|
# sed -e "s:-lIrrlicht:$IRRLICHT_LIBRARY:g" |
|
|
#-e "s:-lleveldb:$LEVELDB_LIBRARY:g" |
|
|
# -e "s:-lleveldb:$LEVELDB_LIBRARY:g" |
|
|
#-e "s:-lluajit-5.1:$LUA_LIBRARY:g" |
|
|
# -e "s:-lluajit-5.1:$LUA_LIBRARY:g" |
|
|
#-e "s:-lsqlite3:$SQLITE3_LIBRARY:g" |
|
|
# -e "s:-lsqlite3:$SQLITE3_LIBRARY:g" |
|
|
#END |
|
|
# END |
|
|
#cmd . = << 'END' |
|
|
# cmd . = << 'END' |
|
|
#-i `find . -type f -name link.txt` |
|
|
# -i `find . -type f -name link.txt` |
|
|
#END |
|
|
# END |
|
|
#cmd = &FixStr ( + cmd + ) |
|
|
# cmd = &FixStr ( + cmd + ) |
|
|
#&RunCmd ($cmd); |
|
|
# RunCmd (cmd.split(" ")) #TODO use cmdParts after editing it |
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
|
|
#--------------------------------------------------------------------- |
|
|
# Build the program. |
|
|
# Build the program. |
|
|
NUMJOBS = 2 |
|
|
NUMJOBS = 3 |
|
|
RunCmd(["make", "clean"]) |
|
|
RunCmd(["make", "clean"]) |
|
|
RunCmd("make", "-j{}".format(NUMJOBS)) |
|
|
RunCmd("make", "-j{}".format(NUMJOBS)) |
|
|
serverlistDir = os.path.join(PRODDIR, "client", "serverlist") |
|
|
serverlistDir = os.path.join(PRODDIR, "client", "serverlist") |
|
@ -948,8 +992,8 @@ again. |
|
|
pushd('games'); |
|
|
pushd('games'); |
|
|
cmd = "" |
|
|
cmd = "" |
|
|
gameNames = ["minimal", "amhi_game"] |
|
|
gameNames = ["minimal", "amhi_game"] |
|
|
if not FlagEdgy: |
|
|
if not Flags["edgy"]: |
|
|
# TODO: What does FlagEdgy do here? Does it leave the old |
|
|
# TODO: What does Flags["edgy"] do here? Does it leave the old |
|
|
# Bucket_Game and do nothing else differently? |
|
|
# Bucket_Game and do nothing else differently? |
|
|
# See mtcompile-program.pl |
|
|
# See mtcompile-program.pl |
|
|
gameNames.append("Bucket_Game") |
|
|
gameNames.append("Bucket_Game") |
|
@ -973,7 +1017,7 @@ again. |
|
|
worldPath = os.path.join(WORLDS_PATH, worldName) |
|
|
worldPath = os.path.join(WORLDS_PATH, worldName) |
|
|
if os.path.isdir(worldPath): |
|
|
if os.path.isdir(worldPath): |
|
|
shutil.rmtree(worldPath) |
|
|
shutil.rmtree(worldPath) |
|
|
if FlagEdgy: |
|
|
if Flags["edgy"]: |
|
|
continue |
|
|
continue |
|
|
tarPath = os.path.join(BALLDIR, worldName) |
|
|
tarPath = os.path.join(BALLDIR, worldName) |
|
|
if os.path.isfile(tarPath): |
|
|
if os.path.isfile(tarPath): |
|
@ -1104,7 +1148,7 @@ again. |
|
|
os.utime(ZIPFILE_PATH, (atime, latestStamp)) |
|
|
os.utime(ZIPFILE_PATH, (atime, latestStamp)) |
|
|
|
|
|
|
|
|
print("Done\n") |
|
|
print("Done\n") |
|
|
#end main |
|
|
# end main |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|