On 04/27/2012 02:16 PM, Peter Portante wrote:
> The package config check for gthreads might have already placed
> a -lrt switch in LIBS earlier.
> 
> Refactored the code from the pthread switch removal, from commit
> e3c56761b465a4253871c32b06ebbc2d8b3fc3e1, to make it work for the
> more general case.
> 

> +add_to_libs() {
> +  found=no
> +  for lib_entry in $LIBS; do
> +    if test "$lib_entry" = "$1"; then
> +      found=yes
> +      break
> +    fi
> +  done
> +  if test "$found" = "no"; then
> +    LIBS="$1 $LIBS"
> +  fi
> +}

Shorter (and probably faster) to write this as:

add_to_libs() {
  case " $LIBS " in
    " $1 ") ;;
    *) LIBS="$1 $LIBS" ;;
  esac
}

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to