From 95c3037a4540ee71514c823c43fab081279c88b7 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Sun, 6 Mar 2011 01:43:04 +0100 Subject: [PATCH] Updated Makefile and register file type --- config.mk | 3 +++ ft/djvu/Makefile | 4 ++-- ft/djvu/djvu.c | 9 +++++++++ ft/pdf/Makefile | 4 ++-- ft/pdf/pdf.c | 9 +++++++++ 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/config.mk b/config.mk index 086388e..b0200e1 100644 --- a/config.mk +++ b/config.mk @@ -20,6 +20,9 @@ CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length $(INCS) # debug DFLAGS = -g +# ld +LDFLAGS = -rdynamic + # compiler CC ?= gcc diff --git a/ft/djvu/Makefile b/ft/djvu/Makefile index 02cabfe..83193ab 100644 --- a/ft/djvu/Makefile +++ b/ft/djvu/Makefile @@ -29,11 +29,11 @@ ${DOBJECTS}: config.mk ${PLUGIN}: ${OBJECTS} @echo LD $@ - @${LD} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS) + @${CC} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS) ${LIBS} ${PLUGIN}-debug: ${DOBJECTS} @echo LD $@ - @${LD} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS) + @${CC} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS) ${LIBS} clean: @rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so ${PLUGIN}-debug.so diff --git a/ft/djvu/djvu.c b/ft/djvu/djvu.c index b7040a8..00f82cb 100644 --- a/ft/djvu/djvu.c +++ b/ft/djvu/djvu.c @@ -5,6 +5,15 @@ #include "djvu.h" #include "../../zathura.h" +bool +plugin_register(void) +{ + zathura_document_plugin_register("djvu", djvu_document_open); + zathura_document_plugin_register("DJVU", djvu_document_open); + + return true; +} + bool djvu_document_open(zathura_document_t* document) { diff --git a/ft/pdf/Makefile b/ft/pdf/Makefile index ce038cb..e260d91 100644 --- a/ft/pdf/Makefile +++ b/ft/pdf/Makefile @@ -29,11 +29,11 @@ ${DOBJECTS}: config.mk ${PLUGIN}: ${OBJECTS} @echo LD $@ - @${LD} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS) + @${CC} -shared ${LDFLAGS} -o ${PLUGIN}.so $(OBJECTS) ${LIBS} ${PLUGIN}-debug: ${DOBJECTS} @echo LD $@ - @${LD} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS) + @${CC} -shared ${LDFLAGS} -o ${PLUGIN}-debug.so $(DOBJECTS) ${LIBS} clean: @rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so ${PLUGIN}-debug.so diff --git a/ft/pdf/pdf.c b/ft/pdf/pdf.c index b4adf36..ba6d06d 100644 --- a/ft/pdf/pdf.c +++ b/ft/pdf/pdf.c @@ -6,6 +6,15 @@ #include "pdf.h" #include "../../zathura.h" +bool +plugin_register(void) +{ + zathura_document_plugin_register("pdf", pdf_document_open); + zathura_document_plugin_register("PDF", pdf_document_open); + + return true; +} + bool pdf_document_open(zathura_document_t* document) {