summaryrefslogtreecommitdiff
path: root/configure.in
blob: 0b48be007b2fbbc7acc4be1887b5230354ffbb85 (plain)
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
dnl
dnl Configure.in for xine
dnl

AC_INIT(src/xine-engine/xine.c)

dnl
dnl Require autoconf version 2.13
dnl
AC_PREREQ(2.13)

dnl
dnl Require libtool minimum version 1.4.0
dnl
dnl AC_PREREQ_LIBTOOL(1.4.0,,AC_MSG_ERROR(*** You should have libtool >= 1.4 installed ***))


XINE_MAJOR=0
XINE_MINOR=5
XINE_SUB=3
XINE_PRE=""
TAR_NAME="xine-lib-"$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE

AC_SUBST(XINE_MAJOR)
AC_SUBST(XINE_MINOR)
AC_SUBST(XINE_SUB)

AC_DEFINE_UNQUOTED(XINE_MAJOR, $XINE_MAJOR)
AC_DEFINE_UNQUOTED(XINE_MINOR, $XINE_MINOR)
AC_DEFINE_UNQUOTED(XINE_SUB, $XINE_SUB)

AC_SUBST(TAR_NAME)
AC_SUBST(SPEC_VERSION)

AM_INIT_AUTOMAKE("xine-lib", $XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE)


dnl
dnl Made possible to build for another arch.
dnl
if test x$XINE_BUILD != "x"; then
  AC_MSG_RESULT(*** build forced to $XINE_BUILD ***)
  build=$XINE_BUILD
  host=$XINE_BUILD
else
  check_athlon=yes
fi

AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)


dnl
dnl Check for programs.
dnl
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl obsolete AC_PROG_RANLIB
AC_PROG_LN_S


dnl
dnl Libtool
dnl
AC_LIBTOOL_DLOPEN
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
  STATIC="-static"
else
  STATIC=
fi
AC_SUBST(STATIC)


dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_BIGENDIAN
dnl AC_C_BIGENDIAN triggers an AC_TRY_RUN warning; we can't cross compile
dnl xine (oh, well)
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AM_TYPE_PTRDIFF_T

AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(GLOBAL_CFLAGS)


dnl
dnl threads
dnl
case $host in
  *-*-freebsd*)
    THREAD_LIBS="-pthread"
    CFLAGS="$CFLAGS -I/usr/local/include -L/usr/local/lib -D_THREAD_SAFE"
    CPPFLAGS="$CPPFLAGS -I/usr/local/include -L/usr/local/lib"
    ;;
  *)
    AC_CHECK_LIB(pthread, pthread_create,
  	     THREAD_LIBS="-lpthread",
 	     AC_MSG_ERROR(pthread needed))
    ;;
esac
AC_SUBST(THREAD_LIBS)


dnl
dnl dynamic linker
dnl
AC_CHECK_LIB(c, dlopen,
	     DYNAMIC_LD_LIBS="",
	     AC_CHECK_LIB(dl, dlopen,
             	          DYNAMIC_LD_LIBS="-ldl",
	                  AC_MSG_ERROR(dynamic linker needed)))
AC_SUBST(DYNAMIC_LD_LIBS)


dnl
dnl mpeg2lib stuff
dnl
AC_SUBST(LIBMPEG2_CONFIG_OBJS)
AC_SUBST(LIBMPEG2_CFLAGS)
AC_SUBST(LIBA52_CFLAGS)
AC_SUBST(LIBFFMPEG_CFLAGS)

LIBMPEG2_CFLAGS="" dnl default include path removed, no more needed.
LIBA52_CFLAGS=""
LIBFFMPEG_CFLAGS=""

if test x$enable_mlib = x; then
AC_ARG_ENABLE(mlib,
	[  --disable-mlib          make a version not using mediaLib],
	enable_mlib=no, enable_mlib=yes)
fi
if test x$enable_mlib = xyes; then
    if test x"$MLIBHOME" = x; then
	mlibhome=/opt/SUNWmlib
    else
	mlibhome="$MLIBHOME"
    fi

    AC_CHECK_LIB(mlib, mlib_VideoAddBlock_U8_S16,
               [ LIBS="$LIBS -L$mlibhome/lib -lmlib" 
                 LIBMPEG2_CONFIG_OBJS="$LIBMPEG2_CONFIG_OBJS idct_mlib.lo motion_comp_mlib.lo" 
                 LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -I$mlibhome/include" 
                 LIBA52_CFLAGS="$LIBA52_CFLAGS -I$mlibhome/include" 
                 LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS -I$mlibhome/include" 
		 AC_DEFINE(HAVE_MLIB)
                 AC_DEFINE(LIBMPEG2_MLIB)
		 AC_DEFINE(LIBA52_MLIB)
		 ac_have_mlib=yes],
               , -L/opt/SUNWmlib/lib)
    AM_CONDITIONAL(HAVE_MLIB, test x$ac_have_mlib = "xyes")
fi


dnl
dnl Checks for X11
dnl
AC_PATH_XTRA
if test x"$no_x" != "xyes"; then
    AC_DEFINE(HAVE_X11)
fi
AM_CONDITIONAL(HAVE_X11, test x"$no_x" != "xyes")


dnl
dnl Checks for Xv extension
dnl
dnl static linking with libXv is preferred!
dnl but only dynamic linking is possible when using libtool < 1.4.0

AC_PREREQ_LIBTOOL(1.4.0, xv_lib="libXv.a", xv_lib="libXv.so")

AC_ARG_WITH(xv-path,[  --with-xv-path=path    Where $xv_lib is installed],
            xv_path="$withval", xv_path="/usr/X11R6/lib")

AC_CHECK_LIB(Xv, XvShmCreateImage, 
             [ AC_MSG_CHECKING(for $xv_lib location)
               if test -f "$xv_path/$xv_lib"; then
                 AC_MSG_RESULT(found in $xv_path)
                 XV_LIB="-lXv"
	         AC_DEFINE(HAVE_XV)
	         ac_have_xv="yes"
               else
                 AC_MSG_RESULT(not found in $xv_path)
	         echo
                 echo "****************************************************************"
		 echo "* if you don't have a libXv.so on your system, use:            *"
		 echo "* ld --whole-archive -shared -o libXv.so.1 libXv.a             *"
		 echo "* then: ln -s libXv.so.1 libXv.so                              *"
	         echo "* to create it or try to use --with-xv-path to set the         *"
                 echo "* location of libXv.so                                         *"
                 echo "****************************************************************"
	         echo
               fi ],, $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
AM_CONDITIONAL(HAVE_XV, test x$ac_have_xv = "xyes")
AC_SUBST(XV_LIB)

dnl
dnl Checks for Xinerama extension
dnl

AC_CHECK_LIB(Xinerama, XineramaQueryExtension, 
             X_LIBS="$X_LIBS -lXinerama"
             AC_DEFINE(HAVE_XINERAMA)
             ac_have_xinerama="yes",,
             $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")

 
dnl
dnl Checks for Ascii-Art library
dnl
AM_PATH_AALIB(1.2,,)
AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes")


dnl
dnl OSS style audio interface
dnl
AC_MSG_CHECKING(for OSS audio support)
have_ossaudio=no
AC_TRY_COMPILE([
	    #ifdef __NetBSD__
	    #include <soundcard.h>
	    #else
	    #include <sys/soundcard.h>
	    #endif
	],[
	    int arg = SNDCTL_DSP_SETFRAGMENT;
	],[
	    have_ossaudio=yes
	])
AC_MSG_RESULT($have_ossaudio)
AM_CONDITIONAL(HAVE_OSS, test x"$have_ossaudio" = "xyes")


dnl
dnl Alsa support
dnl
AM_PATH_ALSA(0.5.5, 
        [ AC_DEFINE(HAVE_ALSA)
          if test x"$have_alsa05" = "xyes"; then
            AC_DEFINE(HAVE_ALSA05)
          fi
          if test x"$have_alsa09" = "xyes"; then
            AC_DEFINE(HAVE_ALSA09)
          fi
        ],
	AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "xyes")
AM_CONDITIONAL(HAVE_ALSA05, test x"$have_alsa05" = "xyes")
AM_CONDITIONAL(HAVE_ALSA09, test x"$have_alsa09" = "xyes")


dnl
dnl ESD support
dnl
AM_PATH_ESD(0.2.8,
        AC_DEFINE(HAVE_ESD),
        AC_MSG_RESULT(*** All of ESD dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ESD, test x"$no_esd" != "xyes")

dnl
dnl ARTS support
dnl
AM_PATH_ARTS(0.9.5,
        AC_DEFINE(HAVE_ARTS),
        AC_MSG_RESULT(*** All of ARTS dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ARTS, test x"$no_arts" != "xyes")

dnl
dnl SUN style audio interface
dnl
AC_MSG_CHECKING(for Sun audio support)
have_sunaudio=no
AC_TRY_COMPILE([
	    #include <sys/types.h>
	    #include <sys/audioio.h>
	],[
	    audio_info_t audio_info;
	    AUDIO_INITINFO(&audio_info);
	],[
	    have_sunaudio=yes
	])
AC_MSG_RESULT($have_sunaudio)
AM_CONDITIONAL(HAVE_SUNAUDIO, test x"$have_sunaudio" = "xyes")

dnl
dnl IRIX style audio interface
dnl
AM_CHECK_IRIXAL(AC_DEFINE(HAVE_IRIXAL),
	AC_MSG_RESULT(*** All of IRIX AL dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_IRIXAL, test "x$am_cv_have_irixal" = xyes)

dnl
dnl Solaris kstat kernel statistics
dnl
AC_CHECK_LIB(kstat, kstat_open,
	KSTAT_LIBS=-lkstat
	AC_DEFINE(HAVE_KSTAT))
AC_SUBST(KSTAT_LIBS)

dnl
dnl cdrom ioctls
dnl
AC_CHECK_HEADERS(sys/cdio.h linux/cdrom.h)
AM_CHECK_CDROM_IOCTLS(AC_DEFINE(HAVE_CDROM_IOCTLS),
	AC_MSG_RESULT(*** DVD and (S)VCD support will be disabled ***))
AM_CONDITIONAL(HAVE_CDROM_IOCTLS, test x"$have_cdrom_ioctls" = "xyes")

dnl
dnl dxr3 / hollywood plus card
dnl
AC_LINUX_PATH(/usr/src/linux)
AC_SUBST(LINUX_INCLUDE)

AC_CHECK_DXR3()
AM_CONDITIONAL(HAVE_DXR3, test x"$have_dxr3" = "xyes")

dnl
dnl ip_mreqn
dnl
AC_CHECK_IP_MREQN

dnl
dnl Some extra checks.
dnl
AC_CHECK_LIB(posix4, sched_get_priority_min)
AC_HAVE_FUNCS(sigaction sigset getpwuid_r nanosleep)
AC_CHECK_HEADERS(byteswap.h malloc.h sys/mman.h)


if test "$GCC" = yes; then
    dnl
    dnl check cflags not supported by all gcc versions
    dnl eg: -mpreferred-stack-boundary=2 and 2.91.66,
    dnl and gcc-2.7.2.3 support a bit less options
    dnl
    AC_TRY_CFLAGS("-mpreferred-stack-boundary=2", 
	m_psb="-mpreferred-stack-boundary=2", m_psb="")
    AC_TRY_CFLAGS("-fno-strict-aliasing", f_nsa="-fno-strict-aliasing", f_nsa="")
    AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="")
    AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="")
fi

dnl Flags not supported by all *cc* variants
AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="")


dnl Common cflags for all platforms
COMMON_CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE"

enable_w32dll="no"
enable_ffmmx="no"

case $host in
  i386-*-freebsd*)
    GLOBAL_CFLAGS="$GLOBAL_CFLAGS -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions"
    GLOBAL_CFLAGS="$GLOBAL_CFLAGS $CFLAGS"
    DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS $CFLAGS"
    AC_DEFINE(__i386__)
    AC_DEFINE([ARCH_X86],,[x86 architecture])
    AC_DEFINE(FPM_INTEL)

    enable_w32dll="yes"
    enable_ffmmx="yes"
    ;;
  *)
    dnl Set the appropriate architecture define
    case "$host_alias" in
    i?86-* | k?-* | athlon-*) dnl catch i386,i486,i586,i686,k6,k7

        if test "$GCC" = yes; then
	    dnl Check for gcc cpu optimization support
	    AC_TRY_CFLAGS("-mcpu=i386", 
	       sarchopt="-mcpu",
	       AC_TRY_CFLAGS("-march=i386", 
		  sarchopt="-march",
		  [ AC_MSG_RESULT(** no cpu optimization supports **)
		    sarchopt=no ]))

	    dnl special check for k7 cpu CC support
            AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686")

	    dnl add x86 specific gcc CFLAGS
	    GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer -malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions"
	    DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"

	    if test x"$sarchopt" != "xno"; then
		[case "$host_alias" in
			i386-*) # *BSD return this even on a P III #-))
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=i386"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=i386"
			  ;;
			i486-*) # oh dear!
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=i486"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=i486"
			  ;;
			i586-*)
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentium"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=pentium"
			  ;;
			i686-*)
			  if test x"$check_athlon" = "xyes"; then
			    if test -f /proc/cpuinfo; then
			      modelname=`cat /proc/cpuinfo | grep "model\ name\	:" | sed -e 's/ //g' | cut -d':' -f2`
			      case $modelname in
				*Athlon* | *Duron* | *K7*)
				  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=$k7cpu"
				  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=$k7cpu"
				;;
				*)
				 GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentiumpro"
				 DEBUG_CFLAGS="$DEBUG_CFLAGS $X_CFLAGS $sarchopt=pentiumpro"
				;;
			      esac
			    fi 
			  else
			    GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=pentiumpro"
			    DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=pentiumpro"
			  fi
			  ;;
			k6-*)
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=k6"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=k6"		
			  ;;
			k7-*)
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=k7"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=k7"
			  ;;
			athlon-*)
			  GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=athlon"
			  DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=athlon"
		esac]
	    fi

	else
	    dnl add x86 specific cc CFLAGS
	    GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O"
	    DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
	fi

        dnl enable x86 specific parts of the code
        enable_w32dll="yes"
        enable_ffmmx="yes"

        AC_DEFINE(__i386__)
	AC_DEFINE([ARCH_X86],,[x86 architecture])
	AC_DEFINE(FPM_INTEL)
        ;;

    alphaev56-*)
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mcpu=ev56 -mieee"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mcpu=ev56 -mieee"
	AC_DEFINE(FPM_64BIT)
        ;;
    alpha*)
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mieee"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mieee"
	AC_DEFINE(FPM_64BIT)
        ;;
    ppc-*-linux-* | powerpc-*) 
	GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops -finline-functions"
       	DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
	FORCE_44K_MAX=yes
	AC_DEFINE(FPM_PPC)
        ;;

    sparc*-*-linux-*)
        case $host_alias in
        sparc-*)    cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
        sparc64-*)  cpu_cflags="-mcpu=supersparc -mtune=ultrasparc" ;;
	esac
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"
        DEBUG_CFLAGS="$DEBUG_CFLAGS -O $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"

	AC_DEFINE(FPM_SPARC)
        ;;

    sparc-*-solaris*)
	if test "$GCC" = yes; then
	    case `uname -m` in
	    sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
	    sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
	    sun4u) cpu_cflags="-mcpu=supersparc -mtune=ultrasparc" ;;
	    *)     cpu_cflags= ;;
	    esac
	    cc_optimize_cflags="-O3 $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"
	    cc_debug_cflags="-O $cpu_cflags -funroll-loops -funroll-all-loops -finline-functions"
	else
	    cc_optimize_cflags="-O"
	    cc_debug_cflags="-O"
	fi
        GLOBAL_CFLAGS="$GLOBAL_CFLAGS $cc_optimize_cflags"
        DEBUG_CFLAGS="$DEBUG_CFLAGS $cc_debug_cflags"
	AC_DEFINE(FPM_SPARC)
	;;

    mips-*)
	GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
	DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
	AC_DEFINE(FPM_MIPS)
	;;
    m68k-*)
	GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O2"
	DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
	AC_DEFINE(FPM_M68K)
	;;
    *) echo "$host is not currently supported by xine"; exit 1;;
    esac
    ;;
esac

GLOBAL_CFLAGS="$GLOBAL_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS $ARTS_CFLAGS $IRIXAL_CFLAGS"
DEBUG_CFLAGS="$DEBUG_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS $ARTS_CFLAGS $IRIXAL_CFLAGS -g -DDEBUG"

AM_CONDITIONAL(HAVE_W32DLL, test x"$enable_w32dll" = "xyes")
if test x"$enable_w32dll" = "xyes"; then
   W32DLL_DEP=""
else 
   W32DLL_DEP="#"
fi
AC_SUBST(W32DLL_DEP)

AM_CONDITIONAL(HAVE_FFMMX, test x"$enable_ffmmx" = "xyes")


dnl
dnl gcc __attribute__ ((aligned ()))
dnl
AC_C_ATTRIBUTE_ALIGNED


dnl
dnl XINE_ROOTDIR does not work if architecture independent files are 
dnl installed to another place than architecture dependent files !!!
dnl
if test "x$prefix" = xNONE; then
   prefix="${ac_default_prefix}"
fi
if test "x$exec_prefix" = xNONE; then
   exec_prefix='${prefix}'
fi
XINE_PLUGINDIR="$libdir/xine/plugins"
eval XINE_PLUGINPATH=`eval echo "$XINE_PLUGINDIR"`
AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH")
AC_SUBST(XINE_PLUGINPATH)


XINE_SKINDIR="${datadir}/xine/skins"
eval XINE_SKINPATH="$XINE_SKINDIR"
AC_DEFINE_UNQUOTED(XINE_SKINDIR,"$XINE_SKINPATH")
AC_SUBST(XINE_SKINPATH)

AC_SUBST(XINE_PLUGINDIR)
AC_SUBST(XINE_DEMUXDIR)
AC_SUBST(XINE_SKINDIR)

dnl
dnl Some informations about xine-lib compilation
dnl
XINE_BUILD_CC="`$CC -v 2>&1 | tail -1`"
XINE_BUILD_OS="`uname -s -r -m`"
XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
AC_SUBST(XINE_BUILD_CC)
AC_SUBST(XINE_BUILD_OS)
AC_SUBST(XINE_BUILD_DATE)

dnl
dnl For win32 libraries location, needed by libw32dll.
dnl
AC_ARG_WITH(w32-path,[  --with-w32-path=path    Location of WIN32 libraries],
            w32_path="$withval", w32_path="/usr/lib/win32")
AC_SUBST(w32_path)


dnl
dnl Force 44.1K maximum audio sample rate for drivers/devices that don't
dnl correctly handle 48K rates, e.g. PowerMac dmasound through at least
dnl early 2.4.*. Will need dynamic test once fix makes it into source
dnl trees.
dnl
if test x$FORCE_44K_MAX = xyes; then
  echo "including FORCE_44K_MAX capping"
  AC_DEFINE(FORCE_44K_MAX,1,[Cap audio sample rate at 44.1K, some drivers (dmasound) don't handle 48K request correctly])
fi


dnl
dnl Some include paths ( !!! DO NOT REMOVE !!! )
dnl
INCLUDES='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/src/xine-engine -I$(top_builddir)/src/xine-engine'
AC_SUBST(INCLUDES)


dnl
dnl Get where .m4 should be installed.
dnl
case "`id`" in
  uid=0\(* )
    AC_MSG_CHECKING(for aclocal directory)
    if(aclocal --version) < /dev/null > /dev/null 2>&1; then
      ACLOCAL_DIR=`$ACLOCAL --print-ac-dir`
      AC_MSG_RESULT($ACLOCAL_DIR)
    else
      ACLOCAL_DIR="/usr/local/share/aclocal"
      AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR)
    fi
    escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`"
    ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e s/^$escapedprefix/'\${prefix}'/`"
    AC_SUBST(ACLOCAL_DIR)
    ;;
esac
AM_CONDITIONAL(INSTALL_M4, test x"$ACLOCAL_DIR" != "x")


dnl
dnl Check for doxygen (dynamic documentation generator)
dnl
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)


dnl
dnl Output configuration files
dnl
AC_OUTPUT([
Makefile
include/Makefile
include/xine.h.tmpl
src/Makefile
src/audio_out/Makefile
src/video_out/Makefile
src/demuxers/Makefile
src/dxr3/Makefile
src/libmpeg2/Makefile
src/liba52/Makefile
src/libffmpeg/Makefile
src/libffmpeg/libavcodec/Makefile
src/liblpcm/Makefile
src/libdts/Makefile
src/libmad/Makefile
src/libw32dll/Makefile
src/libw32dll/wine/Makefile
src/libspudec/Makefile
src/input/Makefile
src/xine-engine/Makefile
misc/Makefile
misc/xine-config
m4/Makefile
doc/Makefile
doc/man/Makefile
doc/man/en/Makefile
doc/man/en/man3/Makefile
doc/xine-lib-API/Makefile
doc/xine-lib-API/html/Makefile
misc/xine-lib.spec
misc/guenter.spec
misc/SlackBuild
misc/guenter_rpms.sh
misc/build_rpms.sh],
[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/guenter_rpms.sh; rm -f include/xine.h; echo '/* !! DO NO EDIT THIS FILE, it is automatically generated */' > include/xine.h && cat include/xine.h.tmpl >> include/xine.h])

dnl
dnl Hack the libtool script.
dnl
cat libtool | sed -e 's/^pic_flag=/#pic_flag=/' > libtool-nofpic
chmod +x libtool-nofpic