]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/dvi-document.c
[windows] Guess texmf.cnf location from mktexpk executable
[evince.git] / backend / dvi / dvi-document.c
index 863276d76d5e2259084beeb0ec8cf0d84e6cbad8..d1411a8e6cc21f95dbdd5ab28e329a4ed19d378b 100644 (file)
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include "dvi-document.h"
+#include "texmfcnf.h"
 #include "ev-document-thumbnails.h"
 #include "ev-document-misc.h"
 #include "ev-file-exporter.h"
 
 #include <glib/gi18n-lib.h>
 #include <ctype.h>
-#include <sys/wait.h>
+#ifdef G_OS_WIN32
+# define WIFEXITED(x) ((x) != 3)
+# define WEXITSTATUS(x) (x)
+#else
+# include <sys/wait.h>
+#endif
 #include <stdlib.h>
 
 GMutex *dvi_context_mutex = NULL;
@@ -234,10 +240,14 @@ dvi_document_class_init (DviDocumentClass *klass)
 {
        GObjectClass    *gobject_class = G_OBJECT_CLASS (klass);
        EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass);
+       gchar *texmfcnf;
 
        gobject_class->finalize = dvi_document_finalize;
 
-       mdvi_init_kpathsea ("evince", MDVI_MFMODE, MDVI_FALLBACK_FONT, MDVI_DPI);
+       texmfcnf = get_texmfcnf();
+       mdvi_init_kpathsea ("evince", MDVI_MFMODE, MDVI_FALLBACK_FONT, MDVI_DPI, texmfcnf);
+       g_free(texmfcnf);
+
        mdvi_register_special ("Color", "color", NULL, dvi_document_do_color_special, 1);
        mdvi_register_fonts ();