864
865 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
866 [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
867 [ CONF_NAME=${with_conf_name} ])
868
869 # Test from where we are running configure, in or outside of src root.
870 AC_MSG_CHECKING([where to store configuration])
871 if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
872 || test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
873 || test "x$CURDIR" = "x$TOPDIR/make" ; then
874 # We are running configure from the src root.
875 # Create a default ./build/target-variant-debuglevel output root.
876 if test "x${CONF_NAME}" = x; then
877 AC_MSG_RESULT([in default location])
878 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JVM_VARIANTS_WITH_AND}-${DEBUG_LEVEL}"
879 else
880 AC_MSG_RESULT([in build directory with custom name])
881 fi
882
883 if test "x$CUSTOM_ROOT" != x; then
884 OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}"
885 else
886 OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}"
887 fi
888 $MKDIR -p "$OUTPUTDIR"
889 if test ! -d "$OUTPUTDIR"; then
890 AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])
891 fi
892 else
893 # We are running configure from outside of the src dir.
894 # Then use the current directory as output dir!
895 # If configuration is situated in normal build directory, just use the build
896 # directory name as configuration name, otherwise use the complete path.
897 if test "x${CONF_NAME}" = x; then
898 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${TOPDIR}/build/!!"`
899 fi
900 OUTPUTDIR="$CURDIR"
901 AC_MSG_RESULT([in current directory])
902
903 # WARNING: This might be a bad thing to do. You need to be sure you want to
904 # have a configuration in this directory. Do some sanity checks!
905
906 if test ! -e "$OUTPUTDIR/spec.gmk"; then
907 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
923 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
924 AC_MSG_NOTICE([seriously mess up just about everything.])
925 AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure])
926 AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
927 AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
928 fi
929 fi
930 fi
931 AC_MSG_CHECKING([what configuration name to use])
932 AC_MSG_RESULT([$CONF_NAME])
933
934 BASIC_FIXUP_PATH(OUTPUTDIR)
935
936 CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support"
937 $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
938
939 SPEC="$OUTPUTDIR/spec.gmk"
940 AC_SUBST(SPEC)
941 AC_SUBST(CONF_NAME)
942 AC_SUBST(OUTPUTDIR)
943 AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
944
945 # The spec.gmk file contains all variables for the make system.
946 AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
947 # The bootcycle-spec.gmk file contains support for boot cycle builds.
948 AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
949 # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
950 AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
951 # The compare.sh is used to compare the build output to other builds.
952 AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
953 # The generated Makefile knows where the spec.gmk is and where the source is.
954 # You can run make from the OUTPUTDIR, or from the top-level Makefile
955 # which will look for generated configurations
956 AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
957 ])
958
959 #%%% Simple tools %%%
960
961 ###############################################################################
962 # Check if we have found a usable version of make
|
864
865 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
866 [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
867 [ CONF_NAME=${with_conf_name} ])
868
869 # Test from where we are running configure, in or outside of src root.
870 AC_MSG_CHECKING([where to store configuration])
871 if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
872 || test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
873 || test "x$CURDIR" = "x$TOPDIR/make" ; then
874 # We are running configure from the src root.
875 # Create a default ./build/target-variant-debuglevel output root.
876 if test "x${CONF_NAME}" = x; then
877 AC_MSG_RESULT([in default location])
878 CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JVM_VARIANTS_WITH_AND}-${DEBUG_LEVEL}"
879 else
880 AC_MSG_RESULT([in build directory with custom name])
881 fi
882
883 if test "x$CUSTOM_ROOT" != x; then
884 WORKSPACE_ROOT="${CUSTOM_ROOT}"
885 else
886 WORKSPACE_ROOT="${TOPDIR}"
887 fi
888 OUTPUTDIR="${WORKSPACE_ROOT}/build/${CONF_NAME}"
889 $MKDIR -p "$OUTPUTDIR"
890 if test ! -d "$OUTPUTDIR"; then
891 AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])
892 fi
893 else
894 # We are running configure from outside of the src dir.
895 # Then use the current directory as output dir!
896 # If configuration is situated in normal build directory, just use the build
897 # directory name as configuration name, otherwise use the complete path.
898 if test "x${CONF_NAME}" = x; then
899 CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${TOPDIR}/build/!!"`
900 fi
901 OUTPUTDIR="$CURDIR"
902 AC_MSG_RESULT([in current directory])
903
904 # WARNING: This might be a bad thing to do. You need to be sure you want to
905 # have a configuration in this directory. Do some sanity checks!
906
907 if test ! -e "$OUTPUTDIR/spec.gmk"; then
908 # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
924 AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
925 AC_MSG_NOTICE([seriously mess up just about everything.])
926 AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure])
927 AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
928 AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
929 fi
930 fi
931 fi
932 AC_MSG_CHECKING([what configuration name to use])
933 AC_MSG_RESULT([$CONF_NAME])
934
935 BASIC_FIXUP_PATH(OUTPUTDIR)
936
937 CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support"
938 $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
939
940 SPEC="$OUTPUTDIR/spec.gmk"
941 AC_SUBST(SPEC)
942 AC_SUBST(CONF_NAME)
943 AC_SUBST(OUTPUTDIR)
944 AC_SUBST(WORKSPACE_ROOT)
945 AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
946
947 # The spec.gmk file contains all variables for the make system.
948 AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
949 # The bootcycle-spec.gmk file contains support for boot cycle builds.
950 AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
951 # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
952 AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
953 # The compare.sh is used to compare the build output to other builds.
954 AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
955 # The generated Makefile knows where the spec.gmk is and where the source is.
956 # You can run make from the OUTPUTDIR, or from the top-level Makefile
957 # which will look for generated configurations
958 AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
959 ])
960
961 #%%% Simple tools %%%
962
963 ###############################################################################
964 # Check if we have found a usable version of make
|