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
|
dnl
dnl Configure.in for xine
dnl
AC_INIT(src/xine-engine/xine.c)
dnl
dnl Required Autoconf Version 2.13
dnl
AC_PREREQ(2.13)
XINE_MAJOR=0
XINE_MINOR=5
XINE_SUB=0
XINE_PRE=".alpha1"
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_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 Build all libs as static
dnl
BUILD_LIB_STATIC="-static"
AC_SUBST(BUILD_LIB_STATIC)
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AM_TYPE_PTRDIFF_T
dnl AC_C_BIGENDIAN
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(GLOBAL_CFLAGS)
dnl
dnl threads
dnl
case $host in
*-*-freebsd*)
THREAD_LIBS="-pthread"
;;
*)
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_CFLAGS)
AC_SUBST(LIBMPEG2_CONFIG_OBJS)
LIBMPEG2_CFLAGS="" dnl default include path removed, no more needed.
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
AC_CHECK_LIB(mlib, main,
[ LIBS="$LIBS -L/opt/SUNWmlib/lib -lmlib"
LIBMPEG2_CONFIG_OBJS="$LIBMPEG2_CONFIG_OBJS idct_mlib.lo motion_comp_mlib.lo"
LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -I/opt/SUNWmlib/include"
AC_DEFINE(HAVE_MLIB)
AC_DEFINE(LIBMPEG2_MLIB)],
, -L/opt/SUNWmlib/lib)
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
AC_CHECK_LIB(Xv, XvShmCreateImage,
X_LIBS="$X_LIBS -lXv"
AC_DEFINE(HAVE_XV)
ac_have_xv="yes",,
$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
AM_CONDITIONAL(HAVE_XV, test x$ac_have_xv = "xyes")
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 Alsa support
dnl
AM_PATH_ALSA(0.5.5,
AC_DEFINE(HAVE_ALSA),
AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "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
dnl
AC_CHECK_FUNC(getpwuid_r,AC_DEFINE(HAVE_GETPWUID_R))
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="")
dnl Common cflags for all platforms
COMMON_CFLAGS="-Wall -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE"
enable_w32dll="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 $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -D_REENTRANT"
DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS $CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -D_REENTRANT -DDEBUG"
AC_DEFINE(__i386__)
AC_DEFINE([ARCH_X86],,[x86 architecture])
enable_w32dll="yes"
;;
*)
dnl Set the appropriate architecture define
case "$host_alias" in
i?86-* | k?-* | athlon-*) dnl catch i386,i486,i586,i686,k6,k7
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=k7", k7cpu="k7", k7cpu="i686")
AC_DEFINE(__i386__)
AC_DEFINE([ARCH_X86],,[x86 architecture])
dnl add x86 specific 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"
dnl enable x86 specific parts of the code
enable_w32dll="yes"
if test x"$sarchopt" != "xno"; then
[case "$host_alias" in
i386-*) dnl *BSD return this even on a P III #-))
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=i386"
DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=i386"
;;
i486-*) dnl 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-* | athlon-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=k7"
DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=k7"
esac]
fi
;;
alphaev56-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mcpu=ev56 -mieee"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mcpu=ev56 -mieee"
;;
alpha*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mieee"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mieee"
;;
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"
;;
sparc-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
;;
*) echo "$host is not currently supported by xine"; exit 1;;
esac
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS"
DEBUG_CFLAGS="$DEBUG_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS -g -DDEBUG"
;;
esac
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)
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")
XINE_SKINDIR="${datadir}/xine/skins"
eval XINE_SKINPATH="$XINE_SKINDIR"
AC_DEFINE_UNQUOTED(XINE_SKINDIR,"$XINE_SKINPATH")
AC_SUBST(XINE_PLUGINDIR)
AC_SUBST(XINE_DEMUXDIR)
AC_SUBST(XINE_SKINDIR)
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 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
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
AC_SUBST(ACLOCAL_DIR)
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/libmpeg2/Makefile
src/libac3/Makefile
src/libmpg123/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/FAQ
doc/man/Makefile
doc/man/en/Makefile
doc/man/en/xine.1
doc/man/fr/Makefile
doc/man/fr/xine.1
misc/xine-lib.spec
misc/SlackBuild
misc/build_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 Change attribute.
dnl
chmod +x ./misc/SlackBuild ./misc/build_rpms.sh
dnl
dnl Hack the libtool script.
dnl
cat libtool | sed -e 's/^pic_flag=/#pic_flag=/' > libtool-nofpic
chmod +x libtool-nofpic
|