File: check3Depict-cross.sh

package info (click to toggle)
3depict 0.0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,908 kB
  • sloc: cpp: 66,548; sh: 6,051; xml: 1,576; python: 326; makefile: 180; ansic: 173
file content (86 lines) | stat: -rwxr-xr-x 1,795 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
#A script for checking that the cross-compilation build still compiles

#You probably want to set up your own environment first, then customise
# this script, rather than trying to use it as a base for cross-compilation

CROSS_BASEDIR=
#Abort notice file
ABORT_MSG_FILE=/tmp/NOTE_ABORT
#Project directory, relative to CROSS_BASEDIR
PROJECTDIR=3Depict

if [ ! -d $CROSS_BASEDIR ] ; then
	echo "Cross compilation base dir missing :" $CROSS_BASEDIR
	exit 1
fi

if [ ! -d $CROSS_BASEDIR/$PROJECT ] ; then
	echo "Cross compilation base dir missing :" $CROSS_BASEDIR
	exit 1
fi

#Number of simultaneous processes when building
NUM_PROC=3 

notifyAbort()
{
	cat $ABORT_MSG_FILE
	rm $ABORT_MSG_FILE
	exit 1
}

cd $CROSS_BASEDIR/$PROJECT
#Set the cross compilation path
PATH=$CROSS_BASEDIR/bin:$PATH

hg pull

if [ $? -ne 0 ] ; then
	echo "Pull failed!"  >> $ABORT_MSG_FILE
	notifyAbort
fi

hg up -r tip

if [ $? -ne 0 ] ; then
	echo "Update failed!"  >> $ABORT_MSG_FILE
	notifyAbort
fi


make distclean
if [ $? -ne 0 ] ; then
	echo "cross compile did not clean!" > $ABORT_MSG_FILE
	notifyAbort
fi

#Initiate the configuration
export CPPFLAGS="-I${CROSS_BASEDIR}/include/ -DUNICODE"
export LDFLAGS=-L${CROSS_BASEDIR}/lib/
#openmp is, out of the box, not supported by the cross-compiler.
# Bug : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625779
# Looks like its an easy fix, but we would need our own private version
./configure --host=x86_64-w64-mingw32 --enable-debug-checks 

if [ $? -ne 0 ] ; then
	echo "Configure failed!" > $ABORT_MSG_FILE
	notifyAbort
fi



make -j $NUM_PROC

if [ $? -ne 0 ] ; then 
	echo "Build failed" > $ABORT_MSG_FILE
	notifyAbort
fi

if [ ! -f $BINARY ] ; then  
	echo "Weird, binary is missing!" > $ABORT_MSG_FILE
	notifyAbort
fi

echo "Build succeeded"