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

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

 



According to Diego Elio Pettenò on 2/24/2010 8:04 AM:
> +dnl AFX to get a unique namespace before it is submitted somewhere
> +dnl (like autoconf-archive).
> +AC_DEFUN([AFX_LIB_DLOPEN], [

Just curious: Why the choice of AFX_, and not something like LV_ for libvirt?

> +  DLOPEN_LIBS=
> +
> +m4_pushdef([action_if_not_found],
> +           [m4_default([$2],
> +                       [AC_MSG_ERROR([Unable to find the dlopen() function])]
> +                      )
> +           ])
> +
> +  old_libs=$LIBS
> +  AC_SEARCH_LIBS([dlopen], [dl],
> +    [DLOPEN_LIBS=${LIBS#${old_libs}}

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?

> +     $1], action_if_not_found)

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.  It should work to pass [action_if_not_found] rather than
action_if_not_found, or even avoid the temporary macro altogether and
inline the m4_default directly as the argument to AC_SEARCH_LIBS.

Is this something that would be worth wrapping in an AC_CACHE_CHECK, to
avoid repeating the check if config.cache exists?

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]