12 Nov 2002 lmjohns3   » (Journeyer)

It's been a little while since I posted. I'll try to make this worthwhile.

Java and automake

I think I may have found a shape that is both circle and square at the same time, at least in the sense of trying to fit a square peg into a round hole. For the past couple of weeks I've been trying to integrate my project at work (a CORBA 3.0 code generator) with GNU automake. Normally (read : if this project were written in C or C++, or even if I could use GCJ), this would be no problem, and I could even get libtool to help in writing shared libraries. The thing that makes this task interesting is that the project is written in Java, Python, and Jython.

Automake's support for Java is fairly on the sketchy side at the moment, but it does try, and it seems to me (a complete beginner on this particular task) that automake could (almost) fully support Java eventually. Similarly for Python. (Thank goodness that s/python/jython/g works for Jython in the M4 aclocal script, so Jython can get wrapped up in with Python in all these comments.)

So far, there are two difficulties in my wanderings :

  • Automake does not support Java the way I want it to, meaning that it does not directly support building and installing jar files instead of class files. (This is compounded with the difficulty that Sun's JDK javac byte compiler is a pain and won't (a) create a build directory automatically for you when you give it the -d option or (b) tell you what version it is. Sorry, just had to complain there.)
  • Python has its own build and install program, distutils, that works beautifully, but only for Python (and the Python parts of a Jython program). Integrating distutils with automake somehow would be a blessing from heaven unknown since the likes of purchasable packages containing parallel pieces of bread, identically sized, that came from a single loaf.

So, the result for the time being is what any beginner in these domains would do : a hack. (At least I keep telling myself that any beginner would do this.) In the various *-local targets of the root Makefile.am and in directories where there are Java source files, there are some simple-but-theoretically-unnecessary shell scripts, just for loops and ifs that copy various files to various places. Nasty, effective (on my machine), could be avoided, but currently necessary.

Automake itself

All of this learning about automake has been enormously instructive, though, and I am sure I have gained more from this little tangent than hacking up some customized makefiles would have gotten me. In the process, I got to read the automake manual, the autoconf manual, an interesting Advogato article from a ways back, several mailing list threads on various Java and automake problems, and automake info for other projects. It does indeed seem like these auto* tools, while functional, helpful, and particularly a boon to the user and platform independent builds, are still not all they could be.

I am a Python fan by heart (but really have no problem with other languages, just haven't learned them as well ... yet), so I tend to lean in the direction of a Python/XML solution for building packages. I think Perl was an excellent choice for automake, though, so perhaps there just needs to be more hacking on automake. I'm not trying to complain about automake here ; on the contrary I think these tools are nice enough to warrant further work.

Social life

Huh ? I still haven't found out how people manage to program, contribute to Open Source, and have a social life of any kind in any sort of simultaneous manner. If anyone has tips, please lay them on me. :) It's frustrating to want to contribute something to the greater good of the software world, and to also want to spend the evening at a bar, and to also have to go to work. Seems like Kant and Bentham would have much to contribute on this issue. These automake issues have brought this question once more to my mind, since I feel it would be a significant contribution to try to add Java (and Python !) support to automake, but I already have so much going on. Maybe I can con my employers into letting me work on automake for work ...

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!