[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
making a 2.52 macro backward compatible
From: |
Nic Ferrier |
Subject: |
making a 2.52 macro backward compatible |
Date: |
19 Apr 2002 15:26:33 +0100 |
Hi
I see some familar names here (hello to you all) but those who don't
know me I'm a GNU volunteer working on a lot of different Java
projects, including maintaining ClasspathX (free extension libraries
for free java) and GNU Paperclips (a kind of java webserver).
I've recently setup some new autoconf based systems in the projects I
maintain. I use a macro for selecting a java compiler based heavily
on the autoconf 2.52 C compiler macro.
Unfortunately, some of the developers I'm working with would rather
not upgrade to 2.52 (I have some sympathy with that, it can be pretty
annoying) so I thought I'd make my compiler macro work with 2.13 as
well.
Here's the source of my attempt at a 2.13 macro:
# AC_PROG_JAVA_CC([COMPILER ...])
# --------------------------
# COMPILER ... is a space separated list of java compilers to search for.
# This just gives the user an opportunity to specify an alternative
# search list for the java compiler.
# The compiler is set in the variable JAVA_CC and the compiler options
# are set in the variable JAVA_CC_OPTS
AC_DEFUN([AC_PROG_JAVA_CC],
[m4_ifval([$1],
[AC_CHECK_PROGS(JAVA_CC, [$1])],
[AC_CHECK_PROG(JAVA_CC, gcj)
if test -z "$JAVA_CC"; then
AC_CHECK_PROG(JAVA_CC, javac)
fi
if test -z "$JAVA_CC"; then
AC_CHECK_PROG(JAVA_CC, jikes)
fi
])
if test "$JAVA_CC" = "gcj"; then
if test "$GCJ_OPTS" = ""; then
AC_SUBST(GCJ_OPTS,-C)
fi
AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
[Define the compilation options for GCJ])
fi
test -z "$JAVA_CC" && AC_MSG_ERROR([no acceptable java compiler found in
\$PATH])
])# AC_PROG_JAVA_CC
I've put that in aclocal.m4 in the project directory with the
congfigure.in which looks like this:
>>>>>
AC_INIT(source/javax/activation/MimeType.java)
dnl Tool discovery
AC_PATH_PROG(JAR_TOOL, jar,)
AC_PROG_JAVA_CC()
dnl Setup the output files
AC_OUTPUT(Makefile)
dnl End.
<<<<<
Because I have both versions of autoconf installed on my machine I'm
having to start it up like this:
$ autoconf2.13 -m /usr/share/autoconf2.13
The directory: /usr/share/autoconf2.13 contains the necessary macro
files; here's the (partial) results of a grep on that directory which
should prove that the macros are defined in there somewhere:
/usr/share/autoconf2.13/acgeneral.m4:AC_DEFUN(AC_CHECK_PROG,
/usr/share/autoconf2.13/acgeneral.m4:AC_DEFUN(AC_CHECK_PROGS,
And here's what happens when I run it:
autoconf: Undefined macros:
***BUG in Autoconf--please report*** AC_CHECK_PROGS
***BUG in Autoconf--please report*** AC_CHECK_PROG
***BUG in Autoconf--please report*** AC_CHECK_PROG
***BUG in Autoconf--please report*** AC_CHECK_PROG
Why is this happening? Am I doing something glaringly stupid?
Nic Ferrier
- making a 2.52 macro backward compatible,
Nic Ferrier <=