b7168d0af9615fc2e411f1a0ad025d567ca2bd74
diff --git a/Makefile.am b/Makefile.am
index b2b43d3..f1d5f00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,6 +14,9 @@ if ENABLE_THUMBNAILER
 SUBDIRS += thumbnailer
 endif
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = evince.pc
+
 # Applications 
 
 intltool_extra = intltool-extract.in intltool-merge.in intltool-update.in
diff --git a/configure.ac b/configure.ac
index 2c213de..3cb2f0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -414,6 +414,7 @@ AC_SUBST(EVINCE_MIME_TYPES)
 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
 
 AC_CONFIG_FILES([
+evince.pc
 backend/Makefile
 backend/comics/Makefile
 backend/djvu/Makefile
diff --git a/evince.pc.in b/evince.pc.in
new file mode 100644
index 0000000..884394b
--- /dev/null
+++ b/evince.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/evince/@EV_API_VERSION@
+
+Name: Evince
+Description: GNOME document viewer backend and view libraries
+Version: @VERSION@
+Requires: glib-2.0 gthread-2.0 gio-2.0 gtk+-2.0
+Libs: -L${libdir}
+Cflags: -I${includedir}
diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am
index 4a95117..cf11ea2 100644
--- a/libdocument/Makefile.am
+++ b/libdocument/Makefile.am
@@ -1,4 +1,5 @@
 INCLUDES=						\
+	-DG_LOG_DOMAIN=\"EvDocument\"			\
 	-DEVINCE_UIDIR=\"$(pkgdatadir)\"		\
 	-DGNOMELOCALEDIR=\"$(datadir)/locale\"		\
 	-DEV_BACKENDSDIR=\"$(libdir)/evince/backends\"	\
@@ -8,7 +9,6 @@ INCLUDES=						\
 
 lib_LTLIBRARIES = libevbackend.la
 
-libevbackend_la_LDFLAGS = -export-dynamic
 libevbackend_la_LIBADD = $(LIBDOCUMENT_LIBS)
 
 NOINST_H_FILES =				\
@@ -46,7 +46,7 @@ INST_H_FILES = 					\
 	ev-selection.h				\
 	ev-transition-effect.h
 
-headerdir = $(prefix)/include/evince/@EV_API_VERSION@/ev-backend
+headerdir = $(includedir)/evince/$(EV_API_VERSION)/ev-backend
 header_DATA = $(INST_H_FILES)
 
 libevbackend_la_SOURCES=			\
diff --git a/libview/Makefile.am b/libview/Makefile.am
index 0134348..2f8e9a9 100644
--- a/libview/Makefile.am
+++ b/libview/Makefile.am
@@ -1,4 +1,5 @@
 INCLUDES=					\
+	-DG_LOG_DOMAIN=\"EvView\"		\
 	-DGNOMELOCALEDIR=\"$(datadir)/locale\"	\
 	-I$(top_srcdir)/libdocument		\
 	$(LIBVIEW_CFLAGS)			\
@@ -7,7 +8,6 @@ INCLUDES=					\
 
 lib_LTLIBRARIES = libevview.la
 
-libevview_la_LDFLAGS = -export-dynamic
 libevview_la_LIBADD = $(LIBVIEW_LIBS)
 
 NOINST_H_FILES =			\
@@ -25,7 +25,7 @@ INST_H_FILES = 				\
 	ev-view.h			\
 	ev-view-type-builtins.h
 
-headerdir = $(prefix)/include/evince/@EV_API_VERSION@/ev-view
+headerdir = $(includedir)/evince/$(EV_API_VERSION)/ev-view
 header_DATA = $(INST_H_FILES)
 
 libevview_la_SOURCES = 			\
@@ -51,11 +51,11 @@ BUILT_SOURCES = 			\
 CLEANFILES = $(BUILT_SOURCES) stamp-ev-view-type-builtins.h
 
 ev-view-marshal.h: $(srcdir)/ev-view-marshal.list
-	$(GLIB_GENMARSHAL) --prefix=ev_view_marshal $(srcdir)/ev-view-marshal.list --header > $@
+	$(GLIB_GENMARSHAL) --prefix=ev_view_marshal $(srcdir)/ev-view-marshal.list --header --internal > $@
 
 ev-view-marshal.c: $(srcdir)/ev-view-marshal.list
-	echo '#include "ev-view-marshal.h"' > ev-view-marshal.c
-	$(GLIB_GENMARSHAL) --prefix=ev_view_marshal $(srcdir)/ev-view-marshal.list --body >> $@
+	echo '#include <config.h>' > ev-view-marshal.c
+	$(GLIB_GENMARSHAL) --prefix=ev_view_marshal $(srcdir)/ev-view-marshal.list --header --internal --body >> $@
 
 ev-view-type-builtins.h: stamp-ev-view-type-builtins.h
 	@true
