Index: /gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/XPDFTOOLS.sh
===================================================================
--- /gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/XPDFTOOLS.sh	(revision 32229)
+++ /gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/XPDFTOOLS.sh	(revision 32230)
@@ -2,5 +2,5 @@
 
 # only going to make xpdf-tools, not xpdf-reader. So not making all of xpdf
-package=gs-xpdf
+package=xpdf
 version=-4.00
 
@@ -12,5 +12,5 @@
 prefix=$GEXTXPDFTOOLS_INSTALLED
 
-# Use C/CPP/CXX FLAGS and LDFLAGS for setting up
+# Use C/CPP/CXX FLAGS and LDFLAGS for further setting up
 # libpng and libz for compiling xpdftools
 export CFLAGS="$CFLAGS -I$GEXTXPDFTOOLS_INSTALLED/include -I$GEXTXPDFTOOLS_INSTALLED/include/libpng15"
@@ -19,5 +19,4 @@
 export LDFLAGS="$LDFLAGS -L$GEXTXPDFTOOLS_INSTALLED/lib"
 
-#echo GSDLOS = $GSDLOS
 
 opt_run_untar $force_untar $auto_untar $package $version
@@ -33,10 +32,10 @@
 echo "Using cmake: "
 echo `which cmake`
-##exit 0
 
-# IGNORE: See xpdf-tools src' INSTALL instructions: need to create a 'build' dir
-# cd there and then run cmake from there, providing the xpdf-tools src dir
-# ACTUALLY: doing the above breaks the way cascade-lib.bash does it. It wants
-# a 'release' directory, so do it the cascade-make way as that works.
+# The xpdf-tools src code's INSTALL instructions say we need to create a 'build' dir,
+# cd into there and then run cmake from there, providing the xpdf-tools src dir
+# However, doing so breaks the way cascade-lib.bash runs a CMake compile sequence.
+# cascade-lib.bash wants a 'release' directory, so do it the cascade-make way as
+# that works.
 # TO AVOID building xpdf(reader), turn off finding Qt libs with the cmake flags below
 if [ $force_config = "1" ] ; then
@@ -49,4 +48,5 @@
     cd release ; \
 
+    # see xpdf-tools src code's INSTALL file for these options
     if [ ! -f Makefile ] ; then \
       #cmake -D CMAKE_BUILD_TYPE=RELEASE \
@@ -54,7 +54,7 @@
 	cmake -DCMAKE_BUILD_TYPE=Release \
 	    -DCMAKE_INSTALL_PREFIX=$prefix \
-	    -DZLIB_LIBRARY=$prefix/lib/libz.a \
-	    -DPNG_LIBRARY=$prefix/lib/libpng15.a \
-	    -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \
+	    -DZLIB_LIBRARY=$prefix/lib/libz.so.1.2.7 \
+	    -DPNG_LIBRARY=$prefix/lib/libpng15.so.15.30.0 \
+	    -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.so.6.3.20 \
 	    -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 \
 	    -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 \
@@ -62,5 +62,4 @@
 	    -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
 	    -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS" \
-	    -DPNG_LINK_FLAGS="-lpng15" \
 	    $GEXT_XPDFTOOLS/packages/$package$version
     fi ; \
@@ -81,15 +80,23 @@
 fi
 
-## The -DFREETYPE_DIR to be used in place of -DFREETYPE_LIBRARY above
-## this will help it find the "libfreetype.so" (no versioning at end) in our gs ext
-## But -DZLIB_DIR and -DPNG_DIR are ignored and unrecognised, whereas
-## -DZLIB_LIBRARY and -DPNG_LIBRARY are recognised & supposedly used when compiling
-## but weren't really used as seen when running ldd on the xpdf-tools binaries:
+# If compiling statically, need these above in place of the references to .so files
+#	    -DZLIB_LIBRARY=$prefix/lib/libz.a \
+#	    -DPNG_LIBRARY=$prefix/lib/libpng15.a \
+#	    -DFREETYPE_LIBRARY=$prefix/lib/libfreetype.a \
+
+
+## When -DFREETYPE_DIR is used in place of -DFREETYPE_LIBRARY above, it makes
+## xpdf-tools compilation find the "libfreetype.so" (no versioning at end) in
+## our gs ext.
+## But -DZLIB_DIR and -DPNG_DIR are ignored because they go unrecognised, whereas
+## -DZLIB_LIBRARY and -DPNG_LIBRARY are recognised by XpdfTools' CMake files.
+## -DZLIB_LIBRARY and -DPNG_LIBRARY require full paths. So the first 2 lines of the
+## following won't work:
 #	    -DZLIB_DIR=$prefix \
 #	    -DPNG_DIR=$prefix \
 #	    -DFREETYPE_DIR=$prefix \
 
-## When specified this way, all 3 lines are recognised (freetype, zlib, png)
-## but weren't really used as seen when running ldd on the xpdf-tools binaries:
+## When specified in the following way, all 3 lines are recognised (freetype, zlib,
+## png). The 3rd line can alternatively still use "-DFREETYPE_DIR=$prefix"
 #	    -DZLIB_LIBRARY=$prefix/lib/libz.so.1.2.7 \
 #	    -DPNG_LIBRARY=$prefix/lib/libpng15.so.15.30.0 \
