@@ -40,8 +40,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK],
40
40
OPENJ9_PLATFORM_SETUP
41
41
OPENJ9_CONFIGURE_CMAKE
42
42
OPENJ9_CONFIGURE_COMPILERS
43
- OPENJ9_CONFIGURE_CRAC_SUPPORT
44
- OPENJ9_CONFIGURE_CRIU_SUPPORT
43
+ OPENJ9_CONFIGURE_CRAC_AND_CRIU_SUPPORT
45
44
OPENJ9_CONFIGURE_CUDA
46
45
OPENJ9_CONFIGURE_DDR
47
46
OPENJ9_CONFIGURE_DEMOS
@@ -343,57 +342,86 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU],
343
342
esac
344
343
] )
345
344
346
- AC_DEFUN ( [ OPENJ9_CONFIGURE_CRAC_SUPPORT ] ,
345
+ AC_DEFUN ( [ OPENJ9_CONFIGURE_CRAC_AND_CRIU_SUPPORT ] ,
347
346
[
348
- AC_MSG_CHECKING ( [ for CRAC support] )
349
- AC_ARG_ENABLE ( [ crac-support] , [ AS_HELP_STRING ( [ --enable-crac-support] , [ enable CRAC support @<:@ platform dependent@:>@ ] ) ] )
350
- OPENJ9_ENABLE_CRAC_SUPPORT=false
347
+ AC_ARG_ENABLE ( [ crac-support] , [ AS_HELP_STRING ( [ --enable-crac-support] , [ enable CRaC support @<:@ platform dependent@:>@ ] ) ] )
348
+ AC_ARG_ENABLE ( [ criu-support] , [ AS_HELP_STRING ( [ --enable-criu-support] , [ enable CRIU support @<:@ platform dependent@:>@ ] ) ] )
349
+
350
+ # Complain about explicitly requested, but illegal combinations.
351
+ if test "x$enable_crac_support" = xyes && test "x$enable_criu_support" = xno ; then
352
+ AC_MSG_ERROR ( [ --enable-crac-support requires CRIU support] )
353
+ fi
354
+
355
+ # Compute platform-specific defaults.
356
+ case "$OPENJ9_PLATFORM_CODE" in
357
+ xa64)
358
+ default_crac=yes
359
+ default_criu=yes
360
+ ;;
361
+ xl64|xr64|xz64)
362
+ default_crac=no
363
+ default_criu=yes
364
+ ;;
365
+ *)
366
+ default_crac=no
367
+ default_criu=no
368
+ ;;
369
+ esac
351
370
371
+ # Capture the origin of each setting.
352
372
if test "x$enable_crac_support" = xyes ; then
353
- AC_MSG_RESULT ( [ yes (explicitly enabled)] )
354
- OPENJ9_ENABLE_CRAC_SUPPORT=true
373
+ origin_crac="explicitly enabled"
355
374
elif test "x$enable_crac_support" = xno ; then
356
- AC_MSG_RESULT ( [ no ( explicitly disabled) ] )
375
+ origin_crac=" explicitly disabled"
357
376
elif test "x$enable_crac_support" = x ; then
358
- case "$OPENJ9_PLATFORM_CODE" in
359
- xa64)
360
- AC_MSG_RESULT ( [ yes (default)] )
361
- OPENJ9_ENABLE_CRAC_SUPPORT=true
362
- ;;
363
- *)
364
- AC_MSG_RESULT ( [ no (default)] )
365
- ;;
366
- esac
377
+ # Adjust if CRUI is explicitly disabled.
378
+ if test "x$enable_criu_support" = xno && test "x$default_crac" = xyes ; then
379
+ origin_crac="implicitly disabled"
380
+ enable_crac_support=no
381
+ else
382
+ origin_crac=default
383
+ enable_crac_support=$default_crac
384
+ fi
367
385
else
368
386
AC_MSG_ERROR ( [ --enable-crac-support accepts no argument] )
369
387
fi
370
- AC_SUBST ( OPENJ9_ENABLE_CRAC_SUPPORT )
371
- ] )
372
-
373
- AC_DEFUN ( [ OPENJ9_CONFIGURE_CRIU_SUPPORT] ,
374
- [
375
- AC_MSG_CHECKING ( [ for CRIU support] )
376
- AC_ARG_ENABLE ( [ criu-support] , [ AS_HELP_STRING ( [ --enable-criu-support] , [ enable CRIU support @<:@ platform dependent@:>@ ] ) ] )
377
- OPENJ9_ENABLE_CRIU_SUPPORT=false
378
388
379
389
if test "x$enable_criu_support" = xyes ; then
380
- AC_MSG_RESULT ( [ yes (explicitly enabled)] )
381
- OPENJ9_ENABLE_CRIU_SUPPORT=true
390
+ origin_criu="explicitly enabled"
382
391
elif test "x$enable_criu_support" = xno ; then
383
- AC_MSG_RESULT ( [ no ( explicitly disabled) ] )
392
+ origin_criu=" explicitly disabled"
384
393
elif test "x$enable_criu_support" = x ; then
385
- case "$OPENJ9_PLATFORM_CODE" in
386
- xa64|xl64|xr64|xz64)
387
- AC_MSG_RESULT ( [ yes (default)] )
388
- OPENJ9_ENABLE_CRIU_SUPPORT=true
389
- ;;
390
- *)
391
- AC_MSG_RESULT ( [ no (default)] )
392
- ;;
393
- esac
394
+ # Adjust if CRaC is explicitly enabled.
395
+ if test "x$enable_crac_support" = xyes && test "x$default_criu" = xno ; then
396
+ origin_criu="implicitly enabled"
397
+ enable_criu_support=yes
398
+ else
399
+ origin_criu=default
400
+ enable_criu_support=$default_criu
401
+ fi
394
402
else
395
403
AC_MSG_ERROR ( [ --enable-criu-support accepts no argument] )
396
404
fi
405
+
406
+ # Report and capture results.
407
+ AC_MSG_CHECKING ( [ for CRAC support] )
408
+ if test "x$enable_crac_support" = xyes ; then
409
+ AC_MSG_RESULT ( [ yes ($origin_crac)] )
410
+ OPENJ9_ENABLE_CRAC_SUPPORT=true
411
+ else
412
+ AC_MSG_RESULT ( [ no ($origin_crac)] )
413
+ OPENJ9_ENABLE_CRAC_SUPPORT=false
414
+ fi
415
+ AC_SUBST ( OPENJ9_ENABLE_CRAC_SUPPORT )
416
+
417
+ AC_MSG_CHECKING ( [ for CRIU support] )
418
+ if test "x$enable_criu_support" = xyes ; then
419
+ AC_MSG_RESULT ( [ yes ($origin_criu)] )
420
+ OPENJ9_ENABLE_CRIU_SUPPORT=true
421
+ else
422
+ AC_MSG_RESULT ( [ no ($origin_criu)] )
423
+ OPENJ9_ENABLE_CRIU_SUPPORT=false
424
+ fi
397
425
AC_SUBST ( OPENJ9_ENABLE_CRIU_SUPPORT )
398
426
] )
399
427
0 commit comments