public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/31891]  New: Libjava configuration scripts out of sync for pkg-config tests
@ 2007-05-10  6:18 rob1weld at aol dot com
  2007-05-18  3:01 ` [Bug libgcj/31891] " rob1weld at aol dot com
  0 siblings, 1 reply; 2+ messages in thread
From: rob1weld at aol dot com @ 2007-05-10  6:18 UTC (permalink / raw)
  To: java-prs

This same problem also occurs on i686-pc-cygwin, it likely would occur on all
platforms.


The ./configure scripts "gcc-4_2-branch/libjava/configure" and
"gcc-4_2-branch/libjava/classpath/configure" are out of sync.


During "make" I get this message:

checking for pkg-config... /usr/bin/pkg-config
checking for gtk+-2.0 >= 2.4... yes
checking GTK_CFLAGS... -DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include
checking GTK_LIBS... -L/gtk/bin -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0
-latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext
-lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0
-lglib-2.0 -lintl -liconv
checking for glib-2.0 >= 2.4 gthread-2.0 >= 2.4... yes


Then later I get this message (for classpath directory's configure):

checking for gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0... Requested
'gtk+-2.0 >= 2.8' but version of GTK+ is 2.6.10
configure: error: Library requirements (gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2
gdk-pixbuf-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment
variable if your libraries are in a nonstandard prefix so pkg-config can find
them.
configure: error: /bin/sh
'/cygdrive/C/makecygwin/gcc-4_2-branch/libjava/classpath/configure' failed for
classpath
make[1]: *** [configure-target-libjava] Error 1


So I fix that, type "make", then this happens:

make[3]: Leaving directory
`/cygdrive/c/gcc-4_2-branch-build/i686-pc-cygwin/libjava'
Making all in libltdl
/bin/sh: line 17: cd: libltdl: No such file or directory
make[2]: *** [all-recursive] Error 1


I deleted /cygdrive/c/gcc-4_2-branch-build/i686-pc-cygwin/libjava, to get
configure to retry. (Note: Later I found out that I could simply create the
missing directory and type "make" again.)


My complaint is that the first message is "checking for gtk+-2.0 >= 2.4...
yes", then sometime later it wants 2.8. When that is fixed ./configure doesn't
know what to do about the missing libltdl directory. The _first_ configure
script should check for 2.8 (if a _later_ script requires that version) and it
should work through the missing directory issue correctly. 


The scripts in Cygwin's gcc, configure uses a more thorough method for testing
gtk. This is from the /cygdrive/c/cygwin/usr/src/gcc-3.4.4/libjava/configure
script (obtained by downloading source from cygwin.com using setup.exe). Here
is a modified snippet from config.log:



/*
configure:6823: checking for pkg-config
configure:6871: checking for GTK+ - version >= 2.2.0
configure:6981: gcc -o conftest.exe -DXTHREADS -DXUSE_MTSAFE_API
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include -I/include
-I/usr/local/include  conftest.c -L/gtk/bin -L/usr/X11R6/lib -lgtk-x11-2.0
-lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz
-lXrender -lXext -lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -lintl -liconv    1>&5
configure: failed program was:
#line 6906 "configure"
*/

/* Compile using

gcc -o test1.exe -DXTHREADS -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include   -I/usr/include -I/include -I/usr/local/include 
test1.c -L/gtk/bin -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext
-lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0
-lglib-2.0 -lintl -liconv

*/

#include "confdefs.h"

#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>

int 
main ()
{
  int major, minor, micro;
  char *tmp_version;

  system ("touch conf.gtktest");

  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = g_strdup("2.2.0");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     printf("%s, bad version string\n", "2.2.0");
     exit(1);
   }

  if ((gtk_major_version != 2) ||
      (gtk_minor_version != 10) ||
      (gtk_micro_version != 6))         /* ./configure figures out those values
and sed's them here */
    {
      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but
GTK+ (%d.%d.%d)\n", 
             2, 10, 6,
             gtk_major_version, gtk_minor_version, gtk_micro_version);  /* Call
the .dlls */
      printf ("*** was found! If pkg-config was correct, then it is best\n");
      printf ("*** to remove the old version of GTK+. You may also be able to
fix the error\n");
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by
editing\n");
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that
is\n");
      printf("*** required on your system.\n");
      printf("*** If pkg-config was wrong, set the environment variable
PKG_CONFIG_PATH\n");
      printf("*** to point to the correct configuration files\n");
    } 
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
           (gtk_minor_version != GTK_MINOR_VERSION) ||
           (gtk_micro_version != GTK_MICRO_VERSION))                    /*
Compare with installed headers */
    {
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
      printf("*** library (version %d.%d.%d)\n",
             gtk_major_version, gtk_minor_version, gtk_micro_version);
    }
  else
    {
      if ((gtk_major_version > major) ||
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
        ((gtk_major_version == major) && (gtk_minor_version == minor) &&
(gtk_micro_version >= micro)))
      {
        return 0;
       }
     else
      {
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
               gtk_major_version, gtk_minor_version, gtk_micro_version);
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest
version of\n",
               major, minor, micro);
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
        printf("***\n");
        printf("*** If you have already installed a sufficiently new version,
this error\n");
        printf("*** probably means that the wrong copy of the pkg-config shell
script is\n");
        printf("*** being found. The easiest way to fix this is to remove the
old version\n");
        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to
point to the\n");
        printf("*** correct copy of pkg-config. (In this case, you will have
to\n");
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit
/etc/ld.so.conf\n");
        printf("*** so that the correct libraries are found at run-time))\n");
      }
    }
  return 1;
}

The "old" method was to create a program and make a call to the library to get
it to tell you it's version. The "modern" way is to use pkg-config (which
usually requires you to get the xyz-DEVEL-version just to get the .pc file).

Note that the above code is not perfect. First it tests "!=" and if true,
fails. It does not get to the test further on that checks ">". The code (as
written) requires that the version of the headers match the version of the
.dlls, but the (windows) gtk site
(http://www.gimp.org/~tml/gimp/win32/downloads.html) says it is OK to use old
headers and new .dlls. 

It _might_ be OK to change the test to allow older headers with the newer .dlls
for _some_ versions (no doubt there are versions of each that this would not
work - it is easier not to check a compatability list but leads to more work to
install dev libs).


A good place to get gtk for Cygwin (ready to roll) is from:

GTK+ and The GIMP installers for Windows
http://sourceforge.net/project/showfiles.php?group_id=121075


First install the Cygwin setup.exe Gtk (and other needed files), then install
the sourceforge version using directory c:\cygwin\gtk\2.0\ (instead of the
installer program's default).


Next, alter your C:\cygwin\lib\pkgconfig\gtk+-2.0.pc file and fix these two
lines like this:

libdir=/gtk/2.0/bin/
Version: 2.10.11


(You might also need to impgen the .dll files.)

Java seems to be configuring fine (for Cygwin) and compiling without error.


For Linux I used a non-stable gtk (and all the other gtk dependancies) obtained
with Aptitude (and a LOT of dependancy tweaking). Evrything _IS_ compiling and
testing very well under Linux (for the JAVA portion of gcc).


-- 
           Summary: Libjava configuration scripts out of sync for pkg-config
                    tests
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31891


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

* [Bug libgcj/31891] Libjava configuration scripts out of sync for pkg-config tests
  2007-05-10  6:18 [Bug libgcj/31891] New: Libjava configuration scripts out of sync for pkg-config tests rob1weld at aol dot com
@ 2007-05-18  3:01 ` rob1weld at aol dot com
  0 siblings, 0 replies; 2+ messages in thread
From: rob1weld at aol dot com @ 2007-05-18  3:01 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from rob1weld at aol dot com  2007-05-18 04:01 -------
A recent gcc 4.2.1 compile (20070515 - revision 124745) for Linux is here:
http://gcc.gnu.org/ml/gcc-testresults/2007-05/msg00812.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31891


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

end of thread, other threads:[~2007-05-18  3:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-10  6:18 [Bug libgcj/31891] New: Libjava configuration scripts out of sync for pkg-config tests rob1weld at aol dot com
2007-05-18  3:01 ` [Bug libgcj/31891] " rob1weld at aol dot com

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).