Index: trunk/psLib/configure.ac
===================================================================
--- trunk/psLib/configure.ac	(revision 42336)
+++ trunk/psLib/configure.ac	(revision 42378)
@@ -46,9 +46,9 @@
 SRCDIRS="sys astro db fft fits imageops jpeg math mathtypes types"   dnl xml
 # escape two escapes at this level so \\ gets passed to the shell and \ to perl
-SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`
-SRCINC="-I${SRCPATH=} ${SRCINC=}"
-SRCSUBLIBS=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`
-AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
-AC_SUBST(SRCINC,${SRCINC=})
+SRCINC=`echo "${SRCDIRS}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH}/\1|g"`
+SRCINC="-I${SRCPATH} ${SRCINC}"
+SRCSUBLIBS=`echo "${SRCDIRS}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`
+AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS})
+AC_SUBST(SRCINC,${SRCINC})
 AC_SUBST(ABS_SRCDIR,`pwd`) dnl assuming configure is run in top directory -- is there something better?
 AC_PROG_MAKE_SET
@@ -67,5 +67,5 @@
   [AC_MSG_RESULT(memory allocation backtracing enabled)
     AC_DEFINE([PS_MEM_BACKTRACE], 1, [Define to 1 if you want memory backtracing])
-    CFLAGS="${CFLAGS=} -rdynamic"
+    CFLAGS="${CFLAGS} -rdynamic"
   ]
 )
@@ -102,6 +102,6 @@
 
 ACX_PTHREAD(
-  [PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${PTHREAD_CFLAGS}"
-    PSLIB_LIBS="${PSLIB_LIBS=} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"],
+  [PSLIB_CFLAGS="${PSLIB_CFLAGS} ${PTHREAD_CFLAGS}"
+    PSLIB_LIBS="${PSLIB_LIBS} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"],
   [AC_MSG_ERROR([pthread support is required to build psLib])]
 )
@@ -110,7 +110,7 @@
 
 AX_LIB_MYSQL([4.1.2],
-  [PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${MYSQL_CFLAGS} -DHAVE_PSDB"
-    PSLIB_LIBS="${PSLIB_LIBS=} ${MYSQL_LDFLAGS}"],
-  [PSLIB_CFLAGS="${PSLIB_CFLAGS=}"]
+  [PSLIB_CFLAGS="${PSLIB_CFLAGS} ${MYSQL_CFLAGS} -DHAVE_PSDB"
+    PSLIB_LIBS="${PSLIB_LIBS} ${MYSQL_LDFLAGS}"],
+  [PSLIB_CFLAGS="${PSLIB_CFLAGS}"]
 )
 
@@ -125,9 +125,9 @@
 PKG_CHECK_MODULES([CFITSIO], [cfitsio], [], AC_MSG_ERROR([CFITSIO package not found.  Obtain CFITSIO at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio]))
 
-PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${CFITSIO_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} ${CFITSIO_LIBS}"
-
-CFLAGS="${CFLAGS=} ${CFITSIO_CFLAGS}"
-LDFLAGS="${LDFLAGS=} ${CFITSIO_LIBS}"
+PSLIB_CFLAGS="${PSLIB_CFLAGS} ${CFITSIO_CFLAGS}"
+PSLIB_LIBS="${PSLIB_LIBS} ${CFITSIO_LIBS}"
+
+CFLAGS="${CFLAGS} ${CFITSIO_CFLAGS}"
+LDFLAGS="${LDFLAGS} ${CFITSIO_LIBS}"
 
 dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501
@@ -159,6 +159,6 @@
 PKG_CHECK_MODULES([FFTW3], [fftw3f], [], AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found.  Obtain it at http://www.fftw.org/]))
 
-PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${FFTW3_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} ${FFTW3_LIBS}"
+PSLIB_CFLAGS="${PSLIB_CFLAGS} ${FFTW3_CFLAGS}"
+PSLIB_LIBS="${PSLIB_LIBS} ${FFTW3_LIBS}"
 
 CFLAGS="${CFLAGS} ${FFTW3_CFLAGS}"
@@ -190,6 +190,6 @@
 PKG_CHECK_MODULES([GSL], [gsl], [], AC_MSG_ERROR([GSL is required.  Obtain it at http://www.gnu.org/software/gsl]))
 
-PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${GSL_CFLAGS}"
-PSLIB_LIBS="${PSLIB_LIBS=} ${GSL_LIBS}"
+PSLIB_CFLAGS="${PSLIB_CFLAGS} ${GSL_CFLAGS}"
+PSLIB_LIBS="${PSLIB_LIBS} ${GSL_LIBS}"
 
 AC_SUBST([GSL_CFLAGS])
@@ -303,10 +303,10 @@
 LDFLAGS="${LDFLAGS} ${JPEG_LDFLAGS}"
 
-AC_CHECK_HEADERS([jpeglib.h],[PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${JPEG_CFLAGS}"
+AC_CHECK_HEADERS([jpeglib.h],[PSLIB_CFLAGS="${PSLIB_CFLAGS} ${JPEG_CFLAGS}"
 			      AC_SUBST(JPEG_CFLAGS)],
   [AC_MSG_ERROR([libjpeg headers not found.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
 )
 
-AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[PSLIB_LIBS="${PSLIB_LIBS=} ${JPEG_LDFLAGS} -ljpeg"],
+AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[PSLIB_LIBS="${PSLIB_LIBS} ${JPEG_LDFLAGS} -ljpeg"],
   [AC_MSG_ERROR([libjpeg library not found.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
 )
@@ -391,5 +391,5 @@
   AC_CHECK_FILE($SWIG,[],
      [AC_MSG_ERROR([SWIG is required.  Obtain it at www.swig.org or use --with-swig to specify its install location.])])
-  SUBDIR="${SUBDIR=} swig"
+  SUBDIR="${SUBDIR} swig"
 
 dnl restore the CFLAGS/LDFLAGS
@@ -433,5 +433,5 @@
 
 AC_CHECK_LIB(mx,sqrtf,
-  [PSLIB_LIBS="${PSLIB_LIBS=} -lmx"])
+  [PSLIB_LIBS="${PSLIB_LIBS} -lmx"])
 LIBS=${TMP_LIBS}
 AC_CHECK_FUNC(atoll, [],
@@ -474,5 +474,5 @@
 IPP_STDOPTS
 IPP_STDCFLAGS
-CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
+CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
 
 dnl ---------------- export variables --------------------
Index: trunk/psLib/src/db/psDB.c
===================================================================
--- trunk/psLib/src/db/psDB.c	(revision 42336)
+++ trunk/psLib/src/db/psDB.c	(revision 42378)
@@ -56,4 +56,10 @@
 
 
+# if (MYSQL_VERSION_ID >= 80000)
+    # define MYSQL_BOOL bool
+# else
+    # define MYSQL_BOOL my_bool
+# endif
+
 // set the pointer to NULL if we are actually freeing the memory
 #define PSDB_NULL_FREE(ptr) \
@@ -138,6 +144,6 @@
 
 // pType utility functions
-static psPtr    psDBGetPTypeNaN(psElemType pType);
-static bool     psDBIsPTypeNaN(psElemType pType, psPtr data);
+static psPtr      psDBGetPTypeNaN(psElemType pType);
+static MYSQL_BOOL psDBIsPTypeNaN(psElemType pType, psPtr data);
 
 // public functions
@@ -753,4 +759,7 @@
     // the return value also needs to be inverted for the same reason.
     // is it safe to assume my_bool always safely casts to bool?
+    // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used
+    // in 5.0 and 5.6, my_bool is char
+    // 
     return !(bool)mysql_autocommit(dbh->mysql, !mode);
 }
@@ -1447,5 +1456,8 @@
 
     mysqlType       *mType;             // type tmp variable
-    static my_bool isNull = true;       // used in a MYSQL_BIND to indicate NULL
+
+    // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used
+    // in 5.0 and 5.6, my_bool is char
+    static MYSQL_BOOL isNull = true;       // used in a MYSQL_BIND to indicate NULL
 
     MYSQL_BIND *bind = mysqlRow->bind;
@@ -1602,5 +1614,7 @@
                     // assume for the time being that we don't have negative
                     // time as ISO8601 doesn't support dates prior to 0
-                    myTime->neg     = (my_bool)false;
+		    // XXX EAM 2022.03.15 : at least in mysql 8.0.28, my_bool is gone and just bool is used
+		    // in 5.0 and 5.6, my_bool is char
+                    myTime->neg     = (bool)false;
                     // currently unused by mysql
                     myTime->second_part  = (unsigned long)time->nsec;
@@ -2869,6 +2883,6 @@
 #define PS_IS_NAN(type, data, nan) *(type *)data == nan
 
-static bool psDBIsPTypeNaN(psElemType pType,
-                           psPtr data)
+static MYSQL_BOOL psDBIsPTypeNaN(psElemType pType, psPtr data)
+
 {
     bool    isNaN = NULL;
Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 42336)
+++ trunk/psLib/src/sys/psString.c	(revision 42378)
@@ -41,4 +41,20 @@
 
 
+// gcc (Ubuntu 20.04) complains when strncpy is used to copy a fraction of a buffer,
+// potentially skipping the ending NULL.  To avoid the error, manually copy
+// and (to ensure the buffer ends in a NULL) set the last + 1 byte to NUL: 
+// WARNING : len(dest) must be >= n + 1
+char *ps_strncpy_nowarn (char *dest, const char *src, size_t n) {
+
+  size_t i;
+  
+  char *d = dest;
+  char *s = (char *) src;
+  for (i = 0; i < n && *s != 0; i++, d++, s++) { *d = *s; }
+  for ( ; i <= n; i++, d++) { *d = 0; }
+  
+  return dest;
+}
+
 psString p_psStringAlloc(const char *file,
                          unsigned int lineno,
Index: trunk/psLib/src/sys/psString.h
===================================================================
--- trunk/psLib/src/sys/psString.h	(revision 42336)
+++ trunk/psLib/src/sys/psString.h	(revision 42378)
@@ -48,4 +48,6 @@
 void psNOOP (void);
 
+char *ps_strncpy_nowarn (char *dest, const char *src, size_t n);
+
 // some constants to use in snprintf statements and variable definitions to ensure
 // consistency
Index: trunk/psLib/src/sys/psTrace.c
===================================================================
--- trunk/psLib/src/sys/psTrace.c	(revision 42336)
+++ trunk/psLib/src/sys/psTrace.c	(revision 42378)
@@ -213,5 +213,5 @@
     }
 
-    strncpy(name, addNodeName, MAX_COMPONENT_LENGTH);
+    ps_strncpy_nowarn(name, addNodeName, MAX_COMPONENT_LENGTH);
     char *pname = name+1;               // Take off the period
     // Iterate through the components of addNodeName.  Strip off the first
