source-dirs.m4 revision 793:64f52ef175a4
1260067Skargl# 2260067Skargl# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 3260067Skargl# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4260067Skargl# 5260067Skargl# This code is free software; you can redistribute it and/or modify it 6260067Skargl# under the terms of the GNU General Public License version 2 only, as 7260067Skargl# published by the Free Software Foundation. Oracle designates this 8260067Skargl# particular file as subject to the "Classpath" exception as provided 9260067Skargl# by Oracle in the LICENSE file that accompanied this code. 10260067Skargl# 11260067Skargl# This code is distributed in the hope that it will be useful, but WITHOUT 12260067Skargl# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13260067Skargl# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14260067Skargl# version 2 for more details (a copy is included in the LICENSE file that 15260067Skargl# accompanied this code). 16260067Skargl# 17260067Skargl# You should have received a copy of the GNU General Public License version 18260067Skargl# 2 along with this work; if not, write to the Free Software Foundation, 19260067Skargl# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20260067Skargl# 21260067Skargl# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22260067Skargl# or visit www.oracle.com if you need additional information or have any 23260067Skargl# questions. 24260067Skargl# 25260067Skargl 26260067SkarglAC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS], 27260067Skargl[ 28260067Skargl 29260067Skargl# Where are the sources. Any of these can be overridden 30260067Skargl# using --with-override-corba and the likes. 31260067SkarglLANGTOOLS_TOPDIR="$SRC_ROOT/langtools" 32260067SkarglCORBA_TOPDIR="$SRC_ROOT/corba" 33260067SkarglJAXP_TOPDIR="$SRC_ROOT/jaxp" 34260067SkarglJAXWS_TOPDIR="$SRC_ROOT/jaxws" 35260067SkarglHOTSPOT_TOPDIR="$SRC_ROOT/hotspot" 36260067SkarglNASHORN_TOPDIR="$SRC_ROOT/nashorn" 37260067SkarglJDK_TOPDIR="$SRC_ROOT/jdk" 38260067SkarglAC_SUBST(LANGTOOLS_TOPDIR) 39260067SkarglAC_SUBST(CORBA_TOPDIR) 40260067SkarglAC_SUBST(JAXP_TOPDIR) 41260067SkarglAC_SUBST(JAXWS_TOPDIR) 42260067SkarglAC_SUBST(HOTSPOT_TOPDIR) 43260067SkarglAC_SUBST(NASHORN_TOPDIR) 44260067SkarglAC_SUBST(JDK_TOPDIR) 45260067Skargl]) 46260067Skargl 47260067Skargl 48260067SkarglAC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS], 49260067Skargl[ 50260067Skargl 51260067Skargl############################################################################### 52260067Skargl# 53260067Skargl# Pickup additional source for a component from outside of the source root 54260067Skargl# or override source for a component. 55260067Skargl# 56260067SkarglAC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], 57260067Skargl [for each and every source directory, look in this additional source root for 58260067Skargl the same directory; if it exists and have files in it, include it in the build])]) 59260067Skargl 60260067SkarglAC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], 61260067Skargl [for each and every source directory, look in this override source root for 62260067Skargl the same directory; if it exists, use that directory instead and 63260067Skargl ignore the directory in the original source root])]) 64260067Skargl 65260067SkarglAC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], 66260067Skargl [use the subdirs 'adds' and 'overrides' in the specified directory as 67260067Skargl add-source-root and override-source-root])]) 68260067Skargl 69260067Skarglif test "x$with_adds_and_overrides" != x; then 70260067Skargl with_add_source_root="$with_adds_and_overrides/adds" 71260067Skargl with_override_source_root="$with_adds_and_overrides/overrides" 72260067Skarglfi 73260067Skargl 74260067Skarglif test "x$with_add_source_root" != x; then 75260067Skargl if ! test -d $with_add_source_root; then 76260067Skargl AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) 77260067Skargl fi 78260067Skargl CURDIR="$PWD" 79260067Skargl cd "$with_add_source_root" 80271779Stijl ADD_SRC_ROOT="`pwd`" 81260067Skargl cd "$CURDIR" 82260067Skargl # Verify that the addon source root does not have any root makefiles. 83260067Skargl # If it does, then it is usually an error, prevent this. 84260067Skargl if test -f $with_add_source_root/langtools/makefiles/Makefile || \ 85260067Skargl test -f $with_add_source_root/langtools/make/Makefile; then 86260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) 87260067Skargl fi 88260067Skargl if test -f $with_add_source_root/corba/makefiles/Makefile || \ 89260067Skargl test -f $with_add_source_root/corba/make/Makefile; then 90260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) 91260067Skargl fi 92260067Skargl if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ 93260067Skargl test -f $with_add_source_root/jaxp/make/Makefile; then 94260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) 95260067Skargl fi 96260067Skargl if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ 97260067Skargl test -f $with_add_source_root/jaxws/make/Makefile; then 98260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) 99260067Skargl fi 100260067Skargl if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ 101260067Skargl test -f $with_add_source_root/hotspot/make/Makefile; then 102260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) 103260067Skargl fi 104260067Skargl if test -f $with_add_source_root/nashorn/makefiles/Makefile || \ 105260067Skargl test -f $with_add_source_root/nashorn/make/Makefile; then 106260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources.]) 107260067Skargl fi 108260067Skargl if test -f $with_add_source_root/jdk/makefiles/Makefile || \ 109260067Skargl test -f $with_add_source_root/jdk/make/Makefile; then 110260067Skargl AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) 111260067Skargl fi 112260067Skarglfi 113260067SkarglAC_SUBST(ADD_SRC_ROOT) 114260067Skargl 115260067Skarglif test "x$with_override_source_root" != x; then 116260067Skargl if ! test -d $with_override_source_root; then 117260067Skargl AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) 118260067Skargl fi 119260067Skargl CURDIR="$PWD" 120260067Skargl cd "$with_override_source_root" 121260067Skargl OVERRIDE_SRC_ROOT="`pwd`" 122260067Skargl cd "$CURDIR" 123260067Skargl if test -f $with_override_source_root/langtools/makefiles/Makefile || \ 124260067Skargl test -f $with_override_source_root/langtools/make/Makefile; then 125260067Skargl AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.]) 126260067Skargl fi 127260067Skargl if test -f $with_override_source_root/corba/makefiles/Makefile || \ 128260067Skargl test -f $with_override_source_root/corba/make/Makefile; then 129260067Skargl AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.]) 130260067Skargl fi 131260067Skargl if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ 132 test -f $with_override_source_root/jaxp/make/Makefile; then 133 AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.]) 134 fi 135 if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ 136 test -f $with_override_source_root/jaxws/make/Makefile; then 137 AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.]) 138 fi 139 if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ 140 test -f $with_override_source_root/hotspot/make/Makefile; then 141 AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.]) 142 fi 143 if test -f $with_override_source_root/nashorn/makefiles/Makefile || \ 144 test -f $with_override_source_root/nashorn/make/Makefile; then 145 AC_MSG_ERROR([Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override.]) 146 fi 147 if test -f $with_override_source_root/jdk/makefiles/Makefile || \ 148 test -f $with_override_source_root/jdk/make/Makefile; then 149 AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.]) 150 fi 151fi 152AC_SUBST(OVERRIDE_SRC_ROOT) 153 154############################################################################### 155# 156# Override a repo completely, this is used for example when you have 3 small 157# development sandboxes of the langtools sources and want to avoid having 3 full 158# OpenJDK sources checked out on disk. 159# 160# Assuming that the 3 langtools sandboxes are located here: 161# /home/fredrik/sandbox1/langtools 162# /home/fredrik/sandbox2/langtools 163# /home/fredrik/sandbox3/langtools 164# 165# From the source root you create build subdirs manually: 166# mkdir -p build1 build2 build3 167# in each build directory run: 168# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) 169# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) 170# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) 171# 172 173AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], 174 [use this langtools dir for the build])]) 175 176AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], 177 [use this corba dir for the build])]) 178 179AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], 180 [use this jaxp dir for the build])]) 181 182AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], 183 [use this jaxws dir for the build])]) 184 185AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], 186 [use this hotspot dir for the build])]) 187 188AC_ARG_WITH(override-nashorn, [AS_HELP_STRING([--with-override-nashorn], 189 [use this nashorn dir for the build])]) 190 191AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], 192 [use this jdk dir for the build])]) 193 194if test "x$with_override_langtools" != x; then 195 CURDIR="$PWD" 196 cd "$with_override_langtools" 197 LANGTOOLS_TOPDIR="`pwd`" 198 cd "$CURDIR" 199 if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then 200 AC_MSG_ERROR([You have to override langtools with a full langtools repo!]) 201 fi 202 AC_MSG_CHECKING([if langtools should be overridden]) 203 AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR]) 204fi 205if test "x$with_override_corba" != x; then 206 CURDIR="$PWD" 207 cd "$with_override_corba" 208 CORBA_TOPDIR="`pwd`" 209 cd "$CURDIR" 210 if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then 211 AC_MSG_ERROR([You have to override corba with a full corba repo!]) 212 fi 213 AC_MSG_CHECKING([if corba should be overridden]) 214 AC_MSG_RESULT([yes with $CORBA_TOPDIR]) 215fi 216if test "x$with_override_jaxp" != x; then 217 CURDIR="$PWD" 218 cd "$with_override_jaxp" 219 JAXP_TOPDIR="`pwd`" 220 cd "$CURDIR" 221 if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then 222 AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!]) 223 fi 224 AC_MSG_CHECKING([if jaxp should be overridden]) 225 AC_MSG_RESULT([yes with $JAXP_TOPDIR]) 226fi 227if test "x$with_override_jaxws" != x; then 228 CURDIR="$PWD" 229 cd "$with_override_jaxws" 230 JAXWS_TOPDIR="`pwd`" 231 cd "$CURDIR" 232 if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then 233 AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!]) 234 fi 235 AC_MSG_CHECKING([if jaxws should be overridden]) 236 AC_MSG_RESULT([yes with $JAXWS_TOPDIR]) 237fi 238if test "x$with_override_hotspot" != x; then 239 CURDIR="$PWD" 240 cd "$with_override_hotspot" 241 HOTSPOT_TOPDIR="`pwd`" 242 cd "$CURDIR" 243 if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ 244 ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then 245 AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!]) 246 fi 247 AC_MSG_CHECKING([if hotspot should be overridden]) 248 AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR]) 249fi 250if test "x$with_override_nashorn" != x; then 251 CURDIR="$PWD" 252 cd "$with_override_nashorn" 253 NASHORN_TOPDIR="`pwd`" 254 cd "$CURDIR" 255 if ! test -f $NASHORN_TOPDIR/makefiles/Makefile; then 256 AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!]) 257 fi 258 AC_MSG_CHECKING([if nashorn should be overridden]) 259 AC_MSG_RESULT([yes with $NASHORN_TOPDIR]) 260fi 261if test "x$with_override_jdk" != x; then 262 CURDIR="$PWD" 263 cd "$with_override_jdk" 264 JDK_TOPDIR="`pwd`" 265 cd "$CURDIR" 266 if ! test -f $JDK_TOPDIR/makefiles/Makefile; then 267 AC_MSG_ERROR([You have to override JDK with a full JDK repo!]) 268 fi 269 AC_MSG_CHECKING([if JDK should be overridden]) 270 AC_MSG_RESULT([yes with $JDK_TOPDIR]) 271fi 272 273]) 274 275AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS], 276[ 277BUILD_OUTPUT="$OUTPUT_ROOT" 278AC_SUBST(BUILD_OUTPUT) 279 280HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" 281BUILD_HOTSPOT=true 282AC_SUBST(HOTSPOT_DIST) 283AC_SUBST(BUILD_HOTSPOT) 284AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot], 285 [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])]) 286if test "x$with_import_hotspot" != x; then 287 CURDIR="$PWD" 288 cd "$with_import_hotspot" 289 HOTSPOT_DIST="`pwd`" 290 cd "$CURDIR" 291 if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then 292 AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!]) 293 fi 294 AC_MSG_CHECKING([if hotspot should be imported]) 295 AC_MSG_RESULT([yes from $HOTSPOT_DIST]) 296 BUILD_HOTSPOT=false 297fi 298 299JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" 300]) 301