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