| 1 |
# Configure paths for DivX |
| 2 |
|
| 3 |
dnl Usage: |
| 4 |
dnl AM_PATH_DIVX([ACTION-IF-FOUND-DECORE [, ACTION-IF-NOT-FOUND-DECORE |
| 5 |
dnl [, ACTION-IF-FOUND-ENCORE, [ACTION-IF-NOT-FOUND-DECORE]]]] ) |
| 6 |
dnl Test for libdivxdecore, libdivxencore, and define DIVX_CFLAGS and DIVX_LIBS |
| 7 |
dnl |
| 8 |
AC_DEFUN([AM_PATH_DIVX], |
| 9 |
[ |
| 10 |
AC_ARG_WITH(divx4_prefix, [ --with-divx4-prefix=PFX where divx4linux is installed.], |
| 11 |
[], with_divx4_prefix=) |
| 12 |
|
| 13 |
have_divx_decore=no |
| 14 |
have_divx_encore=no |
| 15 |
DIVX_CFLAGS="" |
| 16 |
DIVX_LIBS="" |
| 17 |
ac_save_CPPFLAGS=$CPPFLAGS |
| 18 |
if test -n "$with_divx4_prefix"; then |
| 19 |
dnl user has specified extra path for DivX4 instalation |
| 20 |
CPPFLAGS="-I$with_divx4_prefix $CPPFLAGS" |
| 21 |
AC_CHECK_HEADER(include/decore.h, |
| 22 |
DIVX_CFLAGS="-I$with_divx4_prefix/include" |
| 23 |
DIVX_LIBS="-L$with_divx4_prefix/lib" |
| 24 |
have_divx_decore=yes) |
| 25 |
if test "$have_divx_decore" = no; then |
| 26 |
AC_CHECK_HEADER(decore.h, |
| 27 |
DIVX_CFLAGS="-I$with_divx4_prefix" |
| 28 |
DIVX_LIBS="-L$with_divx4_prefix" |
| 29 |
have_divx_decore=yes) |
| 30 |
fi |
| 31 |
else |
| 32 |
AC_CHECK_HEADER(decore.h, have_divx_decore=yes) |
| 33 |
fi |
| 34 |
|
| 35 |
AC_CHECK_HEADER(encore2.h, have_divx_encore=yes) |
| 36 |
CPPFLAGS=$ac_save_CPPFLAGS |
| 37 |
|
| 38 |
ac_save_LIBS=$LIBS |
| 39 |
if test "$have_divx_decore" = yes; then |
| 40 |
AC_CHECK_LIB(divxdecore, decore, [], |
| 41 |
have_divx_decore=no, $DIVX_LIBS) |
| 42 |
fi |
| 43 |
|
| 44 |
if test "$have_divx_encore" = yes; then |
| 45 |
AC_CHECK_LIB(divxencore, encore, [], |
| 46 |
have_divx_encore=no, $DIVX_LIBS) |
| 47 |
fi |
| 48 |
LIBS=$ac_save_LIBS |
| 49 |
|
| 50 |
if test "$have_divx_decore" = yes; then |
| 51 |
DIVX_LIBS="$DIVX_LIBS -ldivxdecore" |
| 52 |
ifelse([$1], , :, [$1]) |
| 53 |
else |
| 54 |
ifelse([$2], , :, [$2]) |
| 55 |
fi |
| 56 |
|
| 57 |
if test "$have_divx_encore" = yes; then |
| 58 |
DIVX_LIBS="$DIVX_LIBS -ldivxencore" |
| 59 |
ifelse([$3], , :, [$3]) |
| 60 |
else |
| 61 |
ifelse([$4], , :, [$4]) |
| 62 |
fi |
| 63 |
|
| 64 |
AC_SUBST(DIVX_CFLAGS) |
| 65 |
AC_SUBST(DIVX_LIBS) |
| 66 |
]) |
| 67 |
|