Index: /trunk/psphot/configure.ac
===================================================================
--- /trunk/psphot/configure.ac	(revision 7437)
+++ /trunk/psphot/configure.ac	(revision 7438)
@@ -65,4 +65,9 @@
 dnl ------------------------------------------------------------
 
+AC_PATH_PROG([ERRORCODES], [psParseErrorCodes], [missing])
+if test "$ERRORCODES" = "missing" ; then
+  AC_MSG_ERROR([psParseErrorCodes is required])
+fi
+
 PKG_CHECK_MODULES(PSLIB, pslib >= 0.9.0)
 PKG_CHECK_MODULES(PSMODULE, psmodule >= 0.0.0)
Index: /trunk/psphot/src/Makefile.am
===================================================================
--- /trunk/psphot/src/Makefile.am	(revision 7437)
+++ /trunk/psphot/src/Makefile.am	(revision 7438)
@@ -1,12 +1,14 @@
+
 lib_LTLIBRARIES = libpsphot.la
 libpsphot_la_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(psphot_CFLAGS)
-libpsphot_la_LDFLAGS = $(PSMODULE_LIBS) $(PSLIB_LIBS)
-libpsphot_la_SOURCES = $(psphot_SOURCES)
+# libpsphot_la_LDFLAGS = $(PSMODULE_LIBS) $(PSLIB_LIBS)
 
 bin_PROGRAMS = psphot
 psphot_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(psphot_CFLAGS)
 psphot_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS)
+psphot_LDADD = libpsphot.la
 
-PSLIB_DIR = `pslib-config --prefix`
+psphot_SOURCES = \
+	psphot.c		
 
 # psphot_CPPFLAGS = $(libpsphot_la_CPPFLAGS)
@@ -14,6 +16,5 @@
 # psphot_LDADD = libpsphot.la
 
-psphot_SOURCES =		\
-	psphot.c		\
+libpsphot_la_SOURCES = \
 	errorCodes.c		\
 	psphotModelGroupInit.c	\
@@ -48,9 +49,10 @@
 	psphotCleanup.c	   	
 
-noinst_HEADERS =		\
+include_HEADERS = \
 	psphot.h		
 
 clean-local:
 	-rm -f TAGS
+
 # Tags for emacs
 tags:
@@ -63,6 +65,6 @@
 
 psphotErrorCodes.h : errorCodes.dat psphotErrorCodes.h.in
-	$(PSLIB_DIR)/bin/psParseErrorCodes --data=errorCodes.dat --outdir=. \
-						psphotErrorCodes.h
+	$(ERRORCODES) --data=errorCodes.dat --outdir=. psphotErrorCodes.h
+
 errorCodes.c : errorCodes.dat errorCodes.c.in psphotErrorCodes.h
-	$(PSLIB_DIR)/bin/psParseErrorCodes --data=errorCodes.dat --outdir=. errorCodes.c
+	$(ERRORCODES) --data=errorCodes.dat --outdir=. errorCodes.c
