• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3#    build in srcdir / install outside build-tree script.
4#
5#    Copyright (C) 2010, Cisco Systems Inc.
6#
7#    This program is free software; you can redistribute it and/or modify
8#    it under the terms of the GNU General Public License as published by
9#    the Free Software Foundation; either version 2 of the License, or
10#    (at your option) any later version.
11#
12#    This program 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
15#    GNU General Public License for more details.
16#
17#    You should have received a copy of the GNU General Public License along
18#    with this program; if not, write to the Free Software Foundation, Inc.,
19#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Ngie Cooper, January 2010
22
23export PATH="${0%/*}:$PATH"
24
25set -e
26. build_test_function.sh
27
28# 0. Setup the environment.
29setup_env "Install out of srcdir"
30# 1. Pull the SCM.
31pull_scm git "$tmp_srcdir"
32# 2. Pre-configure clean sanity.
33# i.   Is srcdir still there (should be)?
34# ii.  Is $DESTDIR/$prefix there (shouldn't be)?
35clean_is_sane "$srcdir" "$srcdir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
36[ -d "$srcdir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
37# 3. Configure.
38configure "$srcdir" "$srcdir" "$tmp_prefix"
39# 4. -->> Compile in-build-tree. <<--
40build "$srcdir" "$srcdir"
41# 5. -->> Install out-of-build-tree. <<--
42install_ltp "$srcdir" "$srcdir" "$tmp_destdir"
43# 6. Test.
44test_ltp "$("$abspath" "$tmp_destdir/$tmp_prefix")"
45# 7. Post-test clean sanity.
46# i.   Is srcdir still there (should be)?
47# ii.  Is $DESTDIR/$prefix there (shouldn't be)?
48clean_is_sane "$srcdir" "$srcdir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
49[ -d "$srcdir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
50