[1693] | 1 | #! @SHELL@ |
---|
| 2 | # @configure_input@ |
---|
| 3 | # $Id: create_yathello.sh.in 1769 2009-02-03 22:01:29Z 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 | |
---|
| 27 | rm -rf yathello |
---|
| 28 | @MKDIR_P@ yathello && cd yathello |
---|
| 29 | cat > configure.ac <<EOF |
---|
| 30 | AC_INIT([hello],[1.0]) |
---|
| 31 | AC_CONFIG_SRCDIR([hello.cc]) |
---|
| 32 | AM_INIT_AUTOMAKE([foreign]) |
---|
| 33 | AC_CONFIG_MACRO_DIR([.]) |
---|
| 34 | AC_LANG(C++) |
---|
| 35 | AC_PROG_CXXCPP |
---|
| 36 | AC_PROG_CXX |
---|
| 37 | AC_PROG_LIBTOOL |
---|
| 38 | YAT_CHECK_YAT([0.4], ,AC_MSG_ERROR([could not find required version of yat])) |
---|
| 39 | AC_CONFIG_FILES([Makefile]) |
---|
| 40 | AC_OUTPUT |
---|
| 41 | EOF |
---|
| 42 | |
---|
| 43 | cat > Makefile.am <<EOF |
---|
| 44 | ACLOCAL_AMFLAGS = -I . |
---|
| 45 | AM_CPPFLAGS = \$(YAT_CPPFLAGS) |
---|
| 46 | AM_CXXFLAGS = \$(YAT_CXXFLAGS) |
---|
| 47 | LDADD = \$(YAT_LA_FILE) |
---|
| 48 | check_PROGRAMS = hello |
---|
| 49 | TESTS = hello |
---|
| 50 | hello_SOURCES = hello.cc |
---|
| 51 | EOF |
---|
| 52 | |
---|
| 53 | cat > hello.cc <<EOF |
---|
| 54 | #include <yat/utility/Vector.h> |
---|
| 55 | #include <yat/utility/Matrix.h> |
---|
| 56 | #include <iostream> |
---|
| 57 | #include <string> |
---|
| 58 | int main(void) |
---|
| 59 | { |
---|
| 60 | theplu::yat::utility::Matrix m(10,3); |
---|
| 61 | m(1,1)=1.0; |
---|
| 62 | theplu::yat::utility::Vector v(m.row_const_view(1)); |
---|
| 63 | if (v(1)!=1.0) |
---|
| 64 | return 1; |
---|
| 65 | return 0; |
---|
| 66 | } |
---|
| 67 | EOF |
---|
| 68 | |
---|
| 69 | cp @abs_top_srcdir@/build_support/yat.m4 . |
---|