Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Jiang <chaoj@infipwr.com>
To: buildroot@busybox.net
Subject: [Buildroot] AC_CHECK_LIB doesn't work for cross-compiling
Date: Thu, 25 Dec 2014 22:25:14 +0900	[thread overview]
Message-ID: <549C103A.5000908@infipwr.com> (raw)
In-Reply-To: <20141225064950.GG6400@tarshish>

On 12/25/2014 03:49 PM, Baruch Siach wrote:
> Hi adam,
>
> On Thu, Dec 25, 2014 at 03:27:40PM +0900, Adam Jiang wrote:
>> Here is what I got from grep in config.log.
>>
>> $ grep -i FCGX_InitRequest output/build/visage-master/config.log
>> configure:5626: checking for FCGX_InitRequest in -lfcgi
>> | char FCGX_InitRequest ();
>> | return FCGX_InitRequest ();
>> configure:5689: WARNING: unable to find the FCGX_InitRequest() function
>> ac_cv_lib_fcgi_FCGX_InitRequest=no
>>
>> I have also attached 'config.log' as well.
> The interesting part in your config.log is
>
> 	libfcgi.so: undefined reference to `frexp'
>
> This means that libfcgi.so depends on the math library (libm), but you didn't
> add it to the compile command line (-lm). Please try adding -lm to the
> AC_CHECK_LIB macro OTHER-LIBRARIES parameter as follows:
>
> 	AC_CHECK_LIB([fcgi], [FCGX_InitRequest], [LIBS="$LIBS -lfcgi],
> 		[AC_MSG_WARN("unable to find the FCGX_InitRequest() function")],
> 		[-lm])

Probably, the dependency on '-lm' issue is caused by difference between 
glibc and uclibc. Does uclibc split math library into another library 
and don't implicitly include it?

/adam

> baruch
>
>> On 12/25/2014 01:47 PM, Baruch Siach wrote:
>>> On Thu, Dec 25, 2014 at 01:34:59PM +0900, Adam Jiang wrote:
>>>> I am trying to add a new package to buildroot. the package is built upon
>>>> autotools. thus, it is supposed to be very easy to make it
>>>> cross-compilable. ever, i got suck at AC_CHECK_LIB macro. it doesn't
>>>> work well at cross-compiling while it does work on normal compiling.
>>>>
>>>> AC_CHECK_LIB([fcgi], [FCGX_InitRequest], [AC_MSG_WARN("unable to find
>>>> the FCGX_InitRequest() function")])
>>>>
>>>> always failed even though I do have libfcgi in my configuration. The
>>>> error message looks like
>>>>
>>>> checking for FCGX_InitRequest in -lfcgi... no
>>>> configure: WARNING: unable to find the FCGX_InitRequest() function
>>>>
>>>> I don't think AC_CHECK_LIB will not work on cross-compiling because it
>>>> seems there are lots of other target packages in buildroot using the
>>>> macro. Most probably, I am doing something wrong.
>>>>
>>>> Does AC_CHECK_LIB work in buildroot? If the macro needs some changes,
>>>> how could I do it?
>>> What do you have in config.log for the FCGX_InitRequest check?

      parent reply	other threads:[~2014-12-25 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-25  4:34 [Buildroot] AC_CHECK_LIB doesn't work for cross-compiling Adam Jiang
2014-12-25  4:47 ` Baruch Siach
2014-12-25  6:27   ` Adam Jiang
2014-12-25  6:49     ` Baruch Siach
2014-12-25 13:03       ` Adam Jiang
2014-12-26 14:31         ` Thomas Petazzoni
2014-12-25 13:25       ` Adam Jiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549C103A.5000908@infipwr.com \
    --to=chaoj@infipwr.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox