Subject: Defining `java_JAVA' doesn't cause errors even if $(javadir) is indefined

From: Stefano Lattarini <[email-masked]>
Date: Sat, 9 Apr 2011 22:34:33 +0200

Well, the subject says it all.  The following example exposes the bug:

  $ cat > configure.ac <<'END'
  AC_INIT([x], [0])
  AM_INIT_AUTOMAKE([foreign])
  AC_CONFIG_FILES([Makefile])
  END
  $ cat > Makefile.am <<'END'
  java_JAVA = foo.java
  END
  $ aclocal
  $ automake -a
  configure.ac:2: installing `./install-sh'
  configure.ac:2: installing `./missing'
  $ grep '^ *javadir' Makefile.in || echo 'javadir undefined!'
  javadir undefined!

I can suggest three possibilities to fix this issue:

  1. Define `javadir' to `$(pkgdatadir)/java' in lib/am/java.am.
 
  2. Define `javadir' and `pkgjavadir' to respectively to `$(datadir)/java'
     and `$(pkgdatadir)/java' in `lib/am/java.am', and add "pkgjava" to the
     @prefixes passed to am_primary_prefixes() and am_install_var() calls
     in handle_java() in automake.in.

  3. Remove "java" from the @prefixes passed to the am_primary_prefixes()
     and am_install_var() calls in handle_java() in automake.in.

In the first two cases, the Automake manual should be adjusted accordingly.
My preference lies with option 3.  Opinions?

Regards,
  Stefano