2022-06-30 13:23:48 +02:00
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
2022-07-06 13:13:00 +02:00
|
|
|
def can_build(env, platform):
|
|
|
|
return False
|
2022-06-30 13:23:48 +02:00
|
|
|
|
2022-07-06 13:13:00 +02:00
|
|
|
def _can_build():
|
2022-06-30 13:23:48 +02:00
|
|
|
if os.name == "posix" or sys.platform == "darwin":
|
|
|
|
x11_error = os.system("pkg-config --version > /dev/null")
|
|
|
|
if x11_error:
|
|
|
|
return False
|
|
|
|
|
|
|
|
libpg_error = os.system("pkg-config libpq --modversion --silence-errors > /dev/null ")
|
|
|
|
|
|
|
|
if libpg_error:
|
|
|
|
print("postgres not found!")
|
|
|
|
return False
|
|
|
|
|
|
|
|
print("postgres found!")
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
#todo
|
|
|
|
return False
|
|
|
|
|
|
|
|
def configure(env):
|
2022-07-06 13:13:00 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
def _configure(env):
|
2022-06-30 13:23:48 +02:00
|
|
|
env.ParseConfig("pkg-config libpq --cflags --libs")
|
|
|
|
|
|
|
|
env.Append(CPPDEFINES=["PGSQL_PRESENT"])
|
|
|
|
|
|
|
|
# Link those statically for portability
|
|
|
|
#if env["use_static_cpp"]:
|
|
|
|
#env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
|