Android on the transplant ghostscript-9.04 static compiler

One, description

becauseAndroidnoGlibLibrary, andGCCThe default for dynamic compilation, in order to enable the program to run on the development board, our ownCProgram needs to use static compiler.

GhostscriptThe download address isHttp://downloads.ghostscript.com/public/. I use theGhostscript-9.04.

Two, online common method

OneGet source code

decompressionGhostscript-9.04.tar.gzAnd will be extracted after theGhostscript-9.04Directory copyGhostscript-9.04-pcandGhostscript-9.04-armTwo points, respectively, for the compilerPCHost onGSandARM-LinuxTheGS.

Command:

Ghostscript-9.04.tar.gz #tarzxvf

Ghostscript-9.04-pc -R #cpghostscript-9.04

Ghostscript-9.04-arm #mvghostscript-9.04


TwocompilePCHost onGS

Command:

#cdghostscript-9.04-pc/

#./configure

#make

This has been compiled.PCMachine.Gs,Cross compiler at the back of the need to use this step in the compilation of the intermediate file, in the./obj/aux/Catalog


ThreecompileARM-LinuxTheGS

Configuration environment variable:

In environmental variablesPATHThe path of the cross compiler tool chain(arm-linux-gccPath).

Command:

#exportPATH=$PATH:/toolschain/4.5.1/bin

Start compilation:

Here./configureCommand needs to bePCDifferent host.

Command:

Ghostscript-9.04-arm/ #cd../

#./configure--host=arm-linux

#make

The compilation process will appear the following error

Error occurred:

./obj/devs.tr --include./obj/unix_./obj/aux/echogs-w

Syntax error: word unexpected./obj/aux/echogs:1: (expecting ")"

[obj/devs.tr] make:***errorTwo

Cause of error:

The compilation process requires some intermediate filesEchogs,Genarch,Genconf,Mkromfs) these files have been compiled here.ARM-LinuxIn thePCSome of the files on the host is not good, so we have toGhostscript-9.04-pc/obj/aux/Copy come.

Solution method:

takeGhostscript-9.04-pc/obj/aux/Three filesEchogs,Genarch,GenconfCopy toGhostscript-9.04-arm/obj/aux/

command:

./obj/aux/echogs #cp../ghostscript-9.04-pc/obj/aux/echogs

./obj/aux/genarch #cp../ghostscript-9.04-pc/obj/aux/genarch

./obj/aux/genconf #cp../ghostscript-9.04-pc/obj/aux/genconf

#make


Error occurred:

Syntax error: word unexpected./obj/aux/mkromfs:2: (expecting ")"

[obj/gsromfs1_.c] make:***errorTwo

Solution method:

takeGhostscript-9.04-pc/obj/aux/FileMkromfsCopy toGhostscript-9.04-arm/obj/aux/. Be carefulMkromfsNeed to update the modification time,Otherwise it will be re created

command:

./obj/aux/mkromfs #cp../ghostscript-9.04-pc/obj/aux/mkromfs

./obj/aux/mkromfs #touch

#make


Compiler is complete, but there is no static compilation, this can not be run under the Android. Is the last link is not used-static.

find./base/unixlink.mak,The last part of this file is used for the last link.

takeFifty-sixthat 's ok

$(ECHOGS_XE) -a $(ldt_tr) -s $(EXTRALIBS) $(STDLIBS) $() $()

Instead

$(ECHOGS_XE) -a $(ldt_tr) -s $(EXTRALIBS) $(STDLIBS) $() $()-Static

command:

No.Rmbin/gs

No./bin/sh<./obj/ldt.tr

Compile successfully, you can download to the development board to try


Three, I am on the transplantGhostscript-9.04Process improvement


Ghostscript-9.04.tar.gz #tarzxvf

Ghostscript-9.04 #cd

#./configure--host=arm-linux

modifyMakefile:

Three hundred and twentyLine: modifySTDLIBS=-lpthread-lmby-lm-static STDLIBS=-lpthread

Three hundred and eighty-sevenLine: modifyCCAUX=arm-linux-gccbyCCAUX=gcc

#make

It is easier than on.




转自:http://prog3.com/sbdm/blog/dreamtdp/article/details/7927957




stackoverflow


I've been googling for hours but to no avail.
I have successfully compiled ImageMagick on Android via the NDK, but cannot use it to open pdf files because this requires Ghostscript.A lot of ghostscript for android searches has led me to believe ghostscript's android port is MuPdf. Will compiling MuPDF's NDK source as a dependency for ImageMagick work for me?



There is no port of Ghostscript for Android, we've never done one and I'm not aware of one. MuPDF is a totally different product.

So no, you can't compile MuPDF for Android and expect it to work in place of Ghostscript for ImageMagick.

It should be possible to port GS over to Android, and we would be interested in hearing if you manage that.