I am running into a peculiar installation problem while trying to install PLplot-5.7.4 on Solaris.  I have been at this installation for quite awhile and the problems I keep running into are strange and I am not sure how to fix them. 
 
I started my installation by basically installing everything I could via cmake, but cmake's configuration results indicated that it could not find libraries, include files, etc from the paths I gave it.  The paths I gave cmake are correct.  I was at a loss from that point so I decided to try my installation using ccmake.  I used the same paths as I was using in cmake and everything was able to configure and then make correctly.  However when I went to test PLplot (via the INSTALL post make instructions) I recieved some wierd linking errors.

target=`echo all`; \
        list='c c++ f77 f95 tk java'; for subdir in $list; do \
          if test -d "$subdir"; then \
            echo "Making $target in $subdir"; \
            (cd $subdir && make $target); \
          fi; \
        done
Making all in c
make[1]: Entering directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/c'
/usw/ude/SunOS/bin/gcc x01c.c -o x01c -Wl,-rpath -Wl,/home/hall000s/SunOS/plplot_ccmake/lib `PKG_CONFIG_PATH=/home/hall000s/SunOS/plplot_ccmake/lib/pkgconfig pkg-config --cflags --libs plplotd`
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
make[1]: *** [x01c] Error 1
make[1]: Leaving directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/c'
Making all in c++
make[1]: Entering directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/c++'
/usw/ude/SunOS/bin/c++ x01cc.cc -o x01cc -Wl,-rpath -Wl,/home/hall000s/SunOS/plplot_ccmake/lib `PKG_CONFIG_PATH=/home/hall000s/SunOS/plplot_ccmake/lib/pkgconfig pkg-config --cflags --libs plplotd-c++`
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
make[1]: *** [x01cc] Error 1
make[1]: Leaving directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/c++'
Making all in f77
make[1]: Entering directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/f77'
/usw/ude/SunOS/bin/g95 x01f.f -o x01f -Wl,-rpath -Wl,/home/hall000s/SunOS/plplot_ccmake/lib `PKG_CONFIG_PATH=/home/hall000s/SunOS/plplot_ccmake/lib/pkgconfig pkg-config --cflags --libs plplotd-f77`
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
make[1]: *** [x01f] Error 1
make[1]: Leaving directory `/home/hall000s/SunOS/plplot_ccmake/share/plplot5.7.4/examples/f77'

So my next step was to start from scratch and gradually enable more bindings and drivers.  So I went back to cmake and ran this following command, also I am trying to create a static build, this is a requirement of my build.  I am building this in a separate folder from the plplot source directory.

cmake -DCMAKE_INSTALL_PREFIX=/home/hall000s/SunOS/plplot                \
      -DCMAKE_INSTALL_BINDIR=/home/hall000s/SunOS/plplot/bin                \
      -DCMAKE_INSTALL_DATADIR=/home/hall000s/SunOS/plplot/share         \
      -DCMAKE_INSTALL_EXEC_PREFIX=/home/hall000s/SunOS/plplot          \
      -DCMAKE_INSTALL_INCLUDEDIR=/home/hall000s/SunOS/plplot/include  \
      -DCMAKE_INSTALL_INFODIR=/home/hall000s/SunOS/plplot/share/info    \
      -DCMAKE_INSTALL_LIBDIR=/home/hall000s/SunOS/plplot/lib                   \
      -DCMAKE_INSTALL_MANDIR=/home/hall000s/SunOS/plplot/share/man     \
      -DDEFAULT_NO_DEVICES=ON                                                                  \
      -DDEFAULT_NO_BINDINGS=ON                                                                 \
      -DBUILD_SHARED_LIBS=OFF                                                                    \
      -DPKG_CONFIG_EXECUTABLE=/bin/pkg-config                                         \
      -DPLD_ps=ON                                                                                             \
      ../plplot-5.7.4

When the above cmake command is executed it shows the following output.
-- Check for working C compiler: /usw/ude/SunOS/bin/gcc
-- Check for working C compiler: /usw/ude/SunOS/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usw/ude/SunOS/bin/c++
-- Check for working CXX compiler: /usw/ude/SunOS/bin/c++ -- works
-- Checking whether system has ANSI C header files
-- Looking for include files StandardHeadersExist
-- Looking for include files StandardHeadersExist - found
-- Performing Test memchrExists
-- Performing Test memchrExists - Success
-- Performing Test freeExists
-- Performing Test freeExists - Success
-- Check for whether ctype.h macros work on characters with the
   high bit set.
-- High-bit characters - work
-- ANSI C header files - found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_TERMIOS_H
-- Looking for include files HAVE_TERMIOS_H - found
-- Looking for include files HAVE_STDINT_H
-- Looking for include files HAVE_STDINT_H - not found.
-- Performing Test HAVE_SYS_WAIT_H
-- Performing Test HAVE_SYS_WAIT_H - Success
-- Looking for DIR in sys/types.h;dirent.h
-- Looking for DIR in sys/types.h;dirent.h - found
-- Check for signal return type in <signal.h>
-- Check for signal handler return type type void  - found
-- Looking for popen
-- Looking for popen - found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for isinf
-- Looking for isinf - not found
-- Looking for finite
-- Looking for finite - found
-- Looking for isnan
-- Looking for isnan - found
-- SWIG was not found. Please specify Swig executable location
-- Looking for XOpenDisplay in /lib/libX11.so;/lib/libXext.so
-- Looking for XOpenDisplay in /lib/libX11.so;/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for connect
-- Looking for connect - not found
-- Looking for connect in socket
-- Looking for connect in socket - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- X11_FOUND = 1
-- X11_INCLUDE_DIR = /usr/include
-- X11_COMPILE_FLAGS = -I/usr/include
-- X11_LIBRARIES = -lSM;-lICE;/lib/libX11.so;/lib/libXext.so;-lsocket;-lnsl
-- X11_LIBRARY_DIR = /lib
-- ENABLE_tcl is OFF so disabling everything else that is Tcl/Tk related
-- Check for NaN awareness in C compiler
-- Check for NaN awareness in C compiler - found
-- WARNING: qhull library not found.  Setting HAVE_QHULL to OFF.
- - Looking for pkg-config - not found
-- WARNING: Install-tree build will be disabled.
-- WARNING: pango not found because pkg-config not available.
-- WARNING: Shared libraries not built. Setting ENABLE_DYNDRIVERS OFF.
-- WARNING: ENABLE_tk OFF.  Setting PLD_tk, PLD_ntk, and PLD_tkwin OFF.
-- WARNING: wxWidgets not found so setting PLD_wxwidgets to OFF.
CMake Error: Error in cmake code at
/home/hall000s/SunOS/plplot-5.7.4/lib/csa/CMakeLists.txt:45:
INSTALL TARGETS given no ARCHIVE DESTINATION for static library target "csirocsa".
Current CMake stack: /home/hall000s/SunOS/plplot-5.7.4/lib/csa/CMakeLists.txt
CMake Error: Error in cmake code at
/home/hall000s/SunOS/plplot-5.7.4/src/CMakeLists.txt:240:
INSTALL TARGETS given no ARCHIVE DESTINATION for static library target "plplotd".
Current CMake stack: /home/hall000s/SunOS/plplot-5.7.4/src/CMakeLists.txt

Summary of CMake build system results for PLplot

Install location variables which can be set by the user:
CMAKE_INSTALL_PREFIX:
CMAKE_INSTALL_EXEC_PREFIX
CMAKE_INSTALL_BINDIR       CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_MANDIR

Derived install location variables:
DATA_DIR        /plplot5.7.4
LIB_DIR
INCLUDE_DIR     /plplot
BIN_DIR         CMAKE_INSTALL_BINDIR
TCL_DIR         /plplot5.7.4/tcl
PYTHON_INSTDIR
DRV_DIR         /plplot5.7.4/driversd
DOC_DIR         /doc/plplot
MAN_DIR
INFO_DIR

Other important CMake variables:

CMAKE_SYSTEM_NAME:      SunOS
UNIX:                   1
WIN32:
APPLE:
MSVC:                           (MSVC_VERSION:  )
MINGW:
MSYS:
CYGWIN:
BORLAND:
WATCOM:

SWIG_FOUND:             FALSE
PERL_FOUND:             YES
X11_FOUND:              1

CMAKE_BUILD_TYPE:
CMAKE_C_COMPILER CMAKE_C_FLAGS:                 /usw/ude/SunOS/bin/gcc
LIB_TAG:                d

ENABLE_DYNDRIVERS:      OFF
DEVICES_LIST: ps
DRIVERS_LIST: ps

Library options:
BUILD_SHARED_LIBS:      OFF             PL_DOUBLE:      ON

Optional libraries:
HAVE_QHULL:             OFF             WITH_CSA:       ON
HAVE_FREETYPE:                          HAVE_PTHREAD:
HAVE_AGG:

Language Bindings:
ENABLE_f77:             OFF             ENABLE_f95:             OFF
ENABLE_cxx:             OFF             ENABLE_java:            OFF
ENABLE_python:          OFF             ENABLE_octave:          OFF
ENABLE_tcl:             OFF             ENABLE_itcl:            OFF
ENABLE_tk:              OFF             ENABLE_itk:             OFF
ENABLE_pdl:             OFF             ENABLE_wxwidgets:       OFF
ENABLE_gnome2:          OFF             ENABLE_pygcw:           OFF
ENABLE_ada:             OFF

Notice that it did not find my pkg-config executable even though the path I gave it is correct.  This occurs with some of the devices and bindings as well.  However if I was to use ccmake and enter the same paths that I am using for cmake I have success.  Has anyone ran into any problems like this?  I appreciate any help with this problem.

Thank you in advance,
Scott