summaryrefslogtreecommitdiff
path: root/xts5
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2009-10-10 10:29:52 -0700
committerDan Nicholson <dbn.lists@gmail.com>2009-10-10 15:02:19 -0700
commitd7f68d95f3eab032a93a908fae5b027c31caa386 (patch)
tree2b2fa64aa0baf505fa4fed826b7e57bbf1ec8a35 /xts5
parent082a784487223612431ad47969f5fa1481436b3a (diff)
Use a default TET_ROOT when not in the environment
Requiring an environment variable to be set in order to get any behavior is an obnoxious trait. Instead, a sane default TET_ROOT is built into the programs that use it. Users such as "make check" that need more control can continue using the environment variable. The scripts are now substituted from make so that we get full variable resolution.
Diffstat (limited to 'xts5')
-rw-r--r--xts5/Makefile.am9
-rwxr-xr-xxts5/bin/xts-config.in (renamed from xts5/bin/xts-config)4
-rw-r--r--xts5/bin/xts-run.in14
3 files changed, 16 insertions, 11 deletions
diff --git a/xts5/Makefile.am b/xts5/Makefile.am
index 430eb6d1..0e582ce7 100644
--- a/xts5/Makefile.am
+++ b/xts5/Makefile.am
@@ -13,6 +13,15 @@ xts5_DATA = tetexec.cfg.in tet_scen
xts5dir = $(datadir)/xts5
check_DATA = tetexec.cfg
+# Script substitutions
+EDIT = $(SED) -e 's,%bindir%,$(bindir),g' \
+ -e 's,%libexecdir%,$(libexecdir),g' \
+ -e 's,%DEFAULT_TET_ROOT%,$(DEFAULT_TET_ROOT),g'
+bin/xts-config: bin/xts-config.in
+ $(AM_V_GEN)$(EDIT) < $< > $@
+bin/xts-run: bin/xts-run.in
+ $(AM_V_GEN)$(EDIT) < $< > $@
+
# Setup for testing
TCC = $(top_builddir)/src/tet3/tcc/tcc$(EXEEXT)
run_tcc = TET_ROOT='$(TET_ROOT)' $(TCC) -e -a $(abs_builddir) \
diff --git a/xts5/bin/xts-config b/xts5/bin/xts-config.in
index 26fee8c7..0e8db47e 100755
--- a/xts5/bin/xts-config
+++ b/xts5/bin/xts-config.in
@@ -10,13 +10,15 @@ BEGIN
$xset = $ENV{"XSET"} or $xset = "xset";
my $xdpyinfo;
$xdpyinfo = $ENV{"XDPYINFO"} or $xdpyinfo = "xdpyinfo";
+ my $tet_root;
+ $tet_root = $ENV{"TET_ROOT"} or $tet_root = "%DEFAULT_TET_ROOT%";
open(XSET, "$xset q |") or die "$xset q failed, giving up.\n";
while(<XSET>)
{
next unless /^Font Path:/;
<XSET> =~ /^\s*(.*)/;
- $::vars{"XT_FONTPATH"} = $ENV{"TET_ROOT"} . '/xts5/fonts,' . $1;
+ $::vars{"XT_FONTPATH"} = $tet_root . '/xts5/fonts,' . $1;
$::vars{"XT_FONTPATH_GOOD"} = $1;
}
close(XSET);
diff --git a/xts5/bin/xts-run.in b/xts5/bin/xts-run.in
index 54cccbc0..a9a5f62d 100644
--- a/xts5/bin/xts-run.in
+++ b/xts5/bin/xts-run.in
@@ -1,23 +1,17 @@
#!/bin/sh
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-bindir="@bindir@"
-libexecdir="@libexecdir@"
-datarootdir="@datarootdir@"
-datadir="@datadir@"
+bindir="%bindir%"
+libexecdir="%libexecdir%"
xtsexecdir="${libexecdir}/xts5"
+DEFAULT_TET_ROOT="%DEFAULT_TET_ROOT%"
TCC=${TCC-tcc}
PERL=${PERL-perl}
XTS_CONFIG="${XTS_CONFIG-${bindir}/xts-config}"
-TET_ROOT=${TET_ROOT-$datadir}
-export TET_ROOT
-
prog=$0
config=
-config_in="$TET_ROOT/xts5/tetexec.cfg.in"
+config_in="${TET_ROOT-$DEFAULT_TET_ROOT}/xts5/tetexec.cfg.in"
outdir=
scenario=