Index: /trunk/psLib/config/psTime.config.template
===================================================================
--- /trunk/psLib/config/psTime.config.template	(revision 3219)
+++ /trunk/psLib/config/psTime.config.template	(revision 3220)
@@ -1,4 +1,4 @@
 # This configuration file specifies values required for time calculations by psLib.
-psLib.time.tables.dir STR PREFIX/data                                                   # Directory for time tables
+psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
 psLib.time.tables.n S32 4                                                               # Number of time tables
 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 3219)
+++ /trunk/psLib/configure.ac	(revision 3220)
@@ -150,7 +150,5 @@
 
 CFLAGS="${CFLAGS=} -Wall -Werror"
-CFLAGS="${CFLAGS=}  -DCONFIG_FILE=\\\"$sysconfdir/pslib/psTime.config\\\""
-CFLAGS="${CFLAGS=}  -DXML_CONFIG_FILE=\\\"$sysconfdir/pslib/psTime.xml\\\""
-CFLAGS="${CFLAGS=}  -DUTC_DAT_FILE=\\\"$datadir/pslib/tai_utc.dat\\\""
+CFLAGS="${CFLAGS=}  -DPS_CONFIG_FILE_DEFAULT=\\\"$sysconfdir/pslib/psTime.config\\\""
 
 
Index: /trunk/psLib/etc/pslib/psTime.config.template
===================================================================
--- /trunk/psLib/etc/pslib/psTime.config.template	(revision 3219)
+++ /trunk/psLib/etc/pslib/psTime.config.template	(revision 3220)
@@ -1,4 +1,4 @@
 # This configuration file specifies values required for time calculations by psLib.
-psLib.time.tables.dir STR PREFIX/data                                                   # Directory for time tables
+psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
 psLib.time.tables.n S32 4                                                               # Number of time tables
 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 3219)
+++ /trunk/psLib/src/astro/psTime.c	(revision 3220)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-10 02:36:41 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -74,4 +74,5 @@
 psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
 
+
 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
  *  terminated copy of the original input string. */
@@ -133,4 +134,17 @@
     return cleanToken;
 }
+
+// get the psTime.config filename by checking environment variable first, then original installation area.
+char* p_psGetConfigFileName()
+{
+    char* filename = getenv("PS_CONFIG_FILE");
+
+    if (filename == NULL) { // environment variable not found
+        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
+    }
+
+    return filename;
+}
+
 
 /** Searches time tables in priority order and performs interpolation if input index value is within a table.
@@ -148,5 +162,5 @@
     // Check time metadata. Function call reports errors.
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE))
+        if(!p_psTimeInit(p_psGetConfigFileName()))
             return 0.0;
     }
@@ -705,5 +719,5 @@
     // Check time metadata
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE)) {
+        if(!p_psTimeInit(p_psGetConfigFileName())) {
             psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
             return 0.0;
Index: /trunk/psLib/src/astro/psTime.h
===================================================================
--- /trunk/psLib/src/astro/psTime.h	(revision 3219)
+++ /trunk/psLib/src/astro/psTime.h	(revision 3220)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 18:52:51 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -284,4 +284,12 @@
 );
 
+/** Get the filename of the psLib configuration file.
+ *
+ *  @return char*          If a PS_CONFIG_FILE environment variable exists,
+ *                         that is returned, otherwise the default location
+ *                         dependent on the installation location.
+ */
+char* p_psGetConfigFileName();
+
 /// @}
 
Index: /trunk/psLib/src/astronomy/psTime.c
===================================================================
--- /trunk/psLib/src/astronomy/psTime.c	(revision 3219)
+++ /trunk/psLib/src/astronomy/psTime.c	(revision 3220)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-10 02:36:41 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -74,4 +74,5 @@
 psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
 
+
 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
  *  terminated copy of the original input string. */
@@ -133,4 +134,17 @@
     return cleanToken;
 }
+
+// get the psTime.config filename by checking environment variable first, then original installation area.
+char* p_psGetConfigFileName()
+{
+    char* filename = getenv("PS_CONFIG_FILE");
+
+    if (filename == NULL) { // environment variable not found
+        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
+    }
+
+    return filename;
+}
+
 
 /** Searches time tables in priority order and performs interpolation if input index value is within a table.
@@ -148,5 +162,5 @@
     // Check time metadata. Function call reports errors.
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE))
+        if(!p_psTimeInit(p_psGetConfigFileName()))
             return 0.0;
     }
@@ -705,5 +719,5 @@
     // Check time metadata
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE)) {
+        if(!p_psTimeInit(p_psGetConfigFileName())) {
             psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
             return 0.0;
Index: /trunk/psLib/src/astronomy/psTime.h
===================================================================
--- /trunk/psLib/src/astronomy/psTime.h	(revision 3219)
+++ /trunk/psLib/src/astronomy/psTime.h	(revision 3220)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-16 18:52:51 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -284,4 +284,12 @@
 );
 
+/** Get the filename of the psLib configuration file.
+ *
+ *  @return char*          If a PS_CONFIG_FILE environment variable exists,
+ *                         that is returned, otherwise the default location
+ *                         dependent on the installation location.
+ */
+char* p_psGetConfigFileName();
+
 /// @}
 
Index: /trunk/psLib/test/astronomy/Makefile.am
===================================================================
--- /trunk/psLib/test/astronomy/Makefile.am	(revision 3219)
+++ /trunk/psLib/test/astronomy/Makefile.am	(revision 3220)
@@ -12,4 +12,5 @@
 
 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
+AM_CFLAGS = -DXML_CONFIG_FILE="\"$(top_srcdir)/etc/pslib/psTime.xml\""
 
 check_PROGRAMS = tst_psTime_01 \
Index: /trunk/psLib/test/astronomy/test.psTime.config2.template
===================================================================
--- /trunk/psLib/test/astronomy/test.psTime.config2.template	(revision 3219)
+++ /trunk/psLib/test/astronomy/test.psTime.config2.template	(revision 3220)
@@ -1,4 +1,4 @@
 # This configuration file specifies values required for time calculations by psLib.
-psLib.time.tables.dir STR PREFIX/data                                                    # Directory for time tables
+psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
 psLib.time.tables.n S32 4                                                               # Number of time tables
 psLib.time.tables.files STR eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
Index: /trunk/psLib/test/astronomy/test.psTime.config3.template
===================================================================
--- /trunk/psLib/test/astronomy/test.psTime.config3.template	(revision 3219)
+++ /trunk/psLib/test/astronomy/test.psTime.config3.template	(revision 3220)
@@ -1,4 +1,4 @@
 # This configuration file specifies values required for time calculations by psLib.
-psLib.time.tables.dir STR PREFIX/data                                                    # Directory for time tables
+psLib.time.tables.dir STR PREFIX/share/pslib                                            # Directory for time tables
 psLib.time.tables.n S32 4                                                               # Number of time tables
 psLib.time.tables.files STR ser7.dat eopc01_1900_2004.dat finals_all.dat tai_utc.dat    # These are the table file names
Index: /trunk/psLib/test/astronomy/tst_psTime_04.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psTime_04.c	(revision 3219)
+++ /trunk/psLib/test/astronomy/tst_psTime_04.c	(revision 3220)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-02-03 00:54:12 $
+ *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,5 +30,5 @@
     // Test A - Initialize time
     printPositiveTestHeader(stdout, "psTime", "Test A - Initialize time");
-    psLibInit(true, CONFIG_FILE);
+    psLibInit(true, p_psGetConfigFileName());
     psLibFinalize();
     printFooter(stdout, "psTime", "Test A - Initialize time", true);
Index: /trunk/psLib/test/dataIO/Makefile.am
===================================================================
--- /trunk/psLib/test/dataIO/Makefile.am	(revision 3219)
+++ /trunk/psLib/test/dataIO/Makefile.am	(revision 3220)
@@ -14,4 +14,5 @@
 
 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
+AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\""
 
 check_PROGRAMS = \
Index: /trunk/psLib/test/fileUtils/Makefile.am
===================================================================
--- /trunk/psLib/test/fileUtils/Makefile.am	(revision 3219)
+++ /trunk/psLib/test/fileUtils/Makefile.am	(revision 3220)
@@ -14,4 +14,5 @@
 
 AM_LDFLAGS = -L$(top_builddir)/src $(PSLIB_LIBS)
+AM_CFLAGS = -DUTC_DAT_FILE="\"$(top_srcdir)/share/pslib/tai_utc.dat\""
 
 check_PROGRAMS = \
