diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/Makefile.am | 36 | ||||
-rw-r--r-- | m4/_xine.m4 | 566 | ||||
-rw-r--r-- | m4/aa.m4 | 272 | ||||
-rw-r--r-- | m4/arts.m4 | 168 | ||||
-rw-r--r-- | m4/audio_out.m4 | 230 | ||||
-rw-r--r-- | m4/decoders.m4 | 488 | ||||
-rw-r--r-- | m4/directx.m4 | 94 | ||||
-rw-r--r-- | m4/dl.m4 | 53 | ||||
-rw-r--r-- | m4/dvdnav.m4 | 187 | ||||
-rw-r--r-- | m4/gas.m4 | 197 | ||||
-rw-r--r-- | m4/gettext/Makefile.am | 32 | ||||
-rw-r--r-- | m4/gettext/codeset.m4 | 21 | ||||
-rw-r--r-- | m4/gettext/gettext.m4 | 419 | ||||
-rw-r--r-- | m4/gettext/glibc2.m4 (renamed from m4/glibc2.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/glibc21.m4 (renamed from m4/glibc21.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/iconv.m4 | 101 | ||||
-rw-r--r-- | m4/gettext/intdiv0.m4 (renamed from m4/intdiv0.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/intmax.m4 | 30 | ||||
-rw-r--r-- | m4/gettext/inttypes-pri.m4 | 30 | ||||
-rw-r--r-- | m4/gettext/inttypes.m4 (renamed from m4/inttypes.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/inttypes_h.m4 | 26 | ||||
-rw-r--r-- | m4/gettext/isc-posix.m4 (renamed from m4/isc-posix.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/lcmessage.m4 (renamed from m4/lcmessage.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/lib-ld.m4 (renamed from m4/lib-ld.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/lib-link.m4 | 644 | ||||
-rw-r--r-- | m4/gettext/lib-prefix.m4 | 185 | ||||
-rw-r--r-- | m4/gettext/longdouble.m4 | 28 | ||||
-rw-r--r-- | m4/gettext/longlong.m4 | 23 | ||||
-rw-r--r-- | m4/gettext/nls.m4 | 31 | ||||
-rw-r--r-- | m4/gettext/po.m4 | 428 | ||||
-rw-r--r-- | m4/gettext/printf-posix.m4 (renamed from m4/printf-posix.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/progtest.m4 (renamed from m4/progtest.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/signed.m4 (renamed from m4/signed.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/size_max.m4 | 59 | ||||
-rw-r--r-- | m4/gettext/stdint_h.m4 | 26 | ||||
-rw-r--r-- | m4/gettext/uintmax_t.m4 (renamed from m4/uintmax_t.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/ulonglong.m4 | 23 | ||||
-rw-r--r-- | m4/gettext/wchar_t.m4 (renamed from m4/wchar_t.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/wint_t.m4 (renamed from m4/wint_t.m4) | 0 | ||||
-rw-r--r-- | m4/gettext/xsize.m4 (renamed from m4/xsize.m4) | 0 | ||||
-rw-r--r-- | m4/input.m4 | 149 | ||||
-rw-r--r-- | m4/ioctl_request.m4 | 52 | ||||
-rw-r--r-- | m4/irixal.m4 | 19 | ||||
-rw-r--r-- | m4/libFLAC.m4 | 27 | ||||
-rw-r--r-- | m4/libfame.m4 | 183 | ||||
-rw-r--r-- | m4/macosx.m4 | 43 | ||||
-rw-r--r-- | m4/objc.m4 | 253 | ||||
-rw-r--r-- | m4/opengl.m4 | 74 | ||||
-rw-r--r-- | m4/optimizations.m4 | 252 | ||||
-rw-r--r-- | m4/package.m4 | 72 | ||||
-rw-r--r-- | m4/pkg.m4 | 6 | ||||
-rw-r--r-- | m4/programs.m4 | 124 | ||||
-rw-r--r-- | m4/summary.m4 | 354 | ||||
-rw-r--r-- | m4/types.m4 | 215 | ||||
-rw-r--r-- | m4/video_out.m4 | 502 | ||||
-rw-r--r-- | m4/xine.m4 | 260 | ||||
-rw-r--r-- | m4/xv.m4 | 93 |
57 files changed, 4792 insertions, 2283 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am index bcaa78a49..5b76df5e0 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,5 +1,7 @@ include $(top_srcdir)/misc/Makefile.common +SUBDIRS = gettext + if INSTALL_M4 m4datadir = $(ACLOCAL_DIR) else @@ -8,29 +10,21 @@ endif m4data_DATA = xine.m4 -EXTRA_DIST = glibc2.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 \ - aa.m4 \ - arts.m4 \ +EXTRA_DIST = \ attributes.m4 \ - codeset.m4 \ + audio_out.m4 \ + decoders.m4 \ directx.m4 \ - dl.m4 \ - dvdnav.m4 \ - gettext.m4 \ - glibc21.m4 \ - iconv.m4 \ - irixal.m4 \ - isc-posix.m4 \ - lcmessage.m4 \ - libFLAC.m4 \ - libfame.m4 \ + gas.m4 \ + input.m4 \ + macosx.m4 \ misc.m4 \ - opengl.m4 \ - optimizations.m4 \ + objc.m4 \ pkg.m4 \ - progtest.m4 \ - xine.m4 \ - _xine.m4 \ - xv.m4 \ + programs.m4 \ pthreads.m4 \ - gas.m4 + symbol.m4 \ + summary.m4 \ + types.m4 \ + video_out.m4 \ + xine.m4 diff --git a/m4/_xine.m4 b/m4/_xine.m4 deleted file mode 100644 index 3ebbb028d..000000000 --- a/m4/_xine.m4 +++ /dev/null @@ -1,566 +0,0 @@ -dnl AC_C_ALWAYS_INLINE -dnl Define inline to something appropriate, including the new always_inline -dnl attribute from gcc 3.1 -dnl Thanks to Michel LESPINASSE <walken@zoy.org> -dnl __inline__ "check" added by Darren Salt -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" - CFLAGS="$CFLAGS -Wall -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[inline __attribute__ ((__always_inline__)) void f (void);]])], - [ac_cv_always_inline=yes],[ac_cv_always_inline=no]) - CFLAGS="$SAVE_CFLAGS" - AC_MSG_RESULT([$ac_cv_always_inline]) - if test x"$ac_cv_always_inline" = x"yes"; then - AH_TOP([ -#ifdef inline -/* the strange formatting below is needed to prevent config.status from rewriting it */ -# undef \ - inline -#endif - ]) - AC_DEFINE_UNQUOTED([inline],[inline __attribute__ ((__always_inline__))]) - fi - ac_cv_c___inline__='' - else - # FIXME: test the compiler to see if it supports __inline__ - # instead of assuming that if it isn't gcc, it doesn't - case "$ac_cv_c_inline" in - yes) - ac_cv_c___inline__=inline - ;; - inline|__inline__) - ac_cv_c___inline__='' - ;; - *) - ac_cv_c___inline__="$ac_cv_c_inline" - ;; - esac - fi - if test x"$ac_cv_c___inline__" != x; then - AC_DEFINE_UNQUOTED([__inline__],[$ac_cv_c___inline__],[Define if the compiler doesn't recognise __inline__]) - fi -]) - -dnl -dnl Check for minimum version of libtool -dnl AC_PREREQ_LIBTOOL([MINIMUM VERSION],[ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]) -AC_DEFUN([AC_PREREQ_LIBTOOL], - [ - lt_min_full=ifelse([$1], ,1.3.5,$1) - lt_min=`echo $lt_min_full | sed -e 's/\.//g'` - AC_MSG_CHECKING(for libtool >= $lt_min_full) - lt_version="`grep '^VERSION' $srcdir/ltmain.sh | sed -e 's/VERSION\=//g;s/[[-.a-zA-Z]]//g'`" - - if test $lt_version -lt 100 ; then - lt_version=`expr $lt_version \* 10` - fi - - if test $lt_version -lt $lt_min ; then - AC_MSG_RESULT(no) - ifelse([$3], , :, [$3]) - fi - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - ]) - -dnl -AC_DEFUN([AC_CHECK_LIRC], - [AC_ARG_ENABLE(lirc, - AS_HELP_STRING([--disable-lirc], [turn off LIRC support]), - enable_lirc=$enableval, enable_lirc=yes) - - if test x"$enable_lirc" = xyes; then - have_lirc=yes - AC_REQUIRE_CPP - AC_CHECK_LIB(lirc_client,lirc_init, - AC_CHECK_HEADER(lirc/lirc_client.h, true, have_lirc=no), have_lirc=no) - if test "$have_lirc" = "yes"; then - - if test x"$LIRC_PREFIX" != "x"; then - lirc_libprefix="$LIRC_PREFIX/lib" - LIRC_INCLUDE="-I$LIRC_PREFIX/include" - fi - for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do - AC_CHECK_FILE("$llirc/liblirc_client.a", - LIRC_LIBS="$llirc/liblirc_client.a" - AC_DEFINE(HAVE_LIRC),,) - done - else - AC_MSG_RESULT([*** LIRC client support not available, LIRC support will be disabled ***]); - fi - fi - - AC_SUBST(LIRC_LIBS) - AC_SUBST(LIRC_INCLUDE) -]) - - -dnl AC_LINUX_PATH(DEFAULT PATH) -AC_DEFUN([AC_LINUX_PATH], - [AC_ARG_WITH(linux-path, - AS_HELP_STRING([--with-linux-path=PATH], [where the linux sources are located]), - linux_path="$withval", linux_path="$1") - LINUX_INCLUDE="-I$linux_path/include" -]) - -dnl AC_CHECK_DXR3() -AC_DEFUN([AC_CHECK_DXR3], -[ - AC_ARG_ENABLE(dxr3, - AS_HELP_STRING([--disable-dxr3], [do not build the DXR3/HW+ plugins]), - enable_dxr3=$enableval, enable_dxr3=yes) - if test x"$enable_dxr3" = xyes; then - have_dxr3=yes - AC_MSG_RESULT([*** checking for a supported mpeg encoder]) - have_encoder=no - have_libfame=yes - AC_CHECK_LIB(fame, fame_open, - [AC_CHECK_HEADER(fame.h, true, have_libfame=no)], have_libfame=no) - if test "$have_libfame" = "yes"; then - AC_DEFINE(HAVE_LIBFAME) - have_encoder=yes - fi - have_librte=yes - AC_CHECK_LIB(rte, rte_init, - [AC_CHECK_HEADER(rte.h, true, have_librte=no)], have_librte=no) - if test "$have_librte" = "yes"; then - AC_DEFINE(HAVE_LIBRTE) - AC_MSG_WARN([this will probably only work with rte version 0.4!]) - have_encoder=yes - fi - if test "$have_encoder" = "yes"; then - AC_MSG_RESULT([*** found one or more external mpeg encoders]); - else - AC_MSG_RESULT([*** no external mpeg encoder found]); - fi - else - AC_MSG_RESULT([DXR3 plugins will not be built.]) - have_dxr3=no - fi -]) - -dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS]) -dnl check if $CC supports a given set of cflags -AC_DEFUN([AC_TRY_CFLAGS], - [AC_MSG_CHECKING([if $CC supports $1 flags]) - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) - CFLAGS="$SAVE_CFLAGS" - AC_MSG_RESULT([$ac_cv_try_cflags_ok]) - if test x"$ac_cv_try_cflags_ok" = x"yes"; then - ifelse([$2],[],[:],[$2]) - else - ifelse([$3],[],[:],[$3]) - fi]) - -dnl AC_TRY_LDFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS]) -dnl check if $CC supports a given set of ldflags -AC_DEFUN([AC_TRY_LDFLAGS], - [AC_MSG_CHECKING([if $CC supports $1 flags]) - SAVE_LDFLAGS="$LDFLAGS" - LDFLAGS="$1" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_try_ldflags_ok=yes],[ac_cv_try_ldflags_ok=no]) - LDFLAGS="$SAVE_LDFLAGS" - AC_MSG_RESULT([$ac_cv_try_ldflags_ok]) - if test x"$ac_cv_try_ldflags_ok" = x"yes"; then - ifelse([$2],[],[:],[$2]) - else - ifelse([$3],[],[:],[$3]) - fi]) - -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], - [AC_CHECK_HEADER([inttypes.h],, - [if test ! -d $1; then mkdir $1; fi - AC_CHECK_HEADER([stdint.h], - [cat >$1/inttypes.h << EOF -#ifndef _INTTYPES_H -#define _INTTYPES_H -/* helper inttypes.h for people who do not have it on their system */ - -#include <stdint.h> -EOF - ], - [AC_COMPILE_CHECK_SIZEOF([char],[1]) - AC_COMPILE_CHECK_SIZEOF([short],[2]) - AC_COMPILE_CHECK_SIZEOF([int],[4]) - AC_COMPILE_CHECK_SIZEOF([long long],[8]) - cat >$1/inttypes.h << EOF -#ifndef _INTTYPES_H -#define _INTTYPES_H -/* default inttypes.h for people who do not have it on their system */ -#if (!defined __int8_t_defined) && (!defined __BIT_TYPES_DEFINED__) -#define __int8_t_defined -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -#ifdef ARCH_X86 -typedef signed long long int64_t; -#endif -#endif -#if (!defined __uint8_t_defined) && (!defined _LINUX_TYPES_H) -#define __uint8_t_defined -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifdef ARCH_X86 -typedef unsigned long long uint64_t; -#endif -#endif -EOF - ]) - cat >>$1/inttypes.h << EOF - -#ifdef WIN32 -# define PRI64_PREFIX "I64" -#else -# define PRI64_PREFIX "l" -#endif - -#ifndef PRId8 -# define PRId8 "d" -#endif -#ifndef PRId16 -# define PRId16 "d" -#endif -#ifndef PRId32 -# define PRId32 "d" -#endif -#ifndef PRId64 -# define PRId64 PRI64_PREFIX "d" -#endif - -#ifndef PRIu8 -# define PRIu8 "u" -#endif -#ifndef PRIu16 -# define PRIu16 "u" -#endif -#ifndef PRIu32 -# define PRIu32 "u" -#endif -#ifndef PRIu64 -# define PRIu64 PRI64_PREFIX "u" -#endif - -#ifndef PRIx8 -# define PRIx8 "x" -#endif -#ifndef PRIx16 -# define PRIx16 "x" -#endif -#ifndef PRIx32 -# define PRIx32 "x" -#endif -#ifndef PRIx64 -# define PRIx64 PRI64_PREFIX "x" -#endif - -#ifndef PRIX8 -# define PRIX8 "X" -#endif -#ifndef PRIX16 -# define PRIX16 "X" -#endif -#ifndef PRIX32 -# define PRIX32 "X" -#endif -#ifndef PRIX64 -# define PRIX64 PRI64_PREFIX "X" -#endif - -#ifndef PRIdFAST8 -# define PRIdFAST8 "d" -#endif -#ifndef PRIdFAST16 -# define PRIdFAST16 "d" -#endif -#ifndef PRIdFAST32 -# define PRIdFAST32 "d" -#endif -#ifndef PRIdFAST64 -# define PRIdFAST64 "d" -#endif - -#ifndef PRIuFAST8 -# define PRIuFAST8 "u" -#endif -#ifndef PRIuFAST16 -# define PRIuFAST16 "u" -#endif -#ifndef PRIuFAST32 -# define PRIuFAST32 "u" -#endif -#ifndef PRIuFAST64 -# define PRIuFAST64 PRI64_PREFIX "u" -#endif - -#ifndef PRIxFAST8 -# define PRIxFAST8 "x" -#endif -#ifndef PRIxFAST16 -# define PRIxFAST16 "x" -#endif -#ifndef PRIxFAST32 -# define PRIxFAST32 "x" -#endif -#ifndef PRIxFAST64 -# define PRIxFAST64 PRI64_PREFIX "x" -#endif - -#ifndef SCNd8 -# define SCNd8 "hhd" -#endif -#ifndef SCNd16 -# define SCNd16 "hd" -#endif -#ifndef SCNd32 -# define SCNd32 "d" -#endif -#ifndef SCNd64 -# define SCNd64 PRI64_PREFIX "d" -#endif - -#ifndef SCNu8 -# define SCNu8 "hhu" -#endif -#ifndef SCNu16 -# define SCNu16 "hu" -#endif -#ifndef SCNu32 -# define SCNu32 "u" -#endif -#ifndef SCNu64 -# define SCNu64 PRI64_PREFIX "u" -#endif - -#ifndef PRIdMAX -# define PRIdMAX PRId64 -#endif -#ifndef PRIuMAX -# define PRIuMAX PRIu64 -#endif -#ifndef PRIxMAX -# define PRIxMAX PRIx64 -#endif -#ifndef SCNdMAX -# define SCNdMAX SCNd64 -#endif - -#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 <sys/ioctl.h> -#ifdef HAVE_SYS_CDIO_H -# include <sys/cdio.h> -#endif -#ifdef HAVE_LINUX_CDROM_H -# include <linux/cdrom.h> -#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 -dnl ---------------------- -dnl Validate the GMSGFMT program found by gettext.m4; reject old versions -dnl of GNU msgfmt that do not support the "msgid_plural" extension. -AC_DEFUN([AC_PROG_GMSGFMT_PLURAL], - [dnl AC_REQUIRE(AM_GNU_GETTEXT) - - if test "$GMSGFMT" != ":"; then - AC_MSG_CHECKING([for plural forms in GNU msgfmt]) - - changequote(,)dnl We use [ and ] in in .po test input - - dnl If the GNU msgfmt does not accept msgid_plural we define it - dnl as : so that the Makefiles still can work. - cat >conftest.po <<_ACEOF -msgid "channel" -msgid_plural "channels" -msgstr[0] "canal" -msgstr[1] "canal" - -_ACEOF - changequote([,])dnl - - if $GMSGFMT -o /dev/null conftest.po >/dev/null 2>&1; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_MSG_RESULT( - [found GNU msgfmt program is too old, it does not support plural forms; ignore it]) - GMSGFMT=":" - fi - rm -f conftest.po - fi -])dnl AC_PROG_GMSGFMT_PLURAL - - -# AC_PROG_LIBTOOL_SANITYCHECK -# ---------------------- -# Default configuration of libtool on solaris produces non-working -# plugin modules, when gcc is used as compiler, and gcc does not -# use gnu-ld -AC_DEFUN([AC_PROG_LIBTOOL_SANITYCHECK], - [dnl AC_REQUIRE(AC_PROG_CC) - dnl AC_REQUIRE(AC_PROG_LD) - dnl AC_REQUIRE(AC_PROG_LIBTOOL) - - case $host in - *-*-solaris*) - if test "$GCC" = yes && test "$with_gnu_ld" != yes; then - AC_MSG_CHECKING([if libtool can build working modules]) - cat > conftest1.c <<_ACEOF -#undef NDEBUG -#include <assert.h> -int shlib_func(long long a, long long b) { - assert(b); - switch (a&3) { - case 0: return a/b; - case 1: return a%b; - case 2: return (unsigned long long)a/b; - case 3: return (unsigned long long)a%b; - } -} -_ACEOF - - cat > conftest2.c <<_ACEOF -#include <dlfcn.h> -int main(){ - void *dl = dlopen(".libs/libconftest.so", RTLD_NOW); - if (!dl) printf("%s\n", dlerror()); - exit(dl ? 0 : 1); -} -_ACEOF - - if ./libtool $CC -c conftest1.c >/dev/null 2>&1 && \ - ./libtool $CC -o libconftest.la conftest1.lo \ - -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \ - ./libtool $CC -o conftest2 conftest2.c -ldl >/dev/null 2>&1 - then - if ./conftest2 >/dev/null 2>&1; then - AC_MSG_RESULT(yes) - else - dnl typical problem: dlopen'ed module not self contained, because - dnl it wasn't linked with -lgcc - AC_MSG_RESULT(no) - if grep '^archive_cmds=.*$LD -G' libtool >/dev/null; then - AC_MSG_CHECKING([if libtool can be fixed]) - - dnl first try to update gcc2's spec file to add the - dnl gcc3 -mimpure-text flag - - libtool_specs="" - - if $CC -dumpspecs | grep -- '-G -dy -z text' >/dev/null; then - $CC -dumpspecs | \ - sed 's/-G -dy -z text/-G -dy %{!mimpure-text:-z text}/g' \ - > gcc-libtool-specs - libtool_specs=" -specs=`pwd`/gcc-libtool-specs" - fi - - sed -e "s,\$LD -G,\$CC${libtool_specs} -shared -mimpure-text,g" \ - -e 's/ -M / -Wl,-M,/' libtool >libtool-fixed - chmod +x libtool-fixed - if ./libtool-fixed $CC -o libconftest.la conftest1.lo \ - -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \ - ./conftest2 >/dev/null 2>&1; then - - dnl the fixed libtool works - AC_MSG_RESULT(yes) - mv -f libtool-fixed libtool - - else - AC_MSG_RESULT(no) - fi - fi - fi - else - AC_MSG_RESULT(no) - fi - rm -f conftest1.c conftest1.lo conftest1.o conftest2.c \ - libconftest.la conftest libtool-fixed - rm -rf .libs - fi ;; - 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_CACHE_VAL(ac_cv_socklen_t, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> -#include <sys/socket.h> - ]], [[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 <sys/types.h> -#include <sys/socket.h>]], [[ -int a=0; -getsockname(0,(struct sockaddr*)0, &a);]])], - [ac_cv_socklen_t=int],[ac_cv_socklen_t=size_t]) - fi - ]) - - 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/aa.m4 b/m4/aa.m4 deleted file mode 100644 index bab0d9d28..000000000 --- a/m4/aa.m4 +++ /dev/null @@ -1,272 +0,0 @@ -dnl Configure path and dependencies for aalib. -dnl -dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr> -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a configuration -dnl script generated by Autoconf, you may include it under the same -dnl distribution terms that you use for the rest of that program. -dnl -dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND ]]]) -dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS, AALIB_STATIC_LIBS. -dnl -dnl *********************** -dnl 26/09/2001 -dnl * fixed --disable-aalibtest. -dnl 17/09/2001 -dnl * use both aalib-config, and *last chance* aainfo for guessing. -dnl 19/08/2001 -dnl * use aalib-config instead of aainfo now. -dnl 17/06/2001 -dnl * First shot -dnl - -dnl Internal bits, used by AM_PATH_AALIB. -dnl Requires AALIB_CFLAGS and AALIB_FLAGS to be defined -AC_DEFUN([_AALIB_CHECK_VERSION], [ - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$AALIB_CFLAGS $CFLAGS" - LIBS="$AALIB_LIBS $LIBS" - -dnl Now check if the installed AALIB is sufficiently new. (Also sanity -dnl checks the results of aalib-config to some extent.) - - rm -f conf.aalibtest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include <stdio.h> -#include <stdlib.h> -#include <aalib.h> - -int main () { - int major, minor; - char *tmp_version; - - system ("touch conf.aalibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = (char *) strdup("$min_aalib_version"); - if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) { - printf("%s, bad version string\n", "$min_aalib_version"); - exit(1); - } - - if ((AA_LIB_VERSION > major) || ((AA_LIB_VERSION == major) && -#ifdef AA_LIB_MINNOR - (AA_LIB_MINNOR >= minor) -#else - (AA_LIB_MINOR >= minor) -#endif - )) { - return 0; - } - else { -#ifdef AA_LIB_MINNOR - printf("\n*** An old version of AALIB (%d.%d) was found.\n", AA_LIB_VERSION, AA_LIB_MINNOR); -#else - printf("\n*** An old version of AALIB (%d.%d) was found.\n", AA_LIB_VERSION, AA_LIB_MINOR); -#endif - printf("*** You need a version of AALIB newer than %d.%d. The latest version of\n", major, minor); - printf("*** AALIB is always available from:\n"); - printf("*** http://www.ta.jcu.cz://aa\n"); - printf("***\n"); - } - return 1; -} -]])],[],[no_aalib=yes],[no_aalib=cc]) - if test "x$no_aalib" = xcc; then - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <stdio.h> -#include <aalib.h> -]], [[ return ((AA_LIB_VERSION) || -#ifdef AA_LIB_MINNOR - (AA_LIB_MINNOR) -#else - (AA_LIB_MINOR) -#endif - ); ]])],[no_aalib=''],[no_aalib=yes]) - fi - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" -]) - - -AC_DEFUN([AM_PATH_AALIB], -[dnl -dnl -AC_ARG_WITH(aalib-prefix, - AS_HELP_STRING([--with-aalib-prefix=DIR], [prefix where AALIB is installed (optional)]), - aalib_config_prefix="$withval", aalib_config_prefix="") -AC_ARG_WITH(aalib-exec-prefix, - AS_HELP_STRING([--with-aalib-exec-prefix=DIR], [exec prefix where AALIB is installed (optional)]), - aalib_config_exec_prefix="$withval", aalib_config_exec_prefix="") -AC_ARG_ENABLE(aalibtest, - AS_HELP_STRING([--disable-aalibtest], [do not try to compile and run a test AALIB program]), - enable_aalibtest=$enableval, enable_aalibtest=yes) - - AC_LANG_PUSH([C]) - - if test x$aalib_config_exec_prefix != x ; then - aalib_config_args="$aalib_config_args --exec-prefix=$aalib_config_exec_prefix" - if test x${AALIB_CONFIG+set} != xset ; then - AALIB_CONFIG=$aalib_config_exec_prefix/bin/aalib-config - fi - fi - if test x$aalib_config_prefix != x ; then - aalib_config_args="$aalib_config_args --prefix=$aalib_config_prefix" - if test x${AALIB_CONFIG+set} != xset ; then - AALIB_CONFIG=$aalib_config_prefix/bin/aalib-config - fi - fi - - min_aalib_version=ifelse([$1], ,1.4,$1) - - if test x"$enable_aalibtest" != "xyes"; then - AC_MSG_CHECKING([for AALIB version >= $min_aalib_version]) - else - if test ! -x "$AALIB_CONFIG"; then - AALIB_CONFIG="" - fi - AC_PATH_TOOL(AALIB_CONFIG, aalib-config, no) - - if test "$AALIB_CONFIG" = "no" ; then - -dnl aalib-config is missing, check for old aainfo - - AALIB_LIBS="$AALIB_LIBS -laa" - if test x$aalib_config_exec_prefix != x ; then - AALIB_CFLAGS="-I$aalib_config_exec_prefix/include" - AALIB_LIBS="-L$aalib_config_exec_prefix/lib -laa" - if test x${AAINFO+set} != xset ; then - AAINFO=$aalib_config_exec_prefix/bin/aainfo - fi - fi - - if test x$aalib_config_prefix != x ; then - AALIB_CFLAGS="-I$aalib_config_prefix/include" - AALIB_LIBS="-L$aalib_config_prefix/lib -laa" - if test x${AAINFO+set} != xset ; then - AAINFO=$aalib_config_prefix/bin/aainfo - fi - fi - - if test x"$aalib_config_prefix" = "x"; then - AC_PATH_TOOL(AAINFO, aainfo, no) - else - AC_MSG_CHECKING(for $AAINFO) - if test -x $AAINFO; then - AC_MSG_RESULT(yes) - else - AAINFO="no" - AC_MSG_RESULT(no) - fi - fi - - AC_MSG_CHECKING([for AALIB version >= $min_aalib_version]) - no_aalib="" - - if test x"$AAINFO" = "xno"; then - no_aalib=yes - else - aalib_drivers="`$AAINFO --help | grep drivers | sed -e 's/available//g;s/drivers//g;s/\://g'`" - for drv in $aalib_drivers; do - if test $drv = "X11" -a x$x11dep = "x"; then - AALIB_CFLAGS="$AALIB_CFLAGS `echo $X_CFLAGS|sed -e 's/\-I/\-L/g;s/include/lib/g'`" - x11dep="yes" - fi -dnl if test $drv = "slang" -a x$slangdep = "x"; then -dnl slangdep="yes" -dnl fi -dnl if test $drv = "gpm" -a x$gmpdep = "x"; then -dnl gpmdep="yes" -dnl fi - done - - _AALIB_CHECK_VERSION - fi - - else dnl AALIB_CONFIG - AC_MSG_CHECKING([for AALIB version >= $min_aalib_version]) - no_aalib="" - AALIB_CFLAGS="`$AALIB_CONFIG $aalib_config_args --cflags`" - AALIB_LIBS="`$AALIB_CONFIG $aalib_config_args --libs`" - aalib_config_major_version=`$AALIB_CONFIG $aalib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - aalib_config_minor_version=`$AALIB_CONFIG $aalib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - aalib_config_sub_version=`$AALIB_CONFIG $aalib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - _AALIB_CHECK_VERSION - fi dnl AALIB_CONFIG - fi dnl enable_aalibtest - - if test "x$no_aalib" = x; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$AALIB_CONFIG" = "no"; then - echo "*** The [aalib-config|aainfo] program installed by AALIB could not be found" - echo "*** If AALIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or use --with-aalib-prefix to set the prefix" - echo "*** where AALIB is installed." - else - if test -f conf.aalibtest ; then - : - else - echo "*** Could not run AALIB test program, checking why..." - CFLAGS="$CFLAGS $AALIB_CFLAGS" - LIBS="$LIBS $AALIB_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <stdio.h> -#include <aalib.h> -]], [[ - return ((AA_LIB_VERSION) || -#ifdef AA_LIB_MINNOR - (AA_LIB_MINNOR) -#else - (AA_LIB_MINOR) -#endif - ); ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding AALIB or finding the wrong" - echo "*** version of AALIB. If it is not finding AALIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means AALIB was incorrectly installed" - echo "*** or that you have moved AALIB since it was installed." ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - AALIB_CFLAGS="" - AALIB_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(AALIB_CFLAGS) - AC_SUBST(AALIB_LIBS) - AC_LANG_POP([C]) - rm -f conf.aalibtest -]) diff --git a/m4/arts.m4 b/m4/arts.m4 deleted file mode 100644 index 079c21ba8..000000000 --- a/m4/arts.m4 +++ /dev/null @@ -1,168 +0,0 @@ -# Configure paths for ARTS -# Philip Stadermann 2001-06-21 -# stolen from esd.m4 - -dnl AM_PATH_ARTS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for ARTS, and define ARTS_CFLAGS and ARTS_LIBS -dnl -AC_DEFUN([AM_PATH_ARTS], -[dnl -dnl Get the cflags and libraries from the artsc-config script -dnl -AC_ARG_WITH(arts-prefix, AS_HELP_STRING([--with-arts-prefix=DIR], [prefix where ARTS is installed (optional)]), - arts_prefix="$withval", arts_prefix="") -AC_ARG_ENABLE(artstest, AS_HELP_STRING([--disable-artstest], [do not try to compile and run a test ARTS program]), - enable_artstest=$enableval, enable_artstest=yes) - - if test x$arts_prefix != x ; then - arts_args="$arts_args --arts-prefix=$arts_prefix" - if test x${ARTS_CONFIG+set} != xset ; then - ARTS_CONFIG=$arts_prefix/bin/artsc-config - fi - fi - - AC_PATH_TOOL(ARTS_CONFIG, artsc-config, no) - - min_arts_version=ifelse([$1], ,0.9.5,$1) - AC_MSG_CHECKING(for ARTS artsc - version >= $min_arts_version) - no_arts="" - if test "$ARTS_CONFIG" = "no" ; then - no_arts=yes - else - ARTS_CFLAGS=`$ARTS_CONFIG $artsconf_args --cflags` - ARTS_LIBS=`$ARTS_CONFIG $artsconf_args --libs` - - arts_major_version=`$ARTS_CONFIG $arts_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - arts_minor_version=`$ARTS_CONFIG $arts_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - arts_micro_version=`$ARTS_CONFIG $arts_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_artstest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ARTS_CFLAGS" - LIBS="$LIBS $ARTS_LIBS" -dnl -dnl Check if the installed ARTS is actually available -- when cross-compiling, -dnl we have probably detected the build system's version of artsc-config -dnl - AC_CHECK_LIB([artsc], [arts_init], [], [no_arts=yes], [$ARTS_LIBS]) - -dnl -dnl Now check if the installed ARTS is sufficiently new. (Also sanity -dnl checks the results of artsc-config to some extent) -dnl - rm -f conf.artstest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <artsc.h> - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.artstest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_arts_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_arts_version"); - exit(1); - } - - if (($arts_major_version > major) || - (($arts_major_version == major) && ($arts_minor_version > minor)) || - (($arts_major_version == major) && ($arts_minor_version == minor) && ($arts_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'artsc-config --version' returned %d.%d.%d, but the minimum version\n", $arts_major_version, $arts_minor_version, $arts_micro_version); - printf("*** of ARTS required is %d.%d.%d. If artsc-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If artsc-config was wrong, set the environment variable ARTS_CONFIG\n"); - printf("*** to point to the correct copy of artsc-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -]])],[],[no_arts=yes],[no_arts=cc]) - - if test "x$no_arts" = "xcc"; then - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <stdio.h> -#include <artsc.h> -]], [[ return 0; ]])],[no_arts=''],[no_arts=yes]) - fi - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_arts" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$ARTS_CONFIG" = "no" ; then - echo "*** The artsc-config script installed by ARTS could not be found" - echo "*** If ARTS was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the ARTS_CONFIG environment variable to the" - echo "*** full path to artsc-config." - else - if test -f conf.artstest ; then - : - else - echo "*** Could not run ARTS test program, checking why..." - CFLAGS="$CFLAGS $ARTS_CFLAGS" - LIBS="$LIBS $ARTS_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <stdio.h> -#include <artsc.h> -]], [[ return 0; ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ARTS or finding the wrong" - echo "*** version of ARTS. If it is not finding ARTS, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ARTS was incorrectly installed" - echo "*** or that you have moved ARTS since it was installed. In the latter case, you" - echo "*** may want to edit the artsc-config script: $ARTS_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - ARTS_CFLAGS="" - ARTS_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ARTS_CFLAGS) - AC_SUBST(ARTS_LIBS) - rm -f conf.artstest -]) diff --git a/m4/audio_out.m4 b/m4/audio_out.m4 new file mode 100644 index 000000000..d43aa38e1 --- /dev/null +++ b/m4/audio_out.m4 @@ -0,0 +1,230 @@ +dnl ----------------- +dnl Audio out plugins +dnl ----------------- +AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ + dnl Setup defaults for the target operating system. For example, alsa 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 - Alsa is Linux only + dnl - CoreAudio is Mac OS X only + dnl - EsounD is reported to be available on most platforms + dnl - FusionSound is Linux only, but don't enable it by default + dnl - Jack is Linux and Mac OS X primarily + dnl - OSS is most unix variants + dnl - PulseAudio has been tested on Linux, Solaris, FreeBSD, Windows + dnl - SunAudio is NetBSD, OpenBSD, Solaris (anything else?) + + default_enable_coreaudio=disable + default_enable_irixal=disable + default_enable_oss=enable + default_enable_sunaudio=disable + + default_with_alsa=without + default_with_esound=with + default_with_fusionsound=without + default_with_jack=without + default_with_pulseaudio=without + + case "$host_os" in + cygwin* | mingw*) + default_enable_oss=disable + default_with_pulseaudio=with + ;; + darwin*) + default_enable_coreaudio=enable + default_with_jack=with + default_enable_oss=disable + ;; + freebsd*) + default_with_pulseaudio=with + ;; + irix*) + default_enable_irixal=enable + default_enable_oss=disable + ;; + linux*) + default_with_alsa=with + default_with_jack=with + default_with_pulseaudio=with + ;; + netbsd*) + default_enable_sunaudio=enable + ;; + openbsd*) + default_enable_sunaudio=enable + ;; + solaris*) + default_with_pulseaudio=with + default_enable_sunaudio=enable + ;; + esac + + + dnl Alsa support + AC_ARG_WITH([alsa], + [AS_HELP_STRING([--with-alsa], [Build with ALSA audio output support])], + [test x"$withval" != x"no" && with_alsa="yes"], + [test $default_with_alsa = without && with_alsa="no"]) + if test x"$with_alsa" != x"no"; then + PKG_CHECK_MODULES([ALSA], [alsa >= 0.9.0], [have_alsa=yes], [have_alsa=no]) + if test x"$with_alsa" = x"yes" && test x"$have_alsa" != x"yes"; then + AC_MSG_ERROR([ALSA support requested but not found.]) + elif test x"$have_alsa" = x"yes"; then + dnl This is needed by src/input/input_v4l.c + AC_DEFINE([HAVE_ALSA], 1, [Define this if you have ALSA installed]) + fi + fi + AM_CONDITIONAL([ENABLE_ALSA], [test x"$have_alsa" = x"yes"]) + + + dnl CoreAudio for Mac OS X + AC_ARG_ENABLE([coreaudio], + [AS_HELP_STRING([--enable-coreaudio], [Enable support for Mac OS X CoreAudio])], + [test x"$enableval" != x"no" && enable_coreaudio="yes"], + [test $default_enable_coreaudio = disable && enable_coreaudio="no"]) + if test x"$enable_coreaudio" != x"no"; then + AC_MSG_CHECKING([for CoreAudio frameworks]) + ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreAudio -framework AudioUnit" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_coreaudio=yes], [have_coreaudio=no]) + LIBS="$ac_save_LIBS" + AC_MSG_RESULT([$have_coreaudio]) + if test x"$enable_coreaudio" = x"yes" && test x"$have_coreaudio" != x"yes"; then + AC_MSG_ERROR([CoreAudio support requested, but CoreAudio not found]) + fi + fi + AM_CONDITIONAL([ENABLE_COREAUDIO], [test x"$have_coreaudio" = x"yes"]) + + + dnl EsounD support + AC_ARG_WITH([esound], + [AS_HELP_STRING([--with-esound], [Build with EsounD audio output support])], + [test x"$withval" != x"no" && with_esound="yes"], + [test $default_with_esound = without && with_esound="no"]) + if test x"$with_esound" != x"no"; then + PKG_CHECK_MODULES([ESD], [esound], [have_esound=yes], [have_esound=no]) + if test x"$with_esound" = x"yes" && test x"$have_esound" != x"yes"; then + AC_MSG_ERROR([EsounD support requested, but EsounD not found]) + fi + fi + AM_CONDITIONAL([ENABLE_ESD], [test x"$have_esound" = x"yes"]) + + + dnl FusionSound support + AC_ARG_WITH([fusionsound], + [AS_HELP_STRING([--with-fusionsound], [Build with FunsionSound audio output support])], + [test x"$withval" != x"no" && with_fusionsound="yes"], + [test $default_with_fusionsound = without && with_fusionsound="no"]) + if test x"$with_fusionsound" != x"no"; then + PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 0.9.23], [have_fusionsound=yes], [have_fusionsound=no]) + if test x"$with_fusionsound" = x"yes" && test x"$have_fusionsound" != x"yes"; then + AC_MSG_ERROR([FusionSound support requested, but FusionSound not found]) + fi + fi + AM_CONDITIONAL([ENABLE_FUSIONSOUND], [test x"$have_fusionsound" = x"yes"]) + + + dnl IRIX style audio interface + AC_ARG_ENABLE([irixal], + [AS_HELP_STRING([--enable-irixal], [Enable support for IRIX libaudio])], + [test x"$enableval" != x"no" && enable_irixal="yes"], + [test $default_enable_irixal = disable && enable_irixal="no"]) + if test x"$enable_irixal" != x"no"; then + AC_CACHE_CHECK([for IRIX libaudio support], [am_cv_have_irixal], + [AC_CHECK_HEADER([dmedia/audio.h], + [am_cv_have_irixal=yes], [am_cv_have_irixal=no])]) + if test x"$am_cv_have_irixal" = x"yes"; then + AC_DEFINE([HAVE_IRIXAL], 1, [Define this if you have a usable IRIX al interface available]) + IRIXAL_LIBS="-laudio" + IRIXAL_STATIC_LIB="/usr/lib/libaudio.a" + AC_SUBST(IRIXAL_LIBS) + AC_SUBST(IRIXAL_STATIC_LIB) + fi + fi + AM_CONDITIONAL([ENABLE_IRIXAL], [test x"$am_cv_have_irixal" = x"yes"]) + + + dnl JACK support + AC_ARG_WITH([jack], + [AS_HELP_STRING([--with-jack], [Build with Jack support])], + [test x"$withval" != x"no" && with_jack="yes"], + [test $default_with_jack = without && with_jack="no"]) + if test x"$with_jack" != x"no"; then + PKG_CHECK_MODULES([JACK], [jack >= 0.100], [have_jack=yes], [have_jack=no]) + if test x"$with_jack" = x"yes" && test x"$have_jack" != x"yes"; then + AC_MSG_ERROR([Jack support requested, but Jack not found]) + fi + fi + AM_CONDITIONAL([ENABLE_JACK], [test x"$have_jack" = x"yes"]) + + + dnl OSS (Open Sound System) + AC_ARG_ENABLE([oss], + [AS_HELP_STRING([--enable-oss], [Enable OSS (Open Sound System) support])], + [test x"$enableval" != x"no" && enable_oss="yes"], + [test $default_enable_oss = disable && enable_oss="no"]) + if test x"$enable_oss" != x"no"; then + AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h soundcard.h], [break]) + AC_CHECK_DECL([SNDCTL_DSP_SETFRAGMENT], [have_oss=yes], [have_oss=no], + [#ifdef HAVE_SYS_SOUNDCARD_H + # include <sys/soundcard.h> + #endif + #ifdef HAVE_MACHINE_SOUNDCARD_H + # include <sys/soundcard.h> + #endif + #ifdef HAVE_SOUNDCARD_H + # include <soundcard.h> + #endif]) + if test x"$enable_oss" = x"yes" && test x"$have_oss" != x"yes"; then + AC_MSG_ERROR([OSS support requested, but OSS not found]) + fi + fi + AM_CONDITIONAL([ENABLE_OSS], [test x"$have_oss" = x"yes"]) + + + dnl PulseAudio + AC_ARG_WITH([pulseaudio], + [AS_HELP_STRING([--with-pulseaudio], [Build with PulseAudio support])], + [test x"$withval" != x"no" && with_pulseaudio="yes"], + [test $default_with_pulseaudio = without && with_pulseaudio="no"]) + if test x"$with_pulseaudio" != x"no"; then + PKG_CHECK_MODULES([PULSEAUDIO], [libpulse], [have_pulseaudio="yes"], [have_pulseaudio="no"]) + if test x"$with_pulseaudio" = x"yes" && test x"$have_pulseaudio" != x"yes"; then + AC_MSG_ERROR([PulseAudio support requested, but PulseAudio not found]) + fi + if test x"$have_pulseaudio" = xyes; then + AC_MSG_CHECKING([for pulseaudio >= 0.9.7]) + PKG_CHECK_EXISTS([libpulse >= 0.9.7], + [have_pulseaudio_0_9_7="yes"], + [have_pulseaudio_0_9_7="no"]) + AC_MSG_RESULT([$have_pulseaudio_0_9_7]) + if test x"$have_pulseaudio_0_9_7" = xyes; then + AC_DEFINE([HAVE_PULSEAUDIO_0_9_7], 1, [define this if you have pulseaudio >= 0.9.7]) + fi + fi + fi + AM_CONDITIONAL([ENABLE_PULSEAUDIO], [test x"$have_pulseaudio" = x"yes"]) + + + dnl SUN style audio interface + AC_ARG_ENABLE([sunaudio], + [AS_HELP_STRING([--enable-sunaudio], [Enable Sun audio support])], + [test x"$enableval" != x"no" && enable_sunaudio="yes"], + [test $default_enable_sunaudio = disable && enable_sunaudio="no"]) + if test x"$enable_sunaudio" != x"no"; then + AC_MSG_CHECKING([for Sun audio support]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> + #include <sys/audioio.h>]], + [[audio_info_t audio_info; AUDIO_INITINFO(&audio_info)]])], + [have_sunaudio=yes], [have_sunaudio=no]) + AC_MSG_RESULT([$have_sunaudio]) + if test x"$enable_sunaudio" = x"yes" && test x"$have_sunaudio" != x"yes"; then + AC_MSG_ERROR([Sun audio support requested, but Sun audio not found]) + elif test x"$have_sunaudio" = x"yes"; then + dnl NetBSD and OpenBSD don't have this, but check for it + dnl rather than assuming that it doesn't happen elsewhere. + AC_CHECK_MEMBERS([audio_info_t.output_muted]) + fi + fi + AM_CONDITIONAL([ENABLE_SUNAUDIO], [test x"$have_sunaudio" = x"yes"]) +])dnl XINE_AUDIO_OUT_PLUGINS diff --git a/m4/decoders.m4 b/m4/decoders.m4 new file mode 100644 index 000000000..d8e3ac571 --- /dev/null +++ b/m4/decoders.m4 @@ -0,0 +1,488 @@ +dnl --------------------------- +dnl Decoder and Demuxer Plugins +dnl --------------------------- +AC_DEFUN([XINE_DECODER_PLUGINS], [ + dnl a52dec (optional; enabled by default; external version allowed) + AC_ARG_ENABLE([a52dec], + [AS_HELP_STRING([--enable-a52dec], [Enable support for a52dec decoding library (default: enabled, internal: use internal copy)])]) + if test x"$enable_a52dec" != x"no"; then + if test x"$enable_a52dec" != x"internal"; then + AC_CHECK_LIB([a52], [a52_init], + [AC_CHECK_HEADERS([a52dec/a52.h a52dec/a52_internal.h], [have_external_a52dec=yes], [have_external_a52dec=no], + [#ifdef HAVE_SYS_TYPES_H + # include <sys/types.h> + #endif + #ifdef HAVE_INTTYPES_H + # include <inttypes.h> + #endif + #ifdef HAVE_STDINT_H + # include <stdint.h> + #endif + #include <a52dec/a52.h>])], [have_external_a52dec=no], [-lm]) + if test x"$have_external_a52dec" = x"no"; then + AC_MSG_RESULT([*** no usable version of a52dec found, using internal copy ***]) + fi + else + AC_MSG_RESULT([Using included a52dec support]) + fi + if test x"$have_external_a52dec" = x"yes"; then + A52DEC_CFLAGS='' + A52DEC_LIBS='-la52' + A52DEC_DEPS='' + else + A52DEC_CFLAGS='-I$(top_srcdir)/contrib/a52dec' + A52DEC_LIBS='$(top_builddir)/contrib/a52dec/liba52.la' + A52DEC_DEPS='$(top_builddir)/contrib/a52dec/liba52.la' + fi + AC_SUBST(A52DEC_CFLAGS) + AC_SUBST(A52DEC_DEPS) + AC_SUBST(A52DEC_LIBS) + fi + AM_CONDITIONAL([ENABLE_A52DEC], [test x"$enable_a52dec" != x"no"]) + AM_CONDITIONAL([WITH_EXTERNAL_A52DEC], [test x"$have_external_a52dec" = x"yes"]) + + + dnl ASF (optional; enabled by default) + AC_ARG_ENABLE([asf], + [AS_HELP_STRING([--enable-asf], [Enable support for ASF demuxer (default: enabled)])], + [test x"$enableval" != x"no" && enable_asf="yes"]) + AM_CONDITIONAL([ENABLE_ASF], [test x"$enable_asf" != x"no"]) + + dnl Nosefart (optional, enabled by default) + AC_ARG_ENABLE([nosefart], + [AS_HELP_STRING([--enable-nosefart], [Enable support for nosefart player (default: enabled)])], + [test x"$enableval" != x"no" && enable_nosefart="yes"]) + AM_CONDITIONAL([ENABLE_NOSEFART], [test "x$enable_nosefart" != "xno"]) + + dnl FAAD (optional; enabled by default) + AC_ARG_ENABLE([faad], + [AS_HELP_STRING([--enable-faad], [Enable support for FAAD decoder (default: enabled, internal: use internal copy)])]) + if test x"$enable_faad" != x"no"; then + if test x"$enable_faad" != x"internal"; then + AC_CHECK_LIB([faad], [NeAACDecInit], + [AC_CHECK_HEADERS([neaacdec.h], [have_external_faad=yes], [have_external_faad=no], + [#include <neaacdec.h>])], [have_external_faad=no], [-lm]) + if test x"$have_external_faad" = x"no"; then + AC_MSG_RESULT([*** no usable version of libfaad found, using internal copy ***]) + fi + else + AC_MSG_RESULT([Using included libfaad support]) + fi + if test x"$have_external_faad" = x"yes"; then + FAAD_CFLAGS='' + FAAD_LIBS='-lfaad' + FAAD_DEPS='' + else + FAAD_CFLAGS='-I$(top_srcdir)/contrib/libfaad' + FAAD_LIBS='$(top_builddir)/contrib/libfaad/libfaad.la' + FAAD_DEPS='$(top_builddir)/contrib/libfaad/libfaad.la' + fi + AC_SUBST(FAAD_CFLAGS) + AC_SUBST(FAAD_DEPS) + AC_SUBST(FAAD_LIBS) + fi + AM_CONDITIONAL([ENABLE_FAAD], [test x"$enable_faad" != x"no"]) + AM_CONDITIONAL([WITH_EXTERNAL_FAAD], [test x"$have_external_faad" = x"yes"]) + + dnl ffmpeg external version required + PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 51.20.0]) + PKG_CHECK_MODULES([AVUTIL], [libavutil >= 49.6.0]) + PKG_CHECK_MODULES([FFMPEG_POSTPROC], [libpostproc]) + AC_DEFINE([HAVE_FFMPEG], 1, [Define this if you have ffmpeg library]) + + dnl Check presence of ffmpeg/avutil.h to see if it's old or new + dnl style for headers. The new style would be preferred actually... + AC_CHECK_HEADERS([ffmpeg/avutil.h]) + + dnl gdk-pixbuf (optional; enabled by default) + AC_ARG_ENABLE([gdkpixbuf], + [AS_HELP_STRING([--enable-gdkpixbuf], [Enable GdkPixbuf support (default: enabled)])], + [test x"$enableval" != x"no" && enable_gdkpixbuf="yes"]) + if test x"$enable_gdkpixbuf" != x"no"; then + PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0], [have_gdkpixbuf=yes], [have_gdkpixbuf=no]) + if test x"$enable_gdkpixbuf" = x"yes" && test x"$have_gdkpixbuf" != x"yes"; then + AC_MSG_ERROR([GdkPixbuf support requested, but GdkPixbuf not found]) + fi + fi + AM_CONDITIONAL([ENABLE_GDK_PIXBUF], [test x"$have_gdkpixbuf" = x"yes"]) + + + dnl ImageMagick (optional; enabled by default) + AC_ARG_WITH([imagemagick], + [AS_HELP_STRING([--with-imagemagick], [Enable ImageMagick image decoder support (default: enabled)])], + [test x"$withval" != x"no" && with_imagemagick="yes"]) + if test x"$with_imagemagick" != x"no"; then + PKG_CHECK_MODULES([WAND], [Wand], [have_imagemagick=yes], [have_imagemagick=no]) + if test x"$with_imagemagick" = x"yes" && test x"$have_imagemagick" = x"no"; then + AC_MSG_ERROR([ImageMagick support requested, but ImageMagick not found]) + fi + fi + AM_CONDITIONAL([ENABLE_IMAGEMAGICK], [test x"$have_imagemagick" = x"yes"]) + + + dnl libdts (optional; enabled by default; external version allowed) + AC_ARG_ENABLE([dts], + [AS_HELP_STRING([--enable-dts], [Enable support for DTS decoding library (default: enabled, internal: use internal copy)])]) + if test x"$enable_dts" != x"no"; then + if test x"$enable_dts" != x"internal"; then + PKG_CHECK_MODULES([LIBDTS], [libdts], [have_external_dts=yes], [have_external_dts=no]) + if test x"$have_external_dts" != x"yes"; then + AC_MSG_RESULT([*** no usable version of libdts found, using internal copy ***]) + fi + else + AC_MSG_RESULT([Using included libdts support]) + fi + if test x"$have_external_dts" != x"yes"; then + LIBDTS_CFLAGS='-I$(top_srcdir)/contrib/libdca/include' + LIBDTS_DEPS='$(top_builddir)/contrib/libdca/libdca.la' + LIBDTS_LIBS='$(top_builddir)/contrib/libdca/libdca.la' + AC_SUBST(LIBDTS_DEPS) + fi + fi + AM_CONDITIONAL([ENABLE_DTS], [test x"$enable_dts" != x"no"]) + AM_CONDITIONAL([WITH_EXTERNAL_LIBDTS], [test x"$have_external_dts" = x"yes"]) + + + dnl libFLAC (optional; disabled by default) + AC_ARG_WITH([libflac], + [AS_HELP_STRING([--with-libflac], [build libFLAC-based decoder and demuxer])], + [test x"$withval" != x"no" && with_libflac="yes"], [with_libflac="no"]) + AC_ARG_WITH([libFLAC-prefix], + [AS_HELP_STRING([--with-libFLAC-prefix=DIR], [prefix where libFLAC is installed (optional)])]) + AC_ARG_WITH([libFLAC-libraries], + [AS_HELP_STRING([--with-libFLAC-libraries=DIR], [directory where libFLAC library is installed (optional)])]) + AC_ARG_WITH([libFLAC-includes], + [AS_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)])]) + if test x"$with_libflac" != x"no"; then + AC_MSG_CHECKING([libdir name]) + case "$host_or_hostalias" in + *-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + xine_cv_cc_64bit_output=no + if AC_TRY_EVAL(ac_compile); then + case `"$MAGIC_CMD" conftest.$ac_objext` in + *"ELF 64"*) xine_cv_cc_64bit_output=yes ;; + esac + fi + rm -rf conftest* + ;; + esac + case "$host_cpu:$xine_cv_cc_64bit_output" in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + XINE_LIBDIRNAME="lib64" ;; + *:*) + XINE_LIBDIRNAME="lib" ;; + esac + AC_MSG_RESULT([$XINE_LIBDIRNAME]) + + if test x"$with_libFLAC_includes" != x""; then + LIBFLAC_CFLAGS="-I$with_libFLAC_includes" + elif test x"$with_libFLAC_prefix" != x""; then + LIBFLAC_CFLAGS="-I$with_libFLAC_prefix/include" + elif test x"$prefix" != x"NONE"; then + LIBFLAC_CFLAGS="-I$prefix/include" + fi + AC_SUBST(LIBFLAC_CFLAGS) + + if test x"$with_libFLAC_libraries" != x""; then + LIBFLAC_LIBS="-L$with_libFLAC_libraries" + elif test x"$with_libFLAC_prefix" != x""; then + LIBFLAC_LIBS="-L$with_libFLAC_prefix/$XINE_LIBDIRNAME" + elif test x"$prefix" != x"NONE"; then + LIBFLAC_LIBS="-L$prefix/$XINE_LIBDIRNAME" + fi + AC_SUBST(LIBFLAC_LIBS) + + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBFLAC_CFLAGS" + AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], + [AC_CHECK_HEADERS([FLAC/stream_decoder.h], + [have_libflac=yes LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"], + [have_libflac=no])], + [have_libflac=no], [-lm]) + CPPFLAGS="$ac_save_CPPFLAGS" + + if test x"$with_libflac" = x"yes" && test x"$have_libflac" != x"yes"; then + AC_MSG_ERROR([libFLAC-based decoder support requested, but libFLAC not found]) + elif test x"$have_libflac" != x"yes"; then + LIBFLAC_CFLAGS="" LIBFLAC_LIBS="" + fi + fi + AM_CONDITIONAL([ENABLE_LIBFLAC], [test x"$have_libflac" = x"yes"]) + + + dnl libmad (optional; enabled by default; external version allowed) + AC_ARG_ENABLE([mad], + [AS_HELP_STRING([--enable-mad], [Enable support for MAD decoding library (default: enabled, internal: use external copy)])]) + if test x"$enable_mad" != x"no"; then + if test x"$enable_mad" != x"internal"; then + PKG_CHECK_MODULES([LIBMAD], [mad], + [AC_CHECK_HEADERS([mad.h], [have_external_libmad=yes], [have_external_libmad=no])], + [have_external_libmad=no]) + if test x"$have_external_libmad" != x"yes"; then + AC_MSG_RESULT([*** no usable version of libmad found, using internal copy ***]) + fi + else + AC_MSG_RESULT([Using included libmad support]) + fi + if test x"$have_external_libmad" != x"yes"; then + case "$host_or_hostalias" in + i?86-* | k?-* | athlon-* | pentium*-) + AC_DEFINE([FPM_INTEL], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + x86_64-*) + AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + ppc-* | powerpc-*) + AC_DEFINE([FPM_PPC], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + sparc*-*) + if test "$GCC" = yes; then + AC_DEFINE([FPM_SPARC], 1, [Define to select libmad fixed point arithmetic implementation]) + else + AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation]) + fi + ;; + mips-*) + AC_DEFINE([FPM_MIPS], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + alphaev56-* | alpha* | ia64-* | hppa*-linux-*) + AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + arm*-*) + AC_DEFINE([FPM_ARM], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + universal-*) + ;; + *) + AC_DEFINE([FPM_DEFAULT], 1, [Define to select libmad fixed point arithmetic implementation]) + ;; + esac + LIBMAD_CFLAGS='-I$(top_srcdir)/contrib/libmad' + LIBMAD_LIBS='$(top_builddir)/contrib/libmad/libmad.la' + LIBMAD_DEPS='$(top_builddir)/contrib/libmad/libmad.la' + fi + AC_SUBST(LIBMAD_CFLAGS) + AC_SUBST(LIBMAD_DEPS) + AC_SUBST(LIBMAD_LIBS) + fi + AM_CONDITIONAL([ENABLE_MAD], [test x"$enable_mad" != x"no"]) + AM_CONDITIONAL([WITH_EXTERNAL_MAD], [test x"$have_external_libmad" = x"yes"]) + + + dnl libmodplug (optional; enabled by default) + AC_ARG_ENABLE([modplug], + [AS_HELP_STRING([--enable-modplug], [Enable MODPlug support (default: enabled)])], + [test x"$enableval" != x"no" && enable_modplug="yes"]) + if test x"$enable_modplug" != x"no"; then + PKG_CHECK_MODULES([LIBMODPLUG], [libmodplug >= 0.7], [have_modplug=yes], [have_modplug=no]) + if test x"$enable_modplug" = x"yes" && test x"$have_modplug" != x"yes"; then + AC_MSG_ERROR([MODPlug support requested, but MODPlug not found]) + fi + fi + AM_CONDITIONAL([ENABLE_MODPLUG], [test x"$have_modplug" = x"yes"]) + + + dnl libmpcdec (optional; enabled by default; external version allowed) + AC_ARG_ENABLE([musepack], + [AS_HELP_STRING([--enable-musepack], [Enable support for Musepack decoding (default: enabled, internal: use external copy)])]) + if test x"$enable_musepack" != x"no"; then + if test x"$enable_musepack" != x"internal"; then + AC_CHECK_LIB([mpcdec], [mpc_decoder_decode], + [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [have_external_libmpcdec=yes], [have_external_libmpcdec=no])], + [have_external_libmpcdec=no]) + if test x"$have_external_libmpcdec" != x"yes"; then + AC_MSG_RESULT([*** no usable version of libmpcdec found, using internal copy ***]) + else + MPCDEC_CFLAGS="" + MPCDEC_DEPS="" + MPCDEC_LIBS="-lmpcdec" + fi + else + AC_MSG_RESULT([Using included libmpcdec (Musepack)]) + fi + if test x"$have_external_libmpcdec" != x"yes"; then + MPCDEC_CFLAGS='-I$(top_srcdir)/contrib/libmpcdec' + MPCDEC_LIBS='$(top_builddir)/contrib/libmpcdec/libmpcdec.la' + MPCDEC_DEPS='$(top_builddir)/contrib/libmpcdec/libmpcdec.la' + fi + AC_SUBST(MPCDEC_CFLAGS) + AC_SUBST(MPCDEC_DEPS) + AC_SUBST(MPCDEC_LIBS) + fi + AM_CONDITIONAL([ENABLE_MUSEPACK], [test x"$enable_musepack" != x"no"]) + AM_CONDITIONAL([WITH_EXTERNAL_LIBMPCDEC], [test x"$have_external_libmpcdec" = x"yes"]) + + + dnl mlib + AC_ARG_ENABLE([mlib], + [AS_HELP_STRING([--enable-mlib], [build Sun mediaLib support (default: disabled)])], + [test x"$enableval" != x"no" && enable_mlib="yes"], [enable_lib="no"]) + AC_ARG_ENABLE([mlib-lazyload], + [AS_HELP_STRING([--enable-mlib-lazyload], [check for Sun mediaLib at runtime])], + [test x"$enableval" != x"no" && enable_mlib_lazyload="yes"], [enable_mlib_lazyload="no"]) + if test x"$enable_mlib" != x"no"; then + mlibhome="$MLIBHOME" test x"$mlibhome" = x"" && mlibhome="/opt/SUNWmlib" + AC_CHECK_LIB([mlib], [mlib_VideoAddBlock_U8_S16], + [saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$mlibhome/include" + AC_CHECK_HEADERS([mlib_video.h], + [if test x"$enable_mlib_lazyload" != x"no"; then + if test "$GCC" = yes; then + MLIB_LIBS="-L$mlibhome/lib -Wl,-z,lazyload,-lmlib,-z,nolazyload" + else + MLIB_LIBS="-L$mlibhome/lib -z lazyload -lmlib -z nolazyload" + fi + AC_DEFINE([MLIB_LAZYLOAD], 1, [Define this if you want to load mlib lazily]) + else + MLIB_LIBS="-L$mlibhome/lib -lmlib" + fi + MLIB_CFLAGS="-I$mlibhome/include" + AC_SUBST(MLIB_LIBS) + AC_SUBST(MLIB_CFLAGS) + dnl TODO: src/video_out/yuv2rgb.c and src/xine-utils/cpu_accel.c should be changed to use LIBMPEG2_MLIB + dnl and HAVE_MLIB should go away. + AC_DEFINE([HAVE_MLIB], 1, [Define this if you have mlib installed]) + AC_DEFINE([LIBMPEG2_MLIB], 1, [Define this if you have mlib installed]) + have_mlib=yes]) + CPPFLAGS="$saved_CPPFLAGS"], [], ["-L$mlibhome/lib"]) + fi + AM_CONDITIONAL([HAVE_MLIB], [test x"$have_mlib" = x"yes"]) + + + dnl mng (optional; enabled by default) + AC_ARG_ENABLE([mng], + [AS_HELP_STRING([--enable-mng], [Enable MNG decoder support (default: enabled)])], + [test x"$enableval" != x"no" && enable_mng="yes"]) + if test x"$with_mng" != x"no"; then + AC_CHECK_LIB([mng], [mng_initialize], + [AC_CHECK_HEADERS([libmng.h], [have_mng=yes], [have_mng=no])], [have_mng=no]) + if test x"$with_mng" = x"yes" && test x"$have_mng" != x"yes"; then + AC_MSG_ERROR([MNG support requested, but libmng not found]) + elif test x"$have_mng" = x"yes"; then + MNG_LIBS="-lmng" + AC_SUBST(MNG_LIBS) + fi + fi + AM_CONDITIONAL([ENABLE_MNG], [test x"$have_mng" = x"yes"]) + + + dnl Ogg/Speex (optional; enabled by default; external) + AC_ARG_WITH([speex], + [AS_HELP_STRING([--with-speex], [Enable Speex audio decoder support (default: enabled)])], + [test x"$withval" != x"no" && with_speex="yes"]) + if test x"$with_speex" != x"no"; then + PKG_CHECK_MODULES([SPEEX], [ogg speex], [have_speex=yes], [have_speex=no]) + if test x"$with_speex" = x"yes" && test x"$have_speex" != x"yes"; then + AC_MSG_ERROR([Speex support requested, but libspeex not found]) + elif test x"$have_speex" = x"yes"; then + AC_DEFINE([HAVE_SPEEX], 1, [Define this if you have speex]) + fi + fi + AM_CONDITIONAL([ENABLE_SPEEX], [test x"$have_speex" = x"yes"]) + + + dnl Ogg/Theora (optional; enabled by default; external) + AC_ARG_WITH([theora], + [AS_HELP_STRING([--with-theora], [Enable Theora video decoder support (default: enabled)])], + [test x"$withval" != x"no" && with_theora="yes"]) + if test x"$with_theora" != x"no"; then + PKG_CHECK_MODULES([THEORA], [ogg theora], [have_theora=yes], [have_theora=no]) + if test x"$with_theora" = x"yes" && test x"$have_theora" = x"no"; then + AC_MSG_ERROR([Theora support requested, but libtheora not found]) + elif test x"$have_theora" = x"yes"; then + AC_DEFINE([HAVE_THEORA], 1, [Define this if you have theora]) + fi + fi + AM_CONDITIONAL([ENABLE_THEORA], [test x"$have_theora" = x"yes"]) + + + dnl Ogg/Vorbis (optional; enabled by default; external) + AC_ARG_WITH([vorbis], + [AS_HELP_STRING([--with-vorbis], [Enable Vorbis audio decoder support (default: enabled)])], + [test x"$withval" != x"no" && with_vorbis="yes"]) + if test x"$with_vorbis" != x"no"; then + PKG_CHECK_MODULES([VORBIS], [ogg vorbis], [have_vorbis=yes], [have_vorbis=no]) + if test x"$with_vorbis" = x"yes" && test x"$have_vorbis" = "xno"; then + AC_MSG_ERROR([Vorbis support requested, but libvorbis not found]) + elif test x"$have_vorbis" = x"yes"; then + AC_DEFINE([HAVE_VORBIS], 1, [Define this if you have vorbis]) + fi + fi + AM_CONDITIONAL([ENABLE_VORBIS], [test x"$have_vorbis" = x"yes"]) + + + dnl real (optional; enabled by default) + dnl On some systems, we cannot enable Real codecs support to begin with. + dnl This includes Darwin, because it uses Mach-O rather than ELF. + AC_ARG_ENABLE([real-codecs], + [AS_HELP_STRING([--enable-real-codecs], [Enable Real binary codecs support (default: enabled)])], + [test x"$enableval" != x"no" && enable_real_codecs="yes"]) + AC_ARG_WITH([real-codecs-path], + [AS_HELP_STRING([--with-real-codecs-path=PATH], [Specify directory for Real binary codecs])]) + if test x"$enable_real_codecs" != x"no"; then + case "$host_os" in + darwin*) have_real_codecs=no ;; + *) + have_real_codecs=yes + + dnl For those that have a replacement, break at the first one found + AC_CHECK_SYMBOLS([__environ _environ environ], [break], [need_weak_aliases=yes]) + AC_CHECK_SYMBOLS([stderr __stderrp], [break], [need_weak_aliases=yes]) + + dnl For these there are no replacements + AC_CHECK_SYMBOLS([___brk_addr __ctype_b]) + + if test x"$need_weak_aliases" = x"yes"; then + CC_ATTRIBUTE_ALIAS([], [have_real_codecs=no]) + fi + ;; + esac + if test x"$enable_real_codecs" = x"yes" && test x"$have_real_codecs" != x"yes"; then + AC_MSG_ERROR([Binary Real codec support requested, but it is not available]) + elif test x"$have_real_codecs" = x"yes"; then + if test "${with_real_codecs_path+set}" = "set"; then + AC_DEFINE_UNQUOTED([REAL_CODEC_PATH], ["$with_real_codecs_path"], [Default path in which to find Real binary codecs]) + fi + fi + fi + AM_CONDITIONAL([ENABLE_REAL], [test x"$have_real_codecs" = x"yes"]) + + + dnl w32dll (optional; x86 only; enabled if using GNU as; GNU as required) + AC_ARG_ENABLE([w32dll], + [AS_HELP_STRING([--enable-w32dll], [Enable Win32 DLL support (default: enabled)])], + [test x"$enableval" != x"no" && enable_w32dll="yes"], + [test x"$with_gnu_as" != x"yes" && enable_w32dll="no"]) + AC_ARG_WITH([w32-path], + [AS_HELP_STRING([--with-w32-path=PATH], [location of Win32 binary codecs])], + [w32_path="$withval"], [w32_path="/usr/lib/codecs"]) + if test x"$enable_w32dll" != x"no"; then + case "$host_or_hostalias" in + *-mingw* | *-cygwin) have_w32dll=no ;; + i?86-* | k?-* | athlon-* | pentium*-) have_w32dll="$with_gnu_as" ;; + *) enable_w32dll=no ;; + esac + if test x"$enable_w32dll" = x"yes" && test x"$have_w32dll" != x"yes"; then + AC_MSG_ERROR([Win32 DLL support requested, but Win32 DLL support is not available]) + fi + fi + AC_SUBST(w32_path) + AM_CONDITIONAL([ENABLE_W32DLL], [test x"$have_w32dll" = x"yes"]) + + + dnl wavpack (optional; disabled by default) + AC_ARG_WITH([wavpack], + [AS_HELP_STRING([--with-wavpack], [Enable Wavpack decoder (requires libwavpack)])], + [test x"$withval" != x"no" && with_wavpack="yes"], [with_wavpack="no"]) + if test x"$with_wavpack" != x"no"; then + PKG_CHECK_MODULES([WAVPACK], [wavpack], [have_wavpack=yes], [have_wavpack=no]) + if test x"$with_wavpack" = x"yes" && test x"$have_wavpack" != x"yes"; then + AC_MSG_ERROR([Wavpack decoder support requested, but libwavpack not found]) + fi + fi + AM_CONDITIONAL([ENABLE_WAVPACK], [test x"$have_wavpack" = x"yes"]) + + + dnl Only enable building dmx image if either gdk_pixbuf or ImageMagick are enabled + AM_CONDITIONAL([BUILD_DMX_IMAGE], [test x"$have_imagemagick" = x"yes" -o x"$have_gdkpixbuf" = x"yes"]) +]) diff --git a/m4/directx.m4 b/m4/directx.m4 index 999beff6d..61b241c0f 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 <stddef.h> - -#include <windows.h> -#include <ddraw.h> -#include <dsound.h> - -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 <stddef.h> + #include <windows.h> + #include <ddraw.h> + #include <dsound.h>]], + [[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([ENABLE_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 <stddef.h> -#include <dlfcn.h> - -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/dvdnav.m4 b/m4/dvdnav.m4 deleted file mode 100644 index 0f24080f7..000000000 --- a/m4/dvdnav.m4 +++ /dev/null @@ -1,187 +0,0 @@ -dnl Configure paths for DVDNAV -dnl -dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr> -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a configuration -dnl script generated by Autoconf, you may include it under the same -dnl distribution terms that you use for the rest of that program. -dnl - -dnl AM_PATH_DVDNAV([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) -dnl Test for DVDNAV, and define DVDNAV_CFLAGS and DVDNAV_LIBS -dnl -AC_DEFUN([AM_PATH_DVDNAV], -[dnl -dnl Get the cflags and libraries from the dvdnav-config script -dnl -AC_ARG_WITH(dvdnav-prefix, - AS_HELP_STRING([--with-dvdnav-prefix=DIR], [prefix where DVDNAV is installed (optional)]), - dvdnav_config_prefix="$withval", dvdnav_config_prefix="") -AC_ARG_WITH(dvdnav-exec-prefix, - AS_HELP_STRING([--with-dvdnav-exec-prefix=DIR], [exec prefix where DVDNAV is installed (optional)]), - dvdnav_config_exec_prefix="$withval", dvdnav_config_exec_prefix="") -AC_ARG_ENABLE(dvdnavtest, - AS_HELP_STRING([--disable-dvdnavtest], [do not try to compile and run a test DVDNAV program]), - enable_dvdnavtest=$enableval, enable_dvdnavtest=yes) - - AC_LANG_PUSH([C]) - - if test x$dvdnav_config_exec_prefix != x ; then - dvdnav_config_args="$dvdnav_config_args --exec-prefix=$dvdnav_config_exec_prefix" - if test x${DVDNAV_CONFIG+set} != xset ; then - DVDNAV_CONFIG=$dvdnav_config_exec_prefix/bin/dvdnav-config - fi - fi - if test x$dvdnav_config_prefix != x ; then - dvdnav_config_args="$dvdnav_config_args --prefix=$dvdnav_config_prefix" - if test x${DVDNAV_CONFIG+set} != xset ; then - DVDNAV_CONFIG=$dvdnav_config_prefix/bin/dvdnav-config - fi - fi - - min_dvdnav_version=ifelse([$1], ,0.0.0,$1) - if test "x$enable_dvdnavtest" != "xyes" ; then - AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version]) - else - AC_PATH_TOOL(DVDNAV_CONFIG, dvdnav-config, no) - AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version]) - no_dvdnav="" - if test "$DVDNAV_CONFIG" = "no" ; then - no_dvdnav=yes - else - DVDNAV_CFLAGS=`$DVDNAV_CONFIG $dvdnav_config_args --cflags` - DVDNAV_LIBS=`$DVDNAV_CONFIG $dvdnav_config_args --libs` - dvdnav_config_major_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - dvdnav_config_minor_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - dvdnav_config_sub_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - dnl if test "x$enable_dvdnavtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $DVDNAV_CFLAGS" - LIBS="$DVDNAV_LIBS $LIBS" -dnl -dnl Now check if the installed DVDNAV is sufficiently new. (Also sanity -dnl checks the results of dvdnav-config to some extent -dnl - rm -f conf.dvdnavtest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include <dvdnav.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -int -main () -{ - int major, minor, sub; - char *tmp_version; - - system ("touch conf.dvdnavtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = (char *) strdup("$min_dvdnav_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) { - printf("%s, bad version string\n", "$min_dvdnav_version"); - exit(1); - } - - if (($dvdnav_config_major_version > major) || - (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version > minor)) || - (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version == minor) && ($dvdnav_config_sub_version >= sub))) { - return 0; - } else { - printf("\n*** An old version of libdvdnav (%d.%d.%d) was found.\n", - $dvdnav_config_major_version, $dvdnav_config_minor_version, $dvdnav_config_sub_version); - printf("*** You need a version of libdvdnav newer than %d.%d.%d. The latest version of\n", - major, minor, sub); - printf("*** libdvdnav is always available from:\n"); - printf("*** http://dvd.sourceforge.net\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the dvdnav-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of libdvdnav, but you can also set the DVDNAV_CONFIG environment to point to the\n"); - printf("*** correct copy of dvdnav-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - return 1; -} -]])],[],[no_dvdnav=yes],[no_dvdnav=cc]) - if test "x$no_dvdnav" = xcc; then - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <dvdnav.h> -#include <stdio.h> -]], [[ return 0; ]])],[no_dvdnav=''],[no_dvdnav=yes]) - fi - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_dvdnav" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$DVDNAV_CONFIG" = "no" ; then - echo "*** The dvdnav-config script installed by DVDNAV could not be found" - echo "*** If DVDNAV was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the DVDNAV_CONFIG environment variable to the" - echo "*** full path to dvdnav-config." - else - if test -f conf.dvdnavtest ; then - : - else - echo "*** Could not run DVDNAV test program, checking why..." - CFLAGS="$CFLAGS $DVDNAV_CFLAGS" - LIBS="$LIBS $DVDNAV_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <dvdnav.h> -#include <stdio.h> -]], [[ return 0; ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding DVDNAV or finding the wrong" - echo "*** version of DVDNAV. If it is not finding DVDNAV, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means DVDNAV was incorrectly installed" - echo "*** or that you have moved DVDNAV since it was installed. In the latter case, you" - echo "*** may want to edit the dvdnav-config script: $DVDNAV_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - DVDNAV_CFLAGS="" - DVDNAV_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(DVDNAV_CFLAGS) - AC_SUBST(DVDNAV_LIBS) - AC_LANG_POP([C]) - rm -f conf.dvdnavtest -]) @@ -10,111 +10,98 @@ dnl modifications, as long as this notice is preserved. dnl AC_PROG_AS dnl ---------- dnl find the pathname to the GNU or non-GNU assembler -AC_DEFUN([CC_PROG_AS], -[AC_ARG_WITH([gnu-as], - [AS_HELP_STRING([--with-gnu-as], - [assume the C compiler uses GNU as @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_as=yes], - [with_gnu_as=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -cc_prog=as -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=as gives a path. - AC_MSG_CHECKING([for as used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=as) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=as) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of as - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$AS" && AS="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=as - ;; - *) - # If it is relative, then search for the first as in PATH. - with_gnu_as=unknown - ;; - esac -elif test "$with_gnu_as" = yes; then - AC_MSG_CHECKING([for GNU as]) -else - AC_MSG_CHECKING([for non-GNU as]) -fi -AC_CACHE_VAL(cc_cv_path_AS, -[if test -z "$AS"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_AS="$ac_dir/$ac_prog" - # Check to see if the program is GNU as. I'd rather use --version, - # but apparently some variants of GNU as only accept -v. - # Break only if it was the GNU/non-GNU as that we prefer. - case `"$cc_cv_path_AS" -v 2>&1 </dev/null` in - dnl Apple's assembler reports itself as GNU as 1.38; - dnl but it doesn't provide the functions we need. - *Apple*) - test "$with_gnu_as" != yes && break - ;; - *GNU* | *'with BFD'*) - test "$with_gnu_as" != no && break - ;; - *) - test "$with_gnu_as" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - cc_cv_path_AS="$AS" # Let the user override the test with a path. -fi]) -AS="$cc_cv_path_AS" -if test -n "$AS"; then - AC_MSG_RESULT($AS) -else - AC_MSG_RESULT(no) -fi -test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH]) -CC_PROG_AS_GNU -]) +dnl based on AC_PROG_LD from libtool +AC_DEFUN([CC_PROG_AS], [ + AC_REQUIRE([LT_AC_PROG_SED])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AM_PROG_AS])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl + + AC_ARG_WITH([gnu-as], + [AS_HELP_STRING([--with-gnu-as], [assume the C compiler uses GNU as @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_as=yes], [with_gnu_as=unknown]) + if test x"$with_gnu_as" = x"unknown"; then + dnl If CCAS is not the same as CC, check to see if it's GCC. + if test x"$CCAS" = x"$CC"; then + ccas_is_gnu="$GCC" + else + AC_CACHE_CHECK([whether $CCAS is a GNU compiler], [ac_cv_CCAS_compiler_gnu], + [saved_CC="$CC" CC="$CCAS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __GNUC__ + choke me + #endif]])], + [ac_cv_CCAS_compiler_gnu=yes], [ac_cv_CCAS_compiler_gnu=no]) + CC="$saved_CC"]) + ccas_is_gnu="$ac_cv_CCAS_compiler_gnu" + fi + dnl Try to figure out the assembler command. Fallback to as. + ac_prog="" + if test x"$AS" = x""; then + AC_MSG_CHECKING([for as used by $CCAS]) + if test x"$ccas_is_gnu" = x"yes"; then + # Check if gcc -print-prog-name=as gives a path. + case "$host_or_hostalias" in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CCAS -print-prog-name=as) 2>&5 | tr -d '\015'` + ;; + *) + ac_prog=`($CCAS -print-prog-name=as) 2>&5` + ;; + esac + + case "$ac_prog" in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of as + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + ;; + *) ac_prog="" ;; + esac + fi + fi + if test x"$ac_prog" = x""; then + # If it fails, then pretend we aren't using GCC. + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/as" || test -f "$ac_dir/as$ac_exeext"; then + ac_prog="$ac_dir/as" + break + fi + done + IFS="$lt_save_ifs" + fi + if test x"$ac_prog" = x""; then + AC_MSG_RESULT([unknown]) + else + AS="$ac_prog" + AC_MSG_RESULT([$AS]) + fi + fi -dnl AC_PROG_AS_GNU -dnl -------------- -AC_DEFUN([CC_PROG_AS_GNU], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_CACHE_CHECK([if the assembler ($AS) is GNU as], cc_cv_prog_gnu_as, -[# I'd rather use --version here, but apparently some GNU as's only accept -v. -case `$AS -v 2>&1 </dev/null` in -dnl Apple's assembler reports itself as GNU as 1.38; -dnl but it doesn't provide the functions we need. -*Apple*) - cc_cv_prog_gnu_as=no - ;; -*GNU* | *'with BFD'*) - cc_cv_prog_gnu_as=yes - ;; -*) - cc_cv_prog_gnu_as=no - ;; -esac]) -with_gnu_as=$cc_cv_prog_gnu_as + test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH]) + AC_CACHE_CHECK([if the assembler ($AS) is GNU as], [cc_cv_prog_gnu_as], [ + # I'd rather use --version here, but apparently some GNU as's only accept -v. + case `"$AS" -v 2>&1 </dev/null` in + *Apple*) + # Apple's assembler reports itself as GNU as 1.38; + # but it doesn't provide the functions we need. + cc_cv_prog_gnu_as=no + ;; + *GNU* | *'with BFD'*) + cc_cv_prog_gnu_as=yes + ;; + *) + cc_cv_prog_gnu_as=no + ;; + esac]) + with_gnu_as="$cc_cv_prog_gnu_as" ]) diff --git a/m4/gettext/Makefile.am b/m4/gettext/Makefile.am new file mode 100644 index 000000000..d5f2fe6f0 --- /dev/null +++ b/m4/gettext/Makefile.am @@ -0,0 +1,32 @@ +include $(top_srcdir)/misc/Makefile.common + +EXTRA_DIST = \ + codeset.m4 \ + gettext.m4 \ + glibc2.m4 \ + glibc21.m4 \ + iconv.m4 \ + intdiv0.m4 \ + intmax.m4 \ + inttypes-pri.m4 \ + inttypes.m4 \ + inttypes_h.m4 \ + isc-posix.m4 \ + lcmessage.m4 \ + lib-ld.m4 \ + lib-link.m4 \ + lib-prefix.m4 \ + longdouble.m4 \ + longlong.m4 \ + nls.m4 \ + po.m4 \ + printf-posix.m4 \ + progtest.m4 \ + signed.m4 \ + size_max.m4 \ + stdint_h.m4 \ + uintmax_t.m4 \ + ulonglong.m4 \ + wchar_t.m4 \ + wint_t.m4 \ + xsize.m4 diff --git a/m4/gettext/codeset.m4 b/m4/gettext/codeset.m4 new file mode 100644 index 000000000..a6e67ec49 --- /dev/null +++ b/m4/gettext/codeset.m4 @@ -0,0 +1,21 @@ +# codeset.m4 serial AM1 (gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include <langinfo.h>], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) + fi +]) diff --git a/m4/gettext/gettext.m4 b/m4/gettext/gettext.m4 new file mode 100644 index 000000000..91c345e99 --- /dev/null +++ b/m4/gettext/gettext.m4 @@ -0,0 +1,419 @@ +# gettext.m4 serial 59 (gettext-0.16.1) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_included_intl], + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_TRY_LINK([#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv. + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include <libintl.h> +$gt_revision_test_code +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *);], + [bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) +]) + + +dnl Checks for special options needed on MacOS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in MacOS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + gt_cv_func_CFPreferencesCopyAppValue, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], + [CFPreferencesCopyAppValue(NULL, NULL)], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, + [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in MacOS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, + [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/glibc2.m4 b/m4/gettext/glibc2.m4 index e8f5bfe6e..e8f5bfe6e 100644 --- a/m4/glibc2.m4 +++ b/m4/gettext/glibc2.m4 diff --git a/m4/glibc21.m4 b/m4/gettext/glibc21.m4 index d95fd9861..d95fd9861 100644 --- a/m4/glibc21.m4 +++ b/m4/gettext/glibc21.m4 diff --git a/m4/gettext/iconv.m4 b/m4/gettext/iconv.m4 new file mode 100644 index 000000000..654c41589 --- /dev/null +++ b/m4/gettext/iconv.m4 @@ -0,0 +1,101 @@ +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff --git a/m4/intdiv0.m4 b/m4/gettext/intdiv0.m4 index b8d78176a..b8d78176a 100644 --- a/m4/intdiv0.m4 +++ b/m4/gettext/intdiv0.m4 diff --git a/m4/gettext/intmax.m4 b/m4/gettext/intmax.m4 new file mode 100644 index 000000000..d99c999fd --- /dev/null +++ b/m4/gettext/intmax.m4 @@ -0,0 +1,30 @@ +# intmax.m4 serial 2 (gettext-0.14.2) +dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether the system has the 'intmax_t' type, but don't attempt to +dnl find a replacement if it is lacking. + +AC_DEFUN([gt_TYPE_INTMAX_T], +[ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + [AC_TRY_COMPILE([ +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif +], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE(HAVE_INTMAX_T, 1, + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) + fi +]) diff --git a/m4/gettext/inttypes-pri.m4 b/m4/gettext/inttypes-pri.m4 new file mode 100644 index 000000000..4d56a9ad3 --- /dev/null +++ b/m4/gettext/inttypes-pri.m4 @@ -0,0 +1,30 @@ +# inttypes-pri.m4 serial 1 (gettext-0.11.4) +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_REQUIRE([gt_HEADER_INTTYPES_H]) + if test $gt_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + gt_cv_inttypes_pri_broken, + [ + AC_TRY_COMPILE([#include <inttypes.h> +#ifdef PRId32 +char *p = PRId32; +#endif +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, + [Define if <inttypes.h> exists and defines unusable PRI* macros.]) + fi +]) diff --git a/m4/inttypes.m4 b/m4/gettext/inttypes.m4 index 779bcea05..779bcea05 100644 --- a/m4/inttypes.m4 +++ b/m4/gettext/inttypes.m4 diff --git a/m4/gettext/inttypes_h.m4 b/m4/gettext/inttypes_h.m4 new file mode 100644 index 000000000..a5d075d96 --- /dev/null +++ b/m4/gettext/inttypes_h.m4 @@ -0,0 +1,26 @@ +# inttypes_h.m4 serial 6 +dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, +# doesn't clash with <sys/types.h>, and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include <sys/types.h> +#include <inttypes.h>], + [uintmax_t i = (uintmax_t) -1;], + gl_cv_header_inttypes_h=yes, + gl_cv_header_inttypes_h=no)]) + if test $gl_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, + [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) + fi +]) diff --git a/m4/isc-posix.m4 b/m4/gettext/isc-posix.m4 index 74dc8f26d..74dc8f26d 100644 --- a/m4/isc-posix.m4 +++ b/m4/gettext/isc-posix.m4 diff --git a/m4/lcmessage.m4 b/m4/gettext/lcmessage.m4 index 19aa77e4f..19aa77e4f 100644 --- a/m4/lcmessage.m4 +++ b/m4/gettext/lcmessage.m4 diff --git a/m4/lib-ld.m4 b/m4/gettext/lib-ld.m4 index 96c4e2c33..96c4e2c33 100644 --- a/m4/lib-ld.m4 +++ b/m4/gettext/lib-ld.m4 diff --git a/m4/gettext/lib-link.m4 b/m4/gettext/lib-link.m4 new file mode 100644 index 000000000..f95b7ba88 --- /dev/null +++ b/m4/gettext/lib-link.m4 @@ -0,0 +1,644 @@ +# lib-link.m4 serial 9 (gettext-0.16) +dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_PREREQ(2.50) + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + dnl Tell automake >= 1.10 to complain if config.rpath is missing. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" \ + && { test -f "$additional_libdir/lib$name.$shlibext" \ + || { test "$shlibext" = dll \ + && test -f "$additional_libdir/lib$name.dll.a"; }; }; then + found_dir="$additional_libdir" + if test -f "$additional_libdir/lib$name.$shlibext"; then + found_so="$additional_libdir/lib$name.$shlibext" + else + found_so="$additional_libdir/lib$name.dll.a" + fi + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" \ + && { test -f "$dir/lib$name.$shlibext" \ + || { test "$shlibext" = dll \ + && test -f "$dir/lib$name.dll.a"; }; }; then + found_dir="$dir" + if test -f "$dir/lib$name.$shlibext"; then + found_so="$dir/lib$name.$shlibext" + else + found_so="$dir/lib$name.dll.a" + fi + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/m4/gettext/lib-prefix.m4 b/m4/gettext/lib-prefix.m4 new file mode 100644 index 000000000..a8684e17e --- /dev/null +++ b/m4/gettext/lib-prefix.m4 @@ -0,0 +1,185 @@ +# lib-prefix.m4 serial 5 (gettext-0.15) +dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing +dnl the basename of the libdir, either "lib" or "lib64". +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib and lib64. The current + dnl practice is that on a system supporting 32-bit and 64-bit instruction + dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit + dnl libraries go under $prefix/lib. We determine the compiler's default + dnl mode by looking at the compiler's library search path. If at least + dnl of its elements ends in /lib64 or points to a directory whose absolute + dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the + dnl default, namely "lib". + acl_libdirstem=lib + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi +]) diff --git a/m4/gettext/longdouble.m4 b/m4/gettext/longdouble.m4 new file mode 100644 index 000000000..40cd7ce02 --- /dev/null +++ b/m4/gettext/longdouble.m4 @@ -0,0 +1,28 @@ +# longdouble.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether the compiler supports the 'long double' type. +dnl Prerequisite: AC_PROG_CC + +AC_DEFUN([gt_TYPE_LONGDOUBLE], +[ + AC_CACHE_CHECK([for long double], gt_cv_c_long_double, + [if test "$GCC" = yes; then + gt_cv_c_long_double=yes + else + AC_TRY_COMPILE([ + /* The Stardent Vistra knows sizeof(long double), but does not support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + int array [2*(sizeof(long double) >= sizeof(double)) - 1]; + ], , + gt_cv_c_long_double=yes, gt_cv_c_long_double=no) + fi]) + if test $gt_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) + fi +]) diff --git a/m4/gettext/longlong.m4 b/m4/gettext/longlong.m4 new file mode 100644 index 000000000..7b399e012 --- /dev/null +++ b/m4/gettext/longlong.m4 @@ -0,0 +1,23 @@ +# longlong.m4 serial 5 +dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG if 'long long' works. + +AC_DEFUN([gl_AC_TYPE_LONG_LONG], +[ + AC_CACHE_CHECK([for long long], ac_cv_type_long_long, + [AC_TRY_LINK([long long ll = 1LL; int i = 63;], + [long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll;], + ac_cv_type_long_long=yes, + ac_cv_type_long_long=no)]) + if test $ac_cv_type_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, + [Define if you have the 'long long' type.]) + fi +]) diff --git a/m4/gettext/nls.m4 b/m4/gettext/nls.m4 new file mode 100644 index 000000000..7967cc2f9 --- /dev/null +++ b/m4/gettext/nls.m4 @@ -0,0 +1,31 @@ +# nls.m4 serial 3 (gettext-0.15) +dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +AC_PREREQ(2.50) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) diff --git a/m4/gettext/po.m4 b/m4/gettext/po.m4 new file mode 100644 index 000000000..00133ef36 --- /dev/null +++ b/m4/gettext/po.m4 @@ -0,0 +1,428 @@ +# po.m4 serial 13 (gettext-0.15) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +AC_PREREQ(2.50) + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done]], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + # When this code is run, in config.status, two variables have already been + # set: + # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, + # - LINGUAS is the value of the environment variable LINGUAS at configure + # time. + +changequote(,)dnl + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + # Find a way to echo strings without interpreting backslash. + if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='echo' + else + if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then + gt_echo='printf %s\n' + else + echo_func () { + cat <<EOT +$* +EOT + } + gt_echo='echo_func' + fi + fi + + # A sed script that extracts the value of VARIABLE from a Makefile. + sed_x_variable=' +# Test if the hold space is empty. +x +s/P/P/ +x +ta +# Yes it was empty. Look if we have the expected variable definition. +/^[ ]*VARIABLE[ ]*=/{ + # Seen the first line of the variable definition. + s/^[ ]*VARIABLE[ ]*=// + ba +} +bd +:a +# Here we are processing a line from the variable definition. +# Remove comment, more precisely replace it with a space. +s/#.*$/ / +# See if the line ends in a backslash. +tb +:b +s/\\$// +# Print the line, without the trailing backslash. +p +tc +# There was no trailing backslash. The end of the variable definition is +# reached. Clear the hold space. +s/^.*$// +x +bd +:c +# A trailing backslash means that the variable definition continues in the +# next line. Put a nonempty string into the hold space to indicate this. +s/^.*$/P/ +x +:d +' +changequote([,])dnl + + # Set POTFILES to the value of the Makefile variable POTFILES. + sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` + POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` + # Compute POTFILES_DEPS as + # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) + POTFILES_DEPS= + for file in $POTFILES; do + POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file" + done + POMAKEFILEDEPS="" + + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. + sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` + ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` + fi + # Hide the ALL_LINGUAS assigment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + # Compute POFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) + # Compute UPDATEPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) + # Compute DUMMYPOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) + # Compute GMOFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) + # Compute PROPERTIESFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) + # Compute CLASSFILES + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) + # Compute QMFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) + # Compute MSGFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) + # Compute RESOURCESDLLFILES + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + UPDATEPOFILES= + DUMMYPOFILES= + GMOFILES= + PROPERTIESFILES= + CLASSFILES= + QMFILES= + MSGFILES= + RESOURCESDLLFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" + CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" + QMFILES="$QMFILES $srcdirpre$lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + JAVACATALOGS= + QTCATALOGS= + TCLCATALOGS= + CSHARPCATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties" + QTCATALOGS="$QTCATALOGS $lang.qm" + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" + done + fi + + sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + cat >> "$ac_file.tmp" <<EOF +$frobbedlang.msg: $lang.po + @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ + \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then + # Add dependencies that cannot be formulated as a simple suffix rule. + for lang in $ALL_LINGUAS; do + frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` + cat >> "$ac_file.tmp" <<EOF +$frobbedlang/\$(DOMAIN).resources.dll: $lang.po + @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ + \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +EOF + done + fi + if test -n "$POMAKEFILEDEPS"; then + cat >> "$ac_file.tmp" <<EOF +Makefile: $POMAKEFILEDEPS +EOF + fi + mv "$ac_file.tmp" "$ac_file" +]) diff --git a/m4/printf-posix.m4 b/m4/gettext/printf-posix.m4 index af10170af..af10170af 100644 --- a/m4/printf-posix.m4 +++ b/m4/gettext/printf-posix.m4 diff --git a/m4/progtest.m4 b/m4/gettext/progtest.m4 index a56365cd3..a56365cd3 100644 --- a/m4/progtest.m4 +++ b/m4/gettext/progtest.m4 diff --git a/m4/signed.m4 b/m4/gettext/signed.m4 index 048f59369..048f59369 100644 --- a/m4/signed.m4 +++ b/m4/gettext/signed.m4 diff --git a/m4/gettext/size_max.m4 b/m4/gettext/size_max.m4 new file mode 100644 index 000000000..4fe81c7b0 --- /dev/null +++ b/m4/gettext/size_max.m4 @@ -0,0 +1,59 @@ +# size_max.m4 serial 2 +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SIZE_MAX], +[ + AC_CHECK_HEADERS(stdint.h) + dnl First test whether the system already has SIZE_MAX. + AC_MSG_CHECKING([for SIZE_MAX]) + result= + AC_EGREP_CPP([Found it], [ +#include <limits.h> +#if HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef SIZE_MAX +Found it +#endif +], result=yes) + if test -z "$result"; then + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider + dnl than the type 'unsigned long'. + dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', + dnl which is guaranteed to work from LONG_MIN to LONG_MAX. + _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, + [#include <stddef.h>], result=?) + _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, + [#include <stddef.h>], result=?) + _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, + [#include <stddef.h>], result=?) + if test "$fits_in_uint" = 1; then + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. + AC_TRY_COMPILE([#include <stddef.h> + extern size_t foo; + extern unsigned long foo; + ], [], fits_in_uint=0) + fi + if test -z "$result"; then + if test "$fits_in_uint" = 1; then + result="$res_hi$res_lo"U + else + result="$res_hi$res_lo"UL + fi + else + dnl Shouldn't happen, but who knows... + result='~(size_t)0' + fi + fi + AC_MSG_RESULT([$result]) + if test "$result" != yes; then + AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], + [Define as the maximum value of type 'size_t', if the system doesn't define it.]) + fi +]) diff --git a/m4/gettext/stdint_h.m4 b/m4/gettext/stdint_h.m4 new file mode 100644 index 000000000..3355f35aa --- /dev/null +++ b/m4/gettext/stdint_h.m4 @@ -0,0 +1,26 @@ +# stdint_h.m4 serial 5 +dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, +# doesn't clash with <sys/types.h>, and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, + [AC_TRY_COMPILE( + [#include <sys/types.h> +#include <stdint.h>], + [uintmax_t i = (uintmax_t) -1;], + gl_cv_header_stdint_h=yes, + gl_cv_header_stdint_h=no)]) + if test $gl_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, + [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) + fi +]) diff --git a/m4/uintmax_t.m4 b/m4/gettext/uintmax_t.m4 index bf83ed746..bf83ed746 100644 --- a/m4/uintmax_t.m4 +++ b/m4/gettext/uintmax_t.m4 diff --git a/m4/gettext/ulonglong.m4 b/m4/gettext/ulonglong.m4 new file mode 100644 index 000000000..dee10ccc3 --- /dev/null +++ b/m4/gettext/ulonglong.m4 @@ -0,0 +1,23 @@ +# ulonglong.m4 serial 4 +dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. + +AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the 'unsigned long long' type.]) + fi +]) diff --git a/m4/wchar_t.m4 b/m4/gettext/wchar_t.m4 index cde2129a9..cde2129a9 100644 --- a/m4/wchar_t.m4 +++ b/m4/gettext/wchar_t.m4 diff --git a/m4/wint_t.m4 b/m4/gettext/wint_t.m4 index b8fff9c86..b8fff9c86 100644 --- a/m4/wint_t.m4 +++ b/m4/gettext/wint_t.m4 diff --git a/m4/xsize.m4 b/m4/gettext/xsize.m4 index 85bb721e4..85bb721e4 100644 --- a/m4/xsize.m4 +++ b/m4/gettext/xsize.m4 diff --git a/m4/input.m4 b/m4/input.m4 new file mode 100644 index 000000000..1e2f72113 --- /dev/null +++ b/m4/input.m4 @@ -0,0 +1,149 @@ +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 - dvb is Linux only + dnl - v4l is Linux only + + default_enable_dvb=disable + default_enable_gnomevfs=enable + default_enable_samba=enable + default_enable_v4l=disable + default_enable_vcd=enable + default_enable_vcdo=disable + + case "$host_os" in + cygwin* | mingw*) + default_enable_gnomevfs=disable + default_enable_samba=disable + ;; + darwin*) + default_enable_gnomevfs=disable + default_enable_samba=disable + ;; + freebsd*) + default_enable_vcdo=enable + ;; + linux*) + default_enable_dvb=enable + default_enable_v4l=enable + default_enable_vcdo=enable + ;; + solaris*) + default_enable_vcdo=enable + ;; + esac + + dnl dvb + AC_ARG_ENABLE([dvb], + [AS_HELP_STRING([--enable-dvb], [Enable support for the DVB plugin (Linux only)])], + [test x"$enableval" != x"no" && enable_dvb="yes"], + [test $default_enable_dvb = disable && enable_dvb="no"]) + if test x"$enable_dvb" != x"no"; then + case "$host_os" in + linux*) have_dvb=yes ;; + *) have_dvb=no ;; + esac + if test x"$enable_dvb" = x"yes" && test x"$have_dvb" != x"yes"; then + AC_MSG_ERROR([DVB support requested, but DVB not found]) + fi + fi + AM_CONDITIONAL([ENABLE_DVB], [test x"$have_dvb" = x"yes"]) + + + dnl gnome-vfs + AC_ARG_ENABLE([gnomevfs], + [AS_HELP_STRING([--enable-gnomevfs], [Enable support for the Gnome-VFS plugin])], + [test x"$enableval" != x"no" && enable_gnomevfs="yes"], + [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], [have_gnomevfs=yes], [have_gnome_vfs=no]) + if test x"$enable_gnomevfs" = x"yes" && test x"$have_gnomevfs" != x"yes"; then + AC_MSG_ERROR([Gnome-VFS support requested, but Gnome-VFS not found]) + fi + fi + AM_CONDITIONAL([ENABLE_GNOME_VFS], [test x"$have_gnomevfs" = x"yes"]) + + + dnl libsmbclient + AC_ARG_ENABLE([samba], + [AS_HELP_STRING([--enable-samba], [Enable support for the Samba plugin])], + [test x"$enableval" != x"no" && enable_samba="yes"], + [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_samba=yes LIBSMBCLIENT_LIBS="-lsmbclient"])]) + AC_SUBST(LIBSMBCLIENT_LIBS) + if test x"$enable_samba" = x"yes" && test x"$have_samba" != x"yes"; then + AC_MSG_ERROR([Samba support requested, but Samba not found]) + fi + fi + AM_CONDITIONAL([ENABLE_LIBSMBCLIENT], [test x"$have_samba" = x"yes"]) + + + dnl video-for-linux (v4l) + AC_ARG_ENABLE([v4l], + [AS_HELP_STRING([--enable-v4l], [Enable Video4Linux support])], + [test x"$enableval" != x"no" && enable_v4l="yes"], + [test $default_enable_v4l = disable && enable_v4l="no"]) + if test x"$enable_v4l" != x"no"; then + have_v4l=yes + AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h], , [have_v4l=no]) + AC_CHECK_HEADERS([asm/types.h]) + if test x"$enable_v4l" = x"yes" && test x"$have_v4l" != x"yes"; then + AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.]) + fi + fi + AM_CONDITIONAL([ENABLE_V4L], [test x"$have_v4l" = x"yes"]) + + + dnl dvdnav + dnl XXX: This could be cleaned up so that code does not have to ifdef so much + AC_ARG_WITH([external-dvdnav], + [AS_HELP_STRING([--with-external-dvdnav], [Use external dvdnav library (not recommended)])], + [test x"$withval" != x"no" && with_external_dvdnav="yes"], [with_external_dvdnav="no"]) + if test x"$with_external_dvdnav" != x"no"; then + ACX_PACKAGE_CHECK([DVDNAV], [0.1.9], [dvdnav-config], + [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([Using included DVDNAV support]) + fi + AM_CONDITIONAL([WITH_EXTERNAL_DVDNAV], [test x"$with_external_dvdnav" != x"no"]) + + + dnl Video CD + dnl XXX: This could be cleaned up so that code does not have it ifdef so much + AC_ARG_ENABLE([vcd], + [AS_HELP_STRING([--enable-vcd], [Enable VCD (VideoCD) support])], + [test x"$enableval" != x"no" && enable_vcd="yes"], + [test $default_enable_vcd = disable && enable_vcd="no"]) + if test x"$enable_vcd" != x"no"; then + PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71]) + PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23]) + AC_DEFINE([HAVE_VCDNAV], 1, [Define this if you use external libcdio/libvcdinfo]) + fi + + enable_vcdo=no + test $default_enable_vcdo = enable && test x"$enable_vcd" != x"no" && enable_vcdo=yes + + 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(LIBVCD_CFLAGS) + AC_SUBST(LIBVCD_LIBS) + AM_CONDITIONAL([ENABLE_VCD], [test x"$enable_vcd" != x"no"]) + AM_CONDITIONAL([ENABLE_VCDO], [test x"$enable_vcdo" != x"no"]) + + + dnl vdr + AC_ARG_ENABLE([vdr], + [AS_HELP_STRING([--enable-vdr], [Enable support for the VDR plugin (default: enabled)])], + [test x"$enableval" != x"no" && enable_vdr="yes"]) + AM_CONDITIONAL([ENABLE_VDR], [test x"$enable_vdr" != x"no"]) +]) diff --git a/m4/ioctl_request.m4 b/m4/ioctl_request.m4 deleted file mode 100644 index c6d12258e..000000000 --- a/m4/ioctl_request.m4 +++ /dev/null @@ -1,52 +0,0 @@ -dnl Simple macro to find the type of the ioctl request parameter -dnl Copyright (c) 2007 xine project -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -dnl 02110-1301, USA. -dnl -dnl As a special exception, the xine project, as copyright owner of the -dnl macro gives unlimited permission to copy, distribute and modify the -dnl configure scripts that are the output of Autoconf when processing the -dnl Macro. You need not follow the terms of the GNU General Public -dnl License when using or distributing such scripts, even though portions -dnl of the text of the Macro appear in them. The GNU General Public -dnl License (GPL) does govern all other use of the material that -dnl constitutes the Autoconf Macro. -dnl -dnl This special exception to the GPL applies to versions of the -dnl Autoconf Macro released by the xine project. When you make and -dnl distribute a modified version of the Autoconf Macro, you may extend -dnl this special exception to the GPL to apply to your modified version as -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 <sys/ioctl.h> - 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/irixal.m4 b/m4/irixal.m4 deleted file mode 100644 index 3ff633cf8..000000000 --- a/m4/irixal.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl AM_CHECK_IRIXAL ([ACTION-IF-YES], [ACTION-IF-NO]) -dnl Configure paths/version for IRIX AL -AC_DEFUN([AM_CHECK_IRIXAL], - [AC_CACHE_CHECK([for IRIX libaudio support], - [am_cv_have_irixal], - [AC_CHECK_HEADER([dmedia/audio.h], - am_cv_have_irixal=yes, am_cv_have_irixal=no)]) - if test "x$am_cv_have_irixal" = xyes ; then - IRIXAL_LIBS="-laudio" - IRIXAL_STATIC_LIB="/usr/lib/libaudio.a" - ifelse([$1], , :, [$1]) - else - ifelse([$2], , :, [$2]) - fi - AC_SUBST(IRIXAL_CFLAGS) - AC_SUBST(IRIXAL_STATIC_LIB) - AC_SUBST(IRIXAL_LIBS) -]) - diff --git a/m4/libFLAC.m4 b/m4/libFLAC.m4 index 9ecf8dd51..9778d25d6 100644 --- a/m4/libFLAC.m4 +++ b/m4/libFLAC.m4 @@ -13,6 +13,33 @@ AC_ARG_WITH(libFLAC-libraries, AS_HELP_STRING([--with-libFLAC-libraries=DIR], [d AC_ARG_WITH(libFLAC-includes, AS_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)]), libFLAC_includes="$withval", libFLAC_includes="") AC_ARG_ENABLE(libFLACtest, AS_HELP_STRING([--disable-libFLACtest], [do not try to compile and run a test libFLAC program]), enable_libFLACtest=$enableval, enable_libFLACtest=yes) + AC_MSG_CHECKING([libdir name]) + case $host_or_hostalias in + *-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + xine_cv_cc_64bit_output=no + if AC_TRY_EVAL(ac_compile); then + case `"$MAGIC_CMD" conftest.$ac_objext` in + *"ELF 64"*) + xine_cv_cc_64bit_output=yes + ;; + esac + fi + rm -rf conftest* + ;; + esac + + case $host_cpu:$xine_cv_cc_64bit_output in + powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + XINE_LIBNAME="lib64" + ;; + *:*) + XINE_LIBNAME="lib" + ;; + esac + AC_MSG_RESULT([$XINE_LIBNAME]) + if test "x$libFLAC_libraries" != "x" ; then LIBFLAC_LIBS="-L$libFLAC_libraries" elif test "x$libFLAC_prefix" != "x" ; then diff --git a/m4/libfame.m4 b/m4/libfame.m4 deleted file mode 100644 index 5fc34cc56..000000000 --- a/m4/libfame.m4 +++ /dev/null @@ -1,183 +0,0 @@ -dnl AM_PATH_LIBFAME([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for libfame, and define LIBFAME_CFLAGS and LIBFAME_LIBS -dnl Vivien Chappelier 12/11/00 -dnl stolen from ORBit autoconf -dnl -AC_DEFUN([AM_PATH_LIBFAME], -[dnl -dnl Get the cflags and libraries from the libfame-config script -dnl -AC_ARG_WITH(libfame-prefix, AS_HELP_STRING([--with-libfame-prefix=DIR], [prefix where libfame is installed (optional)]), - libfame_config_prefix="$withval", libfame_config_prefix="") -AC_ARG_WITH(libfame-exec-prefix, AS_HELP_STRING([--with-libfame-exec-prefix=DIR], [exec prefix where libfame is installed (optional)]), - libfame_config_exec_prefix="$withval", libfame_config_exec_prefix="") -AC_ARG_ENABLE(libfametest, AS_HELP_STRING([--disable-libfametest], [do not try to compile and run a test libfame program]), - enable_libfametest=$enableval, enable_libfametest=yes) - - if test x$libfame_config_exec_prefix != x ; then - libfame_config_args="$libfame_config_args --exec-prefix=$libfame_config_exec_prefix" - if test x${LIBFAME_CONFIG+set} != xset ; then - LIBFAME_CONFIG=$libfame_config_exec_prefix/bin/libfame-config - fi - fi - if test x$libfame_config_prefix != x ; then - libfame_config_args="$libfame_config_args --prefix=$libfame_config_prefix" - if test x${LIBFAME_CONFIG+set} != xset ; then - LIBFAME_CONFIG=$libfame_config_prefix/bin/libfame-config - fi - fi - - AC_PATH_TOOL(LIBFAME_CONFIG, libfame-config, no) - min_libfame_version=ifelse([$1], , 0.9.0, $1) - AC_MSG_CHECKING(for libfame - version >= $min_libfame_version) - no_libfame="" - if test "$LIBFAME_CONFIG" = "no" ; then - no_libfame=yes - else - LIBFAME_CFLAGS=`$LIBFAME_CONFIG $libfame_config_args --cflags` - LIBFAME_LIBS=`$LIBFAME_CONFIG $libfame_config_args --libs` - libfame_config_major_version=`$LIBFAME_CONFIG $libfame_config_args --version | \ - sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - libfame_config_minor_version=`$LIBFAME_CONFIG $libfame_config_args --version | \ - sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - libfame_config_micro_version=`$LIBFAME_CONFIG $libfame_config_args --version | \ - sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_libfametest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $LIBFAME_CFLAGS" - LIBS="$LIBFAME_LIBS $LIBS" -dnl -dnl Now check if the installed LIBFAME is sufficiently new. (Also sanity -dnl checks the results of libfame-config to some extent -dnl - rm -f conf.libfametest - AC_TRY_RUN([ -#include <fame.h> -#include <stdio.h> -#include <stdlib.h> - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.libfametest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = strdup("$min_libfame_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_libfame_version"); - exit(1); - } - - if ((libfame_major_version != $libfame_config_major_version) || - (libfame_minor_version != $libfame_config_minor_version) || - (libfame_micro_version != $libfame_config_micro_version)) - { - printf("\n*** 'libfame-config --version' returned %d.%d.%d, but Libfame (%d.%d.%d)\n", - $libfame_config_major_version, $libfame_config_minor_version, $libfame_config_micro_version, - libfame_major_version, libfame_minor_version, libfame_micro_version); - printf ("*** was found! If libfame-config was correct, then it is best\n"); - printf ("*** to remove the old version of libfame. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If libfame-config was wrong, set the environment variable LIBFAME_CONFIG\n"); - printf("*** to point to the correct copy of libfame-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } -#if defined (LIBFAME_MAJOR_VERSION) && defined (LIBFAME_MINOR_VERSION) && defined (LIBFAME_MICRO_VERSION) - else if ((libfame_major_version != LIBFAME_MAJOR_VERSION) || - (libfame_minor_version != LIBFAME_MINOR_VERSION) || - (libfame_micro_version != LIBFAME_MICRO_VERSION)) - { - printf("*** libfame header files (version %d.%d.%d) do not match\n", - LIBFAME_MAJOR_VERSION, LIBFAME_MINOR_VERSION, LIBFAME_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - libfame_major_version, libfame_minor_version, libfame_micro_version); - } -#endif /* defined (LIBFAME_MAJOR_VERSION) ... */ - else - { - if ((libfame_major_version > major) || - ((libfame_major_version == major) && (libfame_minor_version > minor)) || - ((libfame_major_version == major) && (libfame_minor_version == minor) && (libfame_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of libfame (%d.%d.%d) was found.\n", - libfame_major_version, libfame_minor_version, libfame_micro_version); - printf("*** You need a version of libfame newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** libfame is always available from http://www-eleves.enst-bretagne.fr/~chappeli/fame\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the libfame-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of libfame, but you can also set the LIBFAME_CONFIG environment to point to the\n"); - printf("*** correct copy of libfame-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_libfame=yes, - AC_TRY_LINK([ -#include <fame.h> -#include <stdio.h> -], [ return 0; ],, no_libfame=yes)) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_libfame" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$LIBFAME_CONFIG" = "no" ; then - echo "*** The libfame-config script installed by libfame could not be found" - echo "*** If libfame was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the LIBFAME_CONFIG environment variable to the" - echo "*** full path to libfame-config." - else - if test -f conf.libfametest ; then - : - else - echo "*** Could not run libfame test program, checking why..." - CFLAGS="$CFLAGS $LIBFAME_CFLAGS" - LIBS="$LIBS $LIBFAME_LIBS" - AC_TRY_LINK([ -#include <fame.h> -#include <stdio.h> -], [ return ((libfame_major_version) || (libfame_minor_version) || (libfame_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding libfame or finding the wrong" - echo "*** version of LIBFAME. If it is not finding libfame, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means libfame was incorrectly installed" - echo "*** or that you have moved libfame since it was installed. In the latter case, you" - echo "*** may want to edit the libfame-config script: $LIBFAME_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - ifelse([$3], , :, [$3]) - fi - - AC_SUBST(LIBFAME_CFLAGS) - AC_SUBST(LIBFAME_LIBS) - rm -f conf.libfametest -]) diff --git a/m4/macosx.m4 b/m4/macosx.m4 new file mode 100644 index 000000000..0151b41e9 --- /dev/null +++ b/m4/macosx.m4 @@ -0,0 +1,43 @@ +AC_DEFUN([MACOSX_UNIVERSAL_BINARIES], [ + AC_ARG_ENABLE([macosx-universal], + AS_HELP_STRING([--enable-macosx-universal], [build universal binaries for Mac OS X)]), + [], [enable_macosx_universal="no"]) + if test x"$enable_macosx_universal" != x"no" ; then + case "$host_os" in + *darwin*) + dnl x64_64 and ppc64 binaries could also be built, but there is no + dnl version of Mac OS X currently shipping that can run them, so + dnl do not enable them by default for now. + if test x"$enable_macosx_universal" = x"yes" ; then + UNIVERSAL_ARCHES="i386 ppc" + else + UNIVERSAL_ARCHES=`echo "$enable_macosx_universal" | sed -e 's/,/ /g'` + fi + ;; + *) + AC_MSG_ERROR([Universal binaries can only be built on Darwin]) + ;; + esac + AC_SUBST(UNIVERSAL_ARCHES) + + CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk" + LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" + + if test x"$UNIVERSAL_ARCHES" != x"" ; then + # Forcibly disable dependency tracking for Universal builds, because -M + # does not work with multiple -arch arguments on the gcc command-line. + ac_tool_warned=yes + cross_compiling=yes + enable_dependency_tracking=no + 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]) + for arch in $UNIVERSAL_ARCHES ; do + UNIVERSAL_CFLAGS="$UNIVERSAL_CFLAGS -arch $arch" + UNIVERSAL_LDFLAGS="$UNIVERSAL_LDFLAGS -arch $arch" + done + fi + fi + AM_CONDITIONAL([MACOSX_UNIVERSAL_BINARY], [test x"$enable_macosx_universal" = x"yes"]) +])dnl MACOSX_UNIVERSAL_BINARIES diff --git a/m4/objc.m4 b/m4/objc.m4 new file mode 100644 index 000000000..73dd8b6a0 --- /dev/null +++ b/m4/objc.m4 @@ -0,0 +1,253 @@ +# Extracted from autoconf 2.61 to obtain Objective C macros. +# Only expand if the version of autoconf in use doesn't have the macro itself. +m4_ifdef([AC_PROG_OBJC], [], [ + +# This file is part of Autoconf. -*- Autoconf -*- +# Programming languages support. +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Akim Demaille, Paul Eggert, +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + +# ------------------------------ # +# 1d. The Objective C language. # +# ------------------------------ # + + +# AC_LANG(Objective C) +# -------------------- +m4_define([AC_LANG(Objective C)], +[ac_ext=m +ac_cpp='$OBJCPP $CPPFLAGS' +ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' +ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' +ac_compiler_gnu=$ac_cv_objc_compiler_gnu +]) + + +# AC_LANG_OBJC +# ------------ +AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)]) + + +# _AC_LANG_ABBREV(Objective C) +# ---------------------------- +m4_define([_AC_LANG_ABBREV(Objective C)], [objc]) + + +# _AC_LANG_PREFIX(Objective C) +# ---------------------------- +m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC]) + + +# ------------------------- # +# 2d. Objective C sources. # +# ------------------------- # + +# AC_LANG_SOURCE(Objective C)(BODY) +# --------------------------------- +m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)]) + + +# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY]) +# ------------------------------------------------ +m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)]) + + +# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION) +# --------------------------------------------- +m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)]) + + +# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION) +# -------------------------------------------- +m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)]) + + +# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION) +# ----------------------------------------------------------- +m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)]) + + +# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION) +# --------------------------------------------------- +m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)]) + + +# ------------------------------ # +# 3d. The Objective C compiler. # +# ------------------------------ # + +# AC_LANG_PREPROC(Objective C) +# ---------------------------- +# Find the Objective C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. +m4_defun([AC_LANG_PREPROC(Objective C)], +[AC_REQUIRE([AC_PROG_OBJCPP])]) + + +# AC_PROG_OBJCPP +# -------------- +# Find a working Objective C preprocessor. +AC_DEFUN([AC_PROG_OBJCPP], +[AC_REQUIRE([AC_PROG_OBJC])dnl +AC_ARG_VAR([OBJCPP], [Objective C preprocessor])dnl +_AC_ARG_VAR_CPPFLAGS()dnl +AC_LANG_PUSH(Objective C)dnl +AC_MSG_CHECKING([how to run the Objective C preprocessor]) +if test -z "$OBJCPP"; then + AC_CACHE_VAL(ac_cv_prog_OBJCPP, + [dnl + # Double quotes because OBJCPP needs to be expanded + for OBJCPP in "$OBJC -E" "/lib/cpp" + do + _AC_PROG_PREPROC_WORKS_IFELSE([break]) + done + ac_cv_prog_OBJCPP=$OBJCPP + ])dnl + OBJCPP=$ac_cv_prog_OBJCPP +else + ac_cv_prog_OBJCPP=$OBJCPP +fi +AC_MSG_RESULT([$OBJCPP]) +_AC_PROG_PREPROC_WORKS_IFELSE([], + [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])]) +AC_SUBST(OBJCPP)dnl +AC_LANG_POP(Objective C)dnl +])# AC_PROG_OBJCPP + + +# AC_LANG_COMPILER(Objective C) +# ----------------------------- +# Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. +m4_defun([AC_LANG_COMPILER(Objective C)], +[AC_REQUIRE([AC_PROG_OBJC])]) + + + +# AC_PROG_OBJC([LIST-OF-COMPILERS]) +# --------------------------------- +# LIST-OF-COMPILERS is a space separated list of Objective C compilers to +# search for (if not specified, a default list is used). This just gives +# the user an opportunity to specify an alternative search list for the +# Objective C compiler. +# objcc StepStone Objective-C compiler (also "standard" name for OBJC) +# objc David Stes' POC. If you installed this, you likely want it. +# cc Native C compiler (for instance, Apple). +# CC You never know. +AN_MAKEVAR([OBJC], [AC_PROG_OBJC]) +AN_PROGRAM([objcc], [AC_PROG_OBJC]) +AN_PROGRAM([objc], [AC_PROG_OBJC]) +AC_DEFUN([AC_PROG_OBJC], +[AC_LANG_PUSH(Objective C)dnl +AC_ARG_VAR([OBJC], [Objective C compiler command])dnl +AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +dnl _AC_ARG_VAR_LIBS()dnl +_AC_ARG_VAR_CPPFLAGS()dnl +_AC_ARG_VAR_PRECIOUS([OBJC])dnl +AC_CHECK_TOOLS(OBJC, + [m4_default([$1], [gcc objcc objc cc CC])], + gcc) +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD +ac_compiler=`set X $ac_compile; echo $[2]` +_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD]) + +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +_AC_LANG_COMPILER_GNU +GOBJC=`test $ac_compiler_gnu = yes && echo yes` +_AC_PROG_OBJC_G +AC_LANG_POP(Objective C)dnl +])# AC_PROG_OBJC + + +# _AC_PROG_OBJC_G +# --------------- +# Check whether -g works, even if OBJCFLAGS is set, in case the package +# plays around with OBJCFLAGS (such as to build both debugging and +# normal versions of a library), tasteless as that idea is. +# Don't consider -g to work if it generates warnings when plain compiles don't. +m4_define([_AC_PROG_OBJC_G], +[ac_test_OBJCFLAGS=${OBJCFLAGS+set} +ac_save_OBJCFLAGS=$OBJCFLAGS +AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g, + [ac_save_objc_werror_flag=$ac_objc_werror_flag + ac_objc_werror_flag=yes + ac_cv_prog_objc_g=no + OBJCFLAGS="-g" + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [ac_cv_prog_objc_g=yes], + [OBJCFLAGS="" + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [], + [ac_objc_werror_flag=$ac_save_objc_werror_flag + OBJCFLAGS="-g" + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [ac_cv_prog_objc_g=yes])])]) + ac_objc_werror_flag=$ac_save_objc_werror_flag]) +if test "$ac_test_OBJCFLAGS" = set; then + OBJCFLAGS=$ac_save_OBJCFLAGS +elif test $ac_cv_prog_objc_g = yes; then + if test "$GOBJC" = yes; then + OBJCFLAGS="-g -O2" + else + OBJCFLAGS="-g" + fi +else + if test "$GOBJC" = yes; then + OBJCFLAGS="-O2" + else + OBJCFLAGS= + fi +fi[]dnl +])# _AC_PROG_OBJC_G +])dnl m4_ifdef([AC_PROG_OBJC]) diff --git a/m4/opengl.m4 b/m4/opengl.m4 deleted file mode 100644 index 2c12949d9..000000000 --- a/m4/opengl.m4 +++ /dev/null @@ -1,74 +0,0 @@ -dnl -dnl Check for OpenGL & GLU -dnl -dnl AM_PATH_OPENGL([ACTION IF FOUND [, ACTION IF NOT FOUND]]) -dnl - -AC_DEFUN([AM_PATH_OPENGL], [ - - AC_ARG_ENABLE(opengl, AS_HELP_STRING([--disable-opengl], [do not build OpenGL plugin]), - [enableopengl=$enableval], - [enableopengl="yes"] - ) - AC_ARG_ENABLE(glu, AS_HELP_STRING([--disable-glu], [build OpenGL plugin without GLU (no verbose errors)]), - [enableglu=$enableval], - [enableglu="yes"] - ) - - if test x$enableopengl = "xyes"; then - AC_CHECK_LIB(GL, glBegin, - [AC_CHECK_LIB(m, tan, - [AC_CHECK_HEADER(GL/gl.h, - [ac_have_opengl="yes" - OPENGL_LIBS="-lGL -lm" - AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) - dnl - dnl need to check with some test if this linking with -lGLU actually works... - dnl check for GLU - dnl - if test x$enableglu = "xyes"; then - AC_CHECK_LIB(GLU, gluPerspective, - [AC_CHECK_HEADER(GL/glu.h, - [AC_MSG_CHECKING([if GLU is sane]) - ac_save_LIBS="$LIBS" - LIBS="$X_LIBS $XPRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h> -#include <GL/glu.h>]], [[ gluPerspective(45.0f,1.33f,1.0f,1000.0f); glBegin(GL_POINTS); glEnd(); return 0 ]])], - [ ac_have_glu="yes" - GLU_LIBS="-lGLU" - AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available]) - AC_MSG_RESULT(yes)], - [ AC_MSG_RESULT(no) - echo "*** GLU doesn't link with GL; GLU is disabled ***"]) - LIBS="$ac_save_LIBS"] - )], - [], - [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS] - ) - fi - ] - )], - [], - [$X_LIBS $X_PRE_LIBS -lGL -lm $X_EXTRA_LIBS] - )], - [], - [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS] - ) - if test x$ac_have_opengl = "xyes"; then - ac_use_opengl=yes - fi - fi - - AC_SUBST(OPENGL_CFLAGS) - AC_SUBST(OPENGL_LIBS) - AC_SUBST(GLU_LIBS) - AM_CONDITIONAL(HAVE_OPENGL, [test x$ac_use_opengl = "xyes"]) - - dnl result - if test x$ac_use_opengl = "xyes"; then - ifelse([$1], , :, [$1]) - else - ifelse([$2], , :, [$2]) - fi - -]) diff --git a/m4/optimizations.m4 b/m4/optimizations.m4 deleted file mode 100644 index a1f2f2f00..000000000 --- a/m4/optimizations.m4 +++ /dev/null @@ -1,252 +0,0 @@ -dnl -dnl M4 macro to add support for extra optimizations -dnl -dnl It understand --enable/--disable-optimizations . -dnl when optimizations are disabled, it does not touch cflags -dnl -dnl Note: always disable while crosscompiling -dnl - -AC_DEFUN([AC_OPTIMIZATIONS], [ - AC_ARG_ENABLE([optimizations], - AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable])) - - if test "x$enable_optimizations" != "xno"; then - INLINE_FUNCTIONS=-finline-functions - - if test "$GCC" = yes; then - dnl - dnl check cflags not supported by all gcc versions - AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="") - AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="") - dnl - dnl gcc 3.1 uses the -f version - dnl - AC_TRY_CFLAGS("-falign-functions=4", f_af="-falign-functions=4", - f_af="-malign-functions=4") - AC_TRY_CFLAGS("-falign-loops=4", f_al="-falign-loops=4", - f_al="-malign-loops=4") - AC_TRY_CFLAGS("-falign-jumps=4", f_aj="-falign-jumps=4", - f_aj="-malign-jumps=4") - dnl - dnl Check for some optimization disabling - dnl needed for win32 code - dnl - AC_TRY_CFLAGS("-fno-omit-frame-pointer", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-omit-frame-pointer",) - AC_TRY_CFLAGS("-fno-inline-functions", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-inline-functions",) - AC_TRY_CFLAGS("-fno-rename-registers", W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-rename-registers",) - AC_SUBST(W32_NO_OPTIMIZE) - dnl - dnl Multipass compilation - dnl - AC_TRY_CFLAGS("-fprofile-arcs", PASS1_CFLAGS="-fprofile_arcs $PASS1_CFLAGS",) - AC_TRY_CFLAGS("-fbranch-probabilities", PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS",) - AC_SUBST(PASS1_CFLAGS) - AC_SUBST(PASS2_CFLAGS) - dnl - dnl Warnings - dnl - CFLAGS="-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes $CFLAGS" - CFLAGS="-Wnested-externs -Wcast-align $CFLAGS" - dnl some combinations of gcc+glibc produce useless warnings on memset - dnl when compiling with -Wpointer-arith, so we check for this first - AC_MSG_CHECKING(for sane -Wpointer-arith) - SAVE_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wpointer-arith -Werror $CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[int a; memset(&a, 0, sizeof(int));]])], - [AC_MSG_RESULT(yes); CFLAGS="-Wpointer-arith $SAVE_CFLAGS"], - [AC_MSG_RESULT(no); CFLAGS="$SAVE_CFLAGS"]); - - dnl gcc 3.3.5 (at least) is known to be buggy wrt optimisation and - dnl -finline-functions. Use -fno-inline-functions for gcc < 3.4.0. - - AC_MSG_CHECKING(for gcc 3.4.0 or later) - newGCC="`"$CC" -dumpversion | - awk -F. '{ if ((@S|@1 * 10000 + @S|@2 * 100 + @S|@3) >= 30400) { print "yes" } }' - `" - AC_MSG_RESULT(${newGCC:-no - assuming bugginess in -finline-functions}) - test "$newGCC" = yes || INLINE_FUNCTIONS=-fno-inline-functions - fi - - dnl Flags not supported by all *cc* variants - AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="") - - CFLAGS="$wall ${CFLAGS}" - DEBUG_CFLAGS="$wall ${DEBUG_CFLAGS}" - - case "$host_or_hostalias" in - i?86-* | k?-* | athlon-* | pentium*) - if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then - - if test "$GCC" = yes; then - dnl Check for gcc cpu optimization support - AC_TRY_CFLAGS("-mtune=i386", - sarchopt="-mtune", - 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 - CFLAGS="-O3 -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS" - - DEBUG_CFLAGS="-O $DEBUG_CFLAGS" - - if test x"$sarchopt" != "xno"; then - archopt_val= - - case "$host_or_hostalias" in - i386-*) - archopt_val="i386" ;; - i486-*) - archopt_val="i486" ;; - i586-*) - archopt_val="pentium" - ;; - pentium-mmx-*) - archopt_val="pentium-mmx" - ;; - pentiumpro-* | pentium2-* | i686-*) - archopt_val="pentiumpro" - 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*) - archopt_val="$k7cpu" - ;; - VIAEzra) - archopt_val="c3" - ;; - esac - fi - fi - ;; - k6-2-* | k6-3-*) - archopt_val="k6-2" - ;; - k6-*) - archopt_val="k6" - ;; - pentium3-*) - archopt_val="pentium3" - ;; - pentium4-*) - archopt_val="pentium4" - ;; - athlon-4-* | athlon-xp-* | athlon-mp-*) - archopt_val="athlon-4" - ;; - k7-* | athlon-tbird-* | athlon-*) - archopt_val="athlon" - ;; - - esac - if test x"$archopt_val" != x; then - CFLAGS="$sarchopt=$archopt_val $CFLAGS" - DEBUG_CFLAGS="$sarchopt=$archopt_val $DEBUG_CFLAGS" - fi - fi - else - dnl we have the Intel compiler - CFLAGS="-unroll -ipo -ipo_obj -O3 $CFLAGS" - PASS1_CFLAGS="-prof_genx -prof_dir \$(PWD)/\$(top_builddir)/ $PASS1_CFLAGS" - PASS2_CFLAGS="-prof_use -prof_dir \$(PWD)/\$(top_builddir)/ $PASS2_CFLAGS" - AC_SUBST(PASS1_CFLAGS) - AC_SUBST(PASS2_CFLAGS) - fi - - else - dnl add x86 specific cc CFLAGS - CFLAGS="-O $CFLAGS" - DEBUG_CFLAGS="-O $DEBUG_CFLAGS" - AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation]) - fi - ;; - alphaev56-*) - CFLAGS="-O3 -mcpu=ev56 -mieee $CFLAGS" - DEBUG_CFLAGS="-O3 -mcpu=ev56 -mieee $DEBUG_CFLAGS" - ;; - alpha*) - CFLAGS="-O3 -mieee $CFLAGS" - DEBUG_CFLAGS="-O3 -mieee $DEBUG_CFLAGS" - ;; - *darwin*) - CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS -no-cpp-precomp -D_INTL_REDIRECT_MACROS $CFLAGS" - DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS" - ;; - ppc-*-linux* | powerpc-*) - CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS" - DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS" - ;; - sparc*-*-linux*) - CFLAGS="-O3 $cpu_cflags $INLINE_FUNCTIONS $CFLAGS" - DEBUG_CFLAGS="-O $cpu_cflags $INLINE_FUNCTIONS $DEBUG_CFLAGS" - - case `uname -m` in - sparc) - cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;; - sparc64) - cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc" ;; - esac - ;; - 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) - case `$CC --version 2>/dev/null` in - 1.*|2.*) - # -mcpu=ultrasparc triggers a GCC 2.95.x compiler bug when - # compiling video_out.c: - # gcc: Internal compiler error: program cc1 got fatal signal 11 - # avoid -mcpu=ultrasparc with gcc 2.* - cpu_cflags="-mcpu=v8 -mtune=ultrasparc" - ;; - *) - # GCC 3 or newer should have no problem with -mcpu=ultrasparc - cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc" - ;; - esac - ;; - esac - cc_optimize_cflags="-O3 $cpu_cflags $INLINE_FUNCTIONS" - cc_debug_cflags="-O $cpu_cflags $INLINE_FUNCTIONS" - else - case `uname -m` in - sun4c) cpu_cflags="-xarch=v7" ;; - sun4m) cpu_cflags="-xarch=v8" ;; - sun4u) cpu_cflags="-xarch=v8plusa" ;; - esac - cc_optimize_cflags="-fast $cpu_cflags -xCC" - cc_debug_cflags="-O" - fi - - CFLAGS="$cc_optimize_cflags $CFLAGS" - DEBUG_CFLAGS="$cc_debug_cflags $DEBUG_CFLAGS" - ;; - x86_64-*) - CFLAGS="-O3 -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS" - DEBUG_CFLAGS="-g $DEBUG_CFLAGS" - ;; - armv4l-*-linux*) - CFLAGS="-O2 -fsigned-char -ffast-math -mcpu=strongarm1100 -fomit-frame-pointer -fthread-jumps -fregmove $CFLAGS" - dnl CFLAGS="-O1 -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 $INLINE_FUNCTIONS -fsigned-char -fomit-frame-pointer -march=armv4 -mtune=strongarm $CFLAGS" - DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS" - ;; - esac - fi -]) - -dnl Kate modeline: leave at the end -dnl kate: indent-width 2; replace-trailing-space-save 1; space-indent 1; backspace-indents 1; diff --git a/m4/package.m4 b/m4/package.m4 new file mode 100644 index 000000000..0ee28830a --- /dev/null +++ b/m4/package.m4 @@ -0,0 +1,72 @@ +dnl _ACX_VERSION_PARSE(version) +AC_DEFUN([_ACX_VERSION_PARSE], [`echo $1 | perl -e 'my $v = <>; chomp $v; +my @v = split(" ", $v); $v = $v[[@S|@#v]]; $v =~ s/[[^0-9.]].*$//; @v = split (/\./, $v); +push @v, 0 while $[#v] < 2; print $v[[0]] * 10000 + $v[[1]] * 100 + $v[[2]], "\n"'`]) + +dnl ACX_VERSION_CHECK(required, actual) +AC_DEFUN([ACX_VERSION_CHECK], [ + required_version=ifelse([$1], , [0.0.0], [$1]) + required_version_parsed=_ACX_VERSION_PARSE([$required_version]) + actual_version=ifelse([$2], , [0.0.0], [$2]) + actual_version_parsed=_ACX_VERSION_PARSE([$actual_version]) + if test $required_version_parsed -le $actual_version_parsed; then + ifelse([$3], , [:], [$3]) + else + ifelse([$4], , [:], [$4]) + fi +]) + +AC_DEFUN([ASX_TR_LOWER], [m4_translit([[$1]], [ABCDEFGHIJKLMNOPQRSTUVWXYZ], [abcdefghijklmnopqrstuvwxyz])]) + +dnl ACX_PACKAGE_CHECK(VARIABLE-PREFIX, MINIMUM-VERSION, CONFIG-SCRIPT, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +AC_DEFUN([ACX_PACKAGE_CHECK], [ + AC_ARG_VAR($1_CONFIG, [Full path to $3]) + AC_ARG_WITH(ASX_TR_LOWER([$1][-prefix]), + [AS_HELP_STRING(ASX_TR_LOWER([--with-][$1][-prefix])[=PATH], [prefix where $3 is installed (optional)])], + [package_config_prefix="$withval"], [package_config_prefix=""]) + AC_ARG_WITH(ASX_TR_LOWER([$1][-exec-prefix]), + [AS_HELP_STRING(ASX_TR_LOWER([--with-][$1][-exec-prefix])[=PATH], [exec prefix where $3 is installed (optional)])], + [package_config_exec_prefix="$withval"], [package_config_exec_prefix=""]) + package_config_args="" + if test x"$package_config_exec_prefix" != x""; then + package_config_args="$package_config_args --exec-prefix=$package_config_exec_prefix" + test x"${$1_CONFIG+set}" != x"set" && $1_CONFIG="$package_config_exec_prefix/bin/$3" + fi + if test x"$package_config_prefix" != x""; then + package_config_args="$package_config_args --prefix=$package_config_prefix" + test x"${$1_CONFIG+set}" != x"set" && $1_CONFIG="$package_config_prefix/bin/$3" + fi + + min_package_version=ifelse([$2], , [0.0.0], [$2]) + AC_PATH_TOOL([$1_CONFIG], [$3], [no]) + AC_MSG_CHECKING([for $1 version >= $min_package_version]) + if test x"$$1_CONFIG" = x"no"; then + AC_MSG_RESULT([unknown]) + AC_MSG_NOTICE([The $3 script installed by $1 could not be found. +*** If $1 was installed in PREFIX, make sure PREFIX/bin is in your path, or +*** set the $1_CONFIG environment variable to the full path to the program.]) + else + [$1][_CFLAGS]="`$$1_CONFIG $package_config_args --cflags`" + [$1][_LIBS]="`$$1_CONFIG $package_config_args --libs`" + [$1][_VERSION]="`$$1_CONFIG $package_config_args --version`" + ACX_VERSION_CHECK([$min_package_version], [$[$1][_VERSION]], + [package_version_ok=yes; AC_MSG_RESULT([yes -- $[$1][_VERSION]])], + [[$1][_CFLAGS]="" [$1][_LIBS]=""; AC_MSG_RESULT([no -- $[$1][_VERSION]]) + AC_MSG_NOTICE([If you have already installed a sufficiently new version, +*** this error probably means that the wrong copy of the $3 +*** shell script is being found. The easiest way to fix this is to remove the +*** old version, but you can also set the $1_CONFIG environment +*** variable to point to the correct copy. In this case, you will have to +*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf +*** so that the correct libraries are found at run-time.])]) + fi + + if test x"$package_version_ok" = x"yes"; then + ifelse([$4], , [:], [$4]) + else + ifelse([$5], , [:], [$5]) + fi + AC_SUBST([$1][_CFLAGS]) + AC_SUBST([$1][_LIBS]) +]) @@ -136,7 +136,8 @@ installed software in a non-standard prefix. _PKG_TEXT ])], - [$4]) + [AC_MSG_RESULT([no]) + $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it @@ -146,7 +147,8 @@ path to pkg-config. _PKG_TEXT To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], - [$4]) + [AC_MSG_RESULT([no]) + $4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS diff --git a/m4/programs.m4 b/m4/programs.m4 new file mode 100644 index 000000000..493888a0a --- /dev/null +++ b/m4/programs.m4 @@ -0,0 +1,124 @@ +dnl AC_PROG_GMSGFMT_PLURAL +dnl ---------------------- +dnl Validate the GMSGFMT program found by gettext.m4; reject old versions +dnl of GNU msgfmt that do not support the "msgid_plural" extension. +AC_DEFUN([AC_PROG_GMSGFMT_PLURAL], + [dnl AC_REQUIRE(AM_GNU_GETTEXT) + + if test "$GMSGFMT" != ":"; then + AC_MSG_CHECKING([for plural forms in GNU msgfmt]) + + changequote(,)dnl We use [ and ] in in .po test input + + dnl If the GNU msgfmt does not accept msgid_plural we define it + dnl as : so that the Makefiles still can work. + cat >conftest.po <<_ACEOF +msgid "channel" +msgid_plural "channels" +msgstr[0] "canal" +msgstr[1] "canal" + +_ACEOF + changequote([,])dnl + + if $GMSGFMT -o /dev/null conftest.po >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + AC_MSG_RESULT( + [found GNU msgfmt program is too old, it does not support plural forms; ignore it]) + GMSGFMT=":" + fi + rm -f conftest.po + fi +])dnl AC_PROG_GMSGFMT_PLURAL + + +# AC_PROG_LIBTOOL_SANITYCHECK +# ---------------------- +# Default configuration of libtool on solaris produces non-working +# plugin modules, when gcc is used as compiler, and gcc does not +# use gnu-ld +AC_DEFUN([AC_PROG_LIBTOOL_SANITYCHECK], + [dnl AC_REQUIRE(AC_PROG_CC) + dnl AC_REQUIRE(AC_PROG_LD) + dnl AC_REQUIRE(AC_PROG_LIBTOOL) + + case $host in + *-*-solaris*) + if test "$GCC" = yes && test "$with_gnu_ld" != yes; then + AC_MSG_CHECKING([if libtool can build working modules]) + cat > conftest1.c <<_ACEOF +#undef NDEBUG +#include <assert.h> +int shlib_func(long long a, long long b) { + assert(b); + switch (a&3) { + case 0: return a/b; + case 1: return a%b; + case 2: return (unsigned long long)a/b; + case 3: return (unsigned long long)a%b; + } +} +_ACEOF + + cat > conftest2.c <<_ACEOF +#include <dlfcn.h> +int main(){ + void *dl = dlopen(".libs/libconftest.so", RTLD_NOW); + if (!dl) printf("%s\n", dlerror()); + exit(dl ? 0 : 1); +} +_ACEOF + + if ./libtool $CC -c conftest1.c >/dev/null 2>&1 && \ + ./libtool $CC -o libconftest.la conftest1.lo \ + -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \ + ./libtool $CC -o conftest2 conftest2.c -ldl >/dev/null 2>&1 + then + if ./conftest2 >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + else + dnl typical problem: dlopen'ed module not self contained, because + dnl it wasn't linked with -lgcc + AC_MSG_RESULT(no) + if grep '^archive_cmds=.*$LD -G' libtool >/dev/null; then + AC_MSG_CHECKING([if libtool can be fixed]) + + dnl first try to update gcc2's spec file to add the + dnl gcc3 -mimpure-text flag + + libtool_specs="" + + if $CC -dumpspecs | grep -- '-G -dy -z text' >/dev/null; then + $CC -dumpspecs | \ + sed 's/-G -dy -z text/-G -dy %{!mimpure-text:-z text}/g' \ + > gcc-libtool-specs + libtool_specs=" -specs=`pwd`/gcc-libtool-specs" + fi + + sed -e "s,\$LD -G,\$CC${libtool_specs} -shared -mimpure-text,g" \ + -e 's/ -M / -Wl,-M,/' libtool >libtool-fixed + chmod +x libtool-fixed + if ./libtool-fixed $CC -o libconftest.la conftest1.lo \ + -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \ + ./conftest2 >/dev/null 2>&1; then + + dnl the fixed libtool works + AC_MSG_RESULT(yes) + mv -f libtool-fixed libtool + + else + AC_MSG_RESULT(no) + fi + fi + fi + else + AC_MSG_RESULT(no) + fi + rm -f conftest1.c conftest1.lo conftest1.o conftest2.c \ + libconftest.la conftest libtool-fixed + rm -rf .libs + fi ;; + esac +])# AC_PROG_LIBTOOL_SANITYCHECK diff --git a/m4/summary.m4 b/m4/summary.m4 new file mode 100644 index 000000000..94374017a --- /dev/null +++ b/m4/summary.m4 @@ -0,0 +1,354 @@ +AC_DEFUN([XINE_LIB_SUMMARY], [ + dnl --------------------------------------------- + dnl Some infos: + dnl --------------------------------------------- + + echo "xine-lib summary:" + echo "----------------" + + dnl Input + echo " * input plugins:" + echo " - file - net" + echo " - stdin_fifo - rtp" + echo " - http - mms" + echo " - pnm - rtsp" + if test x"$enable_vcd" != x"no"; then + if test x"$enable_vcdo" != x"no"; then + echo " - vcdo - vcd" + else + echo " - vcd" + fi + fi + if test x"$with_external_dvdnav" != x"no"; then + echo " - dvd (external libs)" + else + echo " - dvd (*INTERNAL* libs)" + fi + test x"$enable_vdr" != x"no" && echo " - vdr" + test x"$have_dvb" = x"yes" && echo " - dvb" + test x"$have_gnomevfs" = x"yes" && echo " - gnome-vfs" + test x"$have_samba" = x"yes" && echo " - smb" + test x"$have_v4l" = x"yes" && echo " - v4l" + echo " - cdda" + echo "" + + dnl Demuxers + echo " * demultiplexer plugins:" + echo " - avi - mpeg" + echo " - mpeg_block - mpeg_audio" + echo " - mpeg_elem - mpeg_pes" + echo " - mpeg_ts - qt/mpeg-4" + echo " - film - roq" + echo " - fli - smjpeg" + echo " - idcin - wav" + echo " - wc3 mve - voc" + echo " - vqa - aiff" + echo " - cdda - snd/au" + echo " - yuv4mpeg2 - real/realaudio" + echo " - ea wve - raw dv" + echo " - interplay mve - psx str" + echo " - ws aud - pva" + echo " - vox - nsf" + echo " - nsv - 4xm" + echo " - FLAC - aac" + echo " - iff - matroska" + echo " - vmd - flv" + if test x"$enable_a52dec" != x"no"; then + if test x"$have_external_a52dec" = x"yes"; then + echo " - ac3 (external library)" + else + echo " - ac3 (*INTERNAL* library)" + fi + fi + test x"$enable_asf" != x"no" && echo " - asf" + test x"$enable_nosefart" != xno && echo " - Nosefart (NSF)" + test x"$enable_mng" != x"no" && echo " - mng" + test x"$have_modplug" = x"yes" && echo " - mod" + test x"$have_libflac" = x"yes" && echo " - FLAC (with libFLAC)" + test x"$have_vorbis" = x"yes" && echo " - ogg" + test x"$have_wavpack" = x"yes" && echo " - WavPack" + echo "" + + dnl video decoders + echo " * video decoder plugins:" + echo " - MPEG 1,2 - Amiga Bitplane" + echo " - Raw RGB - Raw YUV" + test x"$have_dxr3" = x"yes" && echo " - dxr3_video" + test x"$have_gdkpixbuf" = x"yes" && echo " - gdk-pixbuf" + test x"$have_imagemagick" = x"yes" && echo " - image" + test x"$have_theora" = x"yes" && echo " - theora" + test x"$have_w32dll" = x"yes" && echo " - w32dll" + if test x"$with_external_ffmpeg" != x"no"; then + echo " - ffmpeg (external library)" + else + echo " - ffmpeg (*INTERNAL* library):" + echo " - MPEG-4 (ISO, Microsoft, DivX*, XviD)" + echo " - Creative YUV - Motion JPEG" + echo " - Cinepak - MS Video-1" + echo " - FLI/FLC - MS RLE" + echo " - Id RoQ - Id Cin" + echo " - Apple Graphics - Apple Video" + echo " - Apple Animation - Interplay Video" + echo " - Westwood VQA - Origin Xan" + echo " - H.263 - Intel Indeo 3" + echo " - SVQ1 - SVQ3" + echo " - Real Video 1.0 - Real Video 2.0" + echo " - 4X Video - Sierra Video" + echo " - Asus v1/v2 - HuffYUV" + echo " - On2 VP3 - DV" + echo " - 8BPS - Duck TrueMotion v1" + echo " - ATI VCR1 - Flash Video" + echo " - ZLIB - MSZH" + fi + echo "" + + dnl audio decoders + echo " * audio decoder plugins:" + echo " - GSM 06.10 - linear PCM" + test x"$enable_faad" != x"no" && echo " - faad" + test x"$enable_nosefart" != xno && echo " - Nosefart (NSF)" + test x"$have_libflac" = x"yes" && echo " - FLAC (with libFLAC)" + test x"$have_speex" = x"yes" && echo " - speex" + test x"$have_vorbis" = x"yes" && echo " - vorbis" + test x"$have_w32dll" = x"yes" && echo " - w32dll" + test x"$have_wavpack" = x"yes" && echo " - WavPack" + if test x"$enable_mad" != x"no"; then + if test x"$have_external_libmad" = x"yes"; then + echo " - MAD (MPG 1/2/3) (external library)" + else + echo " - MAD (MPG 1/2/3) (*INTERNAL* library)" + fi + fi + if test x"$enable_libdts" != x"no"; then + if test x"$have_external_dts" = x"yes"; then + echo " - DTS (external library)" + else + echo " - DTS (*INTERNAL* library)" + fi + fi + if test x"$enable_a52dec" != x"no"; then + if test x"$have_external_a52dec" = x"yes"; then + echo " - A52/ra-dnet (external library)" + else + echo " - A52/ra-dnet (*INTERNAL* library)" + fi + fi + if test x"$enable_musepack" != x"no"; then + if test x"$have_external_libmpcdec" = x"yes"; then + echo " - Musepack (external library)" + else + echo " - Musepack (*INTERNAL* library)" + fi + fi + if test x"$with_external_ffmpeg" = x"yes"; then + echo " - ffmpeg (external library)" + else + echo " - ffmpeg (*INTERNAL* library):" + echo " - Windows Media Audio v1/v2" + echo " - DV - logarithmic PCM" + echo " - 14k4 - 28k8" + echo " - MS ADPCM - IMA ADPCM" + echo " - XA ADPCM - Game DPCM/ADPCM" + echo " - Mace 3:13 - Mace 6:1" + echo " - FLAC" + fi + echo "" + + dnl spu decoders + echo " * subtitle decoder plugins:" + echo " - spu - spucc" + echo " - spucmml - sputext" + echo " - spudvb" + test x"$have_dxr3" = x"yes" && echo " - dxr3_spu" + echo "" + + dnl post plugins + echo " * post effect plugins:" + echo " * planar video effects:" + echo " - invert - expand" + echo " - eq - eq2" + echo " - boxblur - denoise3d" + echo " - unsharp - tvtime" + test x"$have_dvb" = x"yes" && echo " - vdr" + echo " * SFX:" + echo " - goom - oscope" + echo " - fftscope - mosaico" + echo "" + + dnl Video plugins + echo " * video driver plugins:" + if test x"$no_x" != x"yes"; then + echo " - XShm (X11 shared memory)" + if test x"$have_xv" = x"yes"; then + if test x"$have_xv_static" = x"yes"; then + echo " - Xv (XVideo *static*)" + else + echo " - Xv (XVideo *shared*)" + fi + fi + if test x"$have_xxmc" = x"yes"; then + if test x"$have_vldexts" = x"yes"; then + echo " - XxMC (XVideo extended motion compensation)" + else + echo " - XxMC (XVideo motion compensation - vld extensions DISABLED)" + fi + fi + if test x"$have_xvmc" = x"yes"; then + echo " - XvMC (XVideo motion compensation)" + fi + if test x"$have_opengl" = x"yes"; then + if test x"$have_glu" = x"yes"; then + echo " - OpenGL (with GLU support)" + else + echo " - OpenGL" + fi + fi + if test x"$have_sunfb" = x"yes"; then + if test x"$have_sundga" = x"yes"; then + echo " - PGX64 (for Sun XVR100/PGX64/PGX24 cards)" + echo " - PGX32 (for Sun PGX32 cards)" + fi + fi + fi + if test x"$have_xcb" = x"yes"; then + if test x"$have_xcbshm" = x"yes"; then + echo " - xcb-shm (X shared memory using XCB)" + fi + if test x"$have_xcbxv" = x"yes"; then + echo " - xcb-xv (XVideo using XCB)" + fi + fi + + + test x"$have_aalib" = x"yes" && echo " - aa (Ascii ART)" + test x"$have_caca" = x"yes" && echo " - caca (Color AsCii Art)" + test x"$have_directfb" = x"yes" && echo " - directfb (DirectFB driver)" + test x"$have_directx" = x"yes" && echo " - directx (DirectX video driver)" + test x"$have_fb" = x"yes" && echo " - fb (Linux framebuffer device)" + test x"$have_libstk" = x"yes" && echo " - stk (Libstk Set-top Toolkit)" + test x"$have_macosx_video" = x"yes" && echo " - Mac OS X OpenGL" + test x"$have_sdl" = x"yes" && echo " - sdl (Simple DirectMedia Layer)" + + + if test x"$have_dxr3" = x"yes"; then + if test x"$have_encoder" = x"yes"; then + echo " - dxr3 (Hollywood+ and Creative dxr3, both mpeg and non-mpeg video)" + else + echo " - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)" + fi + fi + if test x"$have_vidix" = x"yes"; then + echo $ECHO_N " - vidix (" + + if test x"$no_x" != x"yes"; then + echo $ECHO_N "X11" + if test x"$have_fb" = x"yes"; then + echo $ECHO_N " and " + fi + fi + + if test x"$have_fb" = x"yes"; then + echo $ECHO_N "framebuffer" + fi + + echo $ECHO_N " support" + + if test x"$enable_dha_kmod" != x"no"; then + echo " with dhahelper)" + else + echo ")" + fi + fi + + echo "" + + dnl Audio plugins + echo " * audio driver plugins:" + test x"$have_alsa" = x"yes" && echo " - alsa (ALSA - Advanced Linux Sound Architecture)" + test x"$have_coreaudio" = x"yes" && echo " - CoreAudio (Mac OS X audio driver)" + test x"$have_directx" = x"yes" && echo " - directx (DirectX audio driver)" + test x"$have_esound" = x"yes" && echo " - esd (Enlightened Sound Daemon)" + test x"$have_fusionsound" = x"yes" && echo " - fusionsound (FusionSound driver)" + test x"$am_cv_have_irixal" = x"yes" && echo " - irixal (Irix audio library)" + test x"$have_jack" = x"yes" && echo " - Jack" + test x"$have_oss" = x"yes" && echo " - oss (Open Sound System)" + test x"$have_pulseaudio" = x"yes" && echo " - pulseaudio (PulseAudio sound server)" + test x"$have_sunaudio" = x"yes" && echo " - sun (Sun audio interface)" + echo "---" + + + dnl --------------------------------------------- + dnl some user warnings + dnl --------------------------------------------- + + dnl some levels of variable expansion to get final install paths + final_libdir="`eval eval eval eval echo $libdir`" + final_bindir="`eval eval eval eval echo $bindir`" + + if test -r /etc/ld.so.conf && ! grep -x "$final_libdir" /etc/ld.so.conf >/dev/null ; then + if test "$final_libdir" != "/lib" -a "$final_libdir" != "/usr/lib" ; then + if ! echo "$LD_LIBRARY_PATH" | egrep "(:|^)$final_libdir(/?:|/?$)" >/dev/null ; then + echo + echo "****************************************************************" + echo "xine-lib will be installed to $final_libdir" + echo + echo "This path is not mentioned among the linker search paths in your" + echo "/etc/ld.so.conf. This means it is possible that xine-lib will" + echo "not be found when you try to compile or run a program using it." + echo "If this happens, you should add $final_libdir to" + echo "the environment variable LD_LIBRARY_PATH like that:" + echo + echo "export LD_LIBRARY_PATH=$final_libdir:\$LD_LIBRARY_PATH" + echo + echo "Alternatively you can add a line \"$final_libdir\"" + echo "to your /etc/ld.so.conf." + echo "****************************************************************" + echo + fi + fi + fi + + if ! echo "$PATH" | egrep "(:|^)$final_bindir(/?:|/?$)" >/dev/null ; then + echo + echo "****************************************************************" + echo "xine-config will be installed to $final_bindir" + echo + echo "This path is not in your search path. This means it is possible" + echo "that xine-config will not be found when you try to compile a" + echo "program using xine-lib. This will result in build failures." + echo "If this happens, you should add $final_bindir to" + echo "the environment variable PATH like that:" + echo + echo "export PATH=$final_bindir:\$PATH" + echo + echo "Note that this is only needed for compilation. It is not needed" + echo "to have xine-config in your search path at runtime. (Although" + echo "it will not cause any harm either.)" + echo "****************************************************************" + echo + fi + + dnl warn if no X11 plugins will be built + if test "x$no_x" = "xyes"; then + case $host in + *mingw*|*-cygwin) ;; + *-darwin*) ;; + *) + echo + echo "****************************************************************" + echo "WARNING! No X11 output plugins will be built." + echo + echo "For some reason, the requirements for building the X11 video" + echo "output plugins are not met. That means, that you will NOT be" + echo "able to use the resulting xine-lib to watch videos in a window" + echo "on any X11-based display (e.g. your desktop)." + echo + echo "If this is not what you want, provide the necessary X11 build" + echo "dependencies (usually done by installing a package called" + echo "XFree86-devel or similar) and run configure again." + echo "****************************************************************" + echo + ;; + esac + fi +]) diff --git a/m4/types.m4 b/m4/types.m4 new file mode 100644 index 000000000..bf13428cb --- /dev/null +++ b/m4/types.m4 @@ -0,0 +1,215 @@ +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], + [AC_CHECK_HEADER([inttypes.h],, + [if test ! -d $1; then mkdir $1; fi + AC_CHECK_HEADER([stdint.h], + [cat >$1/inttypes.h << EOF +#ifndef _INTTYPES_H +#define _INTTYPES_H +/* helper inttypes.h for people who do not have it on their system */ + +#include <stdint.h> +EOF + ], + [AC_COMPILE_CHECK_SIZEOF([char],[1]) + AC_COMPILE_CHECK_SIZEOF([short],[2]) + AC_COMPILE_CHECK_SIZEOF([int],[4]) + AC_COMPILE_CHECK_SIZEOF([long long],[8]) + cat >$1/inttypes.h << EOF +#ifndef _INTTYPES_H +#define _INTTYPES_H +/* default inttypes.h for people who do not have it on their system */ +#if (!defined __int8_t_defined) && (!defined __BIT_TYPES_DEFINED__) +#define __int8_t_defined +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed int int32_t; +#ifdef ARCH_X86 +typedef signed long long int64_t; +#endif +#endif +#if (!defined __uint8_t_defined) && (!defined _LINUX_TYPES_H) +#define __uint8_t_defined +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifdef ARCH_X86 +typedef unsigned long long uint64_t; +#endif +#endif +EOF + ]) + cat >>$1/inttypes.h << EOF + +#ifdef WIN32 +# define PRI64_PREFIX "I64" +#else +# define PRI64_PREFIX "l" +#endif + +#ifndef PRId8 +# define PRId8 "d" +#endif +#ifndef PRId16 +# define PRId16 "d" +#endif +#ifndef PRId32 +# define PRId32 "d" +#endif +#ifndef PRId64 +# define PRId64 PRI64_PREFIX "d" +#endif + +#ifndef PRIu8 +# define PRIu8 "u" +#endif +#ifndef PRIu16 +# define PRIu16 "u" +#endif +#ifndef PRIu32 +# define PRIu32 "u" +#endif +#ifndef PRIu64 +# define PRIu64 PRI64_PREFIX "u" +#endif + +#ifndef PRIx8 +# define PRIx8 "x" +#endif +#ifndef PRIx16 +# define PRIx16 "x" +#endif +#ifndef PRIx32 +# define PRIx32 "x" +#endif +#ifndef PRIx64 +# define PRIx64 PRI64_PREFIX "x" +#endif + +#ifndef PRIX8 +# define PRIX8 "X" +#endif +#ifndef PRIX16 +# define PRIX16 "X" +#endif +#ifndef PRIX32 +# define PRIX32 "X" +#endif +#ifndef PRIX64 +# define PRIX64 PRI64_PREFIX "X" +#endif + +#ifndef PRIdFAST8 +# define PRIdFAST8 "d" +#endif +#ifndef PRIdFAST16 +# define PRIdFAST16 "d" +#endif +#ifndef PRIdFAST32 +# define PRIdFAST32 "d" +#endif +#ifndef PRIdFAST64 +# define PRIdFAST64 "d" +#endif + +#ifndef PRIuFAST8 +# define PRIuFAST8 "u" +#endif +#ifndef PRIuFAST16 +# define PRIuFAST16 "u" +#endif +#ifndef PRIuFAST32 +# define PRIuFAST32 "u" +#endif +#ifndef PRIuFAST64 +# define PRIuFAST64 PRI64_PREFIX "u" +#endif + +#ifndef PRIxFAST8 +# define PRIxFAST8 "x" +#endif +#ifndef PRIxFAST16 +# define PRIxFAST16 "x" +#endif +#ifndef PRIxFAST32 +# define PRIxFAST32 "x" +#endif +#ifndef PRIxFAST64 +# define PRIxFAST64 PRI64_PREFIX "x" +#endif + +#ifndef SCNd8 +# define SCNd8 "hhd" +#endif +#ifndef SCNd16 +# define SCNd16 "hd" +#endif +#ifndef SCNd32 +# define SCNd32 "d" +#endif +#ifndef SCNd64 +# define SCNd64 PRI64_PREFIX "d" +#endif + +#ifndef SCNu8 +# define SCNu8 "hhu" +#endif +#ifndef SCNu16 +# define SCNu16 "hu" +#endif +#ifndef SCNu32 +# define SCNu32 "u" +#endif +#ifndef SCNu64 +# define SCNu64 PRI64_PREFIX "u" +#endif + +#ifndef PRIdMAX +# define PRIdMAX PRId64 +#endif +#ifndef PRIuMAX +# define PRIuMAX PRIu64 +#endif +#ifndef PRIxMAX +# define PRIxMAX PRIx64 +#endif +#ifndef SCNdMAX +# define SCNdMAX SCNd64 +#endif + +#endif +EOF + ])]) + + +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 <sys/types.h> + #include <sys/socket.h>]], + [[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 <sys/types.h> + #include <sys/socket.h>]], + [[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 +]) diff --git a/m4/video_out.m4 b/m4/video_out.m4 new file mode 100644 index 000000000..df782ff06 --- /dev/null +++ b/m4/video_out.m4 @@ -0,0 +1,502 @@ +dnl ----------------- +dnl Video out plugins +dnl ----------------- +AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ + dnl Setup defaults for the target operating system. For example, linuxfb 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 - dha_kmod is Linux only, but disabled by default + dnl - directx is Windows only + dnl - dxr3 is Linux only + dnl - Mac OS X video is Mac OS X only + dnl - OpenGL requires Xwindows + dnl - Vidix is FreeBSD and Linux only + dnl - XvMC and xxmc depend on Xv + + default_enable_aalib=enable + default_enable_dha_kmod=disable + default_enable_directfb=disable + default_enable_directx=disable + default_enable_dxr3=disable + default_enable_glu=enable + default_enable_linuxfb=disable + default_enable_macosx_video=disable + default_enable_opengl=enable + default_enable_vidix=disable + default_enable_xinerama=enable + default_enable_xvmc=enable + + default_with_caca=with + default_with_libstk=without + default_with_sdl=with + default_with_xcb=with + + case "$host_os" in + cygwin* | mingw*) + default_enable_directx=enable + ;; + + darwin*) + default_enable_macosx_video=enable + ;; + + freebsd*) + default_enable_vidix=enable + ;; + + linux*) + default_enable_dxr3=enable + default_enable_linuxfb=enable + default_enable_vidix=enable + enable_linux=yes + ;; + esac + + + dnl Ascii-Art + AC_ARG_ENABLE([aalib], + [AS_HELP_STRING([--enable-aalib], [enable support for AALIB])], + [test x"$enableval" != x"no" && enable_aalib="yes"], + [test $default_enable_aalib = disable && enable_aalib="no"]) + if test x"$enable_aalib" != x"no"; then + ACX_PACKAGE_CHECK([AALIB], [1.4], [aalib-config], [have_aalib=yes], [have_aalib=no]) + if test x"$enable_aalib" = x"yes" && test x"$have_aalib" != x"yes"; then + AC_MSG_ERROR([aalib support requested, but aalib not found]) + fi + fi + AM_CONDITIONAL([ENABLE_AA], [test x"$have_aalib" = x"yes"]) + + + dnl Color AsCii Art + AC_ARG_WITH([caca], + [AS_HELP_STRING([--with-caca], [enable support for CACA])], + [test x"$withval" != x"no" && with_caca="yes"], + [test $default_with_caca = without && with_caca=no]) + if test x"$with_caca" != x"no"; then + PKG_CHECK_MODULES([CACA], [caca cucul], [have_caca="yes"], [have_caca="no"]) + if test x"$with_caca" = x"yes" && test x"$have_caca" != x"yes"; then + AC_MSG_ERROR([CACA support requested, but libcaca 0.99 not found]) + fi + fi + AM_CONDITIONAL([ENABLE_CACA], [test x"$have_caca" = x"yes"]) + + + dnl dha (Linux only) + AC_ARG_ENABLE([dha-kmod], + [AS_HELP_STRING([--enable-dha-kmod], [build Linux DHA kernel module])], + [test x"$enableval" != x"no" && enable_dha_kmod="yes"], + [test $default_enable_dha_kmod = disable && enable_dha_kmod="no"]) + if test x"$enable_dha_kmod" != x"no"; then + AC_ARG_WITH([linux-path], + [AS_HELP_STRING([--with-linux-path=PATH], [where the linux sources are located])], + [linux_path="$withval"], [linux_path="/usr/src/linux"]) + LINUX_INCLUDE="-I$linux_path/include" + AC_SUBST(LINUX_INCLUDE) + AC_CHECK_PROG([MKNOD], [mknod], [mknod], [no]) + AC_CHECK_PROG([DEPMOD], [depmod], [depmod], [no], ["$PATH:/sbin"]) + fi + AM_CONDITIONAL([HAVE_LINUX], [test x"$enable_linux" = x"yes"]) + AM_CONDITIONAL([BUILD_DHA_KMOD], [test x"$enable_dha_kmod" != x"no"]) + + + dnl DirectFB + AC_ARG_ENABLE([directfb], + [AS_HELP_STRING([--enable-directfb], [enable use of DirectFB])], + [test x"$enableval" != x"no" && enable_directfb="yes"], + [test $default_enable_directfb = disable && enable_directfb="no"]) + if test "x$enable_directfb" = "xyes"; then + PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.22], [have_directfb=yes], [have_directfb=no]) + if test x"$enable_directfb" = x"yes" && test x"$have_directfb" != x"yes"; then + AC_MSG_ERROR([DirectFB support requested, but DirectFB not found]) + fi + fi + AM_CONDITIONAL([ENABLE_DIRECTFB], [test x"$have_directfb" = x"yes"]) + + + dnl DirectX (see directx.m4) + AM_PATH_DIRECTX + + + dnl dxr3 / hollywood plus card + AC_ARG_ENABLE([dxr3], + [AS_HELP_STRING([--enable-dxr3], [enable support for DXR3/HW+])], + [test x"$enableval" != x"no" && enable_dxr3="yes"], + [test $default_enable_dxr3 = disable && enable_dxr3="no"]) + if test x"$enable_dxr3" != x"no"; then + have_dxr3=yes + AC_MSG_RESULT([*** checking for a supported mpeg encoder]) + AC_CHECK_LIB([fame], [fame_open], + [AC_CHECK_HEADERS([fame.h], [have_libfame=yes], [have_libfame=no])], [have_libfame=no]) + if test x"$have_libfame" = x"yes"; then + have_encoder=yes + AC_DEFINE([HAVE_LIBFAME], 1, [Define this if you have libfame mpeg encoder installed (fame.sf.net)]) + ACX_PACKAGE_CHECK([LIBFAME], [0.8.10], [libfame-config], + [AC_DEFINE([HAVE_NEW_LIBFAME], 1, [Define this if you have libfame 0.8.10 or above])]) + fi + AC_CHECK_LIB([rte], [rte_init], + [AC_CHECK_HEADERS([rte.h], [have_librte=yes], [have_librte=no])], [have_librte=no]) + if test x"$have_librte" = x"yes"; then + have_encoder=yes + AC_MSG_WARN([this will probably only work with rte version 0.4!]) + AC_DEFINE([HAVE_LIBRTE], 1, [Define this if you have librte mpeg encoder installed (zapping.sf.net)]) + fi + if test "$have_encoder" = "yes"; then + AC_MSG_RESULT([*** found one or more external mpeg encoders]) + else + AC_MSG_RESULT([*** no external mpeg encoder found]) + fi + else + have_dxr3=no have_libfame=no have_librte=no have_encoder=no + fi + AM_CONDITIONAL([ENABLE_DXR3], [test x"$have_dxr3" = x"yes"]) + AM_CONDITIONAL([HAVE_LIBFAME], [test x"$have_libfame" = x"yes"]) + AM_CONDITIONAL([HAVE_LIBRTE], [test x"$have_librte" = x"yes"]) + + + dnl LibSTK - http://www.libstk.net (project appears to be dead) + AC_ARG_WITH([libstk], + [AS_HELP_STRING([--with-libstk], [Build with STK surface video driver])], + [test x"$withval" != x"no" && with_libstk="yes"], + [test $default_with_libstk = without && with_libstk="no"]) + if test x"$with_libstk" != x"no"; then + PKG_CHECK_MODULES([LIBSTK], [libstk >= 0.2.0], [have_libstk=yes], [have_libstk=no]) + if test x"$with_libstk" = x"yes" && test x"$have_libstk" != x"yes"; then + AC_MSG_ERROR([libstk support requested, but libstk not found]) + fi + fi + AM_CONDITIONAL([ENABLE_STK], [test x"$have_libstk" = x"yes"]) + + + dnl Linux framebuffer device + AC_ARG_ENABLE([fb], + [AS_HELP_STRING([--enable-fb], [enable Linux framebuffer support])], + [test x"$enableval" != x"no" && enable_fb="yes"], + [test $default_enable_linuxfb = disable && enable_linuxfb="no"]) + if test x"$enable_linuxfb" != x"no"; then + AC_CHECK_HEADERS([linux/fb.h], [have_fb=yes], [have_fb=no]) + if test x"$enable_fb" = x"yes" && test x"$have_fb" != x"yes"; then + AC_MSG_ERROR([Linux framebuffer support requested, but required header file(s) not found]) + elif test x"$have_fb" = x"yes"; then + dnl This define is needed by src/video_out/video_out_vidix.c + AC_DEFINE([HAVE_FB], 1, [Define this if you have linux framebuffer support]) + fi + fi + AM_CONDITIONAL([ENABLE_FB], [test x"$have_fb" = x"yes"]) + + + dnl Mac OS X OpenGL video output + AC_ARG_ENABLE([macosx-video], + [AS_HELP_STRING([--enable-macosx-video], [enable support for Mac OS X OpenGL video output])], + [test x"$enableval" != x"no" && enable_macosx_video="yes"], + [test $default_enable_macosx_video = disable && enable_macosx_video="no"]) + if test x"$enable_macosx_video" != x"no"; then + AC_MSG_CHECKING([for Mac OS X video output frameworks]) + ac_save_LIBS="$LIBS" LIBS="$LIBS -framework Cocoa -framework OpenGL" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_macosx_video=yes], [have_macosx_video=no]) + LIBS="$ac_save_LIBS" + AC_MSG_RESULT([$have_macosx_video]) + if test x"$enable_macosx_video" = x"yes" && test x"$have_macosx_video" != x"yes"; then + AC_MSG_ERROR([Mac OS X OpenGL video output support requested, but required frameworks not found]) + fi + fi + AM_CONDITIONAL([ENABLE_MACOSX_VIDEO], [test x"$have_macosx_video" = x"yes"]) + + + dnl OpenGL, including GLut and/or GLU + AC_ARG_ENABLE([opengl], + [AS_HELP_STRING([--enable-opengl], [enable support for X-based OpenGL video output])], + [test x"$enableval" != x"no" && enable_opengl="yes"], + [test $default_enable_opengl = disable && enable_opengl="no"]) + AC_ARG_ENABLE([glu], + [AS_HELP_STRING([--enable-glu], [enable support for GLU in the OpenGL plugin])], + [test x"$enableval" != x"no" && enable_glu="yes"], + [test $default_enable_glu = disable && enable_glu="no"]) + if test x"$enable_opengl" != x"no"; then + if test x"$no_x" = x"yes"; then + if test x"$enable_opengl" = x"yes"; then + AC_MSG_ERROR([OpenGL support requested, but X support is disabled]) + fi + enable_opengl=no + fi + fi + if test x"$enable_opengl" != x"no"; then + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_LIB([GL], [glBegin], + [AC_CHECK_HEADERS([GL/gl.h], [have_opengl=yes], [have_opengl=no])], [have_opengl=no], + [$X_LIBS -lm]) + if test x"$enable_opengl" = x"yes" && test x"$have_opengl" != x"yes"; then + AC_MSG_ERROR([OpenGL support requested, but OpenGL not found]) + elif test x"$have_opengl" = x"yes"; then + OPENGL_LIBS="-lGL -lm" + if test x"$enable_glu" != x"no"; then + have_glu=no + AC_CHECK_LIB([GLU], [gluPerspective], + [AC_CHECK_HEADERS([GL/glu.h], + [AC_MSG_CHECKING([if GLU is sane]) + ac_save_LIBS="$LIBS" LIBS="-lGLU $X_LIBS $OPENGL_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h> + #include <GL/glu.h>]], + [[gluPerspective(45.0f, 1.33f, 1.0f, 1000.0f); + glBegin(GL_POINTS); glEnd()]])], + [have_glu=yes], [have_glu=no]) + LIBS="$ac_save_LIBS" + AC_MSG_RESULT([$have_glu])], [have_glu=no])], [have_glu=no], + [$X_LIBS $OPENGL_LIBS]) + if test x"$enable_glu" = x"yes" && test x"$have_glu" != x"yes"; then + AC_MSG_ERROR([OpenGL GLU support requested, but GLU not found]) + elif test x"$have_glu" = x"yes"; then + AC_DEFINE([HAVE_GLU], 1, [Define this if you have GLU support available]) + GLU_LIBS="-lGLU" + fi + fi + fi + CPPFLAGS="$ac_save_CPPFLAGS" + AC_SUBST(OPENGL_CFLAGS) + AC_SUBST(OPENGL_LIBS) + AC_SUBST(GLU_LIBS) + fi + AM_CONDITIONAL([ENABLE_OPENGL], [test x"$have_opengl" = x"yes"]) + + + dnl SDL + AC_ARG_WITH([sdl], + [AS_HELP_STRING([--with-sdl], [Enable support for SDL video output])], + [test x"$withval" != x"no" && with_sdl="yes"], + [test $default_with_sdl = without && with_sdl="no"]) + if test x"$with_sdl" != x"no"; then + PKG_CHECK_MODULES([SDL], [sdl], [have_sdl=yes], [have_sdl=no]) + if test x"$with_sdl" = x"yes" && test x"$have_sdl" != x"yes"; then + AC_MSG_ERROR([SDL support requested, but SDL not found]) + fi + fi + AM_CONDITIONAL([ENABLE_SDL], [test x"$have_sdl" = x"yes"]) + + + dnl Solaris framebuffer device support (exists for more than just Solaris) + AC_CHECK_HEADERS([sys/fbio.h], [have_sunfb=yes], [have_sunfb=no]) + if test x"$have_sunfb" = x"yes"; then + saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/usr/openwin/include" + saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L/usr/openwin/lib" + AC_CHECK_LIB([dga], [XDgaGrabDrawable], + [AC_CHECK_HEADER([dga/dga.h], + [SUNDGA_CFLAGS="-I/usr/openwin/include" + SUNDGA_LIBS="-L/usr/openwin/lib -R/usr/openwin/lib -ldga" + have_sundga=yes])]) + CPPFLAGS="$saved_CPPFLAGS" LDFLAGS="$saved_LDFLAGS" + AC_SUBST(SUNDGA_CPPFLAGS) + AC_SUBST(SUNDGA_LIBS) + fi + AM_CONDITIONAL([ENABLE_SUNDGA], [test x"$have_sundga" = x"yes"]) + AM_CONDITIONAL([ENABLE_SUNFB], [test x"$have_sunfb" = x"yes"]) + + + dnl xcb + AC_ARG_WITH([xcb], + [AS_HELP_STRING([--with-xcb], [Enable support for XCB video out plugins])], + [test x"$withval" != x"no" && with_xcb="yes"], + [test $default_with_xcb = without && with_xcb="no"]) + if test x"$with_xcb" != x"no"; then + PKG_CHECK_MODULES([XCB], [xcb-shape >= 1.0], [have_xcb=yes], [have_xcb=no]) + if test x"$enable_xcb" = x"yes" && test x"$have_xcb" != x"yes"; then + AC_MSG_ERROR([XCB support requested, but XCB not found]) + elif test x"$have_xcb" = x"yes"; then + PKG_CHECK_MODULES([XCBSHM], [xcb-shm], [have_xcbshm=yes], [have_xcbshm=no]) + PKG_CHECK_MODULES([XCBXV], [xcb-xv], [have_xcbxv=yes], [have_xcbxv=no]) + fi + fi + AM_CONDITIONAL([ENABLE_XCB], [test x"$have_xcb" = x"yes"]) + AM_CONDITIONAL([ENABLE_XCBSHM], [test x"$have_xcbshm" = x"yes"]) + AM_CONDITIONAL([ENABLE_XCBXV], [test x"$have_xcbxv" = x"yes"]) + + + dnl vidix/libdha + dnl Requires X11 or Linux framebuffer + AC_ARG_ENABLE([vidix], + [AS_HELP_STRING([--enable-vidix], [enable support for Vidix])], + [test x"$enableval" != x"no" && enable_vidix="yes"], + [test $default_enable_vidix = disable && enable_vidix="no"]) + if test x"$enable_vidix" != x"no"; then + have_vidix=yes + if test x"$ac_cv_prog_AWK" = x"no"; then + have_vidix=no + else + if test x"$no_x" = x"yes" -o x"$have_fb" != x"yes"; then + have_vidix=no + else + case "$host_or_hostalias" in + i?86-*-linux* | k?-*-linux* | athlon-*-linux*) ;; + i?86-*-freebsd* | k?-*-freebsd* | athlon-*-freebsd* | i?86-*-kfreebsd*) ;; + *) have_vidix="no" ;; + esac + fi + fi + if test x"$enable_vidix" = x"yes" && test x"$have_vidix" != x"yes"; then + AC_MSG_ERROR([Vidix support requested, but not all requirements are met]) + fi + fi + AM_CONDITIONAL([ENABLE_VIDIX], test x"$have_vidix" = x"yes") + + + dnl Xinerama + AC_ARG_ENABLE([xinerama], + [AS_HELP_STRING([--enable-xinerama], [enable support for Xinerama])], + [test x"$enableval" != x"no" && enable_xinerama="yes"], + [test $default_enable_xinerama = disable && enable_xinerama="no"]) + if test x"$enable_xinerama" != x"no"; then + if test x"$no_x" != x"yes"; then + PKG_CHECK_MODULES([XINERAMA], [xinerama], [have_xinerama=yes], + [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension], + [XINERAMA_LIBS="-lXinerama" have_xinerama="yes"], [], + [$X_LIBS])]) + fi + if test x"$enable_xinerama" = x"yes" && test x"$have_xinerama" != x"yes"; then + AC_MSG_ERROR([Xinerama support requested, but Xinerama not found or X disabled]) + elif test x"$have_xinerama" = x"yes"; then + AC_DEFINE([HAVE_XINERAMA], 1, [Define this if you have libXinerama installed]) + X_LIBS="$X_LIBS $XINERAMA_LIBS" + fi + fi + AM_CONDITIONAL([ENABLE_XINERAMA], [test x"$have_xinerama" = x"yes"]) + + + dnl xv + AC_ARG_WITH([xv-path], + [AS_HELP_STRING([--with-xv-path=path], [where libXv is installed])]) + dnl With recent XFree86 or Xorg, dynamic linking is preferred! + dnl Only dynamic linking is possible when using libtool < 1.4.0 + AC_ARG_ENABLE([static-xv], + [AS_HELP_STRING([--enable-static-xv], [Enable this to force linking against libXv.a])], + [test x"$enableval" != x"no" && xv_prefer_static="yes"], [xv_prefer_static="no"]) + case "$host_or_hostalias" in + hppa*) xv_libexts="$acl_cv_shlibext" ;; + *) + if test x"$xv_prefer_static" = x"yes"; then + xv_libexts="$acl_cv_libext $acl_cv_shlibext" + else + xv_libexts="$acl_cv_shlibext $acl_cv_libext" + fi + ;; + esac + if test x"$no_x" != x"yes"; then + PKG_CHECK_MODULES([XV], [xv], [have_xv=yes], [have_xv=no]) + if test x"$have_xv" = x"no"; then + dnl No Xv package -- search for it + for xv_libext in $xv_libexts; do + xv_lib="libXv.$xv_libext" + AC_MSG_CHECKING([for $xv_lib]) + for xv_try_path in "$with_xv_path" "$x_libraries" /usr/X11R6/lib /usr/lib; do + if test x"$xv_try_path" != x"" && test -f "$xv_try_path/$xv_lib"; then + case $xv_lib in + *.$acl_cv_libext) have_xv_static=yes xv_try_libs="$xv_try_path/$xv_lib" ;; + *.$acl_cv_shlibext) have_xv_static=no xv_try_libs="${xv_try_path:+-L}$xv_try_path -lXv" ;; + esac + ac_save_LIBS="$LIBS" LIBS="$xv_try_libs $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvShmCreateImage()]])], [have_xv=yes], []) + LIBS="$ac_save_LIBS" + if test x"$have_xv" = x"yes"; then + AC_MSG_RESULT([$xv_try_path]) + XV_LIBS="$xv_try_libs" + break + fi + fi + done + test x"$have_xv" = x"yes" && break + AC_MSG_RESULT([no]) + done + fi + if test x"$have_xv" = x"yes"; then + AC_DEFINE([HAVE_XV], 1, [Define this if you have libXv installed]) + fi + fi + AM_CONDITIONAL([HAVE_XV], [test x"$have_xv" = x"yes"]) + + + dnl XvMC + AC_ARG_ENABLE([xvmc], + [AS_HELP_STRING([--enable-xvmc], [Disable xxmc and XvMC outplut plugins])], + [test x"$enableval" != x"no" && enable_xvmc="yes"], + [test $default_enable_xvmc = disable && enable_xvmc="no"]) + AC_ARG_WITH([xvmc-path], + [AS_HELP_STRING([--with-xvmc-path=PATH], [where libXvMC for the xvmc plugin are installed])], + [], [with_xvmc_path="$x_libraries"]) + AC_ARG_WITH([xvmc-lib], + [AS_HELP_STRING([--with-xvmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xvmc plugin])], + [], [with_xvmc_lib="XvMCW"]) + AC_ARG_WITH([xxmc-path], + [AS_HELP_STRING([--with-xxmc-path=PATH], [Where libXvMC for the xxmc plugin are installed])], + [], [with_xxmc_path="$x_libraries"]) + AC_ARG_WITH([xxmc-lib], + [AS_HELP_STRING([--with-xxmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xxmc plugin])], + [], [with_xxmc_lib="XvMCW"]) + if test x"$enable_xvmc" != x"no"; then + if test x"$have_xv" != x"yes"; then + have_xvmc=no have_xxmc=no have_xvmc_or_xxmc=no + else + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + ac_save_LIBS="$LIBS" + + dnl Check for xxmc + XXMC_LIBS="${with_xxmc_path:+-L}$with_xxmc_path -l$with_xxmc_lib" + AC_SUBST(XXMC_LIBS) + AC_MSG_CHECKING([whether to enable the xxmc plugin with VLD extensions]) + AC_MSG_RESULT([]) + LIBS="$XXMC_LIBS $X_LIBS $XV_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])], [have_xxmc=yes], + [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])], + [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])]) + if test x"$have_xxmc" = x"yes"; then + AC_CHECK_HEADERS([X11/extensions/vldXvMC.h], + [have_vldexts=yes + AC_DEFINE([HAVE_VLDXVMC], 1, [Define if you have vldXvMC.h])], + [have_vldexts=no]) + else + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xxmc=yes], + [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], + [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])]) + fi + if test x"$have_xxmc" = x"yes"; then + AC_CHECK_HEADERS([X11/extensions/XvMC.h], [], [have_xxmc=no]) + fi + + dnl Check for xvmc + XVMC_LIBS="${with_xvmc_path:+-L}$with_xvmc_path -l$with_xvmc_lib" + AC_SUBST(XVMC_LIBS) + AC_MSG_CHECKING([whether to enable the xvmc plugin]) + AC_MSG_RESULT([]) + LIBS="$XVMC_LIBS $X_LIBS $XV_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xvmc=yes], + [LIBS="$XVMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], + [have_xvmc=yes XVMC_LIBS="$XVMC_LIBS -lXvMC"])]) + if test x"$have_xvmc" = x"yes"; then + AC_CHECK_HEADERS([X11/extensions/XvMC.h], [], [have_xvmc=no]) + fi + CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" + fi + have_xvmc_or_xxmc="$have_xvmc"; test x"$have_xxmc" = x"yes" && have_xvmc_or_xxmc=yes + if test x"$enable_xvmc" = x"yes" && test x"$have_xvmc_or_xxmc" != x"yes"; then + AC_MSG_ERROR([XvMC support requested, but neither XvMC nor xxmc could be found, or X is disabled]) + else + if test x"$have_xvmc" = x"yes"; then + AC_DEFINE([HAVE_XVMC], 1, [Define this if you have an XvMC library and XvMC.h installed.]) + AC_MSG_RESULT([*** Enabling old xvmc plugin.]) + else + AC_MSG_RESULT([*** Disabling old xvmc plugin.]) + fi + if test x"$have_xxmc" = x"yes"; then + if test x"$have_vldexts" = x"yes"; then + AC_MSG_RESULT([*** Enabling xxmc plugin with vld extensions.]) + else + AC_MSG_RESULT([*** Enabling xxmc plugin for standard XvMC *only*.]) + fi + else + AC_MSG_RESULT([*** Disabling xxmc plugin.]) + fi + fi + fi + AM_CONDITIONAL([ENABLE_XVMC], [test x"$have_xvmc" = x"yes"]) + AM_CONDITIONAL([ENABLE_XXMC], [test x"$have_xxmc" = x"yes"]) +])dnl XINE_VIDEO_OUT_PLUGINS diff --git a/m4/xine.m4 b/m4/xine.m4 index 2842de621..7030a991f 100644 --- a/m4/xine.m4 +++ b/m4/xine.m4 @@ -23,193 +23,97 @@ dnl script generated by Autoconf, you may include it under the same dnl distribution terms that you use for the rest of that program. dnl -dnl AM_PATH_XINE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) -dnl Test for XINE, and define XINE_CFLAGS and XINE_LIBS -dnl -AC_DEFUN([AM_PATH_XINE], -[dnl -dnl Get the cflags and libraries from the xine-config script -dnl -AC_ARG_WITH(xine-prefix, - AS_HELP_STRING([--with-xine-prefix=DIR], [prefix where XINE is installed (optional)]), - xine_config_prefix="$withval", xine_config_prefix="") -AC_ARG_WITH(xine-exec-prefix, - AS_HELP_STRING([--with-xine-exec-prefix=DIR], [exec prefix where XINE is installed (optional)]), - xine_config_exec_prefix="$withval", xine_config_exec_prefix="") -AC_ARG_ENABLE(xinetest, - AS_HELP_STRING([--disable-xinetest], [do not try to compile and run a test XINE program]), - enable_xinetest=$enableval, enable_xinetest=yes) +dnl _XINE_VERSION_PARSE(version) +AC_DEFUN([_XINE_VERSION_PARSE], [`echo $1 | perl -e 'my $v = <>; chomp $v; +my @v = split(" ", $v); $v = $v[[@S|@#v]]; $v =~ s/[[^0-9.]].*$//; @v = split (/\./, $v); +push @v, 0 while $[#v] < 2; print $v[[0]] * 10000 + $v[[1]] * 100 + $v[[2]], "\n"'`]) - AC_LANG_PUSH([C]) - if test x$xine_config_exec_prefix != x ; then - xine_config_args="$xine_config_args --exec-prefix=$xine_config_exec_prefix" - if test x${XINE_CONFIG+set} != xset ; then - XINE_CONFIG=$xine_config_exec_prefix/bin/xine-config - fi - fi - if test x$xine_config_prefix != x ; then - xine_config_args="$xine_config_args --prefix=$xine_config_prefix" - if test x${XINE_CONFIG+set} != xset ; then - XINE_CONFIG=$xine_config_prefix/bin/xine-config - fi - fi - - min_xine_version=ifelse([$1], ,0.5.0,$1) - if test "x$enable_xinetest" != "xyes" ; then - AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version]) - else - AC_PATH_TOOL(XINE_CONFIG, xine-config, no) - AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version]) - no_xine="" - if test "$XINE_CONFIG" = "no" ; then - no_xine=yes +dnl _XINE_VERSION_CHECK(required, actual) +AC_DEFUN([_XINE_VERSION_CHECK], [ + required_version=ifelse([$1], , [0.0.0], [$1]) + required_version_parsed=_XINE_VERSION_PARSE([$required_version]) + actual_version=ifelse([$2], , [0.0.0], [$2]) + actual_version_parsed=_XINE_VERSION_PARSE([$actual_version]) + if test $required_version_parsed -le $actual_version_parsed; then + ifelse([$3], , [:], [$3]) else - XINE_CFLAGS=`$XINE_CONFIG $xine_config_args --cflags` - XINE_LIBS=`$XINE_CONFIG $xine_config_args --libs` - XINE_ACFLAGS=`$XINE_CONFIG $xine_config_args --acflags` - xine_config_major_version=`$XINE_CONFIG $xine_config_args --version | \ - sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/p'` - xine_config_minor_version=`$XINE_CONFIG $xine_config_args --version | \ - sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/p'` - xine_config_sub_version=`$XINE_CONFIG $xine_config_args --version | \ - sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/p'` - xine_data_dir=`$XINE_CONFIG $xine_config_args --datadir` - xine_script_dir=`$XINE_CONFIG $xine_config_args --scriptdir` - xine_plugin_dir=`$XINE_CONFIG $xine_config_args --plugindir` - xine_locale_dir=`$XINE_CONFIG $xine_config_args --localedir` - dnl if test "x$enable_xinetest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $XINE_CFLAGS" - LIBS="$XINE_LIBS $LIBS" -dnl -dnl Now check if the installed XINE is sufficiently new. (Also sanity -dnl checks the results of xine-config to some extent -dnl - rm -f conf.xinetest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include <xine.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> + ifelse([$4], , [:], [$4]) + fi +]) -int -main () -{ - int major, minor, sub; - char *tmp_version; - system ("touch conf.xinetest"); +dnl AM_PATH_XINE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) +dnl Test for XINE, and define XINE_CFLAGS and XINE_LIBS +dnl +AC_DEFUN([AM_PATH_XINE], [ + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = (char *) strdup("$min_xine_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) { - printf("%s, bad version string\n", "$min_xine_version"); - exit(1); - } + AC_ARG_VAR([XINE_CONFIG], [Full path to xine-config (xine-lib < 1.2)]) + AC_ARG_WITH([xine-prefix], + [AS_HELP_STRING([--with-xine-prefix], [prefix where xine-lib is installed (optional, xine-lib < 1.2)])]) + AC_ARG_WITH([xine-exec-prefix], + [AS_HELP_STRING([--with-xine-exec-prefix], [exec prefix where xine-lib is installed (optional, xine-lib < 1.2)])]) - if ((XINE_MAJOR_VERSION != $xine_config_major_version) || - (XINE_MINOR_VERSION != $xine_config_minor_version) || - (XINE_SUB_VERSION != $xine_config_sub_version)) - { - printf("\n*** 'xine-config --version' returned %d.%d.%d, but XINE (%d.%d.%d)\n", - $xine_config_major_version, $xine_config_minor_version, $xine_config_sub_version, - XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION); - printf ("*** was found! If xine-config was correct, then it is best\n"); - printf ("*** to remove the old version of XINE. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If xine-config was wrong, set the environment variable XINE_CONFIG\n"); - printf("*** to point to the correct copy of xine-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else - { - if ((XINE_MAJOR_VERSION > major) || - ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION > minor)) || - ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION == minor) && (XINE_SUB_VERSION >= sub))) - { - return 0; - } - else - { - printf("\n*** An old version of XINE (%d.%d.%d) was found.\n", - XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION); - printf("*** You need a version of XINE newer than %d.%d.%d. The latest version of\n", - major, minor, sub); - printf("*** XINE is always available from:\n"); - printf("*** http://xine.sourceforge.net\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the xine-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of XINE, but you can also set the XINE_CONFIG environment to point to the\n"); - printf("*** correct copy of xine-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -]])],[],[no_xine=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi + xine_config_args="" + if test x"$with_xine_exec_prefix" != x""; then + xine_config_args="$xine_config_args --exec-prefix=$with_xine_exec_prefix" + test x"$XINE_CONFIG" != x"" && XINE_CONFIG="$with_xine_exec_prefix/bin/xine-config" + fi + if test x"$with_xine_prefix" != x""; then + xine_config_args="$xine_config_args --prefix=$with_xine_prefix" + test x"$XINE_CONFIG" = x"" && XINE_CONFIG="$with_xine_prefix/bin/xine-config" fi - if test "x$no_xine" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) + + if "$PKG_CONFIG" --atleast-version 1.1.90 libxine; then + min_xine_version=ifelse([$1], , [1.2.0], [$1]) + PKG_CHECK_MODULES([XINE], [libxine >= $min_xine_version], + [XINE_VERSION="`"$PKG_CONFIG" --modversion libxine`" + XINE_ACFLAGS="`"$PKG_CONFIG" --variable=acflags libxine`" + xine_data_dir="`"$PKG_CONFIG" --variable=datadir libxine`" + xine_script_dir="`"$PKG_CONFIG" --variable=scriptdir libxine`" + xine_plugin_dir="`"$PKG_CONFIG" --variable=plugindir libxine`" + xine_locale_dir="`"$PKG_CONFIG" --variable=localedir libxine`" + $2], + [$3]) else - AC_MSG_RESULT(no) - if test "$XINE_CONFIG" = "no" ; then - echo "*** The xine-config script installed by XINE could not be found" - echo "*** If XINE was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the XINE_CONFIG environment variable to the" - echo "*** full path to xine-config." - else - if test -f conf.xinetest ; then - : - else - echo "*** Could not run XINE test program, checking why..." - CFLAGS="$CFLAGS $XINE_CFLAGS" - LIBS="$LIBS $XINE_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <xine.h> -#include <stdio.h> -]], [[ return ((XINE_MAJOR_VERSION) || (XINE_MINOR_VERSION) || (XINE_SUB_VERSION)); ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding XINE or finding the wrong" - echo "*** version of XINE. If it is not finding XINE, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means XINE was incorrectly installed" - echo "*** or that you have moved XINE since it was installed. In the latter case, you" - echo "*** may want to edit the xine-config script: $XINE_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + min_xine_version=ifelse([$1], , [0.5.0], [$1]) + AC_PATH_TOOL([XINE_CONFIG], [xine-config], [no]) + AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version]) + XINE_CFLAGS="`$XINE_CONFIG $xine_config_args --cflags`" + XINE_LIBS="`$XINE_CONFIG $xine_config_args --libs`" + XINE_VERSION="`$XINE_CONFIG $xine_config_args --version`" + XINE_ACFLAGS="`$XINE_CONFIG $xine_config_args --acflags`" + xine_data_dir="`$XINE_CONFIG $xine_config_args --datadir`" + xine_script_dir="`$XINE_CONFIG $xine_config_args --scriptdir`" + xine_plugin_dir="`$XINE_CONFIG $xine_config_args --plugindir`" + xine_locale_dir="`$XINE_CONFIG $xine_config_args --localedir`" + _XINE_VERSION_CHECK([$min_xine_version], [$XINE_VERSION], + [xine_version_ok=yes; AC_MSG_RESULT([yes, $XINE_VERSION])], + [xine_version_ok=no; AC_MSG_RESULT([no, $XINE_VERSION])]) + if test x"$xine_version_ok" = x"yes"; then + ifelse([$2], , [:], [$2]) + else + AC_MSG_NOTICE([ +*** You need a version of xine-lib newer than $XINE_VERSION. +*** The latest version of xine-lib is always available from: +*** http://www.xinehq.de +*** +*** If you have already installed a sufficiently new version, this error +*** probably means that the wrong copy of the xine-config shell script is +*** being found. The easiest way to fix this is to remove the old version +*** of xine-lib, but you can also set the XINE_CONFIG environment variable +*** to point to the correct copy of xine-config. In this case, you will have +*** to modify your LD_LIBRARY_PATH enviroment variable, or edit +*** /etc/ld.so.conf so that the correct libraries are found at run-time. + ]) + ifelse([$3], , [:], [$3]) fi - fi - XINE_CFLAGS="" - XINE_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(XINE_CFLAGS) - AC_SUBST(XINE_LIBS) - AC_SUBST(XINE_ACFLAGS) - AC_LANG_POP([C]) - rm -f conf.xinetest + fi -dnl Make sure HAVE_STRSEP, HAVE_SETENV and HAVE_STRPBRK are defined as -dnl necessary. - AC_CHECK_FUNCS([strsep strpbrk setenv]) -dnl alloca (in public macro) and MinGW - AC_CHECK_HEADERS([malloc.h]) + AC_SUBST(XINE_CFLAGS) + AC_SUBST(XINE_LIBS) + AC_SUBST(XINE_ACFLAGS) ]) diff --git a/m4/xv.m4 b/m4/xv.m4 deleted file mode 100644 index 91380a1de..000000000 --- a/m4/xv.m4 +++ /dev/null @@ -1,93 +0,0 @@ -# AC_FIND_LIBXV_IMPL (LIB) -# ------------------------- -# -AC_DEFUN([AC_PATH_LIBXV_IMPL], -[ - AC_MSG_CHECKING([for $1]) - if test -f "$xv_path/$1"; then - AC_MSG_RESULT([found $1 in $xv_path]) - XV_LIBS="$1" - else - if test -f "/usr/lib/$1"; then - AC_MSG_RESULT([found $1 in /usr/lib]) - XV_LIBS="$1" - else - AC_MSG_RESULT([$1 not found in $xv_path]) - fi - fi -]) - -AC_DEFUN([AC_TEST_LIBXV], -[ - dnl ----------------------------------------------- - dnl Testing installed Xv library - dnl ----------------------------------------------- - AC_CHECK_LIB(Xv, XvShmCreateImage, - [ - AC_DEFINE(HAVE_XV, - 1, - [Define this if you have libXv installed]) - - ac_have_xv="yes" - case x$XV_LIBS in - x*.a) - AC_DEFINE(HAVE_XV_STATIC, - 1, - [Define this if you have libXv.a]) - ac_have_xv_static="yes" - XV_LIBS="$xv_path/$XV_LIBS" - ;; - x*.so) - XV_LIBS=`echo $XV_LIBS | sed 's/^lib/-l/; s/\.so$//'` - ;; - *) - AC_MSG_ERROR([sorry, I don't know about $XV_LIBS]) - ;; - esac - ], - , - [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS]) - - dnl ----------------------------------------------- - dnl xine_check use Xv functions API. - dnl ----------------------------------------------- - if test x$ac_have_xv = "xyes"; then - EXTRA_X_LIBS="-L$xv_path $XV_LIBS -lXext" - EXTRA_X_CFLAGS="" - fi - AC_SUBST(XV_LIBS) - AC_SUBST(EXTRA_X_LIBS) - AC_SUBST(EXTRA_X_CFLAGS) -]) - -# AC_PATH_LIBXV -# ------------------------- -# -AC_DEFUN([AC_FIND_LIBXV], -[ - # Ensure that AC_PATH_XTRA is executed before this - AC_REQUIRE([AC_PATH_XTRA]) - - if test x$xv_path = x; then - xv_path=/usr/X11R6/lib - fi - - if test "x$xv_prefer_shared" = "xyes"; then - AC_PATH_LIBXV_IMPL([libXv.so]) - else - AC_PATH_LIBXV_IMPL([libXv.a]) - fi - - # Try the other lib if prefered failed - if test x$XV_LIBS = x; then - if ! test "x$xv_prefer_shared" = "xyes"; then - AC_PATH_LIBXV_IMPL([libXv.so]) - else - AC_PATH_LIBXV_IMPL([libXv.a]) - fi - fi - - if ! test x$XV_LIBS = x; then - AC_TEST_LIBXV - fi -]) |