source: trunk/test/create_yathello.sh.in @ 1808

Last change on this file since 1808 was 1808, checked in by Peter, 12 years ago

changes to reflect that yat.m4 now lives in m4/

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#! @SHELL@
2# @configure_input@
3# $Id: create_yathello.sh.in 1808 2009-02-19 20:38:13Z peter $
4
5# Copyright (C) 2009 Peter Johansson
6#
7# This file is part of the yat library, http://dev.thep.lu.se/yat
8#
9# The yat library is free software; you can redistribute it
10# and/or modify it under the terms of the GNU General Public License as
11# published by the Free Software Foundation; either version 3 of the
12# License, or (at your option) any later version.
13#
14# The yat library is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with yat. If not, see <http://www.gnu.org/licenses/>.
21
22
23# build a `hello world' project that uses macro YAT_CHECK_YAT in its
24# configure.ac. The macro only works with an installed yat, so the
25# test should be run after `make install'.
26
27rm -rf yathello
28@MKDIR_P@ yathello && cd yathello
29cat > configure.ac <<EOF
30AC_INIT([hello],[1.0])
31AC_CONFIG_SRCDIR([hello.cc])
32AM_INIT_AUTOMAKE([foreign])
33AC_CONFIG_MACRO_DIR([.])
34AC_LANG(C++)
35AC_PROG_CXXCPP
36AC_PROG_CXX
37AC_PROG_LIBTOOL
38YAT_CHECK_YAT([0.4], ,AC_MSG_ERROR([could not find required version of yat]))
39AC_CONFIG_FILES([Makefile])
40AC_OUTPUT
41EOF
42
43cat > Makefile.am <<EOF
44ACLOCAL_AMFLAGS = -I .
45AM_CPPFLAGS = \$(YAT_CPPFLAGS)
46AM_CXXFLAGS = \$(YAT_CXXFLAGS)
47LDADD = \$(YAT_LA_FILE)
48check_PROGRAMS = hello
49TESTS = hello
50hello_SOURCES = hello.cc
51EOF
52
53cat > hello.cc <<EOF
54#include <yat/utility/Vector.h>
55#include <yat/utility/Matrix.h>
56#include <iostream>
57#include <string>
58int main(void)
59{
60theplu::yat::utility::Matrix m(10,3);
61m(1,1)=1.0;
62theplu::yat::utility::Vector v(m.row_const_view(1));
63if (v(1)!=1.0)
64  return 1;
65return 0;
66}
67EOF
68
69cp @abs_top_srcdir@/m4/yat.m4 .
Note: See TracBrowser for help on using the repository browser.