ac-archive-maintainers
[Top][All Lists]
Advanced

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

Re: m4 macro submission


From: Guido Draheim
Subject: Re: m4 macro submission
Date: Fri, 26 Mar 2004 15:04:09 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313

Well Patrick,

as a general guideline for active opensource projects, I would recommend
to ask the upstream maintainers (of blitz++) to include an autoconf macro
into their source tree - to be installed along with their projects. That will
also care better for any later version of their library, while one can not be
sure who is downloading an ac-archive macro and when it gets updated.

However, I have to admit that I do not even know what that blitz++ is
really about. As far as I can see on their homepage, they are actually
using autoconf - so they would sure be listening if you would send them
a macro to be installed into $datadir/aclocal during their `make install`.

As for the other libraries, it does depend as well on how the actual project
looks like. If there is some project to be unlikely to ship an autoconf macro
then the ac-archive would be a good place to hold a file as to help people
out there in not reinventing the wheel. But let that be the second path, plz.

Btw, as for any libraries out there, try to ask them to not use a ac macro
but instead install a file for pkg-config. The pkgconfig project has been
helping me a lot in the past also handling some additional complexity
that is hard to express in a shell / macro test script. It is fine for one
library but I know projects linking to twenty libs that again link to x libs.
The pkgconfig tool is very portable _and_ it installs an autoconf macro
that can test for any lib out there that has been providing a *.pc file.

so much for how things are ;-) have fun, cheers, guido

Patrick Guio wrote:
Hi again Guido,

Thank you for your answer about "Multiple definition of VERSION, PACKAGE".
I actually didn't know about ac-archive.sourceforge.net but that is
definitely a very nice initiative.
I found out that all Blitz++ compiler feature checks were ported to m4
macro. Had I seen it before, that would have avoided me to do it...
Is there any plan to integrate these checks in autoconf?
Another thing is I wonder whether you would be interested in a m4 macro
that tests whether Blitz++ library is installed? I attach the code.
I haqve other library check like fftw and hdf4? Would that be of any
interest?
Sincerely,
Patrick


------------------------------------------------------------------------

dnl @synopsis AC_CXX_LIB_BLITZ([optional-string "required"])
dnl
dnl Check whether Blitz++ is installed.
dnl Blitz++ is available at http://oonumerics.org/blitz.
dnl
dnl   Set the path for Blitz++  with the option
dnl      --with-blitz[=DIR]
dnl   Blitz headers should be under DIR/includes
dnl   Blitz library should be under DIR/lib
dnl   Then try to compile and run a simple program with a Blitz Array
dnl   Optional argument `required' triggers an error if Blitz++ not installed
dnl dnl @version $Id: ac_cxx_lib_blitz.m4,v 1.4 2004/03/25 14:17:52 patricg Exp $
dnl @author Patrick Guio <address@hidden>
dnl
AC_DEFUN([AC_MSG_ERROR_BLITZ],[
AC_MSG_ERROR([
$PACKAGE_STRING requires the Blitz++ template library
available at http://oonumerics.org/blitz
When installed give the directory of installation with the option
  --with-blitz@<:@=DIR@:>@
])])


AC_DEFUN([AC_CXX_LIB_BLITZ],[

AC_ARG_WITH(blitz,
AS_HELP_STRING([--with-blitz@<:@=DIR@:>@],[Set the path for Blitz++]),
[],[withval='yes'])

if test "$1" = required -a "$withval" = no ; then
        AC_MSG_ERROR_BLITZ
fi

if test "$withval" != no ; then

        saveCPPFLAGS=$CPPFLAGS
        saveLDFLAGS=$LDFLAGS
        saveLIBS=$LIBS

        if test "$withval" != 'yes'; then
                CPPFLAGS="-I$withval/include"
                LDFLAGS="-L$withval/lib"
        fi
        LIBS="-lblitz"

        AC_CACHE_CHECK([whether Blitz++ is installed],ac_cxx_lib_blitz,
        [AC_LANG_SAVE
        AC_LANG_CPLUSPLUS
        AC_RUN_IFELSE(
        [AC_LANG_PROGRAM([[
#include <blitz/array.h>
]],[[
blitz::Array<int,1> x(10);
x = blitz::tensor::i;
        ]])],[ac_cxx_lib_blitz=yes],[ac_cxx_lib_blitz=no])
        AC_LANG_RESTORE
        ])

        CPPFLAGS=$saveCPPFLAGS
        LDFLAGS=$saveLDFLAGS
        LIBS=$saveLIBS

        if test "$ac_cxx_lib_blitz" = yes ; then
                if test "$withval" != yes ; then
                        CPPFLAGS="-I$withval/include $CPPFLAGS"
                        LDFLAGS="-L$withval/lib $LDFLAGS"
                fi
                LIBS="-lblitz $LIBS"
        else
                if test "$1" = required ; then
                        AC_MSG_ERROR_BLITZ
                fi
        fi

fi

])










reply via email to

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