bug-automake
[Top][All Lists]
Advanced

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

Re: AM_PROG_GCJ fails at `make' if nothing else defines OBJEXT


From: Ralf Wildenhues
Subject: Re: AM_PROG_GCJ fails at `make' if nothing else defines OBJEXT
Date: Sun, 7 Jun 2009 08:06:35 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Jack Kelly wrote on Mon, May 25, 2009 at 12:17:46AM CEST:
> 
> 1. AM_PROG_GCJ might want to think about using AC_CHECK_TOOLS instead
> of AC_CHECK_PROGS - to catch a cross-compiled gcj that's building
> binaries for a different host.

Indeed.  Applying the fix below, will push out soon.

> 2. The suffix mechanism might not be quite enough for Java projects
> with native methods using the C++ interface.

I'm sorry, but I fail to parse this.  Even with the example you gave, it
is unclear to me.  Can you rephrase this, state the problem setup in
more detail, and which parts are not supported by Automake?  Can these
parts easily be worked around by the Makefile.am author?

> For these, it appears
> that gcj wants something like this (my best guess here, docs are quite
> sketchy):
> 
> Suppose Foo.cc contains the implementation of the native methods
> declared in Foo.java. Then to compile, the following is needed:
> 
> # Make Foo.class
> gcj -C Foo.java
> # Make Foo.h, which is #include'd by Foo.cc
> gcjh Foo.class

What files does this generate in general, can we tell in some way,
ideally, without looking at the .java files?  (If we'd have to look
at them, then in principle, the Makefile file (or Makefile.in) would
depend upon the .java file, which seems ugly.)

> g++ -c -o Foo.o Foo.cc
> gcj -o Foo.class.o Foo.class
> # Or instead of the above:
> gcj -c -o Foo.class.o Foo.java
> 
> Then link to taste, using gcj to call the linker.

Thanks,
Ralf

    AM_PROG_GCJ: use AC_CHECK_TOOLS for gcj, for cross compilation.
    
    * m4/gcj.m4 (AM_PROG_GCJ): Use AC_CHECK_TOOLS, rather than
    AC_CHECK_PROGS, when searching for `gcj'.
    * NEWS: Update.
    Report by Jack Kelly.

diff --git a/NEWS b/NEWS
index 10b6f61..7e14ed8 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,9 @@ Bugs fixed in 1.11a:
   - The testsuite does not try to change the mode of `ltmain.sh' files from
     a Libtool installation (symlinked to test directories) any more.
 
+  - AM_PROG_GCJ uses AC_CHECK_TOOLS to look for `gcj' now, so that prefixed
+    tools are preferred in a cross-compile setup.
+
 
 New in 1.11:
 
diff --git a/m4/gcj.m4 b/m4/gcj.m4
index 5d1e00f..9e930e0 100644
--- a/m4/gcj.m4
+++ b/m4/gcj.m4
@@ -1,14 +1,14 @@
 # Check for Java compiler.                                  -*- Autoconf -*-
 # For now we only handle the GNU compiler.
 
-# Copyright (C) 1999, 2000, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2005, 2009  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([AM_PROG_GCJ],[
-AC_CHECK_PROGS(GCJ, gcj, gcj)
+AC_CHECK_TOOLS(GCJ, gcj, gcj)
 test -z "$GCJ" && AC_MSG_ERROR([no acceptable gcj found in \$PATH])
 if test "x${GCJFLAGS-unset}" = xunset; then
    GCJFLAGS="-g -O2"




reply via email to

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