diff -uNr pcp-2.2.1.orig/configure.in pcp-2.2.1/configure.in --- pcp-2.2.1.orig/configure.in Wed Jun 20 22:37:09 2001 +++ pcp-2.2.1/configure.in Thu Aug 23 15:20:32 2001 @@ -678,43 +678,59 @@ pcp_magic_file=$PCP_MAGIC_FILE AC_SUBST(pcp_magic_file) +test "x$exec_prefix" = xNONE && exec_prefix=${prefix} + dnl shared PCP files (shareable for diskless) -if test $target_os = irix +if eval test ${datadir%/*} = NONE then - pcp_share_dir=/usr/pcp + if test $target_os = irix + then + pcp_share_dir=/usr/pcp + else + if test -d /usr/share + then + pcp_share_dir=/usr/share/pcp + elif test -d /usr/local + then + pcp_share_dir=/usr/local/pcp + else + pcp_share_dir=/usr/pcp + fi + fi else - if test -d /usr/share - then - pcp_share_dir=/usr/share/pcp - elif test -d /usr/local - then - pcp_share_dir=/usr/local/pcp - else - pcp_share_dir=/usr/pcp - fi + pcp_share_dir=`eval echo $datadir` fi AC_SUBST(pcp_share_dir) dnl private PCP executables -if test $target_os = linux -then - pcp_binadm_dir=$pcp_share_dir/bin -elif test $target_os = irix +if eval test ${sbindir%/*} = NONE then - pcp_binadm_dir=/usr/pcp/bin + if test $target_os = linux + then + pcp_binadm_dir=$pcp_share_dir/bin + elif test $target_os = irix + then + pcp_binadm_dir=/usr/pcp/bin + fi +else + pcp_binadm_dir=`eval echo $sbindir` fi - AC_SUBST(pcp_binadm_dir) dnl non-shared (i.e. system local) PCP files -if test -d /var +if eval test ${localstatedir%/*} = NONE then - pcp_var_dir=/var/pcp -elif test -d /usr/local -then - pcp_var_dir=/usr/local/pcp + if test -d /var + then + pcp_var_dir=/var/pcp + elif test -d /usr/local + then + pcp_var_dir=/usr/local/pcp + else + pcp_var_dir=/usr + fi else - pcp_var_dir=/usr + pcp_var_dir=`eval echo $localstatedir` fi AC_SUBST(pcp_var_dir) @@ -722,25 +738,35 @@ AC_SUBST(pcp_pmdas_dir) dnl runtime shared libraries -if test -d /usr/lib -then - pcp_lib_dir=/usr/lib -elif test -d /usr/local/lib +if eval test ${libdir%/*} = NONE then - pcp_lib_dir=/usr/local/lib + if test -d /usr/lib + then + pcp_lib_dir=/usr/lib + elif test -d /usr/local/lib + then + pcp_lib_dir=/usr/local/lib + else + pcp_lib_dir=/lib + fi else - pcp_lib_dir=/lib + pcp_lib_dir=`eval echo $libdir` fi AC_SUBST(pcp_lib_dir) dnl directory for compatibility libraries. At the moment we hide dnl x86 shared libraries below PCP_SHARE_DIR/compat on ia64 but it dnl may change in the future. -if test $target_cpu = "ia64" +if eval test ${libdir%/*} = NONE then - pcp_lib_compat_dir=$pcp_share_dir/compat + if test $target_cpu = "ia64" + then + pcp_lib_compat_dir=$pcp_share_dir/compat + else + pcp_lib_compat_dir=$pcp_lib_dir + fi else - pcp_lib_compat_dir=$pcp_lib_dir + pcp_lib_compat_dir=`eval echo $libdir` fi AC_SUBST(pcp_lib_compat_dir) @@ -765,31 +791,43 @@ fi done fi - +if eval test ${mandir%/*} != NONE +then + pcp_man_dir=`eval echo $mandir` +fi if test -z "$pcp_man_dir" then echo "FATAL ERROR: could not find find pcp_man_dir directory." exit 1 fi - AC_SUBST(pcp_man_dir) AC_SUBST(have_gzipped_manpages) dnl public binaries -if test -d /usr/bin +if eval test ${bindir%/*} = NONE then - pcp_bin_dir=/usr/bin + if test -d /usr/bin + then + pcp_bin_dir=/usr/bin + else + pcp_bin_dir=/bin + fi else - pcp_bin_dir=/bin + pcp_bin_dir=`eval echo $bindir` fi AC_SUBST(pcp_bin_dir) dnl include files -if test -d /usr/include +if eval test ${includedir%/*} = NONE then - pcp_inc_dir=/usr/include/pcp + if test -d /usr/include + then + pcp_inc_dir=/usr/include/pcp + else + pcp_inc_dir=$pcp_share_dir/include + fi else - pcp_inc_dir=$pcp_share_dir/include + pcp_inc_dir=`eval echo $includedir` fi AC_SUBST(pcp_inc_dir) @@ -840,30 +878,40 @@ AC_SUBST(pcp_tmp_dir) dnl doc directory -if test $target_os = irix +if eval test ${prefix%/*} = NONE then - pcp_doc_dir=/var/pcp + if test $target_os = irix + then + pcp_doc_dir=/var/pcp + else + if test -d /usr/doc + then + pcp_doc_dir=/usr/doc/pcp-${PACKAGE_VERSION} + else + pcp_doc_dir=/usr/share/pcp/doc + fi + fi else - if test -d /usr/doc - then - pcp_doc_dir=/usr/doc/pcp-${PACKAGE_VERSION} - else - pcp_doc_dir=/usr/share/pcp/doc - fi + pcp_doc_dir=`eval echo $prefix/doc` fi AC_SUBST(pcp_doc_dir) dnl demos directory -if test $target_os = irix +if eval test ${prefix%/*} = NONE then - pcp_demos_dir=/var/pcp/demos + if test $target_os = irix + then + pcp_demos_dir=/var/pcp/demos + else + if test -d /usr/share/demos + then + pcp_demos_dir=/usr/share/demos/pcp + else + pcp_demos_dir=/usr/share/pcp/demos + fi + fi else - if test -d /usr/share/demos - then - pcp_demos_dir=/usr/share/demos/pcp - else - pcp_demos_dir=/usr/share/pcp/demos - fi + pcp_demos_dir=`eval echo $pcp_doc_dir/demos` fi AC_SUBST(pcp_demos_dir) diff -uNr pcp-2.2.1.orig/src/pmcd/GNUmakefile pcp-2.2.1/src/pmcd/GNUmakefile --- pcp-2.2.1.orig/src/pmcd/GNUmakefile Wed Jun 20 22:37:17 2001 +++ pcp-2.2.1/src/pmcd/GNUmakefile Thu Aug 23 15:19:10 2001 @@ -52,7 +52,7 @@ install :: default $(INSTALL) -D -m 555 rc_pcp $(PCP_RC_DIR)/pcp $(INSTALL) -D -m 444 pmcd.options $(PCP_PMCDOPTIONS_PATH) - $(INSTALL) -m 755 rc_local $(PCP_VAR_DIR)/config/pmcd/rc.local + $(INSTALL) -D -m 755 rc_local $(PCP_VAR_DIR)/config/pmcd/rc.local $(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/lib $(INSTALL) -m 444 pmdaproc.sh $(PCP_SHARE_DIR)/lib/pmdaproc.sh $(INSTALL) -m 444 rc-proc.sh $(PCP_SHARE_DIR)/lib/rc-proc.sh diff -uNr pcp-2.2.1.orig/src/pmie/src/pmie.c pcp-2.2.1/src/pmie/src/pmie.c --- pcp-2.2.1.orig/src/pmie/src/pmie.c Wed Jun 20 22:37:20 2001 +++ pcp-2.2.1/src/pmie/src/pmie.c Thu Aug 23 15:45:06 2001 @@ -79,7 +79,7 @@ static char *prompt = "pmie> "; static char *intro = "Performance Co-Pilot Inference Engine (pmie), " "Version %s\n\n%s%s"; -static char *cpath = "/var/pcp/config/pmie/"; +char cpath[MAXPATHLEN]; static char logfile[MAXPATHLEN+1]; static char perffile[PMIE_PATHSIZE]; /* /var/tmp/ file name */ @@ -216,6 +216,7 @@ fprintf(stderr, "load: cannot access config file %s: %s\n", fname, strerror(sts)); } #endif + sprintf(cpath, "%s/config/pmie/", pmGetConfig("PCP_VAR_DIR")); sprintf(config, "%s%s", cpath, fname); if (access(config, F_OK) != 0) { fprintf(stderr, "%s: cannot access config file as either %s or %s: %s\n", diff -uNr pcp-2.2.1.orig/src/pmns/pmnsdel.c pcp-2.2.1/src/pmns/pmnsdel.c --- pcp-2.2.1.orig/src/pmns/pmnsdel.c Wed Jun 20 22:37:14 2001 +++ pcp-2.2.1/src/pmns/pmnsdel.c Thu Aug 23 15:19:10 2001 @@ -211,8 +211,8 @@ pmns_output(root, outf); fclose(outf); - sprintf(cmd, "%s/bin/pmnscomp %s -f -n %s %s.bin", - pmGetConfig("PCP_SHARE_DIR"), dupok ? "-d" : "", pmnsfile, pmnsfile); + sprintf(cmd, "%s/pmnscomp %s -f -n %s %s.bin", + pmGetConfig("PCP_BINADM_DIR"), dupok ? "-d" : "", pmnsfile, pmnsfile); sts = system(cmd); exit(sts); diff -uNr pcp-2.2.1.orig/src/pmns/pmnsmerge.c pcp-2.2.1/src/pmns/pmnsmerge.c --- pcp-2.2.1.orig/src/pmns/pmnsmerge.c Wed Jun 20 22:37:14 2001 +++ pcp-2.2.1/src/pmns/pmnsmerge.c Thu Aug 23 15:19:10 2001 @@ -222,7 +222,7 @@ char cmd[1024]; char pmnscomp[MAXPATHLEN]; - sprintf(pmnscomp, "%s/bin/pmnscomp", pmGetConfig("PCP_SHARE_DIR")); + sprintf(pmnscomp, "%s/pmnscomp", pmGetConfig("PCP_BINADM_DIR")); /* trim command name of leading directory components */ pmProgname = argv[0];