// $Id$
//
// Copyright (C) 2008 Jari Häkkinen, Peter Johansson
// Copyright (C) 2009, 2010, 2011, 2013 Peter Johansson
//
// This file is part of the yat library, http://dev.thep.lu.se/yat
//
// The yat library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// The yat library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with yat. If not, see .
/**
\page build_tool Build Tools
\section yat-config
The \c yat-config script provides information on the local version of
the library. For instance the following command shows that yat was
installed at prefix \c '/usr/local'
\verbatim
#> yat-config --prefix
/usr/local
\endverbatim
This information can then be used in a Makefile, for example, as follows:
\verbatim
BIN=foo
SRC=$(BIN).cc
OBJECTS=$(SRC:.cc=.o)
CPPFLAGS+=`yat-config --cppflags`
CXXFLAGS+=`yat-config --cxxflags`
LDFLAGS+=`yat-config --ldflags`
LIBS+=`yat-config --libs`
all: $(BIN)
$(BIN): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) -o $(BIN) $(LIBS)
.cc.o:
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
clean:; $(RM) $(OBJECTS) $(BIN)
\endverbatim
or if you are using GNU
Make and prefer using default rules, you can use \c yat-config with
\verbatim
CPPFLAGS = `yat-config --cppflags`
CXXFLAGS = `yat-config --cxxflags`
LDFLAGS = `yat-config --ldflags --libs`
all: foo
\endverbatim
From yat 0.6 an alternative \c CBLAS library can be specified using \c
YAT_CBLAS_LIB environment variable. By default the \c CBLAS library
detected during configuration of yat is used.
For further information on yat-config use \c 'yat-config \c --help'
\since New in yat 0.5
\section macro Autoconf Macro
For applications using GNU
Autoconf there is a macro available in \c yat.m4. The macro can be
called from your \c configure.ac:
\verbatim
YAT_CHECK_YAT([minimum-version=0.5], [action-if-found], [action-if-not-found])
\endverbatim
The argument minimum-version should be the number (\c MAJOR.MINOR or
\c MAJOR.MINOR.PATCH) of the version you require. If yat header files
and library are not found or the version is not new enough, macro will
complain and execute shell command \c action-if-not-found. A suitable
\c action-if-not-found could be
\verbatim
AC_MSG_FAILURE([could not find required version of yat])
\endverbatim
If the test is successful, \c HAVE_YAT is defined and \c
action-if-found is executed. The test calls \c yat-config and sets
variables \c YAT_CPPFLAGS, \c YAT_CXXFLAGS, \c YAT_LDFLAGS, \c
YAT_LIBS, and \c YAT_LA_FILE. These flags can then be used in the \c
Makefile.am. For instance:
\verbatim
AM_CPPFLAGS = $(YAT_CPPFLAGS)
AM_CXXFLAGS = $(YAT_CXXFLAGS)
AM_LDFLAGS = $(YAT_LDFLAGS)
LDADD = $(YAT_LIBS)
\endverbatim
\note this macro assumes that \c yat-config has been installed; \c
yat-config was introduced in yat \b 0.5 and consequently this macro
\b does \b not work with yat \b 0.4.x (or older).
*/