summaryrefslogtreecommitdiffstats
path: root/redhat/tdebindings/kdebindings-3.5.6-libgcj.patch
blob: 4ec555a4a89981faf60ce63b02e5eeb4f4140c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--- kdebindings-3.5.6/admin/acinclude.m4.in.libgcj	2007-01-15 17:16:52.000000000 -0600
+++ kdebindings-3.5.6/admin/acinclude.m4.in	2007-03-19 12:08:45.000000000 -0500
@@ -5261,7 +5261,18 @@
   dnl Look for libjvm.so
   kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
   dnl Look for libgcj.so
-  kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+  if test -z "$PKG_CONFIG"; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  fi
+  if (`$PKG_CONFIG --exists libgcj-4.1`) ; then
+    JVMLIBS=`$PKG_CONFIG --libs libgcj-4.1`
+    kde_java_libgcjdir=`$PKG_CONFIG --variable=libdir libgcj-4.1`
+  elif (`$PKG_CONFIG --exists libgcj`) ; then
+    JVMLIBS=`$PKG_CONFIG --libs libgcj`
+    kde_java_libgcjdir=`$PKG_CONFIG --variable=libdir libgcj`
+  else
+    kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
+  fi
   dnl Look for libhpi.so and avoid green threads
   kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
 
@@ -5302,10 +5313,6 @@
      if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
         AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
      fi 
-  else
-     if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
-        AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
-     fi 
   fi
 
   if test ! -x "$kde_java_bindir/java"; then
@@ -5359,7 +5366,13 @@
     if test "x$kde_java_libgcjdir" = "x"; then 
       JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
     else
-      JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+      if test "x$JVMLIBS" = "x"; then
+        if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
+          AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
+        else
+          JVMLIBS="-L$kde_java_libgcjdir -lgcj"
+        fi
+      fi
     fi
     AC_MSG_RESULT([java JDK in $kde_java_bindir])