cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cp-tools-discuss] Re: Automakejar - make install


From: Julian Scheid
Subject: Re: [Cp-tools-discuss] Re: Automakejar - make install
Date: Tue, 11 Mar 2003 01:47:56 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2) Gecko/20021126


Nic Ferrier wrote:
Julian Scheid <address@hidden> writes
gnu/%.class: @srcdir@/src/gnu/%.java
        @JAVAC@ @JAVACFLAGS@ \
                -d . \
                -classpath "${CLASSPATH}:@srcdir@/src:." \
                @srcdir@/src/gnu/xml/libxmlj/transform/*.java

1. What about the scenario where you are shipping dependancys in a lib
directory or something?

At compile-time, this is easy: just add @srcdir@/lib/foo.jar to the
-classpath as well. But I guess you didn't mean that.

At runtime, there are several solutions, the most easy of which I think
is something like copying all dependant jar files to the installation
directory as well and creating a shell script from Makefile.am using
variable replacement. Another approach is the de-facto standard Java way
of using a foo_HOME variable (as in GJDOC_HOME) and having shell scripts
use this variable to determine the location of the jar files, but this
approach requires the user to set a variable in his .profile or
wherever. The former approach hardwires the paths to the libraries at
install-time, which I think is the better solution because the user
doesn't have to perform any post-installation tasks.

Suppose I have a build file which builds app.jar and depends on
foo.jar. Then the "install" Makefile target would copy both app.jar and
foo.jar to $PREFIX/share and would write a shell script to $PREFIX/bin/app
which contains the locations of the two jar files hardwired. I.e. if you
installed using the default prefix /usr/local, then the generated 'app'
shell script would read something like
'java -classpath /usr/local/share/app.jar:/usr/local/share/foo.jar'.

With regard to LibxmlJ and GNU JAXP, I could handle it that way of
course, but then I'd have to care about keeping gnujaxp.jar up-to-date
in CVS which I think is not a good solution.

Hope this answers your question.

2. Do we have existing macros for doing jar file autodiscovery? Or
   are you suggesting you would write some more M4?

I don't think there are such macros, but I could care about that if
necessary. It's not very different from ordinary shell programming after
all, and in this case it basically is nothing but checking if a file exists
at some particular location.

3. Do you think, in this instance, that we should install gnujaxp.jar
   if it doesn't already exist.

I intended to check for the gnujaxp.jar file before the LibxmlJ build,
at the places I mentioned. If it isn't found I'll have the autoconf script
bail out and tell the user to install it... that simple. Actually, the
build script already cancels if no class javax.xml.transform.Transformer
could be found, telling the user he should install GNU JAXP.


4. can you get automake to build install targets given the way you've
   set it up?

Yes. I suggest you take a closer look at the Makefile.am and configure.ac
that I have written for LibxmlJ (and at the Makefile produced after you've
run ./configure). They are both very brief (100 lines and 85 lines, resp.,
including the boilerplate text) and obviously work just fine. At least they
work for me on two different machines, and Alex got it running on his
system too, well more or less since he didn't have gcc 3.3 installed at the
time. I didn't get feedback from anyone else so far...

Julian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]