common/autoconf/libraries.m4
author dholmes
Thu, 24 Oct 2013 20:45:43 -0400
changeset 21055 d52217bb8e80
parent 20655 0cf466e2de61
child 21056 16245d19b19a
permissions -rw-r--r--
8016096: [macosx] jawt_md.h shipped with jdk is outdated Summary: Revised build system and added platform specific headers for Mac OS X Reviewed-by: ihse, erikj Contributed-by: david.dehaven@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     1
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     4
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    10
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    15
# accompanied this code).
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    16
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    20
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    23
# questions.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    24
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    25
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    26
AC_DEFUN_ONCE([LIB_SETUP_INIT],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    27
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    28
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    29
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    30
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    31
  # OS specific settings that we never will need to probe.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    32
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    33
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    34
    AC_MSG_CHECKING([what is not needed on Linux?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    35
    PULSE_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    36
    AC_MSG_RESULT([pulse])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    37
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    38
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    39
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    40
    AC_MSG_CHECKING([what is not needed on Solaris?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    41
    ALSA_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    42
    PULSE_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    43
    AC_MSG_RESULT([alsa pulse])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    44
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    45
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    46
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    47
    AC_MSG_CHECKING([what is not needed on Windows?])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    48
    CUPS_NOT_NEEDED=yes
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    49
    ALSA_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    50
    PULSE_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    51
    X11_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    52
    AC_MSG_RESULT([alsa cups pulse x11])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    53
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    54
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    55
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    56
    AC_MSG_CHECKING([what is not needed on MacOSX?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    57
    ALSA_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    58
    PULSE_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    59
    X11_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    60
    # If the java runtime framework is disabled, then we need X11.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    61
    # This will be adjusted below.
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
    62
    AC_MSG_RESULT([alsa pulse x11])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    63
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    64
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    65
  if test "x$OPENJDK_TARGET_OS" = xbsd; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    66
    AC_MSG_CHECKING([what is not needed on bsd?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    67
    ALSA_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    68
    AC_MSG_RESULT([alsa])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    69
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    70
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    71
  if test "x$OPENJDK" = "xfalse"; then
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
    72
    FREETYPE_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    73
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    74
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    75
  if test "x$SUPPORT_HEADFUL" = xno; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    76
    X11_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    77
  fi
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    78
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    79
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    80
  #
20649
47ddc69a25a7 8026864: Deprecate --disable-macosx-runtime-support.
ihse
parents: 20363
diff changeset
    81
  # Check for MacOSX support for OpenJDK.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    82
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    83
20649
47ddc69a25a7 8026864: Deprecate --disable-macosx-runtime-support.
ihse
parents: 20363
diff changeset
    84
  BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support)
47ddc69a25a7 8026864: Deprecate --disable-macosx-runtime-support.
ihse
parents: 20363
diff changeset
    85
47ddc69a25a7 8026864: Deprecate --disable-macosx-runtime-support.
ihse
parents: 20363
diff changeset
    86
  AC_MSG_CHECKING([for Mac OS X Java Framework])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    87
  if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
20649
47ddc69a25a7 8026864: Deprecate --disable-macosx-runtime-support.
ihse
parents: 20363
diff changeset
    88
    AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    89
  else
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    90
    AC_MSG_RESULT([no])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    91
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    92
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    93
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    94
AC_DEFUN_ONCE([LIB_SETUP_X11],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    95
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    96
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    97
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    98
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    99
  # Check for X Windows
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   100
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   101
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   102
  # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   103
  # Make a simple check for the libraries at the sysroot, and setup --x-includes and
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   104
  # --x-libraries for the sysroot, if that seems to be correct.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   105
  if test "x$SYS_ROOT" != "x/"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   106
    if test "x$x_includes" = xNONE; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   107
      if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   108
        x_includes="$SYS_ROOT/usr/X11R6/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   109
      elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   110
        x_includes="$SYS_ROOT/usr/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   111
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   112
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   113
    if test "x$x_libraries" = xNONE; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   114
      if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   115
        x_libraries="$SYS_ROOT/usr/X11R6/lib"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   116
      elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   117
        x_libraries="$SYS_ROOT/usr/lib64"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   118
      elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   119
        x_libraries="$SYS_ROOT/usr/lib"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   120
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   121
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   122
  fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   123
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   124
  # Now let autoconf do it's magic
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   125
  AC_PATH_X
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   126
  AC_PATH_XTRA
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   127
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   128
  # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   129
  # this doesn't make sense so we remove it.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   130
  if test "x$COMPILE_TYPE" = xcross; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   131
    X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   132
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   133
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   134
  if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   135
    HELP_MSG_MISSING_DEPENDENCY([x11])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   136
    AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   137
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   138
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   139
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   140
    OPENWIN_HOME="/usr/openwin"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   141
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   142
  AC_SUBST(OPENWIN_HOME)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   143
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   144
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   145
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   146
  # Weird Sol10 something check...TODO change to try compile
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   147
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   148
  if test "x${OPENJDK_TARGET_OS}" = xsolaris; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   149
    if test "`uname -r`" = "5.10"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   150
      if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   151
        X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   152
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   153
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   154
  fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   155
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   156
  AC_LANG_PUSH(C)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   157
  OLD_CFLAGS="$CFLAGS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   158
  CFLAGS="$CFLAGS $X_CFLAGS"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   159
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   160
  # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   161
  AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   162
      [X11_A_OK=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   163
      [X11_A_OK=no; break],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   164
      [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   165
        # include <X11/Xlib.h>
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   166
        # include <X11/Xutil.h>
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   167
      ]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   168
  )
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   169
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   170
  CFLAGS="$OLD_CFLAGS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   171
  AC_LANG_POP(C)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   172
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   173
  if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   174
    HELP_MSG_MISSING_DEPENDENCY([x11])
19524
51009a053562 8003162: build-infra: Improve suggestions for missing packages on linux
erikj
parents: 18021
diff changeset
   175
    AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   176
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   177
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   178
  AC_SUBST(X_CFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   179
  AC_SUBST(X_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   180
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   181
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   182
AC_DEFUN_ONCE([LIB_SETUP_CUPS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   183
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   184
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   185
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   186
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   187
  # The common unix printing system cups is used to print from java.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   188
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   189
  AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   190
      [specify prefix directory for the cups package
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   191
      (expecting the headers under PATH/include)])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   192
  AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   193
      [specify directory for the cups include files])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   194
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   195
  if test "x$CUPS_NOT_NEEDED" = xyes; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   196
    if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   197
      AC_MSG_WARN([cups not used, so --with-cups is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   198
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   199
    CUPS_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   200
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   201
    CUPS_FOUND=no
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   202
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   203
    if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   204
      AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   205
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   206
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   207
    if test "x${with_cups}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   208
      CUPS_CFLAGS="-I${with_cups}/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   209
      CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   210
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   211
    if test "x${with_cups_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   212
      CUPS_CFLAGS="-I${with_cups_include}"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   213
      CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   214
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   215
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   216
      BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   217
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   218
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   219
      # Are the cups headers installed in the default /usr/include location?
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   220
      AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   221
          [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   222
            CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   223
            CUPS_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   224
            DEFAULT_CUPS=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   225
          ]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   226
      )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   227
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   228
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   229
      # Getting nervous now? Lets poke around for standard Solaris third-party
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   230
      # package installation locations.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   231
      AC_MSG_CHECKING([for cups headers])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   232
      if test -s /opt/sfw/cups/include/cups/cups.h; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   233
        # An SFW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   234
        CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   235
        CUPS_CFLAGS="-I/opt/sfw/cups/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   236
      elif test -s /opt/csw/include/cups/cups.h; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   237
        # A CSW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   238
        CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   239
        CUPS_CFLAGS="-I/opt/csw/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   240
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   241
      AC_MSG_RESULT([$CUPS_FOUND])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   242
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   243
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   244
      HELP_MSG_MISSING_DEPENDENCY([cups])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   245
      AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   246
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   247
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   248
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   249
  AC_SUBST(CUPS_CFLAGS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   250
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   251
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   252
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   253
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   254
[
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   255
  POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   256
  POTENTIAL_FREETYPE_LIB_PATH="$2"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   257
  METHOD="$3"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   258
  
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   259
  # First check if the files exists.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   260
  if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   261
    # We found an arbitrary include file. That's a good sign.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   262
    AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   263
    FOUND_FREETYPE=yes
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   264
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   265
    FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   266
    if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   267
      AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   268
      FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   269
    else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   270
      if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   271
        # On Windows, we will need both .lib and .dll file.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   272
        if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   273
          AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   274
          FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   275
        fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   276
      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   277
        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   278
        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   279
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   280
    fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   281
  fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   282
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   283
  if test "x$FOUND_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   284
    BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   285
    BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   286
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   287
    FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   288
    AC_MSG_CHECKING([for freetype includes])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   289
    AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   290
    FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   291
    AC_MSG_CHECKING([for freetype libraries])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   292
    AC_MSG_RESULT([$FREETYPE_LIB_PATH])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   293
  fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   294
])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   295
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   296
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   297
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   298
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   299
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   300
  #
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   301
  # The ubiquitous freetype library is used to render fonts.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   302
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   303
  AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   304
      [specify prefix directory for the freetype package
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   305
      (expecting the libraries under PATH/lib and the headers under PATH/include)])])
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   306
  AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   307
      [specify directory for the freetype include files])])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   308
  AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   309
      [specify directory for the freetype library])])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   310
  AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   311
      [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   312
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   313
  FREETYPE_CFLAGS=
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   314
  FREETYPE_LIBS=
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   315
  FREETYPE_BUNDLE_LIB_PATH=
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   316
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   317
  if test "x$FREETYPE_NOT_NEEDED" = xyes; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   318
    if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   319
      AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   320
    fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   321
    if test "x$enable_freetype_bundling" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   322
      AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   323
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   324
  else
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   325
    # freetype is needed to build; go get it!
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   326
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   327
    BUNDLE_FREETYPE="$enable_freetype_bundling"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   328
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   329
    if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   330
      # User has specified settings
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   331
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   332
      if test "x$BUNDLE_FREETYPE" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   333
        # If not specified, default is to bundle freetype
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   334
        BUNDLE_FREETYPE=yes
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   335
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   336
      
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   337
      if test "x$with_freetype" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   338
        POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   339
        POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   340
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   341
      
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   342
      # Allow --with-freetype-lib and --with-freetype-include to override
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   343
      if test "x$with_freetype_include" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   344
        POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   345
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   346
      if test "x$with_freetype_lib" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   347
        POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   348
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   349
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   350
      if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   351
        # Okay, we got it. Check that it works.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   352
        LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   353
        if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   354
          AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   355
        fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   356
      else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   357
        # User specified only one of lib or include. This is an error.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   358
        if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   359
          AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   360
          AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   361
        else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   362
          AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   363
          AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   364
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   365
      fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   366
    else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   367
      # User did not specify settings, but we need freetype. Try to locate it.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   368
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   369
      if test "x$BUNDLE_FREETYPE" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   370
        # If not specified, default is to bundle freetype only on windows
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   371
        if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   372
          BUNDLE_FREETYPE=yes
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   373
        else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   374
          BUNDLE_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   375
        fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   376
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   377
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   378
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   379
        # Check builddeps
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   380
        BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   381
        # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   382
        if test "x$FOUND_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   383
          if test "x$BUNDLE_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   384
            AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   385
            FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   386
          else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   387
            AC_MSG_CHECKING([for freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   388
            AC_MSG_RESULT([yes (using builddeps)])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   389
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   390
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   391
      fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   392
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   393
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   394
        # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   395
        if test "x$PKG_CONFIG" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   396
          PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   397
          if test "x$FOUND_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   398
            # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   399
            FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   400
            # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   401
            if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   402
              FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   403
            fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   404
            # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   405
            if test "x$BUNDLE_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   406
              AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   407
              FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   408
            else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   409
              AC_MSG_CHECKING([for freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   410
              AC_MSG_RESULT([yes (using pkg-config)])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   411
            fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   412
          fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   413
        fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   414
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   415
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   416
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   417
        # Check in well-known locations
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   418
        if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   419
          FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   420
          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   421
          LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   422
          if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   423
            FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   424
            BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   425
            LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   426
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   427
        else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   428
          if test "x$SYS_ROOT" = "x/"; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   429
            FREETYPE_ROOT=
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   430
          else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   431
            FREETYPE_ROOT="$SYS_ROOT"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   432
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   433
          FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   434
          LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   435
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   436
          if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   437
            FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   438
            LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   439
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   440
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   441
          if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   442
            FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   443
            if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   444
              LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   445
            else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   446
              LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   447
              if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   448
                LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   449
              fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   450
            fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   451
          fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   452
        fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   453
      fi # end check in well-known locations
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   454
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   455
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   456
        HELP_MSG_MISSING_DEPENDENCY([freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   457
        AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   458
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   459
    fi # end user specified settings
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   460
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   461
    # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   462
    if test "x$FREETYPE_CFLAGS" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   463
      BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   464
      if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   465
        FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   466
      else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   467
        FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   468
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   469
    fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   470
    
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   471
    if test "x$FREETYPE_LIBS" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   472
      BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   473
      if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   474
        FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   475
      else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   476
        FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   477
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   478
    fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   479
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   480
    # Try to compile it
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   481
    AC_MSG_CHECKING([if we can compile and link with freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   482
    AC_LANG_PUSH(C++)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   483
    PREV_CXXCFLAGS="$CXXFLAGS"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   484
    PREV_LDFLAGS="$LDFLAGS"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   485
    PREV_CXX="$CXX"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   486
    CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" 
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   487
    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   488
    CXX="$FIXPATH $CXX"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   489
    AC_LINK_IFELSE([AC_LANG_SOURCE([[
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   490
          #include<ft2build.h>
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   491
          #include FT_FREETYPE_H
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   492
          int main () {
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   493
            FT_Init_FreeType(NULL);
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   494
            return 0;
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   495
          }
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   496
        ]])],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   497
        [
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   498
          AC_MSG_RESULT([yes])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   499
        ],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   500
        [
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   501
          AC_MSG_RESULT([no])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   502
          AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   503
          AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   504
          
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   505
          HELP_MSG_MISSING_DEPENDENCY([freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   506
          
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   507
          AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   508
        ]
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   509
    )
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   510
    CXXCFLAGS="$PREV_CXXFLAGS"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   511
    LDFLAGS="$PREV_LDFLAGS"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   512
    CXX="$PREV_CXX"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   513
    AC_LANG_POP(C++)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   514
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   515
    AC_MSG_CHECKING([if we should bundle freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   516
    if test "x$BUNDLE_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   517
      FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   518
    fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   519
    AC_MSG_RESULT([$BUNDLE_FREETYPE])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   520
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   521
  fi # end freetype needed
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   522
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   523
  AC_SUBST(FREETYPE_BUNDLE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   524
  AC_SUBST(FREETYPE_CFLAGS)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   525
  AC_SUBST(FREETYPE_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   526
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   527
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   528
AC_DEFUN_ONCE([LIB_SETUP_ALSA],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   529
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   530
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   531
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   532
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   533
  # Check for alsa headers and libraries. Used on Linux/GNU systems.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   534
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   535
  AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   536
      [specify prefix directory for the alsa package
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   537
      (expecting the libraries under PATH/lib and the headers under PATH/include)])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   538
  AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   539
      [specify directory for the alsa include files])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   540
  AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   541
      [specify directory for the alsa library])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   542
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   543
  if test "x$ALSA_NOT_NEEDED" = xyes; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   544
    if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   545
      AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   546
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   547
    ALSA_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   548
    ALSA_LIBS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   549
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   550
    ALSA_FOUND=no
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   551
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   552
    if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   553
      AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   554
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   555
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   556
    if test "x${with_alsa}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   557
      ALSA_LIBS="-L${with_alsa}/lib -lalsa"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   558
      ALSA_CFLAGS="-I${with_alsa}/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   559
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   560
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   561
    if test "x${with_alsa_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   562
      ALSA_CFLAGS="-I${with_alsa_include}"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   563
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   564
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   565
    if test "x${with_alsa_lib}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   566
      ALSA_LIBS="-L${with_alsa_lib} -lalsa"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   567
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   568
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   569
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   570
      BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   571
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   572
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   573
      PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   574
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   575
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   576
      AC_CHECK_HEADERS([alsa/asoundlib.h],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   577
          [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   578
            ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   579
            ALSA_CFLAGS=-Iignoreme
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   580
            ALSA_LIBS=-lasound
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   581
            DEFAULT_ALSA=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   582
          ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   583
          [ALSA_FOUND=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   584
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   585
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   586
      HELP_MSG_MISSING_DEPENDENCY([alsa])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   587
      AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   588
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   589
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   590
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   591
  AC_SUBST(ALSA_CFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   592
  AC_SUBST(ALSA_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   593
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   594
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   595
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   596
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   597
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   598
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   599
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   600
  # Check for the jpeg library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   601
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   602
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   603
  USE_EXTERNAL_LIBJPEG=true
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   604
  AC_CHECK_LIB(jpeg, main, [],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   605
      [ USE_EXTERNAL_LIBJPEG=false
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   606
      AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   607
  ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   608
  AC_SUBST(USE_EXTERNAL_LIBJPEG)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   609
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   610
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   611
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   612
  # Check for the gif library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   613
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   614
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   615
  AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   616
      [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   617
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   618
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   619
  AC_MSG_CHECKING([for which giflib to use])
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   620
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   621
  # default is bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   622
  DEFAULT_GIFLIB=bundled
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   623
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   624
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   625
  # if user didn't specify, use DEFAULT_GIFLIB
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   626
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   627
  if test "x${with_giflib}" = "x"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   628
    with_giflib=${DEFAULT_GIFLIB}
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   629
  fi
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   630
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   631
  AC_MSG_RESULT(${with_giflib})
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   632
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   633
  if test "x${with_giflib}" = "xbundled"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   634
    USE_EXTERNAL_LIBGIF=false
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   635
  elif test "x${with_giflib}" = "xsystem"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   636
    AC_CHECK_HEADER(gif_lib.h, [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   637
        [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   638
    AC_CHECK_LIB(gif, DGifGetCode, [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   639
        [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   640
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   641
    USE_EXTERNAL_LIBGIF=true
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   642
  else
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   643
    AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   644
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   645
  AC_SUBST(USE_EXTERNAL_LIBGIF)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   646
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   647
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   648
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   649
  # Check for the zlib library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   650
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   651
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   652
  AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   653
      [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   654
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   655
  AC_CHECK_LIB(z, compress,
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   656
      [ ZLIB_FOUND=yes ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   657
      [ ZLIB_FOUND=no ])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   658
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   659
  AC_MSG_CHECKING([for which zlib to use])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   660
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   661
  DEFAULT_ZLIB=bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   662
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   663
    #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   664
    # On macosx default is system...on others default is
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   665
    #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   666
    DEFAULT_ZLIB=system
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   667
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   668
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   669
  if test "x${ZLIB_FOUND}" != "xyes"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   670
    #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   671
    # If we don't find any system...set default to bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   672
    #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   673
    DEFAULT_ZLIB=bundled
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   674
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   675
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   676
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   677
  # If user didn't specify, use DEFAULT_ZLIB
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   678
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   679
  if test "x${with_zlib}" = "x"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   680
    with_zlib=${DEFAULT_ZLIB}
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   681
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   682
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   683
  if test "x${with_zlib}" = "xbundled"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   684
    USE_EXTERNAL_LIBZ=false
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   685
    AC_MSG_RESULT([bundled])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   686
  elif test "x${with_zlib}" = "xsystem"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   687
    if test "x${ZLIB_FOUND}" = "xyes"; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   688
      USE_EXTERNAL_LIBZ=true
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   689
      AC_MSG_RESULT([system])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   690
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   691
      AC_MSG_RESULT([system not found])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   692
      AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   693
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   694
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   695
    AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   696
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   697
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   698
  AC_SUBST(USE_EXTERNAL_LIBZ)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   699
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   700
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   701
  LIBZIP_CAN_USE_MMAP=true
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   702
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   703
  AC_SUBST(LIBZIP_CAN_USE_MMAP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   704
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   705
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   706
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   707
  # Check if altzone exists in time.h
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   708
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   709
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   710
  AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   711
      [has_altzone=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   712
      [has_altzone=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   713
  if test "x$has_altzone" = xyes; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   714
    AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   715
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   716
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   717
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   718
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   719
  # Check the maths library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   720
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   721
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   722
  AC_CHECK_LIB(m, cos, [],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   723
      [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   724
        AC_MSG_NOTICE([Maths library was not found])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   725
      ]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   726
  )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   727
  AC_SUBST(LIBM)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   728
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   729
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   730
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   731
  # Check for libdl.so
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   732
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   733
  save_LIBS="$LIBS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   734
  LIBS=""
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   735
  AC_CHECK_LIB(dl,dlopen)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   736
  LIBDL="$LIBS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   737
  AC_SUBST(LIBDL)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   738
  LIBS="$save_LIBS"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   739
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   740
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   741
AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   742
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   743
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   744
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   745
  # statically link libstdc++ before C++ ABI is stablized on Linux unless
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   746
  # dynamic build is configured on command line.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   747
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   748
  AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   749
      [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   750
      [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   751
        if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   752
                && test "x$with_stdc__lib" != xdefault; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   753
          AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   754
        fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   755
      ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   756
      [with_stdc__lib=default]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   757
  )
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   758
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   759
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   760
    # Test if -lstdc++ works.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   761
    AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   762
    AC_LANG_PUSH(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   763
    OLD_CXXFLAGS="$CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   764
    CXXFLAGS="$CXXFLAGS -lstdc++"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   765
    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   766
        [has_dynamic_libstdcxx=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   767
        [has_dynamic_libstdcxx=no])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   768
    CXXFLAGS="$OLD_CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   769
    AC_LANG_POP(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   770
    AC_MSG_RESULT([$has_dynamic_libstdcxx])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   771
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   772
    # Test if stdc++ can be linked statically.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   773
    AC_MSG_CHECKING([if static link of stdc++ is possible])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   774
    STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   775
    AC_LANG_PUSH(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   776
    OLD_LIBS="$LIBS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   777
    OLD_CXX="$CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   778
    LIBS="$STATIC_STDCXX_FLAGS"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   779
    CXX="$CC"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   780
    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   781
        [has_static_libstdcxx=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   782
        [has_static_libstdcxx=no])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   783
    LIBS="$OLD_LIBS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   784
    CXX="$OLD_CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   785
    AC_LANG_POP(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   786
    AC_MSG_RESULT([$has_static_libstdcxx])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   787
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   788
    if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   789
      AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   790
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   791
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   792
    if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   793
      AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   794
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   795
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   796
    if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   797
      AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   798
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   799
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   800
    AC_MSG_CHECKING([how to link with libstdc++])
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   801
    # If dynamic was requested, it's available since it would fail above otherwise.
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   802
    # If dynamic wasn't requested, go with static unless it isn't available.
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   803
    if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   804
      LIBCXX="$LIBCXX -lstdc++"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   805
      LDCXX="$CXX"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   806
      STATIC_CXX_SETTING="STATIC_CXX=false"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   807
      AC_MSG_RESULT([dynamic])
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
   808
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   809
      LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   810
      LDCXX="$CC"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   811
      STATIC_CXX_SETTING="STATIC_CXX=true"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   812
      AC_MSG_RESULT([static])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   813
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   814
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   815
  AC_SUBST(STATIC_CXX_SETTING)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   816
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   817
  if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   818
    # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   819
    PKG_CHECK_MODULES([LIBFFI], [libffi])
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   820
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   821
  fi
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   822
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   823
  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   824
    AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config])
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   825
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   826
    if test "x$LLVM_CONFIG" != xllvm-config; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   827
      AC_MSG_ERROR([llvm-config not found in $PATH.])
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   828
    fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   829
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   830
    llvm_components="jit mcjit engine nativecodegen native"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   831
    unset LLVM_CFLAGS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   832
    for flag in $("$LLVM_CONFIG" --cxxflags); do
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   833
      if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   834
        if test "${flag}" != "-D_DEBUG" ; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   835
          if test "${LLVM_CFLAGS}" != "" ; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   836
            LLVM_CFLAGS="${LLVM_CFLAGS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   837
          fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   838
          LLVM_CFLAGS="${LLVM_CFLAGS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   839
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   840
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   841
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   842
    llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//')
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   843
    LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   844
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   845
    unset LLVM_LDFLAGS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   846
    for flag in $("${LLVM_CONFIG}" --ldflags); do
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   847
      if echo "${flag}" | grep -q '^-L'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   848
        if test "${LLVM_LDFLAGS}" != ""; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   849
          LLVM_LDFLAGS="${LLVM_LDFLAGS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   850
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   851
        LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   852
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   853
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   854
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   855
    unset LLVM_LIBS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   856
    for flag in $("${LLVM_CONFIG}" --libs ${llvm_components}); do
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   857
      if echo "${flag}" | grep -q '^-l'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   858
        if test "${LLVM_LIBS}" != ""; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   859
          LLVM_LIBS="${LLVM_LIBS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   860
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   861
        LLVM_LIBS="${LLVM_LIBS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   862
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   863
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   864
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   865
    AC_SUBST(LLVM_CFLAGS)
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   866
    AC_SUBST(LLVM_LDFLAGS)
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   867
    AC_SUBST(LLVM_LIBS)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   868
  fi
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
   869
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   870
  # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   871
  if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   872
    LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   873
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   874
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   875
  # TODO better (platform agnostic) test
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   876
  if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   877
    LIBCXX="-lstdc++"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   878
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   879
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   880
  AC_SUBST(LIBCXX)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   881
])