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

Re: [libvirt] [PATCH 3/4] Add a simple macro to check in which library dlopen() is, and use it.



According to Diego Elio “Flameeyes” Pettenò on 2/24/2010 8:27 AM:
>> The shell expansion ${a#b} is not portable to Solaris /bin/sh.  Is that a
>> problem for libvirt, or are we Linux-centric enough to not care?
> 
> That's definitely a problem I didn't think about, I was expecting POSIX
> shell to support that, but I'll look for another way.

POSIX, yes.  But Solaris /bin/sh is not POSIX.

>> Underquoted; if the AC_MSG_ERROR were ever changed to contain a comma,
>> then this would be passing an unintentional extra argument to
>> AC_SEARCH_LIBS.
> 
> I have to double check that one but I think that if I were to quote that
> it wouldn't expand properly.

Maybe the alternative is to use m4_default_quoted (oops, not portable to
older autoconf), or m4_default([$2], [[AC_MSG_ERROR([])]]) in the
definition of action_if_not_found.  The problem I'm trying to avoid is
that you should be sure that AC_SEARCH_LIBS sees [AC_MSG_ERROR([])], and
not the underquoted AC_MSG_ERROR([]), so that the contents of the error
message can safely be changed to have m4 metacharacters without any impact.

> 
>> Is this something that would be worth wrapping in an AC_CACHE_CHECK, to
>> avoid repeating the check if config.cache exists?
> 
> The inner check is already cached, so I don't think there is much need
> for adding one further cache…

Good point.  All of the heavy lifting is already in AC_SEARCH_LIBS, so
adding another cache layer doesn't buy anything.

> 
> But this actually made me think that we might as well just use
> AC_SEARCH_LIB and rely on the value stored in the cache to begin with so
> I'll send a different version in a moment.

Which may render all of the above comments obsolete, depending on what you
come up with.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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