common/autoconf/libraries.m4
author vlivanov
Fri, 20 Mar 2015 11:41:34 -0700
changeset 30189 0dce8215957a
parent 28901 5acc0ec03d06
child 31327 8c2512d63fac
permissions -rw-r--r--
8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles Reviewed-by: jrose, kvn
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
#
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
     2
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
13133
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
22467
kvn
parents: 22466 21056
diff changeset
    46
  if test "x$OPENJDK_TARGET_OS" = xaix; then
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    47
    AC_MSG_CHECKING([what is not needed on AIX?])
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    48
    ALSA_NOT_NEEDED=yes
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    49
    PULSE_NOT_NEEDED=yes
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    50
    AC_MSG_RESULT([alsa pulse])
22467
kvn
parents: 22466 21056
diff changeset
    51
  fi
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    52
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 19524
diff changeset
    53
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    54
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    55
    AC_MSG_CHECKING([what is not needed on Windows?])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    56
    CUPS_NOT_NEEDED=yes
13133
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
    AC_MSG_RESULT([alsa cups pulse x11])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    61
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    62
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    63
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    64
    AC_MSG_CHECKING([what is not needed on MacOSX?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    65
    ALSA_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    66
    PULSE_NOT_NEEDED=yes
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    67
    X11_NOT_NEEDED=yes
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
    68
    AC_MSG_RESULT([alsa pulse x11])
20363
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_TARGET_OS" = xbsd; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    72
    AC_MSG_CHECKING([what is not needed on bsd?])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    73
    ALSA_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    74
    AC_MSG_RESULT([alsa])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    75
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    76
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    77
  if test "x$OPENJDK" = "xfalse"; then
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
    78
    FREETYPE_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    79
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    80
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    81
  if test "x$SUPPORT_HEADFUL" = xno; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    82
    X11_NOT_NEEDED=yes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    83
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    84
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    85
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    86
AC_DEFUN_ONCE([LIB_SETUP_X11],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    87
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    88
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    89
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    90
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    91
  # Check for X Windows
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    92
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    93
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    94
  if test "x$X11_NOT_NEEDED" = xyes; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    95
    if test "x${with_x}" != x; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    96
      AC_MSG_WARN([X11 is not used, so --with-x is ignored])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    97
    fi
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    98
    X_CFLAGS=
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
    99
    X_LIBS=
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   100
  else
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   101
    # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   102
    # Make a simple check for the libraries at the sysroot, and setup --x-includes and
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   103
    # --x-libraries for the sysroot, if that seems to be correct.
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   104
    if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   105
      if test "x$SYSROOT" != "x"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   106
        if test "x$x_includes" = xNONE; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   107
          if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   108
            x_includes="$SYSROOT/usr/X11R6/include"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   109
          elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   110
            x_includes="$SYSROOT/usr/include"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   111
          fi
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   112
        fi
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   113
        if test "x$x_libraries" = xNONE; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   114
          if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   115
            x_libraries="$SYSROOT/usr/X11R6/lib"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   116
          elif test "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   117
            x_libraries="$SYSROOT/usr/lib64"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   118
          elif test -f "$SYSROOT/usr/lib/libX11.so"; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   119
            x_libraries="$SYSROOT/usr/lib"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   120
          fi
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   121
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   122
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   123
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   124
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   125
    # Now let autoconf do it's magic
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   126
    AC_PATH_X
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   127
    AC_PATH_XTRA
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   128
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   129
    # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   130
    # this doesn't make sense so we remove it.
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   131
    if test "x$COMPILE_TYPE" = xcross; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   132
      X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   133
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   134
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   135
    if test "x$no_x" = xyes; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   136
      HELP_MSG_MISSING_DEPENDENCY([x11])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   137
      AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   138
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   139
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   140
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   141
      OPENWIN_HOME="/usr/openwin"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   142
      X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   143
      X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   144
          -L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   145
          -R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   146
          -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   147
    fi
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   148
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   149
    AC_LANG_PUSH(C)
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   150
    OLD_CFLAGS="$CFLAGS"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   151
    CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   152
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   153
    # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   154
    AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   155
        [X11_HEADERS_OK=yes],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   156
        [X11_HEADERS_OK=no; break],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   157
        [
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   158
          # include <X11/Xlib.h>
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   159
          # include <X11/Xutil.h>
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   160
        ]
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   161
    )
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   162
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   163
    if test "x$X11_HEADERS_OK" = xno; then
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   164
      HELP_MSG_MISSING_DEPENDENCY([x11])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   165
      AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   166
    fi
27239
12771c65e334 8062159: Fix Xrender check to work with sysroot
erikj
parents: 26400
diff changeset
   167
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   168
    # If XLinearGradient isn't available in Xrender.h, signal that it needs to be
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   169
    # defined in libawt_xawt.
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   170
    AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   171
    AC_COMPILE_IFELSE(
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   172
        [AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   173
            [[XLinearGradient x;]])],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   174
        [AC_MSG_RESULT([yes])],
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   175
        [AC_MSG_RESULT([no])
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   176
         X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   177
27330
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   178
    CFLAGS="$OLD_CFLAGS"
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   179
    AC_LANG_POP(C)
5e83ad1a521a 8062661: Do not perform X11 checks in configure when X11 is not needed
ihse
parents: 27239
diff changeset
   180
  fi # X11_NOT_NEEDED
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   181
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   182
  AC_SUBST(X_CFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   183
  AC_SUBST(X_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   184
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   185
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   186
AC_DEFUN_ONCE([LIB_SETUP_CUPS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   187
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   188
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   189
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   190
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   191
  # 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
   192
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   193
  AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   194
      [specify prefix directory for the cups package
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   195
      (expecting the headers under PATH/include)])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   196
  AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   197
      [specify directory for the cups include files])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   198
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   199
  if test "x$CUPS_NOT_NEEDED" = xyes; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   200
    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
   201
      AC_MSG_WARN([cups not used, so --with-cups is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   202
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   203
    CUPS_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   204
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   205
    CUPS_FOUND=no
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}" = xno || test "x${with_cups_include}" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   208
      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
   209
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   210
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   211
    if test "x${with_cups}" != 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${with_cups_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   216
      CUPS_CFLAGS="-I${with_cups_include}"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   217
      CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   218
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   219
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   220
      BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   221
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   222
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   223
      # Are the cups headers installed in the default /usr/include location?
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   224
      AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
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
            CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   227
            CUPS_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   228
            DEFAULT_CUPS=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   229
          ]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   230
      )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   231
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   232
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   233
      # Getting nervous now? Lets poke around for standard Solaris third-party
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   234
      # package installation locations.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   235
      AC_MSG_CHECKING([for cups headers])
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   236
      if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   237
        # An SFW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   238
        CUPS_FOUND=yes
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   239
        CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   240
      elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   241
        # A CSW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   242
        CUPS_FOUND=yes
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   243
        CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   244
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   245
      AC_MSG_RESULT([$CUPS_FOUND])
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
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   248
      HELP_MSG_MISSING_DEPENDENCY([cups])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   249
      AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   250
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   251
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   252
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   253
  AC_SUBST(CUPS_CFLAGS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   254
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   255
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   256
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   257
AC_DEFUN([LIB_BUILD_FREETYPE],
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   258
[
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   259
  FREETYPE_SRC_PATH="$1"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   260
  BUILD_FREETYPE=yes
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   261
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   262
  # Check if the freetype sources are acessible..
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   263
  if ! test -d $FREETYPE_SRC_PATH; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   264
    AC_MSG_WARN([--with-freetype-src specified, but can't find path "$FREETYPE_SRC_PATH" - ignoring --with-freetype-src])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   265
    BUILD_FREETYPE=no
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   266
  fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   267
  # ..and contain a vc2010 project file
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   268
  vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   269
  if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   270
    AC_MSG_WARN([Can't find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   271
    BUILD_FREETYPE=no
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   272
  fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   273
  # Now check if configure found a version of 'msbuild.exe'
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   274
  if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   275
    AC_MSG_WARN([Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src])
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   276
    BUILD_FREETYPE=no
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   277
  fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   278
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   279
  # Ready to go..
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   280
  if test "x$BUILD_FREETYPE" = xyes; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   281
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   282
    # msbuild requires trailing slashes for output directories
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   283
    freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   284
    freetype_lib_path_unix="$freetype_lib_path"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   285
    freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   286
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(vcxproj_path)
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   287
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_lib_path)
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   288
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_obj_path)
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   289
    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   290
      freetype_platform=x64
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   291
    else
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   292
      freetype_platform=win32
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   293
    fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   294
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   295
    # The original freetype project file is for VS 2010 (i.e. 'v100'),
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   296
    # so we have to adapt the toolset if building with any other toolsed (i.e. SDK).
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   297
    # Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   298
    # 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   299
    AC_MSG_NOTICE([Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ...])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   300
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   301
    # First we try to build the freetype.dll
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   302
    $ECHO -e "@echo off\n"\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   303
	     "$MSBUILD $vcxproj_path "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   304
		       "/p:PlatformToolset=$PLATFORM_TOOLSET "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   305
		       "/p:Configuration=\"Release Multithreaded\" "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   306
		       "/p:Platform=$freetype_platform "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   307
		       "/p:ConfigurationType=DynamicLibrary "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   308
		       "/p:TargetName=freetype "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   309
		       "/p:OutDir=\"$freetype_lib_path\" "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   310
		       "/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   311
    cmd /c freetype.bat
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   312
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   313
    if test -s "$freetype_lib_path_unix/freetype.dll"; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   314
      # If that succeeds we also build freetype.lib
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   315
      $ECHO -e "@echo off\n"\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   316
	       "$MSBUILD $vcxproj_path "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   317
			 "/p:PlatformToolset=$PLATFORM_TOOLSET "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   318
			 "/p:Configuration=\"Release Multithreaded\" "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   319
			 "/p:Platform=$freetype_platform "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   320
			 "/p:ConfigurationType=StaticLibrary "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   321
			 "/p:TargetName=freetype "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   322
			 "/p:OutDir=\"$freetype_lib_path\" "\
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   323
			 "/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   324
      cmd /c freetype.bat
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   325
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   326
      if test -s "$freetype_lib_path_unix/freetype.lib"; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   327
	# Once we build both, lib and dll, set freetype lib and include path appropriately
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   328
	POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   329
	POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix"
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   330
	AC_MSG_NOTICE([Compiling freetype sources succeeded! (see freetype.log for build results)])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   331
      else
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   332
	BUILD_FREETYPE=no
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   333
      fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   334
    else
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   335
      BUILD_FREETYPE=no
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   336
    fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   337
  fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   338
])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   339
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   340
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   341
[
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   342
  POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   343
  POTENTIAL_FREETYPE_LIB_PATH="$2"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   344
  METHOD="$3"
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   345
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   346
  # Let's start with an optimistic view of the world :-)
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   347
  FOUND_FREETYPE=yes
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   348
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   349
  # First look for the canonical freetype main include file ft2build.h.
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   350
  if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   351
    # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite.
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   352
    POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2"
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   353
    if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   354
      # Fail.
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   355
      FOUND_FREETYPE=no
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   356
    fi
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   357
  fi
27595
cff167b3bfa2 8065914: Various improvements and cleanup of build system
ihse
parents: 27331
diff changeset
   358
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   359
  if test "x$FOUND_FREETYPE" = xyes; then
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   360
    # Include file found, let's continue the sanity check.
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   361
    AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   362
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   363
    # Reset to default value
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   364
    FREETYPE_BASE_NAME=freetype
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   365
    FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   366
    if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   367
      if test "x$OPENJDK_TARGET_OS" = xmacosx \
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   368
          && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   369
        # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   370
        # for the .6 version explicitly.
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   371
        FREETYPE_BASE_NAME=freetype.6
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   372
        FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   373
        AC_MSG_NOTICE([Compensating for missing symlink by using version 6 explicitly])
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   374
      else
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   375
        AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   376
        FOUND_FREETYPE=no
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   377
      fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   378
    else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   379
      if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   380
        # On Windows, we will need both .lib and .dll file.
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   381
        if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   382
          AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location.])
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   383
          FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   384
        fi
24081
f98557ef4bf8 8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents: 23428
diff changeset
   385
      elif test "x$OPENJDK_TARGET_OS" = xsolaris \
f98557ef4bf8 8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents: 23428
diff changeset
   386
          && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
f98557ef4bf8 8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents: 23428
diff changeset
   387
        # Found lib in isa dir, use that instead.
f98557ef4bf8 8042213: Freetype detection fails on Solaris sparcv9 when using devkit
erikj
parents: 23428
diff changeset
   388
        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   389
        AC_MSG_NOTICE([Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead])
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   390
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   391
    fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   392
  fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   393
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   394
  if test "x$FOUND_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   395
    BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   396
    BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   397
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   398
    FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   399
    AC_MSG_CHECKING([for freetype includes])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   400
    AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   401
    FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   402
    AC_MSG_CHECKING([for freetype libraries])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   403
    AC_MSG_RESULT([$FREETYPE_LIB_PATH])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   404
  fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   405
])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   406
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   407
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   408
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   409
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   410
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   411
  #
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   412
  # The ubiquitous freetype library is used to render fonts.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   413
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   414
  AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   415
      [specify prefix directory for the freetype package
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   416
      (expecting the libraries under PATH/lib and the headers under PATH/include)])])
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   417
  AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   418
      [specify directory for the freetype include files])])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   419
  AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   420
      [specify directory for the freetype library])])
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   421
  AC_ARG_WITH(freetype-src, [AS_HELP_STRING([--with-freetype-src],
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   422
      [specify directory with freetype sources to automatically build the library (experimental, Windows-only)])])
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   423
  AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   424
      [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
   425
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   426
  # Need to specify explicitly since it needs to be overridden on some versions of macosx
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   427
  FREETYPE_BASE_NAME=freetype
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   428
  FREETYPE_CFLAGS=
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   429
  FREETYPE_LIBS=
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   430
  FREETYPE_BUNDLE_LIB_PATH=
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   431
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   432
  if test "x$FREETYPE_NOT_NEEDED" = xyes; then
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   433
    if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x || test "x$with_freetype_src" != x; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   434
      AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   435
    fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   436
    if test "x$enable_freetype_bundling" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   437
      AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   438
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   439
  else
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   440
    # freetype is needed to build; go get it!
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   441
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   442
    BUNDLE_FREETYPE="$enable_freetype_bundling"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   443
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   444
    if  test "x$with_freetype_src" != x; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   445
      if test "x$OPENJDK_TARGET_OS" = xwindows; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   446
        # Try to build freetype if --with-freetype-src was given on Windows
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   447
        LIB_BUILD_FREETYPE([$with_freetype_src])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   448
        if test "x$BUILD_FREETYPE" = xyes; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   449
          # Okay, we built it. Check that it works.
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   450
          LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype-src])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   451
          if test "x$FOUND_FREETYPE" != xyes; then
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   452
            AC_MSG_ERROR([Can not use the built freetype at location given by --with-freetype-src])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   453
          fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   454
        else
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   455
          AC_MSG_NOTICE([User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   456
          AC_MSG_ERROR([Consider building freetype manually and using --with-freetype instead.])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   457
        fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   458
      else
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   459
        AC_MSG_WARN([--with-freetype-src is currently only supported on Windows - ignoring])
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   460
      fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   461
    fi
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   462
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   463
    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
   464
      # User has specified settings
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   465
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   466
      if test "x$BUNDLE_FREETYPE" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   467
        # If not specified, default is to bundle freetype
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   468
        BUNDLE_FREETYPE=yes
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   469
      fi
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   470
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   471
      if test "x$with_freetype" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   472
        POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   473
        POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   474
      fi
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   475
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   476
      # Allow --with-freetype-lib and --with-freetype-include to override
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   477
      if test "x$with_freetype_include" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   478
        POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   479
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   480
      if test "x$with_freetype_lib" != x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   481
        POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   482
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   483
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   484
      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
   485
        # Okay, we got it. Check that it works.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   486
        LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   487
        if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   488
          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
   489
        fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   490
      else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   491
        # User specified only one of lib or include. This is an error.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   492
        if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   493
          AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   494
          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
   495
        else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   496
          AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   497
          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
   498
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   499
      fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   500
    else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   501
      # User did not specify settings, but we need freetype. Try to locate it.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   502
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   503
      if test "x$BUNDLE_FREETYPE" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   504
        # If not specified, default is to bundle freetype only on windows
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   505
        if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   506
          BUNDLE_FREETYPE=yes
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   507
        else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   508
          BUNDLE_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   509
        fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   510
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   511
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   512
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   513
        # Check builddeps
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   514
        BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   515
        # 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
   516
        if test "x$FOUND_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   517
          if test "x$BUNDLE_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   518
            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
   519
            FOUND_FREETYPE=no
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   520
          else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   521
            AC_MSG_CHECKING([for freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   522
            AC_MSG_RESULT([yes (using builddeps)])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   523
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   524
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   525
      fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   526
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   527
      # If we have a sysroot, assume that's where we are supposed to look and skip pkg-config.
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   528
      if test "x$SYSROOT" = x; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   529
        if test "x$FOUND_FREETYPE" != xyes; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   530
          # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   531
          if test "x$PKG_CONFIG" != x; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   532
            PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   533
            if test "x$FOUND_FREETYPE" = xyes; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   534
              # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   535
              FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   536
              # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   537
              if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   538
                FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   539
              fi
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   540
              # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   541
              if test "x$BUNDLE_FREETYPE" = xyes; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   542
                AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   543
                FOUND_FREETYPE=no
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   544
              else
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   545
                AC_MSG_CHECKING([for freetype])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   546
                AC_MSG_RESULT([yes (using pkg-config)])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   547
              fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   548
            fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   549
          fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   550
        fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   551
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   552
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   553
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   554
        # Check in well-known locations
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   555
        if test "x$OPENJDK_TARGET_OS" = xwindows; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   556
          FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   557
          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   558
          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
   559
          if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   560
            FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   561
            BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   562
            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
   563
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   564
        else
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   565
          FREETYPE_BASE_DIR="$SYSROOT/usr"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   566
          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
   567
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   568
          if test "x$FOUND_FREETYPE" != xyes; then
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   569
            FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   570
            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
   571
          fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   572
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   573
          if test "x$FOUND_FREETYPE" != xyes; then
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   574
            FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   575
            LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   576
          fi
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   577
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   578
          if test "x$FOUND_FREETYPE" != xyes; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   579
            FREETYPE_BASE_DIR="$SYSROOT/usr"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   580
            if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   581
              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
   582
            else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   583
              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
   584
              if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   585
                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
   586
              fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   587
            fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   588
          fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   589
        fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   590
      fi # end check in well-known locations
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   591
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   592
      if test "x$FOUND_FREETYPE" != xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   593
        HELP_MSG_MISSING_DEPENDENCY([freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   594
        AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   595
      fi
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   596
    fi # end user specified settings
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   597
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   598
    # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   599
    if test "x$FREETYPE_CFLAGS" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   600
      BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   601
      if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   602
        FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   603
      else
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   604
        FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   605
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   606
    fi
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   607
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   608
    if test "x$FREETYPE_LIBS" = x; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   609
      BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   610
      if test "x$OPENJDK_TARGET_OS" = xwindows; then
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   611
        FREETYPE_LIBS="$FREETYPE_LIB_PATH/$FREETYPE_BASE_NAME.lib"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   612
      else
27331
3947187af23d 8062816: Fix configure freetype detection on Mac OS X Yosemite
ihse
parents: 27330
diff changeset
   613
        FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -l$FREETYPE_BASE_NAME"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   614
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   615
    fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   616
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   617
    # Try to compile it
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   618
    AC_MSG_CHECKING([if we can compile and link with freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   619
    AC_LANG_PUSH(C++)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   620
    PREV_CXXCFLAGS="$CXXFLAGS"
21056
16245d19b19a 8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents: 20655
diff changeset
   621
    PREV_LIBS="$LIBS"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   622
    PREV_CXX="$CXX"
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   623
    CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
21056
16245d19b19a 8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents: 20655
diff changeset
   624
    LIBS="$LIBS $FREETYPE_LIBS"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   625
    CXX="$FIXPATH $CXX"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   626
    AC_LINK_IFELSE([AC_LANG_SOURCE([[
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   627
          #include<ft2build.h>
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   628
          #include FT_FREETYPE_H
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   629
          int main () {
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   630
            FT_Init_FreeType(NULL);
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   631
            return 0;
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   632
          }
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   633
        ]])],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   634
        [
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   635
          AC_MSG_RESULT([yes])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   636
        ],
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   637
        [
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   638
          AC_MSG_RESULT([no])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   639
          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
   640
          AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   641
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   642
          HELP_MSG_MISSING_DEPENDENCY([freetype])
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25039
diff changeset
   643
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   644
          AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   645
        ]
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   646
    )
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   647
    CXXCFLAGS="$PREV_CXXFLAGS"
21056
16245d19b19a 8027300: configure should use LIBS instead of LDFLAGS when testing freetype
ihse
parents: 20655
diff changeset
   648
    LIBS="$PREV_LIBS"
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   649
    CXX="$PREV_CXX"
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   650
    AC_LANG_POP(C++)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   651
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   652
    AC_MSG_CHECKING([if we should bundle freetype])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   653
    if test "x$BUNDLE_FREETYPE" = xyes; then
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   654
      FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   655
    fi
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   656
    AC_MSG_RESULT([$BUNDLE_FREETYPE])
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   657
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   658
  fi # end freetype needed
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   659
20654
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   660
  AC_SUBST(FREETYPE_BUNDLE_LIB_PATH)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   661
  AC_SUBST(FREETYPE_CFLAGS)
2c17cbccf2ef 8001922: Improve freetype handling.
ihse
parents: 20649
diff changeset
   662
  AC_SUBST(FREETYPE_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   663
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   664
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   665
AC_DEFUN_ONCE([LIB_SETUP_ALSA],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   666
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   667
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   668
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   669
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   670
  # Check for alsa headers and libraries. Used on Linux/GNU systems.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   671
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   672
  AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   673
      [specify prefix directory for the alsa package
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   674
      (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
   675
  AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   676
      [specify directory for the alsa include files])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   677
  AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   678
      [specify directory for the alsa library])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   679
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   680
  if test "x$ALSA_NOT_NEEDED" = xyes; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   681
    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
   682
      AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   683
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   684
    ALSA_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   685
    ALSA_LIBS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   686
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   687
    ALSA_FOUND=no
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   688
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   689
    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
   690
      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
   691
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   692
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   693
    if test "x${with_alsa}" != x; then
22710
3a5575792497 8033921: Build fails if --with-alsa option is used due to incorrect ALSA link parameter in autoconf script.
ihse
parents: 22467
diff changeset
   694
      ALSA_LIBS="-L${with_alsa}/lib -lasound"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   695
      ALSA_CFLAGS="-I${with_alsa}/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   696
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   697
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   698
    if test "x${with_alsa_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   699
      ALSA_CFLAGS="-I${with_alsa_include}"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   700
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   701
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   702
    if test "x${with_alsa_lib}" != x; then
22710
3a5575792497 8033921: Build fails if --with-alsa option is used due to incorrect ALSA link parameter in autoconf script.
ihse
parents: 22467
diff changeset
   703
      ALSA_LIBS="-L${with_alsa_lib} -lasound"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   704
      ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   705
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   706
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   707
      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
   708
    fi
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   709
    # Do not try pkg-config if we have a sysroot set.
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   710
    if test "x$SYSROOT" = x; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   711
      if test "x$ALSA_FOUND" = xno; then
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   712
        PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
   713
      fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   714
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   715
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   716
      AC_CHECK_HEADERS([alsa/asoundlib.h],
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
            ALSA_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   719
            ALSA_CFLAGS=-Iignoreme
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   720
            ALSA_LIBS=-lasound
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   721
            DEFAULT_ALSA=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   722
          ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   723
          [ALSA_FOUND=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   724
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   725
    if test "x$ALSA_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   726
      HELP_MSG_MISSING_DEPENDENCY([alsa])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   727
      AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   728
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   729
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   730
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   731
  AC_SUBST(ALSA_CFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   732
  AC_SUBST(ALSA_LIBS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   733
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   734
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   735
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   736
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   737
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   738
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   739
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   740
  # Check for the jpeg library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   741
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   742
25035
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   743
  AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   744
      [use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   745
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   746
  AC_MSG_CHECKING([for which libjpeg to use])
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   747
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   748
  # default is bundled
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   749
  DEFAULT_LIBJPEG=bundled
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   750
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   751
  #
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   752
  # if user didn't specify, use DEFAULT_LIBJPEG
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   753
  #
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   754
  if test "x${with_libjpeg}" = "x"; then
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   755
    with_libjpeg=${DEFAULT_LIBJPEG}
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   756
  fi
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   757
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   758
  AC_MSG_RESULT(${with_libjpeg})
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   759
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   760
  if test "x${with_libjpeg}" = "xbundled"; then
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   761
    USE_EXTERNAL_LIBJPEG=false
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   762
  elif test "x${with_libjpeg}" = "xsystem"; then
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   763
    AC_CHECK_HEADER(jpeglib.h, [],
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   764
        [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   765
    AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   766
        [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   767
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   768
    USE_EXTERNAL_LIBJPEG=true
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   769
  else
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   770
    AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   771
  fi
2c0a89ff0198 8043805: Allow using a system-installed libjpeg
omajid
parents: 24415
diff changeset
   772
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   773
  AC_SUBST(USE_EXTERNAL_LIBJPEG)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   774
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   775
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   776
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   777
  # Check for the gif library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   778
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   779
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   780
  AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   781
      [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
   782
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   783
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   784
  AC_MSG_CHECKING([for which giflib to use])
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   785
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   786
  # default is bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   787
  DEFAULT_GIFLIB=bundled
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   788
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   789
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   790
  # if user didn't specify, use DEFAULT_GIFLIB
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   791
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   792
  if test "x${with_giflib}" = "x"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   793
    with_giflib=${DEFAULT_GIFLIB}
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   794
  fi
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   795
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   796
  AC_MSG_RESULT(${with_giflib})
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   797
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   798
  if test "x${with_giflib}" = "xbundled"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   799
    USE_EXTERNAL_LIBGIF=false
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   800
  elif test "x${with_giflib}" = "xsystem"; then
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   801
    AC_CHECK_HEADER(gif_lib.h, [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   802
        [ 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
   803
    AC_CHECK_LIB(gif, DGifGetCode, [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   804
        [ 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
   805
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   806
    USE_EXTERNAL_LIBGIF=true
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   807
  else
16424
d955df81d716 8011278: Allow using a system-installed giflib
omajid
parents: 15915
diff changeset
   808
    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
   809
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   810
  AC_SUBST(USE_EXTERNAL_LIBGIF)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   811
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   812
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   813
  #
24413
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   814
  # Check for the lcms2 library
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   815
  #
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   816
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   817
  AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   818
  	[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   819
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   820
  AC_MSG_CHECKING([for which lcms to use])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   821
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   822
  DEFAULT_LCMS=bundled
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   823
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   824
  #
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   825
  # If user didn't specify, use DEFAULT_LCMS
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   826
  #
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   827
  if test "x${with_lcms}" = "x"; then
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   828
      with_lcms=${DEFAULT_LCMS}
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   829
  fi
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   830
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   831
  if test "x${with_lcms}" = "xbundled"; then
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   832
    USE_EXTERNAL_LCMS=false
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   833
    AC_MSG_RESULT([bundled])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   834
  elif test "x${with_lcms}" = "xsystem"; then
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   835
    AC_MSG_RESULT([system])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   836
    PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   837
    if test "x${LCMS_FOUND}" = "xyes"; then
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   838
      USE_EXTERNAL_LCMS=true
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   839
    else
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   840
      AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   841
    fi
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   842
  else
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   843
    AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   844
  fi
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   845
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   846
  AC_SUBST(USE_EXTERNAL_LCMS)
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   847
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   848
  ###############################################################################
1d117d2dfe92 8042159: Allow using a system-installed lcms2
omajid
parents: 23428
diff changeset
   849
  #
23163
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   850
  # Check for the png library
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   851
  #
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   852
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   853
  AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng],
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   854
     [use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   855
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   856
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   857
  AC_MSG_CHECKING([for which libpng to use])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   858
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   859
  # default is bundled
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   860
  DEFAULT_LIBPNG=bundled
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   861
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   862
  #
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   863
  # if user didn't specify, use DEFAULT_LIBPNG
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   864
  #
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   865
  if test "x${with_libpng}" = "x"; then
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   866
      with_libpng=${DEFAULT_LIBPNG}
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   867
  fi
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   868
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   869
  if test "x${with_libpng}" = "xbundled"; then
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   870
      USE_EXTERNAL_LIBPNG=false
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   871
      AC_MSG_RESULT([bundled])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   872
  elif test "x${with_libpng}" = "xsystem"; then
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   873
      PKG_CHECK_MODULES(PNG, libpng,
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   874
                   [ LIBPNG_FOUND=yes ],
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   875
                   [ LIBPNG_FOUND=no ])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   876
      if test "x${LIBPNG_FOUND}" = "xyes"; then
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   877
          USE_EXTERNAL_LIBPNG=true
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   878
          AC_MSG_RESULT([system])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   879
      else
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   880
          AC_MSG_RESULT([system not found])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   881
          AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   882
      fi
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   883
  else
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   884
      AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   885
  fi
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   886
  AC_SUBST(USE_EXTERNAL_LIBPNG)
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   887
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   888
  ###############################################################################
1e2f42892ffe 8035341: Allow using a system installed libpng
omajid
parents: 22710
diff changeset
   889
  #
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   890
  # Check for the zlib library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   891
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   892
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   893
  AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   894
      [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
   895
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   896
  AC_CHECK_LIB(z, compress,
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   897
      [ ZLIB_FOUND=yes ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   898
      [ ZLIB_FOUND=no ])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   899
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   900
  AC_MSG_CHECKING([for which zlib to use])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   901
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   902
  DEFAULT_ZLIB=bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   903
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   904
    #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   905
    # On macosx default is system...on others default is
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   906
    #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   907
    DEFAULT_ZLIB=system
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   908
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   909
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   910
  if test "x${ZLIB_FOUND}" != "xyes"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   911
    #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   912
    # If we don't find any system...set default to bundled
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   913
    #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   914
    DEFAULT_ZLIB=bundled
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   915
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   916
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   917
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   918
  # If user didn't specify, use DEFAULT_ZLIB
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   919
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   920
  if test "x${with_zlib}" = "x"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   921
    with_zlib=${DEFAULT_ZLIB}
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   922
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   923
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   924
  if test "x${with_zlib}" = "xbundled"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   925
    USE_EXTERNAL_LIBZ=false
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   926
    AC_MSG_RESULT([bundled])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   927
  elif test "x${with_zlib}" = "xsystem"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   928
    if test "x${ZLIB_FOUND}" = "xyes"; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   929
      USE_EXTERNAL_LIBZ=true
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   930
      AC_MSG_RESULT([system])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   931
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   932
      AC_MSG_RESULT([system not found])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   933
      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
   934
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   935
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   936
    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
   937
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   938
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   939
  AC_SUBST(USE_EXTERNAL_LIBZ)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   940
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   941
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   942
  LIBZIP_CAN_USE_MMAP=true
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   943
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   944
  AC_SUBST(LIBZIP_CAN_USE_MMAP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   945
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   946
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   947
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   948
  # Check if altzone exists in time.h
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   949
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   950
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   951
  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
   952
      [has_altzone=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   953
      [has_altzone=no])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   954
  if test "x$has_altzone" = xyes; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   955
    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
   956
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   957
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   958
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   959
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   960
  # Check the maths library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   961
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   962
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   963
  AC_CHECK_LIB(m, cos, [],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   964
      [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   965
        AC_MSG_NOTICE([Maths library was not found])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   966
      ]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   967
  )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   968
  AC_SUBST(LIBM)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   969
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   970
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   971
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   972
  # Check for libdl.so
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   973
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   974
  save_LIBS="$LIBS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   975
  LIBS=""
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   976
  AC_CHECK_LIB(dl,dlopen)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   977
  LIBDL="$LIBS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   978
  AC_SUBST(LIBDL)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   979
  LIBS="$save_LIBS"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   980
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   981
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   982
AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   983
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   984
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   985
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   986
  # statically link libstdc++ before C++ ABI is stablized on Linux unless
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   987
  # dynamic build is configured on command line.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   988
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   989
  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
   990
      [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
   991
      [
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   992
        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
   993
                && test "x$with_stdc__lib" != xdefault; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   994
          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
   995
        fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   996
      ],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   997
      [with_stdc__lib=default]
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
   998
  )
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   999
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1000
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1001
    # Test if -lstdc++ works.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1002
    AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1003
    AC_LANG_PUSH(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1004
    OLD_CXXFLAGS="$CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1005
    CXXFLAGS="$CXXFLAGS -lstdc++"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1006
    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1007
        [has_dynamic_libstdcxx=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1008
        [has_dynamic_libstdcxx=no])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1009
    CXXFLAGS="$OLD_CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1010
    AC_LANG_POP(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1011
    AC_MSG_RESULT([$has_dynamic_libstdcxx])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1012
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1013
    # Test if stdc++ can be linked statically.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1014
    AC_MSG_CHECKING([if static link of stdc++ is possible])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1015
    STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1016
    AC_LANG_PUSH(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1017
    OLD_LIBS="$LIBS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1018
    OLD_CXX="$CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1019
    LIBS="$STATIC_STDCXX_FLAGS"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1020
    CXX="$CC"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1021
    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1022
        [has_static_libstdcxx=yes],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1023
        [has_static_libstdcxx=no])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1024
    LIBS="$OLD_LIBS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1025
    CXX="$OLD_CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1026
    AC_LANG_POP(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1027
    AC_MSG_RESULT([$has_static_libstdcxx])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1028
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
  1029
    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
  1030
      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
  1031
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1032
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
  1033
    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
  1034
      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
  1035
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1036
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
  1037
    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
  1038
      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
  1039
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1040
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1041
    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
  1042
    # 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
  1043
    # 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
  1044
    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
  1045
      LIBCXX="$LIBCXX -lstdc++"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1046
      LDCXX="$CXX"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1047
      STATIC_CXX_SETTING="STATIC_CXX=false"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1048
      AC_MSG_RESULT([dynamic])
14459
6213b3f9e08d 8001875: build-infra: We must be able to force static linking of stdc++
tbell
parents: 14280
diff changeset
  1049
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1050
      LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1051
      LDCXX="$CC"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1052
      STATIC_CXX_SETTING="STATIC_CXX=true"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1053
      AC_MSG_RESULT([static])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1054
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1055
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1056
  AC_SUBST(STATIC_CXX_SETTING)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1057
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1058
  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
  1059
    # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1060
    PKG_CHECK_MODULES([LIBFFI], [libffi])
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1061
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1062
  fi
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1063
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1064
  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
  1065
    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
  1066
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1067
    if test "x$LLVM_CONFIG" != xllvm-config; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1068
      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
  1069
    fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1070
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1071
    llvm_components="jit mcjit engine nativecodegen native"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1072
    unset LLVM_CFLAGS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1073
    for flag in $("$LLVM_CONFIG" --cxxflags); do
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1074
      if echo "${flag}" | grep -q '^-@<:@ID@:>@'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1075
        if test "${flag}" != "-D_DEBUG" ; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1076
          if test "${LLVM_CFLAGS}" != "" ; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1077
            LLVM_CFLAGS="${LLVM_CFLAGS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1078
          fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1079
          LLVM_CFLAGS="${LLVM_CFLAGS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1080
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1081
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1082
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1083
    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
  1084
    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
  1085
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1086
    unset LLVM_LDFLAGS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1087
    for flag in $("${LLVM_CONFIG}" --ldflags); do
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1088
      if echo "${flag}" | grep -q '^-L'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1089
        if test "${LLVM_LDFLAGS}" != ""; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1090
          LLVM_LDFLAGS="${LLVM_LDFLAGS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1091
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1092
        LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1093
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1094
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1095
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1096
    unset LLVM_LIBS
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1097
    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
  1098
      if echo "${flag}" | grep -q '^-l'; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1099
        if test "${LLVM_LIBS}" != ""; then
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1100
          LLVM_LIBS="${LLVM_LIBS} "
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1101
        fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1102
        LLVM_LIBS="${LLVM_LIBS}${flag}"
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1103
      fi
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1104
    done
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1105
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1106
    AC_SUBST(LLVM_CFLAGS)
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1107
    AC_SUBST(LLVM_LDFLAGS)
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1108
    AC_SUBST(LLVM_LIBS)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1109
  fi
16581
b2cddec593f4 8011388: Support building zero and zeroshark with the new build
omajid
parents: 16424
diff changeset
  1110
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1111
  # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1112
  if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
  1113
    LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1114
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1115
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1116
  # TODO better (platform agnostic) test
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1117
  if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1118
    LIBCXX="-lstdc++"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1119
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1120
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
  1121
  AC_SUBST(LIBCXX)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1122
])
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1123
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1124
AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS],
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1125
[
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1126
  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27595
diff changeset
  1127
    TOOLCHAIN_SETUP_VS_RUNTIME_DLLS
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1128
    BASIC_DEPRECATED_ARG_WITH([dxsdk])
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1129
    BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1130
    BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1131
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22710
diff changeset
  1132
])