360 ])
361
362 # Setup the most fundamental tools that relies on not much else to set up,
363 # but is used by much of the early bootstrap code.
364 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
365 [
366 # Start with tools that do not need have cross compilation support
367 # and can be expected to be found in the default PATH. These tools are
368 # used by configure. Nor are these tools expected to be found in the
369 # devkit from the builddeps server either, since they are
370 # needed to download the devkit.
371
372 # First are all the simple required tools.
373 BASIC_REQUIRE_PROGS(BASENAME, basename)
374 BASIC_REQUIRE_PROGS(BASH, bash)
375 BASIC_REQUIRE_PROGS(CAT, cat)
376 BASIC_REQUIRE_PROGS(CHMOD, chmod)
377 BASIC_REQUIRE_PROGS(CMP, cmp)
378 BASIC_REQUIRE_PROGS(COMM, comm)
379 BASIC_REQUIRE_PROGS(CP, cp)
380 BASIC_REQUIRE_PROGS(CPIO, cpio)
381 BASIC_REQUIRE_PROGS(CUT, cut)
382 BASIC_REQUIRE_PROGS(DATE, date)
383 BASIC_REQUIRE_PROGS(DIFF, [gdiff diff])
384 BASIC_REQUIRE_PROGS(DIRNAME, dirname)
385 BASIC_REQUIRE_PROGS(ECHO, echo)
386 BASIC_REQUIRE_PROGS(EXPR, expr)
387 BASIC_REQUIRE_PROGS(FILE, file)
388 BASIC_REQUIRE_PROGS(FIND, find)
389 BASIC_REQUIRE_PROGS(HEAD, head)
390 BASIC_REQUIRE_PROGS(LN, ln)
391 BASIC_REQUIRE_PROGS(LS, ls)
392 BASIC_REQUIRE_PROGS(MKDIR, mkdir)
393 BASIC_REQUIRE_PROGS(MKTEMP, mktemp)
394 BASIC_REQUIRE_PROGS(MV, mv)
395 BASIC_REQUIRE_PROGS(NAWK, [nawk gawk awk])
396 BASIC_REQUIRE_PROGS(PRINTF, printf)
397 BASIC_REQUIRE_PROGS(RM, rm)
398 BASIC_REQUIRE_PROGS(SH, sh)
399 BASIC_REQUIRE_PROGS(SORT, sort)
400 BASIC_REQUIRE_PROGS(TAIL, tail)
410
411 # Then required tools that require some special treatment.
412 BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
413 BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
414 BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
415 BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
416 BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
417
418 # Always force rm.
419 RM="$RM -f"
420
421 # pwd behaves differently on various platforms and some don't support the -L flag.
422 # Always use the bash builtin pwd to get uniform behavior.
423 THEPWDCMD=pwd
424
425 # These are not required on all platforms
426 BASIC_PATH_PROGS(CYGPATH, cygpath)
427 BASIC_PATH_PROGS(READLINK, [greadlink readlink])
428 BASIC_PATH_PROGS(DF, df)
429 BASIC_PATH_PROGS(SETFILE, SetFile)
430 ])
431
432 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
433 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
434 [
435 # Save the current directory this script was started from
436 CURDIR="$PWD"
437
438 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
439 PATH_SEP=";"
440 BASIC_CHECK_PATHS_WINDOWS
441 else
442 PATH_SEP=":"
443 fi
444 AC_SUBST(PATH_SEP)
445
446 # We get the top-level directory from the supporting wrappers.
447 AC_MSG_CHECKING([for top-level directory])
448 AC_MSG_RESULT([$TOPDIR])
449 AC_SUBST(TOPDIR)
909 else
910 $3
911 fi
912 else
913 # No df here, say it's local
914 $2
915 fi
916 else
917 if $DF -l $1 > /dev/null 2>&1; then
918 $2
919 else
920 $3
921 fi
922 fi
923 ])
924
925 # Check that source files have basic read permissions set. This might
926 # not be the case in cygwin in certain conditions.
927 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
928 [
929 if test x"$OPENJDK_BUILD_OS" = xwindows; then
930 file_to_test="$SRC_ROOT/LICENSE"
931 if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
932 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.])
933 fi
934 fi
935 ])
936
937 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
938 [
939 # Did user specify any unknown variables?
940 BASIC_CHECK_LEFTOVER_OVERRIDDEN
941
942 AC_MSG_CHECKING([if build directory is on local disk])
943 BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
944 [OUTPUT_DIR_IS_LOCAL="yes"],
945 [OUTPUT_DIR_IS_LOCAL="no"])
946 AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
947
948 BASIC_CHECK_SRC_PERMS
949
|
360 ])
361
362 # Setup the most fundamental tools that relies on not much else to set up,
363 # but is used by much of the early bootstrap code.
364 AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
365 [
366 # Start with tools that do not need have cross compilation support
367 # and can be expected to be found in the default PATH. These tools are
368 # used by configure. Nor are these tools expected to be found in the
369 # devkit from the builddeps server either, since they are
370 # needed to download the devkit.
371
372 # First are all the simple required tools.
373 BASIC_REQUIRE_PROGS(BASENAME, basename)
374 BASIC_REQUIRE_PROGS(BASH, bash)
375 BASIC_REQUIRE_PROGS(CAT, cat)
376 BASIC_REQUIRE_PROGS(CHMOD, chmod)
377 BASIC_REQUIRE_PROGS(CMP, cmp)
378 BASIC_REQUIRE_PROGS(COMM, comm)
379 BASIC_REQUIRE_PROGS(CP, cp)
380 BASIC_REQUIRE_PROGS(CUT, cut)
381 BASIC_REQUIRE_PROGS(DATE, date)
382 BASIC_REQUIRE_PROGS(DIFF, [gdiff diff])
383 BASIC_REQUIRE_PROGS(DIRNAME, dirname)
384 BASIC_REQUIRE_PROGS(ECHO, echo)
385 BASIC_REQUIRE_PROGS(EXPR, expr)
386 BASIC_REQUIRE_PROGS(FILE, file)
387 BASIC_REQUIRE_PROGS(FIND, find)
388 BASIC_REQUIRE_PROGS(HEAD, head)
389 BASIC_REQUIRE_PROGS(LN, ln)
390 BASIC_REQUIRE_PROGS(LS, ls)
391 BASIC_REQUIRE_PROGS(MKDIR, mkdir)
392 BASIC_REQUIRE_PROGS(MKTEMP, mktemp)
393 BASIC_REQUIRE_PROGS(MV, mv)
394 BASIC_REQUIRE_PROGS(NAWK, [nawk gawk awk])
395 BASIC_REQUIRE_PROGS(PRINTF, printf)
396 BASIC_REQUIRE_PROGS(RM, rm)
397 BASIC_REQUIRE_PROGS(SH, sh)
398 BASIC_REQUIRE_PROGS(SORT, sort)
399 BASIC_REQUIRE_PROGS(TAIL, tail)
409
410 # Then required tools that require some special treatment.
411 BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
412 BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
413 BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
414 BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
415 BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
416
417 # Always force rm.
418 RM="$RM -f"
419
420 # pwd behaves differently on various platforms and some don't support the -L flag.
421 # Always use the bash builtin pwd to get uniform behavior.
422 THEPWDCMD=pwd
423
424 # These are not required on all platforms
425 BASIC_PATH_PROGS(CYGPATH, cygpath)
426 BASIC_PATH_PROGS(READLINK, [greadlink readlink])
427 BASIC_PATH_PROGS(DF, df)
428 BASIC_PATH_PROGS(SETFILE, SetFile)
429 BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
430 ])
431
432 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
433 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
434 [
435 # Save the current directory this script was started from
436 CURDIR="$PWD"
437
438 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
439 PATH_SEP=";"
440 BASIC_CHECK_PATHS_WINDOWS
441 else
442 PATH_SEP=":"
443 fi
444 AC_SUBST(PATH_SEP)
445
446 # We get the top-level directory from the supporting wrappers.
447 AC_MSG_CHECKING([for top-level directory])
448 AC_MSG_RESULT([$TOPDIR])
449 AC_SUBST(TOPDIR)
909 else
910 $3
911 fi
912 else
913 # No df here, say it's local
914 $2
915 fi
916 else
917 if $DF -l $1 > /dev/null 2>&1; then
918 $2
919 else
920 $3
921 fi
922 fi
923 ])
924
925 # Check that source files have basic read permissions set. This might
926 # not be the case in cygwin in certain conditions.
927 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
928 [
929 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
930 file_to_test="$SRC_ROOT/LICENSE"
931 if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
932 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.])
933 fi
934 fi
935 ])
936
937 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
938 [
939 # Did user specify any unknown variables?
940 BASIC_CHECK_LEFTOVER_OVERRIDDEN
941
942 AC_MSG_CHECKING([if build directory is on local disk])
943 BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
944 [OUTPUT_DIR_IS_LOCAL="yes"],
945 [OUTPUT_DIR_IS_LOCAL="no"])
946 AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
947
948 BASIC_CHECK_SRC_PERMS
949
|