~siretart/xine-lib/ubuntu

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-15 13:13:45 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051215131345-8n4osv1j7fy9c1s1
* SECURITY UPDATE: Fix arbitrary code execution with crafted PNG images in
  embedded ffmpeg copy.
* src/libffmpeg/libavcodec/utils.c, avcodec_default_get_buffer(): Apply
  upstream patch to fix buffer overflow on decoding of small PIX_FMT_PAL8
  PNG files.
* References:
  CVE-2005-4048
  http://mplayerhq.hu/pipermail/ffmpeg-devel/2005-November/005333.html
  http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/
  utils.c.diff?r1=1.161&r2=1.162&cvsroot=FFMpeg

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
dnl   XINE_SUB += 1; continue with XINE_LT_* values below
16
16
dnl
17
17
XINE_MAJOR=1
18
 
XINE_MINOR=0
 
18
XINE_MINOR=1
19
19
XINE_SUB=1
20
20
 
21
 
if test $XINE_SUB -eq 0 ; then
22
 
  XINE_SUBPART="";
23
 
else
 
21
#if test $XINE_SUB -eq 0 ; then
 
22
#  XINE_SUBPART="";
 
23
#else
24
24
  XINE_SUBPART=".$XINE_SUB"
25
 
fi
 
25
#fi
26
26
 
27
27
dnl The libtool version numbers (XINE_LT_*); Don't even think about faking this!
28
28
dnl 
49
49
dnl  * in Linux, the library will be named
50
50
dnl    libname.so.(XINE_LT_CURRENT - XINE_LT_AGE).XINE_LT_AGE.XINE_LT_REVISION
51
51
 
52
 
XINE_LT_CURRENT=13
 
52
XINE_LT_CURRENT=15
53
53
XINE_LT_REVISION=0
54
 
XINE_LT_AGE=12
 
54
XINE_LT_AGE=14
55
55
 
56
56
dnl for a release tarball do "rm .cvsversion" before "make dist"
57
57
if test -f .cvsversion; then
117
117
dnl Save CFLAGS, AC_ISC_POSIX set some unwanted default CFLAGS
118
118
saved_CFLAGS="$CFLAGS"
119
119
AC_ISC_POSIX
 
120
AC_PATH_MAGIC
120
121
CFLAGS="$saved_CFLAGS"
121
122
AC_PROG_CC
122
123
AC_HEADER_STDC
191
192
dnl threads and OS specific stuff
192
193
dnl ---------------------------------------------
193
194
 
 
195
AC_ARG_WITH(pthread-prefix, 
 
196
  AC_HELP_STRING(
 
197
    [--with-pthread-prefix=PREFIX],
 
198
    [path to pthread library]),
 
199
  [pthread_prefix="$withval"],
 
200
  [pthread_prefix="no"])
 
201
 
194
202
case "$host" in
195
203
  *-*-freebsd*)
196
 
    THREAD_LIBS="-L/usr/local/lib -pthread"
197
 
    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
198
 
 
199
 
    CFLAGS="$THREAD_CFLAGS $CFLAGS"
 
204
    if test x"$pthread_prefix" = "xno"; then
 
205
      pthread_prefix="/usr/local"
 
206
    fi
 
207
    THREAD_LIBS="-L$pthread_prefix/lib -pthread"
 
208
    THREAD_CPPFLAGS="-I$pthread_prefix/include"
 
209
    CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS -D_THREAD_SAFE"
 
210
    have_pthread=yes
200
211
 
201
212
    ;;
202
213
 
203
214
  *-*-hpux11*)
204
 
    THREAD_LIBS=" -lpthread"
205
 
    THREAD_CFLAGS="-D_REENTRANT"
206
 
    CFLAGS="$THREAD_CFLAGS $CFLAGS"
207
 
 
208
 
    ;;
209
 
 
 
215
    THREAD_LIBS="-lpthread"
 
216
    have_pthread=yes
 
217
 
 
218
    ;;
 
219
 
 
220
  *)
 
221
    if test x"$pthread_prefix" = "xno"; then
 
222
      THREAD_LIBS="-lpthread"
 
223
    else
 
224
      THREAD_LIBS="-L$pthread_prefix/lib -lpthread"
 
225
      THREAD_CPPFLAGS="-I$pthread_prefix/include"
 
226
    fi
 
227
    CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
 
228
 
 
229
    ac_save_LIBS="$LIBS"
 
230
    LIBS="$LIBS $THREAD_LIBS"
 
231
 
 
232
    AC_CHECK_LIB(pthread, pthread_create, have_pthread=yes)
 
233
 
 
234
    LIBS="$ac_save_LIBS"
 
235
    ;;
 
236
esac
 
237
 
 
238
if test x"$have_pthread" != "xyes"; then
 
239
  AC_MSG_ERROR(pthread needed)
 
240
fi
 
241
 
 
242
AC_SUBST(THREAD_CPPFLAGS)
 
243
AC_SUBST(THREAD_LIBS)
 
244
 
 
245
dnl
 
246
AC_MSG_CHECKING(for recursive mutex support in pthread)
 
247
ac_save_LIBS="$LIBS"
 
248
LIBS="$LIBS $THREAD_LIBS"
 
249
 
 
250
AC_DEFINE(_GNU_SOURCE)
 
251
have_recursive_mutex=no
 
252
AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h>
 
253
 
 
254
int main() {
 
255
  pthread_mutexattr_t attr;
 
256
  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 
257
  return 0;
 
258
}
 
259
        ]),[
 
260
            have_recursive_mutex=yes
 
261
        ],[
 
262
            AC_MSG_ERROR(recursive mutex support is needed - please report)
 
263
        ])
 
264
LIBS="$ac_save_LIBS"
 
265
 
 
266
AC_MSG_RESULT($have_recursive_mutex)
 
267
 
 
268
 
 
269
dnl ---------------------------------------------
 
270
dnl Windows ports checks
 
271
dnl ---------------------------------------------
 
272
case "$host" in
210
273
  *-*-mingw* | *-*-cygwin*)
211
274
    dnl check if we are using the cygwin, mingw or cygwin with mno-cygwin mode
212
275
    dnl in which case we are actually dealing with a mingw32 compiler
224
287
    esac
225
288
 
226
289
    if test "$SYS" = "mingw32"; then
227
 
      THREAD_INCLUDES='-I$(top_srcdir)/win32/contrib/pthreads'
228
 
      THREAD_LIBS='$(top_builddir)/win32/contrib/pthreads/libpthread.la'
229
 
      THREAD_CFLAGS_CONFIG=" "
230
 
      THREAD_LIBS_CONFIG=" "
231
 
      WIN32_CPPFLAGS='-I$(top_srcdir)/win32/include -I$(top_srcdir)/win32/contrib/dirent'
 
290
      WIN32_CPPFLAGS='-I$(top_srcdir)/win32/include'
232
291
      LIBS="-lwinmm -lwsock32 $LIBS"
233
292
      GOOM_LIBS="-liberty"
234
 
 
235
 
      need_internal_zlib=yes
236
293
    fi
237
294
    LDFLAGS="-no-undefined $LDFLAGS"
238
295
    ;;
239
 
    
240
 
 
241
 
  *)
242
 
    AC_CHECK_LIB(pthread, pthread_create,
243
 
             [THREAD_LIBS="-lpthread"],
244
 
             [AC_MSG_ERROR(pthread needed)])
245
 
    ;;
246
296
esac
247
 
dnl different thread cflags and libs for libxine and for external 
248
 
dnl application linking libxine
249
 
if test "x$THREAD_CFLAGS_CONFIG" = "x"; then
250
 
  THREAD_CFLAGS_CONFIG=$THREAD_CFLAGS
251
 
fi
252
 
if test "x$THREAD_LIBS_CONFIG" = "x"; then
253
 
  THREAD_LIBS_CONFIG=$THREAD_LIBS
254
 
fi
255
 
dnl used for building xine
256
 
AC_SUBST(THREAD_CFLAGS)
257
 
AC_SUBST(THREAD_INCLUDES)
258
 
AC_SUBST(THREAD_LIBS)
259
297
AC_SUBST(GOOM_LIBS)
260
 
dnl needed for xine-config
261
 
AC_SUBST(THREAD_CFLAGS_CONFIG)
262
 
AC_SUBST(THREAD_LIBS_CONFIG)
263
 
dnl WIN32 platform
264
298
AC_SUBST(WIN32_CPPFLAGS)
265
299
AM_CONDITIONAL(WIN32, test x$SYS = "xmingw32")
266
300
 
 
301
 
267
302
dnl ---------------------------------------------
268
303
dnl dynamic linker
269
304
dnl ---------------------------------------------
281
316
 echo 'int i;' > conftest.$ac_ext
282
317
 xine_cv_cc_64bit_output=no
283
318
 if AC_TRY_EVAL(ac_compile); then
284
 
 case `/usr/bin/file conftest.$ac_objext` in
 
319
 case `"$MAGIC_CMD" conftest.$ac_objext` in
285
320
 *"ELF 64"*)
286
321
   xine_cv_cc_64bit_output=yes
287
322
   ;;
310
345
AC_SUBST(LIBFFMPEG_CFLAGS)
311
346
 
312
347
LIBMPEG2_CFLAGS=""
313
 
LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_DECODERS -DXINE_MPEG_ENCODER -DCONFIG_ZLIB"
 
348
LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_DECODERS -DXINE_MPEG_ENCODER -DCONFIG_ZLIB -DCONFIG_GPL"
314
349
 
315
350
AC_CHECK_DECL(lrintf,[
316
351
        AC_DEFINE(HAVE_LRINTF,1,[Define this if the 'lrintf' function is declared in math.h])
431
466
dnl zlib
432
467
dnl ---------------------------------------------
433
468
 
434
 
dnl internal zlib permited only in MINGW-like platform
435
 
if test "x$need_internal_zlib" = "xyes"; then
436
 
  have_zlib=no
437
 
  ZLIB_INCLUDES='-I$(top_srcdir)/win32/contrib/zlib'
438
 
  ZLIB_LIBS='$(top_builddir)/win32/contrib/zlib/libzlib.la'
439
 
  ZLIB_LIBS_CONFIG=""
 
469
AC_ARG_WITH(zlib-prefix, 
 
470
  AC_HELP_STRING(
 
471
    [--with-zlib-prefix=PREFIX],
 
472
    [path to zlib compression library]),
 
473
  [zlib_prefix="$withval"],
 
474
  [zlib_prefix="no"])
 
475
 
 
476
if test x"$zlib_prefix" = "xno"; then
 
477
  ZLIB_LIBS="-lz"
440
478
else
441
 
  AC_CHECK_LIB(z, gzsetparams,
442
 
    [AC_CHECK_HEADER(zlib.h,
443
 
       have_zlib=yes
444
 
       ZLIB_LIBS="-lz"
445
 
       ZLIB_LIBS_CONFIG="-lz",)], AC_MSG_ERROR(zlib needed))
446
 
fi
447
 
AM_CONDITIONAL(HAVE_ZLIB, [test x"$have_zlib" = "xyes"])
448
 
AC_SUBST(ZLIB_INCLUDES)
 
479
  ZLIB_CPPFLAGS="-I$zlib_prefix/include"
 
480
  ZLIB_LIBS="-L$zlib_prefix/lib -lz"
 
481
fi
 
482
 
 
483
ac_save_CPPFLAGS="$CPPFLAGS"
 
484
ac_save_LIBS="$LIBS"
 
485
CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
 
486
LIBS="$LIBS $ZLIB_LIBS"
 
487
 
 
488
AC_CHECK_LIB(z, gzsetparams,
 
489
  [AC_CHECK_HEADER(zlib.h,
 
490
     have_zlib=yes)])
 
491
 
 
492
CPPFLAGS="$ac_save_CPPFLAGS"
 
493
LIBS="$ac_save_LIBS"
 
494
 
 
495
if test "x$have_zlib" != "xyes"; then
 
496
  AC_MSG_ERROR(zlib needed)
 
497
fi
 
498
AC_SUBST(ZLIB_CPPFLAGS)
449
499
AC_SUBST(ZLIB_LIBS)
450
 
AC_SUBST(ZLIB_LIBS_CONFIG)
 
500
 
451
501
 
452
502
dnl ---------------------------------------------
453
503
dnl check posix timers
473
523
 
474
524
case "$host_or_hostalias" in
475
525
  *linux* )
476
 
    have_syncfb="yes"
 
526
    AC_ARG_ENABLE([fb],
 
527
      AC_HELP_STRING([--disable-fb], [do not build syncfb plugins]),
 
528
      have_syncfb=$enableval, have_syncfb="yes")
477
529
    ;;
478
530
  *)
479
531
    have_syncfb="no"
485
537
dnl ----------------------------------------------
486
538
dnl Check for usable video-for-linux (v4l) support
487
539
dnl ----------------------------------------------
 
540
AC_ARG_ENABLE([v4l],
 
541
  AC_HELP_STRING([--disable-v4l], [do not build Video4Linux support]),
 
542
  [with_v4l=${enableval}], [with_v4l=yes])
488
543
 
489
 
AC_CHECK_HEADER(linux/videodev.h, have_v4l=yes,)
 
544
if test "x$with_v4l" == "xyes"; then
 
545
  AC_CHECK_HEADER(linux/videodev.h, have_v4l=yes,)
 
546
else
 
547
  have_v4l=no
 
548
fi
490
549
AM_CONDITIONAL(HAVE_V4L, [test x"$have_v4l" = "xyes"])
491
550
 
492
551
 
530
589
        fi
531
590
        ;;
532
591
 
533
 
  i386-*-freebsd*)
 
592
  i?86-*-freebsd*)
534
593
        AC_CHECK_HEADER(/usr/local/include/iconv.h,
535
594
                        CFLAGS="-I/usr/local/include $CFLAGS"
536
595
                        LDFLAGS="-L/usr/local/lib $LDFLAGS"
560
619
dnl
561
620
if test x$no_x = "x"; then
562
621
 
 
622
 
563
623
AC_ARG_WITH(xxmc-path, AC_HELP_STRING([--with-xxmc-path=path], [where libXvMC libraries for the
564
624
        xxmc plugin are  installed. Defalts to the default X library path.]),
565
625
        xxmc_path="$withval", xxmc_path="$x_libraries")
566
626
AC_ARG_WITH(xxmc-lib, AC_HELP_STRING([--with-xxmc-lib=XXXX], [The name of the XvMC library 
567
627
        libXXXX.so for the xxmc plugin.]),xxmc_stub="$withval", 
568
628
        xxmc_stub="XvMCW")
 
629
 
569
630
saved_libs="$LIBS"
570
631
saved_CPPFLAGS="$CPPFLAGS"
571
 
CPPFLAGS="$CPPFLAGS -I$x_includes"
 
632
if test x$x_includes != "x"; then
 
633
        CPPFLAGS="$CPPFLAGS -I$x_includes"
 
634
fi
 
635
 
572
636
XXMC_LIB="-L$xxmc_path -l$xxmc_stub"
573
637
AC_MSG_CHECKING(whether to enable the xxmc plugin with vld extensions)
574
638
AC_MSG_RESULT()
593
657
fi
594
658
 
595
659
if test x$ac_have_xxmc = "xyes"; then
596
 
  AC_CHECK_HEADERS($x_includes/X11/extensions/vldXvMC.h,
 
660
  AC_CHECK_HEADERS(X11/extensions/vldXvMC.h,
597
661
     [ac_have_vldxvmc_h="yes"],
598
 
     ac_have_xxmc="no",)
 
662
     ac_have_vldxvmc="no",)
599
663
  if test "x$ac_have_vldxvmc_h" = "xyes"; then
600
664
     AC_DEFINE([HAVE_VLDXVMC], [1], 
601
665
               [Define 1 if you have vldXvMC.h])
623
687
  fi
624
688
fi
625
689
if test x$ac_have_xxmc = "xyes"; then
626
 
  AC_CHECK_HEADERS($x_includes/X11/extensions/XvMC.h,,
 
690
  AC_CHECK_HEADERS(X11/extensions/XvMC.h,,
627
691
     ac_have_xxmc="no",)
628
692
fi
629
693
if test x$ac_have_xxmc = "xyes"; then
676
740
    fi  
677
741
fi
678
742
if test x$ac_have_xvmc = "xyes"; then
679
 
  AC_CHECK_HEADERS($x_includes/X11/extensions/XvMC.h,,
 
743
  AC_CHECK_HEADERS(X11/extensions/XvMC.h,,
680
744
     ac_have_xvmc="no",)
681
745
fi
682
746
if test x$ac_have_xvmc = "xyes"; then
696
760
dnl Checks for Xinerama extension
697
761
dnl ---------------------------------------------
698
762
 
699
 
AC_CHECK_LIB(Xinerama, XineramaQueryExtension, 
 
763
AC_ARG_ENABLE([xinerama],
 
764
  AC_HELP_STRING([--disable-xinerama], [do not build Xinerama support]),
 
765
  [with_xinerama=$enableval], [with_xinerama=yes])
 
766
 
 
767
if test "x$with_xinerama" = "xyes"; then
 
768
  AC_CHECK_LIB(Xinerama, XineramaQueryExtension, 
700
769
             [X_LIBS="$X_LIBS -lXinerama"
701
770
              AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
702
771
              ac_have_xinerama="yes"],,
703
772
             [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
 
773
else
 
774
  ac_have_xinerama=no
 
775
fi
704
776
dnl AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")
705
777
 
706
778
 
708
780
dnl Checks for Ascii-Art library
709
781
dnl ---------------------------------------------
710
782
 
711
 
AC_ARG_ENABLE(aalib,
712
 
        AC_HELP_STRING([--disable-aalib], [do not build aalib]),
713
 
                disable_aalib=yes,
714
 
                disable_aalib=no)
 
783
AC_ARG_ENABLE([aalib],
 
784
  AC_HELP_STRING([--disable-aalib], [do not build AALIB support]),
 
785
  [with_aalib=$enableval], [with_aalib=yes])
715
786
 
716
 
if test x$disable_aalib = "xno"; then
717
 
AM_PATH_AALIB(1.4,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***]))
 
787
if test "x$with_aalib" = "xyes"; then
 
788
  AM_PATH_AALIB(1.4,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***]))
 
789
else
 
790
  no_aalib=yes
718
791
fi
719
792
 
720
793
AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes")
723
796
dnl Checks for Color AsCii Art library
724
797
dnl ---------------------------------------------
725
798
 
726
 
AM_PATH_CACA(0.3,, AC_MSG_RESULT([*** All CACA-dependent parts will be disabled ***]))
 
799
AC_ARG_ENABLE([caca],
 
800
  AC_HELP_STRING([--disable-caca], [do not build CACA support]),
 
801
  [with_caca=$enableval], [with_caca=yes])
 
802
 
 
803
if test "x$with_caca" = "xyes"; then
 
804
  AM_PATH_CACA(0.3,, AC_MSG_RESULT([*** All CACA-dependent parts will be disabled ***]))
 
805
else
 
806
  no_caca=yes
 
807
fi
727
808
AM_CONDITIONAL(HAVE_CACA, test x$no_caca != "xyes")
728
809
 
729
 
 
730
810
dnl ---------------------------------------------
731
811
dnl Check solaris framebuffer device support
732
812
dnl ---------------------------------------------
806
886
                enable_directfb=$enableval,
807
887
                enable_directfb=no)
808
888
 
809
 
  DIRECTFB_REQUIRED_VERSION=0.9.9
 
889
  DIRECTFB_REQUIRED_VERSION=0.9.22
810
890
if test x$enable_directfb = "xyes"; then
811
891
  AC_MSG_CHECKING(for DirectFB)
812
892
  if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
829
909
dnl check for SDL
830
910
dnl ---------------------------------------------
831
911
 
832
 
AM_PATH_SDL(1.1.5, 
833
 
        AC_DEFINE(HAVE_SDL,1,[Define this if you have SDL library installed]),
834
 
        [])
 
912
AC_ARG_ENABLE([sdl],
 
913
  AC_HELP_STRING([--disable-sdl], [do not build SDL support]),
 
914
  [with_sdl=$enableval], [with_sdl=yes])
 
915
 
 
916
if test "x$with_sdl" = "xyes"; then
 
917
  AM_PATH_SDL(1.1.5, 
 
918
    AC_DEFINE(HAVE_SDL,1,[Define this if you have SDL library installed]),
 
919
    [])
 
920
else
 
921
  no_sdl=yes
 
922
fi
835
923
AM_CONDITIONAL(HAVE_SDL, [test x"$no_sdl" != x"yes"])
836
924
 
837
925
 
865
953
dnl check for polypaudio
866
954
dnl ---------------------------------------------
867
955
 
868
 
AC_MSG_CHECKING(for polypaudio)
869
 
dnl do some actual testing here
870
 
if test x$PKG_CONFIG = xno ; then
871
 
  AC_MSG_RESULT(no)
872
 
  echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
873
 
  echo "*** All of polypaudio dependent parts will be disabled"
 
956
AC_ARG_ENABLE([polypaudio],
 
957
  AC_HELP_STRING([--disable-polypaudio], [do not build Polypaudio support]),
 
958
  [with_polypaudio=$enableval], [with_polypaudio=yes])
 
959
 
 
960
if test "x$with_polypaudio" = "xyes"; then
 
961
  AC_MSG_CHECKING(for polypaudio)
 
962
  dnl do some actual testing here
 
963
  if test x$PKG_CONFIG = xno ; then
 
964
    AC_MSG_RESULT(no)
 
965
    echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
 
966
    echo "*** All of polypaudio dependent parts will be disabled"
 
967
  else
 
968
      POLYPAUDIO_REQUIRED_VERSION=0.6
 
969
      if $PKG_CONFIG --atleast-version $POLYPAUDIO_REQUIRED_VERSION polyplib ; then
 
970
          POLYPAUDIO_CFLAGS=`$PKG_CONFIG --cflags polyplib`
 
971
          POLYPAUDIO_LIBS=`$PKG_CONFIG --libs polyplib`
 
972
          have_polypaudio="yes"
 
973
          AC_MSG_RESULT(yes)
 
974
      else
 
975
          AC_MSG_RESULT(no)
 
976
          AC_MSG_RESULT([*** All of polypaudio dependent parts will be disabled ***])
 
977
      fi
 
978
  fi
 
979
  AC_SUBST(POLYPAUDIO_CFLAGS)
 
980
  AC_SUBST(POLYPAUDIO_LIBS)
874
981
else
875
 
    POLYPAUDIO_REQUIRED_VERSION=0.6
876
 
    if $PKG_CONFIG --atleast-version $POLYPAUDIO_REQUIRED_VERSION polyplib ; then
877
 
        POLYPAUDIO_CFLAGS=`$PKG_CONFIG --cflags polyplib`
878
 
        POLYPAUDIO_LIBS=`$PKG_CONFIG --libs polyplib`
879
 
        have_polypaudio="yes"
880
 
        AC_MSG_RESULT(yes)
881
 
    else
882
 
        AC_MSG_RESULT(no)
883
 
        AC_MSG_RESULT([*** All of polypaudio dependent parts will be disabled ***])
884
 
    fi
 
982
  have_polypaudio=no
885
983
fi
886
 
AC_SUBST(POLYPAUDIO_CFLAGS)
887
 
AC_SUBST(POLYPAUDIO_LIBS)
888
984
AM_CONDITIONAL(HAVE_POLYPAUDIO, [test x"$have_polypaudio" = x"yes"])
889
985
 
890
986
dnl ---------------------------------------------
998
1094
dnl ---------------------------------------------
999
1095
dnl Ogg/Speex libs.
1000
1096
dnl ---------------------------------------------
1001
 
 
1002
 
PKG_CHECK_MODULES(SPEEX, speex, no_speex="no", no_speex="yes")
1003
 
 
1004
 
if test "x$no_speex" = "xyes" ; then
1005
 
  AM_PATH_OGG([ AM_PATH_SPEEX(no_speex="no")])
 
1097
AC_ARG_ENABLE([speex],
 
1098
  AC_HELP_STRING([--disable-speex], [do not build speex support]),
 
1099
  [with_speex=$enableval], [with_speex=yes])
 
1100
 
 
1101
no_speex=yes
 
1102
 
 
1103
if test "x$with_speex" = "xyes"; then
 
1104
  PKG_CHECK_MODULES(SPEEX, speex, [
 
1105
    no_speex=no
 
1106
 
 
1107
    AC_DEFINE(HAVE_SPEEX,1,[Define this if you have speex])
 
1108
 
 
1109
    dnl Test whether Speex headers are eg. <speex.h> or <speex/speex.h>
 
1110
    dnl Speex headers were moved in mid-2004; 1.0.x has backwards compatible headers, 1.1.x does not
 
1111
    AC_CHECK_HEADER([speex/speex.h], [
 
1112
       AC_DEFINE(HAVE_SPEEX_SUBDIR, [1], [Define to 1 if speex headers are eg. <speex/speex.h>])
 
1113
    ])
 
1114
  ], no_speex="yes")
1006
1115
fi
1007
1116
 
1008
1117
if test "x$no_speex" = "xyes" ; then
1009
1118
  AC_MSG_RESULT([*** All OGG/SPEEX dependent parts will be disabled ***])
1010
 
else
1011
 
  AC_DEFINE(HAVE_SPEEX,1,[Define this if you have speex])
1012
 
 
1013
 
  dnl Test whether Speex headers are eg. <speex.h> or <speex/speex.h>
1014
 
  dnl Speex headers were moved in mid-2004; 1.0.x has backwards compatible headers, 1.1.x does not
1015
 
  AC_CHECK_HEADER([speex/speex.h],
1016
 
                  AC_DEFINE(HAVE_SPEEX_SUBDIR, [1], [Define to 1 if speex headers are eg. <speex/speex.h>])
1017
 
  )
1018
 
 
1019
 
  AC_SUBST(SPEEX_CFLAGS)
1020
 
  AC_SUBST(SPEEX_LIBS)
1021
1119
fi
 
1120
 
 
1121
AC_SUBST(SPEEX_CFLAGS)
 
1122
AC_SUBST(SPEEX_LIBS)
1022
1123
AM_CONDITIONAL(HAVE_SPEEX, [test x"$no_ogg" != "xyes" -a x"$no_speex" != "xyes"])
1023
1124
 
1024
1125
 
1026
1127
dnl check for libFLAC
1027
1128
dnl ---------------------------------------------
1028
1129
 
1029
 
AM_PATH_LIBFLAC([],
1030
 
        AC_MSG_RESULT([*** All FLAC dependent parts will be disabled ***]))
 
1130
AC_ARG_ENABLE([flac],
 
1131
  AC_HELP_STRING([--disable-flac], [do not build flac support]),
 
1132
  [with_flac=$enableval], [with_flac=yes])
 
1133
 
 
1134
if test "x$with_flac" = "xyes"; then
 
1135
  AM_PATH_LIBFLAC([],
 
1136
    AC_MSG_RESULT([*** All FLAC dependent parts will be disabled ***]))
 
1137
else
 
1138
  no_libFLAC=yes
 
1139
fi
1031
1140
AM_CONDITIONAL(HAVE_FLAC, [test x"$no_libFLAC" != "xyes"])
1032
1141
 
 
1142
dnl ---------------------------------------------
 
1143
dnl External version of a52dec
 
1144
dnl ---------------------------------------------
 
1145
 
 
1146
AC_ARG_ENABLE(a52dec, AC_HELP_STRING([--disable-a52dec], [Disable support for a52dec decoding library (default: enabled)]),
 
1147
              [enable_a52dec="$enableval"], [enable_a52dec="yes"])
 
1148
AC_ARG_WITH(external-a52dec, AC_HELP_STRING([--with-external-a52dec], [use external a52dec library (not recommended)]),
 
1149
            [external_a52dec="$withval"], [external_a52dec="no"])
 
1150
 
 
1151
have_a52="no"
 
1152
 
 
1153
if test x"$enable_a52dec" = "xno"; then
 
1154
  AC_MSG_RESULT([a52dec support disabled])
 
1155
elif test x"$external_a52dec" = "xyes"; then
 
1156
  have_a52="yes"
 
1157
  AC_CHECK_HEADERS([a52dec/a52.h a52dec/a52_internal.h],, have_a52="no",
 
1158
[
 
1159
  #ifdef HAVE_SYS_TYPES_H
 
1160
  # include <sys/types.h>
 
1161
  #endif
 
1162
  #ifdef HAVE_INTTYPES_H
 
1163
  # include <inttypes.h>
 
1164
  #endif
 
1165
  #ifdef HAVE_STDINT_H
 
1166
  # include <stdint.h>
 
1167
  #endif
 
1168
 
 
1169
  #include <a52dec/a52.h>
 
1170
])
 
1171
  SAVE_LIBS="$LIBS"
 
1172
  AC_CHECK_LIB([a52], [a52_init],, have_a52="no", [-lm])
 
1173
  LIBS="$SAVE_LIBS"
 
1174
 
 
1175
  if test "x$have_a52" = "xno"; then
 
1176
    AC_MSG_RESULT([*** no usable version of a52dec found, using internal copy ***])
 
1177
  fi
 
1178
else
 
1179
  AC_MSG_RESULT([Use included a52dec support])
 
1180
fi
 
1181
 
 
1182
AM_CONDITIONAL(A52, test x"$enable_a52dec" = "xyes")
 
1183
AM_CONDITIONAL(EXTERNAL_A52DEC, test x"$have_a52" = "xyes")
 
1184
 
 
1185
dnl ---------------------------------------------
 
1186
dnl External version of libmad
 
1187
dnl ---------------------------------------------
 
1188
 
 
1189
AC_ARG_ENABLE(mad, AC_HELP_STRING([--disable-mad], [Disable support for MAD decoding library (default: enabled)]),
 
1190
              [enable_libmad="$enableval"], [enable_libmad="yes"])
 
1191
AC_ARG_WITH(external-libmad, AC_HELP_STRING([--with-external-libmad], [use external libmad library (not recommended)]),
 
1192
            [external_libmad="$withval"], [external_libmad="no"])
 
1193
 
 
1194
have_mad="no"
 
1195
 
 
1196
if test "x$enable_libmad" = "xno"; then
 
1197
  AC_MSG_RESULT([libmad support disabled])
 
1198
elif test x"$external_libmad" = "xyes"; then
 
1199
  PKG_CHECK_MODULES(LIBMAD, [mad], have_mad=yes, have_mad=no)
 
1200
  AC_CHECK_HEADERS([mad.h])
 
1201
  AC_SUBST(LIBMAD_LIBS)
 
1202
  AC_SUBST(LIBMAD_CFLAGS)
 
1203
  if test "x$have_mad" = "xno"; then
 
1204
    AC_MSG_RESULT([*** no usable version of libmad found, using internal copy ***])
 
1205
  fi
 
1206
else
 
1207
  AC_MSG_RESULT([Use included libmad support])
 
1208
fi
 
1209
 
 
1210
AM_CONDITIONAL(MAD, test "x$enable_libmad" = "xyes")
 
1211
AM_CONDITIONAL(EXTERNAL_LIBMAD, test x"$have_mad" = "xyes")
1033
1212
 
1034
1213
dnl ---------------------------------------------
1035
1214
dnl MNG libs.
1036
1215
dnl ---------------------------------------------
1037
1216
 
1038
 
AC_CHECK_LIB(mng, mng_initialize,
 
1217
AC_ARG_ENABLE([mng],
 
1218
  AC_HELP_STRING([--disable-mng], [do not build mng support]),
 
1219
  [with_mng=$enableval], [with_mng=yes])
 
1220
 
 
1221
if test "x$with_mng" = "xyes"; then
 
1222
  AC_CHECK_LIB(mng, mng_initialize,
1039
1223
        [ AC_CHECK_HEADER(libmng.h,
1040
1224
                [ have_libmng=yes
1041
1225
                  MNG_LIBS="-lmng" ], 
1042
1226
                AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))],
1043
1227
        AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))
 
1228
  AC_SUBST(MNG_LIBS)
 
1229
else
 
1230
  have_libmng=no
 
1231
fi
1044
1232
AM_CONDITIONAL(HAVE_LIBMNG, test x"$have_libmng" = "xyes")
1045
 
AC_SUBST(MNG_LIBS)
1046
 
 
1047
 
 
1048
 
dnl ---------------------------------------------
1049
 
dnl PNG lib.
1050
 
dnl ---------------------------------------------
1051
 
 
1052
 
AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no)
1053
 
if test "$LIBPNG_CONFIG" = "no" ; then
1054
 
  AC_CHECK_LIB(png, png_create_read_struct,
1055
 
                  have_libpng=yes
1056
 
                  PNG_LIBS="-lpng",
1057
 
  AC_MSG_RESULT([*** All libpng dependent parts will be disabled ***]))
 
1233
 
 
1234
dnl ---------------------------------------------
 
1235
dnl MagickWand API of Imagemagick.
 
1236
dnl ---------------------------------------------
 
1237
 
 
1238
AC_ARG_ENABLE([imagemagick],
 
1239
  AC_HELP_STRING([--disable-imagemagick], [do not build ImageMagick support]),
 
1240
  [with_imagemagick=$enableval], [with_imagemagick=yes])
 
1241
 
 
1242
if test "x$with_imagemagick" = "xyes"; then
 
1243
  AC_PATH_PROG(WAND_CONFIG, Wand-config, no)
 
1244
  if test "$WAND_CONFIG" = "no" ; then
 
1245
    AC_MSG_RESULT([*** All Imagemagick dependent parts will be disabled, Wand-config not found. ***])
 
1246
    have_imagemagick="no"
 
1247
  else
 
1248
    WAND_CFLAGS=`$WAND_CONFIG --cflags`
 
1249
    WAND_LDFLAGS=`$WAND_CONFIG --ldflags`
 
1250
    WAND_LIBS=`$WAND_CONFIG --libs`
 
1251
    have_imagemagick="yes"
 
1252
    AC_DEFINE(HAVE_WAND,1,[Define this if you have Imagemagick])
 
1253
  fi
1058
1254
else
1059
 
  PNG_CFLAGS=`$LIBPNG_CONFIG --cflags`
1060
 
  PNG_LIBS=`$LIBPNG_CONFIG --libs`
1061
 
  have_libpng="yes"
1062
 
  AC_DEFINE(HAVE_LIBPNG,1,[Define this if you have png library])
 
1255
  have_imagemagick="no"
1063
1256
fi
1064
1257
 
1065
 
AM_CONDITIONAL(HAVE_LIBPNG, test x"$have_libpng" = "xyes" )
1066
 
AC_SUBST(PNG_CFLAGS)
1067
 
AC_SUBST(PNG_LIBS)
1068
 
 
 
1258
AM_CONDITIONAL(HAVE_WAND, test x"$have_imagemagick" = "xyes" )
 
1259
AC_SUBST(WAND_CFLAGS)
 
1260
AC_SUBST(WAND_LDFLAGS)
 
1261
AC_SUBST(WAND_LIBS)
1069
1262
 
1070
1263
dnl ---------------------------------------------
1071
1264
dnl freetype2 lib.
1077
1270
dnl ---------------------------------------------
1078
1271
dnl OSS style audio interface
1079
1272
dnl ---------------------------------------------
 
1273
AC_ARG_ENABLE([oss],
 
1274
  AC_HELP_STRING([--disable-oss], [do not build OSS support]),
 
1275
  [with_oss=$enableval], [with_oss=yes])
1080
1276
 
1081
 
AC_MSG_CHECKING(for OSS audio support)
1082
 
have_ossaudio=no
1083
 
AC_TRY_COMPILE([
 
1277
if test "x$with_oss" = "xyes"; then
 
1278
  AC_MSG_CHECKING(for OSS audio support)
 
1279
  have_ossaudio=no
 
1280
  AC_TRY_COMPILE([
1084
1281
            #ifdef __NetBSD__
1085
1282
            #include <soundcard.h>
1086
1283
            #else
1091
1288
        ],[
1092
1289
            have_ossaudio=yes
1093
1290
        ])
1094
 
AC_MSG_RESULT($have_ossaudio)
 
1291
  AC_MSG_RESULT($have_ossaudio)
 
1292
else
 
1293
  have_ossaudio=no
 
1294
fi
1095
1295
AM_CONDITIONAL(HAVE_OSS, test x"$have_ossaudio" = "xyes")
1096
1296
 
1097
1297
 
1102
1302
AM_PATH_ALSA(0.9.0rc4, 
1103
1303
        [ AC_DEFINE(HAVE_ALSA,1,[Define this if you have Alsa (libasound) installed])
1104
1304
          if test x"$have_alsa09" = "xyes"; then
1105
 
            AC_DEFINE(HAVE_ALSA09,1,[Define this if you have alsa 0.9.x and more installed])
 
1305
            AC_DEFINE(HAVE_ALSA09,1,[Define this if you have ALSA 0.9.x or later installed])
1106
1306
          fi
1107
1307
        ],
1108
1308
        AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
1109
1309
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "xyes")
1110
1310
AM_CONDITIONAL(HAVE_ALSA09, test x"$have_alsa09" = "xyes")
1111
1311
 
1112
 
 
1113
1312
dnl ---------------------------------------------
1114
1313
dnl ESD support
1115
1314
dnl ---------------------------------------------
1116
1315
 
1117
 
AM_PATH_ESD(0.2.8,
 
1316
AC_ARG_ENABLE([esd],
 
1317
  AC_HELP_STRING([--disable-esd], [do not build esd support]),
 
1318
  [with_esd=$enableval], [with_esd=yes])
 
1319
 
 
1320
if test "x$with_esd" = "xyes"; then
 
1321
  AM_PATH_ESD(0.2.8,
1118
1322
        AC_DEFINE(HAVE_ESD,1,[Define this if you have ESD (libesd) installed]),
1119
1323
        AC_MSG_RESULT(*** All of ESD dependent parts will be disabled ***))
 
1324
else
 
1325
  no_esd=yes
 
1326
fi
1120
1327
AM_CONDITIONAL(HAVE_ESD, test x"$no_esd" != "xyes")
1121
1328
 
1122
1329
 
1124
1331
dnl ARTS support
1125
1332
dnl ---------------------------------------------
1126
1333
 
1127
 
AM_PATH_ARTS(0.9.5,
 
1334
AC_ARG_ENABLE([arts],
 
1335
  AC_HELP_STRING([--disable-arts], [do not build arts support]),
 
1336
  [with_arts=$enableval], [with_arts=yes])
 
1337
 
 
1338
if test "x$with_arts" = "xyes"; then
 
1339
  AM_PATH_ARTS(0.9.5,
1128
1340
        AC_DEFINE(HAVE_ARTS,1,[Define this if you have ARTS (libartsc) installed]),
1129
1341
        AC_MSG_RESULT(*** All of ARTS dependent parts will be disabled ***))
 
1342
else
 
1343
  no_arts=yes
 
1344
fi
1130
1345
AM_CONDITIONAL(HAVE_ARTS, test x"$no_arts" != "xyes")
1131
1346
 
1132
1347
 
1134
1349
dnl gnome-vfs support
1135
1350
dnl ---------------------------------------------
1136
1351
 
1137
 
PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0,
 
1352
AC_ARG_ENABLE([gnome],
 
1353
  AC_HELP_STRING([--disable-gnome], [do not build gnome-vfs support]),
 
1354
  [with_gnome=$enableval], [with_gnome=yes])
 
1355
 
 
1356
if test "x$with_gnome" = "xyes"; then
 
1357
  PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0,
1138
1358
                no_gnome_vfs=no,
1139
1359
                no_gnome_vfs=yes)
1140
 
AC_SUBST(GNOME_VFS_CFLAGS)
1141
 
AC_SUBST(GNOME_VFS_LIBS)
1142
 
if test x"$no_gnome_vfs" != "xyes"; then
1143
 
AC_DEFINE(HAVE_GNOME_VFS,1,[Define this if you have gnome-vfs installed])
 
1360
  AC_SUBST(GNOME_VFS_CFLAGS)
 
1361
  AC_SUBST(GNOME_VFS_LIBS)
 
1362
  if test x"$no_gnome_vfs" != "xyes"; then
 
1363
    AC_DEFINE(HAVE_GNOME_VFS,1,[Define this if you have gnome-vfs installed])
 
1364
  else
 
1365
    AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
 
1366
  fi
1144
1367
else
1145
 
AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
 
1368
  no_gnome_vfs=yes
1146
1369
fi
1147
1370
AM_CONDITIONAL(HAVE_GNOME_VFS, test x"$no_gnome_vfs" != "xyes")
1148
1371
 
1151
1374
dnl libsmbclient support
1152
1375
dnl ---------------------------------------------
1153
1376
 
1154
 
AC_CHECK_LIB(smbclient, smbc_init,
 
1377
AC_ARG_ENABLE([samba],
 
1378
  AC_HELP_STRING([--disable-samba], [do not build Samba support]),
 
1379
  [with_samba=$enableval], [with_samba=yes])
 
1380
 
 
1381
if test "x$with_samba" = "xyes"; then
 
1382
  AC_CHECK_LIB(smbclient, smbc_init,
1155
1383
        [ AC_CHECK_HEADER(libsmbclient.h,
1156
1384
                [ have_libsmbclient=yes
1157
1385
                  LIBSMBCLIENT_LIBS="-lsmbclient" ], 
1158
1386
                AC_MSG_RESULT([*** All libsmbclient dependent parts will be disabled ***]))],
1159
1387
        AC_MSG_RESULT([*** All libsmbclient dependent parts will be disabled ***]))
 
1388
  AC_SUBST(LIBSMBCLIENT_LIBS)
 
1389
fi
1160
1390
AM_CONDITIONAL(HAVE_LIBSMBCLIENT, test x"$have_libsmbclient" = "xyes")
1161
 
AC_SUBST(LIBSMBCLIENT_LIBS)
1162
1391
 
1163
1392
 
1164
1393
dnl ---------------------------------------------
1508
1737
              enable_faad=$enableval, enable_faad=yes)
1509
1738
AM_CONDITIONAL(BUILD_FAAD, test x"$enable_faad" = "xyes")
1510
1739
 
 
1740
dnl ---------------------------------------------
 
1741
dnl Optional and external libdts
 
1742
dnl ---------------------------------------------
 
1743
 
 
1744
AC_ARG_ENABLE(dts, AC_HELP_STRING([--disable-dts], [Disable support for DTS decoding library (default: enabled)]),
 
1745
              [enable_libdts="$enableval"], [enable_libdts="yes"])
 
1746
AC_ARG_WITH(external-libdts, AC_HELP_STRING([--with-external-libdts], [use external libdts library (not recommended)]),
 
1747
            [external_libdts="$withval"], [external_libdts="no"])
 
1748
 
 
1749
have_dts="no"
 
1750
 
 
1751
if test "x$enable_libdts" = "xno"; then
 
1752
  AC_MSG_RESULT([libdts support disabled])
 
1753
elif test x"$external_libdts" = "xyes"; then
 
1754
  PKG_CHECK_MODULES(LIBDTS, [libdts], have_dts=yes, have_dts=no)
 
1755
  AC_CHECK_HEADERS([dts.h])
 
1756
  AC_SUBST(LIBDTS_LIBS)
 
1757
  AC_SUBST(LIBDTS_CFLAGS)
 
1758
  if test "x$have_dts" = "xno"; then
 
1759
    AC_MSG_RESULT([*** no usable version of libdts found, using internal copy ***])
 
1760
  fi
 
1761
else
 
1762
  AC_MSG_RESULT([Use included libdts support])
 
1763
fi
 
1764
 
 
1765
AM_CONDITIONAL(DTS, test "x$enable_libdts" = "xyes")
 
1766
AM_CONDITIONAL(EXTERNAL_LIBDTS, test x"$have_dts" = "xyes")
1511
1767
 
1512
1768
dnl ---------------------------------------------
1513
1769
dnl libmodplug support 
1558
1814
AC_CHECK_FUNCS([vsscanf sigaction sigset getpwuid_r nanosleep lstat memset strchr])
1559
1815
AC_FUNC_FSEEKO
1560
1816
AC_DEFINE(_GNU_SOURCE)
1561
 
AC_CHECK_HEADERS(byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h netdb.h sys/times.h sys/ioctl.h)
1562
 
AC_REPLACE_FUNCS(basename gettimeofday setenv strndup strpbrk strsep strtok_r)
 
1817
AC_CHECK_HEADERS(byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h netdb.h dirent.h sys/times.h sys/ioctl.h sys/param.h)
 
1818
AC_REPLACE_FUNCS(basename gettimeofday setenv strndup strpbrk strsep strtok_r timegm unsetenv)
 
1819
AC_CHECK_FUNCS(readlink)
1563
1820
 
1564
1821
AC_LIBSOURCE(hstrerror.c)
1565
1822
AC_LINK_IFELSE([#include <netdb.h>
1573
1830
  AC_LIBOBJ(hstrerror)
1574
1831
fi
1575
1832
 
 
1833
AC_LIBSOURCE(dirent_msvc.c)
 
1834
AC_CHECK_FUNC(opendir,
 
1835
  [AC_DEFINE(HAVE_OPENDIR, 1, [Define to 1 if you have 'opendir' function])],
 
1836
  [if test x"$SYS" = "xmingw32"; then
 
1837
    AC_LIBOBJ(dirent_msvc)
 
1838
  else
 
1839
    AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)])
 
1840
  fi])
 
1841
 
1576
1842
AH_BOTTOM([/* include internal system specific header */
1577
1843
#include "os_internal.h"])
1578
1844
 
1587
1853
dnl dummy
1588
1854
ASFLAGS="$ASFLAGS"
1589
1855
AC_SUBST(ASFLAGS)
1590
 
 
1591
 
 
1592
 
if test "$GCC" = yes; then
1593
 
    dnl
1594
 
    dnl check cflags not supported by all gcc versions
1595
 
    dnl eg: -mpreferred-stack-boundary=2 and 2.91.66,
1596
 
    dnl and gcc-2.7.2.3 support a bit less options
1597
 
    dnl
1598
 
    AC_TRY_CFLAGS("-mpreferred-stack-boundary=2", 
1599
 
        m_psb="-mpreferred-stack-boundary=2", m_psb="")
1600
 
    AC_TRY_CFLAGS("-fno-strict-aliasing", f_nsa="-fno-strict-aliasing", f_nsa="")
1601
 
    AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="")
1602
 
    AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="")
1603
 
    dnl
1604
 
    dnl gcc 3.1 uses the -f version
1605
 
    dnl
1606
 
    AC_TRY_CFLAGS("-falign-functions=4", f_af="-falign-functions=4",
1607
 
        f_af="-malign-functions=4")
1608
 
    AC_TRY_CFLAGS("-falign-loops=4", f_al="-falign-loops=4",
1609
 
        f_al="-malign-loops=4")
1610
 
    AC_TRY_CFLAGS("-falign-jumps=4", f_aj="-falign-jumps=4",
1611
 
        f_aj="-malign-jumps=4")
1612
 
    dnl
1613
 
    dnl Check for some optimization disabling
1614
 
    dnl needed for win32 code
1615
 
    dnl
1616
 
    AC_TRY_CFLAGS("-fno-omit-frame-pointer", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-omit-frame-pointer",)
1617
 
    AC_TRY_CFLAGS("-fno-inline-functions", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-inline-functions",)
1618
 
    AC_TRY_CFLAGS("-fno-rename-registers", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-rename-registers",)
1619
 
    AC_SUBST(W32_NO_OPTIMIZE)
1620
 
    dnl
1621
 
    dnl Multipass compilation
1622
 
    dnl
1623
 
    AC_TRY_CFLAGS("-fprofile-arcs", PASS1_CFLAGS="-fprofile_arcs $PASS1_CFLAGS",)
1624
 
    AC_TRY_CFLAGS("-fbranch-probabilities", PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS",)
1625
 
    AC_SUBST(PASS1_CFLAGS)
1626
 
    AC_SUBST(PASS2_CFLAGS)
1627
 
    dnl
1628
 
    dnl Warnings
1629
 
    dnl
1630
 
    CFLAGS="-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes $CFLAGS"
1631
 
    CFLAGS="-Wnested-externs -Wcast-align $CFLAGS"
1632
 
    dnl some combinations of gcc+glibc produce useless warnings on memset
1633
 
    dnl when compiling with -Wpointer-arith, so we check for this first
1634
 
    AC_MSG_CHECKING(for sane -Wpointer-arith)
1635
 
    SAVE_CFLAGS="$CFLAGS"
1636
 
    CFLAGS="-O2 -Wpointer-arith -Werror $CFLAGS"
1637
 
    AC_TRY_COMPILE([#include <string.h>],[int a; memset(&a, 0, sizeof(int));],
1638
 
        [AC_MSG_RESULT(yes); CFLAGS="-Wpointer-arith $SAVE_CFLAGS"],
1639
 
        [AC_MSG_RESULT(no);  CFLAGS="$SAVE_CFLAGS"]);
1640
 
fi
1641
 
 
1642
 
dnl Flags not supported by all *cc* variants
1643
 
AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="")
1644
1856
 
1645
1857
dnl check for __attribute__ ((aligned ()))
1646
1858
dnl WARNING! Do not move this check behind the $(MULTIPASS_CFLAGS)!
1648
1860
AC_C_ATTRIBUTE_ALIGNED
1649
1861
 
1650
1862
dnl Common cflags for all platforms
1651
 
CFLAGS="$wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
1652
 
DEBUG_CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"
 
1863
CFLAGS="-DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
 
1864
DEBUG_CFLAGS="-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"
 
1865
 
 
1866
AC_OPTIMIZATIONS
1653
1867
 
1654
1868
enable_w32dll="no"
1655
1869
enable_ffmmx="no"
1656
1870
enable_armv4l="no"
1657
1871
 
1658
1872
case "$host_or_hostalias" in
1659
 
  i386-*-freebsd*)
1660
 
    CFLAGS="-pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
1661
 
    DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS"
1662
 
    AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture])
 
1873
  i?86-* | k?-* | athlon-* | pentium*-)
 
1874
    dnl enable x86 specific parts of the code
 
1875
    dnl
 
1876
    dnl all of this stuff needs gcc/gas; it uses gnu c compiler extensions
 
1877
    dnl like the extended asm() or __attribute(__cdecl__), or other direct
 
1878
    dnl mmx/sse/3dnow assembler instructions. 
 
1879
    dnl
1663
1880
    AC_DEFINE_UNQUOTED(ARCH_X86,,[Define this if you're running x86 architecture])
1664
 
    AC_DEFINE_UNQUOTED(FPM_INTEL,,[Define to select libmad fixed point arithmetic implementation])
1665
 
 
 
1881
    AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
 
1882
    enable_ffmmx="yes"
1666
1883
    enable_w32dll="yes"
1667
 
    enable_ffmmx="yes"
1668
 
    no_fpic="yes"
1669
 
    ;;
1670
 
 
1671
 
 
1672
 
 
1673
 
  i?86-*-linux* | i386-*-solaris* | i?86-* | k?-* | athlon-* | pentium*)
1674
 
    if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then
1675
 
 
1676
 
      if test "$GCC" = yes ; then
1677
 
        dnl Check for gcc cpu optimization support
1678
 
        AC_TRY_CFLAGS("-mtune=i386", 
1679
 
          sarchopt="-mtune",
1680
 
          AC_TRY_CFLAGS("-mcpu=i386", 
1681
 
            sarchopt="-mcpu",
1682
 
            AC_TRY_CFLAGS("-march=i386", 
1683
 
              sarchopt="-march",
1684
 
              [ AC_MSG_RESULT(** no cpu optimization supports **)
1685
 
                sarchopt=no 
1686
 
              ]
1687
 
            )
1688
 
          )
1689
 
        )
1690
 
 
1691
 
        dnl special check for k7 cpu CC support
1692
 
        AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686")
1693
 
 
1694
 
        dnl add x86 specific gcc CFLAGS
1695
 
        CFLAGS="-O3 -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
1696
 
 
1697
 
        DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1698
 
 
1699
 
        if test x"$sarchopt" != "xno"; then
1700
 
            [
1701
 
            archopt_val=
1702
 
 
1703
 
            case "$host_or_hostalias" in
1704
 
            i386-*) # *BSD return this even on a P III #-))
1705
 
                archopt_val="i386" ;;
1706
 
            i486-*) # oh dear!
1707
 
                archopt_val="i486" ;;
1708
 
            i586-*)
1709
 
                archopt_val="pentium" 
1710
 
                ;;
1711
 
            pentium-mmx-*)
1712
 
                archopt_val="pentium-mmx" 
1713
 
                ;;
1714
 
            pentiumpro-* | pentium2-* | i686-*)
1715
 
                archopt_val="pentiumpro"
1716
 
                if test x"$check_athlon" = "xyes"; then
1717
 
                    if test -f /proc/cpuinfo; then
1718
 
                        modelname=`cat /proc/cpuinfo | grep "model\ name\       :" | sed -e 's/ //g' | cut -d':' -f2`
1719
 
                        case "$modelname" in
1720
 
                        *Athlon* | *Duron* | *K7*)
1721
 
                            archopt_val="$k7cpu"
1722
 
                            ;;
1723
 
                        VIAEzra)
1724
 
                            archopt_val="c3"
1725
 
                            ;;
1726
 
                        esac
1727
 
                    fi 
1728
 
                fi
1729
 
                ;;
1730
 
            k6-2-* | k6-3-*)
1731
 
                archopt_val="k6-2"
1732
 
                ;;
1733
 
            k6-*)
1734
 
                archopt_val="k6"
1735
 
                ;;
1736
 
            pentium3-*)
1737
 
                archopt_val="pentium3"
1738
 
                ;;
1739
 
            pentium4-*)
1740
 
                archopt_val="pentium4"
1741
 
                ;;
1742
 
            athlon-4-* | athlon-xp-* | athlon-mp-*)
1743
 
                archopt_val="athlon-4"
1744
 
                ;;
1745
 
            k7-* | athlon-tbird-* | athlon-*)
1746
 
                archopt_val="athlon"
1747
 
                ;;
1748
 
            
1749
 
            esac
1750
 
            if test x"$archopt_val" != x; then
1751
 
                CFLAGS="$sarchopt=$archopt_val $CFLAGS"
1752
 
                DEBUG_CFLAGS="$sarchopt=$archopt_val $DEBUG_CFLAGS"
1753
 
            fi
1754
 
            ]
1755
 
        fi
1756
 
      else
1757
 
        dnl we have the Intel compiler
1758
 
        CFLAGS="-unroll -ipo -ipo_obj -O3 $CFLAGS"
1759
 
        PASS1_CFLAGS="-prof_genx -prof_dir \$(PWD)/\$(top_builddir)/ $PASS1_CFLAGS"
1760
 
        PASS2_CFLAGS="-prof_use -prof_dir \$(PWD)/\$(top_builddir)/ $PASS2_CFLAGS"
1761
 
        AC_SUBST(PASS1_CFLAGS)
1762
 
        AC_SUBST(PASS2_CFLAGS)
1763
 
      fi
1764
 
        
1765
 
        dnl enable x86 specific parts of the code
1766
 
        dnl
1767
 
        dnl all of this stuff needs gcc/gas; it uses gnu c compiler extensions
1768
 
        dnl like the extended asm() or __attribute(__cdecl__), or other direct
1769
 
        dnl mmx/sse/3dnow assembler instructions. 
1770
 
        dnl
1771
 
        AC_DEFINE_UNQUOTED(ARCH_X86,,[Define this if you're running x86 architecture])
1772
 
        AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
1773
 
        enable_ffmmx="yes"
1774
 
        enable_w32dll="yes"
1775
 
 
1776
 
        case "$host_or_hostalias" in
1777
 
        *-*-mingw*)
1778
 
          enable_w32dll="no" 
1779
 
          ;;
1780
 
        *-*-cygwin) 
1781
 
          enable_w32dll="no" 
1782
 
          LIBS="$LIBS @INTLLIBS@ -lkernel32"
1783
 
          ;;
1784
 
        esac
1785
 
    else
1786
 
        dnl add x86 specific cc CFLAGS
1787
 
        CFLAGS="-O $CFLAGS"
1788
 
        DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1789
 
        AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
1790
 
    fi
1791
 
 
1792
 
    no_fpic="yes"
1793
 
    AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture])
1794
 
    ;;
1795
 
 
1796
 
  alphaev56-*)
1797
 
    CFLAGS="-O3 -mcpu=ev56 -mieee $CFLAGS"
1798
 
    DEBUG_CFLAGS="-O3 -mcpu=ev56 -mieee $DEBUG_CFLAGS"
1799
 
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
1800
 
    ;;
1801
 
 
1802
 
  alpha*)
1803
 
    CFLAGS="-O3 -mieee $CFLAGS"
1804
 
    DEBUG_CFLAGS="-O3 -mieee $DEBUG_CFLAGS"
1805
 
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
1806
 
    ;;
1807
 
  
 
1884
 
 
1885
    case "$host_or_hostalias" in
 
1886
      *-*-mingw*)
 
1887
        enable_w32dll="no" 
 
1888
        ;;
 
1889
      *-*-cygwin) 
 
1890
        enable_w32dll="no" 
 
1891
        LIBS="$LIBS @INTLLIBS@ -lkernel32"
 
1892
        ;;
 
1893
    esac
 
1894
    ;;
 
1895
  x86_64-*)
 
1896
    AC_DEFINE_UNQUOTED(ARCH_X86_64,,[Define this if you're running x86 architecture])
 
1897
    AC_DEFINE(FPM_64BIT,1,[Define to select libmad fixed point arithmetic implementation])
 
1898
    ;;
1808
1899
  *darwin*)
1809
1900
    HOST_OS_DARWIN=1
1810
1901
    AC_DEFINE_UNQUOTED(HOST_OS_DARWIN, 1, [Define this if built on Mac OS X/Darwin])
1811
 
    CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions -no-cpp-precomp -D_INTL_REDIRECT_MACROS $CFLAGS"
1812
 
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1813
1902
    
1814
1903
    dnl avoid ppc compilation crash
1815
1904
    AS="$CC"
1824
1913
    dnl Do not use AC_SUBST(OBJCDEPMODE): we don't need it as long we use
1825
1914
    dnl _AM_DEPENDENCIES (below), and doing the AC_SUBST elicits a warning
1826
1915
    dnl from automake 1.6.
 
1916
    
1827
1917
    if test x$enable_altivec = xyes; then
1828
1918
        AC_DEFINE_UNQUOTED(ENABLE_ALTIVEC,,[Define this if you want to use altivec on PowerPC CPUs])
1829
1919
        CFLAGS="$CFLAGS -faltivec"
1830
1920
        LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -force_cpusubtype_ALL -faltivec"
1831
1921
    fi
1832
1922
    ;;
1833
 
 
1834
1923
  ppc-*-linux* | powerpc-*) 
1835
 
    CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
1836
 
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1837
1924
    dnl avoid ppc compilation crash
1838
1925
    AS="$CC"
1839
1926
    AC_DEFINE_UNQUOTED(FPM_PPC,,[Define to select libmad fixed point arithmetic implementation])
1845
1932
        DEBUG_CFLAGS="-Wa,-m7400 $DEBUG_CFLAGS"
1846
1933
    fi
1847
1934
    ;;
1848
 
 
1849
1935
  sparc*-*-linux*)
1850
 
    case $host_alias in
1851
 
    sparc-*)    cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
1852
 
    sparc64-*)
1853
 
      cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc"
1854
 
      if test x$enable_vis = xyes; then
1855
 
        AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
1856
 
      fi
1857
 
    ;;
1858
 
    esac
1859
 
 
1860
 
    CFLAGS="-O3 $cpu_cflags -funroll-loops -finline-functions $CFLAGS"
1861
 
    DEBUG_CFLAGS="-O $cpu_cflags -funroll-loops -finline-functions $DEBUG_CFLAGS"
 
1936
    if test x$enable_vis = xyes; then
 
1937
      AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
 
1938
    fi
1862
1939
 
1863
1940
    AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
1864
1941
    AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
1865
1942
    ;;
1866
 
 
1867
1943
  sparc-*-solaris*)
1868
1944
    if test "$GCC" = yes; then
1869
 
        case `uname -m` in
1870
 
        sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
1871
 
        sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
1872
 
        sun4u)
1873
 
          case `$CC --version 2>/dev/null` in
1874
 
          1.*|2.*)
1875
 
            # -mcpu=ultrasparc triggers a GCC 2.95.x compiler bug when
1876
 
            # compiling video_out.c:
1877
 
            #   gcc: Internal compiler error: program cc1 got fatal signal 11
1878
 
            # avoid -mcpu=ultrasparc with gcc 2.*
1879
 
            cpu_cflags="-mcpu=v8 -mtune=ultrasparc"
1880
 
            ;;
1881
 
          *)
1882
 
            # GCC 3 or newer should have no problem with -mcpu=ultrasparc 
1883
 
            cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc"
1884
 
            if test x$enable_vis = xyes; then
1885
 
              AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
1886
 
            fi
1887
 
            ;;
1888
 
          esac
1889
 
          ;;
1890
 
        *)     cpu_cflags= ;;
1891
 
        esac
1892
 
 
1893
 
        cc_optimize_cflags="-O3 $cpu_cflags -funroll-loops -finline-functions"
1894
 
        cc_debug_cflags="-O $cpu_cflags -funroll-loops -finline-functions"
1895
 
 
1896
 
        AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])          dnl uses gnu c asm extensions
1897
 
        AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
 
1945
      case `$CC --version 2>/dev/null` in
 
1946
        1.*|2.*) ;;
 
1947
        *)
 
1948
          if test x$enable_vis = xyes; then
 
1949
            AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
 
1950
          fi
 
1951
          ;;
 
1952
      esac
 
1953
  
 
1954
      AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
 
1955
      AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
1898
1956
    else
1899
 
        case `uname -m` in
1900
 
        sun4c) cpu_cflags="-xarch=v7" ;;
1901
 
        sun4m) cpu_cflags="-xarch=v8" ;;
1902
 
        sun4u) cpu_cflags="-xarch=v8plusa" ;;
1903
 
        esac
1904
 
 
1905
 
        cc_optimize_cflags="-fast $cpu_cflags -xCC"
1906
 
        cc_debug_cflags="-O"
1907
 
        AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])          dnl use portable version with non-gcc
 
1957
      AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
1908
1958
    fi
1909
 
    CFLAGS="$cc_optimize_cflags $CFLAGS"
1910
 
    DEBUG_CFLAGS="$cc_debug_cflags $DEBUG_CFLAGS"
1911
1959
    ;;
1912
 
 
1913
1960
  mips-*)
1914
 
    CFLAGS="-O3 $CFLAGS"
1915
 
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1916
1961
    AC_DEFINE_UNQUOTED(FPM_MIPS,,[Define to select libmad fixed point arithmetic implementation])
1917
1962
    ;;
1918
 
 
1919
 
  m68k-*)
1920
 
    # used to be -O2, but that makes gcc 2.95.2 segfault
1921
 
    # see http://bugs.debian.org/146006 for more info
1922
 
    CFLAGS="-O $CFLAGS"
1923
 
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1924
 
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
1925
 
    ;;
1926
 
 
1927
 
  ia64-*)
1928
 
    CFLAGS="-O3 $CFLAGS"
1929
 
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1930
 
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
1931
 
  ;;
1932
 
 
1933
 
  hppa-*)
1934
 
    dnl -O3 seems to trigger gcc internal compiler errors, at least up to gcc 3.2.1
1935
 
    CFLAGS="-O $CFLAGS"
1936
 
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1937
 
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
1938
 
    ;;
1939
 
 
1940
 
  hppa*-hp-*)
1941
 
    dnl -O3 seems to trigger gcc internal compiler errors, at least up to gcc 3.2.1
1942
 
    CFLAGS="-O2 $CFLAGS"
1943
 
    DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS"
1944
 
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed pointarithmetic implementation])
1945
 
    ;;
1946
 
 
1947
 
  x86_64-*)
1948
 
    CFLAGS="-O3 -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions $CFLAGS"
1949
 
    DEBUG_CFLAGS="-O0 -g $DEBUG_CFLAGS"
1950
 
    AC_DEFINE_UNQUOTED(ARCH_X86_64,,[Define this if you're running x86 architecture])
1951
 
    AC_DEFINE(FPM_64BIT,1,[Define to select libmad fixed point arithmetic implementation])
1952
 
    ;;
1953
 
 
1954
 
  s390-*)
1955
 
    CFLAGS="-O3 $CFLAGS"
1956
 
    DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1957
 
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
1958
 
    ;;
1959
 
 
 
1963
  alphaev56-* | alpha* | ia64-* | hppa*-linux-*)
 
1964
    AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
 
1965
    ;;
1960
1966
  armv4l-*-linux*)
1961
 
    CFLAGS="-O2 -fsigned-char -ffast-math -mcpu=strongarm1100 -fomit-frame-pointer -fthread-jumps -fregmove $CFLAGS"
1962
 
    dnl    CFLAGS="-O1 -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -finline-functions -fsigned-char -fomit-frame-pointer -march=armv4 -mtune=strongarm $CFLAGS"
1963
 
    DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS"
1964
1967
    AC_DEFINE_UNQUOTED(FPM_ARM,,[Define to select libmad fixed point arithmetic implementation])
1965
1968
    enable_armv4l="yes"
1966
1969
    ;;
1967
 
  
1968
1970
  *)
1969
 
    echo
1970
 
    echo "****************************** WARNING ******************************"
1971
 
    echo
1972
 
    echo "Host type '$host' ($host_alias) is currently not supported by xine"
1973
 
    echo
1974
 
    echo "Assuming that -O3 makes the compiler produce useful code."
1975
 
    echo
1976
 
    echo "You might experience problems with this, so please report your"
1977
 
    echo "architecture and, if possible, known good optimization flags for"
1978
 
    echo "your compiler to <xine-devel@lists.sf.net>"\!
1979
 
    echo
1980
 
    echo "*********************************************************************"
1981
 
    echo "(sleeping one minute so you can read this...)"
1982
 
    sleep 60
1983
 
 
1984
 
    CFLAGS="-O3 $CFLAGS"
1985
 
    DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1986
1971
    AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
1987
1972
    ;;
1988
1973
esac
2051
2036
if test "x$exec_prefix" = xNONE; then
2052
2037
   exec_prefix='${prefix}'
2053
2038
fi
 
2039
 
 
2040
dnl
 
2041
dnl installation directories and directories relative to prefix
 
2042
dnl
 
2043
dnl Note:
 
2044
dnl   use AC_DEFINE for runtime
 
2045
dnl   use AC_SUBST for installation
 
2046
dnl
 
2047
XINE_PLUGINDIR="$libdir/xine/plugins/$XINE_MAJOR.$XINE_MINOR.$XINE_SUB"
 
2048
XINE_FONTDIR="${datadir}/xine/libxine$XINE_MAJOR/fonts"
 
2049
XINE_LOCALEDIR="${datadir}/locale"
 
2050
eval XINE_REL_PLUGINDIR="$XINE_PLUGINDIR"
 
2051
XINE_REL_PLUGINDIR=`eval echo "$XINE_REL_PLUGINDIR" | sed -e "s,^${prefix}/,,"`
 
2052
XINE_REL_FONTDIR=`eval echo "$XINE_FONTDIR" | sed -e "s,^${prefix}/,,"`
 
2053
XINE_REL_LOCALEDIR=`eval echo "$XINE_LOCALEDIR" | sed -e "s,^${prefix}/,,"`
 
2054
if test x"$SYS" = "xmingw32"; then
 
2055
  dnl polish paths (MinGW runtime accepts both \ and / anyway)
 
2056
  XINE_REL_PLUGINDIR=`echo "$XINE_REL_PLUGINDIR" | sed -e 's/\\//\\\\\\\\/g'`
 
2057
  XINE_REL_FONTDIR=`echo "$XINE_REL_FONTDIR" | sed -e 's/\\//\\\\\\\\/g'`
 
2058
  XINE_REL_LOCALEDIR=`echo "$XINE_REL_LOCALEDIR" | sed -e 's/\\//\\\\\\\\/g'`
 
2059
fi
2054
2060
if test x"$SYS" = "xmingw32" -o x"$SYS" = "xcygwin"; then
2055
 
  dnl installation directories
2056
 
  eval XINE_PLUGINDIR="${bindir}/plugins"
2057
 
  eval XINE_FONTDIR="${bindir}/fonts"
2058
 
  eval XINE_LOCALEDIR="${bindir}/locale"
2059
 
  dnl directories from xine-config
2060
 
  XINE_PLUGINPATH="\`dirname \$0\`/plugins"
2061
 
  XINE_FONTPATH="\`dirname \$0\`/fonts"
2062
 
  XINE_LOCALEPATH="\`dirname \$0\`/locale"
 
2061
  dnl prefix in xine-config
 
2062
  XINE_CONFIG_PREFIX="\`dirname \$0\`/.."
 
2063
  dnl installation directories (in xine-config)
 
2064
  XINE_PLUGINPATH="$XINE_CONFIG_PREFIX/$XINE_REL_PLUGINDIR"
 
2065
  XINE_FONTPATH="$XINE_CONFIG_PREFIX/$XINE_REL_FONTDIR"
 
2066
  XINE_LOCALEPATH="$XINE_CONFIG_PREFIX/$XINE_REL_LOCALEDIR"
2063
2067
  dnl runtime directories
2064
 
  AC_DEFINE(XINE_PLUGINDIR,[exec_path_append_subdir("plugins")],[Define this to plugins directory location])
2065
 
  AC_DEFINE(XINE_FONTDIR,[exec_path_append_subdir("fonts")],[Define this to osd fonts dir location])
2066
 
  AC_DEFINE(XINE_LOCALEDIR,[exec_path_append_subdir("locale")],[Path where catalog files will be.])
 
2068
  AC_DEFINE(XINE_PLUGINDIR,[xine_get_plugindir()],[Define this to plugins directory location])
 
2069
  AC_DEFINE(XINE_FONTDIR,[xine_get_fontdir()],[Define this to osd fonts dir location])
 
2070
  AC_DEFINE(XINE_LOCALEDIR,[xine_get_localedir()],[Path where catalog files will be.])
 
2071
else
2067
2072
  dnl prefix in xine-config
2068
 
  XINE_CONFIG_PREFIX="\`dirname \$0\`/.."
2069
 
else
2070
 
  dnl installation directories
2071
 
  XINE_PLUGINDIR="$libdir/xine/plugins/$XINE_MAJOR.$XINE_MINOR.$XINE_SUB"
2072
 
  XINE_FONTDIR="${datadir}/xine/libxine$XINE_MAJOR/fonts"
2073
 
  XINE_LOCALEDIR="${datadir}/locale"
 
2073
  XINE_CONFIG_PREFIX="${prefix}"
2074
2074
  dnl directories from xine-config and runtime directories
2075
2075
  eval XINE_PLUGINPATH=`eval echo "$XINE_PLUGINDIR"`
2076
2076
  eval XINE_FONTPATH="$XINE_FONTDIR"
2079
2079
  AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH",[Define this to plugins directory location])
2080
2080
  AC_DEFINE_UNQUOTED(XINE_FONTDIR,"$XINE_FONTPATH",[Define this to osd fonts dir location])
2081
2081
  AC_DEFINE_UNQUOTED(XINE_LOCALEDIR, "$XINE_LOCALEPATH",[Path where catalog files will be.])
2082
 
  dnl prefix in xine-config
2083
 
  XINE_CONFIG_PREFIX="${prefix}"
2084
2082
fi
 
2083
AC_DEFINE_UNQUOTED(XINE_REL_PLUGINDIR,"$XINE_REL_PLUGINDIR",[Define this to plugin directory relative to execution prefix])
 
2084
AC_DEFINE_UNQUOTED(XINE_REL_FONTDIR,"$XINE_REL_FONTDIR",[Define this to font directory relative to prefix])
 
2085
AC_DEFINE_UNQUOTED(XINE_REL_LOCALEDIR,"$XINE_REL_LOCALEDIR",[Define this to font directory relative to prefix])
2085
2086
AC_SUBST(XINE_CONFIG_PREFIX)
2086
2087
AC_SUBST(XINE_PLUGINPATH)
2087
2088
AC_SUBST(XINE_FONTPATH)
2108
2109
dnl Some informations about xine-lib compilation
2109
2110
dnl ---------------------------------------------
2110
2111
 
2111
 
XINE_BUILD_CC="`$CC -v 2>&1 | tail -1`"
 
2112
XINE_BUILD_CC="`$CC -v 2>&1 | tail -n 1`"
2112
2113
XINE_BUILD_OS="`uname -s -r -m`"
2113
2114
XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
2114
2115
AC_SUBST(XINE_BUILD_CC)
2121
2122
dnl ---------------------------------------------
2122
2123
 
2123
2124
AC_ARG_WITH(w32-path, AC_HELP_STRING([--with-w32-path=path], [location of WIN32 libraries]),
2124
 
            w32_path="$withval", w32_path="/usr/lib/win32")
 
2125
            w32_path="$withval", w32_path="/usr/lib/codecs")
2125
2126
AC_SUBST(w32_path)
2126
2127
 
2127
2128
 
2129
2130
dnl some include paths ( !!! DO NOT REMOVE !!! )
2130
2131
dnl ---------------------------------------------
2131
2132
 
2132
 
INCLUDES='-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_builddir)/src/xine-engine -I$(top_srcdir)/src/xine-engine -I$(top_srcdir)/src/xine-utils $(INTLDIR) -I$(top_builddir)/src/input -I$(top_srcdir)/src/input $(WIN32_CPPFLAGS) $(THREAD_INCLUDES) $(ZLIB_INCLUDES) -I$(top_srcdir)/lib'
 
2133
INCLUDES='-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_builddir)/src/xine-engine -I$(top_srcdir)/src/xine-engine -I$(top_srcdir)/src/xine-utils $(INTLDIR) -I$(top_builddir)/src/input -I$(top_srcdir)/src/input $(WIN32_CPPFLAGS) -I$(top_srcdir)/lib'
2133
2134
AC_SUBST(INCLUDES)
2134
2135
 
2135
2136
 
2252
2253
src/libffmpeg/libavcodec/ppc/Makefile
2253
2254
src/libffmpeg/libavcodec/sparc/Makefile
2254
2255
src/libffmpeg/libavcodec/libpostproc/Makefile
 
2256
src/libffmpeg/libavutil/Makefile
2255
2257
src/libflac/Makefile
2256
2258
src/liblpcm/Makefile
2257
2259
src/libmad/Makefile
2297
2299
src/xine-utils/Makefile
2298
2300
src/xine-engine/Makefile
2299
2301
win32/Makefile
2300
 
win32/contrib/Makefile
2301
 
win32/contrib/pthreads/Makefile
2302
 
win32/contrib/zlib/Makefile
2303
2302
win32/include/Makefile])
2304
2303
AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/relchk.sh]],[[]])
2305
2304
AC_OUTPUT
2400
2399
echo "   - ws aud        - pva"
2401
2400
echo "   - vox           - nsf"
2402
2401
echo "   - nsv           - 4xm"
2403
 
echo "   - ac3           - aac"
 
2402
echo "                   - aac"
2404
2403
echo "   - iff           - matroska"
2405
2404
echo "   - vmd           - flv"
2406
2405
if test x"$enable_asf" = "xyes"; then
2415
2414
if test x"$have_modplug" = x"yes"; then
2416
2415
  echo "   - mod"
2417
2416
fi
 
2417
if test x"$enable_a52dec" = "xyes"; then
 
2418
  if test x"$have_a52" = "xyes"; then
 
2419
    echo "   - ac3 (external library)"
 
2420
  else
 
2421
    echo "   - ac3 (internal library)"
 
2422
  fi
 
2423
fi
2418
2424
echo ""
2419
2425
 
2420
2426
dnl video decoders
2449
2455
if test x"$enable_w32dll" = "xyes"; then
2450
2456
  echo "   - w32dll"
2451
2457
fi
2452
 
if test x"$have_libpng" = "xyes"; then
2453
 
  echo "   - png"
 
2458
if test x"$have_imagemagick" = "xyes"; then
 
2459
  echo "   - image"
2454
2460
fi
2455
2461
if test x"$no_theora" != "xyes"; then
2456
2462
  echo "   - theora"
2459
2465
 
2460
2466
dnl audio decoders
2461
2467
echo " * audio decoder plugins:"
2462
 
echo "   - A52/ra-dnet     - DTS"
2463
 
echo "   - MAD (MPG 1/2/3) - GSM 06.10"
 
2468
echo "   - GSM 06.10"
2464
2469
echo "   - linear PCM      - Nosefart (NSF)"
2465
2470
if test x"$external_ffmpeg_found" = "xyes"; then
2466
2471
  echo "   - ffmpeg (external library):"
2473
2478
echo "     - MS ADPCM      - IMA ADPCM"
2474
2479
echo "     - XA ADPCM      - Game DPCM/ADPCM"
2475
2480
echo "     - Mace 3:13     - Mace 6:1"
2476
 
echo "     - FLAC"
 
2481
if test x"no_libFLAC" != "xyes"; then
 
2482
  echo "     - FLAC"
 
2483
fi
2477
2484
if test x"$no_vorbis" != "xyes"; then
2478
2485
  echo "   - vorbis"
2479
2486
fi
2486
2493
if test x"$enable_faad" = "xyes"; then
2487
2494
  echo "   - faad"
2488
2495
fi
 
2496
if test x"$enable_libmad" = "xyes"; then
 
2497
  if test x"$have_mad" = "xyes"; then
 
2498
    echo "   - MAD (MPG 1/2/3) (external library)"
 
2499
  else
 
2500
    echo "   - MAD (MPG 1/2/3) (internal library)"
 
2501
  fi
 
2502
fi
 
2503
if test x"$enable_libdts" = "xyes"; then
 
2504
  if test x"$have_dts" = "xyes"; then
 
2505
    echo "   - DTS (external library)"
 
2506
  else
 
2507
    echo "   - DTS (internal library)"
 
2508
  fi
 
2509
fi
 
2510
if test x"$enable_a52dec" = "xyes"; then
 
2511
  if test x"$have_a52" = "xyes"; then
 
2512
    echo "   - A52/ra-dnet (external library)"
 
2513
  else
 
2514
    echo "   - A52/ra-dnet (internal library)"
 
2515
  fi
 
2516
fi
2489
2517
echo ""
2490
2518
 
2491
2519
dnl spu decoders
2611
2639
  echo "   - oss (Open Sound System)"
2612
2640
fi
2613
2641
if test x"$no_alsa" != "xyes"; then
2614
 
  if test x"$have_alsa09" = "xyes"; then
2615
 
    echo "   - alsa (Alsa 0.9.x)"
 
2642
  if test x"$have_alsa_1_0_9" = "xyes"; then
 
2643
    echo "   - alsa (ALSA >= 1.0.9)"
 
2644
  elif test x"$have_alsa09" = "xyes"; then
 
2645
    echo "   - alsa (ALSA >= 0.9, < 1.0.9)"
2616
2646
  fi
2617
2647
fi
2618
2648
if test x"$no_esd" != "xyes"; then