source: trunk/doc/build_tool.doxygen @ 1637

Last change on this file since 1637 was 1561, checked in by Peter, 13 years ago

minor docs formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1// $Id: build_tool.doxygen 1561 2008-10-10 14:53:40Z peter $
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 yat. If not, see <http://www.gnu.org/licenses/>.
19
20
21/**
22\page build_tool Build Tools
23
24\section yat-config
25
26The \c yat-config script provides information on the local version of
27the library. For instance the following command shows that yat was
28installed at prefix \c `/usr/local'
29
30\verbatim
31 #> yat-config --prefix
32/usr/local
33\endverbatim
34
35This information can then be used in a Makefile, for example, as follows:
36
37\verbatim
38BIN=foo
39SRC=$(BIN).cc
40OBJECTS=$(SRC:.cc=.o)
41
42CPPFLAGS+=`yat-config --cppflags`
43CXXFLAGS+=`yat-config --cxxflags`
44LDFLAGS+=`yat-config --ldflags`
45LIBS+=`yat-config --libs`
46
47all: $(BIN)
48
49$(BIN): $(OBJECTS)
50  $(CXX) $(LDFLAGS) $(OBJECTS) -o $(BIN) $(LIBS)
51
52.cc.o:
53  $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
54
55clean:; rm -f $(OBJECTS) $(BIN)
56\endverbatim
57
58For further information on yat-config use \c `yat-config \c --help'
59
60\section macro Autoconf Macro
61
62For applications using autoconf there is a macro available in \c
63yat.m4. The macro can be called from your \c configure.ac:
64
65\verbatim
66   YAT_CHECK_YAT([minimum-version], [action-if-found],[action-if-not-found])
67\endverbatim
68
69The argument minimum-version should be the number (\c MAJOR.MINOR or
70\c MAJOR.MINOR.PATCH) of the version you require. If yat header files
71and library are not found or the version is not new enough, macro will
72complain and execute shell command \c action-if-not-found. A suitable
73\c action-if-not-found could be
74
75\verbatim
76   AC_MSG_ERROR([could not find required version of yat])
77\endverbatim
78
79If the test is successful, \c HAVE_YAT is defined and \c
80action-if-found is executed. The test calls \c yat-config and sets
81variables \c YAT_CPPFLAGS, \c YAT_CXXFLAGS, \c YAT_LDFLAGS, \c
82YAT_LIBS, and \c YAT_LA_FILE. These flags can then be used in the \c
83Makefile.am. For instance:
84
85\verbatim
86   AM_CPPFLAGS = $(YAT_CPPFLAGS)
87   AM_CXXFLAGS = $(YAT_CXXFLAGS)
88   AM_LDFLAGS = $(YAT_LDFLAGS)
89   LDADD = $(YAT_LIBS)
90\endverbatim
91
92or when using libtool you could use \c YAT_LA_FILE:
93
94\verbatim
95   AM_CPPFLAGS = $(YAT_CPPFLAGS)
96   AM_CXXFLAGS = $(YAT_CXXFLAGS)
97   LDADD = $(YAT_LA_FILE)
98\endverbatim
99
100If you have yat installed with a different prefix than aclocal, for
101example, if yat is installed in prefix \c /usr/local and aclocal is
102located in \c /usr/bin, then you need to tell aclocal (or autoreconf)
103where to look for \c yat.m4
104
105\verbatim
106   #> aclocal -I /usr/local/share/aclocal
107\endverbatim
108
109*/
110
Note: See TracBrowser for help on using the repository browser.