Skip to content

Commit

Permalink
Print Tcl compile flags to understand next steps
Browse files Browse the repository at this point in the history
I think we need to give the linker some useful rpath hints, but I don't know the
structure of the mapping returned from ParseConfig. This is just a debugging
step.
  • Loading branch information
garfieldnate committed Sep 30, 2023
1 parent 9ce5571 commit dad8289
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build_support/tcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,24 @@ def prepare_for_compiling_with_tcl(env, tcl_path_override=None):
env.Append(SHLINKFLAGS=env.Split('$LINKFLAGS -flat_namespace -undefined suppress -fmessage-length=0'))

elif sys.platform.startswith("linux"):
def parse_conf(env, flags, unique=unique):
print(f"{env['INDENT']}Found Tcl with pkg-config: {flags}")
# TODO: grab the library path from the flags and add it below
# # Currently requires Tcl 8.6 b/c it supports multiple threads without manual compilation. The following line
# # hard-codes the path of the current Tcl 8.6 path on this system into the executable (it's used as the first,
# # but not only, search path for the Tcl library)
# # TODO: is this still needed?
# # clone.Append(LINKFLAGS = ['-Wl,-rpath,\''+tcl_libs.abspath+'\''])
return env.MergeFlags(flags, unique)
try:
env.ParseConfig("pkg-config tcl --libs --cflags")
env.ParseConfig("pkg-config tcl --libs --cflags", parse_conf)
except OSError:
print(
f"{env['INDENT']}pkg-config didn't find tcl package; try `apt-get install tcl-dev`"
)
print(f"{env['INDENT']}{NO_TCL_MSG}")
return False
print(f"{env['INDENT']}Found Tcl with pkg-config")


elif sys.platform == "win32":
if tcl_path_override:
Expand Down

0 comments on commit dad8289

Please sign in to comment.