source: trunk/doc/build_tool.doxygen

Last change on this file was 3999, checked in by Peter, 12 months ago

update copyright years

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1// $Id: build_tool.doxygen 3999 2020-10-08 23:22:32Z peter $
2//
3// Copyright (C) 2008 Jari Häkkinen, Peter Johansson
4// Copyright (C) 2009, 2010, 2011, 2013, 2017, 2018, 2020 Peter Johansson
5//
6// This file is part of the yat library, http://dev.thep.lu.se/yat
7//
8// The yat library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License as
10// published by the Free Software Foundation; either version 3 of the
11// License, or (at your option) any later version.
12//
13// The yat library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with yat. If not, see <http://www.gnu.org/licenses/>.
20
21
22/**
23\page build_tool Build Tools
24
25\section yat-config
26
27The \c yat-config script provides information on the local version of
28the library. For instance the following command shows that yat was
29installed at prefix \c '/usr/local'
30
31\verbatim
32 #> yat-config --prefix
33/usr/local
34\endverbatim
35
36This information can then be used in a Makefile, for example, as follows:
37
38\verbatim
39BIN=foo
40SRC=$(BIN).cc
41OBJECTS=$(SRC:.cc=.o)
42
43CXX=`yat-config --cxx`
44CPPFLAGS+=`yat-config --cppflags`
45CXXFLAGS+=`yat-config --cxxflags`
46LDFLAGS+=`yat-config --ldflags`
47LDLIBS+=`yat-config --libs`
48
49all: $(BIN)
50
51$(BIN): $(OBJECTS)
52  $(CXX) $(LDFLAGS) $(OBJECTS) -o $(BIN) $(LDLIBS)
53
54.cc.o:
55  $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
56
57clean:; $(RM) $(OBJECTS) $(BIN)
58\endverbatim
59
60or if you are using <a href="http://www.gnu.org/software/make/">GNU
61Make</a> and prefer using default rules, you can use \c yat-config with
62
63\verbatim
64CPPFLAGS = `yat-config --cppflags`
65CXXFLAGS = `yat-config --cxxflags`
66LDFLAGS = `yat-config --ldflags`
67LDLIBS = `yat-config --libs`
68
69all: foo
70\endverbatim
71
72From yat 0.6 an alternative \c CBLAS library can be specified using \c
73YAT_CBLAS_LIB environment variable. By default the \c CBLAS library
74detected during configuration of yat is used.
75
76For further information on yat-config use \c 'yat-config \c --help'
77
78\since New in yat 0.5
79
80\section macro Autoconf Macro
81
82For applications using <a href="http://www.gnu.org/software/autoconf/">GNU
83Autoconf</a> there is a macro available in \c yat.m4. The macro can be
84called from your \c configure.ac:
85
86\verbatim
87YAT_CHECK_YAT([minimum-version=0.5], [action-if-found], [action-if-not-found])
88\endverbatim
89
90The argument minimum-version should be the number (\c MAJOR.MINOR or
91\c MAJOR.MINOR.PATCH) of the version you require. If yat header files
92and library are not found or the version is not new enough, macro will
93complain and execute shell command \c action-if-not-found. A suitable
94\c action-if-not-found could be
95
96\verbatim
97AC_MSG_FAILURE([could not find required version of yat])
98\endverbatim
99
100If the test is successful, \c HAVE_YAT is defined and \c
101action-if-found is executed. The test calls \c yat-config and sets
102variables \c YAT_CPPFLAGS, \c YAT_CXXFLAGS, \c YAT_LDFLAGS, \c
103YAT_LIBS, and \c YAT_LA_FILE. These flags can then be used in the \c
104Makefile.am. For instance:
105
106\verbatim
107AM_CPPFLAGS = $(YAT_CPPFLAGS)
108AM_CXXFLAGS = $(YAT_CXXFLAGS)
109AM_LDFLAGS = $(YAT_LDFLAGS)
110LDADD = $(YAT_LIBS)
111\endverbatim
112
113\note this macro assumes that \c yat-config has been installed; \c
114      yat-config was introduced in yat \b 0.5 and consequently this macro
115      \b does \b not work with yat \b 0.4.x (or older).
116
117*/
Note: See TracBrowser for help on using the repository browser.