]> Creatis software - cpPlugins.git/blob - config/install_mxe.sh
e23f5acaaee61e89aed6f1f83f89432eaff8f0d2
[cpPlugins.git] / config / install_mxe.sh
1 #!/bin/bash
2
3 ## -- Command line options
4 while [[ "$#" -gt 1 ]]; do
5     key="$1"
6     case $key in
7         -prefix)
8         prefix="$2"
9         shift
10         ;;
11         -cores)
12         cores="$2"
13         shift
14         ;;
15         *)
16         # Do nothing
17         ;;
18     esac
19     shift
20 done
21
22 ## -- Check command line options
23 if [ -z "$prefix" ] ; then
24     (>&2 echo "Usage: $0 -prefix [dir] [-cores [n]]")
25     exit 1
26 fi
27
28 ## -- Complete optional parameters
29 if [ -z "$cores" ] ; then
30     cores="1"
31 fi
32 curr_dir=`pwd`
33
34 ## -- Get mxe
35 cd $prefix
36 git clone https://github.com/mxe/mxe.git
37
38 ## -- Create settings.mk
39 cd $prefix/mxe
40 echo "MXE_TARGETS := x86_64-w64-mingw32.shared" > settings.mk
41
42 ## -- Patch mxe
43 patch -s -p1 < $curr_dir/mxe.patch
44
45 ## -- Compile all
46 make -j$cores -k qtbase vtk itk nsis
47
48 ## -- End
49 cd $curr_dir
50
51 ## eof - $RCSfile$