Index: buildall.config
===================================================================
--- buildall.config	(revision 62)
+++ buildall.config	(revision 62)
@@ -0,0 +1,10 @@
+# Configuration file for buildall.sh
+#
+# It should set the variables below
+
+VSCPL_SOURCE_DIR="${HOME}/munka/vscpl"
+XPLCOMMON_SOURCE_DIR="${HOME}/munka/xpl/xplcommon"
+
+XPSDK_DIR="${HOME}/local/opt/X-Plane/XPSDK"
+
+MAKEOPTS="-j3"
Index: buildall.sh
===================================================================
--- buildall.sh	(revision 62)
+++ buildall.sh	(revision 62)
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+set -e -u
+
+# Script to build all components needed for the X-Plane Remote Access plugin.
+#
+# Usage: buildall.sh <configuration file> <destination directory> <host> [<C/C++ flags>]
+#
+# The C/C++ flags default to -O2
+
+scriptdir=`dirname $0`
+
+if test $# -lt 3; then
+    echo "Usage: buildall.sh <configuration file> <destination directory> <host> [<C/C++ flags>]"
+    exit 1
+fi
+
+config="${1}"
+dest="${2}"
+host="${3}"
+cflags="${4:-}"
+if test -z "${cflags}"; then
+    cflags="-O2"
+fi
+
+XPLRA_SOURCE_DIR=`cd "${scriptdir}"; pwd`
+
+if test -r "${config}"; then
+    . ${config}
+else
+    echo "Configuration file \"${config}\" not found"
+    exit 2
+fi
+
+echo "Building all into \"${dest}\" with host ${host} using C/C++ flags '${cflags}'"
+echo
+
+instdir="${dest}/install"
+vscpldir="${dest}/vscpl"
+xplcommondir="${dest}/xplcommon"
+xplradir="${dest}/xplra"
+
+libconfigopts=""
+case "${host}" in
+    x86_64-linux-gnu)
+        libconfigopts="--disable-shared"
+        cflags="${cflags} -fPIC"
+        ;;
+    i686-linux-gnu)
+        libconfigopts="--disable-shared"
+        cflags="${cflags} -m32"
+        ;;
+esac
+
+echo "Removing destination directory ${dest}"
+rm -rf "${dest}"
+echo
+
+build()
+{
+    local sourcedir="${1}"
+    local builddir="${2}"
+    local configopts="${3}"
+    local maketarget="${4}"
+
+    mkdir -p "${builddir}"
+    cd "${builddir}"
+    "${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
+    make ${MAKEOPTS} ${maketarget} > make.log 2>&1
+
+}
+
+echo "Building VSCPL"
+build "${VSCPL_SOURCE_DIR}" "${vscpldir}" "${libconfigopts}" install
+echo
+
+echo "Building XPLCOMMON"
+build "${XPLCOMMON_SOURCE_DIR}" "${xplcommondir}" "${libconfigopts}" install
+echo
+
+echo "Building XPLRA"
+build "${XPLRA_SOURCE_DIR}" "${xplradir}" "" all
+echo
+
+echo "Building successful"
Index: buildallhosts.sh
===================================================================
--- buildallhosts.sh	(revision 62)
+++ buildallhosts.sh	(revision 62)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -e -u
+
+# Script to build all components needed for the X-Plane Remote Access plugin
+# for all supported hosts.
+#
+# Usage: buildallhosts.sh <configuration file> <destination directory> [<C/C++ flags>]
+#
+# The C/C++ flags default to -O2
+
+scriptdir=`dirname $0`
+
+if test $# -lt 2; then
+    echo "Usage: buildallhosts.sh <configuration file> <destination directory>  [<C/C++ flags>]"
+    exit 1
+fi
+
+config="${1}"
+dest="${2}"
+cflags="${3:-}"
+if test -z "${cflags}"; then
+    cflags="-O2"
+fi
+
+"${scriptdir}/buildall.sh" "${config}" "${dest}/xpl" x86_64-linux-gnu "${cflags}"
+echo
+echo
+"${scriptdir}/buildall.sh" "${config}" "${dest}/xpl-32" i686-linux-gnu "${cflags}"
+echo
+echo
+"${scriptdir}/buildall.sh" "${config}" "${dest}/xpl-win32" i686-w64-mingw32 "${cflags}"
+echo
+echo
+"${scriptdir}/buildall.sh" "${config}" "${dest}/xpl-win64" x86_64-w64-mingw32 "${cflags}"
Index: mkplugindist.sh
===================================================================
--- mkplugindist.sh	(revision 62)
+++ mkplugindist.sh	(revision 62)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e -u
+
+# Script to create the plugin distribution from an already built set of sources.
+#
+# Usage: mkplugindist.sh <build directory>
+#
+# <build directory> is the directory containing the build directories as
+# created by buildallhosts.sh.
+
+scriptdir=`dirname $0`
+scriptdir=`cd "${scriptdir}" && pwd`
+
+if test $# -lt 1; then
+    echo "Usage: mkplugindist.sh <build directory>"
+    exit 1
+fi
+
+zipfile="${scriptdir}/xplra.zip"
+builddir="${1}"
+
+tmpdir=`mktemp -d`
+trap "rm -rf $tmpdir" EXIT
+
+xplradir="${tmpdir}/XPLRA"
+mkdir -p "${xplradir}/32"
+mkdir -p "${xplradir}/64"
+
+strip -g -o "${xplradir}/64/lin.xpl" "${builddir}/xpl/xplra/src/plugin/src/xplra/lin.xpl"
+strip -g -o "${xplradir}/32/lin.xpl" "${builddir}/xpl-32/xplra/src/plugin/src/xplra/lin.xpl"
+i686-w64-mingw32-strip -o "${xplradir}/32/win.xpl" "${builddir}/xpl-win32/xplra/src/plugin/src/xplra/win.xpl.exe"
+x86_64-w64-mingw32-strip -o "${xplradir}/64/win.xpl" "${builddir}/xpl-win64/xplra/src/plugin/src/xplra/win.xpl.exe"
+
+cd "${tmpdir}"
+rm -f "${zipfile}"
+zip -r "${zipfile}" XPLRA
