219 [ 220 AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], 221 [Deprecated. Option is kept for backwards compatibility and is ignored])]) 222 if test "x$enable_$2" != x; then 223 AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) 224 fi 225 ]) 226 227 AC_DEFUN_ONCE([BASIC_INIT], 228 [ 229 # Save the original command line. This is passed to us by the wrapper configure script. 230 AC_SUBST(CONFIGURE_COMMAND_LINE) 231 DATE_WHEN_CONFIGURED=`LANG=C date` 232 AC_SUBST(DATE_WHEN_CONFIGURED) 233 AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) 234 AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) 235 ]) 236 237 # Test that variable $1 denoting a program is not empty. If empty, exit with an error. 238 # $1: variable to check 239 # $2: executable name to print in warning (optional) 240 AC_DEFUN([BASIC_CHECK_NONEMPTY], 241 [ 242 if test "x[$]$1" = x; then 243 if test "x$2" = x; then 244 PROG_NAME=translit($1,A-Z,a-z) 245 else 246 PROG_NAME=$2 247 fi 248 AC_MSG_NOTICE([Could not find $PROG_NAME!]) 249 AC_MSG_ERROR([Cannot continue]) 250 fi 251 ]) 252 253 # Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. 254 # Arguments as AC_PATH_PROG: 255 # $1: variable to set 256 # $2: executable name to look for 257 AC_DEFUN([BASIC_REQUIRE_PROG], 258 [ 259 AC_PATH_PROGS($1, $2) 260 BASIC_CHECK_NONEMPTY($1, $2) 261 ]) 262 263 # Setup the most fundamental tools that relies on not much else to set up, 264 # but is used by much of the early bootstrap code. 265 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], 266 [ 267 268 # Start with tools that do not need have cross compilation support 269 # and can be expected to be found in the default PATH. These tools are 270 # used by configure. Nor are these tools expected to be found in the 271 # devkit from the builddeps server either, since they are 272 # needed to download the devkit. 273 274 # First are all the simple required tools. 275 BASIC_REQUIRE_PROG(BASENAME, basename) 276 BASIC_REQUIRE_PROG(BASH, bash) 277 BASIC_REQUIRE_PROG(CAT, cat) 278 BASIC_REQUIRE_PROG(CHMOD, chmod) 279 BASIC_REQUIRE_PROG(CMP, cmp) 280 BASIC_REQUIRE_PROG(COMM, comm) 281 BASIC_REQUIRE_PROG(CP, cp) 282 BASIC_REQUIRE_PROG(CPIO, cpio) 283 BASIC_REQUIRE_PROG(CUT, cut) 284 BASIC_REQUIRE_PROG(DATE, date) 285 BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) 286 BASIC_REQUIRE_PROG(DIRNAME, dirname) 287 BASIC_REQUIRE_PROG(ECHO, echo) 288 BASIC_REQUIRE_PROG(EXPR, expr) 289 BASIC_REQUIRE_PROG(FILE, file) 290 BASIC_REQUIRE_PROG(FIND, find) 291 BASIC_REQUIRE_PROG(HEAD, head) 292 BASIC_REQUIRE_PROG(LN, ln) 293 BASIC_REQUIRE_PROG(LS, ls) 294 BASIC_REQUIRE_PROG(MKDIR, mkdir) 295 BASIC_REQUIRE_PROG(MKTEMP, mktemp) 296 BASIC_REQUIRE_PROG(MV, mv) 297 BASIC_REQUIRE_PROG(PRINTF, printf) 298 BASIC_REQUIRE_PROG(RM, rm) 299 BASIC_REQUIRE_PROG(SH, sh) 300 BASIC_REQUIRE_PROG(SORT, sort) 301 BASIC_REQUIRE_PROG(TAIL, tail) 302 BASIC_REQUIRE_PROG(TAR, tar) 303 BASIC_REQUIRE_PROG(TEE, tee) 304 BASIC_REQUIRE_PROG(TOUCH, touch) 305 BASIC_REQUIRE_PROG(TR, tr) 306 BASIC_REQUIRE_PROG(UNAME, uname) 307 BASIC_REQUIRE_PROG(UNIQ, uniq) 308 BASIC_REQUIRE_PROG(WC, wc) 309 BASIC_REQUIRE_PROG(WHICH, which) 310 BASIC_REQUIRE_PROG(XARGS, xargs) 311 312 # Then required tools that require some special treatment. 313 AC_PROG_AWK 314 BASIC_CHECK_NONEMPTY(AWK) 315 AC_PROG_GREP 316 BASIC_CHECK_NONEMPTY(GREP) 317 AC_PROG_EGREP 318 BASIC_CHECK_NONEMPTY(EGREP) 319 AC_PROG_FGREP 320 BASIC_CHECK_NONEMPTY(FGREP) 321 AC_PROG_SED 322 BASIC_CHECK_NONEMPTY(SED) 323 324 AC_PATH_PROGS(NAWK, [nawk gawk awk]) 325 BASIC_CHECK_NONEMPTY(NAWK) 326 327 # Always force rm. 328 RM="$RM -f" 329 330 # pwd behaves differently on various platforms and some don't support the -L flag. 331 # Always use the bash builtin pwd to get uniform behavior. 332 THEPWDCMD=pwd 333 334 # These are not required on all platforms 335 AC_PATH_PROG(CYGPATH, cygpath) 336 AC_PATH_PROG(READLINK, readlink) 337 AC_PATH_PROG(DF, df) 338 AC_PATH_PROG(SETFILE, SetFile) 339 ]) 340 341 # Setup basic configuration paths, and platform-specific stuff related to PATHs. 342 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], 343 [ 344 # Locate the directory of this script. 345 SCRIPT="[$]0" 346 AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` 347 348 # Where is the source? It is located two levels above the configure script. 349 CURDIR="$PWD" 350 cd "$AUTOCONF_DIR/../.." 351 SRC_ROOT="`$THEPWDCMD -L`" 352 353 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 354 PATH_SEP=";" 355 BASIC_CHECK_PATHS_WINDOWS 356 else 357 PATH_SEP=":" 358 fi 611 if test -f $DELETEDIR/TestIfFindSupportsDelete; then 612 # No, it does not. 613 rm $DELETEDIR/TestIfFindSupportsDelete 614 FIND_DELETE="-exec rm \{\} \+" 615 AC_MSG_RESULT([no]) 616 else 617 AC_MSG_RESULT([yes]) 618 fi 619 rmdir $DELETEDIR 620 AC_SUBST(FIND_DELETE) 621 ]) 622 623 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], 624 [ 625 BASIC_CHECK_GNU_MAKE 626 627 BASIC_CHECK_FIND_DELETE 628 629 # These tools might not be installed by default, 630 # need hint on how to install them. 631 BASIC_REQUIRE_PROG(UNZIP, unzip) 632 BASIC_REQUIRE_PROG(ZIP, zip) 633 634 # Non-required basic tools 635 636 AC_PATH_PROG(LDD, ldd) 637 if test "x$LDD" = "x"; then 638 # List shared lib dependencies is used for 639 # debug output and checking for forbidden dependencies. 640 # We can build without it. 641 LDD="true" 642 fi 643 AC_PATH_PROGS(READELF, [readelf greadelf]) 644 AC_PATH_PROG(HG, hg) 645 AC_PATH_PROG(STAT, stat) 646 AC_PATH_PROG(TIME, time) 647 # Check if it's GNU time 648 IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` 649 if test "x$IS_GNU_TIME" != x; then 650 IS_GNU_TIME=yes 651 else 652 IS_GNU_TIME=no 653 fi 654 AC_SUBST(IS_GNU_TIME) 655 656 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 657 BASIC_REQUIRE_PROG(COMM, comm) 658 fi 659 660 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 661 BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) 662 BASIC_REQUIRE_PROG(XATTR, xattr) 663 AC_PATH_PROG(CODESIGN, codesign) 664 if test "x$CODESIGN" != "x"; then 665 # Verify that the openjdk_codesign certificate is present 666 AC_MSG_CHECKING([if openjdk_codesign certificate is present]) 667 rm -f codesign-testfile 668 touch codesign-testfile 669 codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= 670 rm -f codesign-testfile 671 if test "x$CODESIGN" = x; then 672 AC_MSG_RESULT([no]) 673 else 674 AC_MSG_RESULT([yes]) 675 fi 676 fi 677 fi 678 ]) 679 680 # Check if build directory is on local disk. If not possible to determine, 681 # we prefer to claim it's local. 682 # Argument 1: directory to test 683 # Argument 2: what to do if it is on local disk 705 else 706 $3 707 fi 708 fi 709 ]) 710 711 # Check that source files have basic read permissions set. This might 712 # not be the case in cygwin in certain conditions. 713 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS], 714 [ 715 if test x"$OPENJDK_BUILD_OS" = xwindows; then 716 file_to_test="$SRC_ROOT/LICENSE" 717 if test `$STAT -c '%a' "$file_to_test"` -lt 400; then 718 AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.]) 719 fi 720 fi 721 ]) 722 723 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], 724 [ 725 AC_MSG_CHECKING([if build directory is on local disk]) 726 BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT, 727 [OUTPUT_DIR_IS_LOCAL="yes"], 728 [OUTPUT_DIR_IS_LOCAL="no"]) 729 AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL) 730 731 BASIC_CHECK_SRC_PERMS 732 733 # Check if the user has any old-style ALT_ variables set. 734 FOUND_ALT_VARIABLES=`env | grep ^ALT_` 735 736 # Before generating output files, test if they exist. If they do, this is a reconfigure. 737 # Since we can't properly handle the dependencies for this, warn the user about the situation 738 if test -e $OUTPUT_ROOT/spec.gmk; then 739 IS_RECONFIGURE=yes 740 else 741 IS_RECONFIGURE=no 742 fi 743 ]) | 219 [ 220 AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], 221 [Deprecated. Option is kept for backwards compatibility and is ignored])]) 222 if test "x$enable_$2" != x; then 223 AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) 224 fi 225 ]) 226 227 AC_DEFUN_ONCE([BASIC_INIT], 228 [ 229 # Save the original command line. This is passed to us by the wrapper configure script. 230 AC_SUBST(CONFIGURE_COMMAND_LINE) 231 DATE_WHEN_CONFIGURED=`LANG=C date` 232 AC_SUBST(DATE_WHEN_CONFIGURED) 233 AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) 234 AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) 235 ]) 236 237 # Test that variable $1 denoting a program is not empty. If empty, exit with an error. 238 # $1: variable to check 239 AC_DEFUN([BASIC_CHECK_NONEMPTY], 240 [ 241 if test "x[$]$1" = x; then 242 AC_MSG_ERROR([Could not find required tool for $1]) 243 fi 244 ]) 245 246 # Check that there are no unprocessed overridden variables left. 247 # If so, they are an incorrect argument and we will exit with an error. 248 AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN], 249 [ 250 if test "x$CONFIGURE_OVERRIDDEN_VARIABLES" != x; then 251 # Replace the separating ! with spaces before presenting for end user. 252 unknown_variables=${CONFIGURE_OVERRIDDEN_VARIABLES//!/ } 253 AC_MSG_ERROR([The following variables are unknown to configure: $unknown_variables]) 254 fi 255 ]) 256 257 # Setup a tool for the given variable. If correctly specified by the user, 258 # use that value, otherwise search for the tool using the supplied code snippet. 259 # $1: variable to set 260 # $2: code snippet to call to look for the tool 261 AC_DEFUN([BASIC_SETUP_TOOL], 262 [ 263 # Publish this variable in the help. 264 AC_ARG_VAR($1, [Override default value for $1]) 265 266 if test "x[$]$1" = x; then 267 # The variable is not set by user, try to locate tool using the code snippet 268 $2 269 else 270 # The variable is set, but is it from the command line or the environment? 271 272 # Try to remove the string !$1! from our list. 273 try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!$1!/} 274 if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then 275 # If it failed, the variable was not from the command line. Ignore it, 276 # but warn the user (except for BASH, which is always set by the calling BASH). 277 if test "x$1" != xBASH; then 278 AC_MSG_WARN([Ignoring value of $1 from the environment. Use command line variables instead.]) 279 fi 280 # Try to locate tool using the code snippet 281 $2 282 else 283 # If it succeeded, then it was overridden by the user. We will use it 284 # for the tool. 285 286 # First remove it from the list of overridden variables, so we can test 287 # for unknown variables in the end. 288 CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" 289 290 # Check if the provided tool contains a complete path. 291 tool_specified="[$]$1" 292 tool_basename="${tool_specified##*/}" 293 if test "x$tool_basename" = "x$tool_specified"; then 294 # A command without a complete path is provided, search $PATH. 295 AC_MSG_NOTICE([Will search for user supplied tool $1=$tool_basename]) 296 AC_PATH_PROG($1, $tool_basename) 297 if test "x[$]$1" = x; then 298 AC_MSG_ERROR([User supplied tool $tool_basename could not be found]) 299 fi 300 else 301 # Otherwise we believe it is a complete path. Use it as it is. 302 AC_MSG_NOTICE([Will use user supplied tool $1=$tool_specified]) 303 AC_MSG_CHECKING([for $1]) 304 if test ! -x "$tool_specified"; then 305 AC_MSG_RESULT([not found]) 306 AC_MSG_ERROR([User supplied tool $1=$tool_specified does not exist or is not executable]) 307 fi 308 AC_MSG_RESULT([$tool_specified]) 309 fi 310 fi 311 fi 312 ]) 313 314 # Call BASIC_SETUP_TOOL with AC_PATH_PROGS to locate the tool 315 # $1: variable to set 316 # $2: executable name (or list of names) to look for 317 AC_DEFUN([BASIC_PATH_PROGS], 318 [ 319 BASIC_SETUP_TOOL($1, [AC_PATH_PROGS($1, $2)]) 320 ]) 321 322 # Call BASIC_SETUP_TOOL with AC_CHECK_TOOLS to locate the tool 323 # $1: variable to set 324 # $2: executable name (or list of names) to look for 325 AC_DEFUN([BASIC_CHECK_TOOLS], 326 [ 327 BASIC_SETUP_TOOL($1, [AC_CHECK_TOOLS($1, $2)]) 328 ]) 329 330 # Like BASIC_PATH_PROGS but fails if no tool was found. 331 # $1: variable to set 332 # $2: executable name (or list of names) to look for 333 AC_DEFUN([BASIC_REQUIRE_PROGS], 334 [ 335 BASIC_PATH_PROGS($1, $2) 336 BASIC_CHECK_NONEMPTY($1) 337 ]) 338 339 # Like BASIC_SETUP_TOOL but fails if no tool was found. 340 # $1: variable to set 341 # $2: autoconf macro to call to look for the special tool 342 AC_DEFUN([BASIC_REQUIRE_SPECIAL], 343 [ 344 BASIC_SETUP_TOOL($1, [$2]) 345 BASIC_CHECK_NONEMPTY($1) 346 ]) 347 348 # Setup the most fundamental tools that relies on not much else to set up, 349 # but is used by much of the early bootstrap code. 350 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], 351 [ 352 # Start with tools that do not need have cross compilation support 353 # and can be expected to be found in the default PATH. These tools are 354 # used by configure. Nor are these tools expected to be found in the 355 # devkit from the builddeps server either, since they are 356 # needed to download the devkit. 357 358 # First are all the simple required tools. 359 BASIC_REQUIRE_PROGS(BASENAME, basename) 360 BASIC_REQUIRE_PROGS(BASH, bash) 361 BASIC_REQUIRE_PROGS(CAT, cat) 362 BASIC_REQUIRE_PROGS(CHMOD, chmod) 363 BASIC_REQUIRE_PROGS(CMP, cmp) 364 BASIC_REQUIRE_PROGS(COMM, comm) 365 BASIC_REQUIRE_PROGS(CP, cp) 366 BASIC_REQUIRE_PROGS(CPIO, cpio) 367 BASIC_REQUIRE_PROGS(CUT, cut) 368 BASIC_REQUIRE_PROGS(DATE, date) 369 BASIC_REQUIRE_PROGS(DIFF, [gdiff diff]) 370 BASIC_REQUIRE_PROGS(DIRNAME, dirname) 371 BASIC_REQUIRE_PROGS(ECHO, echo) 372 BASIC_REQUIRE_PROGS(EXPR, expr) 373 BASIC_REQUIRE_PROGS(FILE, file) 374 BASIC_REQUIRE_PROGS(FIND, find) 375 BASIC_REQUIRE_PROGS(HEAD, head) 376 BASIC_REQUIRE_PROGS(LN, ln) 377 BASIC_REQUIRE_PROGS(LS, ls) 378 BASIC_REQUIRE_PROGS(MKDIR, mkdir) 379 BASIC_REQUIRE_PROGS(MKTEMP, mktemp) 380 BASIC_REQUIRE_PROGS(MV, mv) 381 BASIC_REQUIRE_PROGS(NAWK, [nawk gawk awk]) 382 BASIC_REQUIRE_PROGS(PRINTF, printf) 383 BASIC_REQUIRE_PROGS(RM, rm) 384 BASIC_REQUIRE_PROGS(SH, sh) 385 BASIC_REQUIRE_PROGS(SORT, sort) 386 BASIC_REQUIRE_PROGS(TAIL, tail) 387 BASIC_REQUIRE_PROGS(TAR, tar) 388 BASIC_REQUIRE_PROGS(TEE, tee) 389 BASIC_REQUIRE_PROGS(TOUCH, touch) 390 BASIC_REQUIRE_PROGS(TR, tr) 391 BASIC_REQUIRE_PROGS(UNAME, uname) 392 BASIC_REQUIRE_PROGS(UNIQ, uniq) 393 BASIC_REQUIRE_PROGS(WC, wc) 394 BASIC_REQUIRE_PROGS(WHICH, which) 395 BASIC_REQUIRE_PROGS(XARGS, xargs) 396 397 # Then required tools that require some special treatment. 398 BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK]) 399 BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP]) 400 BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP]) 401 BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP]) 402 BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED]) 403 404 # Always force rm. 405 RM="$RM -f" 406 407 # pwd behaves differently on various platforms and some don't support the -L flag. 408 # Always use the bash builtin pwd to get uniform behavior. 409 THEPWDCMD=pwd 410 411 # These are not required on all platforms 412 BASIC_PATH_PROGS(CYGPATH, cygpath) 413 BASIC_PATH_PROGS(READLINK, [greadlink readlink]) 414 BASIC_PATH_PROGS(DF, df) 415 BASIC_PATH_PROGS(SETFILE, SetFile) 416 ]) 417 418 # Setup basic configuration paths, and platform-specific stuff related to PATHs. 419 AC_DEFUN_ONCE([BASIC_SETUP_PATHS], 420 [ 421 # Locate the directory of this script. 422 SCRIPT="[$]0" 423 AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` 424 425 # Where is the source? It is located two levels above the configure script. 426 CURDIR="$PWD" 427 cd "$AUTOCONF_DIR/../.." 428 SRC_ROOT="`$THEPWDCMD -L`" 429 430 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 431 PATH_SEP=";" 432 BASIC_CHECK_PATHS_WINDOWS 433 else 434 PATH_SEP=":" 435 fi 688 if test -f $DELETEDIR/TestIfFindSupportsDelete; then 689 # No, it does not. 690 rm $DELETEDIR/TestIfFindSupportsDelete 691 FIND_DELETE="-exec rm \{\} \+" 692 AC_MSG_RESULT([no]) 693 else 694 AC_MSG_RESULT([yes]) 695 fi 696 rmdir $DELETEDIR 697 AC_SUBST(FIND_DELETE) 698 ]) 699 700 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], 701 [ 702 BASIC_CHECK_GNU_MAKE 703 704 BASIC_CHECK_FIND_DELETE 705 706 # These tools might not be installed by default, 707 # need hint on how to install them. 708 BASIC_REQUIRE_PROGS(UNZIP, unzip) 709 BASIC_REQUIRE_PROGS(ZIP, zip) 710 711 # Non-required basic tools 712 713 BASIC_PATH_PROGS(LDD, ldd) 714 if test "x$LDD" = "x"; then 715 # List shared lib dependencies is used for 716 # debug output and checking for forbidden dependencies. 717 # We can build without it. 718 LDD="true" 719 fi 720 BASIC_PATH_PROGS(READELF, [readelf greadelf]) 721 BASIC_PATH_PROGS(HG, hg) 722 BASIC_PATH_PROGS(STAT, stat) 723 BASIC_PATH_PROGS(TIME, time) 724 # Check if it's GNU time 725 IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` 726 if test "x$IS_GNU_TIME" != x; then 727 IS_GNU_TIME=yes 728 else 729 IS_GNU_TIME=no 730 fi 731 AC_SUBST(IS_GNU_TIME) 732 733 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then 734 BASIC_REQUIRE_PROGS(COMM, comm) 735 fi 736 737 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 738 BASIC_REQUIRE_PROGS(DSYMUTIL, dsymutil) 739 BASIC_REQUIRE_PROGS(XATTR, xattr) 740 BASIC_PATH_PROGS(CODESIGN, codesign) 741 if test "x$CODESIGN" != "x"; then 742 # Verify that the openjdk_codesign certificate is present 743 AC_MSG_CHECKING([if openjdk_codesign certificate is present]) 744 rm -f codesign-testfile 745 touch codesign-testfile 746 codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= 747 rm -f codesign-testfile 748 if test "x$CODESIGN" = x; then 749 AC_MSG_RESULT([no]) 750 else 751 AC_MSG_RESULT([yes]) 752 fi 753 fi 754 fi 755 ]) 756 757 # Check if build directory is on local disk. If not possible to determine, 758 # we prefer to claim it's local. 759 # Argument 1: directory to test 760 # Argument 2: what to do if it is on local disk 782 else 783 $3 784 fi 785 fi 786 ]) 787 788 # Check that source files have basic read permissions set. This might 789 # not be the case in cygwin in certain conditions. 790 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS], 791 [ 792 if test x"$OPENJDK_BUILD_OS" = xwindows; then 793 file_to_test="$SRC_ROOT/LICENSE" 794 if test `$STAT -c '%a' "$file_to_test"` -lt 400; then 795 AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.]) 796 fi 797 fi 798 ]) 799 800 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], 801 [ 802 # Did user specify any unknown variables? 803 BASIC_CHECK_LEFTOVER_OVERRIDDEN 804 805 AC_MSG_CHECKING([if build directory is on local disk]) 806 BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT, 807 [OUTPUT_DIR_IS_LOCAL="yes"], 808 [OUTPUT_DIR_IS_LOCAL="no"]) 809 AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL) 810 811 BASIC_CHECK_SRC_PERMS 812 813 # Check if the user has any old-style ALT_ variables set. 814 FOUND_ALT_VARIABLES=`env | grep ^ALT_` 815 816 # Before generating output files, test if they exist. If they do, this is a reconfigure. 817 # Since we can't properly handle the dependencies for this, warn the user about the situation 818 if test -e $OUTPUT_ROOT/spec.gmk; then 819 IS_RECONFIGURE=yes 820 else 821 IS_RECONFIGURE=no 822 fi 823 ]) |