Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8027441

Configure fails on (k)ubuntu 12.04

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • infrastructure
    • None

      Running configure like this:
      $ bash configure --with-boot-jdk=$HOME/netbeans/jdks/jdk17 --with-num-cores=1 --with-jobs=1 --with-memory-size=1024

      Fails with:
      -----
      checking cups/ppd.h presence... yes
      checking for cups/ppd.h... yes
      checking for FREETYPE... yes
      checking for freetype... yes (using pkg-config)
      checking if we can compile and link with freetype... no
      configure: Could not compile and link with freetype. This might be a 32/64-bit mismatch.
      configure: Using FREETYPE_CFLAGS=-I/usr/include/freetype2 and FREETYPE_LIBS=-lfreetype
      configure: error: Can not continue without freetype. You might be able to fix this by running 'sudo apt-get install libfreetype6-dev'.
      configure exiting with result code 1
      -----

      This appears to be caused by listing linker flags before the source file on the gcc command line in 'common/autoconf/generated-configure.sh'. Taking this example (from configure script):
      -----test.cpp:
      /* confdefs.h */
      #define PACKAGE_NAME "OpenJDK"
      #define PACKAGE_TARNAME "openjdk"
      #define PACKAGE_VERSION "jdk8"
      #define PACKAGE_STRING "OpenJDK jdk8"
      #define PACKAGE_BUGREPORT "build-dev@openjdk.java.net"
      #define PACKAGE_URL "http://openjdk.java.net"
      #define STDC_HEADERS 1
      #define HAVE_SYS_TYPES_H 1
      #define HAVE_SYS_STAT_H 1
      #define HAVE_STDLIB_H 1
      #define HAVE_STRING_H 1
      #define HAVE_MEMORY_H 1
      #define HAVE_STRINGS_H 1
      #define HAVE_INTTYPES_H 1
      #define HAVE_STDINT_H 1
      #define HAVE_UNISTD_H 1
      #define HAVE_STDIO_H 1
      #define SIZEOF_INT_P 8
      #define HAVE_X11_EXTENSIONS_SHAPE_H 1
      #define HAVE_X11_EXTENSIONS_XRENDER_H 1
      #define HAVE_X11_EXTENSIONS_XTEST_H 1
      #define HAVE_X11_INTRINSIC_H 1
      #define HAVE_CUPS_CUPS_H 1
      #define HAVE_CUPS_PPD_H 1
      /* end confdefs.h. */

             #include<ft2build.h>
             #include FT_FREETYPE_H
             int main () {
               FT_Init_FreeType(NULL);
               return 0;
             }
      -----

      Building like this does not work:
      $ /usr/bin/g++-4.6 -o conftest -I/usr/include/freetype2 -lfreetype test.cpp
      /tmp/cchXKTqQ.o: In function `main':
      test.cpp:(.text+0xa): undefined reference to `FT_Init_FreeType'
      collect2: ld returned 1 exit status

      Building like this does work:
      $ /usr/bin/g++-4.6 -o conftest -I/usr/include/freetype2 test.cpp -lfreetype

      Not sure why the order matters, though.

      The problem happens with a recent checkout of jdk8/tl:
      $ for d in . *; do if [ -d $d/.hg ] ; then echo $d; hg id $d; fi; done
      .
      a36df87b3901+ tip
      corba
      219e616a6a4f tip
      hotspot
      0e55a181cb08 tip
      jaxp
      96562bf197f2 tip
      jaxws
      9ad289610fc6 tip
      jdk
      d34c5e860d5f tip
      langtools
      44e3ba40e00c tip
      nashorn
      767e85d2a1b3 tip

      I'll attach a workaround patch that seems to work for me (so far).

            Unassigned Unassigned
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: