octave-maintainers
[Top][All Lists]
Advanced

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

Re: [PATCH] acinclude.m4: Use pkg-config when available in OCTAVE_CHECK_


From: Jordi Gutiérrez Hermoso
Subject: Re: [PATCH] acinclude.m4: Use pkg-config when available in OCTAVE_CHECK_LIB
Date: Sun, 08 May 2016 11:18:46 -0400

Ping on the patch below. I think it's ok to always use pkg-config for
any library if available, but I don't like the code duplication
between having this check in the general OCTAVE_CHECK_LIB. Can someone
help me figure out the right m4 magic to move the duplicate code from
sndfile and portaudio checks into a common location?

On Fri, 2015-05-22 at 17:06 -0400, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <address@hidden>
> # Date 1432328517 14400
> #      Fri May 22 17:01:57 2015 -0400
> # Node ID 431f166a56cb347f8351950411f58f1b9c5f6621
> # Parent  561af1ab60990a990c70c279475b621846639a83
> acinclude.m4: Use pkg-config when available in OCTAVE_CHECK_LIB
> 
> (Hi, I'm using the Mercurial patchbomb extension to email you a patch
> for code review.)
> 
> The following patch uses pkg-config to add extra flags whenever
> possible. This was necessary for me in Debian in order to find the
> HDF5 libraries, and seems useful in general.
> 
> Like it often happens with m4 and autoconf, I cargo-culted this code
> from existing checks for sndfile in configure.ac. It probably would
> make sense to move the original code into its own m4 macro, so we can
> have a little less code duplication in the autoconf files.
> 
> Any comments if this is the best way to do this? It seems to have
> solved my immediate problem and now hdf5 is recognised on Debian
> without needing to pass extra flags to the configure script.
> 
> diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
> --- a/m4/acinclude.m4
> +++ b/m4/acinclude.m4
> @@ -598,6 +598,12 @@ AC_DEFUN([OCTAVE_CHECK_LIB], [
>      ;;
>    esac
>  
> +  PKG_CHECK_EXISTS([$1], [
> +    m4_toupper([$1])_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $1) 
> $m4_toupper([$1])_CPPFLAGS"
> +    m4_toupper([$1])_LDFLAGS="$($PKG_CONFIG --libs-only-L $1) 
> $m4_toupper([$1])_LDFLAGS"
> +    m4_toupper([$1])_LIBS="$($PKG_CONFIG --libs-only-l $1) 
> $m4_toupper([$1])_LIBS"
> +  ])
> +
>    warn_$1="$3"
>    m4_set_add([summary_warning_list], [warn_$1])
>  







reply via email to

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