Improve linuxbsd headless building, cleanup build scripts

Now the `linuxbsd` platform can be built headlessly (e.g. without X11
development libraries).

I also cleaned up some weird (old?) usages of the `env` variable which
seem to make no difference and are used nowhere else.
This commit is contained in:
Riteo 2022-07-20 03:42:15 +02:00
parent 5777ec590b
commit a21f8b7c13
4 changed files with 25 additions and 55 deletions

View file

@ -15,47 +15,11 @@ def can_build():
if os.name != "posix" or sys.platform == "darwin":
return False
# Check the minimal dependencies
x11_error = os.system("pkg-config --version > /dev/null")
if x11_error:
pkgconf_error = os.system("pkg-config --version > /dev/null")
if pkgconf_error:
print("Error: pkg-config not found. Aborting.")
return False
x11_error = os.system("pkg-config x11 --modversion > /dev/null")
if x11_error:
print("Error: X11 libraries not found. Aborting.")
return False
x11_error = os.system("pkg-config xcursor --modversion > /dev/null")
if x11_error:
print("Error: Xcursor library not found. Aborting.")
return False
x11_error = os.system("pkg-config xinerama --modversion > /dev/null")
if x11_error:
print("Error: Xinerama library not found. Aborting.")
return False
x11_error = os.system("pkg-config xext --modversion > /dev/null")
if x11_error:
print("Error: Xext library not found. Aborting.")
return False
x11_error = os.system("pkg-config xrandr --modversion > /dev/null")
if x11_error:
print("Error: XrandR library not found. Aborting.")
return False
x11_error = os.system("pkg-config xrender --modversion > /dev/null")
if x11_error:
print("Error: XRender library not found. Aborting.")
return False
x11_error = os.system("pkg-config xi --modversion > /dev/null")
if x11_error:
print("Error: Xi library not found. Aborting.")
return False
return True
@ -219,13 +183,14 @@ def configure(env):
## Dependencies
env.ParseConfig("pkg-config x11 --cflags --libs")
env.ParseConfig("pkg-config xcursor --cflags --libs")
env.ParseConfig("pkg-config xinerama --cflags --libs")
env.ParseConfig("pkg-config xext --cflags --libs")
env.ParseConfig("pkg-config xrandr --cflags --libs")
env.ParseConfig("pkg-config xrender --cflags --libs")
env.ParseConfig("pkg-config xi --cflags --libs")
if env["x11"]:
env.ParseConfig("pkg-config x11 --cflags --libs")
env.ParseConfig("pkg-config xcursor --cflags --libs")
env.ParseConfig("pkg-config xinerama --cflags --libs")
env.ParseConfig("pkg-config xext --cflags --libs")
env.ParseConfig("pkg-config xrandr --cflags --libs")
env.ParseConfig("pkg-config xrender --cflags --libs")
env.ParseConfig("pkg-config xi --cflags --libs")
if env["touch"]:
env.Append(CPPDEFINES=["TOUCH_ENABLED"])
@ -381,8 +346,9 @@ def configure(env):
# No pkgconfig file so far, hardcode expected lib name.
env.Append(LIBS=["glslang", "SPIRV"])
env.Append(CPPDEFINES=["GLES3_ENABLED"])
env.ParseConfig("pkg-config gl --cflags --libs")
if env["opengl3"]:
env.Append(CPPDEFINES=["GLES3_ENABLED"])
env.ParseConfig("pkg-config gl --cflags --libs")
env.Append(LIBS=["pthread"])