source-dirs.m4 revision 643:5b0b6ef58dbf
1# 2# Copyright (c) 2011, 2012, 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 26AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS], 27[ 28 29# Where are the sources. Any of these can be overridden 30# using --with-override-corba and the likes. 31LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" 32CORBA_TOPDIR="$SRC_ROOT/corba" 33JAXP_TOPDIR="$SRC_ROOT/jaxp" 34JAXWS_TOPDIR="$SRC_ROOT/jaxws" 35HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" 36NASHORN_TOPDIR="$SRC_ROOT/nashorn" 37JDK_TOPDIR="$SRC_ROOT/jdk" 38AC_SUBST(LANGTOOLS_TOPDIR) 39AC_SUBST(CORBA_TOPDIR) 40AC_SUBST(JAXP_TOPDIR) 41AC_SUBST(JAXWS_TOPDIR) 42AC_SUBST(HOTSPOT_TOPDIR) 43AC_SUBST(NASHORN_TOPDIR) 44AC_SUBST(JDK_TOPDIR) 45]) 46 47 48AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS], 49[ 50 51############################################################################### 52# 53# Pickup additional source for a component from outside of the source root 54# or override source for a component. 55# 56AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], 57 [for each and every source directory, look in this additional source root for 58 the same directory; if it exists and have files in it, include it in the build])]) 59 60AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], 61 [for each and every source directory, look in this override source root for 62 the same directory; if it exists, use that directory instead and 63 ignore the directory in the original source root])]) 64 65AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], 66 [use the subdirs 'adds' and 'overrides' in the specified directory as 67 add-source-root and override-source-root])]) 68 69if test "x$with_adds_and_overrides" != x; then 70 with_add_source_root="$with_adds_and_overrides/adds" 71 with_override_source_root="$with_adds_and_overrides/overrides" 72fi 73 74if test "x$with_add_source_root" != x; then 75 if ! test -d $with_add_source_root; then 76 AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) 77 fi 78 CURDIR="$PWD" 79 cd "$with_add_source_root" 80 ADD_SRC_ROOT="`pwd`" 81 cd "$CURDIR" 82 # Verify that the addon source root does not have any root makefiles. 83 # If it does, then it is usually an error, prevent this. 84 if test -f $with_add_source_root/langtools/makefiles/Makefile || \ 85 test -f $with_add_source_root/langtools/make/Makefile; then 86 AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) 87 fi 88 if test -f $with_add_source_root/corba/makefiles/Makefile || \ 89 test -f $with_add_source_root/corba/make/Makefile; then 90 AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) 91 fi 92 if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ 93 test -f $with_add_source_root/jaxp/make/Makefile; then 94 AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) 95 fi 96 if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ 97 test -f $with_add_source_root/jaxws/make/Makefile; then 98 AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) 99 fi 100 if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ 101 test -f $with_add_source_root/hotspot/make/Makefile; then 102 AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) 103 fi 104 if test -f $with_add_source_root/jdk/makefiles/Makefile || \ 105 test -f $with_add_source_root/jdk/make/Makefile; then 106 AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) 107 fi 108fi 109AC_SUBST(ADD_SRC_ROOT) 110 111if test "x$with_override_source_root" != x; then 112 if ! test -d $with_override_source_root; then 113 AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) 114 fi 115 CURDIR="$PWD" 116 cd "$with_override_source_root" 117 OVERRIDE_SRC_ROOT="`pwd`" 118 cd "$CURDIR" 119 if test -f $with_override_source_root/langtools/makefiles/Makefile || \ 120 test -f $with_override_source_root/langtools/make/Makefile; then 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.]) 122 fi 123 if test -f $with_override_source_root/corba/makefiles/Makefile || \ 124 test -f $with_override_source_root/corba/make/Makefile; then 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.]) 126 fi 127 if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ 128 test -f $with_override_source_root/jaxp/make/Makefile; then 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.]) 130 fi 131 if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ 132 test -f $with_override_source_root/jaxws/make/Makefile; then 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.]) 134 fi 135 if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ 136 test -f $with_override_source_root/hotspot/make/Makefile; then 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.]) 138 fi 139 if test -f $with_override_source_root/jdk/makefiles/Makefile || \ 140 test -f $with_override_source_root/jdk/make/Makefile; then 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.]) 142 fi 143fi 144AC_SUBST(OVERRIDE_SRC_ROOT) 145 146############################################################################### 147# 148# Override a repo completely, this is used for example when you have 3 small 149# development sandboxes of the langtools sources and want to avoid having 3 full 150# OpenJDK sources checked out on disk. 151# 152# Assuming that the 3 langtools sandboxes are located here: 153# /home/fredrik/sandbox1/langtools 154# /home/fredrik/sandbox2/langtools 155# /home/fredrik/sandbox3/langtools 156# 157# From the source root you create build subdirs manually: 158# mkdir -p build1 build2 build3 159# in each build directory run: 160# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) 161# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) 162# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) 163# 164 165AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], 166 [use this langtools dir for the build])]) 167 168AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], 169 [use this corba dir for the build])]) 170 171AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], 172 [use this jaxp dir for the build])]) 173 174AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], 175 [use this jaxws dir for the build])]) 176 177AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], 178 [use this hotspot dir for the build])]) 179 180AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], 181 [use this jdk dir for the build])]) 182 183if test "x$with_override_langtools" != x; then 184 CURDIR="$PWD" 185 cd "$with_override_langtools" 186 LANGTOOLS_TOPDIR="`pwd`" 187 cd "$CURDIR" 188 if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then 189 AC_MSG_ERROR([You have to override langtools with a full langtools repo!]) 190 fi 191 AC_MSG_CHECKING([if langtools should be overridden]) 192 AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR]) 193fi 194if test "x$with_override_corba" != x; then 195 CURDIR="$PWD" 196 cd "$with_override_corba" 197 CORBA_TOPDIR="`pwd`" 198 cd "$CURDIR" 199 if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then 200 AC_MSG_ERROR([You have to override corba with a full corba repo!]) 201 fi 202 AC_MSG_CHECKING([if corba should be overridden]) 203 AC_MSG_RESULT([yes with $CORBA_TOPDIR]) 204fi 205if test "x$with_override_jaxp" != x; then 206 CURDIR="$PWD" 207 cd "$with_override_jaxp" 208 JAXP_TOPDIR="`pwd`" 209 cd "$CURDIR" 210 if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then 211 AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!]) 212 fi 213 AC_MSG_CHECKING([if jaxp should be overridden]) 214 AC_MSG_RESULT([yes with $JAXP_TOPDIR]) 215fi 216if test "x$with_override_jaxws" != x; then 217 CURDIR="$PWD" 218 cd "$with_override_jaxws" 219 JAXWS_TOPDIR="`pwd`" 220 cd "$CURDIR" 221 if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then 222 AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!]) 223 fi 224 AC_MSG_CHECKING([if jaxws should be overridden]) 225 AC_MSG_RESULT([yes with $JAXWS_TOPDIR]) 226fi 227if test "x$with_override_hotspot" != x; then 228 CURDIR="$PWD" 229 cd "$with_override_hotspot" 230 HOTSPOT_TOPDIR="`pwd`" 231 cd "$CURDIR" 232 if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ 233 ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then 234 AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!]) 235 fi 236 AC_MSG_CHECKING([if hotspot should be overridden]) 237 AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR]) 238fi 239if test "x$with_override_nashorn" != x; then 240 CURDIR="$PWD" 241 cd "$with_override_nashorn" 242 NASHORN_TOPDIR="`pwd`" 243 cd "$CURDIR" 244 if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then 245 AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!]) 246 fi 247 AC_MSG_CHECKING([if nashorn should be overridden]) 248 AC_MSG_RESULT([yes with $NASHORN_TOPDIR]) 249fi 250if test "x$with_override_jdk" != x; then 251 CURDIR="$PWD" 252 cd "$with_override_jdk" 253 JDK_TOPDIR="`pwd`" 254 cd "$CURDIR" 255 if ! test -f $JDK_TOPDIR/makefiles/Makefile; then 256 AC_MSG_ERROR([You have to override JDK with a full JDK repo!]) 257 fi 258 AC_MSG_CHECKING([if JDK should be overridden]) 259 AC_MSG_RESULT([yes with $JDK_TOPDIR]) 260fi 261 262]) 263 264AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS], 265[ 266BUILD_OUTPUT="$OUTPUT_ROOT" 267AC_SUBST(BUILD_OUTPUT) 268 269HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" 270BUILD_HOTSPOT=true 271AC_SUBST(HOTSPOT_DIST) 272AC_SUBST(BUILD_HOTSPOT) 273AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot], 274 [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])]) 275if test "x$with_import_hotspot" != x; then 276 CURDIR="$PWD" 277 cd "$with_import_hotspot" 278 HOTSPOT_DIST="`pwd`" 279 cd "$CURDIR" 280 if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then 281 AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!]) 282 fi 283 AC_MSG_CHECKING([if hotspot should be imported]) 284 AC_MSG_RESULT([yes from $HOTSPOT_DIST]) 285 BUILD_HOTSPOT=false 286fi 287 288JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" 289]) 290