if BUILD_GLIB
DIRGLIB = glib-wv
INCGLIB = -I$(srcdir)/glib-wv
LIBGLIB = glib-wv/libglib.la
else
DIRGLIB = 
INCGLIB = 
LIBGLIB = 
endif

if BUILD_EXPAT
DIREXPAT = expat
INCEXPAT = -I$(srcdir)/expat/xmlparse
LIBEXPAT = expat/libexpat.la
else
DIREXPAT = 
INCEXPAT = 
LIBEXPAT = 
endif

if BUILD_EXPORTER
DIREXPORTER = exporter
LIBEXPORTER = exporter/libexporter.la
else
DIREXPORTER = 
LIBEXPORTER = 
endif

DIST_SUBDIRS = xml help wingdingfont patterns glib-wv libole2 magick expat exporter .

SUBDIRS = xml help wingdingfont patterns $(DIRGLIB) libole2 magick $(DIREXPAT) $(DIREXPORTER) .

DEFS = @DEFS@ -DVERSION=\"@VERSION@\" -DXMLCONFIG=\"$(pkgdatadir)/wvConfig.xml\" -DHTMLCONFIG=\"$(pkgdatadir)/wvHtml.xml\" -DWVDATADIR=\"$(datadir)/wv\"

INCLUDES = -I. -I$(top_builddir) -I$(srcdir) \
	-I$(srcdir)/magick -I$(srcdir)/libole2 $(INCGLIB) $(INCEXPAT)

CFLAGS = @CFLAGS@ @ANSI_CFLAGS@

CPPFLAGS = @CPPFLAGS@ @WMF_CFLAGS@ @XML_CFLAGS@ @GLIB_CFLAGS@ @ICONV_CFLAGS@ @PNG_CFLAGS@ @ZLIB_CFLAGS@

WVLIBS = @WMF_LIBS@ @XML_LIBS@ @GLIB_LIBS@ @ICONV_LIBS@ @PNG_LIBS@ @ZLIB_LIBS@ @LIBS@ -lm

wvhdrdir = $(includedir)/wv

wvhdr_HEADERS = wv.h

bin_SCRIPTS = wvCleanLatex wvHtml wvDocBook wvAbw wvMime wvPS wvDVI wvLatex wvPDF wvText wvWml

bin_PROGRAMS = wvSummary wvWare wvRTF wvConvert wvVersion

lib_LTLIBRARIES = libwv.la

GETOPT = @LIBOBJS@

wvSummary_LDADD = libwv.la $(GETOPT)
wvWare_LDADD = libwv.la $(GETOPT)
wvRTF_LDADD = libwv.la $(GETOPT)
wvConvert_LDADD = libwv.la $(GETOPT)
wvVersion_LDADD = libwv.la $(GETOPT)

libwv_la_LIBADD = magick/libmagick.la libole2/libole2.la $(LIBGLIB) $(LIBEXPAT) $(LIBEXPORTER) $(WVLIBS)
libwv_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) -export-dynamic
libwv_la_SOURCES = \
	winmmap.c \
	support.c \
	list.c \
	stylesheet.c \
	sprm.c \
	blip.c \
	utf.c \
	field.c \
	decompresswmf.c \
	dop.c \
	roman.c \
	fib.c \
	frd.c \
	atrd.c \
	sed.c \
	font.c \
	ffn.c \
	fld.c \
	bkf.c \
	dttm.c \
	generic.c \
	error.c \
	unicode.c \
	sttbf.c \
	xst.c \
	fspa.c \
	fdoa.c \
	lst.c \
	lvl.c \
	lfo.c \
	filetime.c \
	chp.c \
	brc.c \
	anld.c \
	shd.c \
	dcs.c \
	numrm.c \
	asumyi.c \
	version.c \
	lspd.c \
	phe.c \
	tlp.c \
	tc.c \
	tap.c \
	pap.c \
	bintree.c \
	decode_simple.c \
	pcd.c \
	prm.c \
	clx.c \
	bte.c \
	bx.c \
	fkp.c \
	text.c \
	decode_complex.c \
	wvTextEngine.c \
	wvHtmlEngine.c \
	wvConfig.c \
	wvparse.c \
	reasons.c \
	sep.c \
	anlv.c \
	olst.c \
	asumy.c \
	bkd.c \
	bkl.c \
	dogrid.c \
	doptypography.c \
	pgd.c \
	rs.c \
	rr.c \
	tbd.c \
	ftxbxs.c \
	wkb.c \
	picf.c \
	crc32.c \
	md5.c \
	rc4.c \
	decrypt97.c \
	decrypt95.c \
	twips.c \
	table.c \
	symbol.c \
	mtextra.c \
	fopt.c \
	fbse.c \
	escher.c \
	bmptopng.c \
	basename.c \
	laolareplace.c \
	isbidi.c \
	plcf.c

OTHERHEADERS = \
	bintree.h \
	crc32.h \
	getopt.h \
	hdr.h \
	md5.h \
	plan9.h \
	rc4.h \
	roman.h \
	utf.h \
	winmmap.h \
	wvinternal.h

OTHERSCRIPTS = wvMime

pkgconfigdir = $(libdir)/pkgconfig

pkgconfig_DATA = wv-1.0.pc

EXTRA_DIST = wv-1.0.pc.in autogen.sh $(OTHERHEADERS) $(OTHERSCRIPTS)
