diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-08-27 20:52:43 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-08-28 13:01:31 +1000 |
commit | 339204cccb2930435552f296fe5b9184ad6836af (patch) | |
tree | 2d31436e75cb59ae1dc4442dfa28094d9b1ef193 /autosetup/tmake.tcl | |
parent | 040b3e203807dffc429e1f0f4bbb2af8c2d4f7b3 (diff) | |
download | jimtcl-339204cccb2930435552f296fe5b9184ad6836af.zip jimtcl-339204cccb2930435552f296fe5b9184ad6836af.tar.gz jimtcl-339204cccb2930435552f296fe5b9184ad6836af.tar.bz2 |
Update autosetup to v0.6.5
Adds pkg-config support
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'autosetup/tmake.tcl')
-rw-r--r-- | autosetup/tmake.tcl | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/autosetup/tmake.tcl b/autosetup/tmake.tcl new file mode 100644 index 0000000..b946362 --- /dev/null +++ b/autosetup/tmake.tcl @@ -0,0 +1,52 @@ +# Copyright (c) 2011 WorkWare Systems http://www.workware.net.au/ +# All rights reserved + +# @synopsis: +# +# The 'tmake' module makes it easy to support the tmake build system. +# +# The following variables are set: +# +## CONFIGURED - to indicate that the project is configured + +use system + +module-options {} + +define CONFIGURED + +# @make-tmake-settings outfile patterns ... +# +# Examines all defined variables which match the given patterns (defaults to "*") +# and writes a tmake-compatible .conf file defining those variables. +# For example, if ABC is "3 monkeys" and ABC matches a pattern, then the file will include: +# +## define ABC {3 monkeys} +# +# If the file would be unchanged, it is not written. +# +# Typical usage is: +# +# make-tmake-settings [get-env BUILDDIR objdir]/settings.conf {[A-Z]*} +proc make-tmake-settings {file args} { + file mkdir [file dirname $file] + set lines {} + + if {[llength $args] == 0} { + set args * + } + + foreach n [lsort [dict keys [all-defines]]] { + foreach p $args { + if {[string match $p $n]} { + set value [get-define $n] + lappend lines "define $n [list $value]" + break + } + } + } + set buf [join $lines \n] + write-if-changed $file $buf { + msg-result "Created $file" + } +} |