Index: trunk/extsrc/gpcsw/Make.Common.fixed
===================================================================
--- trunk/extsrc/gpcsw/Make.Common.fixed	(revision 23485)
+++ trunk/extsrc/gpcsw/Make.Common.fixed	(revision 23488)
@@ -673,5 +673,5 @@
 	@-rm -f $(DIR_BIN)/*.TEXT_FILE_BUSY 2> /dev/null || /bin/true
 	@ln $< $@
-	@-setuidinst $@
+	# @-setuidinst $@
 
 $(DIR_BIN)/%-$(VERSION): scripts/%.sh
Index: trunk/extsrc/gpcsw/Makefile
===================================================================
--- trunk/extsrc/gpcsw/Makefile	(revision 23485)
+++ 	(revision )
@@ -1,32 +1,0 @@
-
-update:
-	mkdir -p gpcsrc
-# top-level files:
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/Makefile gpcsrc/Makefile
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/Make.Common gpcsrc/Make.Common
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/ThisIsTopLevel gpcsrc/ThisIsTopLevel
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/missing_protos.h gpcsrc/missing_protos.h
-# remove existing directories
-	rm -rf gpcsrc/fits
-	rm -rf gpcsrc/analysis
-# required subdirs
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/analysis/libpscoords gpcsrc/analysis/libpscoords
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/analysis/libpsf gpcsrc/analysis/libpsf
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/libfh gpcsrc/fits/libfh
-	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/burntool gpcsrc/fits/burntool
-# replace the standard gpc/Make.Common with our repaired version (g77 -> gfortran)
-	cp -f Make.Common.fixed gpcsrc/Make.Common
-# set up links
-	ln -sf ../Make.Common gpcsrc/analysis/Make.Common
-	ln -sf ../Make.Common gpcsrc/analysis/libpscoords/Make.Common
-	ln -sf ../Make.Common gpcsrc/analysis/libpsf/Make.Common
-	ln -sf ../Make.Common gpcsrc/fits/Make.Common
-	ln -sf ../Make.Common gpcsrc/fits/libfh/Make.Common
-	ln -sf ../Make.Common gpcsrc/fits/burntool/Make.Common
-
-burntool:
-	cd gpcsrc && make -C fits/libfh install
-	cd gpcsrc && make -C analysis/libpscoords install
-	cd gpcsrc && make -C analysis/libpsf install
-	cd gpcsrc && make -C fits/burntool install
-
Index: trunk/extsrc/gpcsw/Makefile.in
===================================================================
--- trunk/extsrc/gpcsw/Makefile.in	(revision 23488)
+++ trunk/extsrc/gpcsw/Makefile.in	(revision 23488)
@@ -0,0 +1,43 @@
+
+default: all
+
+all: burntool
+
+install:
+	cp bin/* @BINDIR@/
+	cp man/man1/* @MANDIR@/man1/
+
+update:
+	mkdir -p gpcsrc
+# top-level files:
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/Makefile gpcsrc/Makefile
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/Make.Common gpcsrc/Make.Common
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/ThisIsTopLevel gpcsrc/ThisIsTopLevel
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/missing_protos.h gpcsrc/missing_protos.h
+# remove existing directories
+	rm -rf gpcsrc/fits
+	rm -rf gpcsrc/analysis
+# required subdirs
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/analysis/libpscoords gpcsrc/analysis/libpscoords
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/analysis/libpsf gpcsrc/analysis/libpsf
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/libfh gpcsrc/fits/libfh
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/libfhreg gpcsrc/fits/libfhreg
+	svn export https://svn.ifa.hawaii.edu/gpc/repos/sw/trunk/fits/burntool gpcsrc/fits/burntool
+# replace the standard gpc/Make.Common with our repaired version (g77 -> gfortran)
+	cp -f Make.Common.fixed gpcsrc/Make.Common
+# set up links
+	ln -sf ../Make.Common gpcsrc/analysis/Make.Common
+	ln -sf ../Make.Common gpcsrc/analysis/libpscoords/Make.Common
+	ln -sf ../Make.Common gpcsrc/analysis/libpsf/Make.Common
+	ln -sf ../Make.Common gpcsrc/fits/Make.Common
+	ln -sf ../Make.Common gpcsrc/fits/libfh/Make.Common
+	ln -sf ../Make.Common gpcsrc/fits/libfhreg/Make.Common
+	ln -sf ../Make.Common gpcsrc/fits/burntool/Make.Common
+
+burntool:
+	cd gpcsrc && make -C fits/libfh install
+	cd gpcsrc && make -C fits/libfhreg install
+	cd gpcsrc && make -C analysis/libpscoords install
+	cd gpcsrc && make -C analysis/libpsf install
+	cd gpcsrc && make -C fits/burntool install
+
Index: trunk/extsrc/gpcsw/autogen.sh
===================================================================
--- trunk/extsrc/gpcsw/autogen.sh	(revision 23488)
+++ trunk/extsrc/gpcsw/autogen.sh	(revision 23488)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+for arg in $*; do
+    case $arg in
+        --no-configure)
+	    exit 0
+            ;;
+        *)
+            ;;
+    esac
+done
+
+./configure.tcsh $*
Index: trunk/extsrc/gpcsw/config.tools
===================================================================
--- trunk/extsrc/gpcsw/config.tools	(revision 23488)
+++ trunk/extsrc/gpcsw/config.tools	(revision 23488)
@@ -0,0 +1,47 @@
+#!/bin/csh -f
+
+if ($#argv == 0) then
+  echo "USAGE: config.tools [fixpath | fixconf]"
+  exit 2
+endif
+
+if ("$argv[1]" == "fixpath") goto fixpath
+if ("$argv[1]" == "fixconf") goto fixconf
+
+echo "unknown option $argv[1]"
+exit 1
+
+#######
+fixpath:
+
+if ($#argv != 2) then
+  echo "USAGE: config.tools fixpath (path)"
+  exit 2
+endif
+
+set indir = $argv[2]
+
+# convert // to / in pathnames
+echo $indir | grep "\/\/" > /dev/null
+set success = $status
+while ($success == 0) 
+  set indir = `echo $indir | sed 's|\/\/|\/|g'`
+  echo $indir | grep "\/\/" > /dev/null
+  set success = $status
+end
+
+set indir = `echo $indir | sed 's|\/$||'`
+echo $indir
+exit 0
+
+#######
+fixconf:
+
+if ($#argv != 3) then
+  echo "USAGE: config.tools fixconf (NAME) (value)"
+  exit 2
+endif
+
+cat Makefile | sed "s|$argv[2]|$argv[3]|" > Makefile.tmp
+mv -f Makefile.tmp Makefile
+exit 0;
Index: trunk/extsrc/gpcsw/configure
===================================================================
--- trunk/extsrc/gpcsw/configure	(revision 23488)
+++ trunk/extsrc/gpcsw/configure	(revision 23488)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# strip out CC, CFLAGS, CPPFLAGS, LDFLAGS and set env vars
+while ( test $# -gt 0 ); do
+
+  skip=0
+
+  # strip out CC, set as env variable
+  echo $1 | grep "^CC=" > /dev/null
+  if ( test $? -eq 0 ) ; then
+    val=`echo $1 | sed "s|^CC=||"`
+    export CC=$val
+    skip=1
+  fi
+  # strip out CFLAGS, set as env variable
+  echo $1 | grep "^CFLAGS=" > /dev/null
+  if ( test $? -eq 0 ) ; then
+    val=`echo $1 | sed "s|^CFLAGS=||"`
+    export CFLAGS=$val
+    skip=1
+  fi
+  # strip out CPPFLAGS, set as env variable
+  echo $1 | grep "^CPPFLAGS=" > /dev/null
+  if ( test $? -eq 0 ) ; then
+    val=`echo $1 | sed "s|^CPPFLAGS=||"`
+    export CPPFLAGS=$val
+    skip=1
+  fi
+  # strip out LDFLAGS, set as env variable
+  echo $1 | grep "^LDFLAGS=" > /dev/null
+  if ( test $? -eq 0 ) ; then
+    val=`echo $1 | sed "s|^LDFLAGS=||"`
+    export LDFLAGS=$val
+    skip=1
+  fi
+  if ( test $skip -eq 0 ) ; then
+    args="$args $1"
+  fi
+  shift
+done
+
+./configure.tcsh $args
Index: trunk/extsrc/gpcsw/configure.tcsh
===================================================================
--- trunk/extsrc/gpcsw/configure.tcsh	(revision 23488)
+++ trunk/extsrc/gpcsw/configure.tcsh	(revision 23488)
@@ -0,0 +1,179 @@
+#!/bin/csh -f
+
+# this is a very low-tech version of configure, not built by autoconf.
+# we check for the following libraries:
+
+# we need to be able to list the required libraries for a given distribution
+
+# evaluate command-line options
+set prefix  = ""
+set bindir  = ""
+set libdir  = ""
+set incdir  = ""
+set mandir  = ""
+set datadir  = ""
+set sysconfdir  = ""
+set exec_prefix = ""
+set defines = ""
+set profile = 0
+
+set root    = ""
+set args    = ""
+
+while ("$1" != "") 
+ switch ("$1")
+  # switch options passed by build systems which we ignore
+  case --enable-maintainer-mode
+  case --no-create
+  case --no-recursion
+  case --enable-optimize
+  case --disable-shared
+  case --enable-shared
+  case --disable-static
+  case --enable-static
+  case --enable-profile
+  case --pedantic
+   shift
+   breaksw;
+  # key/value options passed by build systems which we ignore
+  case --sbindir*
+  case --libexecdir*
+  case --sharedstatedir*
+  case --localstatedir*
+  case --oldincludedir*
+  case --infodir*
+  case --exec-prefix*
+  case --libdir*
+  case --includedir*
+  case --sysconfdir*
+  case --datadir*
+   # we need to strip the --opt word and --opt=word versions
+   set word = `echo $1 | tr = ' '`
+   if ($#word == 1) then
+     if ($#argv > 1) then
+      shift
+     endif
+   endif
+   breaksw;
+  case --prefix*
+   if ("$1" == "--prefix") then
+     shift
+     set prefix = $1
+   else
+     set prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --bindir*
+   if ("$1" == "--bindir") then
+     shift
+     set bindir = $1
+   else
+     set bindir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --mandir*
+   if ("$1" == "--mandir") then
+     shift
+     set mandir = $1
+   else
+     set mandir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --help:
+   goto usage
+  case -*: 
+   echo ""
+   echo "Unknown option: $1"
+   goto usage
+  default:
+   set args=($args $1);
+   breaksw;
+ endsw
+ shift
+end
+if ($#args != 1) goto usage
+
+# gpc build ignores CC, CFLAGS, CPPFLAGS, LDFLAGS
+
+# set up the basic directory names:
+set root = `pwd`
+if ($prefix == "") set prefix = $root
+
+echo 
+echo "install destinations:"
+echo "ROOT: $root"
+echo "PREFIX: $prefix"
+echo 
+
+# the config.tools fixconf operations below interpolate values in Makefile
+if (-e Makefile) mv Makefile Makefile.bak
+cp -f Makefile.in Makefile
+
+# BINDIR holds the output binary files
+if ("$bindir" == "") then
+  set subdir = bin
+  set bindir = $prefix/$subdir
+endif
+set bindir = `./config.tools fixpath $bindir`
+./config.tools fixconf @BINDIR@ $bindir
+echo BINDIR $bindir
+
+# MANDIR (DESTMAN) holds the output man pages
+if ("$mandir" == "") then
+  set mandir = $prefix/man
+endif
+set mandir = `./config.tools fixpath $mandir`
+./config.tools fixconf @MANDIR@ $mandir
+echo DESTMAN $mandir
+
+echo ""
+echo "include $bindir in your path"
+
+exit 0
+
+usage:
+cat <<EOF
+USAGE: configure [OPTION]
+
+echo remaining args: $args
+
+set the installation directory root with --prefix
+if you define the environment variable ARCH, you can set --vararch
+ 
+Configuration:
+  -h, --help              display this help and exit
+  --enable-optimize       enable compiler optimization (-O2)
+  --enable-memcheck       enable ohana memory tests
+  --pedantic              include -Wall -Werror on compilation
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+  --vararch               install with ARCH suffixes for variable architectures
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [PREFIX/bin/$ARCH] 
+  --libdir=DIR           object code libraries [PREFIX/lib/$ARCH]
+  --includedir=DIR       C header files [PREFIX/include]
+  --mandir=DIR           man documentation [PREFIX/man]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+
+Makefile flags:
+  CC=options
+  CFLAGS=options
+  CPPFLAGS=options
+  LDFLAGS=options
+
+The following options are silently ignored for compatibility:
+  --enable-maintainer-mode
+  --no-create
+  --no-recursion
+  --sbindir
+  --libexecdir
+  --sharedstatedir
+  --localstatedir
+  --oldincludedir
+  --infodir
+
+EOF
+ exit 2;
