changeset 8865:eace5649a8b5

set default value for doc_cache_file variable
author John W. Eaton <jwe@octave.org>
date Wed, 25 Feb 2009 01:24:12 -0500
parents 4d328b8979c8
children 3149112b9412
files ChangeLog Makeconf.in configure.in src/ChangeLog src/defaults.cc src/defaults.h.in
diffstat 6 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Feb 25 06:47:16 2009 +0100
+++ b/ChangeLog	Wed Feb 25 01:24:12 2009 -0500
@@ -1,3 +1,8 @@
+2009-02-25  John W. Eaton  <jwe@octave.org>
+
+	* configure.in (doc_cache_file): New default variable
+	* Makeconf.in (@doc_cache_file, do-subst-default-vals): Substitute it.
+
 2009-02-24  John W. Eaton  <jwe@octave.org>
 
 	* run-octave.in (DOCFILE): New variable.  Pass --doc-cache-file
--- a/Makeconf.in	Wed Feb 25 06:47:16 2009 +0100
+++ b/Makeconf.in	Wed Feb 25 01:24:12 2009 -0500
@@ -312,10 +312,13 @@
 man1dir = @man1dir@
 man1ext = @man1ext@
 
+# The full path to the default doc cache file.
+doc_cache_file = @doc_cache_file@
+
 # Where to install and expect the info files describing Octave..
 infodir = @infodir@
 
-# The fill path to the default info file.
+# The full path to the default info file.
 infofile = @infofile@
 
 # ==================== Octave-specific directories ====================
@@ -567,6 +570,7 @@
   -e "s|%OCTAVE_DATADIR%|\"${datadir}\"|" \
   -e "s|%OCTAVE_DATAROOTDIR%|\"${datarootdir}\"|" \
   -e "s|%OCTAVE_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
+  -e "s|%OCTAVE_DOC_CACHE_FILE%|\"${doc_cache_file}\"|" \
   -e "s|%OCTAVE_EXEC_PREFIX%|\"${exec_prefix}\"|" \
   -e "s|%OCTAVE_FCNFILEDIR%|\"${fcnfiledir}\"|" \
   -e "s|%OCTAVE_IMAGEDIR%|\"${imagedir}\"|" \
--- a/configure.in	Wed Feb 25 06:47:16 2009 +0100
+++ b/configure.in	Wed Feb 25 01:24:12 2009 -0500
@@ -88,6 +88,7 @@
 
 OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1')
 OCTAVE_SET_DEFAULT(man1ext, '.1')
+OCTAVE_SET_DEFAULT(doc_cache_file, '$(octetcdir)/DOC')
 OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info')
 OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)')
 OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m')
--- a/src/ChangeLog	Wed Feb 25 06:47:16 2009 +0100
+++ b/src/ChangeLog	Wed Feb 25 01:24:12 2009 -0500
@@ -1,5 +1,9 @@
 2009-02-25  John W. Eaton  <jwe@octave.org>
 
+	* defaults.h.in (OCTAVE_DOC_CACHE_FILE): New macro.
+	* defaults.cc (set_default_doc_cache_file): New function.
+	(install_defaults): Call it.
+
 	* help.cc (__list_functions__): Simplify
 
 	* input.cc (get_debug_input): Don't pass arbitrary input to
--- a/src/defaults.cc	Wed Feb 25 06:47:16 2009 +0100
+++ b/src/defaults.cc	Wed Feb 25 01:24:12 2009 -0500
@@ -278,6 +278,16 @@
 }
 
 static void
+set_default_doc_cache_file (void)
+{
+  std::string def_file = subst_octave_home (OCTAVE_DOC_CACHE_FILE);
+
+  std::string env_file = octave_env::getenv ("OCTAVE_DOC_CACHE_FILE");
+
+  Vdoc_cache_file = env_file.empty () ? def_file : env_file;
+}
+
+static void
 set_default_info_file (void)
 {
   std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE);
@@ -375,6 +385,8 @@
 
   set_image_path ();
 
+  set_default_doc_cache_file ();
+
   set_default_info_file ();
 
   set_default_info_prog ();
--- a/src/defaults.h.in	Wed Feb 25 06:47:16 2009 +0100
+++ b/src/defaults.h.in	Wed Feb 25 01:24:12 2009 -0500
@@ -53,6 +53,10 @@
 #define OCTAVE_DATAROOTDIR %OCTAVE_DATAROOTDIR%
 #endif
 
+#ifndef OCTAVE_DOC_CACHE_FILE
+#define OCTAVE_DOC_CACHE_FILE %OCTAVE_DOC_CACHE_FILE%
+#endif
+
 #ifndef OCTAVE_EXEC_PREFIX
 #define OCTAVE_EXEC_PREFIX %OCTAVE_EXEC_PREFIX%
 #endif