Skip to content
Snippets Groups Projects
configure.ac 144 KiB
Newer Older
if test "${enable_corba}" = "yes"; then
      GLIB_VERSION=2.3.2
	ORBit-2.0 >= 2.8.0 \
	glib-2.0 >= $GLIB_VERSION \
	gobject-2.0 >= $GLIB_VERSION \
	gthread-2.0 >= $GLIB_VERSION,
	[
 	  VLC_ADD_LDFLAGS([corba],[$CORBA_LIBS])
      	  VLC_ADD_CFLAGS([corba],[$CORBA_CFLAGS])
          VLC_ADD_PLUGINS([corba snapshot]) ],
        [ enablecorba=false
	  AC_MSG_WARN(corba library not found) ])
AM_CONDITIONAL(ENABLE_CORBA, test "$enablecorba" = "true")
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_WITH(,[Misc options:])

Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  We give the user the opportunity to specify
dnl  --with-words=big or --with-words=little ; otherwise, try to guess
dnl
AC_ARG_WITH(words,
  [    --with-words=endianness set endianness (big or little)])
  case "${with_words}" in
    big)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
      ac_cv_c_bigendian=yes
      ;;
    little)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
      ac_cv_c_bigendian=no
      ;;
    *)
      dnl  Try to guess endianness by matching patterns on a compiled
      dnl  binary, by looking for an ASCII or EBCDIC string
      AC_CACHE_CHECK([whether the byte order is big-endian],
        [ac_cv_c_bigendian],
Samuel Hocevar's avatar
 
Samuel Hocevar committed
        [cat >conftest.c <<EOF
        short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
        short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
        void _a(void) { char*s = (char*)am; s = (char *)ai; }
        short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
        short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
        void _e(void) { char*s = (char*)em; s = (char*)ei; }
        int main(void) { _a(); _e(); return 0; }
EOF
        ]
        if test -f conftest.c
        then
          if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
Samuel Hocevar's avatar
 
Samuel Hocevar committed
              && test -f conftest.o
          then
            if test "`strings conftest.o | grep BIGenDianSyS`"
            then
Samuel Hocevar's avatar
 
Samuel Hocevar committed
            fi
            if test "`strings conftest.o | grep LiTTleEnDian`"
            then
Samuel Hocevar's avatar
 
Samuel Hocevar committed
            fi
          fi
        fi
      ])
      if test "${ac_cv_c_bigendian}" = "unknown"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
      then
        AC_MSG_ERROR([Could not guess endianness, please use --with-words])
      fi
      ;;
  esac
dnl  Now we know what to use for endianness, just put it in the header
Samuel Hocevar's avatar
 
Samuel Hocevar committed
then
  AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
fi
dnl
dnl  Microsoft ActiveX support
dnl
activex=false
AC_ARG_ENABLE(activex,
  [  --enable-activex        build a vlc-based ActiveX control (default enabled on Win32)])
if test "${enable_activex}" != "no"
then
  if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
  then
    AC_CHECK_PROGS(MIDL, [midl widl], no)
    AC_CHECK_HEADERS(ole2.h olectl.h,
      [ VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
        VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) 
        AC_CHECK_HEADERS(objsafe.h,
          VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER])
        )
      ],
      [ AC_MSG_ERROR([required OLE headers are missing from your system]) ]
    )
  fi
fi
AC_ARG_VAR(MIDL, [Microsoft IDL compiler (Win32 platform only)])
AM_CONDITIONAL(HAS_MIDL_COMPILER, test "${MIDL}" != "no")
AM_CONDITIONAL(BUILD_ACTIVEX,${activex})
AC_ARG_ENABLE(mozilla,
  [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
gbazin's avatar
 
gbazin committed
if test "${enable_mozilla}" = "yes" -a "${SYS}" != "mingw32"
then
  AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
  if test "${MOZILLA_CONFIG}" = "no"
    AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
  else
    if test "${SYS}" != "mingw32"; then
      LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
Samuel Hocevar's avatar
Samuel Hocevar committed
      AC_CHECK_LIB(Xt,XtStrings,
       [VLC_ADD_LDFLAGS([mozilla],[-L${x_libraries} -lXt -lX11 -lSM -lICE])],
Samuel Hocevar's avatar
Samuel Hocevar committed
       [],
       [[-L${x_libraries} -lX11 -lSM -lICE]
    dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
    VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`]])
    VLC_ADD_LDFLAGS([mozilla],[`${MOZILLA_CONFIG} --libs plugin xpcom`])
Samuel Hocevar's avatar
Samuel Hocevar committed
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
    AC_CHECK_HEADERS(mozilla-config.h)
    CPPFLAGS="${CPPFLAGS_save}"
gbazin's avatar
 
gbazin committed

dnl special case for mingw32
elif test "${enable_mozilla}" = "yes"
then
  AC_CHECK_TOOL(CYGPATH, cygpath, "")
gbazin's avatar
 
gbazin committed
  AC_ARG_WITH(mozilla-sdk-path,
    [    --with-mozilla-sdk-path=PATH path to win32 mozilla sdk], [
    real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
gbazin's avatar
 
gbazin committed
    CPPFLAGS="${CPPFLAGS_save} ${real_mozilla_sdk}"
    AC_CHECK_HEADERS(mozilla-config.h, [
gbazin's avatar
 
gbazin committed
      mozilla=:
      VLC_ADD_CPPFLAGS([mozilla],[-DXPCOM_GLUE -I${real_mozilla_sdk} -I${real_mozilla_sdk}/embedstring/include -I${real_mozilla_sdk}/xpcom/include -I${real_mozilla_sdk}/nspr/include -I${real_mozilla_sdk}/string/include -I${real_mozilla_sdk}/plugin/include -I${real_mozilla_sdk}/java/include])
      VLC_ADD_LDFLAGS([mozilla],[-L${real_mozilla_sdk}/embedstring/bin -L${real_mozilla_sdk}/xpcom/bin -L${real_mozilla_sdk}/nspr/bin -L${real_mozilla_sdk}/string/bin -lnspr4 -lplds4 -lplc4 -lembedstring -lxpcomglue -Wl,--kill-at])
      XPIDL_INCL="-I${real_mozilla_sdk}/xpcom/idl"
      if test -n "${CYGPATH}"; then
        XPIDL="${real_mozilla_sdk}/xpcom/bin/xpidl"
        real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
        XPIDL_INCL="${XPIDL_INCL} -I\"${real_mozilla_sdk}/xpcom/idl\""
gbazin's avatar
 
gbazin committed
    CPPFLAGS="${CPPFLAGS_save}"
gbazin's avatar
 
gbazin committed
  ])
fi

dnl Not necessarily in ${PATH}
if test -z "${XPIDL}" -o ! -x "${XPIDL}"; then
  XPIDL="/usr/lib/mozilla/xpidl"
if test -z "${XPIDL_INCL}"; then
  XPIDL_INCL="`${MOZILLA_CONFIG} --cflags plugin xpcom java` \
 `${MOZILLA_CONFIG} --idlflags plugin xpcom java` "
fi
AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
dnl
dnl  test plugins
dnl
AC_ARG_ENABLE(testsuite,
  [  --enable-testsuite      build test modules (default disabled)])
if test "${enable_testsuite}" = "yes"
  dnl  we define those so that bootstrap sets the right linker
  VLC_ADD_CXXFLAGS([test2],[])
  VLC_ADD_OBJCFLAGS([test3],[])
  dnl  this one is needed until automake knows what to do
  VLC_ADD_LDFLAGS([test3],[-lobjc])
  VLC_ADD_PLUGINS([${TESTS}])
  #VLC_ADD_BUILTINS([${TESTS}])
if test "${NEED_GTK_MAIN}" != "no"
    VLC_ADD_PLUGINS([gtk_main])
    VLC_ADD_CFLAGS([gtk_main],[${CFLAGS_gtk}])
    VLC_ADD_LDFLAGS([gtk_main],[${LDFLAGS_gtk}])
if test "${NEED_GNOME_MAIN}" != "no"
    VLC_ADD_PLUGINS([gnome_main])
    VLC_ADD_CFLAGS([gnome_main],[${CFLAGS_gtk} ${CFLAGS_gnome}])
    VLC_ADD_LDFLAGS([gnome_main],[${LDFLAGS_gtk} ${LDFLAGS_gnome}])
if test "${NEED_GTK2_MAIN}" != "no"
    VLC_ADD_PLUGINS([gtk2_main])
    VLC_ADD_CFLAGS([gtk2],[-DNEED_GTK2_MAIN])
    VLC_ADD_CFLAGS([pda],[-DNEED_GTK2_MAIN])
    VLC_ADD_CFLAGS([gtk2_main],[${CFLAGS_gtk2} ${CFLAGS_pda}])
    VLC_ADD_LDFLAGS([gtk2_main],[${LDFLAGS_gtk2} ${LDFLAGS_pda}])
if test "${NEED_GNOME2_MAIN}" != "no"
    VLC_ADD_PLUGINS([gnome2_main])
    VLC_ADD_CFLAGS([gnome2_main],[${CFLAGS_gtk2} ${CFLAGS_gnome2}])
    VLC_ADD_LDFLAGS([gnome2_main],[${LDFLAGS_gtk2} ${LDFLAGS_gnome2}])
if test "${NEED_QTE_MAIN}" != "no"
    VLC_ADD_PLUGINS([qte_main])
    VLC_ADD_CXXFLAGS([opie qte qt_video],[-DNEED_QTE_MAIN])
    VLC_ADD_CXXFLAGS([qte_main],[${CXXFLAGS_qte} ${CXXFLAGS_qt_video}])
    VLC_ADD_LDFLAGS([qte_main],[${LDFLAGS_qte} ${LDFLAGS_qt_video}])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
builtin_support=false
plugin_support=:

dnl Support for plugins - this must be AT THE END
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(plugins,
  [  --disable-plugins       make all plugins built-in (default plugins enabled)],
  [if test "${enable_plugins}" = "no"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
   then
Samuel Hocevar's avatar
 
Samuel Hocevar committed
   fi])

dnl Automagically disable plugins if there is no system support for
dnl dynamically loadable files (.so, .dll, .dylib).
dnl don't forget vlc-win32 still can load .dll as plugins
Samuel Hocevar's avatar
Samuel Hocevar committed
if test "${ac_cv_have_plugins}" = "no"
  echo "*** Your system doesn't have plugin support. All plugins will be built"
  echo "statically."
  plugin_support=false
fi

dnl Export automake variables
if ${plugin_support}
then
  for plugin in `echo ${PLUGINS}`
  do
    eval "${plugin}_p=yes"
  VLC_ADD_BUILTINS([${PLUGINS}])
Samuel Hocevar's avatar
Samuel Hocevar committed
  PLUGINS=""
AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})

[if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
then
  builtin_support=:
  for builtin in `echo ${BUILTINS}`
  do
    eval "${builtin}_b=yes"
  done
fi]
AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl Import conditional variables generated by bootstrap
VLC_CONDITIONALS
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  Stuff used by the program
dnl
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2005 VideoLAN", [Copyright string])
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

DATA_PATH="${ac_tool_prefix}/share/vlc"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_SUBST(DATA_PATH)
PLUGIN_PATH="${ac_tool_prefix}/lib/vlc"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_SUBST(PLUGIN_PATH)

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl  Handle substvars that use $(top_srcdir)
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
VLC_CONFIG="top_builddir=\"\$(top_builddir)\" \$(top_builddir)/vlc-config"
Samuel Hocevar's avatar
Samuel Hocevar committed
AC_SUBST(VLC_CONFIG)
CPPFLAGS_save="${CPPFLAGS_save} -I\$(top_srcdir)/include"
Samuel Hocevar's avatar
Samuel Hocevar committed
dnl  Restore *FLAGS
VLC_RESTORE_FLAGS
Samuel Hocevar's avatar
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtin}"
for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Configuration is finished
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_SUBST(ASM)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_SUBST(MOC)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_SUBST(WINDRES)
gbazin's avatar
 
gbazin committed
AC_SUBST(XPIDL_INCL)
gbazin's avatar
 
gbazin committed
AC_SUBST(ALL_LINGUAS)
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl Import substitutions generated by bootstrap
VLC_SUBSTS
Samuel Hocevar's avatar
Samuel Hocevar committed

dnl Create vlc-config.in
VLC_OUTPUT_VLC_CONFIG_IN
  activex/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  m4/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/access/Makefile
gbazin's avatar
 
gbazin committed
  modules/access/dshow/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/access/mms/Makefile
  modules/access/pvr/Makefile
  modules/access/satellite/Makefile
  modules/access/v4l/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/access/vcd/Makefile
gbazin's avatar
 
gbazin committed
  modules/access/vcdx/Makefile
  modules/access/screen/Makefile
  modules/access_filter/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/access_output/Makefile
  modules/audio_filter/Makefile
  modules/audio_filter/channel_mixer/Makefile
  modules/audio_filter/converter/Makefile
  modules/audio_filter/resampler/Makefile
  modules/audio_mixer/Makefile
  modules/audio_output/Makefile
  modules/codec/Makefile
  modules/codec/cmml/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/codec/ffmpeg/Makefile
  modules/codec/spudec/Makefile
  modules/control/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/demux/Makefile
  modules/demux/asf/Makefile
  modules/demux/avi/Makefile
  modules/demux/mp4/Makefile
  modules/demux/mpeg/Makefile
  modules/demux/playlist/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/demux/util/Makefile
  modules/gui/Makefile
  modules/gui/beos/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/gui/gtk/Makefile
  modules/gui/gtk2/Makefile
  modules/gui/kde/Makefile
  modules/gui/macosx/Makefile
  modules/gui/qnx/Makefile
  modules/gui/qt/Makefile
  modules/gui/skins2/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/gui/wxwindows/Makefile
  modules/gui/wince/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/misc/Makefile
  modules/misc/dummy/Makefile
  modules/misc/memcpy/Makefile
  modules/misc/network/Makefile
  modules/misc/testsuite/Makefile
  modules/misc/playlist/Makefile
gbazin's avatar
gbazin committed
  modules/misc/xml/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/mux/Makefile
  modules/mux/mpeg/Makefile
  modules/packetizer/Makefile
  modules/services_discovery/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/stream_out/Makefile
  modules/stream_out/transrate/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/video_chroma/Makefile
  modules/video_filter/Makefile
  modules/video_filter/swscale/Makefile
Samuel Hocevar's avatar
Samuel Hocevar committed
  modules/video_output/Makefile
  modules/video_output/directx/Makefile
  modules/video_output/qte/Makefile
  modules/video_output/x11/Makefile
  modules/visualization/Makefile
  modules/visualization/visual/Makefile
  modules/visualization/galaktos/Makefile
dnl Generate makefiles
AC_OUTPUT

# Cannot use AC_CONFIG_FILES([vlc-config]) as is automatically built,
# not provided with the source
${SHELL} ./config.status --file=vlc-config
chmod 0755 vlc-config

Samuel Hocevar's avatar
 
Samuel Hocevar committed
vlc configuration
Samuel Hocevar's avatar
 
Samuel Hocevar committed
--------------------
Samuel Hocevar's avatar
 
Samuel Hocevar committed
vlc version           : ${VERSION}
Samuel Hocevar's avatar
 
Samuel Hocevar committed
system                : ${SYS}
architecture          : ${ARCH}
Samuel Hocevar's avatar
Samuel Hocevar committed
test "${enable_debug}" = "yes" && printf "debug "
test "${enable_cprof}" = "yes" && printf "cprof "
test "${enable_gprof}" = "yes" && printf "gprof "
test "${enable_optimizations}" = "yes" && printf "optim "
test "${enable_release}" = "yes" && printf "release " || printf "devel "
Samuel Hocevar's avatar
 
Samuel Hocevar committed
vlc aliases           :${ALIASES}
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
Samuel Hocevar committed
You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type \`make'.
Samuel Hocevar's avatar
 
Samuel Hocevar committed
"