GCC/GCJ and pdftk

bf bf2006a at yahoo.com
Fri Jun 5 23:28:55 UTC 2009

>I need pdftk to compile on an amd64 system, and see in the pdftk 
>Makefile the following:

> > # gcj/libgcj don't exist on these platforms
> > NOT_FOR_ARCHS= amd64 ia64 sparc64

NOT_FOR_ARCHS is _usually_ there for a reason.  In this case, it's because
the lang/gcc4* maintainer hasn't devised a way to build gcj successfully
on architectures other than i386, although in theory this should be
possible, and the print/pdftk maintainer hasn't devised a way to build
that port without gcj.

>However, I've also read in the pdftk port logs that gcj is included in 
>GCC 3.4+ when WITHOUT_JAVA in the GCC Makefile is set to no or commented 
>out. So, I compiled GCC with gcj support without a problem, and 

Oh yes, did you?  Really?  How?  Better look again.

>commented out the NOT_FOR_ARCHS line above to force an install of pdftk:

> > ===>   pdftk-1.41 depends on executable: gmake - found
> > ===>   pdftk-1.41 depends on shared library: gcj - not found
> > ===>    Verifying install for gcj in /usr/ports/lang/gcc42
> > ===>   Returning to build of pdftk-1.41
> > Error: shared library "gcj" does not exist

> gcj does indeed exist in /usr/ports/lang/gcc42:

> > # find /usr/ports/lang/gcc42 -name "gcj"
> > /usr/ports/lang/gcc42/work/gcc-4.2-20090325/libjava/gnu/gcj
> > /usr/ports/lang/gcc42/work/gcc-4.2-20090325/libjava/gcj
> > /usr/ports/lang/gcc42/work/build/gcc/gcj

The "gcj" that the port is searching for must be the appropriate binary executable, or a link to it, and must be in your PATH.  In this case,
if properly installed via the port, it would be:

gcj42, gcj43, gcj44, or gcj45, 

and would be in /usr/local/bin.

All that you have done is find what I suspect are empty directories in the WRKDIR for the lang/gcc42 port.  Consider the 'which' command; or limiting the directories searched and the using of '-not -type d' if employing 'find' in this way in the future.

>Any suggestions as to what I can do to build pdftk? This particular 
>project will surely be much harder if I can't get pdftk to >build/compile...

In the order of increasing effort:

1) Use a tool other than pdftk to manipulate your PDF files. pdftk is
just a wrapper around an old version of devel/itext, structured with
the idea of compiling it with gcj.  You could just install Java and
use the more up-to-date devel/itext.  Or use print/ghostscript8,
graphics/poppler, or print/xpdf, either directly or via one of the many
programs (for example, print/kpdftool) that use them to do the dirty work.
Also textproc/p5-CAM-PDF, print/py-pdf, ...

2) Switch your system to i386 and use pdftk.

3) Find a way to build gcj on architectures other than i386, or persuade
or browbeat gerald@ into doing it.  Debian has packages for other
architectures, for example.  You could look at what they've done.



More information about the freebsd-questions mailing list