source: trunk/doc/build_tool.doxygen @ 1486

Last change on this file since 1486 was 1486, checked in by Jari Häkkinen, 15 years ago

Addresses #436.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1// $Id: build_tool.doxygen 1486 2008-09-09 21:17:19Z jari $
2//
3// Copyright (C) 2008 Peter Johansson
4//
5// This file is part of the yat library, http://dev.thep.lu.se/yat
6//
7// The yat library is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public License as
9// published by the Free Software Foundation; either version 3 of the
10// License, or (at your option) any later version.
11//
12// The yat library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15// General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20// 02111-1307, USA.
21
22
23/**
24\page build_tool Build Tools
25
26\section yat-config
27
28The \c yat-config script provides information on the local version of
29the library. For instance the following command shows that yat was
30installed at prefix \c `/usr/local'
31
32\verbatim
33 #> yat-config --prefix
34/usr/local
35\endverbatim
36
37This information can then be used in a Makefile, for example, as follows:
38
39\verbatim
40BIN=foo
41SRC=$(BIN).cc
42OBJECTS=$(SRC:.cc=.o)
43
44CPPFLAGS+=`yat-config --cppflags`
45CXXFLAGS+=`yat-config --cxxflags`
46LDFLAGS+=`yat-config --ldflags`
47LIBS+=`yat-config --libs`
48
49all: $(BIN)
50
51$(BIN): $(OBJECTS)
52  $(CXX) $(LDFLAGS) $(OBJECTS) -o $(BIN) $(LIBS)
53
54.cc.o:
55  $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
56
57clean:; rm -f $(OBJECTS) $(BIN)
58\endverbatim
59
60For further information on yat-config use \c `yat-config \c --help'
61
62\section macro Autoconf Macro
63
64For applications using autoconf there is a macro available in \c
65yat.m4. The macro can be called from your \c configure.ac:
66
67\verbatim
68   YAT_CHECK_YAT([minimum-version], [action-if-found],[action-if-not-found])
69\endverbatim
70
71The argument minimum-version should be the number (\c MAJOR.MINOR or
72\c MAJOR.MINOR.PATCH) of the version you require. If yat header files
73and library are not found or the version is not new enough, macro will
74complain and execute shell command \c action-if-not-found. A suitable
75\c action-if-not-found could be
76
77\verbatim
78   AC_MSG_ERROR([could not find required version of yat])
79\endverbatim
80
81If the test is successful, \c HAVE_YAT is defined and \c
82action-if-found is executed. The test calls \c yat-config and sets
83variables \c YAT_CPPFLAGS, \c YAT_CXXFLAGS, \c YAT_LDFLAGS, \c
84YAT_LIBS, and \c YAT_LA_FILE. These flags can then be used in the \c
85Makefile.am. For instance:
86
87\verbatim
88   AM_CPPFLAGS = $(YAT_CPPFLAGS)
89   AM_CXXFLAGS = $(YAT_CXXFLAGS)
90   AM_LDFLAGS = $(YAT_LDFLAGS)
91   LDADD = $(YAT_LIBS)
92\endverbatim
93
94or when using libtool you could use \c YAT_LA_FILE:
95
96\verbatim
97   AM_CPPFLAGS = $(YAT_CPPFLAGS)
98   AM_CXXFLAGS = $(YAT_CXXFLAGS)
99   LDADD = $(YAT_LA_FILE)
100\endverbatim
101
102If you have yat installed with a different prefix than aclocal, for
103example, if yat is installed in prefix \c /usr/local and aclocal is
104located in /usr/bin, then you need to tell aclocal (or autoreconf)
105where to look for \c yat.m4
106
107\verbatim
108   #> aclocal -I /usr/local/share/aclocal
109\endverbatim
110
111*/
112
Note: See TracBrowser for help on using the repository browser.