autoconf
[Top][All Lists]
Advanced

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

Re: making a 2.52 macro backward compatible


From: Akim Demaille
Subject: Re: making a 2.52 macro backward compatible
Date: 19 Apr 2002 16:50:10 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| Hi

Hi!

| 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.

Seriously, I don't want to start useless long threads about this
issue, but it is really an error to stick to 2.13.  It is dead and
will no longer be maintained.  I would like to emphasize too, that the
primary cause of problems with `backward compatibility' is due to
poorly written configure.in.  This is by no means a criticism against
the authors of these configure.in: it is one against Autoconf which
did not enforce proper rules.  This results in this depressing fashion
of criticizing 2.5x with poor arguments.

So, really, if you could explain what are the motivations for not
moving to 2.5x, maybe we can help making the transition.

But I don't want _ever_ to hear about 2.13 again.  It's a mess.


| 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])],

m4_ifval does not exist in 2.13.

| [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])

Err, the 3rd arg makes no sense, iirc.

| 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?

2.13 doesn't know m4_ifval, so it doesn't expand your argument.  Since
it doesn't know about m4_*, it doesn't complain about it, but be sure
that grep will find it in configure.



Drop 2.13 *dead*.



reply via email to

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