diff src/Makefile.am @ 95:ff1743cbe4aa

initial attempt at building a shared library
author Carl Byington <carl@five-ten-sg.com>
date Sat, 13 Sep 2008 20:15:40 -0700
parents 3cb02cb1e6cd
children 0f1492b7fe8b
line wrap: on
line diff
--- a/src/Makefile.am	Tue Sep 09 11:11:56 2008 -0700
+++ b/src/Makefile.am	Sat Sep 13 20:15:40 2008 -0700
@@ -9,12 +9,44 @@
 readpst_SOURCES     = $(hfiles) readpst.c    libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c
 readpstlog_SOURCES  = $(hfiles) readpstlog.c                                  debug.c
 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
-
+pst2dii_SOURCES     = $(hfiles) pst2dii.cpp  libpst.c timeconv.c libstrfunc.c debug.c lzfu.c vbuf.c
 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
 
+if BUILD_LIBPST_SHARED
+    lspst_CFLAGS        = $(AM_CFLAGS)
+    readpst_CFLAGS      = $(AM_CFLAGS)
+    readpstlog_CFLAGS   = $(AM_CFLAGS)
+    pst2ldif_CFLAGS     = $(AM_CFLAGS)
+    pst2dii_CFLAGS      = $(AM_CFLAGS)
+    deltasearch_CFLAGS  = $(AM_CFLAGS)
+    dumpblocks_CFLAGS   = $(AM_CFLAGS)
+    getidblock_CFLAGS   = $(AM_CFLAGS)
+    lib_LTLIBRARIES = libpst.la
+    libpst_la_SOURCES = common.h        \
+                        debug.c 		\
+                        libpst.c        \
+                        libpst.h        \
+                        libstrfunc.c    \
+                        libstrfunc.h    \
+                        lspst.c         \
+                        timeconv.c      \
+                        timeconv.h      \
+                        vbuf.c          \
+                        vbuf.h          \
+                        version.h
+    libpst_la_LDFLAGS = -no-undefined
+    libpstincludedir = $(includedir)/libpst
+    libpstinclude_HEADERS = common.h        \
+                            define.h        \
+                            libpst.h        \
+                            libstrfunc.h	\
+                            timeconv.h      \
+                            vbuf.h          \
+                            version.h
+endif
+
 if NEED_XGETOPT
     lspst_SOURCES       += XGetopt.c
     readpst_SOURCES     += XGetopt.c