1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/common/autoconf/source-dirs.m4 Thu Jul 05 18:27:07 2012 -0700 1.3 @@ -0,0 +1,280 @@ 1.4 +# 1.5 +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. Oracle designates this 1.11 +# particular file as subject to the "Classpath" exception as provided 1.12 +# by Oracle in the LICENSE file that accompanied this code. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 +# or visit www.oracle.com if you need additional information or have any 1.26 +# questions. 1.27 +# 1.28 + 1.29 +AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS], 1.30 +[ 1.31 + 1.32 +# Where are the sources. Any of these can be overridden 1.33 +# using --with-override-corba and the likes. 1.34 +LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" 1.35 +CORBA_TOPDIR="$SRC_ROOT/corba" 1.36 +JAXP_TOPDIR="$SRC_ROOT/jaxp" 1.37 +JAXWS_TOPDIR="$SRC_ROOT/jaxws" 1.38 +HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" 1.39 +JDK_TOPDIR="$SRC_ROOT/jdk" 1.40 +AC_SUBST(LANGTOOLS_TOPDIR) 1.41 +AC_SUBST(CORBA_TOPDIR) 1.42 +AC_SUBST(JAXP_TOPDIR) 1.43 +AC_SUBST(JAXWS_TOPDIR) 1.44 +AC_SUBST(HOTSPOT_TOPDIR) 1.45 +AC_SUBST(JDK_TOPDIR) 1.46 +]) 1.47 + 1.48 + 1.49 +AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS], 1.50 +[ 1.51 + 1.52 +############################################################################### 1.53 +# 1.54 +# Pickup additional source for a component from outside of the source root 1.55 +# or override source for a component. 1.56 +# 1.57 +AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], 1.58 + [for each and every source directory, look in this additional source root for 1.59 + the same directory; if it exists and have files in it, include it in the build])]) 1.60 + 1.61 +AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], 1.62 + [for each and every source directory, look in this override source root for 1.63 + the same directory; if it exists, use that directory instead and 1.64 + ignore the directory in the original source root])]) 1.65 + 1.66 +AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], 1.67 + [use the subdirs 'adds' and 'overrides' in the specified directory as 1.68 + add-source-root and override-source-root])]) 1.69 + 1.70 +if test "x$with_adds_and_overrides" != x; then 1.71 + with_add_source_root="$with_adds_and_overrides/adds" 1.72 + with_override_source_root="$with_adds_and_overrides/overrides" 1.73 +fi 1.74 + 1.75 +if test "x$with_add_source_root" != x; then 1.76 + if ! test -d $with_add_source_root; then 1.77 + AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) 1.78 + fi 1.79 + CURDIR="$PWD" 1.80 + cd "$with_add_source_root" 1.81 + ADD_SRC_ROOT="`pwd`" 1.82 + cd "$CURDIR" 1.83 + # Verify that the addon source root does not have any root makefiles. 1.84 + # If it does, then it is usually an error, prevent this. 1.85 + if test -f $with_add_source_root/langtools/makefiles/Makefile || \ 1.86 + test -f $with_add_source_root/langtools/make/Makefile; then 1.87 + AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) 1.88 + fi 1.89 + if test -f $with_add_source_root/corba/makefiles/Makefile || \ 1.90 + test -f $with_add_source_root/corba/make/Makefile; then 1.91 + AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) 1.92 + fi 1.93 + if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ 1.94 + test -f $with_add_source_root/jaxp/make/Makefile; then 1.95 + AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) 1.96 + fi 1.97 + if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ 1.98 + test -f $with_add_source_root/jaxws/make/Makefile; then 1.99 + AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) 1.100 + fi 1.101 + if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ 1.102 + test -f $with_add_source_root/hotspot/make/Makefile; then 1.103 + AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) 1.104 + fi 1.105 + if test -f $with_add_source_root/jdk/makefiles/Makefile || \ 1.106 + test -f $with_add_source_root/jdk/make/Makefile; then 1.107 + AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) 1.108 + fi 1.109 +fi 1.110 +AC_SUBST(ADD_SRC_ROOT) 1.111 + 1.112 +if test "x$with_override_source_root" != x; then 1.113 + if ! test -d $with_override_source_root; then 1.114 + AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) 1.115 + fi 1.116 + CURDIR="$PWD" 1.117 + cd "$with_override_source_root" 1.118 + OVERRIDE_SRC_ROOT="`pwd`" 1.119 + cd "$CURDIR" 1.120 + if test -f $with_override_source_root/langtools/makefiles/Makefile || \ 1.121 + test -f $with_override_source_root/langtools/make/Makefile; then 1.122 + AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.]) 1.123 + fi 1.124 + if test -f $with_override_source_root/corba/makefiles/Makefile || \ 1.125 + test -f $with_override_source_root/corba/make/Makefile; then 1.126 + AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.]) 1.127 + fi 1.128 + if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ 1.129 + test -f $with_override_source_root/jaxp/make/Makefile; then 1.130 + AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.]) 1.131 + fi 1.132 + if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ 1.133 + test -f $with_override_source_root/jaxws/make/Makefile; then 1.134 + AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.]) 1.135 + fi 1.136 + if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ 1.137 + test -f $with_override_source_root/hotspot/make/Makefile; then 1.138 + AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.]) 1.139 + fi 1.140 + if test -f $with_override_source_root/jdk/makefiles/Makefile || \ 1.141 + test -f $with_override_source_root/jdk/make/Makefile; then 1.142 + AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.]) 1.143 + fi 1.144 +fi 1.145 +AC_SUBST(OVERRIDE_SRC_ROOT) 1.146 + 1.147 +############################################################################### 1.148 +# 1.149 +# Override a repo completely, this is used for example when you have 3 small 1.150 +# development sandboxes of the langtools sources and want to avoid having 3 full 1.151 +# OpenJDK sources checked out on disk. 1.152 +# 1.153 +# Assuming that the 3 langtools sandboxes are located here: 1.154 +# /home/fredrik/sandbox1/langtools 1.155 +# /home/fredrik/sandbox2/langtools 1.156 +# /home/fredrik/sandbox3/langtools 1.157 +# 1.158 +# From the source root you create build subdirs manually: 1.159 +# mkdir -p build1 build2 build3 1.160 +# in each build directory run: 1.161 +# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) 1.162 +# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) 1.163 +# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) 1.164 +# 1.165 + 1.166 +AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], 1.167 + [use this langtools dir for the build])]) 1.168 + 1.169 +AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], 1.170 + [use this corba dir for the build])]) 1.171 + 1.172 +AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], 1.173 + [use this jaxp dir for the build])]) 1.174 + 1.175 +AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], 1.176 + [use this jaxws dir for the build])]) 1.177 + 1.178 +AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], 1.179 + [use this hotspot dir for the build])]) 1.180 + 1.181 +AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], 1.182 + [use this jdk dir for the build])]) 1.183 + 1.184 +if test "x$with_override_langtools" != x; then 1.185 + CURDIR="$PWD" 1.186 + cd "$with_override_langtools" 1.187 + LANGTOOLS_TOPDIR="`pwd`" 1.188 + cd "$CURDIR" 1.189 + if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then 1.190 + AC_MSG_ERROR([You have to override langtools with a full langtools repo!]) 1.191 + fi 1.192 + AC_MSG_CHECKING([if langtools should be overridden]) 1.193 + AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR]) 1.194 +fi 1.195 +if test "x$with_override_corba" != x; then 1.196 + CURDIR="$PWD" 1.197 + cd "$with_override_corba" 1.198 + CORBA_TOPDIR="`pwd`" 1.199 + cd "$CURDIR" 1.200 + if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then 1.201 + AC_MSG_ERROR([You have to override corba with a full corba repo!]) 1.202 + fi 1.203 + AC_MSG_CHECKING([if corba should be overridden]) 1.204 + AC_MSG_RESULT([yes with $CORBA_TOPDIR]) 1.205 +fi 1.206 +if test "x$with_override_jaxp" != x; then 1.207 + CURDIR="$PWD" 1.208 + cd "$with_override_jaxp" 1.209 + JAXP_TOPDIR="`pwd`" 1.210 + cd "$CURDIR" 1.211 + if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then 1.212 + AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!]) 1.213 + fi 1.214 + AC_MSG_CHECKING([if jaxp should be overridden]) 1.215 + AC_MSG_RESULT([yes with $JAXP_TOPDIR]) 1.216 +fi 1.217 +if test "x$with_override_jaxws" != x; then 1.218 + CURDIR="$PWD" 1.219 + cd "$with_override_jaxws" 1.220 + JAXWS_TOPDIR="`pwd`" 1.221 + cd "$CURDIR" 1.222 + if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then 1.223 + AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!]) 1.224 + fi 1.225 + AC_MSG_CHECKING([if jaxws should be overridden]) 1.226 + AC_MSG_RESULT([yes with $JAXWS_TOPDIR]) 1.227 +fi 1.228 +if test "x$with_override_hotspot" != x; then 1.229 + CURDIR="$PWD" 1.230 + cd "$with_override_hotspot" 1.231 + HOTSPOT_TOPDIR="`pwd`" 1.232 + cd "$CURDIR" 1.233 + if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ 1.234 + ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then 1.235 + AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!]) 1.236 + fi 1.237 + AC_MSG_CHECKING([if hotspot should be overridden]) 1.238 + AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR]) 1.239 +fi 1.240 +if test "x$with_override_jdk" != x; then 1.241 + CURDIR="$PWD" 1.242 + cd "$with_override_jdk" 1.243 + JDK_TOPDIR="`pwd`" 1.244 + cd "$CURDIR" 1.245 + if ! test -f $JDK_TOPDIR/makefiles/Makefile; then 1.246 + AC_MSG_ERROR([You have to override JDK with a full JDK repo!]) 1.247 + fi 1.248 + AC_MSG_CHECKING([if JDK should be overridden]) 1.249 + AC_MSG_RESULT([yes with $JDK_TOPDIR]) 1.250 +fi 1.251 + 1.252 +]) 1.253 + 1.254 +AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS], 1.255 +[ 1.256 +LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools" 1.257 +CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba" 1.258 +JAXP_OUTPUTDIR="$OUTPUT_ROOT/jaxp" 1.259 +JAXWS_OUTPUTDIR="$OUTPUT_ROOT/jaxws" 1.260 +HOTSPOT_OUTPUTDIR="$OUTPUT_ROOT/hotspot" 1.261 +JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" 1.262 +IMAGES_OUTPUTDIR="$OUTPUT_ROOT/images" 1.263 + 1.264 +AC_SUBST(LANGTOOLS_OUTPUTDIR) 1.265 +AC_SUBST(CORBA_OUTPUTDIR) 1.266 +AC_SUBST(JAXP_OUTPUTDIR) 1.267 +AC_SUBST(JAXWS_OUTPUTDIR) 1.268 +AC_SUBST(HOTSPOT_OUTPUTDIR) 1.269 +AC_SUBST(JDK_OUTPUTDIR) 1.270 +AC_SUBST(IMAGES_OUTPUTDIR) 1.271 + 1.272 +LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist" 1.273 +CORBA_DIST="$OUTPUT_ROOT/corba/dist" 1.274 +JAXP_DIST="$OUTPUT_ROOT/jaxp/dist" 1.275 +JAXWS_DIST="$OUTPUT_ROOT/jaxws/dist" 1.276 +HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" 1.277 + 1.278 +AC_SUBST(LANGTOOLS_DIST) 1.279 +AC_SUBST(CORBA_DIST) 1.280 +AC_SUBST(JAXP_DIST) 1.281 +AC_SUBST(JAXWS_DIST) 1.282 +AC_SUBST(HOTSPOT_DIST) 1.283 +])