Mailinglist Archive: opensuse-java (11 mails)

< Previous Next >
Re: [opensuse-java] Problem with linking JNI
  • From: Michal Vyskocil <mvyskocil@xxxxxxx>
  • Date: Thu, 11 Mar 2010 16:04:42 +0100
  • Message-id: <201003111604.43166.mvyskocil@xxxxxxx>
On Monday 08 March 2010 11:00:05 am Kirill Kirillov wrote:
Hi, all!

We [1] are trying to move [2] Java-based Scilab [3] to Factory OSS
repository.

We have problem with linking jogl JNI to Scilab [4], if we remove the
following line in scilab.spec:
"BuildRequires: -post-build-checks"
then build fails on configure stage with the following error:

checking jogl... /usr/lib64/java//jogl.jar
checking for glTexParameterf in -ljogl... no
configure: WARNING: Could not link against -ljogl. Will try against -ljogl
-lGL checking for glTexParameterf in -ljogl ... no
configure: error: "libjogl: Library missing (Cannot find symbol
glTexParameterf). Check if libjogl - C/Java (JNI) interface for JOGL - or
libGL are installed and if the version is correct. Note that you might
have to update etc/librarypath.xml to provide the actual path the the JNI
libraries." error: Bad exit status from /var/tmp/rpm-tmp.CYklG7 (%build)

I've fixed jogl package [5] to place jar's and so's according to [6]:
/usr/lib/java and /usr/lib/jni for 32 bits and
/usr/lib64/java and /usr/lib64/jni for 64 bits.
But unfortunately it didn't help.

Could you tell please how to fix it? Thanks.

After help of guys from packaging ML - there's a patch for configure.ac (don't
forget to run autoreconf -fi before configure). It fixes jogl and gluegen-rt
tests, the configure now ends on missing fop. And also it needs to be applied
with -p1

Regards
Michal Vyskocil
---
configure.ac | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Index: scilab-5.2.1/configure.ac
===================================================================
--- scilab-5.2.1.orig/configure.ac 2010-02-17 09:06:08.000000000 +0100
+++ scilab-5.2.1/configure.ac 2010-03-11 15:39:45.026798167 +0100
@@ -700,12 +700,13 @@
LDFLAGS="-L/usr/lib/jni -L/usr/lib64/jni/
-L$SCI_SRCDIR/thirdparty/ -L$SCI_SRCDIR/bin/"
AC_CHECK_LIB([jogl], [glTexParameterf],
[JOGL_LIBS="-ljogl"],[AC_MSG_WARN([Could not link against -ljogl. Will try
against -ljogl -lGL])])
if test -z "$JOGL_LIBS"; then # The previous
test failed add more options to the LDFLAGS
- LDFLAGS="$LDFLAGS -lGL "
+ LDFLAGS="$LDFLAGS"
# the space after "jogl" in the
following line is on
# purpose to disable the cache
AC_CHECK_LIB([jogl ],
[glTexParameterf],
[JOGL_LIBS="-ljogl -lGL"],
- [AC_MSG_ERROR(["libjogl: Library
missing (Cannot find symbol glTexParameterf). Check if libjogl - C/Java (JNI)
interface for JOGL - or libGL are installed and if the version is correct. Note
that you might have to update etc/librarypath.xml to provide the actual path
the the JNI libraries."])])
+ [AC_MSG_ERROR(["libjogl: Library
missing (Cannot find symbol glTexParameterf). Check if libjogl - C/Java (JNI)
interface for JOGL - or libGL are installed and if the version is correct. Note
that you might have to update etc/librarypath.xml to provide the actual path
the the JNI libraries."])],
+ [-lGL])
fi

LDFLAGS=$LDFLAGS_save
@@ -724,7 +725,8 @@
LDFLAGS="-L/usr/lib/jni -L/usr/lib64/jni/
-ldl -L$SCI_SRCDIR/thirdparty/ -L$SCI_SRCDIR/bin/"

symbol="Java_com_sun_gluegen_runtime_UnixDynamicLinkerImpl_dlclose__J"
AC_CHECK_LIB([gluegen-rt], [$symbol],
[GLUEGEN_RT_LIBS="-lgluegen-rt"],
- [AC_MSG_ERROR([libgluegen-rt: Library
missing (Cannot find symbol glTexParameterf). Check if libgluegen-rt - C/Java
(JNI) interface for GLUEGEN - is installed and if the version is correct. Note
that you might have to update etc/librarypath.xml to provide the actual path
the the JNI libraries.])])
+ [AC_MSG_ERROR([libgluegen-rt: Library
missing (Cannot find symbol glTexParameterf). Check if libgluegen-rt - C/Java
(JNI) interface for GLUEGEN - is installed and if the version is correct. Note
that you might have to update etc/librarypath.xml to provide the actual path
the the JNI libraries.])],
+ [-ldl])
LDFLAGS=$LDFLAGS_save
fi

< Previous Next >
Follow Ups
References