common/autoconf/lib-cups.m4
author lana
Thu, 22 Oct 2015 08:47:53 -0700
changeset 33329 15a50c5e0668
parent 32921 8e0250dfa145
child 33393 0f584e7d6ab6
permissions -rw-r--r--
Added tag jdk9-b88 for changeset b543e47c74b1
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
#
32921
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
     2
# Copyright (c) 2011, 2015, 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
32921
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    26
################################################################################
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    27
# Setup cups (Common Unix Printing System)
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    28
################################################################################
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    29
AC_DEFUN_ONCE([LIB_SETUP_CUPS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    30
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    31
  AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    32
      [specify prefix directory for the cups package
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    33
      (expecting the headers under PATH/include)])])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    34
  AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    35
      [specify directory for the cups include files])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    36
32921
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    37
  if test "x$NEEDS_LIB_CUPS" = xfalse; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    38
    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
    39
      AC_MSG_WARN([cups not used, so --with-cups is ignored])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    40
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    41
    CUPS_CFLAGS=
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    42
  else
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    43
    CUPS_FOUND=no
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    44
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    45
    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
    46
      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
    47
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    48
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    49
    if test "x${with_cups}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    50
      CUPS_CFLAGS="-I${with_cups}/include"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    51
      CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    52
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    53
    if test "x${with_cups_include}" != x; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    54
      CUPS_CFLAGS="-I${with_cups_include}"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    55
      CUPS_FOUND=yes
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    56
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    57
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    58
      # Are the cups headers installed in the default /usr/include location?
32921
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    59
      AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], [
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    60
          CUPS_FOUND=yes
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    61
          CUPS_CFLAGS=
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    62
          DEFAULT_CUPS=yes
8e0250dfa145 8138761: Improved handling of libffi, and cleanup of libraries.m4
ihse
parents: 31327
diff changeset
    63
      ])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    64
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    65
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    66
      # Getting nervous now? Lets poke around for standard Solaris third-party
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    67
      # package installation locations.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    68
      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
    69
      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
    70
        # An SFW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    71
        CUPS_FOUND=yes
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
    72
        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
    73
      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
    74
        # A CSW package seems to be installed!
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    75
        CUPS_FOUND=yes
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23165
diff changeset
    76
        CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    77
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    78
      AC_MSG_RESULT([$CUPS_FOUND])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    79
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    80
    if test "x$CUPS_FOUND" = xno; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    81
      HELP_MSG_MISSING_DEPENDENCY([cups])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    82
      AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    83
    fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    84
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    85
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19524
diff changeset
    86
  AC_SUBST(CUPS_CFLAGS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    87
])