java/5688: cross compiler build fails in libjava

H . J . Lu hjl@lucon.org
Tue Jun 4 12:54:00 GMT 2002


On Tue, Jun 04, 2002 at 02:03:48PM -0600, Tom Tromey wrote:
> >>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:
> 
> >> +     case $target in
> >> +     *-linux*)
> >> +       AC_DEFINE(HAVE_PROC_SELF_EXE)
> >> +       ;;
> >> +     esac
> 
> Alexandre> One more nit: I wonder if, in the `else' branch, if $target
> Alexandre> doesn't match, we should assume HAVE_PROC_SELF_EXE is not
> Alexandre> present, or bail out asking the user to let us know by
> Alexandre> setting some environment variable.
> 
> I think assuming HAVE_PROC_SELF_EXE is not present is fine.  We can
> always refine this code as people do more host-x-host builds.  My
> impression from what I've seen on the list is that the most important
> "host targets" are Linux and Windows.
> 

Here is the new patch. Is that OK to check in?


H.J.
---
2002-06-03  H.J. Lu  (hjl@gnu.org)

	* configure.in (--with-newlib): New option:
	Check ${with_newlib} instead of ${with_cross_host} for newlib.
	(HAVE_PROC_SELF_EXE): Defined to 1 only for cross compiling to
	Linux.
	* configure: Regenerated.

--- libjava/configure.in.cross	Sun May 19 21:49:56 2002
+++ libjava/configure.in	Mon Jun  3 13:29:32 2002
@@ -16,6 +16,9 @@ AC_ARG_WITH(target-subdir,
 AC_ARG_WITH(cross-host,
 [  --with-cross-host=HOST  configuring with a cross compiler])
 
+AC_ARG_WITH(newlib,
+[  --with-newlib           Configuring with newlib])
+
 LIBGCJ_CONFIGURE(.)
 
 AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
@@ -465,7 +468,7 @@ changequote([,])dnl
 AC_SUBST(tool_include_dir)
 AC_SUBST(gcc_version)
 
-if test -n "${with_cross_host}"; then
+if test "x${with_newlib}" = "xyes"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
    # may not work correctly, because the compiler may not be able to
    # link executables.
@@ -516,8 +519,16 @@ else
 
    AC_CHECK_LIB(dl, dladdr, [
      AC_DEFINE(HAVE_DLADDR)])
-   AC_CHECK_FILES(/proc/self/exe, [
-     AC_DEFINE(HAVE_PROC_SELF_EXE)])
+   if test x$build = x$host; then
+     AC_CHECK_FILES(/proc/self/exe, [
+       AC_DEFINE(HAVE_PROC_SELF_EXE)])
+   else
+     case $target in
+     *-linux*)
+       AC_DEFINE(HAVE_PROC_SELF_EXE)
+       ;;
+     esac
+   fi
 
    AM_ICONV
    AM_LC_MESSAGES



More information about the Gcc-bugs mailing list