Re: how to use AC_LIB_LINKFLAGS with a multi-library package?

2007-11-28 Thread Sam Steingold
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bruno,

Bruno Haible wrote:
> 
>> How do I check for a package (ffcall) which consists of several
>> libraries (avcall and callback)?
>> I do not want to force the user to do pass the prefix twice:
>> "--with-avcall-prefix=/usr/local --with-callback-prefix=/usr/local"
>> I want "--with-ffcall-prefix=/usr/local" instead.
> 
> I agree, what you need is a 'configure --help' that proposes
> 
>   --with-ffcall-prefix[=DIR]  search for ffcall in DIR/include and DIR/lib
>   --without-ffcall-prefix don't search for ffcall in includedir and libdir
> 
> I would use an AC_ARG_WITH that produces this help output and then assigns
> the value of the with_ffcall_prefix variable to with_avcall_prefix and
> with_callback_prefix.

the problem is that AC_LIB_LINKFLAGS_BODY does all the checking work AND
also calls AC_LIB_ARG_WITH.
I suggest that AC_LIB_LINKFLAGS_BODY is split into the checking part and
the arg-with part - then the checking part could be used with ffcall.m4

I also suggest that ffcall.m4 is added to gnulib (together with
sigsegv.m4 from clisp), just like iconv.m4 is in gnulib.

Sam.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTYQxPp1Qsf2qnMcRAk3qAJ9y1NaL4GTwtp4+L7UJa1mcB5oVBgCfbYDF
/qIRbkeotLNUwYAyIkgc7nw=
=QQW7
-END PGP SIGNATURE-




Re: how to use AC_LIB_LINKFLAGS with a multi-library package?

2007-11-28 Thread Bruno Haible
Hi Sam,

> How do I check for a package (ffcall) which consists of several
> libraries (avcall and callback)?
> I do not want to force the user to do pass the prefix twice:
> "--with-avcall-prefix=/usr/local --with-callback-prefix=/usr/local"
> I want "--with-ffcall-prefix=/usr/local" instead.

I agree, what you need is a 'configure --help' that proposes

  --with-ffcall-prefix[=DIR]  search for ffcall in DIR/include and DIR/lib
  --without-ffcall-prefix don't search for ffcall in includedir and libdir

I would use an AC_ARG_WITH that produces this help output and then assigns
the value of the with_ffcall_prefix variable to with_avcall_prefix and
with_callback_prefix.

Bruno





how to use AC_LIB_LINKFLAGS with a multi-library package?

2007-11-27 Thread Sam Steingold
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

How do I check for a package (ffcall) which consists of several
libraries (avcall and callback)?
I do not want to force the user to do pass the prefix twice:
"--with-avcall-prefix=/usr/local --with-callback-prefix=/usr/local"
I want "--with-ffcall-prefix=/usr/local" instead.

my first attempt:

AC_DEFUN([CL_FFCALL],[dnl
AC_ARG_WITH([ffcall],
AC_HELP_STRING([--with-ffcall],[use  (default is YES, if present)]),
[cl_cv_use_ffcall=$withval], [cl_cv_use_ffcall=no])
AC_CACHE_CHECK([whether to use
ffcall],[cl_cv_use_ffcall],[cl_cv_use_ffcall=yes])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])dnl prerequisite of AC_LIB_LINKFLAGS_BODY
AC_REQUIRE([AC_LIB_RPATH])dnl prerequisite of AC_LIB_LINKFLAGS_BODY
- --->>>AC_LIB_LINKFLAGS_BODY([ffcall])dnl set LIBFFCALL et al
if test $cl_cv_use_ffcall = yes; then
AC_CACHE_CHECK([whether ffcall is present],[cl_cv_have_ffcall],[dnl
cl_cv_have_ffcall=no
AC_CHECK_HEADERS(avcall.h callback.h)
AC_SEARCH_LIBS(__builtin_avcall,avcall)
AC_SEARCH_LIBS(is_callback,callback)
if test $ac_cv_header_avcall_h = yes -a $ac_cv_header_callback_h = yes \
 -o $ac_cv_search___builtin_avcall = yes -o
$ac_cv_search_is_callback = yes
then cl_cv_have_ffcall=yes
fi
fi])])

is clearly wrong because there is no libffcall.so, one should be
checking for libavcall.so and libcallback.so instead, so
- --->>>AC_LIB_LINKFLAGS_BODY([ffcall])
should be replaced with
- --->>>AC_LIB_LINKFLAGS_BODY([avcall])
- --->>>AC_LIB_LINKFLAGS_BODY([callback])
which will add options --with-avcall-prefix and --with-callback-prefix
instead of --with-ffcall-prefix.

For a moment I thought AC_LIB_LINKFLAGS_BODY([ffcall],[avcall callback])
would do the trick, but now I doubt that: there is really no libffcall
library, so AC_LIB_LINKFLAGS_BODY will fail...

Any suggestions?

thanks.
Sam.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTJ6nPp1Qsf2qnMcRAuA8AKCDgcH9qj6Tdrt61Pf8CBhFoc22eQCeKLcC
pk7k2T5dMeIqH/xuBtaRtWQ=
=RX0E
-END PGP SIGNATURE-