File: configure.ac

package info (click to toggle)
somaplayer 0.5.2-2.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,668 kB
  • ctags: 2,521
  • sloc: ansic: 32,358; sh: 9,393; makefile: 858; yacc: 316; sed: 16
file content (720 lines) | stat: -rw-r--r-- 18,853 bytes parent folder | download
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
AC_PREREQ(2.54)

AC_INIT(src/player.c)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

AC_PROG_MAKE_SET

AM_SANITY_CHECK
AM_INIT_AUTOMAKE(somaplayer,0.5.2)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_PROG_CC
AC_PROG_LN_S
AC_ISC_POSIX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AM_PROG_CC_STDC

AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN

AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(stdio.h sys/stat.h sys/types.h unistd.h fcntl.h string.h sys/time.h arpa/inet.h netinet/in.h netdb.h sys/socket.h termios.h signal.h dirent.h sys/ioctl.h malloc.h)

CFLAGS="$CFLAGS -Wall"

ALL_LINGUAS="it es"
AM_GNU_GETTEXT

AC_CHECK_HEADER(pthread.h,, AC_MSG_ERROR(pthread is required to compile somaplayer))

if test "$ac_cv_header_pthread_h" = yes; then
LDFLAGS="$LDFLAGS -lpthread"
fi

AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_SIGNAL
AC_HEADER_TIME

AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday select socket strdup nanosleep inet_aton scandir getcwd mktime strerror sethostent endhostent getnameinfo getaddrinfo)

AC_CHECK_LIB(m, abs,, AC_MSG_ERROR(libm (math) is required to compile somaplayer))
AC_CHECK_LIB(z, inflate,, AC_MSG_ERROR(zlib is required to compile somaplayer))

# OSS
AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h linux/soundcard.h)

# ALSA, ALSA09, or ALSA KERNEL 2.6
AC_CHECK_HEADERS(sys/soundlib.h sys/asoundlib.h alsa/asoundlib.h)

lib_preload=no

if test "$ac_cv_header_soundcard_h" = yes || \
   test "$ac_cv_header_sys_soundcard_h" = yes || \
   test "$ac_cv_header_machine_soundcard_h" = yes || \
   test "$ac_cv_header_linux_soundcard_h" = yes || \
   test "$ac_cv_header_sys_audio_h" = yes || \
   test "$ac_cv_header_sys_soundlib_h" = yes || \
   test "$ac_cv_header_alsa_soundlib_h" = yes || \
   test "$ac_cv_header_sys_asoundlib_h" = yes; then
  libpreload=yes
fi

if test "$libpreload" = yes; then

  libpreload=no

  case "$host_os" in
    linux* | freebsd* | bsdi4*) 
      libpreload=yes
      ;;
  esac
fi

if test "$libpreload" = no; then
  AC_MSG_RESULT(no libsdsdsp.so)
fi

AC_ARG_ENABLE(ssl, [  --enable-openssl        enable ssl extensions (default=yes)], ssl=$enableval, ssl=yes)
AH_VERBATIM([ENABLE_OPENSSL],[#undef ENABLE_OPENSSL])
if test "$ssl" = yes; then
  AC_PATH_PROG(pkgconfigpath, pkg-config)
  AC_MSG_CHECKING(for openssl through pkg-config)
  if test "$pkgconfigpath" != "" && \
     $pkgconfigpath openssl --exists; then
    CFLAGS="$CFLAGS `$pkgconfigpath openssl --cflags`"
    LIBS="$LIBS `$pkgconfigpath openssl --libs`"
    AC_MSG_RESULT(yes)
    AC_DEFINE(ENABLE_OPENSSL)
  else
    AC_MSG_RESULT(No openssl support)
    ssl=no
  fi
fi

AC_ARG_ENABLE(mad,     [  --enable-mad            enable mp3 file support (default=yes)], mad=$enableval, mad=yes)
AH_VERBATIM([ENABLE_MP3],[#undef ENABLE_MP3])
if test "$mad" = yes; then

  AC_CHECK_HEADER(mad.h)
  AC_CHECK_LIB(mad,mad_timer_set)

  if test "$ac_cv_header_mad_h" = yes && \
     test "$ac_cv_lib_mad_mad_timer_set" = yes; then
    LDFLAGS="$LDFLAGS -lmad"
    AC_DEFINE(ENABLE_MP3)
  else
    mad=no
    AC_MSG_RESULT(No mad support)
  fi
fi

AC_ARG_ENABLE(id3,  [  --enable-id3            enable id3 tag support (default=yes)], id3=$enableval, id3=yes)
AH_VERBATIM([ENABLE_ID3],[#undef ENABLE_ID3])
if test "$id3" = yes && \
   test "$mad" = yes; then

  
  AC_CHECK_HEADERS(id3.h id3tag.h)
  AC_CHECK_LIB(id3tag,id3_file_fdopen)

  if test "$ac_cv_header_id3tag_h" = yes && \
     test "$ac_cv_lib_id3tag_id3_file_fdopen" = yes && \
     test "$ac_cv_header_id3_h" = yes; then
    LDFLAGS="$LDFLAGS -lid3tag"
    AC_DEFINE(ENABLE_ID3)
  else
    id3=no
    AC_MSG_RESULT(No id3tag support)
  fi
fi

AC_ARG_ENABLE(ogg,     [  --enable-ogg            enable ogg/vorbis file support (default=yes)], ogg=$enableval, ogg=yes)
AH_VERBATIM([ENABLE_OGG],[#undef ENABLE_OGG])
if test "$ogg" = yes; then

  AC_CHECK_HEADERS(ogg/ogg.h vorbis/codec.h vorbis/vorbisenc.h vorbis/vorbisfile.h)
  AC_CHECK_LIB(ogg,ogg_stream_flush)
  AC_CHECK_LIB(vorbis,vorbis_info_init)
  AC_CHECK_LIB(vorbisfile,ov_open_callbacks)
  AC_CHECK_LIB(vorbisenc,vorbis_encode_init)

  if test "$ac_cv_header_ogg_ogg_h" = yes && \
     test "$ac_cv_header_vorbis_codec_h" = yes && \
     test "$ac_cv_header_vorbis_vorbisenc_h" = yes && \
     test "$ac_cv_header_vorbis_vorbisfile_h" = yes && \
     test "$ac_cv_lib_ogg_ogg_stream_flush" = yes && \
     test "$ac_cv_lib_vorbis_vorbis_info_init"  = yes && \
     test "$ac_cv_lib_vorbisfile_ov_open_callbacks" = yes && \
     test "$ac_cv_lib_vorbisenc_vorbis_encode_init" = yes; then
    LDFLAGS="$LDFLAGS -logg -lvorbis -lvorbisenc -lvorbisfile"
    AC_DEFINE(ENABLE_OGG)
  else
    ogg=no
    AC_MSG_RESULT(No ogg/vorbis support)
  fi
fi

AC_ARG_ENABLE(cdaudio, [  --enable-cdaudio        enable cdaudio support (default=yes)], cdaudio=$enableval, cdaudio=yes)
AC_ARG_ENABLE(cdromsearch, [  --enable-cdromsearch    enable cdrom autosearch with configure script (default=yes)], cdromsearch=$enableval, cdromsearch=yes)
AH_VERBATIM([ENABLE_CDAUDIO],[#undef ENABLE_CDAUDIO])
if test "$cdaudio" = yes; then

  devcdrom=no

  if test "$cdromsearch" = yes; then

    AC_MSG_CHECKING(for cdrom drive name)
    if test -f /proc/sys/dev/cdrom/info; then
      trycdrom=`cat /proc/sys/dev/cdrom/info | grep "drive name" | awk '{ print $3 }'`
      if test "$trycdrom" != ""; then
        devcdrom="\\\"/dev/$trycdrom\\\""
        CFLAGS="$CFLAGS -DCDROM_DEVICE=\"$devcdrom\""
        AC_MSG_RESULT($trycdrom)
      fi
    else
      AC_MSG_RESULT(none)
    fi
  fi

  AC_CHECK_FILES(/dev/cdrom /dev/cdaudio)
  AC_CHECK_HEADER(cdda_interface.h)
  AC_CHECK_LIB(cdda_interface,cdda_identify)
  AC_CHECK_LIB(cdda_paranoia,paranoia_init)

  if test "$ac_cv_header_cdda_interface_h" = yes && \
     test "$ac_cv_lib_cdda_interface_cdda_identify" = yes && \
     test "$ac_cv_lib_cdda_paranoia_paranoia_init" = yes; then
    LDFLAGS="$LDFLAGS -lcdda_interface -lcdda_paranoia"
    AC_DEFINE(ENABLE_CDAUDIO)

    if test "$devcdrom" = no && \
       test "$ac_cv_file__dev_cdrom" = yes; then
      devcdrom="\\\"/dev/cdrom\\\""
      CFLAGS="$CFLAGS -DCDROM_DEVICE=\"$devcdrom\""
    fi

    if test "$devcdrom" = no && \
       test "$ac_cv_file__dev_cdaudio" = yes; then
      devcdrom="\\\"/dev/cdaudio\\\""
      CFLAGS="$CFLAGS -DCDROM_DEVICE=\"$devcdrom\""
    fi

  else
    cdaudio=no
    AC_MSG_RESULT(No cdaudio support)
  fi

fi

AC_ARG_ENABLE(mic,     [  --enable-mic            enable mic/line-in support (default=yes)], mic=$enableval, mic=yes)
AH_VERBATIM([ENABLE_MIC],[#undef ENABLE_MIC])
if test "$mic" = yes; then

  AC_CHECK_FILES(/dev/dsp /dev/audio /dev/audio/dsp)

  if test "$ac_cv_file__dev_dsp" = no && \
     test "$ac_cv_file__dev_audio" = no && \
     test "$ac_cv_file__dev_audio_dsp" = no; then
     mic=no
     AC_MSG_RESULT(No mic support)
  else
    mic=yes
  fi

  if test "$mic" = yes; then
    AC_DEFINE(ENABLE_MIC)

  devdsp=no
  if test "$ac_cv_file__dev_dsp" = yes; then
    devdsp="\\\"/dev/dsp\\\""
    CFLAGS="$CFLAGS -DDEVDSP=\"$devdsp\""
  fi

  if test "$ac_cv_file__dev_audio" = yes && \
     test "$devdsp" = no; then
    devdsp="\\\"/dev/audio\\\""
    CFLAGS="$CFLAGS -DDEVDSP=\"$devdsp\""
  fi

  if test "$ac_cv_file__dev_audio_dsp" = yes && \
     test "$devdsp" = no; then
    devdsp="\\\"/dev/audio/dsp\\\""
    CFLAGS="$CFLAGS -DDEVDSP=\"$devdsp\""
  fi

  fi
fi

AC_ARG_ENABLE(ao,      [  --enable-ao             enable output audio dsp support (default=yes)], ao=$enableval, ao=yes)
AH_VERBATIM([ENABLE_AO],[#undef ENABLE_AO])
if test "$ao" = yes; then

  AC_CHECK_HEADER(ao/ao.h)
  AC_CHECK_LIB(ao,ao_initialize)

  if test "$ac_cv_header_ao_ao_h" = yes && \
     test "$ac_cv_lib_ao_ao_initialize" = yes; then
    LDFLAGS="$LDFLAGS -lao"
    AC_DEFINE(ENABLE_AO)
  else
    ao=no
    AC_MSG_RESULT(No ao support)
  fi
fi

AC_ARG_ENABLE(sndfile,      [  --enable-sndfile        enable output file audio support (default=yes)], sndfile=$enableval, sndfile=yes)
AH_VERBATIM([ENABLE_SNDFILE],[#undef ENABLE_SNDFILE])
if test "$sndfile" = yes; then

  AC_CHECK_HEADER(sndfile.h)
  AC_CHECK_LIB(sndfile,sf_seek)

    AC_TRY_COMPILE([
      #include <sndfile.h>], [
      SF_INFO info;
      info.format=SF_FORMAT_HTK;
      sf_open("test", SFM_READ, &info);
      ],
      sndfile=yes,
      sndfile=no
    )
  if test "$ac_cv_header_sndfile_h" = yes && \
     test "$ac_cv_lib_sndfile_sf_seek" = yes; then
     
     if test "$sndfile" = no; then
       AC_MSG_RESULT(libsndfile too old.)
     else

      LDFLAGS="$LDFLAGS -lsndfile"
      AC_DEFINE(ENABLE_SNDFILE)

      AC_MSG_CHECKING([search libsndfile version])

      AH_VERBATIM([ENABLE_SNDFILE_MIDI],[#undef ENABLE_SNDFILE_MIDI])
      AC_TRY_COMPILE([
        #include <sndfile.h>], [
        SF_INFO info;
        info.format=SF_FORMAT_SDS;
        sf_open("test", SFM_READ, &info);
        ],
        sndfile_midi=yes,
        sndfile_midi=no
      )
      if test "$sndfile_midi" = yes; then
        AC_DEFINE(ENABLE_SNDFILE_MIDI)
      fi

      AH_VERBATIM([ENABLE_SNDFILE_AVR],[#undef ENABLE_SNDFILE_AVR])
      AC_TRY_COMPILE([
        #include <sndfile.h>], [
        SF_INFO info;
        info.format=SF_FORMAT_AVR;
        sf_open("test", SFM_READ, &info);
        ],
        sndfile_avr=yes,
        sndfile_avr=no
      )
      if test "$sndfile_avr" = yes; then
        AC_DEFINE(ENABLE_SNDFILE_AVR)
      fi
 
      AH_VERBATIM([ENABLE_SNDFILE_WAVEX],[#undef ENABLE_SNDFILE_WAVEX])
      AC_TRY_COMPILE([
        #include <sndfile.h>], [
        SF_INFO info;
        info.format=SF_FORMAT_WAVEX;
        sf_open("test", SFM_READ, &info);
        ],
        sndfile_wavex=yes,
        sndfile_wavex=no
      )
      if test "$sndfile_wavex" = yes; then
        AC_DEFINE(ENABLE_SNDFILE_WAVEX)
      fi

      if test "$sndfile_wavex" = yes; then
        AC_MSG_RESULT(>= 1.0.8)
      elif test "$sndfile_avr" = yes; then
        AC_MSG_RESULT(>= 1.0.7)
      elif test "$sndfile_midi" = yes; then
        AC_MSG_RESULT(>= 1.0.6)
      else
        AC_MSG_RESULT(>= 1.0.5)
      fi
    fi
  else
    sndfile=no
    AC_MSG_RESULT(No sndfile support)
  fi
fi

AC_ARG_ENABLE(sds,  [  --enable-daemon         enable output sds (soma daemon sound) support (default=yes)], sds=$enableval, sds=yes)
AH_VERBATIM([ENABLE_DAEMON],[#undef ENABLE_DAEMON])
if test "$sds" = yes; then
  AC_DEFINE(ENABLE_DAEMON)
fi

AC_ARG_ENABLE(lame,    [  --enable-lame           enable output lame support (default=yes)], lame=$enableval, lame=yes)
AH_VERBATIM([ENABLE_LAME],[#undef ENABLE_LAME])
if test "$lame" = yes; then

  AC_CHECK_HEADER(lame/lame.h)
  AC_CHECK_LIB(mp3lame,lame_init)

  if test "$ac_cv_header_lame_lame_h" = yes && \
     test "$ac_cv_lib_mp3lame_lame_init" = yes; then
    LDFLAGS="$LDFLAGS -lmp3lame"
    AC_DEFINE(ENABLE_LAME)
  else
    lame=no
    AC_MSG_RESULT(No lame support)
  fi
fi

AC_ARG_ENABLE(streaming, [  --enable-streaming      enable output streaming support (default=yes)], streaming=$enableval, streaming=yes)
AH_VERBATIM([ENABLE_STREAMING],[#undef ENABLE_STREAMING])
if test "$streaming" = yes; then
  AC_DEFINE(ENABLE_STREAMING)
fi

AC_ARG_ENABLE(icecast, [  --enable-icecast        enable output icecast support (default=yes)], icecast=$enableval, icecast=yes)
AH_VERBATIM([ENABLE_ICECAST],[#undef ENABLE_ICECAST])
if test "$icecast" = yes && \
   test "$streaming" = yes && \
   test "$lame" = yes; then
  AC_DEFINE(ENABLE_ICECAST)
fi

AC_ARG_ENABLE(icecast2,[  --enable-icecast2       enable output icecast2 support (default=yes)], icecast2=$enableval, icecast2=yes)
AH_VERBATIM([ENABLE_ICECAST2],[#undef ENABLE_ICECAST2])
if test "$icecast2" = yes && \
   test "$streaming" = yes;  then

   if test "$lame" = yes || \
      test "$ogg" = yes; then
     AC_DEFINE(ENABLE_ICECAST2)
  fi
fi

AC_ARG_ENABLE(shoutcast, [  --enable-shoutcast      enable output shoutcast support (default=yes)], shoutcast=$enableval, shoutcast=yes)
AH_VERBATIM([ENABLE_SHOUTCAST],[#undef ENABLE_SHOUTCAST])
if test "$shoutcast" = yes && \
   test "$streaming" = yes && \
   test "$lame" = yes; then
  AC_DEFINE(ENABLE_SHOUTCAST)
fi

AC_ARG_ENABLE(ipv6,  [  --enable-ipv6           enable ipv6 support (default=yes)], ipv6=$enableval, ipv6=yes)
AH_VERBATIM([ENABLE_IPV6],[#undef ENABLE_IPV6])
if test "$ipv6" = yes; then

  AC_MSG_CHECKING(for ipv6 support)
  AC_TRY_COMPILE([
    #include <sys/types.h>
    #include <sys/socket.h>], [
    socket(AF_INET6, SOCK_STREAM, 0)
    ],
    ipv6=yes,
    ipv6=no
  )

  if test "$ipv6" = yes; then
    AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes, have_getaddrinfo=no)
    AC_DEFINE(ENABLE_IPV6)

    if test "$have_getaddrinfo" = no; then
      for lib in bsd socket inet; do
        AC_CHECK_LIB($lib,getaddrinfo,[LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break])
      done
    fi

  else
    AC_MSG_RESULT(No ipv6 support)
  fi
fi

AC_ARG_ENABLE(glib,   [  --enable-glib           enable glib (default=yes)], glib=$enableval, glib=yes)
AH_VERBATIM([ENABLE_GLIB],[#undef ENABLE_GLIB])
if test "$glib" = yes; then
  GLIB="glib-2.0 >= 2.0.0"
else
  GLIB=""
fi

AC_ARG_ENABLE(gtk,   [  --enable-gtk            enable gtk interface (default=yes)], gtk=$enableval, gtk=yes)
AH_VERBATIM([ENABLE_GTK],[#undef ENABLE_GTK])
if test "$glib" = yes; then
  GTK="gtk+-2.0 >= 2.4.0"
else
  GTK=""
fi

AC_ARG_ENABLE(somalist,    [  --enable-somalist      enable soma playlist support (default=yes)], somalist=$enableval, somalist=yes)
AH_VERBATIM([ENABLE_SOMALIST],[#undef ENABLE_SOMALIST])
if test "$somalist" = yes; then
  SOMALIST="somalist-0.1 >= 0.1"
else
  SOMALIST=""
fi

if test "$GLIB" != ""; then
  PKG_CHECK_MODULES(GLIB_TEST, $GLIB, glib=yes, glib=no)
fi

if test "$GTK" != ""; then
  PKG_CHECK_MODULES(GTK_TEST, $GTK, gtk=yes, gtk=no)
fi

if test "$SOMALIST" != ""; then
  PKG_CHECK_MODULES(SOMAPLAYER_TEST, $SOMALIST, somalist=yes, somalist=no)
fi

WHAT=""
if test "$glib" = yes;     then WHAT="$WHAT $GLIB";     fi
if test "$gtk" = yes;      then WHAT="$WHAT $GTK";      fi
if test "$somalist" = yes; then WHAT="$WHAT $SOMALIST"; fi

if test "$WHAT" != ""; then
  PKG_CHECK_MODULES(MODULES, $WHAT)

  LDFLAGS="$LDFLAGS $MODULES_LIBS"
  CFLAGS="$CFLAGS $MODULES_CFLAGS"

  if test "$gtk" = yes; then
    AC_DEFINE(ENABLE_GTK)
    AC_DEFINE(ENABLE_GLIB)
    gtk=yes
    glib=yes

  elif test "$glib" = yes; then
    AC_DEFINE(ENABLE_GLIB)
    glib=yes
  fi

  if test "$somalist" = yes; then
    AC_DEFINE(ENABLE_SOMALIST)
    somalist=yes
  fi
fi

if test "$USE_NLS" = yes; then
  nls=yes
else
  nls=no
fi

AC_ARG_ENABLE(scripts,  [  --enable-scripts        enable lame/cdparanoia fake scripts (default=yes)], scripts=$enableval, scripts=yes)

AM_CONDITIONAL(ENABLE_GTK, test "$gtk" = yes)
AM_CONDITIONAL(ENABLE_SOMALIST, test "$somalist" = yes)
AM_CONDITIONAL(ENABLE_LAME, test "$lame" = yes)
AM_CONDITIONAL(ENABLE_SNDFILE, test "$sndfile" = yes)
AM_CONDITIONAL(ENABLE_AO, test "$ao" = yes)
AM_CONDITIONAL(ENABLE_LIBPRELOAD, test "$libpreload" = yes)
AM_CONDITIONAL(ENABLE_SCRIPTS, test "$scripts" = yes)

AC_OUTPUT([
Makefile
sdsdsp
src/Makefile
src/input/Makefile
src/input/mp3/Makefile
src/input/ogg/Makefile
src/input/sndfile/Makefile
src/input/cdaudio/Makefile
src/input/mic/Makefile
src/input/daemon/Makefile
src/output/Makefile
src/output/ao/Makefile
src/output/sndfile/Makefile
src/output/daemon/Makefile
src/output/streaming/Makefile
src/output/lame/Makefile
src/output/vorbis/Makefile
src/output/monitor/Makefile
src/confuse/Makefile
src/gtk/Makefile
src/gdaemon/Makefile
doc/Makefile
doc/html/Makefile
scripts/Makefile
scripts/lame.fake
scripts/cdparanoia.fake
tools/Makefile
tools/sdsvumeter/Makefile
tools/controller/Makefile
src/configure/Makefile
src/sds/Makefile
src/controller/Makefile
icons/Makefile
intl/Makefile 
po/Makefile.in 
])

echo
echo Somaplayer compiles with this flags:
echo

i=0
max=20

if test "$ssl" = yes; then
  echo "* OpenSSL support (deconde/encode ssl streams)"
  i=`$as_expr $i + 1`
else
  echo "- No OpenSSL"
fi

if test "$mad" = yes; then
  echo "* Mad support (decode mp3 files/streams)"
  i=`$as_expr $i + 1`
else
  echo "- No Mad (no mp3 support ?!?)"
fi

if test "$mad" = yes && \
   test $id3 = yes; then
  echo "* Id3tag support (read id3 tag)"
  i=`$as_expr $i + 1`
else
  echo "- No Id3tag (no id3 tag support)"
fi

if test "$ogg" = yes; then
  echo "* Ogg/Vorbis support (deconde/encode ogg files/streams)"
  i=`$as_expr $i + 1`
else
  echo "- No Ogg/Vorbis (no ogg decode and endcode support ?!?)"
fi

if test "$cdaudio" = yes; then
  echo "* CdAudio support"
  i=`$as_expr $i + 1`
else
  echo "- No CdAudio (no cdaudio support)"
fi

if test "$mic" = yes; then
  echo "* Mic Support"
  i=`$as_expr $i + 1`
else
  echo "- No Mic support (no mic support)"
fi

if test "$lame" = yes; then
  echo "* Lame support (encode mp3 files/streams)"
  i=`$as_expr $i + 1`
else
  echo "- No Lame (no mp3 encode support)"
fi

if test "$ao" = yes; then
  echo "* Ao support (output audio with dsp device)"
  i=`$as_expr $i + 1`
else
  echo "- No Ao (no audio support ?!?)"
fi

if test "$sndfile" = yes; then
  echo "* Sndfile support (output file audio)"
  i=`$as_expr $i + 1`
else
  echo "- No Sndfile (no wav, aiff file support ?!?)"
fi

if test "$sds" = yes; then
  echo "* Sds support (Soma sound daemon)"
  i=`$as_expr $i + 1`
else
  echo "- No sds support (no daemon support ?!?)"
fi

if test "$streaming" = yes; then
  echo "* Streaming support (encode to icecast/icecast2/shoutcast server)"
  i=`$as_expr $i + 1`
else
  echo "- No streaming support"
fi

if test "$streaming" = yes && \
   test "$icecast" = yes; then
  echo "* Icecast protocol support"
  i=`$as_expr $i + 1`
else
  echo "- No icecast"
fi

if test "$streaming" = yes && \
   test "$icecast2" = yes; then
  echo "* Icecast2 protocol support"
  i=`$as_expr $i + 1`
else
  echo "- No icecast2"
fi

if test "$streaming" = yes && \
   test "$shoutcast" = yes; then
  echo "* Shoutcast protocol support"
  i=`$as_expr $i + 1`
else
  echo "- No shoutcast"
fi

if test "$ipv6" = yes; then
  echo "* Ipv6 support"
  i=`$as_expr $i + 1`
else
  echo "- No Ipv6"
fi

if test "$glib" = yes; then
  echo "* Glib support"
  i=`$as_expr $i + 1`
else
  echo "- No Glib support"
fi

if test "$gtk" = yes; then
  echo "* Gtk Interface"
  i=`$as_expr $i + 1`
else
  echo "- No Gtk Interface"
fi

if test "$somalist" = yes; then
  echo "* Soma List support"
  i=`$as_expr $i + 1`
else
  echo "- No Soma List support"
fi

if test "$libpreload" = yes; then
  echo "* libsdsds.so support"
  i=`$as_expr $i + 1`
else
  echo "- No libsdsdsp.so support"
fi

if test "$nls" = yes; then
  echo "* NLS/Gettext support"
  i=`$as_expr $i + 1`
else
  echo "- No NLS/Gettext support"
fi

echo
echo -n "Dependences founded: $i/$max"

if test "`$as_expr $i = $max`" = "1"; then echo " - Very good"; 
elif test "`$as_expr $i "<" 10`" = "1"; then echo " - Horrible..."; 
else echo " - Good"; fi

echo