From fade38d522067d9dfa676d0b915effcc6a526dfb Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sun, 20 Mar 2022 08:56:01 -0400 Subject: [PATCH] Add $SysInclude system variable. --- src/Makefile.in | 2 +- src/globals.h | 9 +++++++++ src/var.c | 1 + tests/test-rem | 2 ++ tests/test.cmp | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 81c4289c..451f6798 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -40,7 +40,7 @@ test: remind @sh ../tests/test-rem .c.o: - @CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $< + @CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -DSYSDIR=$(datarootdir)/remind -I. -I$(srcdir) $< $(REMINDOBJS): $(REMINDHDRS) diff --git a/src/globals.h b/src/globals.h index bc7c569a..f5d47f5b 100644 --- a/src/globals.h +++ b/src/globals.h @@ -227,6 +227,15 @@ EXTERN int MonthDays[] #endif ; +#define XSTR(x) #x +#define STRSYSDIR(x) XSTR(x) + +EXTERN char *SysDir +#ifdef MK_GLOBALS += STRSYSDIR(SYSDIR); +#endif +; + /* The first day of each month expressed as number of days after Jan 1. Second row is for leap years. */ diff --git a/src/var.c b/src/var.c index 869f717d..921e102e 100644 --- a/src/var.c +++ b/src/var.c @@ -836,6 +836,7 @@ static SysVar SysVarArr[] = { {"SortByTime", 0, INT_TYPE, &SortByTime, 0, 0, NULL }, {"SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132, NULL }, {"Sunday", 1, STR_TYPE, &DynamicDayName[6], 0, 0, NULL }, + {"SysInclude", 0, STR_TYPE, &SysDir, 0, 0, NULL }, {"T", 0, SPECIAL_TYPE, trig_date_func, 0, 0, NULL }, {"Td", 0, SPECIAL_TYPE, trig_day_func, 0, 0, NULL }, {"Thursday", 1, STR_TYPE, &DynamicDayName[3], 0, 0, NULL }, diff --git a/tests/test-rem b/tests/test-rem index cb73c4a3..2da2c904 100644 --- a/tests/test-rem +++ b/tests/test-rem @@ -328,6 +328,8 @@ fi ../src/remind -w128 -c ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out ../src/remind -c ../tests/test-addomit.rem 1 Sep 2021 >> ../tests/test.out +# Remove references to SysInclude, which is build-specific +fgrep -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out cmp -s ../tests/test.out ../tests/test.cmp if [ "$?" = "0" ]; then echo "Remind: Acceptance test PASSED" diff --git a/tests/test.cmp b/tests/test.cmp index 12ad68a9..5cda78c3 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -7979,4 +7979,4 @@ February 29 | | | | | | | | | | | | | | | | +----------+----------+----------+----------+----------+----------+----------+ - \ No newline at end of file +