This is the mail archive of the java-patches@sourceware.cygnus.com 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]

Using multi-language libtool


This is a patch I had promised a long time ago, that fixes all issues
related with libtool's not passing -B and -m flags to gcc for
compiling and/or linking.  The solution is to use the multi-language
libtool.

Unfortunately, at this very moment, the libtool CVS tree fails to link
executables out of libtool objects, so jv-convert fals to link.  But
the patch in itself is correct, and will work fine as soon as the
multi-language libtool is fixed (hopefully, in a couple of minutes).

I'm not including the libtool-related patches in this patch, because
it would make it needlessly huge and useless, since further changes in
libtool will be required.

Do you like it?

Index: ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>

	* libtool.m4, ltcf-c.sh, ltcf-cxx, ltcf-gcj.sh: New, from
	libtool multi-language CVS branch.
	* ltconfig, ltmain.sh: Updated from libtool multi-language CVS
	branch.

Index: boehm-gc/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>

	* acinclude.m4: Include ../libtool.m4.
	* aclocal.m4, configure, Makefile.in: Rebuilt.

Index: libffi/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>

	* libtool.m4, ltcf-c.sh: New, from libtool multi-language CVS
	branch.
	* ltconfig, ltmain.sh: Updated from libtool multi-language CVS
	branch.
	* acinclude.m4: Include ../libtool.m4.
	* aclocal.m4, configure, Makefile.in: Rebuilt.
	* include/Makefile.in: Likewise.

Index: libjava/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>

	* acinclude.m4: Include ../libtool.m4.
	(AC_PROG_CC_WORKS, AC_PROG_CXX_WORKS): Define to do nothing.
	(LIB_AC_PROG_CC, LIB_AC_PROG_CXX): Do not define.
	* configure.in (ZLIBTESTSPEC): Do not refer to `.libs'.
	(GCJ): Test whether gcj was build, not whether the java
	source directory exists.  Run AM_PROG_GCJ.
	* aclocal.m4, configure, Makefile.in: Rebuilt.
	* gcj/Makefile.in, include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

Index: zlib/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>

	* acinclude.m4: Include ../libtool.m4.
	* aclocal.m4, configure, Makefile.in: Rebuilt.

Index: boehm-gc/acinclude.m4
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/acinclude.m4,v
retrieving revision 1.8
diff -u -r1.8 acinclude.m4
--- boehm-gc/acinclude.m4	2000/05/10 21:59:16	1.8
+++ boehm-gc/acinclude.m4	2000/05/28 12:02:05
@@ -155,3 +155,6 @@
 ]))
 
 ))))
+
+ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
+sinclude(../libtool.m4)
Index: libffi/acinclude.m4
===================================================================
RCS file: acinclude.m4
diff -N acinclude.m4
--- libffi/acinclude.m4	Tue May  5 13:32:27 1998
+++ libffi/acinclude.m4	Sun May 28 05:02:06 2000
@@ -0,0 +1,2 @@
+ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
+sinclude(libtool.m4)
Index: libjava/acinclude.m4
===================================================================
RCS file: /cvs/java/libgcj/libjava/acinclude.m4,v
retrieving revision 1.4
diff -u -r1.4 acinclude.m4
--- libjava/acinclude.m4	1999/09/28 20:14:11	1.4
+++ libjava/acinclude.m4	2000/05/28 12:02:07
@@ -36,82 +36,11 @@
 dnl Still use "libjava" here to placate dejagnu.
 AM_INIT_AUTOMAKE(libjava, $version)
 
-# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable.  This should really be fixed in autoconf
-# itself.
-
-AC_DEFUN(LIB_AC_PROG_CC,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-dnl Fool anybody using AC_PROG_CC.
-AC_PROVIDE([AC_PROG_CC])
-AC_CHECK_PROG(CC, gcc, gcc)
-if test -z "$CC"; then
-  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
-  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
-
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  AC_PROG_CC_G
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-O2"
-  fi
-else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-])
-
-LIB_AC_PROG_CC
+AC_DEFUN([AC_PROG_CC_WORKS],)
+AC_PROG_CC
+AC_DEFUN([AC_PROG_CXX_WORKS],)
+AC_PROG_CXX
 
-# Likewise for AC_PROG_CXX.
-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])
-AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
-test -z "$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_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we dont
 # run it explicitly here, it will be run implicitly before
 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
@@ -160,3 +89,6 @@
 AC_SUBST(LIBGCJ_CXXFLAGS)
 AC_SUBST(LIBGCJ_JAVAFLAGS)
 ])dnl
+
+ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
+sinclude(../libtool.m4)
Index: libjava/configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.59
diff -u -r1.59 configure.in
--- libjava/configure.in	2000/05/20 20:26:51	1.59
+++ libjava/configure.in	2000/05/28 12:02:08
@@ -570,7 +570,7 @@
       AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj)
    else
       ZLIBSPEC=-lzgcj
-      ZLIBTESTSPEC="-L`pwd`/../zlib/.libs -rpath `pwd`/../zlib/.libs"
+      ZLIBTESTSPEC="-L`pwd`/../zlib"
    fi
 
    # On Solaris, and maybe other architectures, the Boehm collector
@@ -579,14 +579,23 @@
       AC_CHECK_LIB(dl, main, SYSTEMSPEC="$SYSTEMSPEC -ldl")
    fi
 
-   if test -d "$libgcj_basedir/../gcc/java"; then
-      GCJ=
+   if test -z "${with_multisubdir}"; then
+      builddotdot=.
    else
+changequote(<<,>>)
+      builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
+changequote([,])
+   fi
+   dir="`cd ${builddotdot}/../../gcc && pwd`"
+   if test -x "${dir}/gcj"; then
+      GCJ="$dir/gcj -B$dir/"
+   else
       CANADIAN=yes
       NULL_TARGET=yes
       GCJ=gcj
    fi
 fi
+AM_PROG_GCJ
 
 dnl FIXME: cross compilation
 AC_CHECK_SIZEOF(void *)
@@ -618,17 +627,6 @@
 AC_SUBST(EH_COMMON_INCLUDE)
 
 # Determine gcj version number.
-if test "$GCJ" = ""; then
-   if test -z "${with_multisubdir}"; then
-      builddotdot=.
-   else
-changequote(<<,>>)
-      builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
-changequote([,])
-   fi
-   dir="`cd ${builddotdot}/../../gcc && pwd`"
-   GCJ="$dir/gcj -B$dir/"
-fi
 changequote(<<,>>)
 gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`"
 changequote([,])
Index: zlib/acinclude.m4
===================================================================
RCS file: /cvs/java/libgcj/zlib/acinclude.m4,v
retrieving revision 1.2
diff -u -r1.2 acinclude.m4
--- zlib/acinclude.m4	1999/09/28 20:37:20	1.2
+++ zlib/acinclude.m4	2000/05/28 12:02:08
@@ -37,3 +37,6 @@
   test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
 ])
+
+ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
+sinclude(../libtool.m4)

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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