Remove some unused scons code.

This commit is contained in:
Pentarctagon 2022-05-03 18:22:11 -05:00 committed by Pentarctagon
parent 0aa8dc3c6c
commit 9929d3ca1c
4 changed files with 1 additions and 145 deletions

View File

@ -311,7 +311,7 @@ def Warning(message):
from metasconf import init_metasconf
configure_args = dict(
custom_tests = init_metasconf(env, ["cplusplus", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool", "lua", "gl"]),
custom_tests = init_metasconf(env, ["cplusplus", "sdl", "boost", "cairo", "pango", "pkgconfig", "gettext_tool"]),
config_h = "$build_dir/config.h",
log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp")

View File

@ -1,59 +0,0 @@
# vi: syntax=python:et:ts=4
def CheckOpenGL(context):
context.Message("Checking for OpenGL... ")
env = context.env
backup = env.Clone().Dictionary()
test_program = ""
if env["PLATFORM"] == "win32":
env.AppendUnique(LIBS = ["opengl32"])
test_program += "#include <windows.h>\n#include <GL/gl.h>\n"
elif env["PLATFORM"] == "darwin":
env.AppendUnique(FRAMEWORKS = "OpenGL")
test_program += "#include <OpenGL/gl.h>\n"
else:
env.AppendUnique(LIBS = ["GL"])
test_program += "#include <GL/gl.h>\n"
test_program += "int main()\n{}\n"
if context.TryLink(test_program, ".c"):
context.Result("yes")
return True
else:
env.Replace(**backup)
context.Result("no")
return False
def CheckGLEW(context):
context.Message("Checking for OpenGL Extension Wrangler... ")
env = context.env
backup = env.Clone().Dictionary()
if env["PLATFORM"] == "win32":
env.AppendUnique(LIBS = ["glew32", "opengl32"])
elif env["PLATFORM"] == "darwin":
env.AppendUnique(LIBS = ["GLEW"])
env.AppendUnique(FRAMEWORKS = "OpenGL")
else:
env.AppendUnique(LIBS = ["GLEW", "GL"])
test_program = """
#include <GL/glew.h>
int main()
{
glewInit();
}
"""
if context.TryLink(test_program, ".c"):
context.Result("yes")
return True
else:
env.Replace(**backup)
context.Result("no")
return False
config_checks = { "CheckOpenGL" : CheckOpenGL, "CheckGLEW" : CheckGLEW }

View File

@ -1,42 +0,0 @@
# vi: syntax=python:et:ts=4
from pkgconfig import run_pkg_config
from config_check_utils import find_include
from os.path import join
def CheckLua(context, require_version):
env = context.env
backup = env.Clone().Dictionary()
context.Message("Checking for Lua development files version " + require_version + "... ")
version = ".".join(require_version.split(".")[0:2])
if env.get("luadir"):
env.Append(LIBPATH = ["$luadir"], CPPPATH = ["$luadir/include"], LIBS = "lua" + version)
found = True
else:
found = run_pkg_config(context, "lua >= " + require_version) or run_pkg_config(context, "lua" + version + " >= " + require_version) or run_pkg_config(context, "lua-" + version + " >= " + require_version)
if not found:
try:
prefix, include = find_include([env["prefix"]], "lualib.h", default_prefixes=not env["host"])[0]
found = True
context.Log("Found Lua header " + include + ".\n")
env.Append(LIBPATH = [join(prefix, "lib")], CPPPATH = [join(prefix, "include")], LIBS = ["lua"])
except IndexError:
pass
result = found and context.TryLink("""
#include <lualib.h>
#include <lauxlib.h>
int main() { luaL_newstate(); }
""", ".c")
if result:
context.Result("yes")
return True
else:
context.Result("no")
env.Replace(**backup)
return False
config_checks = { "CheckLua" : CheckLua }

View File

@ -1,43 +0,0 @@
# vi: syntax=python:et:ts=4
import sys, os
from config_check_utils import backup_env, restore_env
import distutils.sysconfig
def exists():
return True
def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kv)
def generate(env):
env.AddMethod(PythonExtension)
def CheckPython(context):
env = context.env
backup = backup_env(env, ["CPPPATH", "LIBPATH", "LIBS"])
context.Message("Checking for Python... ")
env.AppendUnique(CPPPATH = distutils.sysconfig.get_python_inc())
version = distutils.sysconfig.get_config_var("VERSION")
if not version:
version = sys.version[:3]
if env["PLATFORM"] == "win32":
version = version.replace('.', '')
env.AppendUnique(LIBPATH = distutils.sysconfig.get_config_var("LIBDIR") or \
os.path.join(distutils.sysconfig.get_config_var("prefix"), "libs") )
env.AppendUnique(LIBS = "python" + version)
test_program = """
#include <Python.h>
int main()
{
Py_Initialize();
}
\n"""
if context.TryLink(test_program, ".c"):
context.Result("yes")
return True
else:
context.Result("no")
restore_env(context.env, backup)
return False
config_checks = { "CheckPython" : CheckPython }