--- configure.in	2008-08-06 00:36:05.000000000 +0530
+++ configure.in	2008-09-10 16:44:26.000000000 +0530
@@ -20,6 +20,7 @@ AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
+AC_PROG_LIBTOOL
 AC_PROG_MAKE_SET
 AC_PROG_RANLIB
 
@@ -82,6 +83,7 @@ AC_OUTPUT(                  \
     debian/changelog        \
     debian/Makefile         \
     libpst.spec             \
+    libpst.pc		    \
     html/Makefile           \
     info/Makefile           \
     man/Makefile            \
--- Makefile.am	2008-08-06 00:36:05.000000000 +0530
+++ Makefile.am	2008-09-10 16:46:11.000000000 +0530
@@ -2,5 +2,9 @@ SUBDIRS = src man html info debian
 htmldir = ${datadir}/doc/@PACKAGE@-@VERSION@
 html_DATA = AUTHORS COPYING ChangeLog NEWS README
 CLEANFILES = xml/libpst xml/Makefile
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libpst.pc
+
 EXTRA_DIST = Doxyfile libpst.html.tar.gz libpst.spec $(wildcard xml/M*) $(wildcard xml/h*) $(wildcard xml/lib*)
 
--- src/Makefile.am	2008-08-06 00:36:05.000000000 +0530
+++ src/Makefile.am	2008-09-10 16:41:15.000000000 +0530
@@ -11,10 +11,38 @@ readpstlog_SOURCES  = $(hfiles) readpstl
 pst2ldif_SOURCES    = $(hfiles) pst2ldif.cpp libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c
 pst2dii_SOURCES	    = $(hfiles) pst2dii.cpp  libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c
 
+lspst_CFLAGS = $(AM_CFLAGS)
+readpst_CFLAGS = $(AM_CFLAGS)
+readpstlog_CFLAGS = $(AM_CFLAGS)
+pst2ldif_CFLAGS = $(AM_CFLAGS)
+pst2dii_CFLAGS = $(AM_CFLAGS)
+
 deltasearch_SOURCES = deltasearch.cpp debug.c
 dumpblocks_SOURCES  = dumpblocks.c    debug.c libpst.c libstrfunc.c timeconv.c vbuf.c
 getidblock_SOURCES  = getidblock.c    debug.c libpst.c libstrfunc.c timeconv.c vbuf.c
 
+deltasearch_CFLAGS = $(AM_CFLAGS)
+dumpblocks_CFLAGS  = $(AM_CFLAGS)
+getidblock_CFLAGS = $(AM_CFLAGS)
+
+lib_LTLIBRARIES = libpst.la 
+
+libpst_la_SOURCES = 	\
+	libpst.c	\
+	libpst.h	\
+	libstrfunc.c	\
+	libstrfunc.h	\
+	version.h	\
+	timeconv.c	\
+	timeconv.h	\
+	common.h	\
+	lspst.c		\
+	vbuf.c		\
+	vbuf.h		\
+	debug.c	
+
+libpst_la_LDFLAGS = -no-undefined
+
 if NEED_XGETOPT
     lspst_SOURCES       += XGetopt.c
     readpst_SOURCES     += XGetopt.c
@@ -28,6 +56,16 @@ EXTRA_DIST = testdebug.c
 # set the include path found by configure
 INCLUDES= $(all_includes)
 
+libpstincludedir = $(includedir)/libpst
+libpstinclude_HEADERS =				\
+	define.h	\
+	libpst.h	\
+	version.h	\
+	timeconv.h	\
+	common.h	\
+	vbuf.h		\
+	libstrfunc.h	
+
 # the library search path.
 lspst_LDFLAGS      = $(all_libraries)
 readpst_LDFLAGS    = $(all_libraries)
--- /dev/null	2008-06-07 01:09:59.000000000 +0530
+++ libpst.pc.in	2008-09-10 16:41:15.000000000 +0530
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libpst
+Description: A library for reading PST files
+Version: @VERSION@
+Requires: 
+Libs: -L${libdir} -lpst
+Cflags: -I${includedir}
