bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_LINK_IFELSE unexpectedly fails on Ubuntu 12.04


From: David Pointon
Subject: AC_LINK_IFELSE unexpectedly fails on Ubuntu 12.04
Date: Fri, 25 Oct 2013 14:33:43 +0100

Hi ,

When running the configure script for OpenJDK on Ubuntu 12.04, the 
'checking if we can compile and link with freetype...' check fails 
unexpectedly ...

$ sh ./configure --with-jdk-variant=ibm 
--with-import-hotspot=../../SVN/sdk80 --enable-openjdk-only 
--with-freetype-lib=/usr/lib/i386-linux-gnu 
--with-freetype-include=/usr/include
.
.
configure: Found freetype include files at /usr/include using 
--with-freetype
checking for freetype includes... /usr/include
checking for freetype libraries... /usr/lib/i386-linux-gnu
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 -I/usr/include 
and FREETYPE_LIBS=-L/usr/lib/i386-linux-gnu -lfreetype
configure: error: Can not continue without freetype. 
configure exiting with result code 1
$

The above confirms that the freetype headers have, but interestingly not 
the libraries have not, been found. Inspection of the build log reveals 
the following command to have been run:

configure:34201:  /usr/bin/g++-4.6 -o conftest -I/usr/include/freetype2 
-I/usr/include -L/usr/lib/i386-linux-gnu -lfreetype conftest.cpp >&5

against the conftest code. The problem can be readily simplified viz - 
given a copy of the conftest file, in t.c, containing ...

$ cat t.c
#include<ft2build.h>
#include FT_FREETYPE_H
int main () {
        FT_Init_FreeType(NULL);
        return 0;
}
$

... the following commands and their results are all observed ...

$ <compiler> t.c `freetype-config --cflags` `freetype-config --libs`
$ <compiler> `freetype-config --cflags` t.c `freetype-config --libs`
$ <compiler> `freetype-config --cflags` `freetype-config --libs` t.c
/tmp/ccCTZzpt.o: In function `main':
t.c:(.text+0x11): undefined reference to `FT_Init_FreeType'
collect2: ld returned 1 exit status
$

where the same results are observed whether <compiler>is cc, gcc or g++.

Thus it will be seen that, unlike the gcc of old, the ordering of the 
options to the compiler is of paramount importance on Ubuntu - the linker 
option(s) must be specified after the source source file and any CFLAGS.

I have repeated the exercise on Solaris 10, AIX 7.1 & RHEL 6 - on none of 
which is the problem prevalent i.e. the command line options can be 
specified in any order resulting in a.out being successfully generated.

As configure failed, running make check is not possible since there is no 
Makefile.

Rgds ,

--
Dave Pointon FIAP MBCS | Now I saw, tho' too late, the folly of beginning 
a work before we
Test/Software Engineer     |  count the cost and before we we judge 
rightly of our strength to
                                      |  go thro' with it - Robinson 
Crusoe
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU




reply via email to

[Prev in Thread] Current Thread [Next in Thread]