jdk-options.m4 revision 1929:a2a3930ed7c3
1139825Simp#
290643Sbenno# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
390643Sbenno# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
490643Sbenno#
590643Sbenno# This code is free software; you can redistribute it and/or modify it
690643Sbenno# under the terms of the GNU General Public License version 2 only, as
790643Sbenno# published by the Free Software Foundation.  Oracle designates this
890643Sbenno# particular file as subject to the "Classpath" exception as provided
990643Sbenno# by Oracle in the LICENSE file that accompanied this code.
1090643Sbenno#
1190643Sbenno# This code is distributed in the hope that it will be useful, but WITHOUT
1290643Sbenno# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1390643Sbenno# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1490643Sbenno# version 2 for more details (a copy is included in the LICENSE file that
1590643Sbenno# accompanied this code).
1690643Sbenno#
1790643Sbenno# You should have received a copy of the GNU General Public License version
1890643Sbenno# 2 along with this work; if not, write to the Free Software Foundation,
1990643Sbenno# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2090643Sbenno#
2190643Sbenno# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2290643Sbenno# or visit www.oracle.com if you need additional information or have any
2390643Sbenno# questions.
2490643Sbenno#
2590643Sbenno
2690643Sbenno###############################################################################
2790643Sbenno# Check which variant of the JDK that we want to build.
2890643Sbenno# Currently we have:
2990643Sbenno#    normal:   standard edition
3090643Sbenno# but the custom make system may add other variants
3190643Sbenno#
3290643Sbenno# Effectively the JDK variant gives a name to a specific set of
3390643Sbenno# modules to compile into the JDK.
3490643SbennoAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
3590643Sbenno[
36139825Simp  AC_MSG_CHECKING([which variant of the JDK to build])
3777957Sbenno  AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
3877957Sbenno      [JDK variant to build (normal) @<:@normal@:>@])])
3977957Sbenno
4077957Sbenno  if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
4177957Sbenno    JDK_VARIANT="normal"
4277957Sbenno  else
4377957Sbenno    AC_MSG_ERROR([The available JDK variants are: normal])
4477957Sbenno  fi
4577957Sbenno
4677957Sbenno  AC_SUBST(JDK_VARIANT)
4777957Sbenno
4877957Sbenno  AC_MSG_RESULT([$JDK_VARIANT])
4977957Sbenno])
5077957Sbenno
5177957Sbenno###############################################################################
5277957Sbenno# Set the debug level
5377957Sbenno#    release: no debug information, all optimizations, no asserts.
5477957Sbenno#    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
5577957Sbenno#    fastdebug: debug information (-g), all optimizations, all asserts
5677957Sbenno#    slowdebug: debug information (-g), no optimizations, all asserts
5777957SbennoAC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
5877957Sbenno[
5977957Sbenno  DEBUG_LEVEL="release"
6077957Sbenno  AC_MSG_CHECKING([which debug level to use])
6177957Sbenno  AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
6277957Sbenno      [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
6377957Sbenno      [
6477957Sbenno        ENABLE_DEBUG="${enableval}"
6577957Sbenno        DEBUG_LEVEL="fastdebug"
6678880Sbenno      ], [ENABLE_DEBUG="no"])
6777957Sbenno
68139825Simp  AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
6977957Sbenno      [set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
7077957Sbenno      [
7177957Sbenno        DEBUG_LEVEL="${withval}"
7277957Sbenno        if test "x$ENABLE_DEBUG" = xyes; then
7377957Sbenno          AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
7477957Sbenno        fi
7577957Sbenno      ])
7677957Sbenno  AC_MSG_RESULT([$DEBUG_LEVEL])
7777957Sbenno
7877957Sbenno  if test "x$DEBUG_LEVEL" != xrelease && \
7977957Sbenno      test "x$DEBUG_LEVEL" != xoptimized && \
8077957Sbenno      test "x$DEBUG_LEVEL" != xfastdebug && \
8177957Sbenno      test "x$DEBUG_LEVEL" != xslowdebug; then
8277957Sbenno    AC_MSG_ERROR([Allowed debug levels are: release, fastdebug, slowdebug and optimized])
8377957Sbenno  fi
8477957Sbenno])
8577957Sbenno
8677957Sbenno###############################################################################
8777957Sbenno#
8877957Sbenno# Should we build only OpenJDK even if closed sources are present?
8977957Sbenno#
9077957SbennoAC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
9177957Sbenno[
9277957Sbenno  AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
93113038Sobrien      [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
94113038Sobrien
9577957Sbenno  AC_MSG_CHECKING([for presence of closed sources])
9690643Sbenno  if test -d "$SRC_ROOT/jdk/src/closed"; then
9790643Sbenno    CLOSED_SOURCE_PRESENT=yes
9890643Sbenno  else
9990643Sbenno    CLOSED_SOURCE_PRESENT=no
10090643Sbenno  fi
10190643Sbenno  AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
10290643Sbenno
10390643Sbenno  AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
10490643Sbenno  SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
10590643Sbenno  AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
10690643Sbenno
10790643Sbenno  if test "x$CLOSED_SOURCE_PRESENT" = xno; then
10890643Sbenno    OPENJDK=true
10990643Sbenno    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
11090643Sbenno      AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
11190643Sbenno    fi
112118239Speter  else
113118239Speter    if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
11477957Sbenno      OPENJDK=true
11580431Speter    else
116222813Sattilio      OPENJDK=false
117222813Sattilio    fi
11890643Sbenno  fi
11990643Sbenno
12090643Sbenno  if test "x$OPENJDK" = "xtrue"; then
12190643Sbenno    SET_OPENJDK="OPENJDK=true"
12277957Sbenno  fi
123238159Salc
124222813Sattilio  AC_SUBST(SET_OPENJDK)
12590643Sbenno
12690643Sbenno  # custom-make-dir is deprecated. Please use your custom-hook.m4 to override
12777957Sbenno  # the IncludeCustomExtension macro.
12877957Sbenno  BASIC_DEPRECATED_ARG_WITH(custom-make-dir)
12990643Sbenno])
13090643Sbenno
131152180SgrehanAC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
13277957Sbenno[
13377957Sbenno  # Should we build a JDK/JVM with headful support (ie a graphical ui)?
13477957Sbenno  # We always build headless support.
13577957Sbenno  AC_MSG_CHECKING([headful support])
13677957Sbenno  AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
13777957Sbenno      [disable building headful support (graphical UI support) @<:@enabled@:>@])],
13877957Sbenno      [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
13992847Sjeff
14077957Sbenno  SUPPORT_HEADLESS=yes
141125687Sgrehan  BUILD_HEADLESS="BUILD_HEADLESS:=true"
142192067Snwhitehorn
14383730Smp  if test "x$SUPPORT_HEADFUL" = xyes; then
14490643Sbenno    # We are building both headful and headless.
14590643Sbenno    headful_msg="include support for both headful and headless"
14690643Sbenno  fi
14777957Sbenno
148178628Smarcel  if test "x$SUPPORT_HEADFUL" = xno; then
14990643Sbenno    # Thus we are building headless only.
150152180Sgrehan    BUILD_HEADLESS="BUILD_HEADLESS:=true"
151228609Snwhitehorn    headful_msg="headless only"
15277957Sbenno  fi
153152180Sgrehan
15477957Sbenno  AC_MSG_RESULT([$headful_msg])
155152180Sgrehan
156152180Sgrehan  AC_SUBST(SUPPORT_HEADLESS)
15790643Sbenno  AC_SUBST(SUPPORT_HEADFUL)
15877957Sbenno  AC_SUBST(BUILD_HEADLESS)
15990643Sbenno
16090643Sbenno  # Choose cacerts source file
16190643Sbenno  AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
16290643Sbenno      [specify alternative cacerts file])])
16390643Sbenno  if test "x$with_cacerts_file" != x; then
16490643Sbenno    CACERTS_FILE=$with_cacerts_file
16590643Sbenno  fi
16690643Sbenno  AC_SUBST(CACERTS_FILE)
16790643Sbenno
16890643Sbenno  # Enable or disable unlimited crypto
16977957Sbenno  AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
170249864Sjhibbits      [Enable unlimited crypto policy @<:@disabled@:>@])],,
171249864Sjhibbits      [enable_unlimited_crypto=no])
172249864Sjhibbits  if test "x$enable_unlimited_crypto" = "xyes"; then
173249864Sjhibbits    UNLIMITED_CRYPTO=true
174249864Sjhibbits  else
17590643Sbenno    UNLIMITED_CRYPTO=false
17690643Sbenno  fi
17790643Sbenno  AC_SUBST(UNLIMITED_CRYPTO)
17897346Sbenno
17997346Sbenno  # Should we build the serviceability agent (SA)?
180209975Snwhitehorn  INCLUDE_SA=true
181209975Snwhitehorn  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
182100319Sbenno    INCLUDE_SA=false
18377957Sbenno  fi
18490643Sbenno  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
185134535Salc    INCLUDE_SA=false
186134535Salc  fi
187152180Sgrehan  if test "x$OPENJDK_TARGET_OS" = xaix ; then
188212278Snwhitehorn    INCLUDE_SA=false
189134535Salc  fi
190183094Smarcel  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
191183094Smarcel    INCLUDE_SA=false
192183094Smarcel  fi
193134535Salc  AC_SUBST(INCLUDE_SA)
19490643Sbenno
19590643Sbenno  # Compress jars
196152180Sgrehan  COMPRESS_JARS=false
197152180Sgrehan
198152180Sgrehan  AC_SUBST(COMPRESS_JARS)
19977957Sbenno
20090643Sbenno  # Setup default copyright year. Mostly overridden when building close to a new year.
20190643Sbenno  AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
20290643Sbenno      [Set copyright year value for build @<:@current year@:>@])])
203152180Sgrehan  if test "x$with_copyright_year" = xyes; then
204152180Sgrehan    AC_MSG_ERROR([Copyright year must have a value])
205152180Sgrehan  elif test "x$with_copyright_year" != x; then
20677957Sbenno    COPYRIGHT_YEAR="$with_copyright_year"
207242534Sattilio  else
208238159Salc    COPYRIGHT_YEAR=`date +'%Y'`
209152180Sgrehan  fi
210152180Sgrehan  AC_SUBST(COPYRIGHT_YEAR)
21177957Sbenno])
21299037Sbenno
213152180Sgrehan###############################################################################
214152180Sgrehan#
21577957Sbenno# Enable or disable the elliptic curve crypto implementation
21690643Sbenno#
217152180SgrehanAC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
21877957Sbenno[
219152180Sgrehan  AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
22077957Sbenno
22190643Sbenno  if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
22290643Sbenno    ENABLE_INTREE_EC=yes
22390643Sbenno    AC_MSG_RESULT([yes])
224152180Sgrehan  else
225152180Sgrehan    ENABLE_INTREE_EC=no
226152180Sgrehan    AC_MSG_RESULT([no])
227152180Sgrehan  fi
228152180Sgrehan
229152180Sgrehan  AC_SUBST(ENABLE_INTREE_EC)
230152180Sgrehan])
231152180Sgrehan
23290643SbennoAC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
233152180Sgrehan[
234152180Sgrehan  #
235152180Sgrehan  # NATIVE_DEBUG_SYMBOLS
236152180Sgrehan  # This must be done after the toolchain is setup, since we're looking at objcopy.
237152180Sgrehan  #
23890643Sbenno  AC_MSG_CHECKING([what type of native debug symbols to use])
239152180Sgrehan  AC_ARG_WITH([native-debug-symbols],
240152180Sgrehan      [AS_HELP_STRING([--with-native-debug-symbols],
241152180Sgrehan      [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
242152180Sgrehan      [
243152180Sgrehan        if test "x$OPENJDK_TARGET_OS" = xaix; then
244152180Sgrehan          if test "x$withval" = xexternal || test "x$withval" = xzipped; then
24577957Sbenno            AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
24690643Sbenno          fi
247152180Sgrehan        fi
24890643Sbenno      ],
249152180Sgrehan      [
25077957Sbenno        if test "x$OPENJDK_TARGET_OS" = xaix; then
25190643Sbenno          # AIX doesn't support 'zipped' so use 'internal' as default
25290643Sbenno          with_native_debug_symbols="internal"
25390643Sbenno        else
254152180Sgrehan          if test "x$STATIC_BUILD" = xtrue; then
25577957Sbenno            with_native_debug_symbols="none"
25677957Sbenno          else
25790643Sbenno            with_native_debug_symbols="zipped"
25877957Sbenno          fi
259152180Sgrehan        fi
26090643Sbenno      ])
261152180Sgrehan  NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
262152180Sgrehan  AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
263152180Sgrehan
26490643Sbenno  if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
26590643Sbenno
26690643Sbenno    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
26790643Sbenno      if test "x$OBJCOPY" = x; then
268159303Salc        # enabling of enable-debug-symbols and can't find objcopy
269159303Salc        # this is an error
270152180Sgrehan        AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
271152180Sgrehan      fi
272208990Salc    fi
273152180Sgrehan
274152180Sgrehan    COMPILE_WITH_DEBUG_SYMBOLS=true
27590643Sbenno    COPY_DEBUG_SYMBOLS=true
276152180Sgrehan    ZIP_EXTERNAL_DEBUG_SYMBOLS=true
277152180Sgrehan
278152180Sgrehan    # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
279152180Sgrehan    DEBUG_BINARIES=false
280152180Sgrehan    STRIP_POLICY=min_strip
281152180Sgrehan
282248280Skib  elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
283248280Skib    COMPILE_WITH_DEBUG_SYMBOLS=false
284152180Sgrehan    COPY_DEBUG_SYMBOLS=false
285159303Salc    ZIP_EXTERNAL_DEBUG_SYMBOLS=false
286159303Salc
287159627Sups    DEBUG_BINARIES=false
288152180Sgrehan    STRIP_POLICY=no_strip
289152180Sgrehan  elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
290152180Sgrehan    COMPILE_WITH_DEBUG_SYMBOLS=true
291152180Sgrehan    COPY_DEBUG_SYMBOLS=false
292214617Salc    ZIP_EXTERNAL_DEBUG_SYMBOLS=false
293207155Salc
294238357Salc    # Hotspot legacy support, will turn on -g when COPY_DEBUG_SYMBOLS=false
295235936Sraj    DEBUG_BINARIES=true
296152180Sgrehan    STRIP_POLICY=no_strip
297173708Salc    STRIP=""
298152180Sgrehan
299152180Sgrehan  elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
300152180Sgrehan
301152180Sgrehan    if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
302152180Sgrehan      if test "x$OBJCOPY" = x; then
303152180Sgrehan        # enabling of enable-debug-symbols and can't find objcopy
304152180Sgrehan        # this is an error
305152180Sgrehan        AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
306160889Salc      fi
307152180Sgrehan    fi
308152180Sgrehan
309152180Sgrehan    COMPILE_WITH_DEBUG_SYMBOLS=true
310152180Sgrehan    COPY_DEBUG_SYMBOLS=true
311152180Sgrehan    ZIP_EXTERNAL_DEBUG_SYMBOLS=false
312190681Snwhitehorn
313152180Sgrehan    # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
314235936Sraj    DEBUG_BINARIES=false
315213307Snwhitehorn    STRIP_POLICY=min_strip
316152180Sgrehan  else
317235936Sraj    AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
318213307Snwhitehorn  fi
319235936Sraj
320213307Snwhitehorn  # --enable-debug-symbols is deprecated.
321235936Sraj  # Please use --with-native-debug-symbols=[internal,external,zipped] .
322198341Smarcel  BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
323249864Sjhibbits        [Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
324249864Sjhibbits
325249864Sjhibbits  # --enable-zip-debug-info is deprecated.
326152180Sgrehan  # Please use --with-native-debug-symbols=zipped .
327152180Sgrehan  BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
328152180Sgrehan                              [Please use --with-native-debug-symbols=zipped .])
329152180Sgrehan
330152180Sgrehan  AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
331248280Skib  AC_SUBST(COPY_DEBUG_SYMBOLS)
332152180Sgrehan  AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
333159303Salc
334152180Sgrehan  # Legacy values
335152180Sgrehan  AC_SUBST(DEBUG_BINARIES)
336152180Sgrehan  AC_SUBST(STRIP_POLICY)
337152180Sgrehan])
338152180Sgrehan
339214617Salc################################################################################
340207155Salc#
341152180Sgrehan# Gcov coverage data for hotspot
342152180Sgrehan#
343152180SgrehanAC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
344173708Salc[
345152180Sgrehan  AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
346152180Sgrehan      [enable native compilation with code coverage data@<:@disabled@:>@])])
347152180Sgrehan  GCOV_ENABLED="false"
348152180Sgrehan  if test "x$enable_native_coverage" = "xyes"; then
349152180Sgrehan    if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
350152180Sgrehan      AC_MSG_CHECKING([if native coverage is enabled])
351152180Sgrehan      AC_MSG_RESULT([yes])
352152180Sgrehan      GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
353160889Salc      GCOV_LDFLAGS="-fprofile-arcs"
354198341Smarcel      LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $GCOV_CFLAGS"
355152180Sgrehan      LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $GCOV_CFLAGS"
356152180Sgrehan      LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $GCOV_LDFLAGS"
357152180Sgrehan      CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
358152180Sgrehan      CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
359152180Sgrehan      CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
360213307Snwhitehorn      CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
361152180Sgrehan      LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
362152180Sgrehan      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
363152180Sgrehan      GCOV_ENABLED="true"
364190681Snwhitehorn    else
365213307Snwhitehorn      AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
366152180Sgrehan    fi
367152180Sgrehan  elif test "x$enable_native_coverage" = "xno"; then
368152180Sgrehan    AC_MSG_CHECKING([if native coverage is enabled])
369152180Sgrehan    AC_MSG_RESULT([no])
370213307Snwhitehorn  elif test "x$enable_native_coverage" != "x"; then
371152180Sgrehan    AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
372249864Sjhibbits  fi
373249864Sjhibbits
374152180Sgrehan  AC_SUBST(GCOV_ENABLED)
375152180Sgrehan])
376152180Sgrehan
377152180Sgrehan################################################################################
378212627Sgrehan#
379152180Sgrehan# Static build support.  When enabled will generate static
380213307Snwhitehorn# libraries instead of shared libraries for all JDK libs.
381213307Snwhitehorn#
382213307SnwhitehornAC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
383213307Snwhitehorn[
384213307Snwhitehorn  AC_ARG_ENABLE([static-build], [AS_HELP_STRING([--enable-static-build],
385212627Sgrehan    [enable static library build @<:@disabled@:>@])])
386213307Snwhitehorn  STATIC_BUILD=false
387213307Snwhitehorn  if test "x$enable_static_build" = "xyes"; then
388213307Snwhitehorn    AC_MSG_CHECKING([if static build is enabled])
389213307Snwhitehorn    AC_MSG_RESULT([yes])
390213307Snwhitehorn    if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then
391213307Snwhitehorn      AC_MSG_ERROR([--enable-static-build is only supported for macosx builds])
392213307Snwhitehorn    fi
393213307Snwhitehorn    STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
394213307Snwhitehorn    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $STATIC_BUILD_CFLAGS"
395213307Snwhitehorn    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $STATIC_BUILD_CFLAGS"
396213307Snwhitehorn    CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
397213307Snwhitehorn    CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
398213307Snwhitehorn    STATIC_BUILD=true
399213307Snwhitehorn  elif test "x$enable_static_build" = "xno"; then
400213307Snwhitehorn    AC_MSG_CHECKING([if static build is enabled])
401213307Snwhitehorn    AC_MSG_RESULT([no])
402213307Snwhitehorn  elif test "x$enable_static_build" != "x"; then
403213307Snwhitehorn    AC_MSG_ERROR([--enable-static-build can only be assigned "yes" or "no"])
404213307Snwhitehorn  fi
405213307Snwhitehorn
406213307Snwhitehorn  AC_SUBST(STATIC_BUILD)
407213307Snwhitehorn])
408213307Snwhitehorn