a9dae95
diff -u --recursive festival-vanilla/examples/benchmark festival/examples/benchmark
a9dae95
--- festival-vanilla/examples/benchmark	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/benchmark	2018-09-06 20:37:22.855868107 -0400
a9dae95
@@ -1,6 +1,7 @@
a9dae95
 #!/bin/sh
a9dae95
 
a9dae95
-default_libdir="/projects/festival/lib"
a9dae95
+default_libdir="/usr/share/festival"
a9dae95
+default_datadir="/usr/share/festival"
a9dae95
 
a9dae95
 while true
a9dae95
 	do
a9dae95
@@ -11,13 +12,17 @@
a9dae95
 	-l ) libdir="$2"
a9dae95
 		shift 2
a9dae95
 		;;
a9dae95
+	-d ) datadir="$2"
a9dae95
+		shift 2
a9dae95
+		;;
a9dae95
+	-- ) shift; break ;;
a9dae95
 	* ) break;;
a9dae95
 	esac
a9dae95
 done
a9dae95
 
a9dae95
-text=${1-"$HOME/projects/festival/examples/benchmark.text"}
a9dae95
+text=${1-"/usr/share/doc/festival/examples/benchmark.text"}
a9dae95
 
a9dae95
-for i in . src/main ../src/main $HOME/projects/festival/src/main /cstr/bin
a9dae95
+for i in /usr/bin . src/main ../src/main $HOME/projects/festival/src/main /cstr/bin
a9dae95
 	do
a9dae95
 	if [ -n "$festival" ]
a9dae95
 		then
a9dae95
@@ -39,7 +44,15 @@
a9dae95
 	then
a9dae95
 	case $festival in 
a9dae95
 	*main/festival )	libdir=`dirname $festival`/../../lib;;
a9dae95
-	* ) libdir=$default_libdir;;
a9dae95
+	* ) libdir=$default_libdir;
a9dae95
+	esac
a9dae95
+fi
a9dae95
+
a9dae95
+if [ -z "$datadir" ]
a9dae95
+	then
a9dae95
+	case $festival in 
a9dae95
+	*main/festival )   datadir=`dirname $festival`/../../share;;
a9dae95
+	* ) datadir=$default_datadir;;
a9dae95
 	esac
a9dae95
 fi
a9dae95
 
a9dae95
@@ -54,10 +67,11 @@
a9dae95
 cat > $script <<__END__
a9dae95
 
a9dae95
 (set! libdir "$libdir/")
a9dae95
-(set! lexdir "$default_libdir/dicts/")
a9dae95
-(set! voiced_dir "$default_libdir/voices/")
a9dae95
+(set! datadir "$datadir/")
a9dae95
+(set! lexdir "$default_datadir/dicts/")
a9dae95
+(set! voiced_dir "$default_datadir/voices/")
a9dae95
 
a9dae95
-(load (string-append libdir "init.scm"))
a9dae95
+(load (string-append datadir "init.scm"))
a9dae95
 (if (probe_file (format nil "%s/.festivalrc" (getenv "HOME")))
a9dae95
     (load (format nil "%s/.festivalrc" (getenv "HOME"))))
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/examples/benchmark.text festival/examples/benchmark.text
a9dae95
--- festival-vanilla/examples/benchmark.text	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/benchmark.text	2018-09-06 20:37:22.855868107 -0400
a9dae95
@@ -32,8 +32,13 @@
a9dae95
 
a9dae95
      --libdir PATH
a9dae95
 	     Specify alternate to default library directory (used
a9dae95
-	     in	 initializing  the  variable  load-path,  and for
a9dae95
-	     loading most intinialisation files)
a9dae95
+	     for architecture-specific libraries and programs)
a9dae95
+
a9dae95
+     --datadir PATH
a9dae95
+	     Specify alternate to default shared-data directory (used
a9dae95
+	     in	 initializing the  variable  load-path,  and for
a9dae95
+	     loading most initialisation files). Typically, the voice and
a9dae95
+		 dictionary files reside here.
a9dae95
 
a9dae95
      -b	or --batch
a9dae95
 	     Run in batch mode.	 In batch mode no input	 is  read
a9dae95
diff -u --recursive festival-vanilla/examples/dumpfeats.sh festival/examples/dumpfeats.sh
a9dae95
--- festival-vanilla/examples/dumpfeats.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/dumpfeats.sh	2018-09-06 20:37:22.855868107 -0400
a9dae95
@@ -39,7 +39,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file it has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (define (dumpfeats_help)
a9dae95
   (format t "%s\n"
a9dae95
diff -u --recursive festival-vanilla/examples/durmeanstd.sh festival/examples/durmeanstd.sh
a9dae95
--- festival-vanilla/examples/durmeanstd.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/durmeanstd.sh	2018-09-06 20:37:22.856868112 -0400
a9dae95
@@ -40,7 +40,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file it has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (define (durmeanstd_help)
a9dae95
   (format t "%s\n"
a9dae95
diff -u --recursive festival-vanilla/examples/latest.sh festival/examples/latest.sh
a9dae95
--- festival-vanilla/examples/latest.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/latest.sh	2018-09-06 20:37:22.854868102 -0400
a9dae95
@@ -50,7 +50,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file I has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (audio_mode 'async)  ;; play waves while continuing synthesis
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/examples/Makefile festival/examples/Makefile
a9dae95
--- festival-vanilla/examples/Makefile	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/Makefile	2018-09-06 20:37:22.860868131 -0400
a9dae95
@@ -54,8 +54,9 @@
a9dae95
 
a9dae95
 $(ALL) : % : %.sh
a9dae95
 	rm -f $@
a9dae95
-	@echo "#!/bin/sh" >$@
a9dae95
-	@echo "\"true\" ; exec "$(FESTIVAL_HOME)/bin/festival --script '$$0 $$*' >>$@
a9dae95
+	@echo "#!/usr/bin/festival --script" >$@
a9dae95
+#	@echo "#!/bin/sh" >$@
a9dae95
+#	@echo "\"true\" ; exec "/usr/bin/festival --script '$$0 $$*' >>$@
a9dae95
 	cat $< >>$@
a9dae95
 	chmod +x $@
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/examples/make_utts.sh festival/examples/make_utts.sh
a9dae95
--- festival-vanilla/examples/make_utts.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/make_utts.sh	2018-09-06 20:37:22.854868102 -0400
a9dae95
@@ -44,7 +44,7 @@
a9dae95
 ;;; Because this is a --script type file it has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
 (if (not (symbol-bound? 'caar))
a9dae95
-    (load (path-append libdir "init.scm")))
a9dae95
+    (load (path-append datadir "init.scm")))
a9dae95
 
a9dae95
 ;;;  Some parts are potentially editable
a9dae95
 (defvar basic_relations '((Phrase segmental ())
a9dae95
diff -u --recursive festival-vanilla/examples/saytime.sh festival/examples/saytime.sh
a9dae95
--- festival-vanilla/examples/saytime.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/saytime.sh	2018-09-06 20:37:22.856868112 -0400
a9dae95
@@ -44,7 +44,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file I has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (define (get-the-time)
a9dae95
 "Returns a list of hour and minute and second, for later processing"
a9dae95
diff -u --recursive festival-vanilla/examples/scfg_parse_text.sh festival/examples/scfg_parse_text.sh
a9dae95
--- festival-vanilla/examples/scfg_parse_text.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/scfg_parse_text.sh	2018-09-06 20:37:22.856868112 -0400
a9dae95
@@ -45,7 +45,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file I has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (require 'scfg)
a9dae95
 
a9dae95
@@ -66,7 +66,7 @@
a9dae95
 (gc-status nil)
a9dae95
 
a9dae95
 ;;; Default argument values
a9dae95
-(defvar grammarfile (path-append libdir "scfg_wsj_wp20.gram"))
a9dae95
+(defvar grammarfile (path-append datadir "scfg_wsj_wp20.gram"))
a9dae95
 (defvar outfile "-")
a9dae95
 (defvar outfd t)
a9dae95
 (defvar parse_type 'brackets_only)
a9dae95
diff -u --recursive festival-vanilla/examples/text2pos.sh festival/examples/text2pos.sh
a9dae95
--- festival-vanilla/examples/text2pos.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/text2pos.sh	2018-09-06 20:37:22.856868112 -0400
a9dae95
@@ -50,7 +50,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file I has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 (define (find-pos utt)
a9dae95
 "Main function for processing TTS utterances.  Predicts POS and
a9dae95
diff -u --recursive festival-vanilla/examples/text2wave.sh festival/examples/text2wave.sh
a9dae95
--- festival-vanilla/examples/text2wave.sh	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/examples/text2wave.sh	2018-09-06 20:37:22.857868117 -0400
a9dae95
@@ -40,7 +40,7 @@
a9dae95
 
a9dae95
 ;;; Because this is a --script type file I has to explicitly
a9dae95
 ;;; load the initfiles: init.scm and user's .festivalrc
a9dae95
-(load (path-append libdir "init.scm"))
a9dae95
+(load (path-append datadir "init.scm"))
a9dae95
 
a9dae95
 ;;; Process command line arguments
a9dae95
 (define (text2wave_help)
a9dae95
diff -u --recursive festival-vanilla/lib/festival.scm festival/lib/festival.scm
a9dae95
--- festival-vanilla/lib/festival.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/festival.scm	2018-09-06 20:37:22.858868122 -0400
a9dae95
@@ -552,13 +552,13 @@
a9dae95
 (define (intro)
a9dae95
 "(intro)
a9dae95
  Synthesize an introduction to the Festival Speech Synthesis System."
a9dae95
-  (tts (path-append libdir "../examples/intro.text") nil))
a9dae95
+  (tts (path-append datadir "/usr/share/doc/festival/examples/intro.text") nil))
a9dae95
 
a9dae95
 (define (intro-spanish)
a9dae95
 "(intro-spanish)
a9dae95
  Synthesize an introduction to the Festival Speech Synthesis System
a9dae95
  in spanish.  Spanish voice must already be selected for this."
a9dae95
-  (tts (path-append libdir "../examples/spintro.text") nil))
a9dae95
+  (tts (path-append datadir "/usr/share/doc/festival/examples/spintro.text") nil))
a9dae95
 
a9dae95
 (define (na_play FILENAME)
a9dae95
 "(play_wave FILENAME)
a9dae95
diff -u --recursive festival-vanilla/lib/init.scm festival/lib/init.scm
a9dae95
--- festival-vanilla/lib/init.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/init.scm	2018-09-06 20:37:22.852868092 -0400
a9dae95
@@ -36,7 +36,7 @@
a9dae95
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a9dae95
 
a9dae95
 ;;;  Basic siod library (need this before load_library or require works)
a9dae95
-(load (path-append libdir "siod.scm"))
a9dae95
+(load (path-append datadir "siod.scm"))
a9dae95
 
a9dae95
 (defvar home-directory (or (getenv "HOME") "/")
a9dae95
   "home-directory
a9dae95
diff -u --recursive festival-vanilla/lib/lexicons.scm festival/lib/lexicons.scm
a9dae95
--- festival-vanilla/lib/lexicons.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/lexicons.scm	2018-09-06 20:37:22.858868122 -0400
a9dae95
@@ -42,10 +42,10 @@
a9dae95
 ;;;  you should set lexdir in sitevars.scm
a9dae95
 
a9dae95
 (defvar lexdir 
a9dae95
-  (if (probe_file (path-append libdir "dicts"))
a9dae95
-      (path-append libdir "dicts/")
a9dae95
+  (if (probe_file (path-append datadir "dicts"))
a9dae95
+      (path-append datadir "dicts/")
a9dae95
       ;; else we'll guess we're in the CSTR filespace
a9dae95
-      (path-as-directory "/projects/festival/lib/dicts/"))
a9dae95
+      (path-as-directory "/usr/share/festival/dicts/"))
a9dae95
   "lexdir
a9dae95
   The directory where the lexicon(s) are, by default.")
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/lib/phrase.scm festival/lib/phrase.scm
a9dae95
--- festival-vanilla/lib/phrase.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/phrase.scm	2018-09-06 20:37:22.857868117 -0400
a9dae95
@@ -93,7 +93,7 @@
a9dae95
 
a9dae95
 (require 'pos)   ;; for part of speech map
a9dae95
 
a9dae95
-(defvar pbreak_ngram_dir libdir
a9dae95
+(defvar pbreak_ngram_dir datadir
a9dae95
   "pbreak_ngram_dir
a9dae95
   The directory containing the ngram models for predicting phrase
a9dae95
   breaks.  By default this is the standard library directory.")
a9dae95
diff -u --recursive festival-vanilla/lib/soleml-mode.scm festival/lib/soleml-mode.scm
a9dae95
--- festival-vanilla/lib/soleml-mode.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/soleml-mode.scm	2018-09-06 20:37:22.857868117 -0400
a9dae95
@@ -330,7 +330,7 @@
a9dae95
        (list 'exit_func soleml_exit_func)
a9dae95
        '(analysis_type xxml)
a9dae95
        (list 'filter 
a9dae95
-	     (format nil "%s -D %s " sgml_parse_progname libdir))))
a9dae95
+	     (format nil "%s -D %s " sgml_parse_progname datadir))))
a9dae95
     tts_text_modes))
a9dae95
 
a9dae95
 (provide 'soleml-mode)
a9dae95
diff -u --recursive festival-vanilla/lib/voices.scm festival/lib/voices.scm
a9dae95
--- festival-vanilla/lib/voices.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/lib/voices.scm	2018-09-06 20:37:22.853868097 -0400
a9dae95
@@ -42,7 +42,7 @@
a9dae95
 ;; The path to search for voices is created from the load-path with
a9dae95
 ;; an extra list of directories appended.
a9dae95
 
a9dae95
-(defvar system-voice-path '( )
a9dae95
+(defvar system-voice-path '("/usr/share/festival/voices/")
a9dae95
   "system-voice-path
a9dae95
    Additional directory not near the load path where voices can be
a9dae95
    found, this can be redefined in lib/sitevars.scm if desired.")
a9dae95
diff -u --recursive festival-vanilla/src/arch/festival/audspio.cc festival/src/arch/festival/audspio.cc
a9dae95
--- festival-vanilla/src/arch/festival/audspio.cc	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/src/arch/festival/audspio.cc	2018-09-06 20:37:22.859868126 -0400
a9dae95
@@ -108,7 +108,7 @@
a9dae95
 	{
a9dae95
 	    audio = ft_get_param("Audio_Method");
a9dae95
 	    command = ft_get_param("Audio_Command");
a9dae95
-	    audfds = pipe_open("audsp");
a9dae95
+	    audfds = pipe_open("/usr/libexec/festival/audsp");
a9dae95
 	    if (audio != NIL)
a9dae95
 		audsp_send(EST_String("method ")+get_c_string(audio));
a9dae95
 	    if (command != NIL)
a9dae95
diff -u --recursive festival-vanilla/src/arch/festival/festival.cc festival/src/arch/festival/festival.cc
a9dae95
--- festival-vanilla/src/arch/festival/festival.cc	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/src/arch/festival/festival.cc	2018-09-06 20:37:22.859868126 -0400
a9dae95
@@ -60,6 +60,9 @@
a9dae95
 #define STRINGIZE(S) _S_S_S(S)
a9dae95
 
a9dae95
 const char *festival_version =  STRINGIZE(FTVERSION) ":" STRINGIZE(FTSTATE) " " STRINGIZE(FTDATE);
a9dae95
+const char *festival_libdir = "/usr/share/festival";
a9dae95
+const char *festival_datadir = "/usr/share/festival";
a9dae95
+const char *festival_sysconfdir = "/etc";
a9dae95
 
a9dae95
 // Allow the path to be passed in without quotes because Windoze command line
a9dae95
 // is stupid
a9dae95
@@ -79,7 +82,6 @@
a9dae95
 #define FTOSTYPE ""
a9dae95
 #endif
a9dae95
 
a9dae95
-const char *festival_libdir = FTLIBDIR;
a9dae95
 ostream *cdebug;
a9dae95
 static int festival_server_port = 1314;
a9dae95
 static EST_StrList sub_copyrights;
a9dae95
@@ -308,7 +310,7 @@
a9dae95
     EST_String userinitfile, home_str, initfile;
a9dae95
 
a9dae95
     // Load library init first
a9dae95
-    initfile = (EST_String)EST_Pathname(festival_libdir).as_directory() + 
a9dae95
+    initfile = (EST_String)EST_Pathname(festival_datadir).as_directory() +
a9dae95
 	"init.scm";
a9dae95
     if (access((const char *)initfile,R_OK) == 0)
a9dae95
 	vload(initfile,FALSE);
a9dae95
@@ -324,6 +326,8 @@
a9dae95
     int major,minor,subminor;
a9dae95
     
a9dae95
     siod_set_lval("libdir",strintern(festival_libdir));
a9dae95
+    siod_set_lval("datadir",strintern(festival_datadir));
a9dae95
+    siod_set_lval("sysconfdir",strintern(festival_sysconfdir));
a9dae95
     if (!streq(FTOSTYPE,""))
a9dae95
 	siod_set_lval("*ostype*",cintern(FTOSTYPE));
a9dae95
     siod_set_lval("festival_version",
a9dae95
@@ -357,6 +361,7 @@
a9dae95
     if (mplayer_supported)
a9dae95
 	proclaim_module("mplayeraudio");
a9dae95
     
a9dae95
+#if 0 /* /usr/lib/festival/etc/machine -- ??? */
a9dae95
     // Add etc-dir path and machine specific directory etc/$OSTYPE
a9dae95
     char *etcdir = walloc(char,strlen(festival_libdir)+strlen("etc/")+
a9dae95
 			  strlen(FTOSTYPE)+3);
a9dae95
@@ -377,6 +382,7 @@
a9dae95
     
a9dae95
     wfree(etcdir);
a9dae95
     wfree(etcdircommon);
a9dae95
+#endif
a9dae95
     return;
a9dae95
 }
a9dae95
 
a9dae95
Only in festival/src/arch/festival: festival.cc.orig
a9dae95
diff -u --recursive festival-vanilla/src/arch/festival/Makefile festival/src/arch/festival/Makefile
a9dae95
--- festival-vanilla/src/arch/festival/Makefile	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/src/arch/festival/Makefile	2018-09-06 20:37:22.858868122 -0400
a9dae95
@@ -62,6 +62,6 @@
a9dae95
 LOCAL_INCLUDES += $(FESTIVAL_INCLUDES)
a9dae95
 
a9dae95
 festival.o: festival.cc
a9dae95
-	$(CXX_COMMAND_TEMPLATES) -DFTNAME='$(PROJECT_NAME)' -DFTLIBDIRC='$(FTLIBDIR)' -DFTVERSION='$(PROJECT_VERSION)' -DFTSTATE='$(PROJECT_STATE)'  -DFTDATE='$(PROJECT_DATE)' -DFTOSTYPE=\"$(SYSTEM_TYPE)\" festival.cc
a9dae95
+	$(CXX_COMMAND_TEMPLATES) -DFTNAME='$(PROJECT_NAME)' -DFTVERSION='$(PROJECT_VERSION)' -DFTSTATE='$(PROJECT_STATE)'  -DFTDATE='$(PROJECT_DATE)' -DFTOSTYPEC='$(SYSTEM_TYPE)' festival.cc
a9dae95
 
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/src/include/festival.h festival/src/include/festival.h
a9dae95
--- festival-vanilla/src/include/festival.h	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/src/include/festival.h	2018-09-06 20:37:22.854868102 -0400
a9dae95
@@ -138,6 +138,7 @@
a9dae95
 void add_item_features(EST_Item *s,LISP features);
a9dae95
 
a9dae95
 extern const char *festival_libdir;
a9dae95
+extern const char *festival_datadir;
a9dae95
 
a9dae95
 //  Module specific LISP/etc definitions
a9dae95
 void festival_init_modules(void);
a9dae95
diff -u --recursive festival-vanilla/src/main/festival_main.cc festival/src/main/festival_main.cc
a9dae95
--- festival-vanilla/src/main/festival_main.cc	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/src/main/festival_main.cc	2018-09-06 20:37:22.853868097 -0400
a9dae95
@@ -88,6 +88,8 @@
a9dae95
         "In evaluation mode \"filenames\" starting with ( are evaluated inline\n"+
a9dae95
 	"Festival Speech Synthesis System: "+ festival_version +"\n"+
a9dae95
 	"-q            Load no default setup files\n"+
a9dae95
+	"--datadir <string>\n"+
a9dae95
+	"              Set data directory pathname\n"+
a9dae95
 	"--libdir <string>\n"+
a9dae95
         "              Set library directory pathname\n"+
a9dae95
         "-b            Run in batch mode (no interaction)\n"+
a9dae95
@@ -127,6 +129,12 @@
a9dae95
 	festival_libdir = wstrdup(al.val("--libdir"));
a9dae95
     else if (getenv("FESTLIBDIR") != 0)
a9dae95
 	festival_libdir = getenv("FESTLIBDIR");
a9dae95
+
a9dae95
+    if (al.present("--datadir"))
a9dae95
+	festival_datadir = wstrdup(al.val("--datadir"));
a9dae95
+    else if (getenv("FESTDATADIR") != 0)
a9dae95
+	festival_datadir = getenv("FESTDATADIR");
a9dae95
+
a9dae95
     if (al.present("--heap"))
a9dae95
 	heap_size = al.ival("--heap");
a9dae95
 
a9dae95
diff -u --recursive festival-vanilla/testsuite/data/modes.scm festival/testsuite/data/modes.scm
a9dae95
--- festival-vanilla/testsuite/data/modes.scm	2017-09-04 11:54:08.000000000 -0400
a9dae95
+++ festival/testsuite/data/modes.scm	2018-09-06 20:37:22.853868097 -0400
a9dae95
@@ -42,13 +42,13 @@
a9dae95
 
a9dae95
 (format t "\n\nSABLE mode\n")
a9dae95
 (unwind-protect
a9dae95
- (tts (string-append libdir "/../examples/example2.sable") nil))
a9dae95
+ (tts "/usr/share/doc/festival/examples/example2.sable" 'sable))
a9dae95
 (format t "\n\nOGI's mark up mode\n")
a9dae95
 (unwind-protect 
a9dae95
- (tts (string-append libdir "/../examples/ex1.ogi") 'ogimarkup))
a9dae95
+ (tts "/usr/share/doc/festival/examples/ex1.ogi" 'ogimarkup))
a9dae95
 (format t "\n\nAn email mode\n")
a9dae95
 (unwind-protect
a9dae95
- (tts (string-append libdir "/../examples/ex1.email") nil))
a9dae95
+ (tts "/usr/share/doc/festival/examples/ex1.email" nil))
a9dae95
 
a9dae95
 (voice_kal_diphone)
a9dae95
 (format t "\n\nA singing mode\n")