jdk

Форк
0
/
lib-alsa.m4 
111 строк · 4.6 Кб
1
#
2
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
10
#
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
16
#
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
#
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
23
# questions.
24
#
25

26
################################################################################
27
# Setup alsa (Advanced Linux Sound Architecture)
28
################################################################################
29
AC_DEFUN_ONCE([LIB_SETUP_ALSA],
30
[
31
  AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
32
      [specify prefix directory for the alsa package
33
      (expecting the libraries under PATH/lib and the headers under PATH/include)])])
34
  AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
35
      [specify directory for the alsa include files])])
36
  AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
37
      [specify directory for the alsa library])])
38

39
  if test "x$NEEDS_LIB_ALSA" = xfalse; then
40
    if (test "x${with_alsa}" != x && test "x${with_alsa}" != xno) || \
41
        (test "x${with_alsa_include}" != x && test "x${with_alsa_include}" != xno) || \
42
        (test "x${with_alsa_lib}" != x && test "x${with_alsa_lib}" != xno); then
43
      AC_MSG_WARN([[alsa not used, so --with-alsa[-*] is ignored]])
44
    fi
45
    ALSA_CFLAGS=
46
    ALSA_LIBS=
47
  else
48
    ALSA_FOUND=no
49

50
    if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
51
      AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
52
    fi
53

54
    if test "x${with_alsa}" != x; then
55
      ALSA_LIBS="-L${with_alsa}/lib -lasound"
56
      ALSA_CFLAGS="-I${with_alsa}/include"
57
      ALSA_FOUND=yes
58
    fi
59
    if test "x${with_alsa_include}" != x; then
60
      ALSA_CFLAGS="-I${with_alsa_include}"
61
      ALSA_FOUND=yes
62
    fi
63
    if test "x${with_alsa_lib}" != x; then
64
      ALSA_LIBS="-L${with_alsa_lib} -lasound"
65
      ALSA_FOUND=yes
66
    fi
67
    # Do not try pkg-config if we have a sysroot set.
68
    if test "x$SYSROOT" = x; then
69
      if test "x$ALSA_FOUND" = xno; then
70
        PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
71
      fi
72
    fi
73
    if test "x$ALSA_FOUND" = xno; then
74
      # If we have sysroot set, and no explicit library location is set,
75
      # look at known locations in sysroot.
76
      if test "x$SYSROOT" != "x" && test "x${with_alsa_lib}" == x; then
77
        if test -f "$SYSROOT/usr/lib64/libasound.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
78
          ALSA_LIBS="-L$SYSROOT/usr/lib64 -lasound"
79
          ALSA_FOUND=yes
80
        elif test -f "$SYSROOT/usr/lib/libasound.so"; then
81
          ALSA_LIBS="-L$SYSROOT/usr/lib -lasound"
82
          ALSA_FOUND=yes
83
        elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
84
          ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
85
          ALSA_FOUND=yes
86
        elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
87
          ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
88
          ALSA_FOUND=yes
89
        fi
90
      fi
91
    fi
92
    if test "x$ALSA_FOUND" = xno; then
93
      AC_CHECK_HEADERS([alsa/asoundlib.h],
94
          [
95
            ALSA_FOUND=yes
96
            ALSA_CFLAGS=-Iignoreme
97
            ALSA_LIBS=-lasound
98
            DEFAULT_ALSA=yes
99
          ],
100
          [ALSA_FOUND=no]
101
      )
102
    fi
103
    if test "x$ALSA_FOUND" = xno; then
104
      HELP_MSG_MISSING_DEPENDENCY([alsa])
105
      AC_MSG_ERROR([Could not find alsa! $HELP_MSG])
106
    fi
107
  fi
108

109
  AC_SUBST(ALSA_CFLAGS)
110
  AC_SUBST(ALSA_LIBS)
111
])
112

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.