File: configure.in

package info (click to toggle)
fusionsound 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,584 kB
  • ctags: 1,568
  • sloc: ansic: 16,461; sh: 8,865; perl: 668; makefile: 375
file content (526 lines) | stat: -rw-r--r-- 13,657 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/ifusionsound.c)

AC_PREREQ(2.52)

#
# Making releases:
#   FUSIONSOUND_MICRO_VERSION += 1;
#   FUSIONSOUND_INTERFACE_AGE += 1;
#   FUSIONSOUND_BINARY_AGE += 1;
# if any functions have been added, set FUSIONSOUND_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set FUSIONSOUND_BINARY_AGE and FUSIONSOUND_INTERFACE_AGE to 0.
#
FUSIONSOUND_MAJOR_VERSION=1
FUSIONSOUND_MINOR_VERSION=0
FUSIONSOUND_MICRO_VERSION=0
FUSIONSOUND_INTERFACE_AGE=0
FUSIONSOUND_BINARY_AGE=0
FUSIONSOUND_VERSION=$FUSIONSOUND_MAJOR_VERSION.$FUSIONSOUND_MINOR_VERSION.$FUSIONSOUND_MICRO_VERSION

AC_SUBST(FUSIONSOUND_MAJOR_VERSION)
AC_SUBST(FUSIONSOUND_MINOR_VERSION)
AC_SUBST(FUSIONSOUND_MICRO_VERSION)
AC_SUBST(FUSIONSOUND_INTERFACE_AGE)
AC_SUBST(FUSIONSOUND_BINARY_AGE)
AC_SUBST(FUSIONSOUND_VERSION)

AC_DEFINE_UNQUOTED(FUSIONSOUND_VERSION,"$FUSIONSOUND_VERSION",[The FusionSound version])

# libtool versioning
LT_RELEASE=$FUSIONSOUND_MAJOR_VERSION.$FUSIONSOUND_MINOR_VERSION
LT_CURRENT=`expr $FUSIONSOUND_MICRO_VERSION - $FUSIONSOUND_INTERFACE_AGE`
LT_REVISION=$FUSIONSOUND_INTERFACE_AGE
LT_AGE=`expr $FUSIONSOUND_BINARY_AGE - $FUSIONSOUND_INTERFACE_AGE`

AC_SUBST(LT_RELEASE) 
AC_SUBST(LT_CURRENT) 
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

# The earliest version that this release has binary compatibility with.
# This is used for module locations.
BINARY_VERSION=$FUSIONSOUND_MAJOR_VERSION.$FUSIONSOUND_MINOR_VERSION.$LT_CURRENT


VERSION=$FUSIONSOUND_VERSION
PACKAGE=FusionSound

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)

AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_DISABLE_STATIC 
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_C_BIGENDIAN
AC_PROG_CPP

AC_CHECK_SIZEOF(long)

AC_CHECK_HEADERS(stdbool.h)

dnl Clear default CFLAGS
if test x"$CFLAGS" = x"-g -O2"; then
  CFLAGS=
fi

CFLAGS="-O3 -ffast-math -pipe $CFLAGS"

CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"

#
# check target architecture
#
have_x86=no
have_x86_64=no
have_arm=no
have_ppc=no

case x"$target" in
  xNONE | x)
    target_or_host="$host" ;;
  *)
    target_or_host="$target" ;;
esac

case "$target_or_host" in
  i*86-*-*)
    have_x86=yes
    AC_DEFINE(ARCH_X86,1,[Define to 1 if you are compiling for ix86.])
    ;;
    
  x86_64-*)
    have_x86=yes
    have_x86_64=yes
    AC_DEFINE(ARCH_X86_64,1,[Define to 1 if you are compiling for AMD64.])
    ;;

  *arm*)
    have_arm=yes
    AC_DEFINE(ARCH_ARM,1,[Define to 1 if you are compiling for ARM.])
    ;;

  ppc-*-linux* | powerpc-*)
    have_ppc=yes
    AC_DEFINE(ARCH_PPC,1,[Define to 1 if you are compiling for PowerPC.])
    ;;

  *)
    ;;
esac


AC_ARG_ENABLE(extra-warnings,
  [  --enable-extra-warnings enable extra warnings [[default=no]]],,
  enable_extra_warnings=no)
if test "x$enable_extra_warnings" = xyes; then
  CFLAGS="-W -Wno-sign-compare -Wno-unused-parameter -Wundef -Wcast-qual -Wcast-align -Waggregate-return -Wmissing-declarations -Winline $CFLAGS"
fi

AC_ARG_ENABLE(debug,
  [  --enable-debug          enable debugging support [[default=no]]],,
  enable_debug=no)
if test "x$enable_debug" = xyes; then
  CFLAGS="$CFLAGS -g3 -fno-inline"
  CPPFLAGS="$CPPFLAGS -DDIRECT_FORCE_DEBUG"
fi

if test "x$GCC" = xyes; then
  CFLAGS="-Wall $CFLAGS"
fi


AC_ARG_ENABLE(ieee-floats,
  [  --enable-ieee-floats    enable using IEEE floats for internal mixing routines [[default=no]]],,
  enable_ieee_floats=no)
if test "x$enable_ieee_floats" = xyes; then
  AC_DEFINE(FS_USE_IEEE_FLOATS,1,[Define to 1 to enable IEEE floats for mixing routines.])
fi

AC_ARG_ENABLE(precision,
  [  --enable-precision      privilege precision over speed [[default=auto]]],,
  enable_precision=auto)
if test "x$enable_precision" = xauto; then
  if test "x$have_x86" = xyes || test "x$have_ppc" = xyes; then
    enable_precision=yes
  else
    enable_precision=no
  fi
fi
if test "x$enable_precision" = xyes; then
  AC_DEFINE(FS_ENABLE_PRECISION,1,[Define to 1 to enable precision.])
fi

AC_ARG_ENABLE(linear-filter,
  [  --enable-linear-filter  enable linear filtering [[default=yes]]],,
  enable_linear_filter=yes)
if test "x$enable_linear_filter" = xyes; then
  AC_DEFINE(FS_ENABLE_LINEAR_FILTER,1,[Define to 1 to enable linear filter.])
fi

AC_ARG_ENABLE(dithering,
  [  --enable-dithering      enable dithering [[default=no]]],,
  enable_dithering=no)
if test "x$enable_dithering" = xyes; then
  AC_DEFINE(FS_ENABLE_DITHERING,1,[Define to 1 to enable dithering.])
fi

AC_ARG_ENABLE(module,
  [  --enable-module         enable module for DirectFB [[default=yes]]],, enable_module=yes)
AM_CONDITIONAL(BUILD_MODULE, test "x$enable_module" = xyes)


#
# Find pkg-config
#
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno ; then
  AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
fi

if ! pkg-config --atleast-pkgconfig-version 0.9 ; then
  AC_MSG_ERROR([*** pkg-config too old; version 0.9 or better required.])
fi


#
# Check for DirectFB-Internal
#
DIRECTFB_REQUIRED_VERSION=1.0.0

AC_MSG_CHECKING(for DirectFB-Internal)
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb-internal ; then
  MODULEDIR=$libdir/`$PKG_CONFIG --variable=moduledirname directfb-internal`
  DFB_CFLAGS=`$PKG_CONFIG --cflags directfb-internal`
  DFB_LIBS=`$PKG_CONFIG --libs directfb-internal`
  AC_MSG_RESULT(found)
else
  AC_MSG_ERROR([*** DirectFB $DIRECTFB_REQUIRED_VERSION or newer is required. ])
fi

 
#
#
# Check for LiTE
#
AC_ARG_WITH(lite, [  --with-lite             enable lite examples [[default=yes]]],, with_lite=yes)
if test "x$with_lite" = xyes; then
  LITE_REQUIRED_VERSION=0.0.1

  AC_MSG_CHECKING(for LiTE)

  if $PKG_CONFIG --atleast-version $LITE_REQUIRED_VERSION lite ; then
    have_lite=yes
    LITE_CFLAGS=`$PKG_CONFIG --cflags lite`
    LITE_LIBS=`$PKG_CONFIG --libs lite`
    AC_MSG_RESULT(found)
  else
    AC_MSG_WARN([
*** LiTE $LITE_REQUIRED_VERSION or newer is required for some examples, they've been disabled now. ])
  fi
fi
AM_CONDITIONAL(HAVE_LITE, test "x$have_lite" = xyes)


#
# Check for drivers
#
oss=no
alsa=no
wave=no

AC_MSG_CHECKING(which drivers should be built)
AC_ARG_WITH(drivers,
[  --with-drivers=<list>     compile drivers in <list> ]
[                            drivers may be comma separated ]
[                            'all' builds all drivers (default), 'none' builds none ]
[                            Possible drivers are: ]
[                            oss,alsa,wave], drivers="$withval",[drivers="all"])

if test "$drivers" = "all"; then
  checkfor_oss=yes
  checkfor_alsa=yes
  checkfor_wave=yes
else
  if test "$drivers" != "none"; then
    drivers=`echo $drivers | sed 's/,/ /g'`
    for driver in $drivers
    do
      case "$driver" in
        oss)
            checkfor_oss=yes
            ;;
        alsa)
            checkfor_alsa=yes
            ;;
        wave)
            checkfor_wave=yes
            ;;
        *)
            ;;
      esac
    done
  fi
fi

AC_MSG_RESULT($drivers)

if test "x$checkfor_oss" = "xyes"; then
  AC_CHECK_HEADER( [sys/soundcard.h], oss=yes, oss=no
  AC_MSG_WARN([*** OSS driver will not be built.]))
fi

if test "x$checkfor_alsa" = "xyes"; then
  AC_MSG_CHECKING(for alsa >= 0.9)
  if $PKG_CONFIG --atleast-version 0.9 alsa; then
     ALSA_CFLAGS=`$PKG_CONFIG --cflags alsa`
     ALSA_LIBS=`$PKG_CONFIG --libs alsa`
     alsa=yes
     AC_MSG_RESULT(yes)
  else
     AC_MSG_RESULT(no)
  fi
fi

if test "x$checkfor_wave" = "xyes"; then
  wave=yes
fi

AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)

AM_CONDITIONAL(BUILD_OSS, test "x$oss" = "xyes")
AM_CONDITIONAL(BUILD_ALSA, test "x$alsa" = "xyes")
AM_CONDITIONAL(BUILD_WAVE, test "x$wave" = "xyes")


#
# Build examples?
#
AC_ARG_WITH(examples, 
  [  --without-examples       do not build any examples],, with_examples=yes)
AM_CONDITIONAL(BUILD_EXAMPLES, test "x$with_examples" = "xyes")


#
# Build tools?
#
AC_ARG_WITH(tools,
  [  --without-tools          do not build any tools],, with_tools=yes)
AM_CONDITIONAL(BUILD_TOOLS, test "x$with_tools" = "xyes")


#
# Check for Timidity
#
timidty="no"
AC_ARG_ENABLE(timidity,
  [  --enable-timidity       build Timidity music provider [[default=yes]]],
  timidity="$enableval", timidity="yes")
AM_CONDITIONAL(BUILD_TIMIDITY, test "x$timidity" = "xyes")


#
# Check for Wave
#
wave="no"
AC_ARG_ENABLE(wave,
  [  --enable-wave           build Wave music provider [[default=yes]]],
  wave="$enableval", wave="yes")
AM_CONDITIONAL(BUILD_WAVE, test "x$wave" = "xyes")


#
# Check for Vorbis
#
vorbis="no"
tremor="no"
AC_ARG_ENABLE(vorbis,
  [  --enable-vorbis         build Ogg/Vorbis music provider [[default=yes]]],
  enable_vorbis="$enableval", enable_vorbis="yes")
AC_ARG_ENABLE(tremor,
  [  --enable-tremor         enable using Tremor Ogg/Vorbis decoder [[default=no]]],
  enable_tremor="$enableval", enable_tremor="no")

if test "x$enable_vorbis" = "xyes"; then
  if test "x$enable_tremor" = "xyes"; then
    AC_CHECK_HEADER(tremor/ivorbiscodec.h, 
      AC_CHECK_LIB(vorbisidec, ov_clear, tremor="yes", ), )
    
    if test "x$tremor" = "xyes"; then
      vorbis="yes"
      VORBISFILE_CFLAGS=""
      VORBISFILE_LIBS="-lvorbisidec"
      AC_DEFINE(USE_TREMOR,1,[Define to 1 to use Tremor Ogg/Vorbis decoder.])
    else
      AC_MSG_WARN([
*** Tremor is required - Ogg/Vorbis music provider will not be built.])
    fi
  else
    VORBIS_REQUIRED_VERSION=1.0.0
    AC_MSG_CHECKING(for vorbisfile >= $VORBIS_REQUIRED_VERSION)
  
    if $PKG_CONFIG --atleast-version $VORBIS_REQUIRED_VERSION vorbisfile; then
      vorbis="yes"
      VORBISFILE_CFLAGS=`$PKG_CONFIG --cflags vorbisfile`
      VORBISFILE_LIBS=`$PKG_CONFIG --libs vorbisfile`
      AC_MSG_RESULT(yes)
    else
      AC_MSG_RESULT(no)
      AC_MSG_WARN([
*** vorbisfile $VORBIS_REQUIRED_VERSION or newer is required - Ogg/Vorbis music provider will not be built.])
    fi
  fi
fi

AC_SUBST(VORBISFILE_CFLAGS)
AC_SUBST(VORBISFILE_LIBS)
AM_CONDITIONAL(BUILD_VORBIS, test "x$vorbis" = "xyes")


#
# Check for MAD
#
have_mad="no"
AC_ARG_ENABLE(mad,            
  [  --enable-mad            build MAD MP3 music provider [[default=yes]]],
  enable_mad="$enableval", enable_mad="yes")

if test "x$enable_mad" = "xyes"; then
  AC_CHECK_LIB(mad, mad_timer_add, have_mad="yes", have_mad="no")
  if test "x$have_mad" = "xyes"; then
    AC_CHECK_HEADER(mad.h, have_mad="yes", have_mad="no")
    if test "x$have_mad" = "xno"; then
      AC_MSG_WARN([
*** MAD header not found - MAD music provider will not be built.])
    else
      MAD_LIBS="-lmad"
    fi
  else
    AC_MSG_WARN([
*** MAD library not found - MAD music provider will not be built.])
  fi
fi

AC_SUBST(MAD_LIBS)
AM_CONDITIONAL(BUILD_MAD, test "x$have_mad" = "xyes")


#
# Check for CD-DA
#
cdda="no"
AC_ARG_ENABLE(cdda,            
  [  --enable-cdda           build CD-DA music provider [[default=yes]]],
  enable_cdda="$enableval", enable_cdda="yes")
  
if test "x$enable_cdda" = "xyes"; then
  cdda="yes"
  if $PKG_CONFIG --atleast-version 1.0.0 libcddb; then
    AC_DEFINE(HAVE_CDDB,1,[Define to 1 if you have libcddb.])
    CDDB_CFLAGS=`$PKG_CONFIG --cflags libcddb`
    CDDB_LIBS=`$PKG_CONFIG --libs libcddb`
  else
    AC_MSG_WARN([
*** libcddb 1.0.0 or newer not found - CD-DA Music Provider will be built without CDDB support.])
  fi
fi

AC_SUBST(CDDB_CFLAGS)
AC_SUBST(CDDB_LIBS)
AM_CONDITIONAL(BUILD_CDDA, test "x$cdda" = "xyes")   


#
# Check for Playlist
#
AC_ARG_ENABLE(playlist,            
  [  --enable-playlist       build Playlist music provider [[default=yes]]],
  playlist="$enableval", playlist="yes")

AM_CONDITIONAL(BUILD_PLAYLIST, test "x$playlist" = "xyes") 


DATADIR=$datadir/fusionsound
INCLUDEDIR=$includedir/fusionsound
INTERNALINCLUDEDIR=$includedir/fusionsound-internal

CFLAGS="$CFLAGS -Werror-implicit-function-declaration"

# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

AM_CONDITIONAL(BUILD_STATIC, test "$enable_static" = "yes")

AC_SUBST(DFB_CFLAGS)
AC_SUBST(DFB_LIBS)
AC_SUBST(LITE_CFLAGS)
AC_SUBST(LITE_LIBS)
AC_SUBST(DATADIR)
AC_SUBST(INCLUDEDIR)
AC_SUBST(INTERNALINCLUDEDIR)
AC_SUBST(MODULEDIR)
AC_SUBST(PACKAGE)

AC_OUTPUT([
fusionsound.pc
fusionsound-internal.pc
Makefile
docs/Makefile
docs/fusionsoundrc.5
docs/html/Makefile
drivers/Makefile
examples/Makefile
include/Makefile
include/fusionsound_version.h
interfaces/Makefile
interfaces/IFusionSound/Makefile
interfaces/IFusionSoundMusicProvider/Makefile
interfaces/IFusionSoundMusicProvider/timidity/Makefile
src/Makefile
src/core/Makefile
src/media/Makefile
src/misc/Makefile
tools/Makefile
])

AC_MSG_RESULT([
Build options: 
  Version                   $VERSION
  Install prefix	    $prefix
  Build shared libs         $enable_shared
  Build static libs         $enable_static
  Build Module              $enable_module
  Build Examples            $with_examples
  Build Tools               $with_tools
  Module directory          $MODULEDIR
  CPPFLAGS                  $CPPFLAGS
  CFLAGS                    $CFLAGS
  DFB_CFLAGS                $DFB_CFLAGS
  
Misc options:
  IEEE floats:              $enable_ieee_floats
  Precision:                $enable_precision
  Linear filter:            $enable_linear_filter
  Dithering:                $enable_dithering
  
Building Drivers:
  OSS                       $oss
  ALSA                      $alsa
  WAVE                      $wave

Building Music Providers:
  Timidity                  $timidity
  Wave                      $wave
  Ogg/Vorbis                $vorbis
  MAD                       $have_mad
  CD-DA                     $cdda
  Playlist                  $playlist
])