1.1 --- a/common/autoconf/builddeps.m4 Mon Jun 25 21:37:09 2012 -0700 1.2 +++ b/common/autoconf/builddeps.m4 Tue Jul 03 16:11:12 2012 -0700 1.3 @@ -23,7 +23,7 @@ 1.4 # questions. 1.5 # 1.6 1.7 -AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS], 1.8 +AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS], 1.9 [ 1.10 define(LIST_OF_BUILD_DEPENDENCIES,) 1.11 if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then 1.12 @@ -50,27 +50,27 @@ 1.13 AC_MSG_ERROR([Could not find any builddeps.conf at all!]) 1.14 fi 1.15 fi 1.16 - # Create build and host names that use _ instead of "-" and ".". 1.17 + # Create build and target names that use _ instead of "-" and ".". 1.18 # This is necessary to use them in variable names. 1.19 - build_var=`echo ${build} | tr '-' '_' | tr '.' '_'` 1.20 - host_var=`echo ${host} | tr '-' '_' | tr '.' '_'` 1.21 - # Extract rewrite information for build and host 1.22 + build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'` 1.23 + target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'` 1.24 + # Extract rewrite information for build and target 1.25 eval rewritten_build=\${REWRITE_${build_var}} 1.26 if test "x$rewritten_build" = x; then 1.27 - rewritten_build=${build} 1.28 + rewritten_build=${OPENJDK_BUILD_SYSTEM} 1.29 echo Build stays the same $rewritten_build 1.30 else 1.31 echo Rewriting build for builddeps into $rewritten_build 1.32 fi 1.33 - eval rewritten_host=\${REWRITE_${host_var}} 1.34 - if test "x$rewritten_host" = x; then 1.35 - rewritten_host=${host} 1.36 - echo Host stays the same $rewritten_host 1.37 + eval rewritten_target=\${REWRITE_${target_var}} 1.38 + if test "x$rewritten_target" = x; then 1.39 + rewritten_target=${OPENJDK_TARGET_SYSTEM} 1.40 + echo Target stays the same $rewritten_target 1.41 else 1.42 - echo Rewriting host for builddeps into $rewritten_host 1.43 + echo Rewriting target for builddeps into $rewritten_target 1.44 fi 1.45 rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` 1.46 - rewritten_host_var=`echo ${rewritten_host} | tr '-' '_' | tr '.' '_'` 1.47 + rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` 1.48 fi 1.49 AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip]) 1.50 if test "x$BDEPS_UNZIP" = x7z; then 1.51 @@ -127,11 +127,11 @@ 1.52 if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then 1.53 # Source the builddeps file again, to make sure it uses the latest variables! 1.54 . $builddepsfile 1.55 - # Look for a host and build machine specific resource! 1.56 - eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}} 1.57 + # Look for a target and build machine specific resource! 1.58 + eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} 1.59 if test "x$resource" = x; then 1.60 - # Ok, lets instead look for a host specific resource 1.61 - eval resource=\${builddep_$2_HOST_${rewritten_host_var}} 1.62 + # Ok, lets instead look for a target specific resource 1.63 + eval resource=\${builddep_$2_TARGET_${rewritten_target_var}} 1.64 fi 1.65 if test "x$resource" = x; then 1.66 # Ok, lets instead look for a build specific resource 1.67 @@ -228,3 +228,33 @@ 1.68 $5=$installdir 1.69 fi 1.70 ]) 1.71 + 1.72 +AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS], 1.73 +[ 1.74 +AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf], 1.75 + [use this configuration file for the builddeps])]) 1.76 + 1.77 +AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server], 1.78 + [download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])]) 1.79 + 1.80 +AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir], 1.81 + [store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])], 1.82 + [], 1.83 + [with_builddeps_dir=/localhome/builddeps]) 1.84 + 1.85 +AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group], 1.86 + [chgrp the downloaded build dependencies to this group])]) 1.87 + 1.88 +AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps], 1.89 + [list all build dependencies known to the configure script])], 1.90 + [LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no']) 1.91 + 1.92 +if test "x$LIST_BUILDDEPS" = xyes; then 1.93 + echo 1.94 + echo List of build dependencies known to the configure script, 1.95 + echo that can be used in builddeps.conf files: 1.96 + cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODUL[E]\( | cut -f 2 -d ',' | tr -d ' ' | sort 1.97 + echo 1.98 + exit 1 1.99 +fi 1.100 +])