Index: /branches/base-1-6/Ohana/Configure.in
===================================================================
--- /branches/base-1-6/Ohana/Configure.in	(revision 11971)
+++ /branches/base-1-6/Ohana/Configure.in	(revision 11971)
@@ -0,0 +1,27 @@
+# Configure file for Ohana Package
+# the values of the form @WORD@ are filled in by configure
+
+# location of the package and architecture
+ROOT    = @ROOTDIR@
+ARCH    = @ARCHVAL@
+
+# destination directories:
+DESTBIN	 = @BINDIR@
+DESTINC	 = @INCDIR@
+DESTLIB	 = @LIBDIR@
+DESTMAN	 = @MANDIR@
+DESTDATA = @DATADIR@
+
+# C compiler options
+CC       = @CC@
+CFLAGS   = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS  = @LDFLAGS@
+
+# flags for external dependencies
+INCDIRS  = @INCDIRS@
+LIBDIRS  = @LIBDIRS@
+LIBFLAGS = @LIBFLAGS@
+
+# select the appropriate version of ranlib
+RANLIB = @RANLIB@
Index: /branches/base-1-6/Ohana/Makefile.Common
===================================================================
--- /branches/base-1-6/Ohana/Makefile.Common	(revision 11971)
+++ /branches/base-1-6/Ohana/Makefile.Common	(revision 11971)
@@ -0,0 +1,91 @@
+# this file must be added to the makefile *after* LIB,BIN, etc are defined
+
+# (INC)     & (LIB)     are the program's local include & lib directories
+# (DESTINC) & (DESTLIB) are the target installation include & lib directories
+# (INCDIRS) & (LIBDIRS) are all of the probed include & lib directories
+# (LIBFLAGS) is the list of -lXXX directives from configure for external libs
+
+BASE_CFLAGS   =	$(CFLAGS)
+BASE_CPPFLAGS =	$(CPPFLAGS) -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH)
+BASE_LDFLAGS  = $(LDFLAGS) -L$(LIB) -L$(DESTLIB) $(LIBDIRS) $(LIBFLAGS)
+
+.PRECIOUS: %.$(ARCH).o
+.PRECIOUS: $(BIN)/%.$(ARCH)
+
+# is this line needed?
+.SUFFIXES: .$(ARCH).o
+
+$(DESTINC)/%: $(INC)/%
+	@if [ ! -d $(DESTINC) ]; then mkdir -p $(DESTINC); fi
+	rm -f $@
+	cp $< $@
+
+%.$(ARCH).o : %.c
+	$(CC) $(FULL_CFLAGS) $(FULL_CPPFLAGS) -c $< -o $@
+
+$(BIN)/%.$(ARCH):
+	@if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi
+	$(CC) $(FULL_CFLAGS) -o $@ $^ $(FULL_LDFLAGS)
+	@echo "compiled $*"
+	@echo ""
+
+$(DESTBIN)/%: $(BIN)/%.$(ARCH) 
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN); fi
+	rm -f $(DESTBIN)/$*
+	cp $(BIN)/$*.$(ARCH) $(DESTBIN)/$*
+	@echo "installed $*"
+	@echo ""
+
+$(LIB):
+	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
+
+$(LIB)/%.$(ARCH).a:
+	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
+	rm -f $@
+	ar rcv $@ $^
+	$(RANLIB) $@
+	@echo "compiled library $*"
+	@echo ""
+
+$(DESTLIB)/%.a: $(LIB)/%.$(ARCH).a
+	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
+	rm -f $@
+	cp $< $@
+	@echo "installed static library $*"
+	@echo ""
+
+$(LIB)/%.$(ARCH).so:
+	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
+	rm -f $@
+	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+
+# shared objects have a different compilation on solaris:
+# gcc -shared -o $@ $^ -lc
+
+$(DESTLIB)/%.so: $(LIB)/%.$(ARCH).so
+	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
+	rm -f $@
+	cp $< $@
+	@echo "installed shared library $*"
+	@echo ""
+
+$(DESTMAN)/%: $(MAN)/%
+	@if [ ! -d $(DESTMAN) ]; then mkdir -p $(DESTMAN); fi
+	rm -f $@
+	cp $< $@
+
+clean:
+	rm -f `find . -name "*.o"`
+	rm -f `find . -name "*.o"`
+	rm -f `find . -name "*~"`
+	rm -f `find . -name "#*"`
+
+dist: clean
+	rm -rf $(BIN)
+	rm -rf $(LIB)
+
+# $@ : target filename
+# $* : matched word (%)
+# $< : first prereq
+# $^ : all prereqs
+
Index: /branches/base-1-6/Ohana/Makefile.in
===================================================================
--- /branches/base-1-6/Ohana/Makefile.in	(revision 11971)
+++ /branches/base-1-6/Ohana/Makefile.in	(revision 11971)
@@ -0,0 +1,140 @@
+# --------------------------------------------------------------------------- #
+# --------------------------------------------------------------------------- #
+#									      #
+#                 OOO    HH   HH    AAA    NN   NN    AAA		      #
+#               OO   OO  HH   HH  AA   AA  NNN  NN  AA   AA		      #
+#               OO   OO  HHHHHHH  AAAAAAA  NN N NN  AAAAAAA		      #
+#               OO   OO  HH   HH  AA   AA  NN  NNN  AA   AA		      #
+#                 OOO    HH   HH  AA   AA  NN   NN  AA   AA		      #
+#      								              #
+# --------------------------------------------------------------------------- #
+# --------------------------------------------------------------------------- #
+
+# This makefile compiles all Ohana package programs in the Elixir
+# system, and their libraries.  Most of the components in this
+# directory were created for Ohana, but there are a few libraries
+# which are from external sources: libjpeg, libpng, zlib, and
+# readline.  Extra care should be taken in compiling those libraries. 
+
+# Edit Configure to reflect the location of your installation 
+# or use the script 'configure'
+
+include Configure
+
+# .SILENT:								       
+default: all
+
+# The collection of Ohana programs.  Other components in the src
+# directory may be compiled by going to those directories. 
+PROGRAM =   \
+addstar     \
+delstar     \
+elixir      \
+gastro      \
+gastro2     \
+getstar     \
+gcompare    \
+imclean     \
+imregister  \
+kapa        \
+kii         \
+misc        \
+mosastro    \
+nightd      \
+opihi       \
+perl        \
+relphot     \
+shell       \
+tcl         \
+uniphot
+
+# any of these programs can be built with 'make (name)' 
+EXTRAS =     \
+opihi.v1    \
+fixcat      \
+gophot      \
+getusno     \
+lightcurve  \
+markrock    \
+photdbc     \
+markstar    \
+mosastro.v1 \
+mosastro.v2 \
+skycalc     
+
+OLD = mana status addusno addrefs addspphot
+
+LIBS = libtap libohana libfits libdvo libkapa
+
+# general build targets:
+libs:
+	@if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
+	mkdir -p $(DESTINC)
+	mkdir -p $(DESTLIB)
+	mkdir -p $(DESTBIN)
+	for i in $(LIBS); do make $$i.install || exit; done
+	chmod +x ohana-config
+	cp -f ohana-config $(DESTBIN)/
+
+bins: 
+	for i in $(PROGRAM); do make $$i; done
+
+all:
+	make libs || exit
+	for i in $(PROGRAM); do make $$i || exit; done
+
+extras:
+	for i in $(EXTRAS); do make $$i || exit; done
+
+pantasks:
+	make libs || exit
+	cd src/opihi; make pclient.install && exit
+	cd src/opihi; make pcontrol.install && exit
+	cd src/opihi; make pantasks.install && exit
+
+mana:
+	make libs
+	make kii.install
+	make kapa.install
+	cd src/opihi; make mana.install && exit
+
+dvoshell:
+	make libs
+	make kii.install
+	make kapa.install
+	cd src/opihi; make dvo.install && exit
+
+clean:
+	@if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
+	for i in $(LIBS); do make $$i.clean || exit; done
+	for i in $(PROGRAM); do make $$i.clean || exit; done
+	for i in $(EXTRAS); do make $$i.clean || exit; done
+	@rm -f `find . -name .mana`
+	@rm -f `find . -name .dvo`
+
+dist:
+	@if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
+	for i in $(LIBS); do make $$i.dist || exit; done
+	for i in $(PROGRAM); do make $$i.dist || exit; done
+
+install:
+	@if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
+	for i in $(LIBS); do make $$i.install || exit; done
+	for i in $(PROGRAM); do make $$i.install || exit; done
+
+install.extras:
+	for i in $(EXTRAS); do make $$i.install || exit; done
+
+# standard rules: targets are foo, foo.clean, foo.install, foo.dist
+$(PROGRAM) $(LIBS) $(EXTRAS): 
+	if [ -d "src/$@" ]; then (cd src/$@ && make); fi
+
+%.install:
+	mkdir -p bin/$(ARCH)
+	if [ -d "src/$*" ]; then (cd src/$* && make install); fi
+
+%.clean:
+	if [ -d "src/$*" ]; then (cd src/$* && make clean); fi
+
+%.dist:
+	(cd src/$* && make dist)
Index: /branches/base-1-6/Ohana/autogen.sh
===================================================================
--- /branches/base-1-6/Ohana/autogen.sh	(revision 11971)
+++ /branches/base-1-6/Ohana/autogen.sh	(revision 11971)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./configure.tcsh $*
Index: /branches/base-1-6/Ohana/config.tools
===================================================================
--- /branches/base-1-6/Ohana/config.tools	(revision 11971)
+++ /branches/base-1-6/Ohana/config.tools	(revision 11971)
@@ -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 Configure | sed "s|$argv[2]|$argv[3]|" > Configure.tmp
+mv -f Configure.tmp Configure
+exit 0;
Index: /branches/base-1-6/Ohana/configure
===================================================================
--- /branches/base-1-6/Ohana/configure	(revision 11971)
+++ /branches/base-1-6/Ohana/configure	(revision 11971)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# strip out CC, CFLAGS, CPPFLAGS, LDFLAGS and set env vars
+while (( $# > 0 )); do
+  skip=0
+
+  # strip out CC, set as env variable
+  echo $1 | grep "^CC=" > /dev/null
+  if (( $? == 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 (( $? == 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 (( $? == 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 (( $? == 0 )) ; then
+    val=`echo $1 | sed "s|^LDFLAGS=||"`
+    export LDFLAGS=$val
+    skip=1
+  fi
+  if (( $skip == 0 )) ; then
+    args="$args $1"
+  fi
+  shift
+done
+
+./configure.tcsh $args
Index: /branches/base-1-6/Ohana/configure.tcsh
===================================================================
--- /branches/base-1-6/Ohana/configure.tcsh	(revision 11971)
+++ /branches/base-1-6/Ohana/configure.tcsh	(revision 11971)
@@ -0,0 +1,493 @@
+#!/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
+
+# libX11.a
+# libsocket.a
+# libnsl.a
+# libpng.a
+# libjpeg.a
+# libz.a
+# libreadline.a
+# libtermcap.a
+
+# evaluate command-line options
+set vararch = 0
+set optimize = 0
+set pedantic = 0
+set memcheck = 0
+
+set prefix  = ""
+set bindir  = ""
+set libdir  = ""
+set incdir  = ""
+set mandir  = ""
+set datadir  = ""
+set sysconfdir  = ""
+
+set root    = ""
+set args    = ""
+
+while ("$1" != "") 
+ switch ("$1")
+  # options passed by jhbuild or others which we ignore
+  case --enable-maintainer-mode
+  case --no-create
+  case --no-recursion
+  case --sbindir
+  case --libexecdir*
+  case --sharedstatedir*
+  case --localstatedir*
+  case --oldincludedir*
+  case --infodir*
+   # we need to strip the --opt word and --opt=word versions
+   set word = `echo $1 | tr = ' '`
+   if ($#word == 1) shift
+   breaksw;
+  case --vararch
+   set vararch = 1
+   breaksw;
+  case --enable-optimize
+   set optimize = 1
+   breaksw;
+  case --enable-memcheck
+   set memcheck = 1
+   breaksw;
+  case --pedantic
+   set pedantic = 1
+   breaksw;
+  case --prefix*
+   if ("$1" == "--prefix") then
+     shift
+     set prefix = $1
+   else
+     set prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   set exec_prefix = $prefix
+   breaksw;
+  case --bindir*
+   if ("$1" == "--bindir") then
+     shift
+     set bindir = $1
+   else
+     set bindir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --libdir*
+   if ("$1" == "--libdir") then
+     shift
+     set libdir = $1
+   else
+     set libdir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --includedir*
+   if ("$1" == "--includedir") then
+     shift
+     set includedir = $1
+   else
+     set includedir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --sysconfdir*
+   if ("$1" == "--sysconfdir") then
+     shift
+     set sysconfdir = $1
+   else
+     set sysconfdir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --datadir*
+   if ("$1" == "--datadir") then
+     shift
+     set datadir = $1
+   else
+     set datadir = `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
+
+# set values for CC, CFLAGS, CPPFLAGS, LDFLAGS
+if (! $?CC) then
+  set CC = gcc
+endif  
+
+if (! $?CFLAGS) then
+  set CFLAGS = "-g -O0"
+endif  
+# optimize overrides user-supplied CFLAGS
+if ($optimize) set CFLAGS = "-O2"
+
+if (! $?CPPFLAGS) then
+  set CPPFLAGS = 
+endif  
+if ($pedantic) set CPPFLAGS = "$CPPFLAGS -Wall -Werror"
+if ($memcheck) set CPPFLAGS = "$CPPFLAGS -DOHANA_MEMORY"
+
+if (! $?LDFLAGS) then
+  set LDFLAGS = 
+endif  
+
+set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/openwin/lib /usr/local/lib"
+set needlibs   = "png z jpeg readline X11 pthread m"
+
+# /usr/local/include/libpng is really pretty lame...
+set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include /usr/openwin/include /usr/local/include/libpng"
+
+set needincs = ""
+set needincs = "$needincs X11/Xatom.h"
+set needincs = "$needincs X11/Xlib.h"
+set needincs = "$needincs X11/Xresource.h"
+set needincs = "$needincs X11/Xutil.h"
+set needincs = "$needincs X11/cursorfont.h"
+set needincs = "$needincs X11/keysym.h"
+set needincs = "$needincs X11/keysymdef.h"
+set needincs = "$needincs arpa/inet.h"
+set needincs = "$needincs ctype.h"
+set needincs = "$needincs errno.h"
+set needincs = "$needincs fcntl.h"
+set needincs = "$needincs glob.h"
+set needincs = "$needincs jpeglib.h"
+set needincs = "$needincs malloc.h"
+set needincs = "$needincs math.h"
+set needincs = "$needincs memory.h"
+set needincs = "$needincs netdb.h"
+set needincs = "$needincs netinet/ip.h"
+set needincs = "$needincs png.h"
+set needincs = "$needincs pthread.h"
+set needincs = "$needincs readline/history.h"
+set needincs = "$needincs readline/readline.h"
+set needincs = "$needincs signal.h"
+set needincs = "$needincs stdio.h"
+set needincs = "$needincs stdlib.h"
+set needincs = "$needincs string.h"
+set needincs = "$needincs sys/ipc.h"
+set needincs = "$needincs sys/resource.h"
+set needincs = "$needincs sys/sem.h"
+set needincs = "$needincs sys/socket.h"
+set needincs = "$needincs sys/stat.h"
+set needincs = "$needincs sys/time.h"
+set needincs = "$needincs sys/types.h"
+set needincs = "$needincs sys/uio.h"
+set needincs = "$needincs sys/un.h"
+set needincs = "$needincs sys/wait.h"
+set needincs = "$needincs time.h"
+set needincs = "$needincs unistd.h"
+set needincs = "$needincs values.h"
+set needincs = "$needincs zlib.h"
+
+# XXX need to have options for non-ANSI includes? (ie, varargs.h)
+# set needincs = "$needincs cfuncs.h" - from non-ANSI option in ohana.h
+# set needincs = "$needincs float.h" - is from missing_proto (CFHT)
+# set needincs = "$needincs floatingpoint.h" - is from missing_proto (CFHT)
+# set needincs = "$needincs stdarg.h" - from std includes (in gcc path)
+# set needincs = "$needincs varargs.h" - from std includes (in gcc path)
+
+# check the hardware architecture:
+set sys=`uname -s` 
+set ranlib = "ranlib"
+switch ($sys)
+ case IRIX64:
+   set arch="irix";
+   breaksw;
+ case SunOS:
+   set ver=`uname -r | awk '{print substr($1,1,1)}'`;
+   if ($ver == 5) then
+     set arch="sol";
+   else 
+     set arch="sun4";
+   endif
+   # sun (at least) seems to need the socket library (linux does not)
+   set needlibs = "$needlibs libsocket libnsl"
+   set ranlib = "touch"
+   breaksw;
+ case Linux:
+   set arch="linux";
+   if (-e /etc/sidious.config) set arch="sid";
+   set mach=`uname -m`
+   if ("$mach" == "x86_64") then
+    set arch="lin64";
+    set syslibpath = "/lib64 /usr/lib64 /usr/X11R6/lib64 $syslibpath"
+   endif
+   breaksw;
+ case HP-UX:
+    set arch="hpux";
+    breaksw;
+ default:
+   echo "unknown architecture";
+   exit 1;
+   breaksw;
+endsw
+echo "setting architecture to: $arch" 
+
+# set up the basic directory names:
+set root = `pwd`
+if ($prefix == "") set prefix = $root
+if ($vararch) then
+  set inc = $prefix/include/$arch
+  set lib = $prefix/lib/$arch
+else
+  set inc = $prefix/include
+  set lib = $prefix/lib
+endif
+if ($?LD_LIBRARY_PATH) then 
+  set libpath = `echo $LD_LIBRARY_PATH | tr ':' ' '`
+else
+  set libpath = ""
+endif
+
+# check for basic libraries
+echo ""
+echo "searching for needed external libraries..."
+set faillibs = ""
+set libflags = ""
+set libdirs  = ""
+set nonomatch
+foreach f ( $needlibs )
+    foreach g ( $syslibpath $lib $libpath )
+        if (! -e $g) continue
+	set name = $g/lib$f.a
+	if (-e $name[1]) goto got_lib;
+	set name = $g/lib$f.so*
+	if (-e $name[1]) goto got_lib;
+    end
+    echo "missing lib$f"
+    set faillibs = "$faillibs lib$f"
+    continue
+got_lib:
+    echo "found lib$f ($name[$#name])"
+    echo "$libdirs" | grep -- "-L$g " > /dev/null
+    if ($status) then
+      set libdirs  = "$libdirs-L$g "
+    endif
+    echo "$libflags" | grep -- "-l$f " > /dev/null
+    if ($status) then
+      set libflags = "$libflags-l$f "
+    endif
+end
+
+# we need a curses library; can choose one of the following:
+# check for termcap, curses, etc
+foreach f ( ncurses curses termcap )
+    foreach g ( $syslibpath $lib $libpath )
+	set name = $g/lib$f.a
+	if (-e $name[1]) goto got_curses;
+	set name = $g/lib$f.so*
+	if (-e $name[1]) goto got_curses;
+    end
+end
+set faillibs = "$faillibs (ncurses | curses | termcap)"
+echo "missing a valid curses library"
+echo "missing: $faillibs"
+echo "please find one of them and install them in $lib"
+exit 1
+
+got_curses:
+  echo "found $f ($name[$#name])"
+  echo "$libdirs" | grep -- "-L$g " > /dev/null
+  if ($status) then
+    set libdirs  = "$libdirs-L$g "
+  endif
+  echo "$libflags" | grep -- "-l$f " > /dev/null
+  if ($status) then
+    set libflags = "$libflags-l$f"
+  endif
+
+if ("$faillibs" != "") then
+  echo "your installation is missing some important libraries"
+  echo "missing: $faillibs"
+  echo "please find them and install them in $lib"
+  exit 1
+endif    
+
+# check for headers
+echo ""
+echo "searching for needed external header files..."
+set failincs = ""
+set incdirs = ""
+foreach f ( $needincs )
+  foreach g ( $sysincpath $inc )
+    set name = "$g/$f"
+    if (-e $name) goto got_inc;
+  end
+  echo "missing $f"
+  set failincs = "$failincs $f"
+  continue
+got_inc:
+  echo "found $f ($name)"
+  echo "$incdirs" | grep -- "-I$g " > /dev/null
+  if ($status) then
+    set incdirs = "$incdirs-I$g "
+  endif
+end
+
+if ("$failincs" != "") then
+  echo "your installation is missing some important library headers"
+  echo "please find them and install them in $inc"
+  exit 1
+endif    
+
+echo 
+echo "Compiler options:"
+echo "CC: $CC"
+echo "CFLAGS: $CFLAGS"
+echo "CPPFLAGS: $CPPFLAGS"
+echo "LDFLAGS: $LDFLAGS"
+
+echo
+echo "Additional compiler flags:"
+echo "INCDIRS: $incdirs"
+echo "LIBDIRS: $libdirs"
+echo "LIBFLAGS: $libflags"
+
+echo 
+echo "ARCH: $arch"
+echo "ROOT: $root"
+echo "PREFIX: $prefix"
+echo 
+
+# the config.tools fixconf operations below interpolate values in Configure
+if (-e Configure) mv Configure Configure.bak
+cp Configure.in Configure
+
+# we don't currently need to modify the Makefile but since configure
+# should create a new Makefile, we need to do this:
+cp -f Makefile.in Makefile
+
+# the ROOTDIR defines the location of the source tree
+./config.tools fixconf @ROOTDIR@  "$root"
+
+# the following entries define the target installation locations 
+
+# BINDIR (DESTBIN) holds the output binary files
+if ("$bindir" == "") then
+  set subdir = bin
+  set subpath = bin
+  if ($vararch) then 
+    set subdir = 'bin/$(ARCH)'
+    set subpath = "bin/$arch"
+  endif
+  set bindir = $prefix/$subdir
+  set binpath = $prefix/$subpath
+endif
+set bindir = `./config.tools fixpath $bindir`
+./config.tools fixconf @BINDIR@ $bindir
+echo DESTBIN $bindir
+
+# INCDIR (DESTINC) holds the output header files
+if ("$incdir" == "") then
+  set subdir = include
+  if ($vararch) set subdir = 'include/$(ARCH)'
+  set incdir = $prefix/$subdir
+endif
+set incdir = `./config.tools fixpath $incdir`
+./config.tools fixconf @INCDIR@ $incdir
+echo DESTINC $incdir
+
+# LIBDIR (DESTLIB) holds the output library files
+if ("$libdir" == "") then
+  set subdir = lib
+  if ($vararch) set subdir = 'lib/$(ARCH)'
+  set libdir = $prefix/$subdir
+endif
+set libdir = `./config.tools fixpath $libdir`
+./config.tools fixconf @LIBDIR@ $libdir
+echo DESTLIB $libdir
+
+# 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
+
+# DATADIR (DESTDATA) holds the general non-binary files
+if ("$datadir" == "") then
+  set datadir = $prefix/share
+endif
+set datadir = `./config.tools fixpath $datadir`
+./config.tools fixconf @DATADIR@ $datadir
+echo DESTDATA $datadir
+
+# the vararch option defines an automatic arch-dependent directory 
+# tree for DESTBIN, DESTLIB, DESTINC
+if ($vararch) then
+  ./config.tools fixconf "^\s*ARCH" "# ARCH"
+else 
+  ./config.tools fixconf @ARCHVAL@ $arch
+endif 
+
+# INCDIRS, LIBDIRS, LIBFLAGS define include and library flags needed
+# by the externally-supplied libraries
+./config.tools fixconf @INCDIRS@  "$incdirs"
+./config.tools fixconf @LIBDIRS@  "$libdirs"
+./config.tools fixconf @LIBFLAGS@ "$libflags"
+
+# these are the compiler options
+./config.tools fixconf @CC@ "$CC"
+./config.tools fixconf @CFLAGS@ "$CFLAGS"
+./config.tools fixconf @CPPFLAGS@ "$CPPFLAGS"
+./config.tools fixconf @LDFLAGS@ "$LDFLAGS"
+
+# other architecture dependent options
+./config.tools fixconf @RANLIB@ "$ranlib"
+
+cat ohana-config.in | sed "s|@INCDIR@|$incdir|" | sed "s|@LIBDIR@|$libdir|" | sed "s|(ARCH)|ARCH|" > ohana-config
+
+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
+  --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]
+
+EOF
+ exit 2;
Index: /branches/base-1-6/Ohana/ohana-config.in
===================================================================
--- /branches/base-1-6/Ohana/ohana-config.in	(revision 11971)
+++ /branches/base-1-6/Ohana/ohana-config.in	(revision 11971)
@@ -0,0 +1,25 @@
+#!/bin/csh -f
+
+if ($#argv != 1) then
+  echo "USAGE: ohana-config [option]"
+  echo "valid options:"
+  echo " --libs"
+  echo " --cflags"
+  echo " --prefix"
+  exit 2
+endif
+
+switch ($1) 
+  case "--libs":
+    echo "-L@LIBDIR@ -lkapa -ldvo -lFITS -lohana"
+    shift
+    breaksw
+  case "--cflags":
+    echo "-I@INCDIR@"
+    shift
+    breaksw
+  default:
+    echo "unknown option $1"
+    exit 2
+endsw
+ 
