Newer
Older
fi
mozilla=:
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`])
CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
AC_CHECK_HEADERS(mozilla-config.h)
CPPFLAGS="${CPPFLAGS_save}"
XPIDL_INCL="`${MOZILLA_CONFIG} --cflags plugin xpcom java` \
`${MOZILLA_CONFIG} --idlflags plugin xpcom java` "
xpidl_path="`${MOZILLA_CONFIG} --prefix`/bin"
fi
dnl special case for mingw32
if test "${SYS}" = "mingw32"
then
AC_CHECK_TOOL(CYGPATH, cygpath, "")
dnl latest gecko sdk does not have an xpcom directory
if test -d "${with_mozilla_sdk_path}/xpcom"; then
mozilla_sdk_xpcom="/xpcom"
fi
Samuel Hocevar
committed
fi
real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
CPPFLAGS="${CPPFLAGS_save} -I${real_mozilla_sdk} -I${real_mozilla_sdk}/include"
AC_CHECK_HEADERS(mozilla-config.h, [
mozilla=:
VLC_ADD_CPPFLAGS([mozilla],[-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX -I${real_mozilla_sdk} -I${real_mozilla_sdk}/include -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 -L${real_mozilla_sdk}/lib -lnspr4 -lplds4 -lplc4 -lxpcomglue])
if test "${SYS}" = "mingw32"; then
dnl latest gecko sdk does not have embedstring
if test -d "${real_mozilla_sdk}/embedstring/bin"
then
VLC_ADD_LDFLAGS([mozilla],[-lembedstring -Wl,--kill-at])
fi
fi
XPIDL_INCL="-I${real_mozilla_sdk}${mozilla_sdk_xpcom}/idl"
xpidl_path="${real_mozilla_sdk}${mozilla_sdk_xpcom}/bin"
if test -n "${CYGPATH}"; then
real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
XPIDL_INCL="${XPIDL_INCL} -I\"${real_mozilla_sdk}${mozilla_sdk_xpcom}/idl\""
fi ])
fi
if test "${mozilla}" != "false"
then
build_pic=yes
AC_PATH_PROG(XPIDL, xpidl, no, ${xpidl_path} /usr/lib/mozilla)
if test "${XPIDL}" = "no"; then
AC_MSG_ERROR([Please install the Mozilla development tools, xpidl was not found.])
fi

Rémi Denis-Courmont
committed
fi
AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
AC_ARG_ENABLE(mediacontrol-python-bindings,
[ --enable-mediacontrol-python-bindings Enable Python bindings for MediaControl (default disabled)])
dnl TODO: look for python dev headers
AM_CONDITIONAL(BUILD_PYTHON, [test "${enable_mediacontrol_python_bindings}" = "yes"])
if test "${enable_mediacontrol_python_bindings}" = "yes"
then
build_pic=yes
fi
dnl
dnl Java bindings
dnl
AC_ARG_ENABLE(java-bindings,
[ --enable-java-bindings Enable Java bindings (default disabled)])
AM_CONDITIONAL(BUILD_JAVA, [test "${enable_java_bindings}" = "yes"])
if test "${enable_java_bindings}" = "yes"
then
build_pic=yes
fi
dnl
dnl test plugins
dnl
AC_ARG_ENABLE(testsuite,
[ --enable-testsuite build test modules (default disabled)])
Samuel Hocevar
committed
TESTS="test1 test2 test3 test4"
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
Samuel Hocevar
committed
VLC_ADD_PLUGINS([${TESTS}])
#VLC_ADD_BUILTINS([${TESTS}])
fi
Samuel Hocevar
committed
dnl
dnl gtk_main plugin
dnl
Samuel Hocevar
committed
then
VLC_ADD_PLUGINS([gtk_main])
VLC_ADD_CFLAGS([gtk_main],[${CFLAGS_gtk}])
VLC_ADD_LDFLAGS([gtk_main],[${LDFLAGS_gtk}])
Samuel Hocevar
committed
fi
Samuel Hocevar
committed
then
VLC_ADD_PLUGINS([gnome_main])
VLC_ADD_CFLAGS([gnome_main],[${CFLAGS_gtk} ${CFLAGS_gnome}])
VLC_ADD_LDFLAGS([gnome_main],[${LDFLAGS_gtk} ${LDFLAGS_gnome}])
Samuel Hocevar
committed
fi
then
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}])
fi
then
VLC_ADD_PLUGINS([gnome2_main])
VLC_ADD_CFLAGS([gnome2_main],[${CFLAGS_gtk2} ${CFLAGS_gnome2}])
VLC_ADD_LDFLAGS([gnome2_main],[${LDFLAGS_gtk2} ${LDFLAGS_gnome2}])
fi

Jean-Paul Saman
committed
dnl
dnl qte_main plugin
dnl

Jean-Paul Saman
committed
then
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}])

Jean-Paul Saman
committed
fi
Samuel Hocevar
committed
dnl Plugin and builtin checks
Samuel Hocevar
committed
builtin_support=false
plugin_support=:
dnl Support for plugins - this must be AT THE END
Samuel Hocevar
committed
[ --disable-plugins make all plugins built-in (default plugins enabled)],
Samuel Hocevar
committed
plugin_support=false
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
committed
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
AC_DEFINE(HAVE_DYNAMIC_PLUGINS, 1, Define if we have support for dynamic plugins)
Samuel Hocevar
committed
for plugin in `echo ${PLUGINS}`
do
Samuel Hocevar
committed
done
else
Samuel Hocevar
committed
AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})
[if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
then
builtin_support=:
for builtin in `echo ${BUILTINS}`
do
Samuel Hocevar
committed
done
fi]
AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
dnl
dnl Pic and shared libvlc stuff
dnl
AS_IF([test "x${shared_libvlc}" = "x"], [shared_libvlc=no])
AM_CONDITIONAL(BUILD_SHARED, [test "${shared_libvlc}" != "no"])
AM_CONDITIONAL(BUILD_PIC, [test "${build_pic}" = "yes" -o "${shared_libvlc}" != "no"] )
AS_IF([test "${shared_libvlc}" != "no"], [
AC_DEFINE(HAVE_SHARED_LIBVLC, 1, [Define to 1 if libvlc is built as a shared library.])
])
pic=no
AS_IF([test "${shared_libvlc}" != "no" -o "${build_pic}" = "yes"], [pic=pic])
AS_IF([test "${SYS}" = "mingw32"], [pic=no])
AS_IF([test "${pic}" = "no"], [pic=])
AC_SUBST(pic)
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VLC media player - version ${VERSION} ${CODENAME} - (c) 1996-2006 the VideoLAN team", [Copyright string])
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR,"${VERSION_MAJOR}", [version major number])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR,"${VERSION_MINOR}", [version minor number])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION_REVISION,"${VERSION_REVISION}", [version minor number])
AC_DEFINE_UNQUOTED(PACKAGE_VERSION_EXTRA,"${VERSION_EXTRA}", [version minor number])

Rémi Denis-Courmont
committed
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
Christophe Massiot
committed
AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami`", [user who ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILE_DOMAIN, "`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`", [domain of the host which ran configure])
AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler])
dnl Old definitions for version-dependant plugins
dnl VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
Christophe Massiot
committed
dnl New definitions with value matching 0.8.4 release
module_symbol="0_8_4"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions])
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions])
VLC_CONFIG="top_builddir=\"\$(top_builddir)\" \$(top_builddir)/vlc-config"
AC_SUBST(VLC_CONFIG)
CPPFLAGS_save="${CPPFLAGS_save} -I\$(top_srcdir)/include"
Samuel Hocevar
committed
dnl
Samuel Hocevar
committed
dnl
dnl
dnl Create the vlc-config script
dnl
Samuel Hocevar
committed
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
committed
dnl
AC_SUBST(SYS)
AC_SUBST(ARCH)
AC_SUBST(ALIASES)
Samuel Hocevar
committed
AC_SUBST(XPIDL)
Samuel Hocevar
committed
AC_SUBST(LIBEXT)
AC_SUBST(INCLUDES)
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
Samuel Hocevar
committed
AC_CONFIG_FILES([
Makefile
activex/axvlc.inf
Samuel Hocevar
committed
debian/Makefile
doc/Makefile
intl/Makefile
Samuel Hocevar
committed
ipkg/Makefile
Samuel Hocevar
committed
modules/Makefile
mozilla/Makefile
po/Makefile.in
Samuel Hocevar
committed
share/Makefile
])
AC_CONFIG_FILES([
modules/access/dvb/Makefile
modules/access/mms/Makefile
modules/access/pvr/Makefile
modules/access/v4l/Makefile
modules/access/cdda/Makefile
modules/access/screen/Makefile
modules/access_filter/Makefile
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
modules/codec/dmo/Makefile
modules/codec/ffmpeg/Makefile
modules/codec/spudec/Makefile
modules/control/Makefile
modules/control/http/Makefile
modules/control/corba/Makefile
modules/demux/Makefile
modules/demux/asf/Makefile
modules/demux/avi/Makefile
modules/demux/mp4/Makefile
modules/demux/mpeg/Makefile
modules/demux/util/Makefile
modules/gui/Makefile
modules/gui/beos/Makefile

Jean-Paul Saman
committed
modules/gui/pda/Makefile
modules/gui/macosx/Makefile
modules/gui/qnx/Makefile
modules/gui/skins2/Makefile
modules/gui/wxwidgets/Makefile
modules/gui/wince/Makefile
modules/misc/Makefile
modules/misc/dummy/Makefile
modules/misc/memcpy/Makefile
modules/misc/network/Makefile
modules/misc/testsuite/Makefile
modules/mux/Makefile
modules/mux/mpeg/Makefile
modules/packetizer/Makefile
modules/stream_out/transrate/Makefile
modules/video_chroma/Makefile
modules/video_filter/Makefile
modules/video_filter/swscale/Makefile
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
dnl echo "Enabled builtin modules :"
dnl for a in `./vlc-config --target builtin` ; do echo $a; done | sed -e 's,modules\/\(.*\)\/lib\(.*\)\.a,\2 (\1),'
dnl echo "Enabled plugin modules :"
dnl for a in `./vlc-config --target plugin` ; do echo $a; done | sed -e 's,modules\/\(.*\)\/lib\(.*\)_plugin,\2 (\1),'
Christophe Mutricy
committed
dnl Shortcut to nice compile message
rm -f compile
echo '#! /bin/sh' >compile
echo "PATH=$PATH LANG=C make \$* 2>&1| \\" >> compile
echo '`sed -ne "s/^top_srcdir *= *//p" < Makefile`/extras/make.pl' >> compile
Christophe Mutricy
committed
chmod a+x compile
Samuel Hocevar
committed
printf "
Samuel Hocevar
committed
build flavour : "
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
committed
echo "
Christophe Mutricy
committed
To build vlc and its plugins, type \`./compile' or \`make'.