diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/tet3/tcc/Makefile.am | 3 | ||||
-rw-r--r-- | src/tet3/tcc/tcc.c | 8 | ||||
-rw-r--r-- | xts5/Makefile.am | 9 | ||||
-rwxr-xr-x | xts5/bin/xts-config.in (renamed from xts5/bin/xts-config) | 4 | ||||
-rw-r--r-- | xts5/bin/xts-run.in | 14 |
6 files changed, 27 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index d88bd4fc..5c892dc0 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,9 @@ AM_MAINTAINER_MODE AM_CONFIG_HEADER([config.h]) +# Directory setup +AC_SUBST([DEFAULT_TET_ROOT], ['${datadir}']) + # Checks for programs. AC_DISABLE_STATIC AC_PROG_LIBTOOL @@ -114,7 +117,6 @@ src/tet3/tcm/Makefile src/tet3/tcc/Makefile src/tet3/tcclib/Makefile xts5/Makefile -xts5/bin/xts-run xts5/scenarios/Makefile xts5/src/Makefile xts5/src/lib/Makefile diff --git a/src/tet3/tcc/Makefile.am b/src/tet3/tcc/Makefile.am index fc078aa5..95a0a185 100644 --- a/src/tet3/tcc/Makefile.am +++ b/src/tet3/tcc/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = -I../inc -I$(top_srcdir)/include +AM_CPPFLAGS = -I../inc -I$(top_srcdir)/include \ + -DDEFAULT_TET_ROOT='"$(DEFAULT_TET_ROOT)"' bin_PROGRAMS = tcc tcc_LDADD = ../tcclib/libtcc.la tcc_SOURCES = cleanup.c \ diff --git a/src/tet3/tcc/tcc.c b/src/tet3/tcc/tcc.c index eead1371..290d7069 100644 --- a/src/tet3/tcc/tcc.c +++ b/src/tet3/tcc/tcc.c @@ -100,6 +100,10 @@ char tcc_options[] = "IT:Va:bcef:g:i:j:l:m:n:pr:s:t:v:x:y:"; static void badusage PROTOLIST((void)); static void prversioninfo PROTOLIST((void)); +/* default root directory */ +#ifndef DEFAULT_TET_ROOT +#define DEFAULT_TET_ROOT "/usr/local/share" +#endif int main(argc, argv) int argc; @@ -146,8 +150,8 @@ char **argv; /* determine the tet_root directory */ if ((p = getenv("TET_ROOT")) == (char *) 0 || !*p) { - fatal(0, "TET_ROOT environment variable NULL or not set", - (char *) 0); + strncpy(tet_root, DEFAULT_TET_ROOT, sizeof(tet_root)); + tet_root[sizeof(tet_root) - 1] = '\0'; } else fullpath(cwd, p, tet_root, sizeof tet_root, 0); 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= |