1#!/bin/sh
2#
3# Copyright (C) 2015 Y. Pouillon
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU Lesser General Public License for more details.
14#
15# You should have received a copy of the GNU Lesser General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18#
19#
20
21# Note: this script is temporary and will be removed upon release.
22
23# Stop at first error and echo commands
24set -ev
25
26# Check that we are in the correct directory
27test -s "configure.ac" -a -s "src/sax/m_xml_parser.f90" || exit 0
28
29# Fix permissions
30chmod -R u+w .
31
32# Init build parameters
33export CC="gcc"
34#export CFLAGS="-O0 -g3 -ggdb -Wall -Wextra -fbounds-check -fno-inline"
35export CFLAGS="-O0 -g3 -ggdb -Wall -Wextra -fno-inline"
36export FC="gfortran"
37#export FCFLAGS="-O0 -g3 -ggdb -Wall -Wextra -fbounds-check -fno-inline -fbacktrace"
38export FCFLAGS="-O0 -g3 -ggdb -Wall -Wextra -fno-inline -fbacktrace"
39
40# Prepare source tree
41./wipeout.sh
42./autogen.sh
43
44# Check default build
45mkdir tmp-default
46cd tmp-default
47../configure
48sleep 3
49make dist -j4
50make -j4
51make clean && make -j4
52make check -j4
53mkdir install-test
54make install DESTDIR="${PWD}/install-test"
55ls -lR install-test >install-test.log
56cd ..
57
58# Check docgen build
59mkdir tmp-docgen
60cd tmp-docgen
61../configure --enable-docgen
62sleep 3
63make check -j4
64mkdir install-test
65make install DESTDIR="${PWD}/install-test"
66ls -lR install-test >install-test.log
67cd ..
68
69# Make distcheck
70mkdir tmp-distcheck
71cd tmp-distcheck
72../configure
73sleep 3
74make distcheck -j4
75make distcleancheck
76cd ..
77
78# Clean-up the mess
79rm -rf tmp-default tmp-docgen tmp-distcheck
80