common/autoconf/source-dirs.m4

Mon, 25 Feb 2013 15:08:11 -0800

author
jjg
date
Mon, 25 Feb 2013 15:08:11 -0800
changeset 645
5b0b6ef58dbf
parent 506
78bb27faf889
child 795
64f52ef175a4
permissions
-rw-r--r--

8008914: Add nashorn to the tl build
Reviewed-by: mr, tbell, jjh
Contributed-by: erik.joelsson@oracle.com, james.laskey@oracle.com

     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 #
    26 AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS],
    27 [
    29 # Where are the sources. Any of these can be overridden
    30 # using --with-override-corba and the likes.
    31 LANGTOOLS_TOPDIR="$SRC_ROOT/langtools"
    32 CORBA_TOPDIR="$SRC_ROOT/corba"
    33 JAXP_TOPDIR="$SRC_ROOT/jaxp"
    34 JAXWS_TOPDIR="$SRC_ROOT/jaxws"
    35 HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
    36 NASHORN_TOPDIR="$SRC_ROOT/nashorn"
    37 JDK_TOPDIR="$SRC_ROOT/jdk"
    38 AC_SUBST(LANGTOOLS_TOPDIR)
    39 AC_SUBST(CORBA_TOPDIR)
    40 AC_SUBST(JAXP_TOPDIR)
    41 AC_SUBST(JAXWS_TOPDIR)
    42 AC_SUBST(HOTSPOT_TOPDIR)
    43 AC_SUBST(NASHORN_TOPDIR)
    44 AC_SUBST(JDK_TOPDIR)
    45 ])
    48 AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
    49 [
    51 ###############################################################################
    52 #
    53 # Pickup additional source for a component from outside of the source root
    54 # or override source for a component. 
    55 #
    56 AC_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])])                             
    60 AC_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])])
    65 AC_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])])
    69 if 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"
    72 fi
    74 if 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
   108 fi
   109 AC_SUBST(ADD_SRC_ROOT)
   111 if 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
   143 fi
   144 AC_SUBST(OVERRIDE_SRC_ROOT)
   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 #
   165 AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools],
   166     [use this langtools dir for the build])])
   168 AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba],
   169     [use this corba dir for the build])])
   171 AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp],
   172 	[use this jaxp dir for the build])])
   174 AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws],
   175 	[use this jaxws dir for the build])])
   177 AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot],
   178 	[use this hotspot dir for the build])])
   180 AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk],
   181 	[use this jdk dir for the build])])
   183 if 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])
   193 fi    
   194 if 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])
   204 fi    
   205 if 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])
   215 fi    
   216 if 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])
   226 fi    
   227 if 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])
   238 fi
   239 if 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])
   249 fi
   250 if 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])
   260 fi    
   262 ])
   264 AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
   265 [
   266 BUILD_OUTPUT="$OUTPUT_ROOT"
   267 AC_SUBST(BUILD_OUTPUT)
   269 HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
   270 BUILD_HOTSPOT=true
   271 AC_SUBST(HOTSPOT_DIST)
   272 AC_SUBST(BUILD_HOTSPOT)
   273 AC_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])])
   275 if 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
   286 fi
   288 JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
   289 ])

mercurial