source: xplra/buildall.sh@ 67:1f08d2ceff1a

Last change on this file since 67:1f08d2ceff1a was 62:466bd91afa55, checked in by István Váradi <ivaradi@…>, 12 years ago

Added automatic build scripts

  • Property exe set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3set -e -u
4
5# Script to build all components needed for the X-Plane Remote Access plugin.
6#
7# Usage: buildall.sh <configuration file> <destination directory> <host> [<C/C++ flags>]
8#
9# The C/C++ flags default to -O2
10
11scriptdir=`dirname $0`
12
13if test $# -lt 3; then
14 echo "Usage: buildall.sh <configuration file> <destination directory> <host> [<C/C++ flags>]"
15 exit 1
16fi
17
18config="${1}"
19dest="${2}"
20host="${3}"
21cflags="${4:-}"
22if test -z "${cflags}"; then
23 cflags="-O2"
24fi
25
26XPLRA_SOURCE_DIR=`cd "${scriptdir}"; pwd`
27
28if test -r "${config}"; then
29 . ${config}
30else
31 echo "Configuration file \"${config}\" not found"
32 exit 2
33fi
34
35echo "Building all into \"${dest}\" with host ${host} using C/C++ flags '${cflags}'"
36echo
37
38instdir="${dest}/install"
39vscpldir="${dest}/vscpl"
40xplcommondir="${dest}/xplcommon"
41xplradir="${dest}/xplra"
42
43libconfigopts=""
44case "${host}" in
45 x86_64-linux-gnu)
46 libconfigopts="--disable-shared"
47 cflags="${cflags} -fPIC"
48 ;;
49 i686-linux-gnu)
50 libconfigopts="--disable-shared"
51 cflags="${cflags} -m32"
52 ;;
53esac
54
55echo "Removing destination directory ${dest}"
56rm -rf "${dest}"
57echo
58
59build()
60{
61 local sourcedir="${1}"
62 local builddir="${2}"
63 local configopts="${3}"
64 local maketarget="${4}"
65
66 mkdir -p "${builddir}"
67 cd "${builddir}"
68 "${sourcedir}/configure" --prefix="${instdir}" --with-xpsdk="${XPSDK_DIR}" ${configopts} --host "${host}" CFLAGS="${cflags}" CXXFLAGS="${cflags}" PKG_CONFIG_PATH="${instdir}/lib/pkgconfig" > "configure.log" 2>&1
69 make ${MAKEOPTS} ${maketarget} > make.log 2>&1
70
71}
72
73echo "Building VSCPL"
74build "${VSCPL_SOURCE_DIR}" "${vscpldir}" "${libconfigopts}" install
75echo
76
77echo "Building XPLCOMMON"
78build "${XPLCOMMON_SOURCE_DIR}" "${xplcommondir}" "${libconfigopts}" install
79echo
80
81echo "Building XPLRA"
82build "${XPLRA_SOURCE_DIR}" "${xplradir}" "" all
83echo
84
85echo "Building successful"
Note: See TracBrowser for help on using the repository browser.