Index: configure.ac
===================================================================
RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/configure.ac,v
retrieving revision 1.51
diff -u -r1.51 configure.ac
--- configure.ac	13 Oct 2005 23:31:16 -0000	1.51
+++ configure.ac	29 Oct 2005 03:18:18 -0000
@@ -11,21 +11,25 @@
 PSLIB_LT_VERSION="0:9:0"
 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
 
-dnl Determine the location of GNU sed
-AC_CHECK_PROGS([SED],[gsed sed])
-if test "${SED}" == ""
-then
-  AC_MSG_ERROR([GNU SED is required.])
-fi
-AC_SUBST(SED,[${SED}])
+dnl ------------------- PERL options ---------------------
+  AC_ARG_WITH(perl,
+    [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
+    [AC_CHECK_PROG(PERL, $withval, $withval)],
+    [AC_CHECK_PROG(PERL, perl, `which perl`)])
+    if test "$PERL" == ""
+    then
+      AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
+    fi
+    AC_SUBST(PERL,$PERL)
 
 SUBDIR="etc src test" dnl don't include 'swig', as it is optional
 
 SRCPATH='${top_srcdir}/src'
 SRCDIRS="sys astro db fft fits imageops math mathtypes types xml"
-SRCINC=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
+# escape two escapes at this level so \\ gets passed to the shell and \ to perl
+SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`
 SRCINC="-I${SRCPATH=} ${SRCINC=}"
-SRCSUBLIBS=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|\1/libpslib\1.la|g"`
+SRCSUBLIBS=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`
 AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
 AC_SUBST(SRCINC,${SRCINC=})
 AC_SUBST(ABS_SRCDIR,`pwd`) dnl assuming configure is run in top directory -- is there something better?
@@ -238,17 +242,6 @@
      [AC_MSG_ERROR([SWIG is required.  Obtain it at www.swig.org or use --with-swig to specify its install location.])])
   SUBDIR="${SUBDIR=} swig"
 
-dnl ------------------- PERL options ---------------------
-  AC_ARG_WITH(perl,
-    [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
-    [AC_CHECK_PROG(PERL, $withval, $withval)],
-    [AC_CHECK_PROG(PERL, perl, `which perl`)])
-    if test "$PERL" == ""
-    then
-      AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
-    fi
-    AC_SUBST(PERL,$PERL)
-
 dnl ---------------- PERLPREFIX option -------------------
   AC_ARG_WITH(perlprefix,
     [AS_HELP_STRING(--with-perlprefix=DIR,Specify prefix of Perl Module's installation. (default=PREFIX))],
Index: ./etc/pslib/Makefile.am
===================================================================
RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/etc/pslib/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- ./etc/pslib/Makefile.am	13 Sep 2005 01:11:51 -0000	1.9
+++ ./etc/pslib/Makefile.am	29 Oct 2005 03:18:18 -0000
@@ -7,7 +7,7 @@
 EXTRA_DIST = psTime.xml pslib.config.template
 
 pslib.config: pslib.config.template
-	sed 's|PREFIX|$(prefix)|' $? > $@
+	$(PERL) -pe 's|PREFIX|$(prefix)|' $? > $@
 
 $(sysconfdir)/pslib:
 	mkdir -p -m 755 $(sysconfdir)/pslib
Index: ./src/Makefile.am
===================================================================
RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/src/Makefile.am,v
retrieving revision 1.18
diff -u -r1.18 Makefile.am
--- ./src/Makefile.am	6 Oct 2005 22:41:08 -0000	1.18
+++ ./src/Makefile.am	29 Oct 2005 03:18:18 -0000
@@ -24,5 +24,5 @@
 	psErrorText.h
 
 install-exec-hook: libpslib.la
-	sed "s|\(^dependency_libs=.*\)|dependency_libs=\'$(PSLIB_LIBS)\'|" $(libdir)/libpslib.la > libpslib.la.temp
+	$(PERL) -pe "s|(^dependency_libs=.*)|dependency_libs=\'$(PSLIB_LIBS)\'|" $(libdir)/libpslib.la > libpslib.la.temp
 	$(INSTALL) libpslib.la.temp $(libdir)/libpslib.la
Index: ./swig/Makefile.am
===================================================================
RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/swig/Makefile.am,v
retrieving revision 1.18
diff -u -r1.18 Makefile.am
--- ./swig/Makefile.am	27 Sep 2005 00:04:07 -0000	1.18
+++ ./swig/Makefile.am	29 Oct 2005 03:18:18 -0000
@@ -6,7 +6,7 @@
 
 # this is going into a make file one directory deeper in the tree so the
 # realitive paths need to be adjusted
-SWIGINC=`echo "${SRCINC}" | ${SED} "s|-I|-I../|g"`
+SWIGINC=`echo "${SRCINC}" | ${PERL} -pe "s|-I|-I../|g"`
 
 ####################################################
 ## PsLibModule swig build section.
Index: ./test/astro/Makefile.am
===================================================================
RCS file: /usr/local/cvs/repositories/pan-starrs/datasys/IPP/psLib/test/astro/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- ./test/astro/Makefile.am	14 Oct 2005 00:07:37 -0000	1.11
+++ ./test/astro/Makefile.am	29 Oct 2005 03:18:18 -0000
@@ -43,16 +43,16 @@
 CLEANFILES = $(TESTS) $(check_DATA) temp/*
 
 pslib.config: $(top_srcdir)/etc/pslib/pslib.config.template
-	sed 's|PREFIX|$(top_srcdir)|' $? > $@
+	$(PERL) -pe 's|PREFIX|$(top_srcdir)|' $? > $@
 
 test.psTime.config1: data/test.psTime.config1.template
 	cp $? $@
 
 test.psTime.config2: data/test.psTime.config2.template
-	sed 's|PREFIX|$(top_srcdir)|' $? > $@
+	$(PERL) -pe 's|PREFIX|$(top_srcdir)|' $? > $@
 
 test.psTime.config3: data/test.psTime.config3.template
-	sed 's|PREFIX|$(top_srcdir)|' $? > $@
+	$(PERL) -pe 's|PREFIX|$(top_srcdir)|' $? > $@
 
 test.psTime.config4: data/test.psTime.config4.template
 	cp $? $@
