~ubuntu-branches/ubuntu/saucy/esound/saucy-proposed

« back to all changes in this revision

Viewing changes to .pc/03_hurd.patch/configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-10-22 01:04:30 UTC
  • Revision ID: james.westby@ubuntu.com-20111022010430-hn1iib4pudbgjsk7
Tags: 0.2.41-10
* Switch to dpkg source format 3.0 (quilt).
* Transition to multiarch, thanks Steve. Closes: #645978
* Drop the libtool .la file, since we break existing references anyway.
* debian/control.in:
  - Bump Standards-Version to 3.9.2. No further changes.
  - Drop old Conflicts (pre-lenny).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_PREREQ([2.58])
 
2
AC_INIT(esound, 0.2.41)
 
3
 
 
4
ESD_MAJOR_VERSION=0
 
5
ESD_MINOR_VERSION=2
 
6
ESD_MICRO_VERSION=39
 
7
ESD_VERSION=$ESD_MAJOR_VERSION.$ESD_MINOR_VERSION.$ESD_MICRO_VERSION
 
8
 
 
9
AC_CANONICAL_TARGET([])
 
10
AM_INIT_AUTOMAKE(1.6)
 
11
AM_MAINTAINER_MODE
 
12
 
 
13
AM_CONFIG_HEADER(config.h)
 
14
 
 
15
ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
 
16
 
 
17
AC_CONFIG_SRCDIR([esd.h])
 
18
 
 
19
dnl set version info for libesd.so to package rev - $MAJOR + $MINOR : $MICRO : $MINOR
 
20
ESD_VERSION_INFO=`expr $ESD_MINOR_VERSION + $ESD_MAJOR_VERSION`:$ESD_MICRO_VERSION:$ESD_MINOR_VERSION
 
21
 
 
22
AC_SUBST(ESD_MAJOR_VERSION)
 
23
AC_SUBST(ESD_MINOR_VERSION)
 
24
AC_SUBST(ESD_MICRO_VERSION)
 
25
AC_SUBST(ESD_VERSION)
 
26
AC_SUBST(ESD_VERSION_INFO)
 
27
 
 
28
AC_PROG_CC
 
29
AC_PROG_CXX
 
30
AC_PROG_CPP
 
31
AC_LIBTOOL_WIN32_DLL
 
32
AM_PROG_LIBTOOL
 
33
 
 
34
 
 
35
dnl Check for tools
 
36
 
 
37
AC_PROG_MAKE_SET
 
38
 
 
39
AC_PROG_INSTALL
 
40
 
 
41
dnl Check for compiler environment
 
42
 
 
43
AC_C_CONST
 
44
AC_C_BIGENDIAN
 
45
AC_C_INLINE
 
46
 
 
47
dnl Check for system libs needed
 
48
 
 
49
AC_FUNC_ALLOCA
 
50
AC_CHECK_FUNCS(setenv putenv fchown fchmod gethostbyname2)
 
51
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
 
52
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
 
53
AC_CHECK_FUNC(hstrerror,,[AC_CHECK_LIB(resolv,hstrerror)])
 
54
AC_CHECK_FUNC(nanosleep,,[
 
55
  AC_CHECK_LIB(rt,nanosleep,,[AC_CHECK_LIB(posix4,nanosleep)])])
 
56
AC_CHECK_FUNCS(usleep)
 
57
AC_CHECK_FUNCS(strtok_r)
 
58
 
 
59
use_inet_pton=no
 
60
AC_CHECK_FUNC(inet_pton,use_inet_pton=yes,[AC_CHECK_LIB(resolv,inet_pton)])
 
61
       if test "x$use_inet_pton" = "xyes"; then
 
62
               case $ac_cv_func_inet_pton/$ac_cv_lib_resolv_inet_pton in
 
63
               no/no) ;;
 
64
               *) AC_DEFINE(HAVE_INET_PTON, 1, [Defined if inet_pton() works])
 
65
               esac
 
66
       else
 
67
               AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
 
68
               case $ac_cv_func_inet_aton/$ac_cv_lib_resolv_inet_aton in
 
69
               no/no) ;;
 
70
               *) AC_DEFINE(HAVE_INET_ATON, 1, [Defined if inet_aton() works])
 
71
               esac
 
72
       fi
 
73
 
 
74
case $ac_cv_func_nanosleep/$ac_cv_lib_rt_nanosleep/$ac_cv_lib_posix4_nanosleep in
 
75
no/no/no) ;;
 
76
*) AC_DEFINE(HAVE_NANOSLEEP, 1, [Defined if nanosleep() works])
 
77
esac
 
78
 
 
79
dnl Check if INADDR_LOOPBACK exists
 
80
  
 
81
AC_TRY_COMPILE([
 
82
    #include<sys/types.h>
 
83
    #include<netinet/in.h>],
 
84
    [unsigned long ul = INADDR_LOOPBACK;],,
 
85
    [AC_DEFINE(INADDR_LOOPBACK, (u_int32_t)0x7f000001, [Defined as the address of the loopback interface])])
 
86
    
 
87
 
 
88
dnl ========================================================================
 
89
dnl Begin IPv6 checks
 
90
dnl ========================================================================
 
91
AC_MSG_CHECKING([whether to enable ipv6])
 
92
AC_ARG_ENABLE(ipv6, [  --enable-ipv6 enable IPv6 extensions], ,enable_ipv6=yes)
 
93
 
 
94
if test $enable_ipv6 = yes; then
 
95
  AC_TRY_COMPILE([
 
96
    #include <sys/types.h>
 
97
    #include <sys/socket.h>], [
 
98
    socket(AF_INET6, SOCK_STREAM, 0)
 
99
    ],
 
100
    have_ipv6=yes,
 
101
    have_ipv6=no
 
102
  )
 
103
  AC_MSG_RESULT($have_ipv6)
 
104
 
 
105
  if test $have_ipv6=yes; then
 
106
    have_getaddrinfo=no
 
107
    AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
 
108
    if test $have_getaddrinfo = no; then
 
109
      for lib in bsd socket inet; do
 
110
        AC_CHECK_LIB($lib,getaddrinfo,[LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
 
111
      done
 
112
    fi
 
113
 
 
114
    if test $have_getaddrinfo = yes; then
 
115
      AC_DEFINE(ENABLE_IPV6, 1, [Defined if ipv6 is enabled])
 
116
    fi
 
117
 
 
118
 
 
119
    dnl Check for inet_ntop. We need it only for debugging
 
120
    AC_CHECK_FUNC(inet_ntop, AC_DEFINE(HAVE_INET_NTOP, 1, [Defined if inet_ntop() works]))
 
121
  fi
 
122
else
 
123
  AC_MSG_RESULT(no)
 
124
fi
 
125
 
 
126
dnl ========================================================================
 
127
dnl End of IPv6 checks
 
128
dnl ========================================================================
 
129
 
 
130
dnl Check if SUN_LEN exists
 
131
 
 
132
AC_TRY_LINK([
 
133
    #include<sys/types.h>
 
134
    #include<sys/un.h>], 
 
135
    [struct sockaddr_un su; int i = SUN_LEN(&su);],
 
136
    [AC_DEFINE(HAVE_SUN_LEN, 1, [Defined if SUN_LEN() exists])], )
 
137
 
 
138
dnl check for getopt_long, substitute the distributed versions if not
 
139
 
 
140
AC_CHECK_FUNC(getopt_long,[have_getopt_long=yes],[have_getopt_long=no])
 
141
AM_CONDITIONAL(NEED_GETOPT, test "x$have_getopt_long" = xno)
 
142
 
 
143
dnl Needed for FIONBIO on Solaris at least
 
144
 
 
145
AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h)
 
146
 
 
147
dnl see if we want to enable insanely verbose debugging
 
148
 
 
149
AC_ARG_ENABLE(debugging,
 
150
  AC_HELP_STRING([--enable-debugging],[enable verbose diagnostic info [default=no]]),
 
151
  [enable_debuggin=${enableval}],
 
152
  [enable_debugging=no])
 
153
 
 
154
if test "x$enable_debugging" = "xyes"; then
 
155
  AC_DEFINE(ESDBG, 1, [Defined if debugging is enabled])
 
156
fi
 
157
 
 
158
dnl see if we intentionally want to disable local sound
 
159
 
 
160
AC_ARG_ENABLE(local_sound,
 
161
  AC_HELP_STRING([--enable-local-sound],[turn on local sound playing [default=yes]]),
 
162
  [enable_local_sound=${enableval}],
 
163
  [enable_local_sound=yes])
 
164
AC_ARG_ENABLE(oss,
 
165
  AC_HELP_STRING([--enable-oss],[use OSS if available [default=yes]]),
 
166
  [enable_oss=${enableval}],
 
167
  [enable_oss=yes])
 
168
AC_ARG_ENABLE(alsa,
 
169
  AC_HELP_STRING([--enable-alsa],[use ALSA if available [default=yes]]),
 
170
  [enable_alsa=${enableval}],
 
171
  [enable_alsa=yes])
 
172
AC_ARG_ENABLE(arts,
 
173
  AC_HELP_STRING([--enable-arts],[use arts if available [default=no]]),
 
174
  [enable_arts=${enableval}],
 
175
  [enable_arts=no])
 
176
 
 
177
dnl build the esddsp wrapper for systems, 
 
178
dnl that support LD_PRELOAD and RTLD_NEXT only
 
179
dsp_ok=no DL_LIB=
 
180
 
 
181
AC_MSG_CHECKING([if your platform supports esddsp])
 
182
case "$host_os" in
 
183
  linux* | freebsd* | kfreebsd*-gnu | bsdi4* )
 
184
    dsp_ok=yes
 
185
    ;;
 
186
esac
 
187
AC_MSG_RESULT($dsp_ok)
 
188
 
 
189
if test "x$dsp_ok" = xyes; then
 
190
   AC_CHECK_FUNC(dlopen, DL_LIB=,
 
191
      AC_CHECK_LIB(dl, dlopen, DL_LIB=-ldl))
 
192
   ESDDSP=esddsp
 
193
   LIBESDDSP=libesddsp.la
 
194
fi
 
195
AM_CONDITIONAL(BUILD_ESDDSP, test "x$dsp_ok" = xyes)
 
196
 
 
197
if test "x$enable_local_sound" = "xyes"; then
 
198
   found_sound=no
 
199
 
 
200
   dnl Check for audio header files needed
 
201
 
 
202
   echo "---------------------------------------------------------------------"
 
203
   echo "--- Checking to see which audio header files your system uses.";
 
204
   echo "--- Most of these checks should fail. Do not be alarmed.";
 
205
   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h sys/audio.h)
 
206
   AC_CHECK_HEADERS(sys/audioio.h sys/audio.io.h sun/audioio.h)
 
207
   AC_CHECK_HEADERS(dmedia/audio.h sys/soundlib.h sys/asoundlib.h alsa/asoundlib.h)
 
208
   AC_CHECK_HEADERS(CoreAudio/CoreAudio.h)
 
209
   # mme_api.h directly includes other files from the mme subdir
 
210
   xCPPFLAGS="$CPPFLAGS"
 
211
   CPPFLAGS="$CPPFLAGS -I/usr/include/mme"
 
212
   AC_CHECK_HEADERS(mme/mme_api.h)
 
213
   CPPFLAGS="$xCPPFLAGS"
 
214
   AM_PATH_ARTS(, HAVE_ARTS=yes, HAVE_ARTS=no)
 
215
 
 
216
   dnl Define the driver needed based on the first header file found
 
217
 
 
218
   if test x"$enable_oss" = xyes ; then
 
219
     if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
 
220
        test "${ac_cv_header_soundcard_h}" = "yes" || \
 
221
        test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
 
222
 
 
223
        dnl Platform mklinux/powerpc needs special care and feeding
 
224
        found_sound=yes
 
225
        AC_DEFINE(DRIVER_OSS, 1, [Defined if OSS backend is enabled])
 
226
     fi
 
227
   fi
 
228
 
 
229
   if test "${ac_cv_header_sys_audio_h}" = "yes"; then
 
230
      case ${host_os} in
 
231
      hpux*)
 
232
          found_sound=yes
 
233
          AC_DEFINE(DRIVER_HPUX, 1, [Defined if HPUX backend is enabled])
 
234
      ;;
 
235
      aix*)
 
236
          found_sound=yes
 
237
          AC_DEFINE(DRIVER_AIX, 1, [Defined if AIX backend is enabled])
 
238
      esac
 
239
   fi
 
240
 
 
241
   if test "${ac_cv_header_sys_audioio_h}" = "yes" || \
 
242
      test "${ac_cv_header_sys_audio_io_h}" = "yes" || \
 
243
      test "${ac_cv_header_sun_audioio_h}" = "yes"; then
 
244
      case ${host_os} in
 
245
      solaris*)
 
246
         found_sound=yes
 
247
         AC_DEFINE(DRIVER_SOLARIS, 1, [Defined if Solaris backend is enabled])
 
248
         ;;
 
249
      esac
 
250
   fi
 
251
 
 
252
   case ${host_os} in
 
253
   os2*)
 
254
      found_sound=yes
 
255
      AC_DEFINE(DRIVER_DART, 1, [Defined if OS/2 backend is enabled])
 
256
      ;;
 
257
   esac
 
258
 
 
259
   if test "${ac_cv_header_dmedia_audio_h}" = "yes"; then
 
260
      case ${host_os} in
 
261
      irix*)
 
262
         found_sound=yes
 
263
         AC_DEFINE(DRIVER_IRIX, 1, [Defined if IRIX backend is enabled])
 
264
      esac
 
265
   fi
 
266
 
 
267
   if test "${ac_cv_header_mme_mme_api_h}" = "yes"; then
 
268
      case ${host_os} in
 
269
      osf*)
 
270
        found_sound=yes
 
271
        AC_DEFINE(DRIVER_OSF, 1, [Defined if OSF backend is enabled])
 
272
        CPPFLAGS="$CPPFLAGS -I/usr/include/mme"
 
273
        SOUND_LIBS=-lmme
 
274
      esac
 
275
   fi
 
276
 
 
277
   if test "x$enable_alsa" = "xyes"; then
 
278
      if test "${ac_cv_header_sys_soundlib_h}" = "yes"; then
 
279
         found_sound=yes
 
280
         AC_DEFINE(DRIVER_ALSA, 1, [Defined if ALSA backend is enabled (deprecated)])
 
281
      fi
 
282
      if test "${ac_cv_header_alsa_asoundlib_h}" = "yes"; then
 
283
         found_sound=yes
 
284
         AC_DEFINE(DRIVER_ALSA_09, 1, [Defined if ALSA-1.0 backend is enabled])
 
285
      fi
 
286
      if test "${ac_cv_header_sys_asoundlib_h}" = "yes"; then
 
287
         found_sound=yes
 
288
         AC_DEFINE(DRIVER_NEWALSA, 1, [Defined if old ALSA backend is enabled (deprecated)])
 
289
      fi
 
290
   fi
 
291
 
 
292
   if test "${ac_cv_header_CoreAudio_CoreAudio_h}" = "yes"; then
 
293
      found_sound=yes
 
294
      AC_DEFINE(DRIVER_COREAUDIO, 1, [Defined if CoreAudio backend is enabled])
 
295
      SOUND_LIBS="-Wl,-framework,CoreAudio"
 
296
   fi
 
297
 
 
298
   if test "x$enable_arts" = "xyes" ; then
 
299
     if test "x$HAVE_ARTS" = "xyes"; then
 
300
       found_sound=yes
 
301
       CFLAGS="$CFLAGS $ARTSC_CFLAGS"
 
302
       LIBS="$LIBS $ARTS_LIBS"
 
303
       AC_DEFINE(DRIVER_ARTS, 1, [Defined if Arts backend is enabled])
 
304
     fi
 
305
   fi
 
306
 
 
307
   if test "$found_sound" = "no"; then
 
308
      AC_MSG_ERROR([Could not find a support sound driver])
 
309
   fi
 
310
 
 
311
   dnl Check for additional audio libs needed
 
312
 
 
313
   echo "---------------------------------------------------------------------"
 
314
   echo "--- Checking to see which audio libraries are required for linking.";
 
315
   echo "--- Most of these checks should also fail. Do not be alarmed.";
 
316
   AC_CHECK_FUNC(_oss_ioctl,,[AC_CHECK_LIB(ossaudio,_oss_ioctl)])
 
317
   AC_CHECK_FUNC(ALnewconfig,,[AC_CHECK_LIB(audio,ALnewconfig)])
 
318
   if test "x$enable_alsa" = "xyes"; then
 
319
      AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(sound,snd_cards)])
 
320
      AC_CHECK_FUNC(snd_cards,,[AC_CHECK_LIB(asound,snd_cards)])
 
321
      AC_CHECK_FUNC(snd_pcm_pause,,[AC_CHECK_LIB(asound,snd_pcm_pause)])
 
322
 
 
323
      dnl Check if ALSA uses new API
 
324
      saved_cflags="$CFLAGS"
 
325
      CFLAGS="$CFLAGS -Werror"
 
326
      echo -n "checking for alsa new PCM API... "
 
327
      AC_TRY_LINK([
 
328
          #include <alsa/asoundlib.h>
 
329
          ], [
 
330
          snd_pcm_t *pcm;
 
331
          snd_pcm_hw_params_t *params;
 
332
          unsigned int val;
 
333
          int dir;
 
334
          /* intentionally not uses pointers, trying to replicate bug 129709 */
 
335
          snd_pcm_hw_params_set_rate_near(pcm, params, val, &dir);
 
336
          ],[ echo "no" ], AC_DEFINE(DRIVER_ALSA_09_NEW_PCM_API, 1, [Defined if alsa-0.9 new pcm api is detected]) [ echo "yes" ],
 
337
          ])
 
338
 
 
339
      CFLAGS="$saved_cflags"
 
340
   fi
 
341
 
 
342
 
 
343
else
 
344
   AC_DEFINE(DRIVER_NONE, 1, [Defined if no backend is enabled])
 
345
fi
 
346
 
 
347
dnl offer daemon in serverdir
 
348
 
 
349
AC_ARG_WITH(esd-dir, [  --with-esd-dir=PATH     specify location of esound daemon ])
 
350
 
 
351
if test "x$with_esd_dir" = "x" ; then
 
352
  ESD_DIR='$(prefix)/bin'
 
353
  ESD_PC_DIR='${prefix}/bin'
 
354
else
 
355
  ESD_DIR=$with_esd_dir
 
356
  ESD_PC_DIR=$with_esd_dir
 
357
fi
 
358
AC_SUBST(ESD_DIR)
 
359
AC_SUBST(ESD_PC_DIR)
 
360
 
 
361
dnl make sure we have the library, -laudiofile
 
362
 
 
363
build_esdplay=false
 
364
 
 
365
PKG_CHECK_MODULES(AUDIOFILE, [audiofile >= 0.2.3])
 
366
 
 
367
CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
 
368
LIBS="$LIBS $AUDIOFILE_LIBS"
 
369
 
 
370
build_esdplay=true
 
371
 
 
372
AM_CONDITIONAL(BUILD_ESDPLAY, $build_esdplay)
 
373
 
 
374
echo "---------------------------------------------------------------------"
 
375
echo "--- Checking for the documentation generation tools.  NOTE: These "
 
376
echo "--- are NOT required for proper compilation of the esound package."
 
377
 
 
378
AC_CHECK_PROG(JW, jw, jw, false)
 
379
AM_CONDITIONAL(HAVE_JW, test "x$JW" != xfalse)
 
380
 
 
381
echo "---------------------------------------------------------------------"
 
382
 
 
383
AC_ARG_WITH(libwrap,[  --with-libwrap          use tcp wrappers [default=no]], , wrap_ok=no)
 
384
 
 
385
WRAP_LIB=
 
386
if test "x$with_libwrap" = "xyes"; then
 
387
   esound_save_LIBS="$LIBS"
 
388
   LIBS="$LIBS -lwrap"
 
389
 
 
390
   AC_MSG_CHECKING([for tcp_wrapper library and headers])
 
391
 
 
392
   wrap_ok=no
 
393
   AC_TRY_LINK(
 
394
[#include <tcpd.h>
 
395
#include <syslog.h>
 
396
int allow_severity = LOG_INFO;
 
397
int deny_severity = LOG_WARNING;],
 
398
[struct request_info *request; return hosts_access (request);],
 
399
      [AC_DEFINE(USE_LIBWRAP, 1, [Defined if libwrap is used])
 
400
       WRAP_LIB="-lwrap"
 
401
       wrap_ok=yes],
 
402
      [LIBS="$LIBS -lnsl"
 
403
       AC_TRY_LINK(
 
404
[#include <tcpd.h>
 
405
#include <syslog.h>
 
406
int allow_severity = LOG_INFO;
 
407
int deny_severity = LOG_WARNING;],
 
408
[struct request_info *request; return hosts_access (request);],
 
409
 
 
410
         [AC_DEFINE(USE_LIBWRAP, 1, [Defined if libwrap is used])
 
411
          WRAP_LIB="-lwrap -lnsl"
 
412
          wrap_ok=yes])])
 
413
 
 
414
   AC_MSG_RESULT($wrap_ok)
 
415
 
 
416
   LIBS="$esound_save_LIBS"
 
417
fi
 
418
 
 
419
AS_COMPILER_FLAG(-Wall, CFLAGS="$CFLAGS -Wall")
 
420
 
 
421
# set | sort; # just for double checking the script...
 
422
 
 
423
AC_SUBST(WRAP_LIB)
 
424
AC_SUBST(SOUND_LIBS)
 
425
AC_SUBST(AUDIOFILE_LIBS)
 
426
AC_SUBST(DL_LIB)
 
427
AC_SUBST(DOCS)
 
428
AC_SUBST(DISTDOCS)
 
429
AC_SUBST(JW)
 
430
 
 
431
AC_OUTPUT([
 
432
Makefile
 
433
esd-config
 
434
esound.spec
 
435
esound.pc
 
436
esddsp
 
437
docs/Makefile
 
438
docs/esd.1
 
439
docs/esdcat.1
 
440
docs/esd-config.1
 
441
docs/esdctl.1
 
442
docs/esddsp.1
 
443
docs/esdfilt.1
 
444
docs/esdloop.1
 
445
docs/esdmon.1
 
446
docs/esdplay.1
 
447
docs/esdrec.1
 
448
docs/esdsample.1
 
449
])
 
450
dnl , [case "$CONFIG_FILES" in *esd-config*) chmod +x esd-config;; esac])
 
451
 
 
452
echo ""
 
453
echo "Esound Configure Settings:"
 
454
echo ""
 
455
echo "Debugging support: $enable_debugging" 
 
456
echo "libwrap support:   $wrap_ok"
 
457
echo ""
 
458
echo "LIBS=$LIBS"
 
459
echo ""
 
460