You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kenneth Porter <sh...@sewingwitch.com> on 2006/01/10 03:01:35 UTC
Building JavaHL fails with Red Hat "alternatives"
Red Hat Fedora implements a system called "alternatives" for
simultaneous installation of competing solutions for various
technologies, such as email servers and Java suppliers. This is
accomplished through scripts and a network of symbolic links.
When configuring Subversion (ie. running the configure script), the JNI
headers are located based on the supplied JDK root. Code in build/ac-
macros/java.m4 assembles the list of header subdirectories to pass to
the build tools.
This fails on Fedora because the top-level include directory is a
symbolic link, and the find command used doesn't follow the symlink to
find its subdirectories. To fix this, invocations of find in java.m4
should include the -follow switch.
[buildmeister@segw java]$ ls -l /usr/lib/jvm/java/include
lrwxrwxrwx 1 root root 31 Nov 29 19:19 /usr/lib/jvm/java/include ->
/usr/java/j2sdk1.4.2_10/include
[buildmeister@segw java]$ find /usr/lib/jvm/java/include -type d
[buildmeister@segw java]$ find /usr/lib/jvm/java/include -follow -type d
/usr/lib/jvm/java/include
/usr/lib/jvm/java/include/linux
Suggested fix:
--- java.m4 2006-01-09 18:25:03.570422116 -0800
+++ java.m4.new 2006-01-09 18:59:56.069761404 -0800
@@ -136,7 +136,7 @@
fi
JNI_INCLUDES="-I$JNI_INCLUDEDIR"
- list="`find "$JNI_INCLUDEDIR" -type d -print`"
+ list="`find "$JNI_INCLUDEDIR" -follow -type d -print`"
for dir in $list; do
JNI_INCLUDES="$JNI_INCLUDES -I$dir"
done
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Building JavaHL fails with Red Hat "alternatives"
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Sun, Jan 15, 2006 at 07:09:41AM -0600, Peter Samuelson wrote:
> [Kenneth Porter]
> > > the find command used doesn't follow the symlink to find its
> > > subdirectories. To fix this, invocations of find in java.m4 should
> > > include the -follow switch.
>
> I suggest just putting a trailing "/" after the pathname in the find
> command.
>
> - list="`find "$JNI_INCLUDEDIR" -type d -print`"
> + list="`find "$JNI_INCLUDEDIR/" -type d -print`"
>
> That does end up printing $JNI_INCLUDEDIR/ itself with the trailing
> slash, but trailing slashes on dirs never hurt anybody in Unix.
>
This sounds like a reasonable course of action. Could anyone check that
this doesn't cause any problems for a javahl build?
Note that this may cause the include paths to contain double-slashes,
specifically on Darwin, where the output from 'find /usr/' includes
paths like '/usr//bin'. That shouldn't be a problem either, but, again,
it would be nice if someone could check.
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Building JavaHL fails with Red Hat "alternatives"
Posted by Peter Samuelson <pe...@p12n.org>.
[Malcolm Rowe]
[Kenneth Porter]
> > the find command used doesn't follow the symlink to find its
> > subdirectories. To fix this, invocations of find in java.m4 should
> > include the -follow switch.
> 'find -follow' isn't defined by POSIX, though it looks like it might
> be implemented widely enough that this doesn't matter
I suggest just putting a trailing "/" after the pathname in the find
command.
- list="`find "$JNI_INCLUDEDIR" -type d -print`"
+ list="`find "$JNI_INCLUDEDIR/" -type d -print`"
That does end up printing $JNI_INCLUDEDIR/ itself with the trailing
slash, but trailing slashes on dirs never hurt anybody in Unix.
Peter
Re: Building JavaHL fails with Red Hat "alternatives"
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Jan 10, 2006 at 03:01:35AM +0000, Kenneth Porter wrote:
> This fails on Fedora because the top-level include directory is a
> symbolic link, and the find command used doesn't follow the symlink to
> find its subdirectories. To fix this, invocations of find in java.m4
> should include the -follow switch.
>
'find -follow' isn't defined by POSIX, though it looks like it might
be implemented widely enough that this doesn't matter (POSIX provides
'find -L' as the supported way to achieve this, but GNU find doesn't
support that).
Certainly -follow seems to work fine on Darwin and GNU find - does anyone
know whether it's supported widely enough to use?
(I've not tested the patch, but the idea seems sane enough).
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org