shithub: aacdec

ref: 064740662b4b78775c62f610a84dc17969a1aabf
dir: /configure.in/

View raw version
AC_INIT
AM_INIT_AUTOMAKE(faad2, 2.0)

AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AM_CONFIG_HEADER(config.h)

AC_ARG_WITH( xmms,   [  --with-xmms             compile XMMS plugin],WITHXMMS=$withval, WITHXMMS=no)

AC_ARG_WITH( xmmsmp4,[  --with-xmmsmp4          compile XMMS MP4 plugin],WITHXMMSMP4=$withval, WITHXMMSMP4=no)

AC_ARG_WITH( drm,    [  --with-drm              compile libfaad with DRM support],WITHDRM=$withval, WITHDRM=no)

dnl Checks for header files required for mp4.h
AC_HEADER_STDC
AC_CHECK_HEADERS(stdint.h inttypes.h)
AC_CHECK_HEADERS(mathf.h)
AC_CHECK_HEADERS(float.h)
AC_CHECK_FUNCS(strchr memcpy)
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME

AC_C_INLINE
AC_C_BIGENDIAN

AC_DEFUN(MY_CHECK_TYPEDEF_FROM_INCLUDE,
[
   AC_MSG_CHECKING([for $1])
   AC_TRY_COMPILE([$2],
                  [$1;],
                  libfaad_ok=yes, libfaad_ok=no)
   if test $libfaad_ok = yes; then
      AC_DEFINE($3, 1, [Define if needed])
      AC_MSG_RESULT([yes])
   else
      AC_MSG_RESULT([no])
fi
])


MY_CHECK_TYPEDEF_FROM_INCLUDE([float32_t temp],
        [#include <sys/types.h>,
        #include <sys/float.h>], [HAVE_FLOAT32_T])

AC_CHECK_FUNCS(strsep)

MY_CHECK_TYPEDEF_FROM_INCLUDE([in_port_t temp],
        [#include <sys/types.h>
         #include <netinet/in.h>], [HAVE_IN_PORT_T])
MY_CHECK_TYPEDEF_FROM_INCLUDE([socklen_t temp],
        [#include <sys/types.h>
         #include <sys/socket.h>], HAVE_SOCKLEN_T)
MY_CHECK_TYPEDEF_FROM_INCLUDE([fpos_t foo; foo.__pos = 0;],
        [#include <stdio.h>],
        [HAVE_FPOS_T_POS])


external_mp4v2=yes
AC_CHECK_LIB(mp4v2, MP4Create, , external_mp4v2=no, -lstdc++)
AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=no, , -lstdc++)
AC_CHECK_HEADER(mp4.h, , external_mp4v2=no)

if test x$external_mp4v2 = xyes; then
  AM_CONDITIONAL(HAVE_MPEG4IP, true)
  MPEG4IP_PLAYER_PLUGIN_DIR=`mpeg4ip-config --player-plugin-dir`  
  AC_SUBST(MPEG4IP_PLAYER_PLUGIN_DIR)
  AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
  AC_MSG_NOTICE([*** Building with external mp4v2 ***])
else
  AM_CONDITIONAL(HAVE_MPEG4IP, false)
  AC_CONFIG_FILES(common/mp4v2/Makefile)
fi

if test x$WITHXMMS = xyes; then
  xmmsplugin=yes
  AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"no_found")
  if test "$XMMS_CONFIG" = "no_found"; then
   AC_MSG_ERROR("*** xmms-config not found - omitting xmms plugin build")
   xmmsplugin=no
   AM_CONDITIONAL(HAVE_XMMS, false)
  else
   AM_CONDITIONAL(HAVE_XMMS, true)
   AC_CONFIG_SUBDIRS(plugins/xmms)
  fi
else
 AM_CONDITIONAL(HAVE_XMMS, false)
 xmmsplugin=no
fi

if test x$WITHDRM = xyes; then
  AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
fi

AC_CONFIG_FILES(libfaad/Makefile frontend/Makefile common/Makefile Makefile plugins/Makefile)
AC_OUTPUT

dnl AC_CONFIG_SUBDIRS(plugins/xmmsmp4/src)
dnl AC_OUTPUT(plugins/xmmsmp4/Makefile plugins/xmmsmp4/src/Makefile)