Re: [ecasound] libecasoundc-config howto?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] libecasoundc-config howto?
From: Kai Vehmanen (kai.vehmanen_AT_wakkanet.fi)
Date: Mon Mar 10 2003 - 15:50:21 EET


On Mon, 10 Mar 2003, Remco Poelstra wrote:

> detected anymore. (I used
> AC_CHECK_LIB(ecasoundc,eci_init,,AC_MESSAGE_ERROR(Can't find ecasoundc,
> please install)) ).

Hmm, what's the full error in config.log?

> I found out that libecasoundc-config is provided by
> ecasound, which is supposed to enlighten a developers task, not? I was
> just wondering how do I use it correctly? Than I mean that I do not
> direclty assign it's output the the FLAGS and LIBS variables, but have
> configure print a nice error if ecasound isn't found.

Well, I don't have a ready example, but you can for example use
ecamegapedal's libecasound check as an example. Here's an untested
example:

--cut--
------------------------------------------------------------------------
## Check for libecasoundc
##
## version: 1
##
## defines: ECI_S_PREFIX, ECI_S_LIBS, ECI_S_LDFLAGS, ECI_S_CFLAGS,
## inputs: include_debug (shell variable)
##
------------------------------------------------------------------------
##
AC_DEFUN(AC_CHECK_LIBECASOUNDC,
[
AC_PATH_PROG(LIBECASOUNDC_CONFIG, libecasoundc-config,
${prefix}/bin/libecasoundc-config,
 /usr/local/bin:/usr/bin)

AC_MSG_CHECKING(for libecasoundc)

if test x$include_debug = xyes; then
        ECI_S_LIBS=`$LIBECASOUNDC_CONFIG --libs_debug`
        AC_SUBST(ECI_S_LIBS)
else
        ECI_S_LIBS=`$LIBECASOUNDC_CONFIG --libs`
        AC_SUBST(ECI_S_LIBS)
fi

ECI_S_PREFIX=`$LIBECASOUNDC_CONFIG --prefix`
ECI_S_LDFLAGS=`$LIBECASOUNDC_CONFIG --ldflags`
ECI_S_CFLAGS=`$LIBECASOUNDC_CONFIG --cflags`

AC_SUBST(ECI_S_PREFIX)
AC_SUBST(ECI_S_LDFLAGS)
AC_SUBST(ECI_S_CFLAGS)

AC_LANG_CPLUSPLUS

old_cxx_flags=$CXXFLAGS
old_ld_flags=$LDFLAGS
old_libs=$LIBS

CXXFLAGS="$CXXFLAGS $ECI_S_CFLAGS"
LDFLAGS="$LDFLAGS $ECI_S_LDFLAGS"
LIBS="$LDFLAGS $ECI_S_LIBS"

AC_TRY_RUN([
#include <ecasoundc.h>

int main(void)
{
  eci_init();
  eci_cleanup();
  return 0;
}
],
  [AC_MSG_RESULT(found.)],
  [AC_MSG_RESULT(not present.)
   AC_MSG_WARN(** Compatible version of libecasoundc not found.
Will still try compiling... **)]
)
CXXFLAGS=$old_cxx_flags
LDFLAGS=$old_ld_flags
LIBS=$old_libs

])
--cut--

You can put the above to your acinclude.m4 and then call
"AC_CHECK_LIBECASOUNDC" from your configure.in, or copy'n'paste the above
function as is to configure.in. In your makefiles, you need to add ECI_S_*
variables to linker/compiler options (see for instance ecamegapedal's
makefiles).

--
 http://www.eca.cx
 Audio software for Linux!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Mar 10 2003 - 15:50:24 EET