aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile.am11
-rw-r--r--bootstrap.am1
-rw-r--r--configure.ac7
-rw-r--r--doc/sciteco.1.in21
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/lexer.tes (renamed from lexer.tes)0
-rw-r--r--src/Makefile.am2
-rw-r--r--src/main.cpp6
-rw-r--r--teco.ini (renamed from teco.ini.in)2
9 files changed, 40 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index db0a39b..e94317d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,16 +1,11 @@
-include $(top_srcdir)/bootstrap.am
+SUBDIRS = src lib doc
-SUBDIRS = src doc
-
-pkgdata_DATA = teco.ini
-EXTRA_DIST = teco.ini.in
-CLEANFILES = teco.ini
-dist_pkgdata_DATA = lexer.tes
+dist_pkgdata_DATA = teco.ini
noinst_HEADERS = compat/bsd/sys/cdefs.h \
compat/bsd/sys/queue.h \
compat/bsd/sys/tree.h
-EXTRA_DIST += patches/scintilla-teco-control-codes.patch
+EXTRA_DIST = patches/scintilla-teco-control-codes.patch
EXTRA_DIST += TODO
diff --git a/bootstrap.am b/bootstrap.am
index dabf475..2fc6285 100644
--- a/bootstrap.am
+++ b/bootstrap.am
@@ -11,6 +11,7 @@ SUBST_MACRO = eb$<\e \
<fs@PACKAGE_URL^Q@\e@PACKAGE_URL@\e;>j \
<fs@bindir^Q@\e$(bindir)\e;>j \
<fs@pkgdatadir^Q@\e$(pkgdatadir)\e;>j \
+ <fs@scitecopathdir^Q@\e$(scitecopathdir)\e;>j \
<fs@DATE^Q@\e$(shell @DATE@ "+%d %b %Y")\e;>j \
ew$@\e
diff --git a/configure.ac b/configure.ac
index 4a9d500..f3da0b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,10 @@ AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
+# Standard macro path ($SCITECOPATH)
+scitecopathdir=$datadir/$PACKAGE/lib
+AC_SUBST(scitecopathdir)
+
# Checks for programs.
LT_INIT
AC_PROG_CXX
@@ -154,5 +158,6 @@ AC_ARG_ENABLE(bootstrap,
[bootstrap=$enableval])
AM_CONDITIONAL(BOOTSTRAP, [test x$bootstrap = xyes])
-AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([src/Makefile lib/Makefile doc/Makefile])
AC_OUTPUT
diff --git a/doc/sciteco.1.in b/doc/sciteco.1.in
index 8e9b88f..ea28c98 100644
--- a/doc/sciteco.1.in
+++ b/doc/sciteco.1.in
@@ -128,6 +128,27 @@ Default is
batch mode processing.
.
.
+.SH ENVIRONMENT
+.
+Before \*(ST executes any macro, all of the variables in the process
+environment are inserted into the global
+.I Q-Register
+table.
+A dollar sign is prepended before each variable name, so that for
+instance the variable \(lqHOME\(rq can be examined by macros by
+reading the string-content of Q-Register \(lq$HOME\(rq.
+The following environment variables have a special meaning for
+\*(ST:
+.TP
+.B SCITECOPATH
+Standard library macro path.
+Macros can expect to find standard library macros in this
+directory.
+Therefore if undefined it defaults to the standard library
+installation directory
+.BR "@scitecopathdir@" .
+.
+.
.SH FILES
.
.TP
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..89c5e94
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,2 @@
+
+dist_scitecopath_DATA = lexer.tes
diff --git a/lexer.tes b/lib/lexer.tes
index cc8dffb..cc8dffb 100644
--- a/lexer.tes
+++ b/lib/lexer.tes
diff --git a/src/Makefile.am b/src/Makefile.am
index 9f40524..60cb387 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/bootstrap.am
AM_CFLAGS = -Wall -std=c99
AM_CXXFLAGS = -Wall
-AM_CPPFLAGS =
+AM_CPPFLAGS = -D'DEFAULT_SCITECOPATH="@scitecopathdir@"'
if NEED_COMPAT
AM_CPPFLAGS += -I@top_srcdir@/compat
endif
diff --git a/src/main.cpp b/src/main.cpp
index c1da584..2834709 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -168,7 +168,11 @@ process_options(int &argc, char **&argv)
static inline void
initialize_environment(void)
{
- gchar **environ = g_get_environ();
+ gchar **environ;
+
+ g_setenv("SCITECOPATH", DEFAULT_SCITECOPATH, FALSE);
+
+ environ = g_get_environ();
for (gchar **p = environ; *p; p++) {
gchar *value = strchr(*p, '=') + 1;
diff --git a/teco.ini.in b/teco.ini
index fcf344a..5b4c752 100644
--- a/teco.ini.in
+++ b/teco.ini
@@ -1,6 +1,6 @@
! TECO.INI !
-EQ0@pkgdatadir@/lexer.tes
+EQ0Q{$SCITECOPATH}/lexer.tes
@1{
! lexer.tes calls this !
}