common/autoconf/source-dirs.m4

Thu, 31 Aug 2017 15:40:18 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:40:18 +0800
changeset 1133
50aaf272884f
parent 912
a667caba1e84
parent 0
75a576e87639
permissions
-rw-r--r--

merge

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation. Oracle designates this
aoqi@0 8 # particular file as subject to the "Classpath" exception as provided
aoqi@0 9 # by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 #
aoqi@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 # accompanied this code).
aoqi@0 16 #
aoqi@0 17 # You should have received a copy of the GNU General Public License version
aoqi@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 #
aoqi@0 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 # or visit www.oracle.com if you need additional information or have any
aoqi@0 23 # questions.
aoqi@0 24 #
aoqi@0 25
aoqi@0 26 AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS],
aoqi@0 27 [
aoqi@0 28 # Where are the sources. Any of these can be overridden
aoqi@0 29 # using --with-override-corba and the likes.
aoqi@0 30 LANGTOOLS_TOPDIR="$SRC_ROOT/langtools"
aoqi@0 31 CORBA_TOPDIR="$SRC_ROOT/corba"
aoqi@0 32 JAXP_TOPDIR="$SRC_ROOT/jaxp"
aoqi@0 33 JAXWS_TOPDIR="$SRC_ROOT/jaxws"
aoqi@0 34 HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
aoqi@0 35 NASHORN_TOPDIR="$SRC_ROOT/nashorn"
aoqi@0 36 JDK_TOPDIR="$SRC_ROOT/jdk"
aoqi@0 37 AC_SUBST(LANGTOOLS_TOPDIR)
aoqi@0 38 AC_SUBST(CORBA_TOPDIR)
aoqi@0 39 AC_SUBST(JAXP_TOPDIR)
aoqi@0 40 AC_SUBST(JAXWS_TOPDIR)
aoqi@0 41 AC_SUBST(HOTSPOT_TOPDIR)
aoqi@0 42 AC_SUBST(NASHORN_TOPDIR)
aoqi@0 43 AC_SUBST(JDK_TOPDIR)
aoqi@0 44 ])
aoqi@0 45
aoqi@0 46
aoqi@0 47 AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
aoqi@0 48 [
aoqi@0 49
aoqi@0 50 ###############################################################################
aoqi@0 51 #
aoqi@0 52 # Pickup additional source for a component from outside of the source root
aoqi@0 53 # or override source for a component.
aoqi@0 54 #
aoqi@0 55 AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root],
aoqi@0 56 [for each and every source directory, look in this additional source root for
aoqi@0 57 the same directory; if it exists and have files in it, include it in the build])])
aoqi@0 58
aoqi@0 59 AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root],
aoqi@0 60 [for each and every source directory, look in this override source root for
aoqi@0 61 the same directory; if it exists, use that directory instead and
aoqi@0 62 ignore the directory in the original source root])])
aoqi@0 63
aoqi@0 64 AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides],
aoqi@0 65 [use the subdirs 'adds' and 'overrides' in the specified directory as
aoqi@0 66 add-source-root and override-source-root])])
aoqi@0 67
aoqi@0 68 if test "x$with_adds_and_overrides" != x; then
aoqi@0 69 with_add_source_root="$with_adds_and_overrides/adds"
aoqi@0 70 with_override_source_root="$with_adds_and_overrides/overrides"
aoqi@0 71 fi
aoqi@0 72
aoqi@0 73 if test "x$with_add_source_root" != x; then
aoqi@0 74 if ! test -d $with_add_source_root; then
aoqi@0 75 AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root])
aoqi@0 76 fi
aoqi@0 77 CURDIR="$PWD"
aoqi@0 78 cd "$with_add_source_root"
aoqi@0 79 ADD_SRC_ROOT="`pwd`"
aoqi@0 80 cd "$CURDIR"
aoqi@0 81 # Verify that the addon source root does not have any root makefiles.
aoqi@0 82 # If it does, then it is usually an error, prevent this.
aoqi@0 83 if test -f $with_add_source_root/langtools/make/Makefile; then
aoqi@0 84 AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
aoqi@0 85 fi
aoqi@0 86 if test -f $with_add_source_root/corba/make/Makefile; then
aoqi@0 87 AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
aoqi@0 88 fi
aoqi@0 89 if test -f $with_add_source_root/jaxp/make/Makefile; then
aoqi@0 90 AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
aoqi@0 91 fi
aoqi@0 92 if test -f $with_add_source_root/jaxws/make/Makefile; then
aoqi@0 93 AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
aoqi@0 94 fi
aoqi@0 95 if test -f $with_add_source_root/hotspot/make/Makefile; then
aoqi@0 96 AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
aoqi@0 97 fi
aoqi@0 98 if test -f $with_add_source_root/nashorn/make/Makefile; then
aoqi@0 99 AC_MSG_ERROR([Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources.])
aoqi@0 100 fi
aoqi@0 101 if test -f $with_add_source_root/jdk/make/Makefile; then
aoqi@0 102 AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
aoqi@0 103 fi
aoqi@0 104 fi
aoqi@0 105 AC_SUBST(ADD_SRC_ROOT)
aoqi@0 106
aoqi@0 107 if test "x$with_override_source_root" != x; then
aoqi@0 108 if ! test -d $with_override_source_root; then
aoqi@0 109 AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root])
aoqi@0 110 fi
aoqi@0 111 CURDIR="$PWD"
aoqi@0 112 cd "$with_override_source_root"
aoqi@0 113 OVERRIDE_SRC_ROOT="`pwd`"
aoqi@0 114 cd "$CURDIR"
aoqi@0 115 if test -f $with_override_source_root/langtools/make/Makefile; then
aoqi@0 116 AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.])
aoqi@0 117 fi
aoqi@0 118 if test -f $with_override_source_root/corba/make/Makefile; then
aoqi@0 119 AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.])
aoqi@0 120 fi
aoqi@0 121 if test -f $with_override_source_root/jaxp/make/Makefile; then
aoqi@0 122 AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.])
aoqi@0 123 fi
aoqi@0 124 if test -f $with_override_source_root/jaxws/make/Makefile; then
aoqi@0 125 AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.])
aoqi@0 126 fi
aoqi@0 127 if test -f $with_override_source_root/hotspot/make/Makefile; then
aoqi@0 128 AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.])
aoqi@0 129 fi
aoqi@0 130 if test -f $with_override_source_root/nashorn/make/Makefile; then
aoqi@0 131 AC_MSG_ERROR([Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override.])
aoqi@0 132 fi
aoqi@0 133 if test -f $with_override_source_root/jdk/make/Makefile; then
aoqi@0 134 AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.])
aoqi@0 135 fi
aoqi@0 136 fi
aoqi@0 137 AC_SUBST(OVERRIDE_SRC_ROOT)
aoqi@0 138
aoqi@0 139 ###############################################################################
aoqi@0 140 #
aoqi@0 141 # Override a repo completely, this is used for example when you have 3 small
aoqi@0 142 # development sandboxes of the langtools sources and want to avoid having 3 full
aoqi@0 143 # OpenJDK sources checked out on disk.
aoqi@0 144 #
aoqi@0 145 # Assuming that the 3 langtools sandboxes are located here:
aoqi@0 146 # /home/fredrik/sandbox1/langtools
aoqi@0 147 # /home/fredrik/sandbox2/langtools
aoqi@0 148 # /home/fredrik/sandbox3/langtools
aoqi@0 149 #
aoqi@0 150 # From the source root you create build subdirs manually:
aoqi@0 151 # mkdir -p build1 build2 build3
aoqi@0 152 # in each build directory run:
aoqi@0 153 # (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make)
aoqi@0 154 # (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make)
aoqi@0 155 # (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make)
aoqi@0 156 #
aoqi@0 157
aoqi@0 158 AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools],
aoqi@0 159 [use this langtools dir for the build])])
aoqi@0 160
aoqi@0 161 AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba],
aoqi@0 162 [use this corba dir for the build])])
aoqi@0 163
aoqi@0 164 AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp],
aoqi@0 165 [use this jaxp dir for the build])])
aoqi@0 166
aoqi@0 167 AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws],
aoqi@0 168 [use this jaxws dir for the build])])
aoqi@0 169
aoqi@0 170 AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot],
aoqi@0 171 [use this hotspot dir for the build])])
aoqi@0 172
aoqi@0 173 AC_ARG_WITH(override-nashorn, [AS_HELP_STRING([--with-override-nashorn],
aoqi@0 174 [use this nashorn dir for the build])])
aoqi@0 175
aoqi@0 176 AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk],
aoqi@0 177 [use this jdk dir for the build])])
aoqi@0 178
aoqi@0 179 if test "x$with_override_langtools" != x; then
aoqi@0 180 CURDIR="$PWD"
aoqi@0 181 cd "$with_override_langtools"
aoqi@0 182 LANGTOOLS_TOPDIR="`pwd`"
aoqi@0 183 cd "$CURDIR"
aoqi@0 184 if ! test -f $LANGTOOLS_TOPDIR/make/Makefile; then
aoqi@0 185 AC_MSG_ERROR([You have to override langtools with a full langtools repo!])
aoqi@0 186 fi
aoqi@0 187 AC_MSG_CHECKING([if langtools should be overridden])
aoqi@0 188 AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR])
aoqi@0 189 fi
aoqi@0 190 if test "x$with_override_corba" != x; then
aoqi@0 191 CURDIR="$PWD"
aoqi@0 192 cd "$with_override_corba"
aoqi@0 193 CORBA_TOPDIR="`pwd`"
aoqi@0 194 cd "$CURDIR"
aoqi@0 195 if ! test -f $CORBA_TOPDIR/make/Makefile; then
aoqi@0 196 AC_MSG_ERROR([You have to override corba with a full corba repo!])
aoqi@0 197 fi
aoqi@0 198 AC_MSG_CHECKING([if corba should be overridden])
aoqi@0 199 AC_MSG_RESULT([yes with $CORBA_TOPDIR])
aoqi@0 200 fi
aoqi@0 201 if test "x$with_override_jaxp" != x; then
aoqi@0 202 CURDIR="$PWD"
aoqi@0 203 cd "$with_override_jaxp"
aoqi@0 204 JAXP_TOPDIR="`pwd`"
aoqi@0 205 cd "$CURDIR"
aoqi@0 206 if ! test -f $JAXP_TOPDIR/make/Makefile; then
aoqi@0 207 AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!])
aoqi@0 208 fi
aoqi@0 209 AC_MSG_CHECKING([if jaxp should be overridden])
aoqi@0 210 AC_MSG_RESULT([yes with $JAXP_TOPDIR])
aoqi@0 211 fi
aoqi@0 212 if test "x$with_override_jaxws" != x; then
aoqi@0 213 CURDIR="$PWD"
aoqi@0 214 cd "$with_override_jaxws"
aoqi@0 215 JAXWS_TOPDIR="`pwd`"
aoqi@0 216 cd "$CURDIR"
aoqi@0 217 if ! test -f $JAXWS_TOPDIR/make/Makefile; then
aoqi@0 218 AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!])
aoqi@0 219 fi
aoqi@0 220 AC_MSG_CHECKING([if jaxws should be overridden])
aoqi@0 221 AC_MSG_RESULT([yes with $JAXWS_TOPDIR])
aoqi@0 222 fi
aoqi@0 223 if test "x$with_override_hotspot" != x; then
aoqi@0 224 CURDIR="$PWD"
aoqi@0 225 cd "$with_override_hotspot"
aoqi@0 226 HOTSPOT_TOPDIR="`pwd`"
aoqi@0 227 cd "$CURDIR"
aoqi@0 228 if ! test -f $HOTSPOT_TOPDIR/make/Makefile; then
aoqi@0 229 AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!])
aoqi@0 230 fi
aoqi@0 231 AC_MSG_CHECKING([if hotspot should be overridden])
aoqi@0 232 AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
aoqi@0 233 fi
aoqi@0 234 if test "x$with_override_nashorn" != x; then
aoqi@0 235 CURDIR="$PWD"
aoqi@0 236 cd "$with_override_nashorn"
aoqi@0 237 NASHORN_TOPDIR="`pwd`"
aoqi@0 238 cd "$CURDIR"
aoqi@0 239 if ! test -f $NASHORN_TOPDIR/make/Makefile; then
aoqi@0 240 AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!])
aoqi@0 241 fi
aoqi@0 242 AC_MSG_CHECKING([if nashorn should be overridden])
aoqi@0 243 AC_MSG_RESULT([yes with $NASHORN_TOPDIR])
aoqi@0 244 fi
aoqi@0 245 if test "x$with_override_jdk" != x; then
aoqi@0 246 CURDIR="$PWD"
aoqi@0 247 cd "$with_override_jdk"
aoqi@0 248 JDK_TOPDIR="`pwd`"
aoqi@0 249 cd "$CURDIR"
aoqi@0 250 if ! test -f $JDK_TOPDIR/make/Makefile; then
aoqi@0 251 AC_MSG_ERROR([You have to override JDK with a full JDK repo!])
aoqi@0 252 fi
aoqi@0 253 AC_MSG_CHECKING([if JDK should be overridden])
aoqi@0 254 AC_MSG_RESULT([yes with $JDK_TOPDIR])
aoqi@0 255 fi
aoqi@0 256 ])
aoqi@0 257
aoqi@0 258 AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
aoqi@0 259 [
aoqi@0 260 BUILD_OUTPUT="$OUTPUT_ROOT"
aoqi@0 261 AC_SUBST(BUILD_OUTPUT)
aoqi@0 262
aoqi@0 263 HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
aoqi@0 264 BUILD_HOTSPOT=true
aoqi@0 265 AC_SUBST(HOTSPOT_DIST)
aoqi@0 266 AC_SUBST(BUILD_HOTSPOT)
aoqi@0 267 AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot],
aoqi@0 268 [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])])
aoqi@0 269 if test "x$with_import_hotspot" != x; then
aoqi@0 270 CURDIR="$PWD"
aoqi@0 271 cd "$with_import_hotspot"
aoqi@0 272 HOTSPOT_DIST="`pwd`"
aoqi@0 273 cd "$CURDIR"
aoqi@0 274 if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
aoqi@0 275 AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!])
aoqi@0 276 fi
aoqi@0 277 AC_MSG_CHECKING([if hotspot should be imported])
aoqi@0 278 AC_MSG_RESULT([yes from $HOTSPOT_DIST])
aoqi@0 279 BUILD_HOTSPOT=false
aoqi@0 280 fi
aoqi@0 281
aoqi@0 282 JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
aoqi@0 283 ])

mercurial