Skip to content
Snippets Groups Projects
configure.ac 170 KiB
Newer Older
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl Autoconf settings for vlc
AC_COPYRIGHT([Copyright 2002-2009 the VideoLAN team])

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
AC_INIT(vlc, 1.1.0-git)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
VERSION_MAJOR="1"
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
VERSION_MINOR="1"
VERSION_REVISION="0"
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
VERSION_EXTRA="-git"
PKGDIR="vlc"
AC_SUBST(PKGDIR)
CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
Christophe Mutricy's avatar
Christophe Mutricy committed
COPYRIGHT_YEARS="1996-2009"
AC_CONFIG_MACRO_DIR(m4)
AC_CANONICAL_BUILD
AM_INIT_AUTOMAKE(tar-ustar)
# Disable with "./configure --disable-silent-rules" or "make V=1"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])


dnl Too many people are not aware of maintainer mode:
dnl If you want to use it, you definitely know what you are doing, so
dnl you can specify "--disable-maintainer-mode". But if you want the default
dnl automake behavior, you've likely never heard of maintainer mode, so we
dnl can't expect you to enable it manually.

AS_IF([test "x${enable_maintainer_mode}" != "xno"],
    [enable_maintainer_mode="yes"])
dnl
dnl Directories
dnl
dnl vlcincludedir="\${includedir}/\${PKGDIR}"
dnl AC_SUBST(vlcincludedir)
vlcdatadir="\${datadir}/\${PKGDIR}"
AC_SUBST(vlcdatadir)
vlclibdir="\${libdir}/\${PKGDIR}"
AC_SUBST(vlclibdir)

dnl
dnl  Deprecated options
dnl  to notify packagers that stuff has changed
dnl
AC_ARG_ENABLE(python-bindings,
  [  --enable-python-bindings Always fails for historical reasons)],,
  [enable_python_bindings="no"])
AS_IF([test "${enable_python_bindings}" != "no"], [
  AC_MSG_ERROR([Python bindings are now built from a separate source package])
])

AC_ARG_ENABLE(java-bindings,
  [  --enable-java-bindings  Always fails for historical reasons],,
  [enable_java_bindings="no"])
AS_IF([test "${enable_java_bindings}" != "no"], [
  AC_MSG_ERROR([Java bindings are now built from a separate source package])
])

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
dnl  Save *FLAGS
dnl
VLC_SAVE_FLAGS
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
dnl Check for tools
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
AC_DEFINE([_FORTIFY_SOURCE], 2, [Define to '2' to get glibc warnings.])
AC_PROG_OBJC
_AM_DEPENDENCIES([OBJC])
AC_PROG_EGREP
gbazin's avatar
 
gbazin committed
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_TOOL(LD, ld, :)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
AC_CHECK_TOOL(DLLTOOL, dlltool, :)
gbazin's avatar
 
gbazin committed

dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
dnl Allow binary package maintainer to pass a custom string to avoid
AC_ARG_WITH(binary-version,
	AS_HELP_STRING([--with-binary-version=STRING],
	     [To avoid plugins cache problem between binary version]),[],[])
AS_IF([test -n "${with_binary_version}"],[
      AC_DEFINE_UNQUOTED([DISTRO_VERSION],["${with_binary_version}"],
			 [Binary specific version])
      ])


dnl
dnl  Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
    [  --without-contrib       do not use the libraries in CONTRIB_DIR],[],[])
  AS_IF([test "${with_contrib}" != "no"],[
    AC_ARG_VAR([CONTRIB_DIR], [directory containing pre-built contrib, overriding extras/contrib])
    if test -z "$CONTRIB_DIR"
    then
      topdir="`dirname $0`"
      if test "`echo \"$topdir\" | cut -c 1`" != "/"; then
         topdir="`pwd`/$topdir"
      fi
      CONTRIB_DIR=${topdir}/extras/contrib
    AC_MSG_CHECKING([for libs in ${CONTRIB_DIR}])
Christophe Mutricy's avatar
Christophe Mutricy committed
  AS_IF([test -d ${CONTRIB_DIR}/lib],[
   AS_IF([test "`grep HOST ${CONTRIB_DIR}/config.mak 2>/dev/null|awk '{print $3}'`" != "`$CC -dumpmachine`"],[
      if test "${with_contrib}" = "yes"; then
        AC_MSG_RESULT([no])
        AC_MSG_ERROR([ not using the libs in extras/contrib as it is not the same host])
      else
        AC_MSG_RESULT([no])
        AC_MSG_WARN([ not using the libs in extras/contrib as it is not the same host])
    AC_MSG_RESULT([yes])
Christophe Mutricy's avatar
Christophe Mutricy committed
    export PATH=${CONTRIB_DIR}/bin:$PATH
    CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
    CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
    CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
    CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
    CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
    CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
    OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
    OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
    if test $build = $host -o "$PKG_CONFIG_LIBDIR"; then
        export PKG_CONFIG_PATH=${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH
        export PKG_CONFIG_LIBDIR=${CONTRIB_DIR}/lib/pkgconfig
    LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
    LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
    if test -z $with_mozilla_sdk_path; then
       with_mozilla_sdk_path=${CONTRIB_DIR}/gecko-sdk
    if test -z $with_cyberlink_tree; then
       with_cyberlink_tree=${CONTRIB_DIR}/src/clinkcc
    if test ".`uname -s`" = ".Darwin"; then
      export LD_LIBRARY_PATH=${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH
      export DYLD_LIBRARY_PATH=${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH
    elif test ".`uname -s`" = ".BeOS"; then
      export LIBRARY_PATH=${CONTRIB_DIR}/lib:$LIBRARY_PATH
      export BELIBRARIES=${CONTRIB_DIR}/lib:$BELIBRARIES
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
Samuel Hocevar committed

gbazin's avatar
 
gbazin committed
dnl
dnl  Check the operating system
dnl
case "${host_os}" in
  linux*)
  bsdi*)
    SYS=bsdi
    CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
    VLC_ADD_LIBS([dvd dvdcss vcd cdda vcdx cddax],[-ldvd])
  *bsd*)
    SYS="${host_os}"
    CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
Loading
Loading full blame...