Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Added plugin skel
Browse files Browse the repository at this point in the history
svn path=/trunk/moon-mp/; revision=122023
  • Loading branch information
abock committed Dec 23, 2008
1 parent 7e68e56 commit 97767cb
Show file tree
Hide file tree
Showing 15 changed files with 2,110 additions and 0 deletions.
Empty file added plugin/AUTHORS
Empty file.
Empty file added plugin/COPYING
Empty file.
Empty file added plugin/ChangeLog
Empty file.
16 changes: 16 additions & 0 deletions plugin/Makefile.am
@@ -0,0 +1,16 @@
SUBDIRS = src

MAINTAINERCLEANFILES = \
compile \
INSTALL \
config.h.in \
aclocal.m4 \
ltmain.sh \
Makefile.in \
depcomp \
missing \
install-sh \
configure \
config.sub \
config.guess \
mkinstalldirs
Empty file added plugin/NEWS
Empty file.
Empty file added plugin/README
Empty file.
153 changes: 153 additions & 0 deletions plugin/autogen.sh
@@ -0,0 +1,153 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
# Ripped off from GNOME macros version

DIE=0

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

if [ -n "$MONO_PATH" ]; then
# from -> /mono/lib:/another/mono/lib
# to -> /mono /another/mono
for i in `echo ${MONO_PATH} | tr ":" " "`; do
i=`dirname ${i}`
if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
fi
if [ -n "{i}" -a -d "${i}/bin" ]; then
PATH="${i}/bin:$PATH"
fi
done
export PATH
fi

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to compile Mono."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}

if [ -z "$LIBTOOL" ]; then
LIBTOOL=`which glibtool 2>/dev/null`
if [ ! -x "$LIBTOOL" ]; then
LIBTOOL=`which libtool`
fi
fi

(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}

grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed to compile Mono."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}

(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
NO_AUTOMAKE=yes
}


# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}

if test "$DIE" -eq 1; then
exit 1
fi

if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi

case $CC in
xlc )
am_opt=--include-deps;;
esac


if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
${LIBTOOL}ize --force --copy
fi
fi

echo "Running aclocal $ACLOCAL_FLAGS ..."
aclocal $ACLOCAL_FLAGS || {
echo
echo "**Error**: aclocal failed. This may mean that you have not"
echo "installed all of the packages you need, or you may need to"
echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
echo "for the prefix where you installed the packages whose"
echo "macros were not found"
exit 1
}

if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
echo "Running autoheader..."
autoheader || { echo "**Error**: autoheader failed."; exit 1; }
fi

echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt ||
{ echo "**Error**: automake failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }

if test -d $srcdir/libgc; then
echo Running libgc/autogen.sh ...
(cd $srcdir/libgc ; NOCONFIGURE=1 ./autogen.sh "$@")
echo Done running libgc/autogen.sh ...
fi

if test -d $srcdir/pixman; then
echo Running pixman/autogen.sh ...
(cd $srcdir/pixman ; ./autogen.sh "$@")
echo Done running pixman/autogen.sh ...
fi

if test -d $srcdir/cairo; then
echo Running cairo/autogen.sh ...
(cd $srcdir/cairo ; ./autogen.sh "$@")
echo Done running cairo/autogen.sh ...
fi

conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c

if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
else
echo Skipping configure process.
fi
180 changes: 180 additions & 0 deletions plugin/configure.ac
@@ -0,0 +1,180 @@
AC_INIT([moon-mp-plugin],[0.1])
AC_CONFIG_SRCDIR(README)
AC_CANONICAL_SYSTEM

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([tar-ustar])
AM_MAINTAINER_MODE

AC_PROG_CXX
AC_HEADER_STDC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

PKG_PROG_PKG_CONFIG

dnl
dnl Mozilla checks
dnl
with_mozilla=no

AC_ARG_WITH(ff3,[ --with-ff3=no,yes If you want to enable the xulrunner 1.9 (Firefox 3) bridge],[],[with_ff3=yes])
if test x$with_ff3 = xyes; then
FF3_MODULES="libxul-unstable mozilla-plugin mozilla-js"

PKG_CHECK_EXISTS($FF3_MODULES,
[with_ff3=yes],
[with_ff3=no
ff3_reason="(reason: missing FF3 development packages)"])

if test x$with_ff3 = xyes; then
AC_DEFINE([HAVE_GECKO_1_9],[1],[Gecko 1.9 support])
PKG_CHECK_MODULES(FF3, [$FF3_MODULES])
dnl Strip out problem libraries (should already be in process space)
FF3_LIBS="$(echo $FF3_LIBS | sed -e 's/-lmozjs\|-lplds4\|-lplc4\|-lnspr4//g')"
fi
fi
AM_CONDITIONAL(HAVE_GECKO_1_9,test x$with_ff3 = xyes)

AC_ARG_WITH(ff2,[ --with-ff2=no,yes If you want to enable the xulrunner 1.8.1 (Firefox 2)],[],[with_ff2=yes])
if test x$with_ff2 = xyes; then
mozilla_xpcom="libxul-missing"
mozilla_xpcom_pcs="xpcom mozilla-xpcom firefox-xpcom xulrunner-xpcom"
for pc in $mozilla_xpcom_pcs; do
PKG_CHECK_EXISTS($pc,[mozilla_xpcom=$pc])
done
mozilla_plugin="plugin-missing"
mozilla_plugin_pcs="plugin firefox-plugin xulrunner-plugin"
for pc in $mozilla_plugin_pcs; do
PKG_CHECK_EXISTS($pc,[mozilla_plugin=$pc])
done

if test $mozilla_xpcom = "libxul-missing" -o $mozilla_plugin = "plugin-missing"; then
with_ff2=no
ff2_reason="(reason: missing FF2 development packages)"
else
PKG_CHECK_MODULES(FF2,[$mozilla_xpcom $mozilla_plugin])
dnl Strip out problem libraries (should already be in process space)
FF2_LIBS="$(echo $FF2_LIBS | sed -e 's/-lmozjs\|-lplds4\|-lplc4\|-lnspr4//g')"
fi
fi
AM_CONDITIONAL(HAVE_GECKO_1_8,test x$with_ff2 = xyes)

if test x$with_ff2 = xyes; then
with_mozilla=yes
MIN_FIREFOX_VERSION="1.5"
if test x$with_ff3 = xyes; then
MAX_FIREFOX_VERSION="3.0.*"
else
MAX_FIREFOX_VERSION="2.0.0.*"
fi
else
if test x$with_ff3 = xyes; then
with_mozilla=yes
MIN_FIREFOX_VERSION="2.9.*"
MAX_FIREFOX_VERSION="3.0.*"
fi
fi
AC_SUBST([MIN_FIREFOX_VERSION])
AC_SUBST([MAX_FIREFOX_VERSION])
AM_CONDITIONAL(HAVE_MOZILLA, test x$with_mozilla = xyes)

dnl
dnl glib
dnl
PKG_CHECK_MODULES(GLIB,glib-2.0)

dnl
dnl plugin checks
dnl
AC_ARG_ENABLE(user-plugin,[ --enable-user-plugin Build the plugin installer],
[user_plugin=yes
AC_DEFINE([PLUGIN_INSTALL],[1],[Load libraries from ~/.mozilla/plugins and build a Mozilla XPInstall file])
],
[user_plugin=no
])
AM_CONDITIONAL([PLUGIN_INSTALL],[test x$user_plugin = xyes])

if test x$user_plugin = xyes; then
if test x$with_ff3 = xno -a x$with_ff2 = xno; then
AC_MSG_ERROR([Building the plugin installer requires Firefox2 or Firefox3 support.])
fi
case "$target_os" in
*linux* )
TARGET_PLATFORM="Linux"
;;
* )
AC_MSG_ERROR([Target os $target_os is unknown.
Please add the appropriate string to configure.ac.
See http://developer.mozilla.org/en/docs/OS_TARGET])
;;
esac

case "$target_cpu" in
i*86 )
TARGET_PLATFORM="$TARGET_PLATFORM"_x86-gcc3
INSTALL_ARCH=i586
;;
x86_64 )
TARGET_PLATFORM="$TARGET_PLATFORM"_x86_64-gcc3
INSTALL_ARCH=x86_64
;;
powerpc )
TARGET_PLATFORM="$TARGET_PLATFORM"_ppc-gcc3
INSTALL_ARCH=ppc
;;
sparc64 )
TARGET_PLATFORM="$TARGET_PLATFORM"_sparc64-gcc3
INSTALL_ARCH=sparc
;;
* )
AC_MSG_ERROR([Target cpu $target_cpu is unknown.
Please add the appropriate string to configure.ac.
See http://developer.mozilla.org/en/docs/XPCOM_ABI])
;;
esac
AC_SUBST(TARGET_PLATFORM)
AC_SUBST([INSTALL_ARCH])
fi

if test x$with_ff3 = xyes; then
MOZILLA_CFLAGS=$FF3_CFLAGS
else
MOZILLA_CFLAGS=$FF2_CFLAGS
fi

AC_SUBST(MOZILLA_CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)

AC_OUTPUT([
Makefile
src/Makefile
])

# general configuration info
cat <<EOF

Moonlight Media Player configuration
====================================
EOF

# plugin installer/bridge info
cat <<EOF

Browser Support:
Firefox: $with_mozilla
EOF

if test x$with_mozilla = xyes; then
cat <<EOF
Plugin Installer (.xpi): $user_plugin
Gecko 1.8 (Firefox 2): $with_ff2 $ff2_reason
Gecko 1.9 (Firefox 3): $with_ff3 $ff3_reason
EOF
fi

# blank line
cat <<EOF

EOF
25 changes: 25 additions & 0 deletions plugin/src/Makefile.am
@@ -0,0 +1,25 @@
INCLUDES = \
-I$(srcdir)/moz-sdk \
$(MOZILLA_CFLAGS) \
$(GLIB_CFLAGS)
-Wall

mpplugindir=$(libdir)/browser-plugins
mpplugin_LTLIBRARIES = libmoonmp-plugin.la

libmoonmp_plugin_la_LDFLAGS = \
-avoid-version \
-export-symbols $(srcdir)/export-symbols \
-module

libmoonmp_plugin_la_LIBADD = $(GLIB_LIBS)

libmoonmp_plugin_la_SOURCES = \
plugin-entry.cpp

test-plugin:
mkdir -p ~/.mozilla/plugins
rm -f ~/.mozilla/plugins/libmoonmp-plugin.so
cp .libs/libmoonmp-plugin.so ~/.mozilla/plugins

MAINTAINERCLEANFILES = Makefile.in
4 changes: 4 additions & 0 deletions plugin/src/export-symbols
@@ -0,0 +1,4 @@
NP_GetMIMEDescription
NP_GetValue
NP_Initialize
NP_Shutdown

0 comments on commit 97767cb

Please sign in to comment.