1 #
   2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS],
  27 [
  28   # Where are the sources.
  29   LANGTOOLS_TOPDIR="$SRC_ROOT/langtools"
  30   CORBA_TOPDIR="$SRC_ROOT/corba"
  31   JAXP_TOPDIR="$SRC_ROOT/jaxp"
  32   JAXWS_TOPDIR="$SRC_ROOT/jaxws"
  33   HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
  34   NASHORN_TOPDIR="$SRC_ROOT/nashorn"
  35   JDK_TOPDIR="$SRC_ROOT/jdk"
  36   AC_SUBST(LANGTOOLS_TOPDIR)
  37   AC_SUBST(CORBA_TOPDIR)
  38   AC_SUBST(JAXP_TOPDIR)
  39   AC_SUBST(JAXWS_TOPDIR)
  40   AC_SUBST(HOTSPOT_TOPDIR)
  41   AC_SUBST(NASHORN_TOPDIR)
  42   AC_SUBST(JDK_TOPDIR)
  43 ])
  44 
  45 AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
  46 [
  47   # This feature is no longer supported.
  48 
  49   BASIC_DEPRECATED_ARG_WITH(add-source-root)
  50   BASIC_DEPRECATED_ARG_WITH(override-source-root)
  51   BASIC_DEPRECATED_ARG_WITH(adds-and-overrides)
  52   BASIC_DEPRECATED_ARG_WITH(override-langtools)
  53   BASIC_DEPRECATED_ARG_WITH(override-corba)
  54   BASIC_DEPRECATED_ARG_WITH(override-jaxp)
  55   BASIC_DEPRECATED_ARG_WITH(override-jaxws)
  56   BASIC_DEPRECATED_ARG_WITH(override-hotspot)
  57   BASIC_DEPRECATED_ARG_WITH(override-nashorn)
  58   BASIC_DEPRECATED_ARG_WITH(override-jdk)
  59 ])
  60 
  61 AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
  62 [
  63   BUILD_OUTPUT="$OUTPUT_ROOT"
  64   AC_SUBST(BUILD_OUTPUT)
  65 
  66   HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
  67   BUILD_HOTSPOT=true
  68   AC_SUBST(HOTSPOT_DIST)
  69   AC_SUBST(BUILD_HOTSPOT)
  70   AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot],
  71   [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])])
  72   if test "x$with_import_hotspot" != x; then
  73     CURDIR="$PWD"
  74     cd "$with_import_hotspot"
  75     HOTSPOT_DIST="`pwd`"
  76     cd "$CURDIR"
  77     if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
  78       AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!])
  79     fi
  80     AC_MSG_CHECKING([if hotspot should be imported])
  81     AC_MSG_RESULT([yes from $HOTSPOT_DIST])
  82     BUILD_HOTSPOT=false
  83   fi
  84 
  85   JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
  86 ])
  87 
  88 ################################################################################
  89 # Define a mechanism for importing extra prebuilt modules
  90 #
  91 
  92 AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
  93 [
  94   AC_ARG_WITH(import-modules, [AS_HELP_STRING([--with-import-modules],
  95       [import a set of prebuilt modules either as a zip file or an exploded directory])])
  96 
  97   if test "x$with_import_modules" != x \
  98       && test "x$with_import_modules" != "xno"; then
  99     if test -d "$with_import_modules"; then
 100       IMPORT_MODULES_TOPDIR="$with_import_modules"
 101       BASIC_FIXUP_PATH([IMPORT_MODULES_TOPDIR])
 102     elif test -e "$with_import_modules"; then
 103       IMPORT_MODULES_TOPDIR="$CONFIGURESUPPORT_OUTPUTDIR/import-modules"
 104       $RM -rf "$IMPORT_MODULES_TOPDIR"
 105       $MKDIR -p "$IMPORT_MODULES_TOPDIR"
 106       if ! $UNZIP -q "$with_import_modules" -d "$IMPORT_MODULES_TOPDIR"; then
 107         AC_MSG_ERROR([--with-import-modules="$with_import_modules" must point to a dir or a zip file])
 108       fi
 109     else
 110       AC_MSG_ERROR([--with-import-modules="$with_import_modules" must point to a dir or a zip file])
 111     fi
 112   fi
 113 
 114   if test -d "$IMPORT_MODULES_TOPDIR/modules"; then
 115     IMPORT_MODULES_CLASSES="$IMPORT_MODULES_TOPDIR/modules"
 116   fi
 117   if test -d "$IMPORT_MODULES_TOPDIR/modules_cmds"; then
 118     IMPORT_MODULES_CMDS="$IMPORT_MODULES_TOPDIR/modules_cmds"
 119   fi
 120   if test -d "$IMPORT_MODULES_TOPDIR/modules_libs"; then
 121     IMPORT_MODULES_LIBS="$IMPORT_MODULES_TOPDIR/modules_libs"
 122   fi
 123   if test -d "$IMPORT_MODULES_TOPDIR/modules_conf"; then
 124     IMPORT_MODULES_CONF="$IMPORT_MODULES_TOPDIR/modules_conf"
 125   fi
 126   if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
 127     IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
 128   fi
 129   # Workaround for using different imported module-info.java in Jake due to a
 130   # change in format. Remove once new format is standard in JDK 9 and javafx
 131   # delivers just that.
 132   if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
 133     IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
 134   fi
 135   if test -d "$IMPORT_MODULES_TOPDIR/make"; then
 136     IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
 137   fi
 138 
 139   AC_SUBST(IMPORT_MODULES_CLASSES)
 140   AC_SUBST(IMPORT_MODULES_CMDS)
 141   AC_SUBST(IMPORT_MODULES_LIBS)
 142   AC_SUBST(IMPORT_MODULES_CONF)
 143   AC_SUBST(IMPORT_MODULES_SRC)
 144   AC_SUBST(IMPORT_MODULES_MAKE)
 145 ])