191
192
dnl threads and OS specific stuff
192
193
dnl ---------------------------------------------
195
AC_ARG_WITH(pthread-prefix,
197
[--with-pthread-prefix=PREFIX],
198
[path to pthread library]),
199
[pthread_prefix="$withval"],
200
[pthread_prefix="no"])
196
THREAD_LIBS="-L/usr/local/lib -pthread"
197
THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
199
CFLAGS="$THREAD_CFLAGS $CFLAGS"
204
if test x"$pthread_prefix" = "xno"; then
205
pthread_prefix="/usr/local"
207
THREAD_LIBS="-L$pthread_prefix/lib -pthread"
208
THREAD_CPPFLAGS="-I$pthread_prefix/include"
209
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS -D_THREAD_SAFE"
204
THREAD_LIBS=" -lpthread"
205
THREAD_CFLAGS="-D_REENTRANT"
206
CFLAGS="$THREAD_CFLAGS $CFLAGS"
215
THREAD_LIBS="-lpthread"
221
if test x"$pthread_prefix" = "xno"; then
222
THREAD_LIBS="-lpthread"
224
THREAD_LIBS="-L$pthread_prefix/lib -lpthread"
225
THREAD_CPPFLAGS="-I$pthread_prefix/include"
227
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
230
LIBS="$LIBS $THREAD_LIBS"
232
AC_CHECK_LIB(pthread, pthread_create, have_pthread=yes)
238
if test x"$have_pthread" != "xyes"; then
239
AC_MSG_ERROR(pthread needed)
242
AC_SUBST(THREAD_CPPFLAGS)
243
AC_SUBST(THREAD_LIBS)
246
AC_MSG_CHECKING(for recursive mutex support in pthread)
248
LIBS="$LIBS $THREAD_LIBS"
250
AC_DEFINE(_GNU_SOURCE)
251
have_recursive_mutex=no
252
AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h>
255
pthread_mutexattr_t attr;
256
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
260
have_recursive_mutex=yes
262
AC_MSG_ERROR(recursive mutex support is needed - please report)
266
AC_MSG_RESULT($have_recursive_mutex)
269
dnl ---------------------------------------------
270
dnl Windows ports checks
271
dnl ---------------------------------------------
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
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"
235
need_internal_zlib=yes
237
294
LDFLAGS="-no-undefined $LDFLAGS"
242
AC_CHECK_LIB(pthread, pthread_create,
243
[THREAD_LIBS="-lpthread"],
244
[AC_MSG_ERROR(pthread needed)])
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
252
if test "x$THREAD_LIBS_CONFIG" = "x"; then
253
THREAD_LIBS_CONFIG=$THREAD_LIBS
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)
264
298
AC_SUBST(WIN32_CPPFLAGS)
265
299
AM_CONDITIONAL(WIN32, test x$SYS = "xmingw32")
267
302
dnl ---------------------------------------------
268
303
dnl dynamic linker
269
304
dnl ---------------------------------------------
432
467
dnl ---------------------------------------------
434
dnl internal zlib permited only in MINGW-like platform
435
if test "x$need_internal_zlib" = "xyes"; then
437
ZLIB_INCLUDES='-I$(top_srcdir)/win32/contrib/zlib'
438
ZLIB_LIBS='$(top_builddir)/win32/contrib/zlib/libzlib.la'
469
AC_ARG_WITH(zlib-prefix,
471
[--with-zlib-prefix=PREFIX],
472
[path to zlib compression library]),
473
[zlib_prefix="$withval"],
476
if test x"$zlib_prefix" = "xno"; then
441
AC_CHECK_LIB(z, gzsetparams,
442
[AC_CHECK_HEADER(zlib.h,
445
ZLIB_LIBS_CONFIG="-lz",)], AC_MSG_ERROR(zlib needed))
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"
483
ac_save_CPPFLAGS="$CPPFLAGS"
485
CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
486
LIBS="$LIBS $ZLIB_LIBS"
488
AC_CHECK_LIB(z, gzsetparams,
489
[AC_CHECK_HEADER(zlib.h,
492
CPPFLAGS="$ac_save_CPPFLAGS"
495
if test "x$have_zlib" != "xyes"; then
496
AC_MSG_ERROR(zlib needed)
498
AC_SUBST(ZLIB_CPPFLAGS)
449
499
AC_SUBST(ZLIB_LIBS)
450
AC_SUBST(ZLIB_LIBS_CONFIG)
452
502
dnl ---------------------------------------------
453
503
dnl check posix timers
696
760
dnl Checks for Xinerama extension
697
761
dnl ---------------------------------------------
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])
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])
704
776
dnl AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")
865
953
dnl check for polypaudio
866
954
dnl ---------------------------------------------
868
AC_MSG_CHECKING(for polypaudio)
869
dnl do some actual testing here
870
if test x$PKG_CONFIG = xno ; then
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])
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
965
echo "*** pkg-config not found. See http://pkgconfig.sourceforge.net"
966
echo "*** All of polypaudio dependent parts will be disabled"
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"
976
AC_MSG_RESULT([*** All of polypaudio dependent parts will be disabled ***])
979
AC_SUBST(POLYPAUDIO_CFLAGS)
980
AC_SUBST(POLYPAUDIO_LIBS)
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"
883
AC_MSG_RESULT([*** All of polypaudio dependent parts will be disabled ***])
886
AC_SUBST(POLYPAUDIO_CFLAGS)
887
AC_SUBST(POLYPAUDIO_LIBS)
888
984
AM_CONDITIONAL(HAVE_POLYPAUDIO, [test x"$have_polypaudio" = x"yes"])
890
986
dnl ---------------------------------------------
998
1094
dnl ---------------------------------------------
999
1095
dnl Ogg/Speex libs.
1000
1096
dnl ---------------------------------------------
1002
PKG_CHECK_MODULES(SPEEX, speex, no_speex="no", no_speex="yes")
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])
1103
if test "x$with_speex" = "xyes"; then
1104
PKG_CHECK_MODULES(SPEEX, speex, [
1107
AC_DEFINE(HAVE_SPEEX,1,[Define this if you have speex])
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>])
1008
1117
if test "x$no_speex" = "xyes" ; then
1009
1118
AC_MSG_RESULT([*** All OGG/SPEEX dependent parts will be disabled ***])
1011
AC_DEFINE(HAVE_SPEEX,1,[Define this if you have speex])
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>])
1019
AC_SUBST(SPEEX_CFLAGS)
1020
AC_SUBST(SPEEX_LIBS)
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"])
1026
1127
dnl check for libFLAC
1027
1128
dnl ---------------------------------------------
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])
1134
if test "x$with_flac" = "xyes"; then
1136
AC_MSG_RESULT([*** All FLAC dependent parts will be disabled ***]))
1031
1140
AM_CONDITIONAL(HAVE_FLAC, [test x"$no_libFLAC" != "xyes"])
1142
dnl ---------------------------------------------
1143
dnl External version of a52dec
1144
dnl ---------------------------------------------
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"])
1153
if test x"$enable_a52dec" = "xno"; then
1154
AC_MSG_RESULT([a52dec support disabled])
1155
elif test x"$external_a52dec" = "xyes"; then
1157
AC_CHECK_HEADERS([a52dec/a52.h a52dec/a52_internal.h],, have_a52="no",
1159
#ifdef HAVE_SYS_TYPES_H
1160
# include <sys/types.h>
1162
#ifdef HAVE_INTTYPES_H
1163
# include <inttypes.h>
1165
#ifdef HAVE_STDINT_H
1166
# include <stdint.h>
1169
#include <a52dec/a52.h>
1172
AC_CHECK_LIB([a52], [a52_init],, have_a52="no", [-lm])
1175
if test "x$have_a52" = "xno"; then
1176
AC_MSG_RESULT([*** no usable version of a52dec found, using internal copy ***])
1179
AC_MSG_RESULT([Use included a52dec support])
1182
AM_CONDITIONAL(A52, test x"$enable_a52dec" = "xyes")
1183
AM_CONDITIONAL(EXTERNAL_A52DEC, test x"$have_a52" = "xyes")
1185
dnl ---------------------------------------------
1186
dnl External version of libmad
1187
dnl ---------------------------------------------
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"])
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 ***])
1207
AC_MSG_RESULT([Use included libmad support])
1210
AM_CONDITIONAL(MAD, test "x$enable_libmad" = "xyes")
1211
AM_CONDITIONAL(EXTERNAL_LIBMAD, test x"$have_mad" = "xyes")
1034
1213
dnl ---------------------------------------------
1036
1215
dnl ---------------------------------------------
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])
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 ***]))
1044
1232
AM_CONDITIONAL(HAVE_LIBMNG, test x"$have_libmng" = "xyes")
1048
dnl ---------------------------------------------
1050
dnl ---------------------------------------------
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,
1057
AC_MSG_RESULT([*** All libpng dependent parts will be disabled ***]))
1234
dnl ---------------------------------------------
1235
dnl MagickWand API of Imagemagick.
1236
dnl ---------------------------------------------
1238
AC_ARG_ENABLE([imagemagick],
1239
AC_HELP_STRING([--disable-imagemagick], [do not build ImageMagick support]),
1240
[with_imagemagick=$enableval], [with_imagemagick=yes])
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"
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])
1059
PNG_CFLAGS=`$LIBPNG_CONFIG --cflags`
1060
PNG_LIBS=`$LIBPNG_CONFIG --libs`
1062
AC_DEFINE(HAVE_LIBPNG,1,[Define this if you have png library])
1255
have_imagemagick="no"
1065
AM_CONDITIONAL(HAVE_LIBPNG, test x"$have_libpng" = "xyes" )
1066
AC_SUBST(PNG_CFLAGS)
1258
AM_CONDITIONAL(HAVE_WAND, test x"$have_imagemagick" = "xyes" )
1259
AC_SUBST(WAND_CFLAGS)
1260
AC_SUBST(WAND_LDFLAGS)
1070
1263
dnl ---------------------------------------------
1071
1264
dnl freetype2 lib.
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])
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")
1113
1312
dnl ---------------------------------------------
1114
1313
dnl ESD support
1115
1314
dnl ---------------------------------------------
1316
AC_ARG_ENABLE([esd],
1317
AC_HELP_STRING([--disable-esd], [do not build esd support]),
1318
[with_esd=$enableval], [with_esd=yes])
1320
if test "x$with_esd" = "xyes"; then
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 ***))
1120
1327
AM_CONDITIONAL(HAVE_ESD, test x"$no_esd" != "xyes")
1134
1349
dnl gnome-vfs support
1135
1350
dnl ---------------------------------------------
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])
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])
1365
AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
1145
AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
1147
1370
AM_CONDITIONAL(HAVE_GNOME_VFS, test x"$no_gnome_vfs" != "xyes")
1151
1374
dnl libsmbclient support
1152
1375
dnl ---------------------------------------------
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])
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)
1160
1390
AM_CONDITIONAL(HAVE_LIBSMBCLIENT, test x"$have_libsmbclient" = "xyes")
1161
AC_SUBST(LIBSMBCLIENT_LIBS)
1164
1393
dnl ---------------------------------------------
1508
1737
enable_faad=$enableval, enable_faad=yes)
1509
1738
AM_CONDITIONAL(BUILD_FAAD, test x"$enable_faad" = "xyes")
1740
dnl ---------------------------------------------
1741
dnl Optional and external libdts
1742
dnl ---------------------------------------------
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"])
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 ***])
1762
AC_MSG_RESULT([Use included libdts support])
1765
AM_CONDITIONAL(DTS, test "x$enable_libdts" = "xyes")
1766
AM_CONDITIONAL(EXTERNAL_LIBDTS, test x"$have_dts" = "xyes")
1512
1768
dnl ---------------------------------------------
1513
1769
dnl libmodplug support
1588
1854
ASFLAGS="$ASFLAGS"
1589
1855
AC_SUBST(ASFLAGS)
1592
if test "$GCC" = yes; then
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
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="")
1604
dnl gcc 3.1 uses the -f version
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")
1613
dnl Check for some optimization disabling
1614
dnl needed for win32 code
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)
1621
dnl Multipass compilation
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)
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"]);
1642
dnl Flags not supported by all *cc* variants
1643
AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="")
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
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"
1654
1868
enable_w32dll="no"
1655
1869
enable_ffmmx="no"
1656
1870
enable_armv4l="no"
1658
1872
case "$host_or_hostalias" in
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
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.
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])
1881
AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
1666
1883
enable_w32dll="yes"
1673
i?86-*-linux* | i386-*-solaris* | i?86-* | k?-* | athlon-* | pentium*)
1674
if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then
1676
if test "$GCC" = yes ; then
1677
dnl Check for gcc cpu optimization support
1678
AC_TRY_CFLAGS("-mtune=i386",
1680
AC_TRY_CFLAGS("-mcpu=i386",
1682
AC_TRY_CFLAGS("-march=i386",
1684
[ AC_MSG_RESULT(** no cpu optimization supports **)
1691
dnl special check for k7 cpu CC support
1692
AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686")
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"
1697
DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1699
if test x"$sarchopt" != "xno"; then
1703
case "$host_or_hostalias" in
1704
i386-*) # *BSD return this even on a P III #-))
1705
archopt_val="i386" ;;
1707
archopt_val="i486" ;;
1709
archopt_val="pentium"
1712
archopt_val="pentium-mmx"
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"
1737
archopt_val="pentium3"
1740
archopt_val="pentium4"
1742
athlon-4-* | athlon-xp-* | athlon-mp-*)
1743
archopt_val="athlon-4"
1745
k7-* | athlon-tbird-* | athlon-*)
1746
archopt_val="athlon"
1750
if test x"$archopt_val" != x; then
1751
CFLAGS="$sarchopt=$archopt_val $CFLAGS"
1752
DEBUG_CFLAGS="$sarchopt=$archopt_val $DEBUG_CFLAGS"
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)
1765
dnl enable x86 specific parts of the code
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.
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])
1776
case "$host_or_hostalias" in
1782
LIBS="$LIBS @INTLLIBS@ -lkernel32"
1786
dnl add x86 specific cc CFLAGS
1788
DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1789
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
1793
AC_DEFINE(__i386__,1,[Define this if you're running x86 architecture])
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])
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])
1885
case "$host_or_hostalias" in
1891
LIBS="$LIBS @INTLLIBS@ -lkernel32"
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])
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"
1814
1903
dnl avoid ppc compilation crash
1845
1932
DEBUG_CFLAGS="-Wa,-m7400 $DEBUG_CFLAGS"
1849
1935
sparc*-*-linux*)
1851
sparc-*) cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
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])
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])
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])
1867
1943
sparc-*-solaris*)
1868
1944
if test "$GCC" = yes; then
1870
sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
1871
sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
1873
case `$CC --version 2>/dev/null` in
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"
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])
1893
cc_optimize_cflags="-O3 $cpu_cflags -funroll-loops -finline-functions"
1894
cc_debug_cflags="-O $cpu_cflags -funroll-loops -finline-functions"
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
1948
if test x$enable_vis = xyes; then
1949
AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
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])
1900
sun4c) cpu_cflags="-xarch=v7" ;;
1901
sun4m) cpu_cflags="-xarch=v8" ;;
1902
sun4u) cpu_cflags="-xarch=v8plusa" ;;
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])
1909
CFLAGS="$cc_optimize_cflags $CFLAGS"
1910
DEBUG_CFLAGS="$cc_debug_cflags $DEBUG_CFLAGS"
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])
1920
# used to be -O2, but that makes gcc 2.95.2 segfault
1921
# see http://bugs.debian.org/146006 for more info
1923
DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1924
AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
1928
CFLAGS="-O3 $CFLAGS"
1929
DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1930
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
1934
dnl -O3 seems to trigger gcc internal compiler errors, at least up to gcc 3.2.1
1936
DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
1937
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed pointarithmetic implementation])
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])
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])
1955
CFLAGS="-O3 $CFLAGS"
1956
DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
1957
AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
1963
alphaev56-* | alpha* | ia64-* | hppa*-linux-*)
1964
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
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"
1970
echo "****************************** WARNING ******************************"
1972
echo "Host type '$host' ($host_alias) is currently not supported by xine"
1974
echo "Assuming that -O3 makes the compiler produce useful code."
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>"\!
1980
echo "*********************************************************************"
1981
echo "(sleeping one minute so you can read this...)"
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])
2051
2036
if test "x$exec_prefix" = xNONE; then
2052
2037
exec_prefix='${prefix}'
2041
dnl installation directories and directories relative to prefix
2044
dnl use AC_DEFINE for runtime
2045
dnl use AC_SUBST for installation
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'`
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.])
2067
2072
dnl prefix in xine-config
2068
XINE_CONFIG_PREFIX="\`dirname \$0\`/.."
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"