public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Encode the libgcj soversion in libjava's private dir
@ 2007-07-05 13:26 Matthias Klose
  2007-07-05 13:29 ` Andrew Haley
  2007-08-21  7:50 ` Jakub Jelinek
  0 siblings, 2 replies; 9+ messages in thread
From: Matthias Klose @ 2007-07-05 13:26 UTC (permalink / raw)
  To: GCJ-patches; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

The following patch encodes the libgcj soversion in the name of the private
libjava subdirectory. Currently a directory gcj-X.Y.Z is used, the patch changes
 that to gcj-X.Y.Z-N. This allows installation of multiple gcj versions within
the same prefix, when the soname changes, but not the gcj version number. This
usually happens, if vendors backport more recent versions of libjava to stable
branches (as seen with Fedora, Debian and Ubuntu). There should not be any
references to the private subdirectory, besides from libjava itself. The patch
is in use without problems in the gcj builds for Debian and Ubuntu, and tested
on i686-linux on the trunk.

Ok for trunk?

  Matthias

[-- Attachment #2: libgcjversion.diff --]
[-- Type: text/plain, Size: 1715 bytes --]

2007-07-05  Matthias Klose  <doko@ubuntu.com>

	* configure.ac: Encode the libgcj soversion in dbexecdir,
	pass --with-native-libdir to classpath configure.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 126356)
+++ configure.ac	(working copy)
@@ -1359,25 +1359,27 @@
 AC_SUBST(toolexecmainlibdir)
 AC_SUBST(toolexeclibdir)
 
+# Determine gcj and libgcj version number.
+gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'`
+libgcj_soversion=`awk -F: '/^[[^#]].*:/ { print $1 }' $srcdir/libtool-version`
+GCJVERSION=$gcjversion
+AC_SUBST(GCJVERSION)
+AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
+
 # Determine where the standard .db file and GNU Classpath JNI
 # libraries are found.
 multi_os_directory=`$CC -print-multi-os-directory`
 case $multi_os_directory in
   .)
-   dbexecdir='$(libdir)/gcj-$(gcc_version)' # Avoid /.
+   dbexecdir='$(libdir)/gcj-$(gcc_version)'-$libgcj_soversion # Avoid /.
    ;;
   *)
-   dbexecdir='$(libdir)/'$multi_os_directory'/gcj-$(gcc_version)'
+   dbexecdir='$(libdir)/'$multi_os_directory'/gcj-$(gcc_version)'-$libgcj_soversion
    ;;
 esac
 AC_SUBST(dbexecdir)
+ac_configure_args="$ac_configure_args --with-native-libdir=\$\(toolexeclibdir\)/gcj-$gcjversion-$libgcj_soversion"
 
-# Determine gcj version number.
-gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([[^ ]]*\).*$/\1/p'`
-GCJVERSION=$gcjversion
-AC_SUBST(GCJVERSION)
-AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
-
 AC_DEFINE(JV_VERSION, "1.5.0", [Compatibility version string])
 AC_DEFINE(JV_API_VERSION, "1.5", [API compatibility version string])
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-07-05 13:26 [patch] Encode the libgcj soversion in libjava's private dir Matthias Klose
@ 2007-07-05 13:29 ` Andrew Haley
  2007-07-28 20:15   ` Tom Tromey
  2007-08-21  7:50 ` Jakub Jelinek
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Haley @ 2007-07-05 13:29 UTC (permalink / raw)
  To: Matthias Klose; +Cc: GCJ-patches, gcc-patches

Matthias Klose writes:
 > The following patch encodes the libgcj soversion in the name of the private
 > libjava subdirectory. Currently a directory gcj-X.Y.Z is used, the patch changes
 >  that to gcj-X.Y.Z-N. This allows installation of multiple gcj versions within
 > the same prefix, when the soname changes, but not the gcj version number. This
 > usually happens, if vendors backport more recent versions of libjava to stable
 > branches (as seen with Fedora, Debian and Ubuntu). There should not be any
 > references to the private subdirectory, besides from libjava itself. The patch
 > is in use without problems in the gcj builds for Debian and Ubuntu, and tested
 > on i686-linux on the trunk.
 > 
 > Ok for trunk?

I can't see anything wrong with it, but I'll wait for an ACK from Tom
Tromey.

Andrew.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-07-05 13:29 ` Andrew Haley
@ 2007-07-28 20:15   ` Tom Tromey
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2007-07-28 20:15 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Matthias Klose, GCJ-patches, gcc-patches

>>>>> "Andrew" == Andrew Haley <aph-gcc@littlepinkcloud.COM> writes:

>> Matthias Klose writes:
>> The following patch encodes the libgcj soversion in the name of the private
>> libjava subdirectory. 

>> Ok for trunk?

Andrew> I can't see anything wrong with it, but I'll wait for an ACK from Tom
Andrew> Tromey.

Sorry for the delay on this.  Matthias had to ping me on irc.

I couldn't think of a problem with this.  So it is ok by me.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-07-05 13:26 [patch] Encode the libgcj soversion in libjava's private dir Matthias Klose
  2007-07-05 13:29 ` Andrew Haley
@ 2007-08-21  7:50 ` Jakub Jelinek
  2007-09-02 13:44   ` Matthias Klose
  1 sibling, 1 reply; 9+ messages in thread
From: Jakub Jelinek @ 2007-08-21  7:50 UTC (permalink / raw)
  To: Matthias Klose; +Cc: GCJ-patches, gcc-patches

On Thu, Jul 05, 2007 at 03:26:11PM +0200, Matthias Klose wrote:
> The following patch encodes the libgcj soversion in the name of the private
> libjava subdirectory. Currently a directory gcj-X.Y.Z is used, the patch changes
>  that to gcj-X.Y.Z-N. This allows installation of multiple gcj versions within
> the same prefix, when the soname changes, but not the gcj version number. This
> usually happens, if vendors backport more recent versions of libjava to stable
> branches (as seen with Fedora, Debian and Ubuntu). There should not be any
> references to the private subdirectory, besides from libjava itself. The patch
> is in use without problems in the gcj builds for Debian and Ubuntu, and tested
> on i686-linux on the trunk.

> 2007-07-05  Matthias Klose  <doko@ubuntu.com>
> 
> 	* configure.ac: Encode the libgcj soversion in dbexecdir,
> 	pass --with-native-libdir to classpath configure.
> 	* configure: Regenerate.

I'm now seeing:

./config.status: line 405: toolexeclibdir: command not found
./config.status: line 695: toolexeclibdir: command not found

While libjava/config.status has:
ac_configure_args=" ... --with-native-libdir=$\(toolexeclibdir\)/gcj-4.3.0-9 ... "
which is ok, libjava/classpath/config.status has:
ac_configure_args=" '--with-native-libdir=$(toolexeclibdir)/gcj-4.3.0-9' "
which tries to execute toolexeclibdir as a command.

	Jakub

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-08-21  7:50 ` Jakub Jelinek
@ 2007-09-02 13:44   ` Matthias Klose
  2007-09-04 20:31     ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Klose @ 2007-09-02 13:44 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: GCJ-patches, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

Jakub Jelinek schrieb:
> On Thu, Jul 05, 2007 at 03:26:11PM +0200, Matthias Klose wrote:
>> The following patch encodes the libgcj soversion in the name of the private
>> libjava subdirectory. Currently a directory gcj-X.Y.Z is used, the patch changes
>>  that to gcj-X.Y.Z-N. This allows installation of multiple gcj versions within
>> the same prefix, when the soname changes, but not the gcj version number. This
>> usually happens, if vendors backport more recent versions of libjava to stable
>> branches (as seen with Fedora, Debian and Ubuntu). There should not be any
>> references to the private subdirectory, besides from libjava itself. The patch
>> is in use without problems in the gcj builds for Debian and Ubuntu, and tested
>> on i686-linux on the trunk.
> 
>> 2007-07-05  Matthias Klose  <doko@ubuntu.com>
>>
>> 	* configure.ac: Encode the libgcj soversion in dbexecdir,
>> 	pass --with-native-libdir to classpath configure.
>> 	* configure: Regenerate.
> 
> I'm now seeing:
> 
> ./config.status: line 405: toolexeclibdir: command not found
> ./config.status: line 695: toolexeclibdir: command not found
> 
> While libjava/config.status has:
> ac_configure_args=" ... --with-native-libdir=$\(toolexeclibdir\)/gcj-4.3.0-9 ... "
> which is ok, libjava/classpath/config.status has:
> ac_configure_args=" '--with-native-libdir=$(toolexeclibdir)/gcj-4.3.0-9' "
> which tries to execute toolexeclibdir as a command.

Avoiding this by not passing a make macro to ac_configure_args, the attached
patch passed a build, check and install.

ok for the trunk?

  Matthias

2007-09-02  Matthias Klose  <doko@ubuntu.com>

        * configure.ac: Robustify passing of --with-native-libdir to classpath.
        * configure: Regenerate.

[-- Attachment #2: libjava-nativedir.diff --]
[-- Type: text/plain, Size: 1281 bytes --]

2007-09-02  Matthias Klose  <doko@ubuntu.com>

	* configure.ac: Robustify passing of --with-native-libdir to classpath.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 128023)
+++ configure.ac	(working copy)
@@ -1377,17 +1377,20 @@
 
 # Determine where the standard .db file and GNU Classpath JNI
 # libraries are found.
+gcjsubdir=gcj-$gcjversion-$libgcj_soversion
 multi_os_directory=`$CC -print-multi-os-directory`
 case $multi_os_directory in
   .)
-   dbexecdir='$(libdir)/gcj-$(gcc_version)'-$libgcj_soversion # Avoid /.
+   dbexecdir='$(libdir)/'$gcjsubdir # Avoid /.
+   nativelibdir="$libdir/$gcjsubdir"
    ;;
   *)
-   dbexecdir='$(libdir)/'$multi_os_directory'/gcj-$(gcc_version)'-$libgcj_soversion
+   dbexecdir='$(libdir)/'$multi_os_directory/$gcjsubdir
+   nativelibdir="$libdir/$multi_os_directory/$gcjsubdir"
    ;;
 esac
 AC_SUBST(dbexecdir)
-ac_configure_args="$ac_configure_args --with-native-libdir=\$\(toolexeclibdir\)/gcj-$gcjversion-$libgcj_soversion"
+ac_configure_args="$ac_configure_args --with-native-libdir=$nativelibdir"
 
 AC_DEFINE(JV_VERSION, "1.5.0", [Compatibility version string])
 AC_DEFINE(JV_API_VERSION, "1.5", [API compatibility version string])

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-09-02 13:44   ` Matthias Klose
@ 2007-09-04 20:31     ` Tom Tromey
  2007-09-04 20:36       ` Jakub Jelinek
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2007-09-04 20:31 UTC (permalink / raw)
  To: Matthias Klose; +Cc: Jakub Jelinek, GCJ-patches, gcc-patches

>>>>> "Matthias" == Matthias Klose <doko@ubuntu.com> writes:

Matthias> Avoiding this by not passing a make macro to
Matthias> ac_configure_args, the attached patch passed a build, check
Matthias> and install.

Matthias> ok for the trunk?

Yes, thanks.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-09-04 20:31     ` Tom Tromey
@ 2007-09-04 20:36       ` Jakub Jelinek
  2007-09-04 22:11         ` Matthias Klose
  2007-09-05  2:33         ` Tom Tromey
  0 siblings, 2 replies; 9+ messages in thread
From: Jakub Jelinek @ 2007-09-04 20:36 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Matthias Klose, GCJ-patches, gcc-patches

On Tue, Sep 04, 2007 at 02:10:25PM -0600, Tom Tromey wrote:
> >>>>> "Matthias" == Matthias Klose <doko@ubuntu.com> writes:
> 
> Matthias> Avoiding this by not passing a make macro to
> Matthias> ac_configure_args, the attached patch passed a build, check
> Matthias> and install.
> 
> Matthias> ok for the trunk?
> 
> Yes, thanks.

Won't this break installs with e.g.
make prefix=/var/tmp/root/usr install ?  As the native libdir
no longer contains make variables, it won't be possible to override
it, and make prefix=something install worked until now for many years.

	Jakub

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-09-04 20:36       ` Jakub Jelinek
@ 2007-09-04 22:11         ` Matthias Klose
  2007-09-05  2:33         ` Tom Tromey
  1 sibling, 0 replies; 9+ messages in thread
From: Matthias Klose @ 2007-09-04 22:11 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Tom Tromey, GCJ-patches, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Jakub Jelinek schrieb:
> On Tue, Sep 04, 2007 at 02:10:25PM -0600, Tom Tromey wrote:
>>>>>>> "Matthias" == Matthias Klose <doko@ubuntu.com> writes:
>> Matthias> Avoiding this by not passing a make macro to
>> Matthias> ac_configure_args, the attached patch passed a build, check
>> Matthias> and install.
>>
>> Matthias> ok for the trunk?
>>
>> Yes, thanks.
> 
> Won't this break installs with e.g.
> make prefix=/var/tmp/root/usr install ?  As the native libdir
> no longer contains make variables, it won't be possible to override
> it, and make prefix=something install worked until now for many years.

$srcdir is expressed in terms of '${prefix}', so this should not break; anyway,
I'm testing the attached patch, which avoids passing the additional argument to
classpath, changing the classpath configure instead (there already was a GCJ
local change). currently building/testing/installing. Will check in this patch
if it succeeds.

  Matthias


[-- Attachment #2: libjava-nativedir.diff --]
[-- Type: text/plain, Size: 2295 bytes --]

libjava/classpath/

2007-09-04  Matthias Klose  <doko@ubuntu.com>

	* configure.ac: Append libgcj soversion to nativeexeclibdir.
	* configure: Regenerate.

libjava/

2007-09-04  Matthias Klose  <doko@ubuntu.com>
 
	* configure.ac: Do not pass --with-native-libdir to classpath.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 128104)
+++ configure.ac	(working copy)
@@ -1389,17 +1389,17 @@
 
 # Determine where the standard .db file and GNU Classpath JNI
 # libraries are found.
+gcjsubdir=gcj-$gcjversion-$libgcj_soversion
 multi_os_directory=`$CC -print-multi-os-directory`
 case $multi_os_directory in
   .)
-   dbexecdir='$(libdir)/gcj-$(gcc_version)'-$libgcj_soversion # Avoid /.
+   dbexecdir='$(libdir)/'$gcjsubdir # Avoid /.
    ;;
   *)
-   dbexecdir='$(libdir)/'$multi_os_directory'/gcj-$(gcc_version)'-$libgcj_soversion
+   dbexecdir='$(libdir)/'$multi_os_directory/$gcjsubdir
    ;;
 esac
 AC_SUBST(dbexecdir)
-ac_configure_args="$ac_configure_args --with-native-libdir=\$\(toolexeclibdir\)/gcj-$gcjversion-$libgcj_soversion"
 
 AC_DEFINE(JV_VERSION, "1.5.0", [Compatibility version string])
 AC_DEFINE(JV_API_VERSION, "1.5", [API compatibility version string])
Index: classpath/configure.ac
===================================================================
--- classpath/configure.ac	(revision 128102)
+++ classpath/configure.ac	(working copy)
@@ -294,14 +294,14 @@
 dnl -----------------------------------------------------------
 dnl Sets the native libraries installation dir
 dnl -----------------------------------------------------------
-dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}
+dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
 AC_ARG_WITH([native-libdir],
 	    [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
 	    [
 	     nativeexeclibdir=${withval}
 	    ],
 	    [
-	     nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`
+	     nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
 	    ])
 
 AC_SUBST(nativeexeclibdir)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [patch] Encode the libgcj soversion in libjava's private dir
  2007-09-04 20:36       ` Jakub Jelinek
  2007-09-04 22:11         ` Matthias Klose
@ 2007-09-05  2:33         ` Tom Tromey
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2007-09-05  2:33 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Matthias Klose, GCJ-patches, gcc-patches

>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

Jakub> Won't this break installs with e.g.
Jakub> make prefix=/var/tmp/root/usr install ?  As the native libdir
Jakub> no longer contains make variables, it won't be possible to override
Jakub> it, and make prefix=something install worked until now for many years.

I didn't realize we supported that.  I thought DESTDIR was the
official GNU way.

Anyway, it sounds like this has already been addressed.

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-05  2:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-05 13:26 [patch] Encode the libgcj soversion in libjava's private dir Matthias Klose
2007-07-05 13:29 ` Andrew Haley
2007-07-28 20:15   ` Tom Tromey
2007-08-21  7:50 ` Jakub Jelinek
2007-09-02 13:44   ` Matthias Klose
2007-09-04 20:31     ` Tom Tromey
2007-09-04 20:36       ` Jakub Jelinek
2007-09-04 22:11         ` Matthias Klose
2007-09-05  2:33         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).