forked from DESY-FH-ELab/cmstkmodlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·180 lines (166 loc) · 4.26 KB
/
configure
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/sh
echo
echo " CMSTkModLab configuration script."
echo
BASEPATH=$PWD
ARCHITECTURE=`uname`
KERNELMAJOR=`uname -r | cut -d . -f 1`
KERNELMINOR=`uname -r | cut -d . -f 2`
NODEFO=0
NOTHERMAL=0
NOASSEMBLY=0
NOPLASMA=0
NOPUMPSTATION=0
USEFAKEDEVICES=0
NOUEYE=0
CONFIGDEFINES=""
WEBDOCUMENTROOT="/var/www/html"
ROOTCFLAGS=`root-config --cflags`
ROOTLIBS=`root-config --libs`
ROOTGLIBS=`root-config --glibs`
ROOTMAJOR=`root-config --version | cut -d . -f 1`
echo "#!/bin/sh" > reconfigure
COMMANDLINE="./configure "
for var in "$@"
do
COMMANDLINE="$COMMANDLINE $var"
done
echo $COMMANDLINE >> reconfigure
chmod a+x reconfigure
while test $# -gt 0; do
case $1 in
--nodefo)
NODEFO=1
;;
--nothermal)
NOTHERMAL=1
;;
--noassembly)
NOASSEMBLY=1
;;
--noplasma)
NOPLASMA=1
;;
--nopumpstation)
NOPUMPSTATION=1
;;
--noueye)
NOUEYE=1
CONFIGDEFINES="$CONFIGDEFINES NOUEYE"
;;
--fake)
USEFAKEDEVICES=1
NOUEYE=1
CONFIGDEFINES="$CONFIGDEFINES USE_FAKEIO NOUEYE"
;;
*)
# Call standard parser
;;
esac
shift
done
QMAKE="qmake"
if test $ARCHITECTURE = "Darwin"; then
CONFIGDEFINES="$CONFIGDEFINES DARWIN"
SOFLAGS="-m64 -O2 -dynamiclib -single_module -undefined dynamic_lookup"
CC="clang"
CXX="clang++"
LD="clang++"
QWTDEFINES=""
QWTINCLUDES="/usr/local/lib/qwt.framework/Headers"
QWTLIBS="-F/usr/local/lib -framework qwt"
QMAKE="qmake"
fi
if test $ARCHITECTURE = "Linux" && test $KERNELMAJOR -lt 2 && test $KERNELMINOR -lt 6; then
echo "Linux kernel minor version < 6: fake device support forced"
USEFAKEDEVICES=1
CONFIGDEFINES="USE_FAKEIO NOUEYE"
fi
if test $ARCHITECTURE = "Linux"; then
SOFLAGS="-shared"
# Support multiple distros (e.g. Ubuntu (Debian), openSUSE)
if [ -n "`which qmake 2> /dev/null`" ]; then
echo Using qmake.
QMAKE="qmake"
fi
if [ -n "`which qmake-qt4 2> /dev/null`" ]; then
echo Using qmake-qt4
QMAKE="qmake-qt4"
fi
CC="gcc"
CXX="g++"
LD="g++"
# Support multiple distros (e.g. Ubuntu (Debian), openSUSE)
if [ -n "`locate qwtplot3d-qt4.so`" ]; then
echo Using Qwt libraries with qt4 suffix.
QWTDEFINES="QWT_QT4"
QWTINCLUDES="/usr/include/qwtplot3d-qt4"
QWTLIBS="-lqwtplot3d-qt4"
else
echo Using Qwt libraries without qt4 suffix.
QWTDEFINES=""
QWTINCLUDES="/usr/include/qwtplot3d"
QWTLIBS="-lqwtplot3d"
fi
QWTINCLUDES="/usr/include/qwt $QWTINCLUDES"
QWTLIBS="-lqwt $QWTLIBS -lGL -lGLU"
fi
if test $USEFAKEDEVICES = 1; then
echo build with fake device support
else
echo build with real device support
fi
if test $NOUEYE = 1; then
echo build without uEye support
else
echo build with uEye support
fi
if test $NODEFO = 1; then
echo build without DEFO support
else
echo build with DEFO support
fi
if test $NOTHERMAL = 1; then
echo build without THERMAL support
else
echo build with THERMAL support
fi
if test $NOASSEMBLY = 1; then
echo build without ASSEMBLY support
else
echo build with ASSEMBLY support
fi
if test $NOPLASMA = 1; then
echo build without Plasma Cleaner support
else
echo build with Plasma Cleaner support
fi
if test $NOPUMPSTATION = 1; then
echo build without Pump Station support
else
echo build with Pump Station support
fi
SED_VARIABLES="BASEPATH ARCHITECTURE KERNELMAJOR KERNELMINOR QMAKE CXX CC LD NODEFO NOTHERMAL NOASSEMBLY NOPLASMA NOPUMPSTATION APPLICATIONVERSIONSTR USEFAKEDEVICES NOUEYE WEBDOCUMENTROOT SOFLAGS CONFIGDEFINES QWTDEFINES QWTINCLUDES QWTLIBS ROOTCFLAGS ROOTLIBS ROOTGLIBS ROOTMAJOR"
echo "#!/bin/sh
dest=\`basename \$1 .in\`
sed \\" > config.status
for key in $SED_VARIABLES; do
eval key_value='"$'${key}'"'
key_lower=`echo $key | awk '{print tolower($1)}'`
echo " -e 's?@$key_lower@?$key_value?g' \\" >> config.status
done
echo " < \$1 > \$dest" >> config.status
chmod +x config.status
echo ""
echo -n 'running config.status ..... '
served_dirs=
ROOTDIR=`pwd`
for a in `find . -name '*.in' -print`; do
if test `basename $a` = "Makefile.in"; then
served_dirs="$served_dirs `dirname $a` "
fi
cd `dirname $a`
$ROOTDIR/config.status `basename $a`
cd $ROOTDIR
done
echo done.