Problem with AC_CHECK_FUNC and order of gcc command-line parameters

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

 



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
=============




_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux