File: configure.ac

package info (click to toggle)
pcaudiolib 1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 300 kB
  • sloc: ansic: 1,675; cpp: 136; makefile: 61; sh: 12
file content (175 lines) | stat: -rw-r--r-- 4,893 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
AC_PREREQ([2.65])
AC_INIT([pcaudiolib], [1.1], [https://github.com/rhdunn/pcaudiolib/issues], [], [https://github.com/rhdunn/pcaudiolib])
AM_INIT_AUTOMAKE()

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
AM_SILENT_RULES([yes])

AC_CONFIG_SRCDIR([src])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST

dnl ================================================================
dnl Program checks.
dnl ================================================================

AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL

dnl ================================================================
dnl PulseAudio checks.
dnl ================================================================

AC_ARG_WITH([pulseaudio],
    [AS_HELP_STRING([--with-pulseaudio], [support for PulseAudio output @<:@default=yes@:>@])],
    [])

AS_IF([test "x$with_pulseaudio" = "xno"],
    [
        echo "Disabling PulseAudio output support";
        have_pulseaudio=no
    ], [
        PKG_CHECK_MODULES(PULSEAUDIO, [libpulse-simple >= 0.9],
        [
            AC_DEFINE(HAVE_PULSE_SIMPLE_H, [], [Do we have pulse/simple.h])
            have_pulseaudio=yes
        ],[
            have_pulseaudio=no
])
])

AC_SUBST(PULSEAUDIO_CFLAGS)
AC_SUBST(PULSEAUDIO_LIBS)

dnl ================================================================
dnl ALSA checks.
dnl ================================================================

AC_ARG_WITH([alsa],
    [AS_HELP_STRING([--with-alsa], [support for ALSA audio output @<:@default=yes@:>@])],
    [])

AS_IF([test "x$with_alsa" = "xno"], [
    echo "Disabling ALSA audio output support";
    have_alsa=no
    ], [
        PKG_CHECK_MODULES(ALSA, [alsa],
        [
            AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H, [], [Do we have ALSA])
            have_alsa=yes
        ],[
            have_alsa=no
        ])])

AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)

dnl ================================================================
dnl QSA checks.
dnl ================================================================

AC_ARG_WITH([qsa],
    [AS_HELP_STRING([--with-qsa], [support for QSA audio output @<:@default=yes@:>@])],
    [])

if test "$with_qsa" = "no"; then
    echo "Disabling QSA audio output support"
    have_qsa=no
else
    AC_CHECK_HEADERS([sys/asoundlib.h],[
        AC_CHECK_HEADERS([sys/asound.h],[
            have_qsa=yes
            QSA_LIBS=-lasound
        ],[
            have_qsa=no
        ])
    ],[
        have_qsa=no
    ])
fi

AC_SUBST(QSA_LIBS)

dnl ================================================================
dnl coreaudio checks.
dnl ================================================================

AC_ARG_WITH([coreaudio],
    [AS_HELP_STRING([--with-coreaudio], [support for coreaudio audio output on Mac OS @<:@default=yes@:>@])],
    [])

if test "$with_coreaudio" = "no";then
    echo "Disabling coreaudio audio output support"
    have_coreaudio=no
else
    case $host_os in
        *darwin*)
            COREAUDIO_CFLAGS="-dynamiclib -fvisibility=default"
            COREAUDIO_LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit"
            have_coreaudio=yes
            AC_DEFINE(HAVE_COREAUDIO_H, [], [Do we have coreaudio?])
            ;;
        *)
            have_coreaudio=no
            ;;
    esac
fi

AC_SUBST(COREAUDIO_CFLAGS)
AC_SUBST(COREAUDIO_LIBS)
AM_CONDITIONAL([HAVE_COREAUDIO], [test "x${have_coreaudio}" = "xyes"])

dnl ================================================================
dnl OSS checks.
dnl ================================================================

AC_ARG_WITH([oss],
    [AS_HELP_STRING([--with-oss], [support for OSS audio output @<:@default=yes@:>@])],
    [])

if test "$with_oss" = "no"; then
    echo "Disabling OSS audio output support"
    have_oss=no
else
    AC_CHECK_HEADERS([sys/soundcard.h],[
        AC_CHECK_LIB(ossaudio, _oss_ioctl)
        have_oss=yes
    ],[
        AC_CHECK_HEADERS([linux/soundcard.h],[
            AC_CHECK_LIB(ossaudio, _oss_ioctl)
            have_oss=yes
        ],[
            AC_CHECK_HEADERS([soundcard.h],[
                AC_CHECK_LIB(ossaudio, _oss_ioctl)
                have_oss=yes
            ],[
                have_oss=no
            ])
        ])
    ])
fi

dnl ================================================================
dnl Generate output.
dnl ================================================================

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

AC_MSG_NOTICE([

    Configuration for Portable C Audio Library complete.

        Source code location:          ${srcdir}

        Compiler:                      ${CC}
        Compiler flags:                ${CFLAGS}

	PulseAudio support:            ${have_pulseaudio}
	ALSA support:                  ${have_alsa}
	QSA support:                   ${have_qsa}
	Coreaudio support:             ${have_coreaudio} 
	OSS support:                   ${have_oss}
])