From 88cb45ef27eb73eec0731074d59bf051b2b35f4c Mon Sep 17 00:00:00 2001 From: Matt Messier Date: Wed, 9 May 2007 15:25:05 -0400 Subject: Clean up input plugin configuration checks -- Split input plugin checks out of configure.ac into m4/input.m4 -- Move m4/vcd.m4 (previously split out from configure.ac) into m4/input.m4 -- Fold m4/dl.m4 into configure.ac -- Various miscellaneous cleanups throughout configure.ac and m4/*.m4 --- m4/Makefile.am | 3 +- m4/_xine.m4 | 114 ++++++------------- m4/directx.m4 | 94 ++++++---------- m4/dl.m4 | 53 --------- m4/input.m4 | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++ m4/ioctl_request.m4 | 26 ++--- m4/macosx.m4 | 2 +- m4/vcd.m4 | 230 --------------------------------------- 8 files changed, 388 insertions(+), 442 deletions(-) delete mode 100644 m4/dl.m4 create mode 100644 m4/input.m4 delete mode 100644 m4/vcd.m4 (limited to 'm4') diff --git a/m4/Makefile.am b/m4/Makefile.am index d924ff80b..6fb4d6f80 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -16,9 +16,9 @@ EXTRA_DIST = \ attributes.m4 \ audio_out.m4 \ directx.m4 \ - dl.m4 \ dvdnav.m4 \ gas.m4 \ + input.m4 \ ioctl_request.m4 \ libFLAC.m4 \ libfame.m4 \ @@ -29,7 +29,6 @@ EXTRA_DIST = \ pthreads.m4 \ symbol.m4 \ summary.m4 \ - vcd.m4 \ video_out.m4 \ xine.m4 \ _xine.m4 \ diff --git a/m4/_xine.m4 b/m4/_xine.m4 index 7868c0591..90a1699f1 100644 --- a/m4/_xine.m4 +++ b/m4/_xine.m4 @@ -3,8 +3,8 @@ dnl Define inline to something appropriate, including the new always_inline dnl attribute from gcc 3.1 dnl Thanks to Michel LESPINASSE dnl __inline__ "check" added by Darren Salt -AC_DEFUN([AC_C_ALWAYS_INLINE], - [AC_C_INLINE +AC_DEFUN([AC_C_ALWAYS_INLINE], [ + AC_C_INLINE if test x"$GCC" = x"yes" -a x"$ac_cv_c_inline" = x"inline"; then AC_MSG_CHECKING([for always_inline]) SAVE_CFLAGS="$CFLAGS" @@ -44,6 +44,16 @@ AC_DEFUN([AC_C_ALWAYS_INLINE], fi ]) + +dnl AC_COMPILE_CHECK_SIZEOF (TYPE SUPPOSED-SIZE) +dnl abort if the given type does not have the supposed size +AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], [ + AC_MSG_CHECKING(that size of $1 is $2) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) case 0: case (sizeof ($1) == $2):;]])], + [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([can not build a default inttypes.h])]) +]) + + dnl AC_CHECK_GENERATE_INTTYPES_H (INCLUDE-DIRECTORY) dnl generate a default inttypes.h if the header file does not exist already AC_DEFUN([AC_CHECK_GENERATE_INTTYPES], @@ -226,64 +236,7 @@ EOF #endif EOF - ])] -) - - -dnl AC_COMPILE_CHECK_SIZEOF (TYPE SUPPOSED-SIZE) -dnl abort if the given type does not have the supposed size -AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], - [AC_MSG_CHECKING(that size of $1 is $2) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) case 0: case (sizeof ($1) == $2):;]])],[], - [AC_MSG_ERROR([can not build a default inttypes.h])]) - AC_MSG_RESULT([yes])]) - - -dnl AM_CHECK_CDROM_IOCTLS ([ACTION-IF-YES], [ACTION-IF-NO]) -dnl check for CDROM_DRIVE_STATUS in ioctl.h -AC_DEFUN([AM_CHECK_CDROM_IOCTLS], - [AC_CACHE_CHECK([if cdrom ioctls are available], - [am_cv_have_cdrom_ioctls], - [AC_EGREP_HEADER([CDROM_DRIVE_STATUS],[sys/ioctl.h], - am_cv_have_cdrom_ioctls=yes, - [AC_EGREP_HEADER([CDIOCALLOW],[sys/ioctl.h], - am_cv_have_cdrom_ioctls=yes, - [AC_EGREP_CPP(we_have_cdrom_ioctls,[ -#include -#ifdef HAVE_SYS_CDIO_H -# include -#endif -#ifdef HAVE_LINUX_CDROM_H -# include -#endif -#if defined(CDROM_DRIVE_STATUS) || defined(CDIOCALLOW) || defined(CDROMCDXA) - we_have_cdrom_ioctls -#endif -], - am_cv_have_cdrom_ioctls=yes, - am_cv_have_cdrom_ioctls=no - )])])]) - have_cdrom_ioctls=$am_cv_have_cdrom_ioctls - if test "x$have_cdrom_ioctls" = xyes ; then - ifelse([$1], , :, [$1]) - else - ifelse([$2], , :, [$2]) - fi -]) - - -dnl AC_CHECK_IP_MREQN -dnl check for struct ip_mreqn in netinet/in.h -AC_DEFUN([AC_CHECK_IP_MREQN], - [AC_CACHE_CHECK([for ip_mreqn], [ac_cv_have_ip_mreqn], - [AC_EGREP_HEADER([ip_mreqn], - [netinet/in.h], - [ac_cv_have_ip_mreqn=yes], - [ac_cv_have_ip_mreqn=no])]) - if test $ac_cv_have_ip_mreqn = yes; then - AC_DEFINE([HAVE_IP_MREQN],1,[Define this if you have ip_mreqn in netinet/in.h]) - fi -]) + ])]) dnl AC_PROG_GMSGFMT_PLURAL @@ -411,30 +364,25 @@ _ACEOF esac ])# AC_PROG_LIBTOOL_SANITYCHECK + dnl Check for the type of the third argument of getsockname AC_DEFUN([AC_CHECK_SOCKLEN_T], [ - AC_MSG_CHECKING(for socklen_t) - AC_LANG_PUSH(C++) - - AC_CACHE_VAL(ac_cv_socklen_t, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include - ]], [[socklen_t a=0; -getsockname(0,(struct sockaddr*)0, &a); - ]])],[ac_cv_socklen_t=socklen_t],[ac_cv_socklen_t='']) - if test "x$ac_cv_socklen_t" = x; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[ -int a=0; -getsockname(0,(struct sockaddr*)0, &a);]])], - [ac_cv_socklen_t=int],[ac_cv_socklen_t=size_t]) + AC_MSG_CHECKING([for socklen_t]) + AC_LANG_PUSH([C]) + AC_CACHE_VAL([ac_cv_socklen_t], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], + [[socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a)]])], + [ac_cv_socklen_t=socklen_t], [ac_cv_socklen_t='']) + if test x"$ac_cv_socklen_t" = x""; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], + [[int a=0; getsockname(0,(struct sockaddr*)0, &a);]])], + [ac_cv_socklen_t=int], [ac_cv_socklen_t=size_t]) + fi]) + AC_LANG_POP([C]) + AC_MSG_RESULT([$ac_cv_socklen_t]) + if test x"$ac_cv_socklen_t" != x"socklen_t"; then + AC_DEFINE_UNQUOTED([socklen_t], [$ac_cv_socklen_t], [Define the real type of socklen_t]) fi - ]) - AC_LANG_POP([C++]) - - AC_MSG_RESULT($ac_cv_socklen_t) - if test "$ac_cv_socklen_t" != "socklen_t"; then - AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t, - [Define the real type of socklen_t]) - fi ]) diff --git a/m4/directx.m4 b/m4/directx.m4 index 6d023528e..4aa13cbf3 100644 --- a/m4/directx.m4 +++ b/m4/directx.m4 @@ -10,62 +10,40 @@ dnl It looks for DirectX, defines DIRECTX_CPPFLAGS, DIRECTX_AUDIO_LIBS and dnl DIRECTX_VIDEO_LIBS. dnl AC_DEFUN([AM_PATH_DIRECTX], [ - -AC_ARG_WITH(dxheaders, AS_HELP_STRING([--with-dxheaders], [specify location of DirectX headers]), - [dxheaders_prefix="$withval"], - [dxheaders_prefix="no"] -) - -if test x"$dxheaders_prefix" != "xno"; then - DIRECTX_CPPFLAGS="-I${dxheaders_prefix} ${DIRECTX_CPPFLAGS}" -fi - -AC_MSG_CHECKING(for DirectX) -DIRECTX_VIDEO_LIBS="$DIRECTX_LIBS -lgdi32 -lddraw" -DIRECTX_AUDIO_LIBS="$DIRECTX_LIBS -ldsound" -AC_LANG_PUSH([C]) -ac_save_CPPFLAGS="$CPPFLAGS" -ac_save_LIBS="$LIBS" -CPPFLAGS="$CPPFLAGS $DIRECTX_CPPFLAGS" -LIBS="$LIBS $DIRECTX_VIDEO_LIBS $DIRECTX_AUDIO_LIBS" -AC_COMPILE_IFELSE( - [ -#include - -#include -#include -#include - -int main() { - DirectDrawCreate(0, NULL, 0); - DirectsoundCreate(0, NULL, 0); - - return 0; -} - ], - [have_directx=yes - AC_DEFINE(HAVE_DIRECTX,1,[Define this if you have DirectX])],,) -CPPFLAGS=$ac_save_CPPFLAGS -LIBS=$ac_save_LIBS -AC_LANG_POP([C]) - -if test x$have_directx = xyes ; then - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) - AC_MSG_RESULT(*** All DirectX dependent parts will be disabled ***) -fi - -AC_SUBST(DIRECTX_CPPFLAGS) -AC_SUBST(DIRECTX_AUDIO_LIBS) -AC_SUBST(DIRECTX_VIDEO_LIBS) -AM_CONDITIONAL(HAVE_DIRECTX, test x$have_directx = "xyes") - -dnl result -if test x"$have_directx" = "xyes"; then - ifelse([$1], , :, [$1]) -else - ifelse([$2], , :, [$2]) -fi - + AC_ARG_WITH([dxheaders], + [AS_HELP_STRING([--with-dxheaders], [specify location of DirectX headers])], + [dxheaders_prefix="$withval"], [dxheaders_prefix="no"]) + if test x"$dxheaders_prefix" != x"no"; then + DIRECTX_CPPFLAGS="-I$dxheaders_prefix $DIRECTX_CPPFLAGS" + fi + + AC_MSG_CHECKING([for DirectX]) + DIRECTX_AUDIO_LIBS="$DIRECTX_LIBS -ldsound" + DIRECTX_VIDEO_LIBS="$DIRECTX_LIBS -lgdi32 -lddraw" + + AC_LANG_PUSH([C]) + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $DIRECTX_CPPFLAGS" + ac_save_LIBS="$LIBS" LIBS="$LIBS $DIRECTX_VIDEO_LIBS $DIRECTX_AUDIO_LIBS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include + #include + #include ]], + [[DirectDrawCreate(0, NULL, 0); DirectsoundCreate(0, NULL, 0)]])], + [have_directx=yes], [have_directx=no]) + CPPFLAGS=$ac_save_CPPFLAGS + LIBS=$ac_save_LIBS + AC_LANG_POP([C]) + + AC_SUBST(DIRECTX_CPPFLAGS) + AC_SUBST(DIRECTX_AUDIO_LIBS) + AC_SUBST(DIRECTX_VIDEO_LIBS) + AM_CONDITIONAL([HAVE_DIRECTX], [test x"$have_directx" = x"yes"]) + + AC_MSG_RESULT([$have_directx]) + if test x"$have_directx" = x"yes"; then + AC_DEFINE([HAVE_DIRECTX], 1, [Define this if you have DirectX]) + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi ]) diff --git a/m4/dl.m4 b/m4/dl.m4 deleted file mode 100644 index 30ea00b1c..000000000 --- a/m4/dl.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl -dnl Check for dlopen symbol and set DYNAMIC_LD_LIBS. -dnl -dnl AM_DL() -dnl - -AC_DEFUN([AM_DL], [ - AC_CHECK_LIB(c, dlopen, - [DYNAMIC_LD_LIBS="" - have_dl=yes]) - - if test x$have_dl != "xyes"; then - AC_CHECK_LIB(dl, dlopen, - [DYNAMIC_LD_LIBS="-ldl" - have_dl=yes]) - fi - - if test x$have_dl != "xyes"; then - AC_MSG_CHECKING(for dlopen under win32) - AC_LANG_PUSH([C]) - - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LIBS="$LIBS" - CPPFLAGS="-I${srcdir}/win32/include $CPPFLAGS" - LIBS="$LIBS -lkernel32" - AC_COMPILE_IFELSE([ -#include -#include - -int main() { - dlopen(NULL, 0); - return 0; -} -], - [DYNAMIC_LD_LIBS=-lkernel32 - have_dl=yes - AC_MSG_RESULT(yes)], - AC_MSG_RESULT(no) - ) - - CPPFLAGS=$ac_save_CPPFLAGS - LIBS=$ac_save_LIBS - - AC_LANG_POP([C]) - fi - - if test x$have_dl != "xyes"; then - AC_MSG_ERROR(dynamic linker needed) - fi - - AC_SUBST(DYNAMIC_LD_LIBS) - -]) diff --git a/m4/input.m4 b/m4/input.m4 new file mode 100644 index 000000000..31d22f128 --- /dev/null +++ b/m4/input.m4 @@ -0,0 +1,308 @@ +dnl ------------- +dnl Input Plugins +dnl ------------- +AC_DEFUN([XINE_INPUT_PLUGINS], [ + dnl Setup defaults for the target operating system. For example, v4l is + dnl only ever available on Linux, so don't bother checking for it unless + dnl explicitly requested to do so on other operating systems. + dnl Notes: + dnl - v4l is Linux only + + default_enable_gnomevfs=enable + default_enable_samba=enable + default_enable_v4l=disable + default_enable_vcd=enable + + default_with_internal_vcdlibs=without + + case "$host_os" in + linux*) default_enable_v4l=enable ;; + esac + + + dnl gnome-vfs + AC_ARG_ENABLE([gnomevfs], + [AS_HELP_STRING([--disable-gnomevfs], [do not build gnome-vfs support])], + [], [test $default_enable_gnomevfs = disable && enable_gnomevfs=no]) + if test x"$enable_gnomevfs" != x"no"; then + PKG_CHECK_MODULES([GNOME_VFS], [gnome-vfs-2.0], [no_gnome_vfs=no], [no_gnome_vfs=yes]) + if test x"$no_gnome_vfs" != x"yes"; then + AC_DEFINE([HAVE_GNOME_VFS], 1, [Define this if you have gnome-vfs installed]) + fi + else + no_gnome_vfs=yes + fi + AM_CONDITIONAL([HAVE_GNOME_VFS], [test x"$no_gnome_vfs" != x"yes"]) + + + dnl libsmbclient + AC_ARG_ENABLE([samba], + [AS_HELP_STRING([--disable-samba], [do not build Samba support])], + [], [test $default_enable_samba = disable && enable_samba=no]) + if test x"$enable_samba" != x"no"; then + AC_CHECK_LIB([smbclient], [smbc_init], + [AC_CHECK_HEADERS([libsmbclient.h], [have_libsmbclient=yes + LIBSMBCLIENT_LIBS="-lsmbclient"])]) + AC_SUBST(LIBSMBCLIENT_LIBS) + fi + AM_CONDITIONAL([HAVE_LIBSMBCLIENT], [test x"$have_libsmbclient" = x"yes"]) + + + dnl video-for-linux (v4l) + AC_ARG_ENABLE([v4l], + [AS_HELP_STRING([--disable-v4l], [do not build Video4Linux input plugin])], + [], [test $default_enable_v4l = disable && enable_v4l=no]) + if test x"$enable_v4l" != x"no"; then + AC_CHECK_HEADERS([linux/videodev.h], [have_v4l=yes], [have_v4l=no]) + AC_CHECK_HEADERS([asm/types.h]) + if test x"$enable_v4l" = x"yes" && test x"$have_v4l" = x"no"; then + AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.]) + fi + fi + AM_CONDITIONAL([HAVE_V4L], [test x"$have_v4l" = x"yes"]) + + + dnl cdrom ioctls (common for dvdnav and vcd) + case "$host_os" in + linux*) + AC_CHECK_HEADERS([linux/cdrom.h], + [AC_DEFINE([HAVE_LINUX_CDROM], 1, [Define 1 if you have Linux-type CD-ROM support]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[struct cdrom_generic_command test; int has_timeout = sizeof(test.timeout);]])], + [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1], [Define 1 if timeout is in cdrom_generic_command struct])])]) + ;; + esac + AC_CHECK_HEADERS([sys/dvdio.h sys/cdio.h sys/scsiio.h]) + AC_CACHE_CHECK([if cdrom ioctls are available], [am_cv_have_cdrom_ioctls], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[CDROM_DRIVE_STATUS]])], + [am_cv_have_cdrom_ioctls=yes], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[CDIOCALLOW]])], + [am_cv_have_cdrom_ioctls=yes], + [AC_EGREP_CPP([we_have_cdrom_ioctls], + [#include + #ifdef HAVE_SYS_CDIO_H + # include + #endif + #ifdef HAVE_LINUX_CDROM_H + # include + #endif + #if defined(CDROM_DRIVE_STATUS) || defined(CDIOCALLOW) || defined(CDROMCDXA) + we_have_cdrom_ioctls + #endif], + [am_cv_have_cdrom_ioctls=yes], [am_cv_have_cdrom_ioctls=no])])])]) + have_cdrom_ioctls="$am_cv_have_cdrom_ioctls" + if test x"$have_cdrom_ioctls" = x"yes"; then + AC_DEFINE([HAVE_CDROM_IOCTLS], 1, [Define this if you have CDROM ioctls]) + fi + AM_CONDITIONAL([HAVE_CDROM_IOCTLS], [test x"$have_cdrom_ioctls" = x"yes"]) + + + dnl dvdnav + dnl REVISIT: Something doesn't feel right about this ... I'm not sure it works as intended + AC_ARG_WITH([external-dvdnav], + [AS_HELP_STRING([--with-external-dvdnav], [use external dvdnav library (not recommended)])], + [external_dvdnav="$withval"], [no_dvdnav=yes external_dvdnav=no]) + if test "x$external_dvdnav" = "xyes"; then + AM_PATH_DVDNAV([0.1.9], + [AC_DEFINE([HAVE_DVDNAV], 1, [Define this if you have a suitable version of libdvdnav])], + [AC_MSG_RESULT([*** no usable version of libdvdnav found, using internal copy ***])]) + else + AC_MSG_RESULT([Use included DVDNAV support]) + fi + AM_CONDITIONAL([HAVE_DVDNAV], [test x"$no_dvdnav" != x"yes"]) + + + dnl Video CD + AC_ARG_ENABLE([vcd], + [AS_HELP_STRING([--disable-vcd], [do not compile VCD plugin])], + [], [test $default_enable_vcd = disable && enable_vcd=no]) + if test x"$enable_vcd" != x"no"; then + AC_ARG_WITH([internal-vcdlibs], + [AS_HELP_STRING([--with-internal-vcdlibs], [force using internal libcdio/libvcd/libvcdinfo])], + [], [test $default_with_internal_vcdlibs = without && with_internal_vcdlibs=no]) + dnl check twice - fallback is to use internal vcdlibs + if test x"$with_internal_vcdlibs" = x"no"; then + PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71], [], [with_internval_vcdlibs=yes]) + PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23], [], [with_internval_vcdlibs=yes]) + if test x"$with_internval_vcdlibs" = x"yes"; then + AC_MSG_RESULT([Using included libcdio/libvcdinfo support]) + fi + fi + if test "x$with_internval_vcdlibs" = "xno"; then + AC_DEFINE([HAVE_VCDNAV], 1, [Define this if you use external libcdio/libvcdinfo]) + else + AC_DEFINE_UNQUOTED([HOST_ARCH], ["$host_os/$host_cpu"], [host os/cpu identifier]) + AC_DEFINE([_DEVELOPMENT_], [], [enable warnings about being development release]) + AC_CHECK_FUNCS([bzero memcpy]) + + AC_CHECK_MEMBER([struct tm.tm_gmtoff], + [AC_DEFINE([HAVE_TM_GMTOFF], 1, [Define if struct tm has the tm_gmtoff member.])], + [], [#include ]) + + dnl empty_array_size + AC_MSG_CHECKING([how to create empty arrays]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[]; } baz]])], + [empty_array_size=""], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[0]; } baz]])], + [empty_array_size="0"], + [AC_MSG_ERROR([compiler is unable to create empty arrays])])]) + + AC_DEFINE_UNQUOTED([EMPTY_ARRAY_SIZE], [$empty_array_size], [what to put between the brackets for empty arrays]) + AC_MSG_RESULT([[[$empty_array_size]]]) + + dnl ISOC99_PRAGMA + AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Pragma("pack(1)")]])], + [ISOC99_PRAGMA=yes + AC_DEFINE([HAVE_ISOC99_PRAGMA], [], [Supports ISO _Pragma() macro])], + [ISOC99_PRAGMA=no]) + AC_MSG_RESULT([$ISOC99_PRAGMA]) + + AC_CHECK_HEADERS([errno.h fcntl.h glob.h stdbool.h]) + if test x"$ac_cv_header_stdint_h" != x"yes"; then + AC_CHECK_SIZEOF([int], 4) + AC_CHECK_SIZEOF([long], 4) + AC_CHECK_SIZEOF([long long], 8) + fi + + dnl + dnl bitfield order + dnl + AC_MSG_CHECKING([bitfield ordering in structs]) + + dnl basic compile test for all platforms + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ + struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + __attribute__((packed)) + #endif + bf = { 1,1,1,1 }; + switch (0) case 0: case sizeof(bf) == 1:;]])], + [], [AC_MSG_ERROR([compiler doesn't support bitfield structs])]) + + + dnl run test + AC_RUN_IFELSE([[ + int main() { + struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + __attribute__((packed)) + #endif + bf = { 1,1,1,1 }; + if (sizeof (bf) != 1) return 1; + return *((unsigned char*) &bf) != 0x4b; + }]], [bf_lsbf=1], [ + AC_RUN_IFELSE([[ + int main() { + struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + __attribute__((packed)) + #endif + bf = { 1,1,1,1 }; + if (sizeof (bf) != 1) return 1; + return *((unsigned char*) &bf) != 0xa5; + }]], [bf_lsbf=0], [AC_MSG_ERROR([unsupported bitfield ordering])])], + [case "$host" in + *-*-mingw32* | *-*-cygwin* | i?86-* | k?-* | athlon-* | pentium*- | x86_64-*) + bf_lsbf=1 + ;; + universal-*-darwin*) + bf_lsbf=2 + ;; + powerpc-* | powerpc64-* | ppc-* | sparc*-* | mips-*) + bf_lsbf=0 + ;; + *) + AC_MSG_RESULT([unknown]) + AC_MSG_ERROR([value of bitfield test isn't known for $host + ********************************************************************* + Value of bitfield test can't be found out for cross-compiling and we + don't know its value for host "$host". + + Because it's needed for VCD plugin, disable VCD by configure option + --disable-vcd or use external VCD library. + *********************************************************************]) + ;; + esac]) + + if test "x$cross_compiling" = "xyes"; then + TEXT=" (guessed)" + else + TEXT="" + fi + if test "x$bf_lsbf" = "x1"; then + AC_MSG_RESULT([LSBF${TEXT}]) + AC_DEFINE([BITFIELD_LSBF], [], [compiler does lsbf in struct bitfields]) + else + if test "x$bf_lsbf" = "x2"; then + AC_MSG_RESULT([indeterminate (universal build)]) + else + AC_MSG_RESULT([MSBF${TEXT}]) + fi + fi + + dnl REVISIT: CFLAGS stuff here is wrong; it should be CPPFLAGS + LIBCDIO_CFLAGS='-I$(top_srcdir)/src/input/vcd/libcdio' + LIBCDIO_LIBS='$(top_builddir)/src/input/vcd/libcdio/libcdio.la' + LIBISO9660_LIBS='$(top_builddir)/src/input/vcd/libcdio/libiso9660.la' + LIBVCD_CFLAGS='-I$(top_srcdir)/src/input/vcd/libvcd' + LIBVCD_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcd.la' + LIBVCDINFO_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcdinfo.la' + + case "$host_os" in + bsdi*) + AC_CHECK_HEADERS([dvd.h], + [AC_DEFINE([HAVE_BSDI_CDROM], 1, [Define 1 if you have BSDI-type CD-ROM support])]) + ;; + cygwin*) + AC_DEFINE([CYGWIN], 1, [Define 1 if you are compiling using cygwin]) + AC_DEFINE([HAVE_WIN32_CDROM], 1, [Define 1 if you have MinGW CD-ROM support]) + LIBCDIO_LIBS="$LIBCDIO_LIBS -lwinmm" + LIBVCD_LIBS="$LIBVCD_LIBS -lwinmm" + ;; + darwin*) + AC_CHECK_HEADERS([IOKit/IOKitLib.h CoreFoundation/CFBase.h], + [AC_DEFINE([HAVE_DARWIN_CDROM], 1, [Define 1 if you have Darwin OS X-type CD-ROM support])]) + ;; + freebsd4.*) + AC_DEFINE([HAVE_FREEBSD_CDROM], 1, [Define 1 if you have FreeBSD CD-ROM support]) + ;; + linux*) + AC_CHECK_HEADERS([linux/version.h]) + ;; + mingw*) + AC_DEFINE([MINGW32], 1, [Define 1 if you are compiling using MinGW]) + AC_DEFINE([HAVE_WIN32_CDROM], 1, [Define 1 if you have MinGW CD-ROM support]) + ;; + sunos*|sun*|solaris*) + AC_CHECK_HEADERS([sys/cdio.h], + [AC_DEFINE([HAVE_SOLARIS_CDROM], 1, [Define 1 if you have Solaris CD-ROM support])]) + ;; + *) + AC_MSG_WARN([Don't have OS CD-reading support for ${host_os} ... Will use generic support.]) + ;; + esac + + fi + fi + + AC_DEFINE([LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) + AC_DEFINE([EXTERNAL_LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) + AC_SUBST(LIBCDIO_CFLAGS) + AC_SUBST(LIBCDIO_LIBS) + AC_SUBST(LIBISO9660_LIBS) + AC_SUBST(LIBVCD_CFLAGS) + AC_SUBST(LIBVCD_LIBS) + AC_SUBST(LIBVCDINFO_LIBS) + AM_CONDITIONAL([HAVE_VCDNAV], [test x"$with_internval_vcdlibs" = x"no"]) + AM_CONDITIONAL([ENABLE_VCD], [test x"$enable_vcd" = x"yes"]) +]) + + + + + + + + + diff --git a/m4/ioctl_request.m4 b/m4/ioctl_request.m4 index c6d12258e..b90559592 100644 --- a/m4/ioctl_request.m4 +++ b/m4/ioctl_request.m4 @@ -34,19 +34,15 @@ dnl well. dnl Usage AC_IOCTL_REQUEST AC_DEFUN([AC_IOCTL_REQUEST], [ - AC_CACHE_CHECK([type of request parameter for ioctl()], - ac_cv_ioctl_request, - [for ac_ioctl_request_type in "unsigned long" "int" - do - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - int ioctl(int fd, $ac_ioctl_request_type request, ...); - ]], [[]])],[ac_cv_ioctl_request=$ac_ioctl_request_type],[]) - done]) - - if test "x$ac_cv_ioctl_request" = "x"; then - AC_MSG_ERROR([Unable to determine the type for ioctl() request parameter]) - fi - - AC_DEFINE_UNQUOTED([IOCTL_REQUEST_TYPE], $ac_cv_ioctl_request, [Type of the request parameter for ioctl()]) + AC_CACHE_CHECK([type of request parameter for ioctl()], [ac_cv_ioctl_request], [ + for ac_ioctl_request_type in "unsigned long" "int"; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include + int ioctl(int fd, $ac_ioctl_request_type request, ...);]], [[]])], + [ac_cv_ioctl_request=$ac_ioctl_request_type], []) + done + if test "x$ac_cv_ioctl_request" = "x"; then + AC_MSG_ERROR([Unable to determine the type for ioctl() request parameter]) + fi + ]) + AC_DEFINE_UNQUOTED([IOCTL_REQUEST_TYPE], [$ac_cv_ioctl_request], [Type of the request parameter for ioctl()]) ]) diff --git a/m4/macosx.m4 b/m4/macosx.m4 index 2fafa695c..8a66c49b9 100644 --- a/m4/macosx.m4 +++ b/m4/macosx.m4 @@ -30,7 +30,7 @@ AC_DEFUN([MACOSX_UNIVERSAL_BINARIES], [ host="`echo $host | sed -e s/$host_cpu/universal/g`" host_cpu=universal - AC_DEFINE(XINE_MACOSX_UNIVERSAL_BINARY, 1, [Define this if a universal binary is being built for Mac OS X]) + AC_DEFINE([XINE_MACOSX_UNIVERSAL_BINARY], 1, [Define this if a universal binary is being built for Mac OS X]) for arch in $UNIVERSAL_ARCHES ; do UNIVERSAL_CFLAGS="$UNIVERSAL_CFLAGS -arch $arch" UNIVERSAL_LDFLAGS="$UNIVERSAL_LDFLAGS -arch $arch" diff --git a/m4/vcd.m4 b/m4/vcd.m4 deleted file mode 100644 index 917fc5128..000000000 --- a/m4/vcd.m4 +++ /dev/null @@ -1,230 +0,0 @@ -AC_DEFUN([VCD_SUPPORT], [ - AC_ARG_ENABLE(vcd, AS_HELP_STRING([--disable-vcd], [do not compile VCD plugin]), - enable_vcd=$enableval, enable_vcd=yes) - -dnl Force build of both vcd plugins, for now. -dnl AC_ARG_ENABLE(vcdo, AS_HELP_STRING([--disable-vcdo], [do not compile old VCD plugin]), -dnl enable_vcdo=$enableval, enable_vcdo=yes) -dnl - enable_vcdo="yes" - - AC_ARG_WITH(internal-vcdlibs, AS_HELP_STRING([--with-internal-vcdlibs], [force using internal libcdio/libvcd/libvcdinfo]), - [internal_vcdnav="$withval"], [internal_vcdnav="no"]) - - if test "x$enable_vcd" = "xyes"; then - dnl empty_array_size - AC_MSG_CHECKING([how to create empty arrays]) - - empty_array_size="xxx" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[]; } doo;]])],[empty_array_size=""],[]) - - if test "x$empty_array_size" = "xxxx";then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[0]; } doo;]])],[empty_array_size="0"],[]) - fi - - if test "x$empty_array_size" = "xxxx" - then - AC_MSG_ERROR([compiler is unable to creaty empty arrays]) - else - AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size, - [what to put between the brackets for empty arrays]) - changequote(`,') - msg="[${empty_array_size}]" - changequote([,]) - AC_MSG_RESULT($msg) - fi - dnl empty_array_size - - if test "x$internal_vcdnav" = "xno" ; then - PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71], [], [internal_vcdnav=yes]) - PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23], [], [internal_vcdnav=yes]) - if test "x$internal_vcdnav" = "xyes"; then - AC_MSG_RESULT([Use included libcdio/libvcdinfo support]) - fi - fi - - dnl check twice, fallback is internal copy - if test "x$internal_vcdnav" = "xno"; then - AC_DEFINE([HAVE_VCDNAV], [1], [Define this if you use external libcdio/libvcdinfo]) - else - AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_os/$host_cpu", [host os/cpu identifier]) - - AC_DEFINE(_DEVELOPMENT_, [], enable warnings about being development release) - AC_HEADER_STDC - AC_CHECK_HEADERS(sys/stat.h stdint.h glob.h inttypes.h stdbool.h) - - if test "x$ac_cv_header_stdint_h" != "xyes" - then - AC_CHECK_SIZEOF(int, 4) - AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(long long, 8) - fi - - dnl ISOC99_PRAGMA - AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Pragma("pack(1)")]])],[ - ISOC99_PRAGMA=yes - AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro]) - ],[ISOC99_PRAGMA=no]) - AC_MSG_RESULT($ISOC99_PRAGMA) - - dnl - dnl bitfield order - dnl - AC_MSG_CHECKING([bitfield ordering in structs]) - - dnl basic compile test for all platforms - AC_COMPILE_IFELSE([ -int main() { - struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) - __attribute__((packed)) -#endif - bf = { 1,1,1,1 }; - switch (0) case 0: case sizeof(bf) == 1:; - return 0; -} -], [], AC_MSG_ERROR([compiler doesn't support bitfield structs])) - - - dnl run test - AC_RUN_IFELSE([ -int main() { - struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) - __attribute__((packed)) -#endif - bf = { 1,1,1,1 }; - if (sizeof (bf) != 1) return 1; - return *((unsigned char*) &bf) != 0x4b; } -], bf_lsbf=1, [ - AC_RUN_IFELSE([ -int main() { - struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; } -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) - __attribute__((packed)) -#endif - bf = { 1,1,1,1 }; - if (sizeof (bf) != 1) return 1; - return *((unsigned char*) &bf) != 0xa5; } -], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering])) - ], - [case "$host" in - *-*-mingw32* | *-*-cygwin*) - bf_lsbf=1 - ;; - universal-*-darwin*) - bf_lsbf=0 - ;; - *) - AC_MSG_RESULT([unknown]) - AC_MSG_ERROR([value of bitfield test isn't known for $host -********************************************************************* -Value of bitfield test can't be found out for cross-compiling and we -don't know its value for host "$host". - -Because it's needed for VCD plugin, disable VCD by configure option ---disable-vcd or use external VCD library. -*********************************************************************]) - esac]) - - if test "x$cross_compiling" = "xyes"; then - TEXT=" (guessed)" - else - TEXT="" - fi - if test "x$bf_lsbf" = "x1"; then - AC_MSG_RESULT(LSBF${TEXT}) - AC_DEFINE(BITFIELD_LSBF, [], [compiler does lsbf in struct bitfields]) - else - AC_MSG_RESULT(MSBF${TEXT}) - fi - - AC_CHECK_HEADERS([errno.h fcntl.h \ - stdbool.h stdlib.h stdint.h stdio.h string.h \ - strings.h linux/version.h sys/cdio.h sys/stat.h \ - sys/types.h ]) - - LIBCDIO_CFLAGS='-I$(top_srcdir)/src/input/vcd/libcdio' - LIBCDIO_LIBS='$(top_builddir)/src/input/vcd/libcdio/libcdio.la' - LIBISO9660_LIBS='$(top_builddir)/src/input/vcd/libcdio/libiso9660.la' - LIBVCD_CFLAGS='-I$(top_srcdir)/src/input/vcd/libvcd' - LIBVCD_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcd.la' - LIBVCDINFO_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcdinfo.la' - - case $host_os in - darwin*) - AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h, [have_iokit_h="yes"]) - if test "x$have_iokit_h" = "xyes" ; then - AC_DEFINE([HAVE_DARWIN_CDROM], [1], [Define 1 if you have Darwin OS X-type CD-ROM support]) - fi - ;; - linux*) - AC_CHECK_HEADERS(linux/version.h) - AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"]) - if test "x$have_linux_cdrom_h" = "xyes" ; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ -#include -struct cdrom_generic_command test; -int has_timeout=sizeof(test.timeout);]])], - [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1], [Define 1 if timeout is in cdrom_generic_command struct])],[]) - AC_DEFINE([HAVE_LINUX_CDROM], [1], [Define 1 if you have Linux-type CD-ROM support]) - fi - ;; - bsdi*) - AC_CHECK_HEADERS(dvd.h, [have_bsdi_dvd_h="yes"]) - if test "x$have_bsdi_dvd_h" = "xyes" ; then - AC_DEFINE([HAVE_BSDI_CDROM], [1], [Define 1 if you have BSDI-type CD-ROM support]) - fi - ;; - sunos*|sun*|solaris*) - AC_CHECK_HEADERS(sys/cdio.h) - AC_DEFINE([HAVE_SOLARIS_CDROM], [1], [Define 1 if you have Solaris CD-ROM support]) - ;; - cygwin*) - AC_DEFINE([CYGWIN], [1], [Define 1 if you are compiling using cygwin]) - AC_DEFINE([HAVE_WIN32_CDROM], [1], [Define 1 if you have MinGW CD-ROM support]) - LIBCDIO_LIBS="$LIBCDIO_LIBS -lwinmm" - LIBVCD_LIBS="$LIBVCD_LIBS -lwinmm" - ;; - mingw*) - AC_DEFINE([MINGW32], [1], [Define 1 if you are compiling using MinGW]) - AC_DEFINE([HAVE_WIN32_CDROM], [1], [Define 1 if you have MinGW CD-ROM support]) - ;; - freebsd4.*) - AC_DEFINE([HAVE_FREEBSD_CDROM], [1], [Define 1 if you have FreeBSD CD-ROM support]) - ;; - *) - AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...) - AC_MSG_WARN(Will use generic support.) - ;; - esac - AC_SUBST(LINUX_CDROM_TIMEOUT) - AC_SUBST(HAVE_BSDI_CDROM) - AC_SUBST(HAVE_DARWIN_CDROM) - AC_SUBST(HAVE_FREEBSD_CDROM) - AC_SUBST(HAVE_LINUX_CDROM) - AC_SUBST(HAVE_SOLARIS_CDROM) - AC_SUBST(HAVE_WIN32_CDROM) - AC_SUBST(LINUX_CDROM_TIMEOUT) - AC_SUBST(LIBVCD_SYSDEP) - - AC_CHECK_FUNCS( bzero memcpy ) - - AC_CHECK_MEMBER([struct tm.tm_gmtoff], - [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has the tm_gmtoff member.])], - [], [#include ]) - fi - fi - - AC_DEFINE([LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) - AC_DEFINE([EXTERNAL_LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) - AC_SUBST(LIBCDIO_CFLAGS) - AC_SUBST(LIBCDIO_LIBS) - AC_SUBST(LIBISO9660_LIBS) - AC_SUBST(LIBVCD_CFLAGS) - AC_SUBST(LIBVCD_LIBS) - AC_SUBST(LIBVCDINFO_LIBS) - AM_CONDITIONAL(HAVE_VCDNAV, [test "x$internal_vcdnav" = "xno"]) - AM_CONDITIONAL(ENABLE_VCD, [test "x$enable_vcd" = "xyes"]) -]) -- cgit v1.2.3