autoconf
[Top][All Lists]
Advanced

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

Re: how to use AC_CHECK_LIB without LDFLAGS?


From: Braden McDaniel
Subject: Re: how to use AC_CHECK_LIB without LDFLAGS?
Date: Fri, 05 Nov 2004 14:03:14 -0500
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Harald Dunkel wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Braden McDaniel wrote:
| Harald Dunkel wrote:
|
|> -----BEGIN PGP SIGNED MESSAGE-----
|> Hash: SHA1
|>
|> Braden McDaniel wrote:
|> |
|> | I don't fully understand the problem you're describing; but perhaps you
|> | want to do something like this:
|> |
|> | save_LDFLAGS="$LDFLAGS"
|> | LDFLAGS="$LDFLAGS -Lwhatever"
|> | AC_CHECK_LIB(...)
|> | LDFLAGS="$save_LDFLAGS"
|> |
|>
|> No, what I want to do is something like
|>
|> AC_CHECK_LIB([my], [anysym], ["-static -L/mylibs -L/plibs"], [], [])
|>
|> but this doesn't seem to be in the interface.
|
|
| It looks to me like you could accomplish the same thing with the
| solution I gave you. What's wrong with it?
|

Sorry, but it is error-prone, and it is pretty painfull
to copy-n-paste all these lines for each library test. I
thought the goal of autoconf is to make maintaining a
build system easier?

No offense.

The macros included by autoconf are building blocks. The requirements of different projects vary so much that it's simply unrealistic to expect there already to exist a macro for whatever you might need. Doing nontrivial things with autoconf pretty much requires that you learn the basics of writing your own macros. That said, it's a good idea to look here first to see if someone's already solved the problem and made the solution available:

  <http://www.gnu.org/software/ac-archive/>

My suggestion would be to put your wrapper into an
additional macro AC_CHECK_LIB_XTD. Give me some time
to learn m4 and I could post it here, but I guess it
would be pretty easy.

Would this be possible?

I doubt you'll find much support for adding such a macro to autoconf. (Your requirements aren't as common as you might think; in fact, I'm inclined to suspect there's a better and completely different solution to the problem you're trying to solve. But I don't have enough information about the problem parameters to make a concrete suggestion.) But there's nothing stopping you from writing your own.

AC_DEFUN([YOUR_CHECK_LIB],
[save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
AC_CHECK_LIB([$1], [$2], [$4], [$5])
LDFLAGS="$save_LDFLAGS"
])

Braden




reply via email to

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