lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <>
Subject Re: JCC Install
Date Sun, 22 Feb 2009 22:28:31 GMT

On Fri, 20 Feb 2009, Jacob Floyd wrote:

> Here I am again.
> After talking with some of the gentoo devs, they suggested I modify
> the to include gentoo specifics and send it upstream. As it
> is, they don't like to have to specify all the lflags, and in fact it
> becomes troublesome, because we'd then have to duplicate what you're
> doing (sniffing for x86/x86_x86_64...) within the ebuild. Instead, it
> would be nicer to have something like a JCC_JAVA_DIR, that specifies
> where the java install is, and then use that within Includes and
> lflags. In my case I would then set not the JCC_LFLAGS variable but
> the JCC_JAVA_DIR, and the would automatically give me either
> i386/i686/x86_64.
> I don't know if you prefer a copy or a patch, and I don't know if I
> can attach things going to the list, so here's the and the
> diff (available for the next 30 days):
> Note that I moved some of the variables up or down, to keep it simple
> for users to change just what they need.
> What do you think?

Thank you for the patch.
This is the second time in a week that someone suggest the same thing: a 
variable to specify the JDK root (JAVA_HOME or somesuch).
I'll take the ideas from both patches and incorporate that into JCC's

I've since remembered why I haven't noticed the need for this myself before.
Getting annoyed with having to modify myself and needing a way to 
build JCC that didn't involve editing the file, I added a long time ago the 
possibility to set all these flags via environment variables (as you 
noticed). I then do the right thing, once, in the Makefile driving my build 
and all is good.

This is, for example, what I've done, on Gentoo 64-bit no less, at my day 
job (see snippets of a Makefile below) where I had to support various 
versions of Python (2.4, 2.5 and 2.6) and various versions of Java (1.5 and 
1.6). Note that Gentoo has a very handy utility, called java-config, that 
makes it easy to do a bunch of things with your java installation(s), such 
as knowing where they are and making one the default.


ifeq ($(OS),Linux)
PYTHON_VER:=$(shell $(PYTHON) -c "import sys; print '%s.%s' %(sys.version_info[0:2])")
ifeq ($(ARCH),x86_64)
JDK:=$(shell java-config -O)
   INSTALL_OPT="--install-dir $(PACKAGES)" \
   JCC_INCLUDES="$(JDK)/include:$(JDK)/include/linux" \
   ANT=ant \
   INSTALL_OPT="--install-dir $(PACKAGES)" \
   JCC="$(PYTHON) $(PACKAGES)/$(JCC_EGG)/jcc/ --shared" \

jcc.egg: setuptools.egg $(JCC_DIR)
 	mkdir -p $(PACKAGES)
 	cd $(JCC_DIR); $(JCC_ENV) \
             $(PYTHON) build $(DBG_FLAGS) \
                                install --install-lib $(PACKAGES)
 	touch $@

lucene.egg: $(LUCENE_DIR) $(PYLUCENE_DIR)
 	cd $(PYLUCENE_DIR); $(PYLUCENE_ENV) make -e compile install
 	touch $@


Note that jcc.egg and lucene.egg are pseudo files I use to let make know 
where it needs to build jcc and/or PyLucene.

Maybe a similar environment variable technique should be used for the Gentoo 
ebuild. It would solve the problem of having to modify
Still, like I said earlier, having a JCC_JDK variable (or somesuch) to root 
all java-based flags on in would make it simpler to build JCC in 
the manual case.

The same technique works on the PyLucene build. I believe I implemented this 
environment variable based build first at OSAF for the Chandler build, 
actually :)


View raw message