@@ -68,7 +68,21 @@ function setVSEnv()
68
68
;;
69
69
esac
70
70
71
- local cmd=$(printf "cmd /V /C cd %s && vcvarsall.bat %s 1>NUL && echo LIB=!LIB! && echo INCLUDE=!INCLUDE! && echo PATH=!PATH! && echo FrameworkSDKDir=!FrameworkSDKDir! && echo WindowsSdkDir=!WindowsSdkDir!" "$1" "$ARCH")
71
+ local cmd
72
+ # Repository can be located on a different drive than the system drive, in
73
+ # order to make the command below work in that scenario, first switch to
74
+ # the drive on which Program Files is located.
75
+ local drv=$(echo "${VS_HOME}" | perl -ne 'print "$1$2" if (m#^(?:([a-z]):|/cygdrive/([a-z])/)#i)')
76
+
77
+ #needed to check if we have a VS > 2015 as the vsvarsall.bat has been renamed to VsDevCmd.bat
78
+ vsvarscheck="${VS_HOME}/VC/vcvarsall.bat"
79
+ if [ -f "$vsvarscheck" ]; then
80
+ local cmd=$(printf "cmd /V /C %s: && cd %s && vcvarsall.bat %s 1>NUL && echo LIB=!LIB! && echo INCLUDE=!INCLUDE! && echo PATH=!PATH! && echo FrameworkSDKDir=!FrameworkSDKDir! && echo WindowsSdkDir=!WindowsSdkDir!" "$drv" "$1" "$ARCH")
81
+ else
82
+ vshome_norm=$(cygpath -w $VS_HOME)
83
+ vs_gt_2015_path=${vshome_norm}/Common7/Tools/
84
+ local cmd=$(printf "cmd /V /C %s: && cd %s && VsDevCmd.bat -arch=%s 1>NUL && echo LIB=!LIB! && echo INCLUDE=!INCLUDE! && echo PATH=!PATH! && echo FrameworkSDKDir=!FrameworkSDKDir! && echo WindowsSdkDir=!WindowsSdkDir!" "$drv" "$vs_gt_2015_path" "$ARCH")
85
+ fi
72
86
73
87
# PATH is converted by cygwin automatically, others are not. Unset them to prevent corruption in case this function is executed more than once
74
88
[[ -n "$LIB" ]] && { echo "Warning: LIB already set!"; unset LIB; }
@@ -133,7 +147,7 @@ csharp_check ()
133
147
msvs_check ()
134
148
{
135
149
# VS_VER 19 Windows 10 / VS2015 / .NET framework V4.6 / SDK v10.0A
136
- # VS_VER 18 Windows 8.1 / VS2013 / .NET framework V4.5.2 / SDK 8.1A
150
+ # VS_VER 18 Windows 8.1 / VS2013 / .NET framework V4.5.1 / SDK 8.1A
137
151
# VS_VER 17 Windows 8 / VS2012 / .NET framework V4.5 / SDK 8.0A
138
152
# VS_VER 16 Windows 7 / VS2010 / .NET framework V4.0.30319 / SDK 7.0A
139
153
# VS_VER 15 Windows Vista / VS2008 / .NET framework V3.5 / SDK 6.0A
@@ -162,21 +176,64 @@ msvs_check ()
162
176
# needed for installer names
163
177
if [ "$VS_VER" == "14" ]; then
164
178
VS_YEAR=2005
179
+ DOTNET="3.0"
165
180
elif [ "$VS_VER" == "15" ]; then
166
181
VS_YEAR=2008
182
+ DOTNET="3.5"
167
183
elif [ "$VS_VER" == "16" ]; then
168
184
VS_YEAR=2010
185
+ DOTNET="4.0"
169
186
elif [ "$VS_VER" == "17" ]; then
170
187
VS_YEAR=2012
188
+ DOTNET="4.5"
171
189
elif [ "$VS_VER" == "18" ]; then
172
190
VS_YEAR=2013
173
- elif [ "$VS_VER" == "19" ]; then
191
+ DOTNET="4.5.1"
192
+ elif [[ $OSPL_COMPILER_VER == "19.0"* ]]; then
174
193
VS_YEAR=2015
194
+ DOTNET="4.6"
195
+ elif [[ $OSPL_COMPILER_VER == "19.1"* ]]; then
196
+ VS_YEAR=2017
197
+ DOTNET="4.6.1"
175
198
else
176
199
VS_YEAR=Unknown
200
+ DOTNET="Unknown"
177
201
fi
202
+
178
203
set_var VS_YEAR "$VS_YEAR"
179
- echo "OK - using compiler version: $COMPILER_VER for VS: $VS_YEAR"
204
+ set_var DOTNET "$DOTNET"
205
+ # from VS 2015 update 3 and above C11 is enabled so enable it for the build too.
206
+ if [ $VS_VER -gt 18 ]
207
+ then
208
+ set_var OSPL_USE_CXX11 "yes"
209
+ fi
210
+
211
+
212
+ # only generate an AssemblyAttributes for vs2010 and newer lower is not supported
213
+ if [ $VS_VER -gt 15 ]
214
+ then
215
+ sed -e "s;%DOTNET%;$DOTNET;g" $OSPL_HOME/src/api/dcps/sacs/AssemblyAttributesTemplate.cs > $OSPL_HOME/src/api/dcps/sacs/code/DDS/AssemblyAttributes.cs
216
+ fi
217
+
218
+ DOTNETPROGFILES=$PROGRAMFILES
219
+
220
+ case ${SPLICE_HOST} in
221
+ x86_64.*)
222
+ DOTNETPROGFILES="C:\\Program Files (x86)"
223
+ ;;
224
+ esac
225
+
226
+ #fallback for when the host is 32 bit but the actual platform is 64 bit
227
+ if [[ "$PROCESSOR_ARCHITECTURE" == "AMD64" ]]; then
228
+ DOTNETPROGFILES="C:\\Program Files (x86)"
229
+ fi
230
+
231
+ if [[ "$PROCESSOR_ARCHITEW6432" == "AMD64" ]]; then
232
+ DOTNETPROGFILES="C:\\Program Files (x86)"
233
+ fi
234
+ set_var DOTNETPROGFILES "$DOTNETPROGFILES"
235
+
236
+ echo "OK - using compiler version: $COMPILER_VER for VS: $VS_YEAR and .Net $DOTNET and Program Files $DOTNETPROGFILES"
180
237
fi
181
238
182
239
@@ -218,57 +275,65 @@ gcc_check ()
218
275
{
219
276
echo -n "GCC: "
220
277
pathcheck gcc
221
- if [ $? != 0 ]
222
- then
278
+ if [ $? != 0 ]; then
223
279
echo "ERROR - Not found"
224
280
return 1
225
281
fi
226
282
227
283
GCC_FULLVERSION=`gcc -dumpversion`
228
284
GCC_MAJOR=`echo $GCC_FULLVERSION | cut -f 1 -d .`
229
- if [ $GCC_MAJOR -lt 3 ]
230
- then
231
- echo "ERROR - Only gcc 3.2 and above is supported"
232
- return 1
233
- fi
234
-
235
285
GCC_MINOR=`echo $GCC_FULLVERSION | cut -f 2 -d .`
236
- if [ $GCC_MAJOR -eq 3 -a $GCC_MINOR -lt 2 ]
237
- then
238
- echo "ERROR - Only gcc 3.2 and above is supported"
286
+ export GCC_MAJOR GCC_MINOR
287
+
288
+ # GCC < 3.2 not supported
289
+ if echo $GCC_FULLVERSION | gawk '{ exit $1 < 3.2 ? 0 : 1 }'; then
290
+ echo "ERROR - Only GCC >= 3.2 is supported (found: $GCC_FULLVERSION)"
239
291
return 1
240
292
fi
241
- # -Werror=switch supported by gcc >= 4.2
242
- # -Wconversion changed in 4.3 and we want the new one, but it gives too many false positives in 4.3
243
- GCC_WERROR_IS_SWITCH_SUPPORT=`echo $GCC_FULLVERSION | gawk '{ print $1>="4.2"?"1":"0"}'`
244
- GCC_WCONVERSION_IS_SUPPORTED=`echo $GCC_FULLVERSION | gawk '{ print $1>="4.4"?"1":"0"}'`
293
+
294
+ echo "OK - Using version $GCC_FULLVERSION"
295
+
296
+ # GCC >= 4.2 supports -Werror=switch
297
+ GCC_WERROR_IS_SWITCH_SUPPORT=`echo $GCC_FULLVERSION | gawk '{ print $1 >= 4.2 ? 1 : 0 }'`
245
298
set_var GCC_WERROR_IS_SWITCH_SUPPORT "$GCC_WERROR_IS_SWITCH_SUPPORT"
299
+
300
+ # GCC >= 4.3 supports C++11
301
+ GCC_SUPPORTS_CPLUSPLUS11=`echo $GCC_FULLVERSION | gawk '{ print $1 >= 4.3 ? 1 : 0 }'`
302
+ set_var GCC_SUPPORTS_CPLUSPLUS11 "$GCC_SUPPORTS_CPLUSPLUS11"
303
+
304
+ # GCC >= 4.4 supports -Wconversion (too many false positives in 4.3)
305
+ GCC_WCONVERSION_IS_SUPPORTED=`echo $GCC_FULLVERSION | gawk '{ print $1 >= 4.4 ? 1 : 0 }'`
246
306
set_var GCC_WCONVERSION_IS_SUPPORTED "$GCC_WCONVERSION_IS_SUPPORTED"
247
- export GCC_WERROR_IS_SWITCH_SUPPORT
248
- export GCC_WCONVERSION_IS_SUPPORTED
249
- export GCC_MAJOR GCC_MINOR
250
- echo "OK - using version $GCC_FULLVERSION"
251
307
252
- if echo $GCC_FULLVERSION | gawk '{ if($1>="4.3"){exit 0}else{exit 1} }' ; then
253
- set_var GCC_SUPPORTS_CPLUSPLUS11 1
254
- export GCC_SUPPORTS_CPLUSPLUS11
308
+ # GCC >= 4.7 supports -flto (except 5.4, due to bug in linker: OSPL-10875)
309
+ # Also at GCC >= 4.7 we disable maybe-uninitialized errors for some 3rd party code
310
+ if echo $GCC_FULLVERSION | gawk '{ exit $1 >= 4.7 ? 0 : 1 }'; then
311
+ case "${GCC_FULLVERSION}" in
312
+ 5.4*)
313
+ ;;
314
+ *)
315
+ echo " NOTE - Enable link-time optimizations (for release build)"
316
+ set_var GCC_SUPPORTS_LTO 1
317
+ if ! pathcheck gcc-ar; then
318
+ echo " WARNING - Unable to find gcc-ar (could result in link errors)"
319
+ fi
320
+ ;;
321
+ esac
322
+ set_var GCC_HAS_NO_MAYBE_UNINITIALIZED yes
255
323
fi
256
324
257
- # -flto works well in gcc >= 4.7
258
- if echo $GCC_FULLVERSION | gawk '{ if($1>="4.7"){exit 0}else{exit 1} }' ; then
259
- echo " NOTE - enabling link-time optimizations for release build"
260
- set_var GCC_SUPPORTS_LTO 1
261
- export GCC_SUPPORTS_LTO
262
- pathcheck gcc-ar
263
- if [ $? -ne 0 ]
264
- then
265
- echo " WARNING - unable to find gcc-ar this could result in link errors"
325
+ # GCC >= 4.8 supports building Fujitsu system-tests (except when cross-compiling)
326
+ if echo $GCC_FULLVERSION | gawk '{ exit $1 >= 4.8 ? 0 : 1 }'; then
327
+ if [ ${SPLICE_TARGET} = ${SPLICE_HOST} ]; then
328
+ echo " NOTE - Building Fujitsu system-tests"
329
+ set_var INCLUDE_FUJITSU_ST_TEST yes
330
+ else
331
+ echo " NOTE - Not building Fujitsu system-tests (cross-compile not supported)"
266
332
fi
267
-
268
- # Also at 4.7+ we disable maybe-uninitialized errors for some 3rd party code
269
- set_var GCC_HAS_NO_MAYBE_UNINITIALIZED yes
270
- export GCC_HAS_NO_MAYBE_UNINITIALIZED
333
+ else
334
+ echo " NOTE - Not building Fujitsu system-tests (requires GCC >= 4.8)"
271
335
fi
336
+
272
337
return 0
273
338
}
274
339
@@ -363,12 +428,12 @@ qt_check ()
363
428
echo -n "Qt: "
364
429
if [ "$OSPL_QT_IS_ON" = "no" ]
365
430
then
366
- echo "Disabled. OSPL_QT_IS_ON was: no"
431
+ echo "Disabled. \$ OSPL_QT_IS_ON was: no"
367
432
return 0
368
433
fi
369
434
if [ -n "$QTDIR" ]
370
435
then
371
- if [ -f " $QTDIR/bin/uic" ]
436
+ if [ -f $QTDIR/bin/uic ]
372
437
then
373
438
QT_VERSION=`$QTDIR/bin/uic -version 2>&1 | sed 's/\([^0-9][^0-9]*\)\([0-9]\)\([^0-9].*\)/\2/'`
374
439
echo "at_check (1) and QT_VERSION is $QT_VERSION"
@@ -401,7 +466,7 @@ qt_check ()
401
466
return 1
402
467
fi
403
468
else
404
- if [ -z " $QTLIBDIR" ]
469
+ if [ -z $QTLIBDIR ]
405
470
then
406
471
linkpath=`ld --verbose | grep SEARCH_DIR | tr ' ' '\n' | sed -e 's/SEARCH_DIR("\=\?\(.*\)");/\1/g'`
407
472
for i in $linkpath
@@ -412,12 +477,9 @@ qt_check ()
412
477
fi
413
478
done
414
479
fi
415
- if [ -z " $QTLIBDIR" ]
480
+ if [ -z $QTLIBDIR ]
416
481
then
417
- echo "Warning - Cannot find Qt libraries. Standalone demo package will not be built."
418
- echo " Please specifiy QTLIBDIR."
419
- set_var OSPL_QT_IS_ON no
420
- return 0
482
+ echo "Cannot find Qt libraries. Standalone demo package will not be built. Please specifiy QTLIBDIR."
421
483
fi
422
484
case `uname` in
423
485
CYGWIN_NT*)
@@ -448,7 +510,7 @@ qt_check ()
448
510
echo "On. Using QT tools from the path."
449
511
set_var OSPL_QT_IS_ON yes
450
512
else
451
- echo "Off. Ok, iShapes Demo will not be built "
513
+ echo "Off. Ok, but you're missing out on bouncing shapes... "
452
514
fi
453
515
fi
454
516
return 0
@@ -618,13 +680,14 @@ bison_check ()
618
680
echo "ERROR - Not found"
619
681
return 1
620
682
fi
621
- BISON_VERSION=`bison -V 2>/dev/null | head -1`
622
- #BISON_MAJOR=`echo $BISON_VERSION | cut -f 1 -d '.' | cut -f 4 -d ' '`
623
- #if [ $BISON_MAJOR -lt 2 ]
624
- #then
625
- # echo "ERROR - Only bison 2.x and above is supported"
626
- # return 1
627
- #fi
683
+ BISON_VERSION=`bison -V 2>/dev/null | head -1 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'`
684
+ BISON_MAJOR=`echo $BISON_VERSION | cut -f 1 -d '.'`
685
+ BISON_MINOR=`echo $BISON_VERSION | cut -f 2 -d '.'`
686
+ if [ $BISON_MAJOR -lt 3 ] && ! [ $BISON_MAJOR -eq 2 -a $BISON_MINOR -ge 7 ]
687
+ then
688
+ echo "ERROR - Only bison 2.7 and above is supported"
689
+ return 1
690
+ fi
628
691
629
692
echo "OK - using $BISON_VERSION"
630
693
return 0
@@ -795,25 +858,10 @@ javac_check ()
795
858
then
796
859
JAVA_HOME=`echo "$JAVAC_EXE" | sed 's@/bin/javac$@@' `
797
860
set_var JAVA_HOME "$JAVA_HOME"
798
- if [ "$JAVAC_VERSION" -ne "$REQUIRED_VERSION" -a ! -f "$JAVA_COMPATJAR" ]
799
- then
800
- if [ "$STRICT_CHECKS" = yes ]
801
- then
802
- echo "ERROR - JAVA_COMPATJAR must point to rt.jar for Java 1.6"
803
- return 1
804
- else
805
- echo "Warning - you should set JAVA_COMPATJAR to rt.jar for Java 1.6"
806
- fi
807
- fi
808
861
else
809
862
echo "ERROR - Only Oracle JAVA 1.6 and above is supported"
810
863
return 1
811
864
fi
812
- if [ ! -n "$JAVA_VERSION_OVERRIDE" -a ! -z "$OSPL_OUTER_HOME" -a "$JAVAC_VERSION" -ne "$REQUIRED_VERSION" ]
813
- then
814
- echo "ERROR - Only Oracle JAVA 1.6 is supported"
815
- return 1
816
- fi
817
865
else
818
866
echo "ERROR - Only Oracle JAVA 1.6 and above is supported"
819
867
return 1
@@ -872,7 +920,7 @@ javac_check ()
872
920
fi
873
921
874
922
echo "OK - using JAVAC version $JAVAC_REAL_VERSION"
875
- echo " JAVA_HOME is $JAVA_HOME"
923
+ echo " JAVA_HOME is $JAVA_HOME"
876
924
return 0
877
925
}
878
926
@@ -1232,6 +1280,8 @@ c99_check()
1232
1280
1233
1281
no_protoc()
1234
1282
{
1283
+ set_var INCLUDE_FUJITSU_ST_TEST no
1284
+ export INCLUDE_FUJITSU_ST_TEST
1235
1285
if [ "$STRICT_CHECKS" = "yes" ]
1236
1286
then
1237
1287
# this needs to be to an error before protobuf functionality is released
@@ -1243,6 +1293,7 @@ no_protoc()
1243
1293
echo "Warning - Protobuf compiler environment not set, building of all protobuf related features is disabled."
1244
1294
return 0;
1245
1295
fi
1296
+
1246
1297
}
1247
1298
1248
1299
launch4j_check()
0 commit comments