This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Conversion of libjava to autoconf 2.59 (cross testing wanted)


Bootstrapped i686-pc-linux-gnu.  No significant changes in generated
Makefiles.  :-)

I would appreciate testing on your favorite working cross targets (I don't have
one which I can get to work reliably).

If I get positive results, or at least non-negative ones, I will commit this.
I have plans for improving configure.in further, particularly for
build!=host targets, but I want to get this done first.

	* acinclude.m4: Include no-executables.m4.
	* aclocal.m4: Rebuild.
	* configure.in: Convert to the autoconf 2.59 version of
	of the no-executables hack, and also of the nonstandard CXX
	hack and the multilibbed CC and CXX hack.  Change prerequisite
	to autoconf 2.59.
	* configure: Rebuild with autoconf 2.59.  (Woo-hoo!)
	* Makefile.in, gcj/Makefile.in, include/Makefile.in,
	testsuite/Makefile.in: Regenerate.

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libjava/acinclude.m4,v
retrieving revision 1.28
diff -u -r1.28 acinclude.m4
--- acinclude.m4	16 Jul 2004 02:11:26 -0000	1.28
+++ acinclude.m4	18 Jul 2004 07:42:36 -0000
@@ -1,5 +1,6 @@
 sinclude(../config/accross.m4)
 sinclude(../config/acx.m4)
+sinclude(../config/no-executables.m4)
 
 sinclude(../libtool.m4)
 dnl The lines below arrange for aclocal not to bring libtool.m4
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.194
diff -u -r1.194 configure.in
--- configure.in	16 Jul 2004 23:42:19 -0000	1.194
+++ configure.in	18 Jul 2004 07:42:37 -0000
@@ -1,5 +1,5 @@
 dnl Process this with autoconf to create configure
-AC_PREREQ(2.13)
+AC_PREREQ(2.59)
 AC_INIT(java/lang/System.java)
 
 dnl We use these options to decide which functions to include.
@@ -82,57 +82,31 @@
   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
  esac], [multilib=yes])dnl
 
-dnl This shouldn't be needed, as long as top-level dependencies are
-dnl defined correctly and shared-library paths are set up so that
-dnl execution tests succeed.  FIXME.
-define([AC_PROG_CC_WORKS],[])
-define([AC_PROG_CXX_WORKS],[])
+dnl # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+GCC_NO_EXECUTABLES
 
+# (1) We use an abnormal CXX (without library references), so we
+# must cache it under a different name.
+# (2) CC, CFLAGS, CXX, CXXFLAGS, LDFLAGS must not be 'precious', or
+# the non-multilib-adjusted value will be used in multilibs.
+# (3) As a side effect, we must SUBST CXXFLAGS, CFLAGS, and LDFLAGS ourselves.
+# (4) As another side effect, automake doesn't automatically include them
+# in Makefile.in.
+# (5) For libstdc++-v3, -fno-builtin must be present here so that a
+# non-conflicting form of std::exit can be guessed by AC_PROG_CXX, and
+# used in later tests.  This may not be necessary in libjava; I don't know.
+m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
+m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -fno-builtin"
 AC_PROG_CC
-
-# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, but use
-# glibjava_CXX instead of glibcpp_CXX.  That's because we're passed a
-# different definition of CXX than other directories, since we don't
-# depend on libstdc++-v3 having already been built.
-AC_DEFUN(LIB_AC_PROG_CXX,
-[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-dnl Fool anybody using AC_PROG_CXX.
-AC_PROVIDE([AC_PROG_CXX])
-# Use glibjava_CXX so that we do not cause CXX to be cached with the
-# flags that come in CXX while configuring libjava.  They're different
-# from those used for all other target libraries.  If CXX is set in
-# the environment, respect that here.
-glibjava_CXX=$CXX
-AC_CHECK_PROGS(glibjava_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
-AC_SUBST(CXX)
-CXX=$glibjava_CXX
-test -z "$glibjava_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
-
-AC_PROG_CXX_GNU
-
-if test $ac_cv_prog_gxx = yes; then
-  GXX=yes
-dnl Check whether -g works, even if CXXFLAGS is set, in case the package
-dnl plays around with CXXFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
-  ac_test_CXXFLAGS="${CXXFLAGS+set}"
-  ac_save_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS=
-  AC_PROG_CXX_G
-  if test "$ac_test_CXXFLAGS" = set; then
-    CXXFLAGS="$ac_save_CXXFLAGS"
-  elif test $ac_cv_prog_cxx_g = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-O2"
-  fi
-else
-  GXX=
-  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-])
-
-LIB_AC_PROG_CXX
+AC_PROG_CXX
+CXXFLAGS="$save_CXXFLAGS"
+m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+AC_SUBST(CFLAGS)
+AC_SUBST(CXXFLAGS)
+AC_SUBST(LDFLAGS)
 
 dnl version is pulled out to make it a bit easier to change using sed.
 version=0.0.7

-- 
There are none so blind as those who will not see.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]