Bug 692269

Summary: Unable to compile mupdf/android under Cygwin using ndk (r5)
Product: MuPDF Reporter: Avishek Chakraborty <avishek.chakraborty>
Component: mupdfAssignee: Robin Watts <robin.watts>
Status: RESOLVED FIXED    
Severity: normal CC: robin.watts
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Windows XP   
Customer: Word Size: ---

Description Avishek Chakraborty 2011-06-09 15:56:04 UTC
Hello 

I am currently building an apllication which will read pdf & show it in the screen page wise.
I did some research and found that every available pdf reader is build on MuPDF(a lightweight PDF and XPS viewer).

I went to your official site (http://www.mupdf.com/) & i downloaded latest development source from git repository (git clone git://git.ghostscript.com/mupdf.git
).

I also downloaded the mupdf-thirdparty.zip from the link given there.

I added freetype2, jbig2dec, libjpeg, openjpeg, and zlib included in the mupdf-thirdparty.zip in the mupdf tree in android project.


I am using ndk (r5) under Cygwin.

I edited the  definitions(MK file) &  convert-deps-to-cygwin(AWK file) as per http://groups.google.com/group/android-ndk/msg/b385e47e1484c2d4



/*********Edited portion in definitions***********************/
	$(hide) $$(PRIVATE_CC) $$(PRIVATE_CFLAGS) $$(call host-path,$$(PRIVATE_SRC)) -o $$(call host-path,$$(PRIVATE_OBJ))  && \
	$$(call cmd-convert-deps,$$(PRIVATE_DEPS))


/***********Edited portion in convert-deps-to-cygwin***************/

BEGIN {
    # TODO: We could determine this dynamically before calling this script
    CYGDRIVE_PREFIX = "/cygdrive/"
}

{
    LINE=""
    SEP=""
     for (n = 1; n <= NF; n++) {
               if ($n ~ /^[A-Za-z]:/) {
                       printf("%s%s/%s", CYGDRIVE_PREFIX, tolower(substr($n,1,1)), substr($n,4))
               } else {
                       printf("%s", $n)
               }
               if (n < NF) {
                       printf(" ")
               }
       }
       printf("\n") 
}





Then I tried to compile it from Cygwin using android-ndk-r5b & got below errors:-



/**********ERROR****************************/


avishek@avishek /cygdrive/c/workspace/mupdf/android
$ /cygdrive/c/android-ndk-r5b/ndk-build
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup       : libs/armeabi-v7a/gdb.setup
Compile thumb  : mupdfcore <= base_error.c
awk: /cygdrive/c/android-ndk-r5b/build/awk/convert-deps-to-cygwin.awk:37: fatal:
 cannot open file `C:/workspace/mupdf/android/obj/local/armeabi/objs-debug/mupdf
core/../../fitz/base_error.o.d.org' for reading (No such file or directory)
make: *** [/cygdrive/c/workspace/mupdf/android/obj/local/armeabi/objs-debug/mupd
fcore/../../fitz/base_error.o] Error 2


/*************END***********************/


Please help me.Please tell where I am doing wrong.
I will be very greatfull if you kindly tell me how I can use it in my application.Also I want to search text from the pdf file.
Comment 1 Robin Watts 2011-07-04 23:35:12 UTC
Various problems have been solved recently, though I have been using an older version of the ndk (r5). Please retry and let us know how you get on.

I'll try to find time to try r5c later.

As to your questions about how to use mupdf in your own app, this bug is not the best place to discuss it. Why not join us on #ghostscript on irc? (perhaps using http://webchat.freenode.net).
Comment 2 Robin Watts 2011-07-05 12:17:39 UTC
Now checked with r5c. Still builds fine, so closing.