autoconf
[Top][All Lists]
Advanced

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

Problem with AC_CHECK_FUNC and order of gcc command-line parameters


From: Horst Wagner
Subject: Problem with AC_CHECK_FUNC and order of gcc command-line parameters
Date: Wed, 10 Aug 2005 22:10:02 -0400

Hi,

I am having trouble with AC_CHECK_FUNC. It turns out that the order of
parameters on the gcc commandline configure uses to compile code to check
for the existence of the function is not proper in my case.
I could not find any mention of such a problem in newsgroups, so I am
assuming I am doing something stupid.
The root problem is that in the compile command the source file name
(conftest.c) is placed behind the $LDFLAGS. Latter library contains the
function I am checking for.
If I reorder the commandline such that -lgd comes after conftest.c (the way
it ought to be according to the gcc documentation) then the code compiles
fine. I observe this problem with both autoconf-2.1.3 and 2.5.9 and am
running on cygwin using gcc3.4.4
I appreciate any tips on how to resolve this.

Thanks,
Horst


Here is the appropriate excerpt from configure.in

=============
LDFLAGS="$LDFLAGS -lgd"
AC_CHECK_FUNC(gdImagePng, DO_GD=' ';AC_DEFINE(DO_GD))
=============

Here is the appropriate excerpt from config.log:
=============
configure:2242: checking for gdImagePng
configure:2270: gcc -o
conftest -g -O2  -I/usr/X11R6/include -I/usr/local/include    -L/usr/X11R6/l
ib -L/usr/local/lib -lm -lX11 -lgd conftest.c 1>&5
/D/tmp/ccQFB8tX.o: In function `main':
/cygdrive/d/horst/C/g2/g2/configure:2264: undefined reference to
`_gdImagePng'
collect2: ld returned 1 exit status
=============






reply via email to

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