Skip to content
Snippets Groups Projects
configure.ac 127 KiB
Newer Older
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl Autoconf settings for vlc
Rafaël Carré's avatar
Rafaël Carré committed
AC_COPYRIGHT([Copyright 2002-2013 VLC authors and VideoLAN])
AC_INIT(vlc, 2.2.0-git)
VERSION_MAJOR=2
VERSION_MINOR=2
VERSION_REVISION=0
VERSION_EXTRA=0
VERSION_DEV=git
PKGDIR="vlc"
AC_SUBST(PKGDIR)
CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
CODENAME="Weatherwax"
Rafaël Carré's avatar
Rafaël Carré committed
COPYRIGHT_YEARS="1996-2013"
AC_CONFIG_MACRO_DIR(m4)
AC_CANONICAL_BUILD
AC_PRESERVE_HELP_ORDER
AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
AC_CONFIG_HEADERS([config.h])
# Disable with "./configure --disable-silent-rules" or "make V=1"
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)

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_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
AC_DEFINE([_REENTRANT],, [Define to expose reentrant functions.])
AC_DEFINE([_THREAD_SAFE],, [Same as _REENTANT for some other OSes.])
AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
AC_PROG_OBJC
_AM_DEPENDENCIES([OBJC])
AC_PROG_EGREP
AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
AC_CHECK_PROGS(DESKTOP_FILE_VALIDATE, [${DESKTOP_FILE_VALIDATE} desktop-file-validate], :)

dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])

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])
])
gbazin's avatar
 
gbazin committed
dnl
dnl  Check the operating system
dnl
case "${host_os}" in
  linux*)
  bsdi*)
  freebsd*)
    SYS=freebsd
    CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
    LDFLAGS="${LDFLAGS} -L/usr/local/lib"
    ;;
  openbsd*)
    SYS=openbsd
    CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/usr/X11R6/include"
    LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/usr/X11R6/lib/"
    ;;
  netbsd*)
    SYS=netbsd
    ;;
  dragonfly*)
    SYS=dragonfly

    dnl Force gcc "-arch" flag
    ARCH_flag=""
    case "${host}" in
        ARCH_flag="-arch i386"
      ;;
      ppc64*)
        ARCH_flag="-arch ppc64"
      ;;
      ppc*)
        ARCH_flag="-arch ppc"
      ;;
      x86_64*)
        ARCH_flag="-arch x86_64"
      ;;
        ac_cv_c_attribute_packed="no"
    CFLAGS="${CFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
    CXXFLAGS="${CXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
    CPPFLAGS="${CPPFLAGS} ${ARCH_flag}"
    OBJCFLAGS="${OBJCFLAGS} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"
    LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
Pierre Ynard's avatar
Pierre Ynard committed
    VLC_ADD_LIBS([motion rotate], [-Wl,-framework,IOKit,-framework,CoreFoundation])
    VLC_ADD_LIBS([libvlc vlc],[-Wl,-undefined,dynamic_lookup,-framework,AppKit])
    VLC_ADD_LIBS([avcodec access_avio swscale postproc i420_rgb_mmx x262 x264 x26410b],[-Wl,-read_only_relocs,suppress])
    VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation,-framework,SystemConfiguration])
    dnl Allow binaries created on Lion to run on earlier releases
    AC_EGREP_CPP(yes,
           [#import <Cocoa/Cocoa.h>
            #ifdef MAC_OS_X_VERSION_10_7
            yes
            #endif],
            [AC_MSG_RESULT([yes])
            AC_LIBOBJ([getdelim])
            AC_LIBOBJ([strndup])
            AC_LIBOBJ([strnlen])],)
      [AS_HELP_STRING([--with-macosx-sdk=DIR],
        [compile using the SDK in DIR])])
    if test "${with_macosx_sdk}" != "" ; then
        test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
        CPP="${CPP} -isysroot ${with_macosx_sdk}"
        CC="${CC} -isysroot ${with_macosx_sdk}"
        CXX="${CXX} -isysroot ${with_macosx_sdk}"
        OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
        LD="${LD} -syslibroot ${with_macosx_sdk}"
    fi
      [AS_HELP_STRING([--with-macosx-version-min=VERSION],
        [compile for Mac OS X VERSION and above])])
    if test "${with_macosx_version_min}" != "" ; then
        MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
        CPP="${CPP} -mmacosx-version-min=${with_macosx_version_min}"
        CC="${CC} -mmacosx-version-min=${with_macosx_version_min}"
        CXX="${CXX} -mmacosx-version-min=${with_macosx_version_min}"
        OBJC="${OBJC} -mmacosx-version-min=${with_macosx_version_min}"
        LD="${LD} -mmacosx_version_min=${with_macosx_version_min}"
        CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
        CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
        OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
        export MACOSX_DEPLOYMENT_TARGET
Loading
Loading full blame...